Просмотр исходного кода

pms 瑞都单井队 施工井 统计

zhangcl 3 недель назад
Родитель
Сommit
ed4fbbe3b3

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

@@ -1517,6 +1517,13 @@ public class IotRdDailyReportController {
                     }
                 }
 
+                // 施工完成的井累计计数 1
+                if (finishedTaskIds.contains(report.getTaskId())) {
+                    groupCumulativeWorkingWellPair.put(uniqueKey, new BigDecimal("1"));
+                } else {
+                    groupCumulativeWorkingWellPair.put(uniqueKey, BigDecimal.ZERO);
+                }
+
                 // 设置每个任务的工作量数据  单位相同的工作量值作合并处理
                 List<IotTaskAttrModelProperty> taskAttrs = report.getExtProperty();
                 // 暂存不同单位的工作量属性值
@@ -1600,21 +1607,7 @@ public class IotRdDailyReportController {
                                 groupWaterVolumePair.put(uniqueKey, tempTotalWaterVolume);
                             }
                         }
-                        /* if ("井数".equals(unit)) {
-                            tempTotalCumulativeWorkingWell = tempTotalCumulativeWorkingWell.add(actualValue);
-                            if (groupCumulativeWorkingWellPair.containsKey(uniqueKey)) {
-                                BigDecimal tempWorkingWell = groupCumulativeWorkingWellPair.get(uniqueKey);
-                                groupCumulativeWorkingWellPair.put(uniqueKey, tempTotalCumulativeWorkingWell.add(tempWorkingWell));
-                            } else {
-                                groupCumulativeWorkingWellPair.put(uniqueKey, tempTotalCumulativeWorkingWell);
-                            }
-                        } */
-                        // 施工完成的井累计计数 1
-                        if (finishedTaskIds.contains(report.getTaskId())) {
-                            groupCumulativeWorkingWellPair.put(uniqueKey, new BigDecimal("1"));
-                        } else {
-                            groupCumulativeWorkingWellPair.put(uniqueKey, BigDecimal.ZERO);
-                        }
+
                         if ("段数".equals(unit)) {
                             // 累计施工层
                             tempTotalCumulativeWorkingLayers = tempTotalCumulativeWorkingLayers.add(actualValue);
@@ -1670,9 +1663,7 @@ public class IotRdDailyReportController {
                     if (groupRunCountPair.containsKey(uniqueKey)) {
                         groupIdRunCountPair.put(groupId, groupRunCountPair.get(uniqueKey));
                     }
-                    /* if (groupCumulativeWorkingWellPair.containsKey(uniqueKey)) {
-                        groupIdCumulativeWorkingWellPair.put(groupId, groupCumulativeWorkingWellPair.get(uniqueKey));
-                    } */
+
                     if (groupFinishedWellPair.containsKey(uniqueKey)) {
                         groupIdFinishedWellPair.put(groupId, groupFinishedWellPair.get(uniqueKey));
                     }
@@ -1949,6 +1940,12 @@ public class IotRdDailyReportController {
                 BigDecimal tempTotalPumpTrips = BigDecimal.ZERO;
                 BigDecimal tempTotalCumulativeWorkingLayers = BigDecimal.ZERO;
                 BigDecimal tempTotalMixSand = BigDecimal.ZERO;
+
+                if (finishedTaskIds.contains(report.getTaskId()) && "wg".equals(report.getRdStatus())) {
+                    // 只有任务完工且日报施工状态为 完工 才统计 井数为 1
+                    tempTotalCumulativeWorkingWell = new BigDecimal("1");
+                }
+
                 if (CollUtil.isNotEmpty(taskAttrs)) {
                     for (IotTaskAttrModelProperty attr : taskAttrs) {
                         String unit = attr.getUnit();   // 工作量单位
@@ -1981,13 +1978,7 @@ public class IotRdDailyReportController {
                         if ("方".equals(unit)) {
                             tempTotalWaterVolume = tempTotalWaterVolume.add(actualValue);
                         }
-                        /* if ("井数".equals(unit)) {
-                            tempTotalCumulativeWorkingWell = tempTotalCumulativeWorkingWell.add(actualValue);
-                        } */
-                        if (finishedTaskIds.contains(report.getTaskId()) && "wg".equals(report.getRdStatus())) {
-                            // 只有任务完工且日报施工状态为 完工 才统计 井数为 1
-                            tempTotalCumulativeWorkingWell = new BigDecimal("1");
-                        }
+
                         if ("段数".equals(unit)) {
                             tempTotalCumulativeWorkingLayers = tempTotalCumulativeWorkingLayers.add(actualValue);
                         }
@@ -1998,7 +1989,6 @@ public class IotRdDailyReportController {
                             tempTotalMixSand = tempTotalMixSand.add(actualValue);
                         }
                     }
-                    report.setCumulativeWorkingWell(tempTotalCumulativeWorkingWell);
                     report.setCumulativeWorkingLayers(tempTotalCumulativeWorkingLayers);
                     report.setDailyPumpTrips(tempTotalPumpTrips);
                     report.setDailyToolsSand(tempTotalMixSand);
@@ -2007,6 +1997,8 @@ public class IotRdDailyReportController {
                     report.setWaterVolume(tempTotalWaterVolume);
                     report.setHourCount(tempTotalHourCount);
                 }
+                // 赋值累计施工井
+                report.setCumulativeWorkingWell(tempTotalCumulativeWorkingWell);
             }
         });
         return BeanUtils.toBean(reports, IotRdDailyReportRespVO.class, (reportVO) -> {
@@ -2199,6 +2191,13 @@ public class IotRdDailyReportController {
                     }
                 }
 
+                // 施工完成的井累计计数 1
+                if (finishedTaskIds.contains(report.getTaskId())) {
+                    groupCumulativeWorkingWellPair.put(uniqueKey, new BigDecimal("1"));
+                } else {
+                    groupCumulativeWorkingWellPair.put(uniqueKey, BigDecimal.ZERO);
+                }
+
                 // 设置每个任务的工作量数据  单位相同的工作量值作合并处理
                 List<IotTaskAttrModelProperty> taskAttrs = report.getExtProperty();
                 // 暂存不同单位的工作量属性值
@@ -2282,21 +2281,8 @@ public class IotRdDailyReportController {
                                 groupWaterVolumePair.put(uniqueKey, tempTotalWaterVolume);
                             }
                         }
-                        /* if ("井数".equals(unit)) {
-                            tempTotalCumulativeWorkingWell = tempTotalCumulativeWorkingWell.add(actualValue);
-                            if (groupCumulativeWorkingWellPair.containsKey(uniqueKey)) {
-                                BigDecimal tempWorkingWell = groupCumulativeWorkingWellPair.get(uniqueKey);
-                                groupCumulativeWorkingWellPair.put(uniqueKey, tempTotalCumulativeWorkingWell.add(tempWorkingWell));
-                            } else {
-                                groupCumulativeWorkingWellPair.put(uniqueKey, tempTotalCumulativeWorkingWell);
-                            }
-                        } */
-                        // 施工完成的井累计计数 1
-                        if (finishedTaskIds.contains(report.getTaskId())) {
-                            groupCumulativeWorkingWellPair.put(uniqueKey, new BigDecimal("1"));
-                        } else {
-                            groupCumulativeWorkingWellPair.put(uniqueKey, BigDecimal.ZERO);
-                        }
+
+
                         if ("段数".equals(unit)) {
                             // 累计施工层
                             tempTotalCumulativeWorkingLayers = tempTotalCumulativeWorkingLayers.add(actualValue);
@@ -2352,9 +2338,6 @@ public class IotRdDailyReportController {
                     if (groupRunCountPair.containsKey(uniqueKey)) {
                         groupIdRunCountPair.put(groupId, groupRunCountPair.get(uniqueKey));
                     }
-                    /* if (groupCumulativeWorkingWellPair.containsKey(uniqueKey)) {
-                        groupIdCumulativeWorkingWellPair.put(groupId, groupCumulativeWorkingWellPair.get(uniqueKey));
-                    } */
                     if (groupFinishedWellPair.containsKey(uniqueKey)) {
                         groupIdFinishedWellPair.put(groupId, groupFinishedWellPair.get(uniqueKey));
                     }
@@ -2631,6 +2614,12 @@ public class IotRdDailyReportController {
                 BigDecimal tempTotalPumpTrips = BigDecimal.ZERO;
                 BigDecimal tempTotalCumulativeWorkingLayers = BigDecimal.ZERO;
                 BigDecimal tempTotalMixSand = BigDecimal.ZERO;
+
+                if (finishedTaskIds.contains(report.getTaskId()) && "wg".equals(report.getRdStatus())) {
+                    // 只有任务完工且日报施工状态为 完工 才统计 井数为 1
+                    tempTotalCumulativeWorkingWell = new BigDecimal("1");
+                }
+
                 if (CollUtil.isNotEmpty(taskAttrs)) {
                     for (IotTaskAttrModelProperty attr : taskAttrs) {
                         String unit = attr.getUnit();   // 工作量单位
@@ -2663,13 +2652,7 @@ public class IotRdDailyReportController {
                         if ("方".equals(unit)) {
                             tempTotalWaterVolume = tempTotalWaterVolume.add(actualValue);
                         }
-                        /* if ("井数".equals(unit)) {
-                            tempTotalCumulativeWorkingWell = tempTotalCumulativeWorkingWell.add(actualValue);
-                        } */
-                        if (finishedTaskIds.contains(report.getTaskId()) && "wg".equals(report.getRdStatus())) {
-                            // 只有任务完工且日报施工状态为 完工 才统计 井数为 1
-                            tempTotalCumulativeWorkingWell = new BigDecimal("1");
-                        }
+
                         if ("段数".equals(unit)) {
                             tempTotalCumulativeWorkingLayers = tempTotalCumulativeWorkingLayers.add(actualValue);
                         }
@@ -2680,7 +2663,6 @@ public class IotRdDailyReportController {
                             tempTotalMixSand = tempTotalMixSand.add(actualValue);
                         }
                     }
-                    report.setCumulativeWorkingWell(tempTotalCumulativeWorkingWell);
                     report.setCumulativeWorkingLayers(tempTotalCumulativeWorkingLayers);
                     report.setDailyPumpTrips(tempTotalPumpTrips);
                     report.setDailyToolsSand(tempTotalMixSand);
@@ -2689,6 +2671,8 @@ public class IotRdDailyReportController {
                     report.setWaterVolume(tempTotalWaterVolume);
                     report.setHourCount(tempTotalHourCount);
                 }
+                // 赋值累计施工井
+                report.setCumulativeWorkingWell(tempTotalCumulativeWorkingWell);
             }
         });
         return BeanUtils.toBean(reports, IotRdDailyReportRespVO.class, (reportVO) -> {

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

@@ -3370,7 +3370,7 @@ public class IotRdDailyReportServiceImpl implements IotRdDailyReportService {
             pageReqVO.setDeptIds(ids);
         }
         List<IotRdDailyReportDO> groupIds = iotRdDailyReportMapper.rdDeptDailyReportsGroupIds(
-                new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()), pageReqVO,
+                new Page<>(pageReqVO.getPageNo(), PageParam.PAGE_SIZE_NONE), pageReqVO,
                 pageReqVO.getTaskIds(), pageReqVO.getProjectIds(), ids);
         return groupIds;
     }
@@ -3385,7 +3385,7 @@ public class IotRdDailyReportServiceImpl implements IotRdDailyReportService {
             pageReqVO.setDeptIds(ids);
         }
         List<IotRdDailyReportDO> groupIds = iotRdDailyReportMapper.rdWellNameDailyReportsGroupIds(
-                new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()), pageReqVO,
+                new Page<>(pageReqVO.getPageNo(), PageParam.PAGE_SIZE_NONE), pageReqVO,
                 pageReqVO.getTaskIds(), pageReqVO.getProjectIds(), ids);
         return groupIds;
     }

+ 2 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/resources/mapper/static/iotprojecttask/IotRdDailyReportMapper.xml

@@ -134,6 +134,8 @@
         ORDER BY
             COALESCE(pd.sort, 999999) ASC,
             d.sort ASC,
+            rdr.dept_id ASC,
+            rdr.task_id ASC,
             DATE(rdr.create_time) DESC;
     </select>