|
@@ -101,29 +101,32 @@ public class IotOperationPlanJob implements JobHandler {
|
|
|
|
|
|
//2、根据计划获取设备ID
|
|
|
List<IotDeviceRespVO> devList = iotOpeationFillMapper.getFillDevices2(idList);
|
|
|
- List<Long> devIdList= devList.stream().map(IotDeviceRespVO::getId).collect(Collectors.toList());
|
|
|
- //3、根据设备ID生成主表数据
|
|
|
- List<IotOpeationFillOrderDO> orderList = new ArrayList<>();
|
|
|
- List<IotOpeationFillDO> pdList = iotOpeationFillMapper.pdList(devIdList);
|
|
|
|
|
|
- for (IotOpeationFillDO pd:pdList) {
|
|
|
+ if(devList.size()>0){
|
|
|
+ List<Long> devIdList= devList.stream().map(IotDeviceRespVO::getId).collect(Collectors.toList());
|
|
|
+ //3、根据设备ID生成主表数据
|
|
|
+ List<IotOpeationFillOrderDO> orderList = new ArrayList<>();
|
|
|
+ List<IotOpeationFillDO> pdList = iotOpeationFillMapper.pdList(devIdList);
|
|
|
|
|
|
- IotOpeationFillOrderDO fillDO = new IotOpeationFillOrderDO();
|
|
|
+ for (IotOpeationFillDO pd:pdList) {
|
|
|
|
|
|
- fillDO.setOrderName(pd.getOrgName()+"/"+LocalDate.now()+"运行记录填报");
|
|
|
- fillDO.setDeptId(pd.getDeptId());
|
|
|
- fillDO.setOrderStatus(0);
|
|
|
- fillDO.setCreateTime(LocalDateTime.now());
|
|
|
- fillDO.setUserName(pd.getUserName());
|
|
|
- fillDO.setUserId(pd.getUserId());
|
|
|
- fillDO.setMobile(pd.getMobile());
|
|
|
- orderList.add(fillDO);
|
|
|
+ IotOpeationFillOrderDO fillDO = new IotOpeationFillOrderDO();
|
|
|
|
|
|
- }
|
|
|
+ fillDO.setOrderName(pd.getOrgName()+"/"+LocalDate.now()+"运行记录填报");
|
|
|
+ fillDO.setDeptId(pd.getDeptId());
|
|
|
+ fillDO.setOrderStatus(0);
|
|
|
+ fillDO.setCreateTime(LocalDateTime.now());
|
|
|
+ fillDO.setUserName(pd.getUserName());
|
|
|
+ fillDO.setUserId(pd.getUserId());
|
|
|
+ fillDO.setMobile(pd.getMobile());
|
|
|
+ orderList.add(fillDO);
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
+ deal(planDO, date,devIdList,orderList);
|
|
|
+ }
|
|
|
|
|
|
|
|
|
- deal(planDO, date,devIdList,orderList);
|
|
|
}
|
|
|
} else {
|
|
|
Date lastdate = Date.from(
|
|
@@ -142,28 +145,31 @@ public class IotOperationPlanJob implements JobHandler {
|
|
|
|
|
|
//2、根据计划获取设备ID
|
|
|
List<IotDeviceRespVO> devList = iotOpeationFillMapper.getFillDevices2(idList);
|
|
|
- List<Long> devIdList= devList.stream().map(IotDeviceRespVO::getId).collect(Collectors.toList());
|
|
|
- //3、根据设备ID生成主表数据
|
|
|
- List<IotOpeationFillOrderDO> orderList = new ArrayList<>();
|
|
|
- List<IotOpeationFillDO> pdList = iotOpeationFillMapper.pdList(devIdList);
|
|
|
+ if(devList.size()>0){
|
|
|
+ List<Long> devIdList= devList.stream().map(IotDeviceRespVO::getId).collect(Collectors.toList());
|
|
|
+ //3、根据设备ID生成主表数据
|
|
|
+ List<IotOpeationFillOrderDO> orderList = new ArrayList<>();
|
|
|
+ List<IotOpeationFillDO> pdList = iotOpeationFillMapper.pdList(devIdList);
|
|
|
|
|
|
- for (IotOpeationFillDO pd:pdList) {
|
|
|
+ for (IotOpeationFillDO pd:pdList) {
|
|
|
|
|
|
- IotOpeationFillOrderDO fillDO = new IotOpeationFillOrderDO();
|
|
|
+ IotOpeationFillOrderDO fillDO = new IotOpeationFillOrderDO();
|
|
|
|
|
|
- fillDO.setOrderName(pd.getOrgName()+"/"+LocalDate.now()+"运行记录填报");
|
|
|
- fillDO.setDeptId(pd.getDeptId());
|
|
|
- fillDO.setOrderStatus(0);
|
|
|
- fillDO.setCreateTime(LocalDateTime.now());
|
|
|
- fillDO.setUserName(pd.getUserName());
|
|
|
- fillDO.setUserId(pd.getUserId());
|
|
|
- fillDO.setMobile(pd.getMobile());
|
|
|
- orderList.add(fillDO);
|
|
|
+ fillDO.setOrderName(pd.getOrgName()+"/"+LocalDate.now()+"运行记录填报");
|
|
|
+ fillDO.setDeptId(pd.getDeptId());
|
|
|
+ fillDO.setOrderStatus(0);
|
|
|
+ fillDO.setCreateTime(LocalDateTime.now());
|
|
|
+ fillDO.setUserName(pd.getUserName());
|
|
|
+ fillDO.setUserId(pd.getUserId());
|
|
|
+ fillDO.setMobile(pd.getMobile());
|
|
|
+ orderList.add(fillDO);
|
|
|
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
|
|
|
- deal(planDO, lastdate,devIdList,orderList);
|
|
|
+ deal(planDO, lastdate,devIdList,orderList);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -221,7 +227,7 @@ public class IotOperationPlanJob implements JobHandler {
|
|
|
iotOpeationFillOrderMapper.insertBatch(orderList1);
|
|
|
|
|
|
|
|
|
- //发送钉钉通知
|
|
|
+ /*//发送钉钉通知
|
|
|
pmsThreadPoolTaskExecutor.execute(()->{
|
|
|
try{
|
|
|
for (IotOpeationFillOrderDO order:orderList1) {
|
|
@@ -230,7 +236,7 @@ public class IotOperationPlanJob implements JobHandler {
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
- });
|
|
|
+ });*/
|
|
|
|
|
|
|
|
|
for (IotOpeationFillDO device:deviceList) {
|