update
This commit is contained in:
@@ -16,15 +16,21 @@ import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import com.maibu.constant.FastBeeConstant;
|
||||
import com.maibu.core.business.AlarmOrderConfig;
|
||||
import com.maibu.core.business.DevicePlan;
|
||||
import com.maibu.core.business.DevicePlanTask;
|
||||
import com.maibu.core.business.DeviceRunParam;
|
||||
import com.maibu.core.business.ErrorIdentificationStandard;
|
||||
import com.maibu.core.business.OrderModel;
|
||||
import com.maibu.core.domain.entity.SysSite;
|
||||
import com.maibu.core.enums.DeviceTaskStaus;
|
||||
import com.maibu.influxdb.util.InfluxDBUtil;
|
||||
import com.maibu.mapper.AlarmOrderConfigMapper;
|
||||
import com.maibu.mapper.DevicePlanMapper;
|
||||
import com.maibu.mapper.DevicePlanTaskMapper;
|
||||
import com.maibu.mapper.DeviceRunParamMapper;
|
||||
import com.maibu.mapper.ErrorIdentificationStandardMapper;
|
||||
import com.maibu.mapper.OrderModelMapper;
|
||||
import com.maibu.mapper.SysSiteMapper;
|
||||
import com.maibu.memory.GlobalMemory;
|
||||
import com.maibu.memory.SiteMemory;
|
||||
@@ -63,6 +69,12 @@ public class InitThread implements ApplicationRunner {
|
||||
|
||||
@Autowired
|
||||
private DeviceRunParamMapper deviceRunParamMapper;
|
||||
@Autowired
|
||||
private ErrorIdentificationStandardMapper errorIdentificationStandardMapper;
|
||||
@Autowired
|
||||
private OrderModelMapper orderModelMapper;
|
||||
@Autowired
|
||||
private AlarmOrderConfigMapper alarmOrderConfigMapper;
|
||||
|
||||
@Value("${influxdb.url}")
|
||||
private String influxDBUrl;
|
||||
@@ -157,6 +169,43 @@ public class InitThread implements ApplicationRunner {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
List<ErrorIdentificationStandard> standadList = errorIdentificationStandardMapper.selectList();
|
||||
if (!CollectionUtils.isEmpty(standadList)) {
|
||||
standadList.forEach(x -> {
|
||||
Long orgId = x.getOrgId();
|
||||
Long siteId = x.getId();
|
||||
SiteMemory siteMemory = GlobalMemory.getSiteMemory(orgId, siteId);
|
||||
if (siteMemory != null) {
|
||||
siteMemory.saveErrorIdentificationStandard(x);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
List<OrderModel> orderModelList = orderModelMapper.selectList();
|
||||
if (!CollectionUtils.isEmpty(orderModelList)) {
|
||||
orderModelList.forEach(x -> {
|
||||
Long orgId = x.getOrgId();
|
||||
Long siteId = x.getId();
|
||||
SiteMemory siteMemory = GlobalMemory.getSiteMemory(orgId, siteId);
|
||||
if (siteMemory != null) {
|
||||
siteMemory.saveOrderModel(x);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
List<AlarmOrderConfig> alarmOrderList = alarmOrderConfigMapper.selectList();
|
||||
if (!CollectionUtils.isEmpty(alarmOrderList)) {
|
||||
alarmOrderList.forEach(x -> {
|
||||
Long orgId = x.getOrgId();
|
||||
Long siteId = x.getId();
|
||||
SiteMemory siteMemory = GlobalMemory.getSiteMemory(orgId, siteId);
|
||||
if (siteMemory != null) {
|
||||
siteMemory.saveAlarmOrderConfig(x);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 未执行完的重复计划
|
||||
LambdaQueryWrapperX<DevicePlan> query = new LambdaQueryWrapperX<>();
|
||||
List<String> list = Arrays.asList(DeviceTaskStaus.NEW.getCode(), DeviceTaskStaus.EXECUTING.getCode(),
|
||||
|
||||
Reference in New Issue
Block a user