|
@@ -361,20 +361,58 @@ public class IotOperationPlanJob implements JobHandler {
|
|
|
|
|
|
|
|
|
|
|
|
- List<Long> oDeptList = orderList2.stream().map(IotOpeationFillOrderDO::getDeptId).collect(Collectors.toList());
|
|
|
|
|
|
- boolean exist = idList1.containsAll(oDeptList);
|
|
|
+ List<Long> oDeptList = new ArrayList<>();
|
|
|
+
|
|
|
+ if(rpList.size()>0){
|
|
|
+ oDeptList = orderList2.stream().map(IotOpeationFillOrderDO::getDeptId).collect(Collectors.toList());
|
|
|
+
|
|
|
+ // 先判断oDeptList是否为空,如果为空则根据业务需求设置exist的值
|
|
|
+ boolean exist;
|
|
|
+ if (oDeptList.isEmpty()) {
|
|
|
+ // 当oDeptList为空时,这里可以根据实际场景设置默认值
|
|
|
+ // 例如:空列表认为所有元素都被包含,设置为true
|
|
|
+ exist = false;
|
|
|
+ // 或者认为不满足,设置为false
|
|
|
+ // exist = false;
|
|
|
+ } else {
|
|
|
+ exist = idList1.containsAll(oDeptList);
|
|
|
+ }
|
|
|
|
|
|
- if(exist){
|
|
|
- List <IotOpeationFillDO> devList = new ArrayList<>();
|
|
|
- if(rpList.size()>0){
|
|
|
- devList = opeationFillService.reportMethod(orderList2);
|
|
|
- }else{
|
|
|
- devList = opeationFillService.reportMethod(orderList1);
|
|
|
+ if(exist){
|
|
|
+ List <IotOpeationFillDO> devList = opeationFillService.reportMethod(orderList2);
|
|
|
+ //插入虚拟设备
|
|
|
+ iotOpeationFillMapper.insertFill(devList);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }else{
|
|
|
+ oDeptList = orderList1.stream().map(IotOpeationFillOrderDO::getDeptId).collect(Collectors.toList());
|
|
|
+
|
|
|
+ // 先判断oDeptList是否为空,如果为空则根据业务需求设置exist的值
|
|
|
+ boolean exist;
|
|
|
+ if (oDeptList.isEmpty()) {
|
|
|
+ // 当oDeptList为空时,这里可以根据实际场景设置默认值
|
|
|
+ // 例如:空列表认为所有元素都被包含,设置为true
|
|
|
+ exist = false;
|
|
|
+ // 或者认为不满足,设置为false
|
|
|
+ // exist = false;
|
|
|
+ } else {
|
|
|
+ exist = idList1.containsAll(oDeptList);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(exist){
|
|
|
+ List <IotOpeationFillDO> devList = opeationFillService.reportMethod(orderList1);
|
|
|
+ //插入虚拟设备
|
|
|
+ iotOpeationFillMapper.insertFill(devList);
|
|
|
}
|
|
|
- //插入虚拟设备
|
|
|
- iotOpeationFillMapper.insertFill(devList);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
}
|