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

pms 瑞都 工作量统计功能优化

zhangcl 2 дней назад
Родитель
Сommit
e93d26fd6d

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

@@ -1217,7 +1217,7 @@ public class IotRdDailyReportController {
                             tempTotalMixSand = tempTotalMixSand.add(actualValue);
                             if (groupMixSandPair.containsKey(uniqueKey)) {
                                 BigDecimal tempMixSand = groupMixSandPair.get(uniqueKey);
-                                groupMixSandPair.put(uniqueKey, tempTotalMixSand.add(tempMixSand));
+                                groupMixSandPair.put(uniqueKey, actualValue.add(tempMixSand));
                             } else {
                                 groupMixSandPair.put(uniqueKey, tempTotalMixSand);
                             }
@@ -1760,7 +1760,7 @@ public class IotRdDailyReportController {
                             tempTotalMixSand = tempTotalMixSand.add(actualValue);
                             if (groupMixSandPair.containsKey(uniqueKey)) {
                                 BigDecimal tempMixSand = groupMixSandPair.get(uniqueKey);
-                                groupMixSandPair.put(uniqueKey, tempTotalMixSand.add(tempMixSand));
+                                groupMixSandPair.put(uniqueKey, actualValue.add(tempMixSand));
                             } else {
                                 groupMixSandPair.put(uniqueKey, tempTotalMixSand);
                             }

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

@@ -634,7 +634,7 @@ public class IotRdDailyReportServiceImpl implements IotRdDailyReportService {
                             tempTotalMixSand = tempTotalMixSand.add(actualValue);
                             if (mixSandPair.containsKey(report.getTaskId())) {
                                 BigDecimal tempMixSand = mixSandPair.get(report.getTaskId());
-                                mixSandPair.put(report.getTaskId(), tempTotalMixSand.add(tempMixSand));
+                                mixSandPair.put(report.getTaskId(), actualValue.add(tempMixSand));
                             } else {
                                 mixSandPair.put(report.getTaskId(), tempTotalMixSand);
                             }
@@ -738,20 +738,22 @@ public class IotRdDailyReportServiceImpl implements IotRdDailyReportService {
                         item.setWorkload(cumulativeWorkingLayersPair.get(taskId));
                         items.add(item);
                     }
-                    if (pumpTripsPair.containsKey(taskId)) {
+                    if (pumpTripsPair.containsKey(taskId) || mixSandPair.containsKey(taskId)) {
                         // 主压裂车 当日泵车台次
                         IotRdDailyReportStatisticsItemVO item = new IotRdDailyReportStatisticsItemVO();
                         item.setUnit("台次");
-                        item.setWorkload(pumpTripsPair.get(taskId));
+                        BigDecimal tempPumpTrip = pumpTripsPair.get(taskId);
+                        BigDecimal tempMixSand = mixSandPair.get(taskId);
+                        item.setWorkload((ObjUtil.isEmpty(tempPumpTrip)?BigDecimal.ZERO:tempPumpTrip).add(ObjUtil.isEmpty(tempMixSand)?BigDecimal.ZERO:tempMixSand));
                         items.add(item);
                     }
-                    if (mixSandPair.containsKey(taskId)) {
+                    /* if (mixSandPair.containsKey(taskId)) {
                         // 当日仪表/混砂 台次
                         IotRdDailyReportStatisticsItemVO item = new IotRdDailyReportStatisticsItemVO();
                         item.setUnit("台次");
                         item.setWorkload(mixSandPair.get(taskId));
                         items.add(item);
-                    }
+                    } */
                     uniqueReport.setItems(items);
                     result.add(uniqueReport);
                 });
@@ -1268,7 +1270,7 @@ public class IotRdDailyReportServiceImpl implements IotRdDailyReportService {
                                     tempTotalMixSand = tempTotalMixSand.add(actualValue);
                                     if (cumulativeMixSandPair.containsKey(projectDeptId)) {
                                         BigDecimal tempMixSand = cumulativeMixSandPair.get(projectDeptId);
-                                        cumulativeMixSandPair.put(projectDeptId, tempTotalMixSand.add(tempMixSand));
+                                        cumulativeMixSandPair.put(projectDeptId, actualValue.add(tempMixSand));
                                     } else {
                                         cumulativeMixSandPair.put(projectDeptId, tempTotalMixSand);
                                     }

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

@@ -22,6 +22,7 @@
         <result column="production_status" property="productionStatus" />
         <result column="next_plan" property="nextPlan" />
         <result column="personnel" property="personnel" />
+        <result column="ext_property" property="extProperty" typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler"/>
         <!-- 其他字段映射 -->
         <result column="remark" property="remark" />
         <result column="status" property="status" />