|
@@ -1377,6 +1377,9 @@ public class IotRdDailyReportController {
|
|
|
// key 部门id-队伍id value队伍工作量数据 台次 当日泵车台次 当日仪表/混砂
|
|
// key 部门id-队伍id value队伍工作量数据 台次 当日泵车台次 当日仪表/混砂
|
|
|
Map<String, BigDecimal> groupMixSandPair = new HashMap<>();
|
|
Map<String, BigDecimal> groupMixSandPair = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
+ // key 部门id-队伍id value 累计完工井
|
|
|
|
|
+ Map<String, Set<Long>> groupFinishedWellPair = new HashMap<>();
|
|
|
|
|
+
|
|
|
// key小组最后1条记录id value 桥塞(个数)
|
|
// key小组最后1条记录id value 桥塞(个数)
|
|
|
Map<Long, BigDecimal> groupIdBridgePlugPair = new HashMap<>();
|
|
Map<Long, BigDecimal> groupIdBridgePlugPair = new HashMap<>();
|
|
|
// key小组最后1条记录id value趟数
|
|
// key小组最后1条记录id value趟数
|
|
@@ -1397,6 +1400,13 @@ public class IotRdDailyReportController {
|
|
|
Map<Long, BigDecimal> groupIdMixSandPair = new HashMap<>();
|
|
Map<Long, BigDecimal> groupIdMixSandPair = new HashMap<>();
|
|
|
// 已经完工的任务id集合
|
|
// 已经完工的任务id集合
|
|
|
Set<Long> finishedTaskIds = new HashSet<>();
|
|
Set<Long> finishedTaskIds = new HashSet<>();
|
|
|
|
|
+
|
|
|
|
|
+ // key小组最后1条记录id value累计完工井
|
|
|
|
|
+ Map<Long, Set<Long>> groupIdFinishedWellPair = new HashMap<>();
|
|
|
|
|
+
|
|
|
|
|
+ // keykey小组最后1条记录id value完工井id集合
|
|
|
|
|
+ Map<Long, Set<Long>> cumulativeWellsPair = new HashMap<>();
|
|
|
|
|
+
|
|
|
// key日报id value生产动态明细
|
|
// key日报id value生产动态明细
|
|
|
Map<Long, List<IotRdDailyReportDetailRespVO>> reportDetailsPair = new HashMap<>();
|
|
Map<Long, List<IotRdDailyReportDetailRespVO>> reportDetailsPair = new HashMap<>();
|
|
|
|
|
|
|
@@ -1426,7 +1436,7 @@ public class IotRdDailyReportController {
|
|
|
if (CollUtil.isNotEmpty(deptTaskDailyReports)) {
|
|
if (CollUtil.isNotEmpty(deptTaskDailyReports)) {
|
|
|
deptTaskDailyReports.forEach(report -> {
|
|
deptTaskDailyReports.forEach(report -> {
|
|
|
String uniqueKey = StrUtil.join("-", report.getDeptId(), report.getTaskId());
|
|
String uniqueKey = StrUtil.join("-", report.getDeptId(), report.getTaskId());
|
|
|
-
|
|
|
|
|
|
|
+ // 油耗
|
|
|
BigDecimal dailyFuel = report.getDailyFuel();
|
|
BigDecimal dailyFuel = report.getDailyFuel();
|
|
|
dailyFuel = ObjUtil.isEmpty(dailyFuel) ? BigDecimal.ZERO : dailyFuel;
|
|
dailyFuel = ObjUtil.isEmpty(dailyFuel) ? BigDecimal.ZERO : dailyFuel;
|
|
|
if (groupFuelPair.containsKey(uniqueKey)) {
|
|
if (groupFuelPair.containsKey(uniqueKey)) {
|
|
@@ -1436,6 +1446,20 @@ public class IotRdDailyReportController {
|
|
|
} else {
|
|
} else {
|
|
|
groupFuelPair.put(uniqueKey, dailyFuel);
|
|
groupFuelPair.put(uniqueKey, dailyFuel);
|
|
|
}
|
|
}
|
|
|
|
|
+ // 累计完工井
|
|
|
|
|
+ // 日报关联的任务井id
|
|
|
|
|
+ Long taskId = report.getTaskId();
|
|
|
|
|
+ if (ObjUtil.isNotEmpty(taskId) && finishedTaskIds.contains(taskId)) {
|
|
|
|
|
+ if (groupFinishedWellPair.containsKey(uniqueKey)) {
|
|
|
|
|
+ Set<Long> existTaskIds = groupFinishedWellPair.get(uniqueKey);
|
|
|
|
|
+ existTaskIds.add(taskId);
|
|
|
|
|
+ groupFinishedWellPair.put(uniqueKey, existTaskIds);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ Set<Long> existTaskIds = new HashSet<>();
|
|
|
|
|
+ existTaskIds.add(taskId);
|
|
|
|
|
+ groupFinishedWellPair.put(uniqueKey, existTaskIds);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
// 设置每个任务的工作量数据 单位相同的工作量值作合并处理
|
|
// 设置每个任务的工作量数据 单位相同的工作量值作合并处理
|
|
|
List<IotTaskAttrModelProperty> taskAttrs = report.getExtProperty();
|
|
List<IotTaskAttrModelProperty> taskAttrs = report.getExtProperty();
|
|
@@ -1590,8 +1614,11 @@ public class IotRdDailyReportController {
|
|
|
if (groupRunCountPair.containsKey(uniqueKey)) {
|
|
if (groupRunCountPair.containsKey(uniqueKey)) {
|
|
|
groupIdRunCountPair.put(groupId, groupRunCountPair.get(uniqueKey));
|
|
groupIdRunCountPair.put(groupId, groupRunCountPair.get(uniqueKey));
|
|
|
}
|
|
}
|
|
|
- if (groupCumulativeWorkingWellPair.containsKey(uniqueKey)) {
|
|
|
|
|
|
|
+ /* if (groupCumulativeWorkingWellPair.containsKey(uniqueKey)) {
|
|
|
groupIdCumulativeWorkingWellPair.put(groupId, groupCumulativeWorkingWellPair.get(uniqueKey));
|
|
groupIdCumulativeWorkingWellPair.put(groupId, groupCumulativeWorkingWellPair.get(uniqueKey));
|
|
|
|
|
+ } */
|
|
|
|
|
+ if (groupFinishedWellPair.containsKey(uniqueKey)) {
|
|
|
|
|
+ groupIdFinishedWellPair.put(groupId, groupFinishedWellPair.get(uniqueKey));
|
|
|
}
|
|
}
|
|
|
if (groupHourCountPair.containsKey(uniqueKey)) {
|
|
if (groupHourCountPair.containsKey(uniqueKey)) {
|
|
|
groupIdHourCountPair.put(groupId, groupHourCountPair.get(uniqueKey));
|
|
groupIdHourCountPair.put(groupId, groupHourCountPair.get(uniqueKey));
|
|
@@ -1965,7 +1992,7 @@ public class IotRdDailyReportController {
|
|
|
// 趟数
|
|
// 趟数
|
|
|
findAndThen(groupIdRunCountPair, reportVO.getId(), runCount -> reportVO.setGroupIdRunCount(runCount));
|
|
findAndThen(groupIdRunCountPair, reportVO.getId(), runCount -> reportVO.setGroupIdRunCount(runCount));
|
|
|
// 井数
|
|
// 井数
|
|
|
- findAndThen(groupIdCumulativeWorkingWellPair, reportVO.getId(), workingWell -> reportVO.setGroupIdCumulativeWorkingWell(workingWell));
|
|
|
|
|
|
|
+ findAndThen(groupIdFinishedWellPair, reportVO.getId(), workingWells -> reportVO.setGroupIdCumulativeWorkingWell(new BigDecimal(workingWells.size())));
|
|
|
// 小时H
|
|
// 小时H
|
|
|
findAndThen(groupIdHourCountPair, reportVO.getId(), hourCount -> reportVO.setGroupIdHourCount(hourCount));
|
|
findAndThen(groupIdHourCountPair, reportVO.getId(), hourCount -> reportVO.setGroupIdHourCount(hourCount));
|
|
|
// 油耗
|
|
// 油耗
|
|
@@ -2031,6 +2058,9 @@ public class IotRdDailyReportController {
|
|
|
// key 部门id-队伍id value队伍工作量数据 台次 当日泵车台次 当日仪表/混砂
|
|
// key 部门id-队伍id value队伍工作量数据 台次 当日泵车台次 当日仪表/混砂
|
|
|
Map<String, BigDecimal> groupMixSandPair = new HashMap<>();
|
|
Map<String, BigDecimal> groupMixSandPair = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
+ // key 部门id-队伍id value 完工井id集合
|
|
|
|
|
+ Map<String, Set<Long>> groupFinishedWellPair = new HashMap<>();
|
|
|
|
|
+
|
|
|
// key小组最后1条记录id value 桥塞(个数)
|
|
// key小组最后1条记录id value 桥塞(个数)
|
|
|
Map<Long, BigDecimal> groupIdBridgePlugPair = new HashMap<>();
|
|
Map<Long, BigDecimal> groupIdBridgePlugPair = new HashMap<>();
|
|
|
// key小组最后1条记录id value趟数
|
|
// key小组最后1条记录id value趟数
|
|
@@ -2051,6 +2081,10 @@ public class IotRdDailyReportController {
|
|
|
Map<Long, BigDecimal> groupIdMixSandPair = new HashMap<>();
|
|
Map<Long, BigDecimal> groupIdMixSandPair = new HashMap<>();
|
|
|
// 已经完工的任务id集合
|
|
// 已经完工的任务id集合
|
|
|
Set<Long> finishedTaskIds = new HashSet<>();
|
|
Set<Long> finishedTaskIds = new HashSet<>();
|
|
|
|
|
+
|
|
|
|
|
+ // key小组最后1条记录id value完工井id集合
|
|
|
|
|
+ Map<Long, Set<Long>> groupIdFinishedWellPair = new HashMap<>();
|
|
|
|
|
+
|
|
|
// key日报id value生产动态明细
|
|
// key日报id value生产动态明细
|
|
|
Map<Long, List<IotRdDailyReportDetailRespVO>> reportDetailsPair = new HashMap<>();
|
|
Map<Long, List<IotRdDailyReportDetailRespVO>> reportDetailsPair = new HashMap<>();
|
|
|
|
|
|
|
@@ -2094,6 +2128,21 @@ public class IotRdDailyReportController {
|
|
|
groupFuelPair.put(uniqueKey, dailyFuel);
|
|
groupFuelPair.put(uniqueKey, dailyFuel);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 累计完工井
|
|
|
|
|
+ // 日报关联的任务井id
|
|
|
|
|
+ Long taskId = report.getTaskId();
|
|
|
|
|
+ if (ObjUtil.isNotEmpty(taskId) && finishedTaskIds.contains(taskId)) {
|
|
|
|
|
+ if (groupFinishedWellPair.containsKey(uniqueKey)) {
|
|
|
|
|
+ Set<Long> existTaskIds = groupFinishedWellPair.get(uniqueKey);
|
|
|
|
|
+ existTaskIds.add(taskId);
|
|
|
|
|
+ groupFinishedWellPair.put(uniqueKey, existTaskIds);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ Set<Long> existTaskIds = new HashSet<>();
|
|
|
|
|
+ existTaskIds.add(taskId);
|
|
|
|
|
+ groupFinishedWellPair.put(uniqueKey, existTaskIds);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 设置每个任务的工作量数据 单位相同的工作量值作合并处理
|
|
// 设置每个任务的工作量数据 单位相同的工作量值作合并处理
|
|
|
List<IotTaskAttrModelProperty> taskAttrs = report.getExtProperty();
|
|
List<IotTaskAttrModelProperty> taskAttrs = report.getExtProperty();
|
|
|
// 暂存不同单位的工作量属性值
|
|
// 暂存不同单位的工作量属性值
|
|
@@ -2247,8 +2296,11 @@ public class IotRdDailyReportController {
|
|
|
if (groupRunCountPair.containsKey(uniqueKey)) {
|
|
if (groupRunCountPair.containsKey(uniqueKey)) {
|
|
|
groupIdRunCountPair.put(groupId, groupRunCountPair.get(uniqueKey));
|
|
groupIdRunCountPair.put(groupId, groupRunCountPair.get(uniqueKey));
|
|
|
}
|
|
}
|
|
|
- if (groupCumulativeWorkingWellPair.containsKey(uniqueKey)) {
|
|
|
|
|
|
|
+ /* if (groupCumulativeWorkingWellPair.containsKey(uniqueKey)) {
|
|
|
groupIdCumulativeWorkingWellPair.put(groupId, groupCumulativeWorkingWellPair.get(uniqueKey));
|
|
groupIdCumulativeWorkingWellPair.put(groupId, groupCumulativeWorkingWellPair.get(uniqueKey));
|
|
|
|
|
+ } */
|
|
|
|
|
+ if (groupFinishedWellPair.containsKey(uniqueKey)) {
|
|
|
|
|
+ groupIdFinishedWellPair.put(groupId, groupFinishedWellPair.get(uniqueKey));
|
|
|
}
|
|
}
|
|
|
if (groupHourCountPair.containsKey(uniqueKey)) {
|
|
if (groupHourCountPair.containsKey(uniqueKey)) {
|
|
|
groupIdHourCountPair.put(groupId, groupHourCountPair.get(uniqueKey));
|
|
groupIdHourCountPair.put(groupId, groupHourCountPair.get(uniqueKey));
|
|
@@ -2628,7 +2680,7 @@ public class IotRdDailyReportController {
|
|
|
// 趟数
|
|
// 趟数
|
|
|
findAndThen(groupIdRunCountPair, reportVO.getId(), runCount -> reportVO.setGroupIdRunCount(runCount));
|
|
findAndThen(groupIdRunCountPair, reportVO.getId(), runCount -> reportVO.setGroupIdRunCount(runCount));
|
|
|
// 井数
|
|
// 井数
|
|
|
- findAndThen(groupIdCumulativeWorkingWellPair, reportVO.getId(), workingWell -> reportVO.setGroupIdCumulativeWorkingWell(workingWell));
|
|
|
|
|
|
|
+ findAndThen(groupIdFinishedWellPair, reportVO.getId(), workingWells -> reportVO.setGroupIdCumulativeWorkingWell(new BigDecimal(workingWells.size())));
|
|
|
// 小时H
|
|
// 小时H
|
|
|
findAndThen(groupIdHourCountPair, reportVO.getId(), hourCount -> reportVO.setGroupIdHourCount(hourCount));
|
|
findAndThen(groupIdHourCountPair, reportVO.getId(), hourCount -> reportVO.setGroupIdHourCount(hourCount));
|
|
|
// 油耗
|
|
// 油耗
|