Zimo 19 часов назад
Родитель
Сommit
e148b3191a

+ 19 - 41
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotrddailyreport/IotRdDailyReportController.java

@@ -2321,7 +2321,6 @@ public class IotRdDailyReportController {
                 constructStatusPair.put(data.getValue(), data.getLabel());
             });
         }
-        Map<String, Boolean> reportNonProductFlagPair = new HashMap<>();
         DataPermissionUtils.executeIgnore(() -> {
             // 查询日报关联的项目信息
             IotProjectInfoPageReqVO reqVO = new IotProjectInfoPageReqVO();
@@ -2349,7 +2348,6 @@ public class IotRdDailyReportController {
             // relatedWellReqVO.setPlatformWell(2);
             List<IotRdDailyReportDO> relatedWellReports = iotRdDailyReportService.dailyReports(relatedWellReqVO);
 
-
             // 按照日报创建时间倒序排列
             if (CollUtil.isNotEmpty(relatedWellReports)) {
                 relatedWellReports = relatedWellReports.stream()
@@ -2391,7 +2389,6 @@ public class IotRdDailyReportController {
                     }
                 }
             }
-
             // 平台井 主井施工完成 需要显示 关联井的施工状态 井号
             if (CollUtil.isNotEmpty(relatedWellReports)) {
                 Map<String, IotRdDailyReportDO> relatedPlatformGroupPair = new HashMap<>();
@@ -2401,12 +2398,6 @@ public class IotRdDailyReportController {
                         if (!relatedPlatformGroupPair.containsKey(report.getPlatformGroup())) {
                             relatedPlatformGroupPair.put(report.getPlatformGroup(), report);
                         }
-                        // 查询关联井的 非生产时间填写情况 只要有1个关联井填写了 非生产时间 就显示为 已填写
-                        IotRdDailyReportRespVO reportRespVO = BeanUtils.toBean(report, IotRdDailyReportRespVO.class);
-                        Boolean flag = setNoProductFlag(reportRespVO);
-                        if (flag) {
-                            reportNonProductFlagPair.put(report.getPlatformGroup(), true);
-                        }
                     }
                 });
                 relatedWellReports.forEach(report -> {
@@ -2573,8 +2564,25 @@ public class IotRdDailyReportController {
                     reportVO.setRdStatusLabel(constructStatusPair.get(reportVO.getRdStatus()));
                 }
             }
-            // 设置非生产时间填写标识
-            reportVO.setNonProductFlag(setNoProductFlag(reportVO));
+            BigDecimal accidentTime = reportVO.getAccidentTime();
+            BigDecimal repairTime = reportVO.getRepairTime();
+            BigDecimal selfStopTime = reportVO.getSelfStopTime();
+            BigDecimal complexityTime = reportVO.getComplexityTime();
+            BigDecimal relocationTime = reportVO.getRelocationTime();
+            BigDecimal rectificationTime = reportVO.getRectificationTime();
+            BigDecimal waitingStopTime = reportVO.getWaitingStopTime();
+            BigDecimal winterBreakTime = reportVO.getWinterBreakTime();
+            BigDecimal partyaDesignTime = reportVO.getPartyaDesign();
+            BigDecimal partyaPrepareTime = reportVO.getPartyaPrepare();
+            BigDecimal partyaResourceTime = reportVO.getPartyaResource();
+            BigDecimal otherNptTime = reportVO.getOtherNptTime();
+            if (accidentTime.compareTo(BigDecimal.ZERO) > 0 || repairTime.compareTo(BigDecimal.ZERO) > 0 || selfStopTime.compareTo(BigDecimal.ZERO) > 0
+            || complexityTime.compareTo(BigDecimal.ZERO) > 0 || relocationTime.compareTo(BigDecimal.ZERO) > 0 || rectificationTime.compareTo(BigDecimal.ZERO) > 0
+            || waitingStopTime.compareTo(BigDecimal.ZERO) > 0 || winterBreakTime.compareTo(BigDecimal.ZERO) > 0 || partyaDesignTime.compareTo(BigDecimal.ZERO) > 0
+            || partyaPrepareTime.compareTo(BigDecimal.ZERO) > 0 || partyaResourceTime.compareTo(BigDecimal.ZERO) > 0 || otherNptTime.compareTo(BigDecimal.ZERO) > 0) {
+                // 设置非生产时间填写标识
+                reportVO.setNonProductFlag(true);
+            }
             // 创建时间 格式化 yyyy-MM-dd
             if (ObjUtil.isNotEmpty(reportVO.getCreateTime())) {
                 reportVO.setCreateTimeStr(LocalDateTimeUtil.format(reportVO.getCreateTime(), DatePattern.NORM_DATE_PATTERN));
@@ -2587,8 +2595,6 @@ public class IotRdDailyReportController {
             findAndThen(taskPair, reportVO.getTaskId(), taskName -> reportVO.setTaskName(taskName));
             // 日报关联的任务信息(兼容主井完工 关联井未完工的情况)
             findAndThen(relatedPlatformPair, reportVO.getPlatformGroup(), relatedTaskName -> reportVO.setTaskName(relatedTaskName));
-            // 平台井相关的非生产时间标识
-            findAndThen(reportNonProductFlagPair, reportVO.getPlatformGroup(), nonProductFlag -> reportVO.setNonProductFlag(nonProductFlag));
             // 日报关联的任务施工状态(兼容主井完工 关联井未完工的情况)
             findAndThen(relatedWellStatusPair, reportVO.getPlatformGroup(), rdStatus -> reportVO.setRdStatus(rdStatus));
             // 日报关联的责任人
@@ -2598,34 +2604,6 @@ public class IotRdDailyReportController {
         });
     }
 
-    /**
-     *
-     * @param dailyReport
-     * @return
-     */
-    private Boolean setNoProductFlag(IotRdDailyReportRespVO dailyReport){
-        BigDecimal accidentTime = dailyReport.getAccidentTime();
-        BigDecimal repairTime = dailyReport.getRepairTime();
-        BigDecimal selfStopTime = dailyReport.getSelfStopTime();
-        BigDecimal complexityTime = dailyReport.getComplexityTime();
-        BigDecimal relocationTime = dailyReport.getRelocationTime();
-        BigDecimal rectificationTime = dailyReport.getRectificationTime();
-        BigDecimal waitingStopTime = dailyReport.getWaitingStopTime();
-        BigDecimal winterBreakTime = dailyReport.getWinterBreakTime();
-        BigDecimal partyaDesignTime = dailyReport.getPartyaDesign();
-        BigDecimal partyaPrepareTime = dailyReport.getPartyaPrepare();
-        BigDecimal partyaResourceTime = dailyReport.getPartyaResource();
-        BigDecimal otherNptTime = dailyReport.getOtherNptTime();
-        if (accidentTime.compareTo(BigDecimal.ZERO) > 0 || repairTime.compareTo(BigDecimal.ZERO) > 0 || selfStopTime.compareTo(BigDecimal.ZERO) > 0
-                || complexityTime.compareTo(BigDecimal.ZERO) > 0 || relocationTime.compareTo(BigDecimal.ZERO) > 0 || rectificationTime.compareTo(BigDecimal.ZERO) > 0
-                || waitingStopTime.compareTo(BigDecimal.ZERO) > 0 || winterBreakTime.compareTo(BigDecimal.ZERO) > 0 || partyaDesignTime.compareTo(BigDecimal.ZERO) > 0
-                || partyaPrepareTime.compareTo(BigDecimal.ZERO) > 0 || partyaResourceTime.compareTo(BigDecimal.ZERO) > 0 || otherNptTime.compareTo(BigDecimal.ZERO) > 0) {
-            // 设置非生产时间填写标识
-            return true;
-        }
-        return false;
-    }
-
     @GetMapping("/taskActualProgress")
     @Operation(summary = "查询日报所属任务的实际进度")
     @PreAuthorize("@ss.hasPermission('pms:iot-rd-daily-report:query')")

+ 0 - 3
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotrddailyreport/vo/IotRdDailyReportSaveReqVO.java

@@ -180,7 +180,4 @@ public class IotRdDailyReportSaveReqVO {
 
     @Schema(description = "车辆油耗")
     private List<IotDailyReportFuelSaveReqVO> reportFuels;
-
-    @Schema(description = "非生产时间标识 Y 修改非生产时间后不再审批")
-    private String nonProduct;
 }

+ 5 - 14
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/iotrddailyreport/IotRdDailyReportServiceImpl.java

@@ -61,7 +61,6 @@ import java.time.temporal.ChronoUnit;
 import java.util.*;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicReference;
 import java.util.stream.Collectors;
 
 import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
@@ -131,13 +130,10 @@ public class IotRdDailyReportServiceImpl implements IotRdDailyReportService {
         }
         // 更新
         IotRdDailyReportDO updateObj = BeanUtils.toBean(updateReqVO, IotRdDailyReportDO.class);
-        // 如果是修改 非生产时间 ,则不必再发起审批
-        if (StrUtil.isBlank(updateReqVO.getNonProduct())) {
-            // 设置 日报填写状态 保存 已完成
-            updateObj.setStatus(1);
-            // 设置 日报审批状态为 审批中 auditStatus = 10
-            updateObj.setAuditStatus(10);
-        }
+        // 设置 日报填写状态 保存 已完成
+        updateObj.setStatus(1);
+        // 设置 日报审批状态为 审批中 auditStatus = 10
+        updateObj.setAuditStatus(10);
         iotRdDailyReportMapper.updateById(updateObj);
         // 保存油耗信息
         if (CollUtil.isNotEmpty(updateReqVO.getReportFuels())) {
@@ -2194,12 +2190,7 @@ public class IotRdDailyReportServiceImpl implements IotRdDailyReportService {
         List<IotRdDailyReportDO> mainPlatformReports = new ArrayList<>();
         // 关联井日报
         List<IotRdDailyReportDO> relatePlatformReports = new ArrayList<>();
-        // 维护非生产时间标识 nonProduct
-        AtomicReference<String> nonProduct = new AtomicReference<>(StrUtil.EMPTY);
         reports.forEach(report -> {
-            if (StrUtil.isNotBlank(report.getNonProduct())) {
-                nonProduct.set(report.getNonProduct());
-            }
             IotRdDailyReportDO updatedReport = updateIotRdDailyReport(report);
             // 标识当前任务井是 普通井 或 平台井主井 关联的任务审批人发送提醒消息
             if (1 == updatedReport.getPlatformWell() || 0 == updatedReport.getPlatformWell()) {
@@ -2226,7 +2217,7 @@ public class IotRdDailyReportServiceImpl implements IotRdDailyReportService {
             reqVO.setPlatformGroup(platformGroup);
             reqVO.setPlatformWell(1);
             List<IotRdDailyReportDO> mainWellReports = iotRdDailyReportMapper.dailyReports(reqVO);
-            if (CollUtil.isNotEmpty(mainWellReports) && StrUtil.isBlank(nonProduct.get())) {
+            if (CollUtil.isNotEmpty(mainWellReports)) {
                 IotRdDailyReportDO mainWellReport = mainWellReports.get(0);
                 // 设置 日报审批状态为 审批中 auditStatus = 10
                 mainWellReport.setAuditStatus(10);