|
@@ -17,6 +17,7 @@ import cn.iocoder.yudao.module.pms.dal.mysql.iotopeationfill.IotOpeationFillOrde
|
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.iotoperationplan.IotOperationPlanMapper;
|
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.iotoperationplandev.IotOperationPlanDevMapper;
|
|
|
import cn.iocoder.yudao.module.pms.message.PmsMessage;
|
|
|
+import cn.iocoder.yudao.module.pms.service.iotopeationfill.IotOpeationFillService;
|
|
|
import cn.iocoder.yudao.module.system.service.dept.DeptService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -59,6 +60,8 @@ public class IotOperationPlanJob implements JobHandler {
|
|
|
private IotOperationPlanDevMapper planDevMapper;
|
|
|
@Resource
|
|
|
private DeptService deptService;
|
|
|
+ @Resource
|
|
|
+ private IotOpeationFillService opeationFillService;
|
|
|
|
|
|
/**
|
|
|
* 1、查询开启状态运行计划
|
|
@@ -258,11 +261,24 @@ public class IotOperationPlanJob implements JobHandler {
|
|
|
|
|
|
for (IotOpeationFillDO re:deviceList) {
|
|
|
re.setDeviceId(re.getId());
|
|
|
+ re.setIsReport(0);
|
|
|
}
|
|
|
iotOpeationFillMapper.insertFill(deviceList);
|
|
|
|
|
|
|
|
|
- System.out.println("*****************插入运行记录设备表完成***********************");
|
|
|
- }
|
|
|
+ Set<Long> idList1 = new HashSet<>();
|
|
|
+ idList1 = deptService.getChildDeptIdListFromCache(157L);
|
|
|
+ idList1.add(157L);
|
|
|
+
|
|
|
+ List<Long> oDeptList = orderList1.stream().map(IotOpeationFillOrderDO::getDeptId).collect(Collectors.toList());
|
|
|
+
|
|
|
+ boolean exist = idList1.containsAll(oDeptList);
|
|
|
|
|
|
+ if(exist){
|
|
|
+ //插入虚拟设备
|
|
|
+ List <IotOpeationFillDO> devList = opeationFillService.reportMethod(orderList1);
|
|
|
+ iotOpeationFillMapper.insertFill(devList);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
}
|