|
|
@@ -157,6 +157,22 @@ public class IotRdDailyReportServiceImpl implements IotRdDailyReportService {
|
|
|
|
|
|
@Override
|
|
|
public PageResult<IotRdDailyReportDO> getIotRdDailyReportPage(IotRdDailyReportPageReqVO pageReqVO) {
|
|
|
+ // 查询选择部门下面所有子部门
|
|
|
+ Set<Long> ids = new HashSet<>();
|
|
|
+ if (Objects.nonNull(pageReqVO.getDeptId())) {
|
|
|
+ ids = deptService.getChildDeptIdListFromCache(pageReqVO.getDeptId());
|
|
|
+ ids.add(pageReqVO.getDeptId());
|
|
|
+ pageReqVO.setDeptIds(ids);
|
|
|
+ }
|
|
|
+ // 检查contractName不为空但projectIds为空的情况
|
|
|
+ if (StrUtil.isNotBlank(pageReqVO.getContractName()) && (CollUtil.isEmpty(pageReqVO.getProjectIds()))) {
|
|
|
+ return new PageResult<>(Collections.emptyList(), 0L);
|
|
|
+ }
|
|
|
+ // 检查taskName不为空但taskIds为空的情况
|
|
|
+ if (StrUtil.isNotBlank(pageReqVO.getTaskName()) && (CollUtil.isEmpty(pageReqVO.getTaskIds()))) {
|
|
|
+ return new PageResult<>(Collections.emptyList(), 0L);
|
|
|
+ }
|
|
|
+
|
|
|
return iotRdDailyReportMapper.selectPage(pageReqVO);
|
|
|
}
|
|
|
|
|
|
@@ -173,6 +189,14 @@ public class IotRdDailyReportServiceImpl implements IotRdDailyReportService {
|
|
|
@Override
|
|
|
public List<IotRdDailyReportStatisticsRespVO> statistics(IotRdDailyReportPageReqVO pageReqVO) {
|
|
|
List<IotRdDailyReportStatisticsRespVO> result = new ArrayList<>();
|
|
|
+ // 检查contractName不为空但projectIds为空的情况
|
|
|
+ if (StrUtil.isNotBlank(pageReqVO.getContractName()) && (CollUtil.isEmpty(pageReqVO.getProjectIds()))) {
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ // 检查taskName不为空但taskIds为空的情况
|
|
|
+ if (StrUtil.isNotBlank(pageReqVO.getTaskName()) && (CollUtil.isEmpty(pageReqVO.getTaskIds()))) {
|
|
|
+ return result;
|
|
|
+ }
|
|
|
// 按照项目部统计日报 先查询瑞都所有部门 163l
|
|
|
Set<Long> rdChildDeptIds = deptService.getChildDeptIdListFromCache(163l);
|
|
|
List<DeptDO> depts =deptService.getDeptList(rdChildDeptIds);
|
|
|
@@ -196,7 +220,7 @@ public class IotRdDailyReportServiceImpl implements IotRdDailyReportService {
|
|
|
}
|
|
|
// 查询所有瑞都日报
|
|
|
IotRdDailyReportPageReqVO reqVO = new IotRdDailyReportPageReqVO();
|
|
|
- List<IotRdDailyReportDO> dailyReports = iotRdDailyReportMapper.dailyReports(reqVO);
|
|
|
+ List<IotRdDailyReportDO> dailyReports = iotRdDailyReportMapper.dailyReports(pageReqVO);
|
|
|
// key项目id value项目甲方名称
|
|
|
Map<Long, String> projectPair = new HashMap<>();
|
|
|
// key任务id value任务井号
|
|
|
@@ -277,7 +301,7 @@ public class IotRdDailyReportServiceImpl implements IotRdDailyReportService {
|
|
|
});
|
|
|
}
|
|
|
// 设置 小队 任务已经完成的工作量集合 (按照不同的单位统计任务的不同工作量)
|
|
|
- // key队伍id value队伍工作量数据
|
|
|
+ // key任务井id value队伍工作量数据
|
|
|
Map<Long, BigDecimal> bridgePlugPair = new HashMap<>();
|
|
|
Map<Long, BigDecimal> runCountPair = new HashMap<>();
|
|
|
Map<Long, BigDecimal> cumulativeWorkingWellPair = new HashMap<>();
|
|
|
@@ -318,27 +342,27 @@ public class IotRdDailyReportServiceImpl implements IotRdDailyReportService {
|
|
|
tempTotalBridgePlug = tempTotalBridgePlug.add(actualValue);
|
|
|
if (bridgePlugPair.containsKey(report.getDeptId())) {
|
|
|
BigDecimal tempBridgePlug = bridgePlugPair.get(report.getDeptId());
|
|
|
- bridgePlugPair.put(report.getDeptId(), tempTotalBridgePlug.add(tempBridgePlug));
|
|
|
+ bridgePlugPair.put(report.getTaskId(), tempTotalBridgePlug.add(tempBridgePlug));
|
|
|
} else {
|
|
|
- bridgePlugPair.put(report.getDeptId(), tempTotalBridgePlug);
|
|
|
+ bridgePlugPair.put(report.getTaskId(), tempTotalBridgePlug);
|
|
|
}
|
|
|
}
|
|
|
if ("趟数".equals(unit)) {
|
|
|
tempTotalRunCount = tempTotalRunCount.add(actualValue);
|
|
|
if (runCountPair.containsKey(report.getDeptId())) {
|
|
|
BigDecimal tempRunCount = runCountPair.get(report.getDeptId());
|
|
|
- runCountPair.put(report.getDeptId(), tempTotalRunCount.add(tempRunCount));
|
|
|
+ runCountPair.put(report.getTaskId(), tempTotalRunCount.add(tempRunCount));
|
|
|
} else {
|
|
|
- runCountPair.put(report.getDeptId(), tempTotalRunCount);
|
|
|
+ runCountPair.put(report.getTaskId(), tempTotalRunCount);
|
|
|
}
|
|
|
}
|
|
|
if ("小时".equals(unit)) {
|
|
|
tempTotalHourCount = tempTotalHourCount.add(actualValue);
|
|
|
if (hourCountPair.containsKey(report.getDeptId())) {
|
|
|
BigDecimal tempHourCount = hourCountPair.get(report.getDeptId());
|
|
|
- hourCountPair.put(report.getDeptId(), tempTotalHourCount.add(tempHourCount));
|
|
|
+ hourCountPair.put(report.getTaskId(), tempTotalHourCount.add(tempHourCount));
|
|
|
} else {
|
|
|
- hourCountPair.put(report.getDeptId(), tempTotalHourCount);
|
|
|
+ hourCountPair.put(report.getTaskId(), tempTotalHourCount);
|
|
|
}
|
|
|
}
|
|
|
if ("天数".equals(unit)) {
|
|
|
@@ -347,27 +371,27 @@ public class IotRdDailyReportServiceImpl implements IotRdDailyReportService {
|
|
|
tempTotalHourCount = tempTotalHourCount.add(hours);
|
|
|
if (hourCountPair.containsKey(report.getDeptId())) {
|
|
|
BigDecimal tempHourCount = hourCountPair.get(report.getDeptId());
|
|
|
- hourCountPair.put(report.getDeptId(), tempTotalHourCount.add(tempHourCount));
|
|
|
+ hourCountPair.put(report.getTaskId(), tempTotalHourCount.add(tempHourCount));
|
|
|
} else {
|
|
|
- hourCountPair.put(report.getDeptId(), tempTotalHourCount);
|
|
|
+ hourCountPair.put(report.getTaskId(), tempTotalHourCount);
|
|
|
}
|
|
|
}
|
|
|
if ("方".equals(unit)) {
|
|
|
tempTotalWaterVolume = tempTotalWaterVolume.add(actualValue);
|
|
|
if (waterVolumePair.containsKey(report.getDeptId())) {
|
|
|
BigDecimal tempWaterVolume = waterVolumePair.get(report.getDeptId());
|
|
|
- waterVolumePair.put(report.getDeptId(), tempTotalWaterVolume.add(tempWaterVolume));
|
|
|
+ waterVolumePair.put(report.getTaskId(), tempTotalWaterVolume.add(tempWaterVolume));
|
|
|
} else {
|
|
|
- waterVolumePair.put(report.getDeptId(), tempTotalWaterVolume);
|
|
|
+ waterVolumePair.put(report.getTaskId(), tempTotalWaterVolume);
|
|
|
}
|
|
|
}
|
|
|
if ("井数".equals(unit)) {
|
|
|
tempTotalCumulativeWorkingWell = tempTotalCumulativeWorkingWell.add(actualValue);
|
|
|
if (cumulativeWorkingWellPair.containsKey(report.getDeptId())) {
|
|
|
BigDecimal tempWorkingWell = cumulativeWorkingWellPair.get(report.getDeptId());
|
|
|
- cumulativeWorkingWellPair.put(report.getDeptId(), tempTotalCumulativeWorkingWell.add(tempWorkingWell));
|
|
|
+ cumulativeWorkingWellPair.put(report.getTaskId(), tempTotalCumulativeWorkingWell.add(tempWorkingWell));
|
|
|
} else {
|
|
|
- cumulativeWorkingWellPair.put(report.getDeptId(), tempTotalCumulativeWorkingWell);
|
|
|
+ cumulativeWorkingWellPair.put(report.getTaskId(), tempTotalCumulativeWorkingWell);
|
|
|
}
|
|
|
}
|
|
|
if ("段数".equals(unit)) {
|
|
|
@@ -375,27 +399,27 @@ public class IotRdDailyReportServiceImpl implements IotRdDailyReportService {
|
|
|
tempTotalCumulativeWorkingLayers = tempTotalCumulativeWorkingLayers.add(actualValue);
|
|
|
if (cumulativeWorkingLayersPair.containsKey(report.getDeptId())) {
|
|
|
BigDecimal tempWorkingLayer = cumulativeWorkingLayersPair.get(report.getDeptId());
|
|
|
- cumulativeWorkingLayersPair.put(report.getDeptId(), tempTotalCumulativeWorkingLayers.add(tempWorkingLayer));
|
|
|
+ cumulativeWorkingLayersPair.put(report.getTaskId(), tempTotalCumulativeWorkingLayers.add(tempWorkingLayer));
|
|
|
} else {
|
|
|
- cumulativeWorkingLayersPair.put(report.getDeptId(), tempTotalCumulativeWorkingLayers);
|
|
|
+ cumulativeWorkingLayersPair.put(report.getTaskId(), tempTotalCumulativeWorkingLayers);
|
|
|
}
|
|
|
}
|
|
|
if ("台次".equals(unit) && "当日泵车台次".equals(attr.getName())) {
|
|
|
tempTotalPumpTrips = tempTotalPumpTrips.add(actualValue);
|
|
|
if (pumpTripsPair.containsKey(report.getDeptId())) {
|
|
|
BigDecimal tempPumpTrips = pumpTripsPair.get(report.getDeptId());
|
|
|
- pumpTripsPair.put(report.getDeptId(), tempTotalPumpTrips.add(tempPumpTrips));
|
|
|
+ pumpTripsPair.put(report.getTaskId(), tempTotalPumpTrips.add(tempPumpTrips));
|
|
|
} else {
|
|
|
- pumpTripsPair.put(report.getDeptId(), tempTotalPumpTrips);
|
|
|
+ pumpTripsPair.put(report.getTaskId(), tempTotalPumpTrips);
|
|
|
}
|
|
|
}
|
|
|
if ("台次".equals(unit) && ("当日仪表/混砂".equals(attr.getName()))) {
|
|
|
tempTotalMixSand = tempTotalMixSand.add(actualValue);
|
|
|
if (mixSandPair.containsKey(report.getDeptId())) {
|
|
|
BigDecimal tempMixSand = mixSandPair.get(report.getDeptId());
|
|
|
- mixSandPair.put(report.getDeptId(), tempTotalMixSand.add(tempMixSand));
|
|
|
+ mixSandPair.put(report.getTaskId(), tempTotalMixSand.add(tempMixSand));
|
|
|
} else {
|
|
|
- mixSandPair.put(report.getDeptId(), tempTotalMixSand);
|
|
|
+ mixSandPair.put(report.getTaskId(), tempTotalMixSand);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -448,60 +472,60 @@ public class IotRdDailyReportServiceImpl implements IotRdDailyReportService {
|
|
|
uniqueReport.setWorkloadDesign(taskWorkloadPair.get(taskId));
|
|
|
}
|
|
|
// 以队伍为维度 设置每种施工工艺的工作量 总和
|
|
|
- if (bridgePlugPair.containsKey(deptId)) {
|
|
|
+ if (bridgePlugPair.containsKey(taskId)) {
|
|
|
// 钻可溶桥塞 钻复合桥塞
|
|
|
IotRdDailyReportStatisticsItemVO item = new IotRdDailyReportStatisticsItemVO();
|
|
|
item.setUnit("个数");
|
|
|
- item.setWorkload(bridgePlugPair.get(deptId));
|
|
|
+ item.setWorkload(bridgePlugPair.get(taskId));
|
|
|
items.add(item);
|
|
|
}
|
|
|
- if (runCountPair.containsKey(deptId)) {
|
|
|
+ if (runCountPair.containsKey(taskId)) {
|
|
|
// 通刮洗 冲砂
|
|
|
IotRdDailyReportStatisticsItemVO item = new IotRdDailyReportStatisticsItemVO();
|
|
|
item.setUnit("趟数");
|
|
|
- item.setWorkload(runCountPair.get(deptId));
|
|
|
+ item.setWorkload(runCountPair.get(taskId));
|
|
|
items.add(item);
|
|
|
}
|
|
|
- if (hourCountPair.containsKey(deptId)) {
|
|
|
+ if (hourCountPair.containsKey(taskId)) {
|
|
|
// 液氮泵车(时间D) 千型泵车(时间H)
|
|
|
IotRdDailyReportStatisticsItemVO item = new IotRdDailyReportStatisticsItemVO();
|
|
|
item.setUnit("小时");
|
|
|
- item.setWorkload(hourCountPair.get(deptId));
|
|
|
+ item.setWorkload(hourCountPair.get(taskId));
|
|
|
items.add(item);
|
|
|
}
|
|
|
- if (waterVolumePair.containsKey(deptId)) {
|
|
|
+ if (waterVolumePair.containsKey(taskId)) {
|
|
|
// 注水
|
|
|
IotRdDailyReportStatisticsItemVO item = new IotRdDailyReportStatisticsItemVO();
|
|
|
item.setUnit("方");
|
|
|
- item.setWorkload(waterVolumePair.get(deptId));
|
|
|
+ item.setWorkload(waterVolumePair.get(taskId));
|
|
|
items.add(item);
|
|
|
}
|
|
|
- if (cumulativeWorkingWellPair.containsKey(deptId)) {
|
|
|
+ if (cumulativeWorkingWellPair.containsKey(taskId)) {
|
|
|
// 连续油管常规作业
|
|
|
IotRdDailyReportStatisticsItemVO item = new IotRdDailyReportStatisticsItemVO();
|
|
|
item.setUnit("井数");
|
|
|
- item.setWorkload(cumulativeWorkingWellPair.get(deptId));
|
|
|
+ item.setWorkload(cumulativeWorkingWellPair.get(taskId));
|
|
|
items.add(item);
|
|
|
}
|
|
|
- if (cumulativeWorkingLayersPair.containsKey(deptId)) {
|
|
|
+ if (cumulativeWorkingLayersPair.containsKey(taskId)) {
|
|
|
// 压裂大包 压裂总包
|
|
|
IotRdDailyReportStatisticsItemVO item = new IotRdDailyReportStatisticsItemVO();
|
|
|
item.setUnit("段数");
|
|
|
- item.setWorkload(cumulativeWorkingLayersPair.get(deptId));
|
|
|
+ item.setWorkload(cumulativeWorkingLayersPair.get(taskId));
|
|
|
items.add(item);
|
|
|
}
|
|
|
- if (pumpTripsPair.containsKey(deptId)) {
|
|
|
+ if (pumpTripsPair.containsKey(taskId)) {
|
|
|
// 主压裂车 当日泵车台次
|
|
|
IotRdDailyReportStatisticsItemVO item = new IotRdDailyReportStatisticsItemVO();
|
|
|
item.setUnit("台次");
|
|
|
- item.setWorkload(pumpTripsPair.get(deptId));
|
|
|
+ item.setWorkload(pumpTripsPair.get(taskId));
|
|
|
items.add(item);
|
|
|
}
|
|
|
- if (mixSandPair.containsKey(deptId)) {
|
|
|
+ if (mixSandPair.containsKey(taskId)) {
|
|
|
// 当日仪表/混砂 台次
|
|
|
IotRdDailyReportStatisticsItemVO item = new IotRdDailyReportStatisticsItemVO();
|
|
|
item.setUnit("台次");
|
|
|
- item.setWorkload(mixSandPair.get(deptId));
|
|
|
+ item.setWorkload(mixSandPair.get(taskId));
|
|
|
items.add(item);
|
|
|
}
|
|
|
uniqueReport.setItems(items);
|