|
|
@@ -169,7 +169,6 @@ public class IotRhDailyReportServiceImpl implements IotRhDailyReportService {
|
|
|
teams.add(currentDept[0]);
|
|
|
// 查询增压机状态为非施工的小队
|
|
|
List<IotDeviceDO> teamStatusL = iotOpeationFillMapper.selectDevStatusBatch(teams);
|
|
|
- // System.out.println("无施工设备的队伍:" + currentDept.getName());
|
|
|
|
|
|
// 设置 日报填写状态 审核状态
|
|
|
iotRhDailyReport.setStatus(1);
|
|
|
@@ -257,9 +256,22 @@ public class IotRhDailyReportServiceImpl implements IotRhDailyReportService {
|
|
|
));
|
|
|
}
|
|
|
} else {
|
|
|
- wellName = StrUtil.EMPTY;
|
|
|
- // 当前队伍没有关联任务 不生成日报
|
|
|
- // throw exception(IOT_PROJECT_TASK_NOT_RELATED);
|
|
|
+ // 当前队伍没有关联任务 查询当前部门关联的最新的完工任务 关联上 有可能是已经完工的空日报任务
|
|
|
+ reqVO.setDeptId(createReqVO.getDeptId());
|
|
|
+ // 只筛选未施工完成的任务
|
|
|
+ reqVO.setJobFlag(StrUtil.EMPTY);
|
|
|
+ reqVO.setFinishFlag("Y");
|
|
|
+ // 查询包含当前日报施工队伍的任务
|
|
|
+ List<IotProjectTaskDO> finishedTasks = iotProjectTaskMapper.selectList(reqVO);
|
|
|
+ if (CollUtil.isNotEmpty(finishedTasks)) {
|
|
|
+ // 最新完工的任务位于列表第1个元素
|
|
|
+ IotProjectTaskDO latestTask = finishedTasks.get(0);
|
|
|
+ iotRhDailyReport.setProjectId(latestTask.getProjectId());
|
|
|
+ iotRhDailyReport.setTaskId(latestTask.getId());
|
|
|
+ wellName = latestTask.getWellName();
|
|
|
+ } else {
|
|
|
+ wellName = StrUtil.EMPTY;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// 查询当前队伍的运行记录 找到注水量 注水时间 赋值到日报的 注水时间
|
|
|
@@ -335,24 +347,6 @@ public class IotRhDailyReportServiceImpl implements IotRhDailyReportService {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- /* if (CollUtil.isNotEmpty(deptDevices)) {
|
|
|
- deptDevices.forEach(device -> {
|
|
|
- deviceCodes.add(device.getDeviceCode());
|
|
|
- });
|
|
|
- // 查询当前小队在运行记录填报结果表中 生产日报虚拟设备id 查询当年的日报
|
|
|
- // 然后根据 虚拟设备id 在 rq_iot_device_run_log 表中查询 日报中填写的 当日注气量
|
|
|
- List<IotOpeationFillDO> reports = iotOpeationFillMapper.selectReportsByYear(createReqVO.getDeptId(), LocalDateTime.now().getYear());
|
|
|
- Set<Long> reportDeviceIds = new HashSet<>();
|
|
|
- if (CollUtil.isNotEmpty(reports)) {
|
|
|
- reports.forEach(report -> {
|
|
|
- reportDeviceIds.add(report.getDeviceId());
|
|
|
- });
|
|
|
- // 累计注气量
|
|
|
- BigDecimal currentYearFillContentSum = iotDeviceRunLogMapper.selectCurrentYearFillContentSum(createReqVO.getDeptId(), reportDeviceIds);
|
|
|
- iotRhDailyReport.setTotalGasInjection(currentYearFillContentSum);
|
|
|
- }
|
|
|
- } */
|
|
|
-
|
|
|
BigDecimal capacity = queryCapacity(createReqVO.getDeptId());
|
|
|
// 计算运行时效 当日注气量/产能
|
|
|
if (ObjUtil.isNotEmpty(createReqVO.getDailyGasInjection()) && (capacity.compareTo(BigDecimal.ZERO)>0)) {
|