|
@@ -316,103 +316,102 @@ public class IotOperationPlanJob implements JobHandler {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- iotOpeationFillOrderMapper.insertBatch(orderList1);
|
|
|
+ IotOpeationFillOrderDO todayTime = new IotOpeationFillOrderDO();
|
|
|
+ todayTime.setCreateTime(localDateTime);
|
|
|
|
|
|
+ List<String> userList = orderList1.stream().map(IotOpeationFillOrderDO::getUserName).collect(Collectors.toList());
|
|
|
|
|
|
+ List<IotOpeationFillOrderDO> allOrder = iotOpeationFillMapper.allOrder(localDateTime,userList);
|
|
|
|
|
|
+ if(allOrder.size()>0){
|
|
|
|
|
|
+ }else{
|
|
|
|
|
|
+ iotOpeationFillOrderMapper.insertBatch(orderList1);
|
|
|
|
|
|
|
|
|
- /* //发送钉钉通知
|
|
|
- pmsThreadPoolTaskExecutor.execute(()->{
|
|
|
- try{
|
|
|
- for (IotOpeationFillOrderDO order:orderList1) {
|
|
|
- pmsMessage.sendMessage(order.getId(), order.getOrderName(), PmsConstants.GENERATE_OPERATION, (long)order.getUserId(), order.getMobile());
|
|
|
+ /* //发送钉钉通知
|
|
|
+ pmsThreadPoolTaskExecutor.execute(()->{
|
|
|
+ try{
|
|
|
+ for (IotOpeationFillOrderDO order:orderList1) {
|
|
|
+ pmsMessage.sendMessage(order.getId(), order.getOrderName(), PmsConstants.GENERATE_OPERATION, (long)order.getUserId(), order.getMobile());
|
|
|
+ }
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
}
|
|
|
- }catch (Exception e){
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- });*/
|
|
|
+ });*/
|
|
|
|
|
|
-
|
|
|
- for (IotOpeationFillDO device:deviceList) {
|
|
|
- System.out.println("deviceUser"+device.getUserId());
|
|
|
- for (IotOpeationFillOrderDO order:orderList1) {
|
|
|
- System.out.println("orderId"+order.getUserId());
|
|
|
- if(device.getUserId().intValue()==order.getUserId().intValue()){
|
|
|
- System.out.println("-----相等-------");
|
|
|
- device.setOrderId(order.getId());
|
|
|
+ for (IotOpeationFillDO device:deviceList) {
|
|
|
+ System.out.println("deviceUser"+device.getUserId());
|
|
|
+ for (IotOpeationFillOrderDO order:orderList1) {
|
|
|
+ System.out.println("orderId"+order.getUserId());
|
|
|
+ if(device.getUserId().intValue()==order.getUserId().intValue()){
|
|
|
+ System.out.println("-----相等-------");
|
|
|
+ device.setOrderId(order.getId());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
|
|
- System.out.println("***********创建运行记录填报工单执行结束*********8");
|
|
|
+ System.out.println("***********创建运行记录填报工单执行结束*********8");
|
|
|
|
|
|
|
|
|
- System.out.println("*****************插入运行记录设备表***********************");
|
|
|
-
|
|
|
- for (IotOpeationFillDO re:deviceList) {
|
|
|
- re.setDeviceId(re.getId());
|
|
|
- re.setIsReport(0);
|
|
|
- }
|
|
|
- iotOpeationFillMapper.insertFill(deviceList);
|
|
|
+ System.out.println("*****************插入运行记录设备表***********************");
|
|
|
|
|
|
+ for (IotOpeationFillDO re:deviceList) {
|
|
|
+ re.setDeviceId(re.getId());
|
|
|
+ re.setIsReport(0);
|
|
|
+ }
|
|
|
+ iotOpeationFillMapper.insertFill(deviceList);
|
|
|
|
|
|
|
|
|
|
|
|
- List<Long> oDeptList = new ArrayList<>();
|
|
|
|
|
|
- if(rpList.size()>0){
|
|
|
- oDeptList = orderList2.stream().map(IotOpeationFillOrderDO::getDeptId).collect(Collectors.toList());
|
|
|
+ List<Long> oDeptList = new ArrayList<>();
|
|
|
|
|
|
- // 先判断oDeptList是否为空,如果为空则根据业务需求设置exist的值
|
|
|
- boolean exist;
|
|
|
- if (oDeptList.isEmpty()) {
|
|
|
- // 当oDeptList为空时,这里可以根据实际场景设置默认值
|
|
|
- // 例如:空列表认为所有元素都被包含,设置为true
|
|
|
- exist = false;
|
|
|
- // 或者认为不满足,设置为false
|
|
|
- // exist = false;
|
|
|
- } else {
|
|
|
- exist = idList1.containsAll(oDeptList);
|
|
|
- }
|
|
|
+ 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 = opeationFillService.reportMethod(orderList2);
|
|
|
- //插入虚拟设备
|
|
|
- iotOpeationFillMapper.insertFill(devList);
|
|
|
- }
|
|
|
+ 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);
|
|
|
- }
|
|
|
+ }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);
|
|
|
+ if(exist){
|
|
|
+ List <IotOpeationFillDO> devList = opeationFillService.reportMethod(orderList1);
|
|
|
+ //插入虚拟设备
|
|
|
+ iotOpeationFillMapper.insertFill(devList);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-}
|
|
|
+ }
|
|
|
}
|