|
@@ -394,14 +394,6 @@ public class IotRhDailyReportServiceImpl implements IotRhDailyReportService {
|
|
|
pageReqVO.getTaskIds(), pageReqVO.getProjectIds(), ids);
|
|
pageReqVO.getTaskIds(), pageReqVO.getProjectIds(), ids);
|
|
|
List<IotRhDailyReportDO> dailyReports = page.getRecords();
|
|
List<IotRhDailyReportDO> dailyReports = page.getRecords();
|
|
|
|
|
|
|
|
- // key队伍id/项目部id value累计注气量
|
|
|
|
|
- Map<Long, BigDecimal> cumulativeGasInjectionPair = new HashMap<>();
|
|
|
|
|
- // key队伍id/项目部id value累计注水量
|
|
|
|
|
- Map<Long, BigDecimal> cumulativeWaterInjectionPair = new HashMap<>();
|
|
|
|
|
- // key队伍id/项目部id value累计用电
|
|
|
|
|
- Map<Long, BigDecimal> cumulativePowerConsumptionPair = new HashMap<>();
|
|
|
|
|
- // key队伍id/项目部id value累计油耗
|
|
|
|
|
- Map<Long, BigDecimal> cumulativeFuelConsumptionPair = new HashMap<>();
|
|
|
|
|
// 默认显示所有项目部的汇总数据(新疆分公司也展示 下属各项目部的数据)
|
|
// 默认显示所有项目部的汇总数据(新疆分公司也展示 下属各项目部的数据)
|
|
|
// 点击项目部 显示 下属队伍的数据
|
|
// 点击项目部 显示 下属队伍的数据
|
|
|
// 首先判断点击的部门是属于 公司 还是 队伍 如果没有点击任何部门 默认查询所有项目部数据
|
|
// 首先判断点击的部门是属于 公司 还是 队伍 如果没有点击任何部门 默认查询所有项目部数据
|
|
@@ -456,6 +448,10 @@ public class IotRhDailyReportServiceImpl implements IotRhDailyReportService {
|
|
|
Map<Long, BigDecimal> cumulativeWaterInjectionPair = new HashMap<>();
|
|
Map<Long, BigDecimal> cumulativeWaterInjectionPair = new HashMap<>();
|
|
|
// key队伍id/项目部id value累计用电
|
|
// key队伍id/项目部id value累计用电
|
|
|
Map<Long, BigDecimal> cumulativePowerConsumptionPair = new HashMap<>();
|
|
Map<Long, BigDecimal> cumulativePowerConsumptionPair = new HashMap<>();
|
|
|
|
|
+ // key队伍id/项目部id value对应项目部的总产能
|
|
|
|
|
+ Map<Long, BigDecimal> cumulativeCapacityPair = new HashMap<>();
|
|
|
|
|
+ // key队伍id/项目部id value累计运行时效 累计注气量/累计产能
|
|
|
|
|
+ Map<Long, BigDecimal> cumulativeTransitTimePair = new HashMap<>();
|
|
|
|
|
|
|
|
// 以项目部为维度统计数据
|
|
// 以项目部为维度统计数据
|
|
|
// 找到所有项目部与队伍的对应关系
|
|
// 找到所有项目部与队伍的对应关系
|
|
@@ -474,6 +470,10 @@ public class IotRhDailyReportServiceImpl implements IotRhDailyReportService {
|
|
|
teamProjectIdPair.put(dept.getId(), dept.getParentId());
|
|
teamProjectIdPair.put(dept.getId(), dept.getParentId());
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ // 查询指定部门下相关设备的产能
|
|
|
|
|
+ // key队伍id value队伍下相关设备产能
|
|
|
|
|
+ Map<Long, BigDecimal> teamCapacityPair = queryCapacities(new ArrayList<>(allRhChildDeptIds));
|
|
|
|
|
+
|
|
|
// 累计计算各项指标
|
|
// 累计计算各项指标
|
|
|
if (CollUtil.isNotEmpty(dailyReports)) {
|
|
if (CollUtil.isNotEmpty(dailyReports)) {
|
|
|
dailyReports.forEach(report -> {
|
|
dailyReports.forEach(report -> {
|
|
@@ -486,9 +486,28 @@ public class IotRhDailyReportServiceImpl implements IotRhDailyReportService {
|
|
|
cumulativeWaterInjectionPair.merge(projectDeptId, report.getDailyWaterInjection(), BigDecimal::add);
|
|
cumulativeWaterInjectionPair.merge(projectDeptId, report.getDailyWaterInjection(), BigDecimal::add);
|
|
|
// 累计用电量
|
|
// 累计用电量
|
|
|
cumulativePowerConsumptionPair.merge(projectDeptId, report.getDailyPowerUsage(), BigDecimal::add);
|
|
cumulativePowerConsumptionPair.merge(projectDeptId, report.getDailyPowerUsage(), BigDecimal::add);
|
|
|
|
|
+ if (teamCapacityPair.containsKey(report.getDeptId())) {
|
|
|
|
|
+ BigDecimal tempCapacity = teamCapacityPair.get(report.getDeptId());
|
|
|
|
|
+ cumulativeCapacityPair.merge(projectDeptId, tempCapacity, BigDecimal::add);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
+ // 根据 累计注气量 累计产能 计算指定项目部下的平均产能
|
|
|
|
|
+ if (CollUtil.isNotEmpty(cumulativeGasInjectionPair) && CollUtil.isNotEmpty(cumulativeCapacityPair)) {
|
|
|
|
|
+ cumulativeGasInjectionPair.forEach((projectDeptId, cumulativeGasInjection) -> {
|
|
|
|
|
+ if (cumulativeCapacityPair.containsKey(projectDeptId)) {
|
|
|
|
|
+ BigDecimal tempCapacity = cumulativeCapacityPair.get(projectDeptId);
|
|
|
|
|
+ if (tempCapacity.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
|
|
+ // 指定项目部的累计运行时效
|
|
|
|
|
+ BigDecimal tempTransitTime = cumulativeGasInjection.divide(tempCapacity, 4, RoundingMode.HALF_UP);
|
|
|
|
|
+ cumulativeTransitTimePair.put(projectDeptId, tempTransitTime);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ cumulativeTransitTimePair.put(projectDeptId, BigDecimal.ZERO);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 生成返回的数据列表集合
|
|
// 生成返回的数据列表集合
|
|
@@ -501,6 +520,7 @@ public class IotRhDailyReportServiceImpl implements IotRhDailyReportService {
|
|
|
statistics.setCumulativeGasInjection(cumulativeGasInjectionPair.get(deptId));
|
|
statistics.setCumulativeGasInjection(cumulativeGasInjectionPair.get(deptId));
|
|
|
statistics.setCumulativeWaterInjection(cumulativeWaterInjectionPair.get(deptId));
|
|
statistics.setCumulativeWaterInjection(cumulativeWaterInjectionPair.get(deptId));
|
|
|
statistics.setCumulativePowerConsumption(cumulativePowerConsumptionPair.get(deptId));
|
|
statistics.setCumulativePowerConsumption(cumulativePowerConsumptionPair.get(deptId));
|
|
|
|
|
+ statistics.setTransitTime(cumulativeTransitTimePair.get(deptId));
|
|
|
result.add(statistics);
|
|
result.add(statistics);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -530,6 +550,10 @@ public class IotRhDailyReportServiceImpl implements IotRhDailyReportService {
|
|
|
Map<Long, BigDecimal> cumulativeWaterInjectionPair = new HashMap<>();
|
|
Map<Long, BigDecimal> cumulativeWaterInjectionPair = new HashMap<>();
|
|
|
// key队伍id value累计用电
|
|
// key队伍id value累计用电
|
|
|
Map<Long, BigDecimal> cumulativePowerConsumptionPair = new HashMap<>();
|
|
Map<Long, BigDecimal> cumulativePowerConsumptionPair = new HashMap<>();
|
|
|
|
|
+ // key队伍id/项目部id value对应项目部的总产能
|
|
|
|
|
+ Map<Long, BigDecimal> cumulativeCapacityPair = new HashMap<>();
|
|
|
|
|
+ // key队伍id/项目部id value累计运行时效 累计注气量/累计产能
|
|
|
|
|
+ Map<Long, BigDecimal> cumulativeTransitTimePair = new HashMap<>();
|
|
|
|
|
|
|
|
// 以 队伍 为维度统计数据
|
|
// 以 队伍 为维度统计数据
|
|
|
// 找到所有项目部与队伍的对应关系
|
|
// 找到所有项目部与队伍的对应关系
|
|
@@ -549,6 +573,10 @@ public class IotRhDailyReportServiceImpl implements IotRhDailyReportService {
|
|
|
teamProjectIdPair.put(dept.getId(), dept.getParentId());
|
|
teamProjectIdPair.put(dept.getId(), dept.getParentId());
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ // 查询指定部门下相关设备的产能
|
|
|
|
|
+ // key队伍id value队伍下相关设备产能
|
|
|
|
|
+ Map<Long, BigDecimal> teamCapacityPair = queryCapacities(new ArrayList<>(allRhChildDeptIds));
|
|
|
|
|
+
|
|
|
// 累计计算各项指标
|
|
// 累计计算各项指标
|
|
|
if (CollUtil.isNotEmpty(dailyReports)) {
|
|
if (CollUtil.isNotEmpty(dailyReports)) {
|
|
|
dailyReports.forEach(report -> {
|
|
dailyReports.forEach(report -> {
|
|
@@ -559,8 +587,25 @@ public class IotRhDailyReportServiceImpl implements IotRhDailyReportService {
|
|
|
cumulativeWaterInjectionPair.merge(report.getDeptId(), report.getDailyWaterInjection(), BigDecimal::add);
|
|
cumulativeWaterInjectionPair.merge(report.getDeptId(), report.getDailyWaterInjection(), BigDecimal::add);
|
|
|
// 累计用电量
|
|
// 累计用电量
|
|
|
cumulativePowerConsumptionPair.merge(report.getDeptId(), report.getDailyPowerUsage(), BigDecimal::add);
|
|
cumulativePowerConsumptionPair.merge(report.getDeptId(), report.getDailyPowerUsage(), BigDecimal::add);
|
|
|
|
|
+ if (teamCapacityPair.containsKey(report.getDeptId())) {
|
|
|
|
|
+ BigDecimal tempCapacity = teamCapacityPair.get(report.getDeptId());
|
|
|
|
|
+ cumulativeCapacityPair.merge(report.getDeptId(), tempCapacity, BigDecimal::add);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
+ // 根据 累计注气量 累计产能 计算指定队伍下的平均产能
|
|
|
|
|
+ if (CollUtil.isNotEmpty(cumulativeGasInjectionPair) && CollUtil.isNotEmpty(cumulativeCapacityPair)) {
|
|
|
|
|
+ cumulativeGasInjectionPair.forEach((teamDeptId, cumulativeGasInjection) -> {
|
|
|
|
|
+ if (cumulativeCapacityPair.containsKey(teamDeptId)) {
|
|
|
|
|
+ BigDecimal tempCapacity = cumulativeCapacityPair.get(teamDeptId);
|
|
|
|
|
+ if (tempCapacity.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
|
|
+ // 指定队伍的累计运行时效
|
|
|
|
|
+ BigDecimal tempTransitTime = cumulativeGasInjection.divide(tempCapacity);
|
|
|
|
|
+ cumulativeTransitTimePair.put(teamDeptId, tempTransitTime);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 生成返回的数据列表集合
|
|
// 生成返回的数据列表集合
|
|
@@ -573,6 +618,7 @@ public class IotRhDailyReportServiceImpl implements IotRhDailyReportService {
|
|
|
statistics.setCumulativeGasInjection(cumulativeGasInjectionPair.get(teamDeptId));
|
|
statistics.setCumulativeGasInjection(cumulativeGasInjectionPair.get(teamDeptId));
|
|
|
statistics.setCumulativeWaterInjection(cumulativeWaterInjectionPair.get(teamDeptId));
|
|
statistics.setCumulativeWaterInjection(cumulativeWaterInjectionPair.get(teamDeptId));
|
|
|
statistics.setCumulativePowerConsumption(cumulativePowerConsumptionPair.get(teamDeptId));
|
|
statistics.setCumulativePowerConsumption(cumulativePowerConsumptionPair.get(teamDeptId));
|
|
|
|
|
+ statistics.setTransitTime(cumulativeTransitTimePair.get(teamDeptId));
|
|
|
result.add(statistics);
|
|
result.add(statistics);
|
|
|
});
|
|
});
|
|
|
|
|
|