#update
This commit is contained in:
@@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user