|
@@ -75,28 +75,7 @@ public class IotOperationPlanJob implements JobHandler {
|
|
|
List<IotOperationPlanDO> planList = planMapper.getPlanList();
|
|
|
|
|
|
if(planList.size()>0){
|
|
|
- List<Long> planIds= planList.stream().map(IotOperationPlanDO::getId).collect(Collectors.toList());
|
|
|
- //2、根据计划获取设备ID
|
|
|
- List<IotOperationPlanDevDO> devList = planDevMapper.devIdList(planIds);
|
|
|
- List<Long> devIdList= devList.stream().map(IotOperationPlanDevDO::getId).collect(Collectors.toList());
|
|
|
- //3、根据设备ID生成主表数据
|
|
|
- List<IotOpeationFillOrderDO> orderList = new ArrayList<>();
|
|
|
- List<IotOpeationFillDO> pdList = iotOpeationFillMapper.pdList(devIdList);
|
|
|
-
|
|
|
- for (IotOpeationFillDO pd:pdList) {
|
|
|
-
|
|
|
- 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);
|
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
for (IotOperationPlanDO planDO:planList) {
|
|
@@ -107,6 +86,34 @@ public class IotOperationPlanJob implements JobHandler {
|
|
|
planDO.getBeginCreateTime().atZone(ZoneId.systemDefault()) // 使用系统默认时区
|
|
|
.toInstant() // 转为 Instant(时间戳)
|
|
|
);
|
|
|
+
|
|
|
+
|
|
|
+ List<Long> planIds= new ArrayList<>();
|
|
|
+ planIds.add(planDO.getId());
|
|
|
+ //2、根据计划获取设备ID
|
|
|
+ List<IotOperationPlanDevDO> devList = planDevMapper.devIdList(planIds);
|
|
|
+ List<Long> devIdList= devList.stream().map(IotOperationPlanDevDO::getId).collect(Collectors.toList());
|
|
|
+ //3、根据设备ID生成主表数据
|
|
|
+ List<IotOpeationFillOrderDO> orderList = new ArrayList<>();
|
|
|
+ List<IotOpeationFillDO> pdList = iotOpeationFillMapper.pdList(devIdList);
|
|
|
+
|
|
|
+ for (IotOpeationFillDO pd:pdList) {
|
|
|
+
|
|
|
+ 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);
|
|
|
}
|
|
|
} else {
|
|
@@ -114,6 +121,32 @@ public class IotOperationPlanJob implements JobHandler {
|
|
|
planDO.getLastCreateTime().atZone(ZoneId.systemDefault()) // 使用系统默认时区
|
|
|
.toInstant() // 转为 Instant(时间戳)
|
|
|
);
|
|
|
+
|
|
|
+ List<Long> planIds= new ArrayList<>();
|
|
|
+ planIds.add(planDO.getId());
|
|
|
+ //2、根据计划获取设备ID
|
|
|
+ List<IotOperationPlanDevDO> devList = planDevMapper.devIdList(planIds);
|
|
|
+ List<Long> devIdList= devList.stream().map(IotOperationPlanDevDO::getId).collect(Collectors.toList());
|
|
|
+ //3、根据设备ID生成主表数据
|
|
|
+ List<IotOpeationFillOrderDO> orderList = new ArrayList<>();
|
|
|
+ List<IotOpeationFillDO> pdList = iotOpeationFillMapper.pdList(devIdList);
|
|
|
+
|
|
|
+ for (IotOpeationFillDO pd:pdList) {
|
|
|
+
|
|
|
+ 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, lastdate,devIdList,orderList);
|
|
|
}
|
|
|
}
|
|
@@ -167,6 +200,8 @@ public class IotOperationPlanJob implements JobHandler {
|
|
|
.filter(obj -> idList.contains(obj.getUserId()))
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
+
|
|
|
+
|
|
|
iotOpeationFillOrderMapper.insertBatch(orderList1);
|
|
|
|
|
|
|