|
|
@@ -547,6 +547,30 @@ public class IotRhDailyReportController {
|
|
|
}
|
|
|
// 设备部门信息
|
|
|
Map<Long, DeptDO> deptMap = deptService.getDeptMap(convertList(reports, IotRhDailyReportDO::getDeptId));
|
|
|
+ Set<Long> projectDeptIds = new HashSet<>();
|
|
|
+ Map<Long, String> teamIdProjectNamePair = new HashMap<>();
|
|
|
+ // 查询施工队伍的上级项目部 计算气电比使用
|
|
|
+ if (CollUtil.isNotEmpty(deptMap)) {
|
|
|
+ deptMap.forEach((deptId, dept) -> {
|
|
|
+ projectDeptIds.add(dept.getParentId());
|
|
|
+ });
|
|
|
+ }
|
|
|
+ // 查询所有项目部的名称
|
|
|
+ Map<Long, DeptDO> projectDeptMap = new HashMap<>();
|
|
|
+ if (CollUtil.isNotEmpty(projectDeptIds)) {
|
|
|
+ projectDeptMap = deptService.getDeptMap(projectDeptIds);
|
|
|
+ }
|
|
|
+ // 设置施工队伍与 上级项目部对应关系
|
|
|
+ if (CollUtil.isNotEmpty(deptMap)) {
|
|
|
+ Map<Long, DeptDO> finalProjectDeptMap = projectDeptMap;
|
|
|
+ deptMap.forEach((deptId, dept) -> {
|
|
|
+ if (finalProjectDeptMap.containsKey(dept.getParentId())) {
|
|
|
+ DeptDO projectDept = finalProjectDeptMap.get(dept.getParentId());
|
|
|
+ teamIdProjectNamePair.put(deptId, projectDept.getName());
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
// key项目id value项目合同号
|
|
|
Map<Long, String> projectPair = new HashMap<>();
|
|
|
// key任务id value任务井号-施工区域
|
|
|
@@ -738,6 +762,21 @@ public class IotRhDailyReportController {
|
|
|
// 赋值
|
|
|
reportVO.setTransitTimeRate(transitTimeRate);
|
|
|
}
|
|
|
+ // 气电比 塔里木、吐哈-气/电 气/电/1.07-其它 气单位:方 电单位:KWh
|
|
|
+ if (teamIdProjectNamePair.containsKey(reportVO.getDeptId())) {
|
|
|
+ String deptName = teamIdProjectNamePair.get(reportVO.getDeptId());
|
|
|
+ BigDecimal power = reportVO.getDailyPowerUsage();
|
|
|
+ BigDecimal gas = reportVO.getDailyGasInjection();
|
|
|
+ if (power.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
+ BigDecimal tempResult = gas.divide(power, 4, RoundingMode.HALF_UP);
|
|
|
+ if (deptName.contains("塔里木") || deptName.contains("吐哈")) {
|
|
|
+ reportVO.setGasElectricityRatio(tempResult);
|
|
|
+ } else {
|
|
|
+ reportVO.setGasElectricityRatio(tempResult.divide(BigDecimal.valueOf(1.07), 4, RoundingMode.HALF_UP));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// 导出列表时 格式化时间为 yyyy-MM-dd
|
|
|
if (ObjUtil.isNotEmpty(reportVO.getCreateTime())) {
|
|
|
reportVO.setCreateTimeStr(LocalDateTimeUtil.format(reportVO.getCreateTime(), DatePattern.NORM_DATE_PATTERN));
|