This commit is contained in:
2026-06-05 08:51:12 +08:00
parent 133a2bd223
commit a3edf3275d
3 changed files with 19 additions and 5 deletions

View File

@@ -116,7 +116,9 @@ public class InitThread implements ApplicationRunner {
Long orgId = x.getOrgId();
Long siteId = x.getSiteId();
SiteMemory siteMemory = GlobalMemory.getSiteMemory(orgId, siteId);
siteMemory.addDevicePlan(x);
if(siteMemory!=null){
siteMemory.addDevicePlan(x);
}
});
}
@@ -129,7 +131,9 @@ public class InitThread implements ApplicationRunner {
Long orgId = x.getOrgId();
Long siteId = x.getSiteId();
SiteMemory siteMemory = GlobalMemory.getSiteMemory(orgId, siteId);
siteMemory.addDevicePlanPrepare(x);
if(siteMemory!=null){
siteMemory.addDevicePlanPrepare(x);
}
});
}
@@ -141,7 +145,9 @@ public class InitThread implements ApplicationRunner {
Long orgId = x.getOrgId();
Long siteId = x.getSiteId();
SiteMemory siteMemory = GlobalMemory.getSiteMemory(orgId, siteId);
siteMemory.addDevicePlanExecute(x);
if(siteMemory!=null){
siteMemory.addDevicePlanExecute(x);
}
});
}

View File

@@ -175,8 +175,16 @@ public class DeviceTaskService {
public int delete(Long id) {
DevicePlan planTask = devicePlanMapper.selectById(id);
if (planTask != null) {
if (planTask.getOrgId() == null) {
SysSite site = sysSiteMapper.selectById(planTask.getSiteId());
if (site != null) {
planTask.setOrgId(site.getOrgId());
}
}
SiteMemory siteMemory = GlobalMemory.getSiteMemory(planTask.getOrgId(), planTask.getSiteId());
siteMemory.removeDevicePlan(planTask);
if (siteMemory != null) {
siteMemory.removeDevicePlan(planTask);
}
return devicePlanMapper.deleteById(id);
}
return 0;

View File

@@ -53,7 +53,7 @@ public class SysUserClientServiceImpl implements ISysUserClientService {
}
@Override
public int updateAliveStatus(String clientName, String deviceName, int isAlive) {
public synchronized int updateAliveStatus(String clientName, String deviceName, int isAlive) {
int i = userClientMapper.updateAliveStatus(clientName, deviceName, isAlive);
if (i > 0) {
return i;