|
@@ -6,6 +6,7 @@ import cn.iocoder.yudao.framework.common.util.date.DateUtils;
|
|
import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler;
|
|
import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler;
|
|
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
|
|
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
|
|
import cn.iocoder.yudao.module.pms.constant.PmsConstants;
|
|
import cn.iocoder.yudao.module.pms.constant.PmsConstants;
|
|
|
|
+import cn.iocoder.yudao.module.pms.controller.admin.iotrhdailyreport.vo.IotRhDailyReportSaveReqVO;
|
|
import cn.iocoder.yudao.module.pms.controller.admin.vo.IotDeviceRespVO;
|
|
import cn.iocoder.yudao.module.pms.controller.admin.vo.IotDeviceRespVO;
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.inspect.IotInspectPlanDO;
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.inspect.IotInspectPlanDO;
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO;
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO;
|
|
@@ -18,6 +19,7 @@ import cn.iocoder.yudao.module.pms.dal.mysql.iotoperationplan.IotOperationPlanMa
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.iotoperationplandev.IotOperationPlanDevMapper;
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.iotoperationplandev.IotOperationPlanDevMapper;
|
|
import cn.iocoder.yudao.module.pms.message.PmsMessage;
|
|
import cn.iocoder.yudao.module.pms.message.PmsMessage;
|
|
import cn.iocoder.yudao.module.pms.service.iotopeationfill.IotOpeationFillService;
|
|
import cn.iocoder.yudao.module.pms.service.iotopeationfill.IotOpeationFillService;
|
|
|
|
+import cn.iocoder.yudao.module.pms.service.iotrhdailyreport.IotRhDailyReportService;
|
|
import cn.iocoder.yudao.module.system.service.dept.DeptService;
|
|
import cn.iocoder.yudao.module.system.service.dept.DeptService;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -26,6 +28,7 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
|
+import java.math.BigDecimal;
|
|
import java.time.LocalDate;
|
|
import java.time.LocalDate;
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
import java.time.ZoneId;
|
|
import java.time.ZoneId;
|
|
@@ -62,6 +65,8 @@ public class IotOperationPlanJob implements JobHandler {
|
|
private DeptService deptService;
|
|
private DeptService deptService;
|
|
@Resource
|
|
@Resource
|
|
private IotOpeationFillService opeationFillService;
|
|
private IotOpeationFillService opeationFillService;
|
|
|
|
+ @Resource
|
|
|
|
+ private IotRhDailyReportService iotRhDailyReportService;
|
|
/**
|
|
/**
|
|
* 1、查询开启状态运行计划
|
|
* 1、查询开启状态运行计划
|
|
* 2、根据计划获取设备
|
|
* 2、根据计划获取设备
|
|
@@ -272,6 +277,12 @@ public class IotOperationPlanJob implements JobHandler {
|
|
boolean rhContain = rhIdList.contains(plan.getDeptId());
|
|
boolean rhContain = rhIdList.contains(plan.getDeptId());
|
|
|
|
|
|
if(rhContain){
|
|
if(rhContain){
|
|
|
|
+
|
|
|
|
+ //创建日报设备
|
|
|
|
+ List <IotOpeationFillDO> devList = opeationFillService.reportMethod(orderList1);
|
|
|
|
+ //插入日报设备
|
|
|
|
+ iotOpeationFillMapper.insertFill(devList);
|
|
|
|
+
|
|
//2、瑞恒无指定队伍全部队伍插入日报设备
|
|
//2、瑞恒无指定队伍全部队伍插入日报设备
|
|
//筛选正常工单部门id
|
|
//筛选正常工单部门id
|
|
List<Long> deptIdList = orderList1.stream().map(IotOpeationFillOrderDO::getDeptId).collect(Collectors.toList());
|
|
List<Long> deptIdList = orderList1.stream().map(IotOpeationFillOrderDO::getDeptId).collect(Collectors.toList());
|
|
@@ -298,38 +309,39 @@ public class IotOperationPlanJob implements JobHandler {
|
|
}
|
|
}
|
|
//创建虚拟工单
|
|
//创建虚拟工单
|
|
if(verRPList.size()>0){
|
|
if(verRPList.size()>0){
|
|
- List<IotOpeationFillOrderDO> virOrderList = new ArrayList<>();
|
|
|
|
- for (IotOpeationFillDO pd:verRPList) {
|
|
|
|
- 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());
|
|
|
|
- virOrderList.add(fillDO);
|
|
|
|
- }
|
|
|
|
- if(virOrderList.size()>0){
|
|
|
|
- orderList1.addAll(virOrderList);
|
|
|
|
- //插入虚拟工单工单
|
|
|
|
- iotOpeationFillOrderMapper.insertBatch(virOrderList);
|
|
|
|
-
|
|
|
|
|
|
+ for (IotOpeationFillDO vir:verRPList) {
|
|
|
|
+ IotRhDailyReportSaveReqVO saveReqVO = new IotRhDailyReportSaveReqVO();
|
|
|
|
+ //查询队伍增压机状态
|
|
|
|
+ /*IotDeviceDO devStatus = iotOpeationFillMapper.devStatus(vir);
|
|
|
|
+ //不为空则为日报赋值
|
|
|
|
+ if(devStatus!=null){
|
|
|
|
+ saveReqVO.setConstructionStatus(devStatus.getOrderStatus());
|
|
|
|
+ }*/
|
|
|
|
+ //当日注气量
|
|
|
|
+ saveReqVO.setDailyGasInjection(BigDecimal.valueOf(0.00));
|
|
|
|
+ //当日注水量
|
|
|
|
+ saveReqVO.setDailyWaterInjection(BigDecimal.valueOf(0.00));
|
|
|
|
+ //当日注气时间
|
|
|
|
+ saveReqVO.setDailyInjectGasTime(BigDecimal.valueOf(0.00));
|
|
|
|
+ //当日注水时间
|
|
|
|
+ saveReqVO.setDailyInjectWaterTime(BigDecimal.valueOf(0.00));
|
|
|
|
+ //当日用电量
|
|
|
|
+ saveReqVO.setDailyPowerUsage(BigDecimal.valueOf(0.00));
|
|
|
|
+ //非生产时间
|
|
|
|
+ saveReqVO.setNonProductionTime(BigDecimal.valueOf(0.00));
|
|
|
|
+ saveReqVO.setDeptId(vir.getDeptId());
|
|
|
|
+ saveReqVO.setFillOrderCreateTime(LocalDateTime.now());
|
|
|
|
+ iotRhDailyReportService.createIotRhDailyReport(saveReqVO);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- //创建日报设备
|
|
|
|
- List <IotOpeationFillDO> devList = opeationFillService.reportMethod(orderList1);
|
|
|
|
- //插入日报设备
|
|
|
|
- iotOpeationFillMapper.insertFill(devList);
|
|
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
//发送钉钉通知
|
|
//发送钉钉通知
|
|
- pmsThreadPoolTaskExecutor.execute(()->{
|
|
|
|
|
|
+ /*pmsThreadPoolTaskExecutor.execute(()->{
|
|
try{
|
|
try{
|
|
for (IotOpeationFillOrderDO order:orderList1) {
|
|
for (IotOpeationFillOrderDO order:orderList1) {
|
|
pmsMessage.sendMessage(order.getId(), order.getOrderName(), PmsConstants.GENERATE_OPERATION, (long)order.getUserId(), order.getMobile());
|
|
pmsMessage.sendMessage(order.getId(), order.getOrderName(), PmsConstants.GENERATE_OPERATION, (long)order.getUserId(), order.getMobile());
|
|
@@ -337,7 +349,7 @@ public class IotOperationPlanJob implements JobHandler {
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
- });
|
|
|
|
|
|
+ });*/
|
|
|
|
|
|
|
|
|
|
//正常工单设备
|
|
//正常工单设备
|
|
@@ -355,7 +367,6 @@ public class IotOperationPlanJob implements JobHandler {
|
|
}
|
|
}
|
|
iotOpeationFillMapper.insertFill(deviceList);
|
|
iotOpeationFillMapper.insertFill(deviceList);
|
|
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|