|
@@ -1331,6 +1331,7 @@ public class IotRyDailyReportServiceImpl implements IotRyDailyReportService {
|
|
|
if (ObjUtil.isNotEmpty(deptId)) {
|
|
if (ObjUtil.isNotEmpty(deptId)) {
|
|
|
// 查询指定部门下所有子部门
|
|
// 查询指定部门下所有子部门
|
|
|
Set<Long> childDeptIds = deptService.getChildDeptIdListFromCache(deptId);
|
|
Set<Long> childDeptIds = deptService.getChildDeptIdListFromCache(deptId);
|
|
|
|
|
+ childDeptIds.add(deptId);
|
|
|
Map<Long, DeptDO> allDeptPair = deptService.getDeptMap(childDeptIds);
|
|
Map<Long, DeptDO> allDeptPair = deptService.getDeptMap(childDeptIds);
|
|
|
// 过滤掉关闭的部门
|
|
// 过滤掉关闭的部门
|
|
|
if (CollUtil.isNotEmpty(allDeptPair)) {
|
|
if (CollUtil.isNotEmpty(allDeptPair)) {
|
|
@@ -1353,7 +1354,10 @@ public class IotRyDailyReportServiceImpl implements IotRyDailyReportService {
|
|
|
List<IotDeptTypeDO> deptTypes = iotDeptTypeMapper.selectList(reqVO);
|
|
List<IotDeptTypeDO> deptTypes = iotDeptTypeMapper.selectList(reqVO);
|
|
|
if (CollUtil.isNotEmpty(deptTypes)) {
|
|
if (CollUtil.isNotEmpty(deptTypes)) {
|
|
|
deptTypes.forEach(dept -> {
|
|
deptTypes.forEach(dept -> {
|
|
|
- zjOrXjDeptIds.add(dept.getDeptId());
|
|
|
|
|
|
|
+ // 有的队伍不需要计入队伍总数
|
|
|
|
|
+ if (!"no".equals(dept.getUpdater())) {
|
|
|
|
|
+ zjOrXjDeptIds.add(dept.getDeptId());
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1580,7 +1584,9 @@ public class IotRyDailyReportServiceImpl implements IotRyDailyReportService {
|
|
|
List<IotDeptTypeDO> deptTypes = iotDeptTypeMapper.selectList(deptTypeReqVO);
|
|
List<IotDeptTypeDO> deptTypes = iotDeptTypeMapper.selectList(deptTypeReqVO);
|
|
|
if (CollUtil.isNotEmpty(deptTypes)) {
|
|
if (CollUtil.isNotEmpty(deptTypes)) {
|
|
|
deptTypes.forEach(dept -> {
|
|
deptTypes.forEach(dept -> {
|
|
|
- zjOrXjDeptIds.add(dept.getDeptId());
|
|
|
|
|
|
|
+ if (!"no".equals(dept.getUpdater())) {
|
|
|
|
|
+ zjOrXjDeptIds.add(dept.getDeptId());
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1668,14 +1674,19 @@ public class IotRyDailyReportServiceImpl implements IotRyDailyReportService {
|
|
|
// 统计各项目部的设备利用率
|
|
// 统计各项目部的设备利用率
|
|
|
// key项目部id value项目部包含的队伍指定时间区域内日报数量
|
|
// key项目部id value项目部包含的队伍指定时间区域内日报数量
|
|
|
Map<Long, Integer> projectReportPair = new HashMap<>();
|
|
Map<Long, Integer> projectReportPair = new HashMap<>();
|
|
|
-
|
|
|
|
|
|
|
+ Set<String> dtStatuses = new HashSet<>();
|
|
|
|
|
+ dtStatuses.add("dt");
|
|
|
|
|
+ dtStatuses.add("zx");
|
|
|
// 累计计算各项指标
|
|
// 累计计算各项指标
|
|
|
if (CollUtil.isNotEmpty(dailyReports)) {
|
|
if (CollUtil.isNotEmpty(dailyReports)) {
|
|
|
dailyReports.forEach(report -> {
|
|
dailyReports.forEach(report -> {
|
|
|
|
|
+ String rigStatus = report.getRigStatus();
|
|
|
|
|
+ String repairStatus = report.getRepairStatus();
|
|
|
// 统计各项目部的日报数量
|
|
// 统计各项目部的日报数量
|
|
|
if (CollUtil.isNotEmpty(projectTeamPair)) {
|
|
if (CollUtil.isNotEmpty(projectTeamPair)) {
|
|
|
projectTeamPair.forEach((projectDeptId, teamDeptIds) -> {
|
|
projectTeamPair.forEach((projectDeptId, teamDeptIds) -> {
|
|
|
- if (teamDeptIds.contains(report.getDeptId())) {
|
|
|
|
|
|
|
+ // 过滤掉 dt zx 的日报
|
|
|
|
|
+ if (teamDeptIds.contains(report.getDeptId()) && !dtStatuses.contains(rigStatus) && !dtStatuses.contains(repairStatus)) {
|
|
|
// 项目部日报数量
|
|
// 项目部日报数量
|
|
|
if (projectReportPair.containsKey(projectDeptId)) {
|
|
if (projectReportPair.containsKey(projectDeptId)) {
|
|
|
Integer tempCount = projectReportPair.get(projectDeptId);
|
|
Integer tempCount = projectReportPair.get(projectDeptId);
|
|
@@ -1696,15 +1707,7 @@ public class IotRyDailyReportServiceImpl implements IotRyDailyReportService {
|
|
|
cumulativePowerConsumptionPair.merge(projectDeptId, report.getDailyPowerUsage(), BigDecimal::add);
|
|
cumulativePowerConsumptionPair.merge(projectDeptId, report.getDailyPowerUsage(), BigDecimal::add);
|
|
|
// 累计油耗
|
|
// 累计油耗
|
|
|
cumulativeFuelConsumptionPair.merge(projectDeptId, report.getDailyFuel(), BigDecimal::add);
|
|
cumulativeFuelConsumptionPair.merge(projectDeptId, report.getDailyFuel(), BigDecimal::add);
|
|
|
- // 统计各项目部的 累计施工井数 累计完工井数 取每个井任务的最大值 而不是累加
|
|
|
|
|
- /* if (totalTasksPair.containsKey(report.getDeptId())) {
|
|
|
|
|
- Integer tempCount = totalTasksPair.get(report.getDeptId());
|
|
|
|
|
- cumulativeConstructWellsPair.merge(projectDeptId, tempCount, Integer::sum);
|
|
|
|
|
- }
|
|
|
|
|
- if (completedTasksPair.containsKey(report.getDeptId())) {
|
|
|
|
|
- Integer tempCompleteCount = completedTasksPair.get(report.getDeptId());
|
|
|
|
|
- cumulativeCompletedWellsPair.merge(projectDeptId, tempCompleteCount, Integer::sum);
|
|
|
|
|
- } */
|
|
|
|
|
|
|
+
|
|
|
// 额定生产时间
|
|
// 额定生产时间
|
|
|
if (taskRatedProductionTimePair.containsKey(report.getTaskId())) {
|
|
if (taskRatedProductionTimePair.containsKey(report.getTaskId())) {
|
|
|
BigDecimal ratedTime = taskRatedProductionTimePair.get(report.getTaskId());
|
|
BigDecimal ratedTime = taskRatedProductionTimePair.get(report.getTaskId());
|
|
@@ -1854,6 +1857,7 @@ public class IotRyDailyReportServiceImpl implements IotRyDailyReportService {
|
|
|
statistics.setProjectDeptName(dept.getName());
|
|
statistics.setProjectDeptName(dept.getName());
|
|
|
statistics.setSort(dept.getSort());
|
|
statistics.setSort(dept.getSort());
|
|
|
statistics.setType("2");
|
|
statistics.setType("2");
|
|
|
|
|
+ // 设备利用率
|
|
|
statistics.setUtilizationRate(deviceUtilizationPair.get(deptId));
|
|
statistics.setUtilizationRate(deviceUtilizationPair.get(deptId));
|
|
|
statistics.setCumulativeFootage(cumulativeFootagePair.get(deptId));
|
|
statistics.setCumulativeFootage(cumulativeFootagePair.get(deptId));
|
|
|
statistics.setCumulativeConstructWells(cumulativeConstructWellsPair.get(deptId));
|
|
statistics.setCumulativeConstructWells(cumulativeConstructWellsPair.get(deptId));
|
|
@@ -2537,7 +2541,9 @@ public class IotRyDailyReportServiceImpl implements IotRyDailyReportService {
|
|
|
List<IotDeptTypeDO> deptTypes = iotDeptTypeMapper.selectList(deptTypeReqVO);
|
|
List<IotDeptTypeDO> deptTypes = iotDeptTypeMapper.selectList(deptTypeReqVO);
|
|
|
if (CollUtil.isNotEmpty(deptTypes)) {
|
|
if (CollUtil.isNotEmpty(deptTypes)) {
|
|
|
deptTypes.forEach(dept -> {
|
|
deptTypes.forEach(dept -> {
|
|
|
- zjOrXjDeptIds.add(dept.getDeptId());
|
|
|
|
|
|
|
+ if (!"no".equals(dept.getUpdater())) {
|
|
|
|
|
+ zjOrXjDeptIds.add(dept.getDeptId());
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -2601,17 +2607,24 @@ public class IotRyDailyReportServiceImpl implements IotRyDailyReportService {
|
|
|
// 统计各队伍的设备利用率
|
|
// 统计各队伍的设备利用率
|
|
|
// key队伍id value队伍指定时间区域内日报数量
|
|
// key队伍id value队伍指定时间区域内日报数量
|
|
|
Map<Long, Integer> teamReportPair = new HashMap<>();
|
|
Map<Long, Integer> teamReportPair = new HashMap<>();
|
|
|
-
|
|
|
|
|
|
|
+ Set<String> dtStatuses = new HashSet<>();
|
|
|
|
|
+ dtStatuses.add("dt");
|
|
|
|
|
+ dtStatuses.add("zx");
|
|
|
// 累计计算各项指标
|
|
// 累计计算各项指标
|
|
|
if (CollUtil.isNotEmpty(dailyReports)) {
|
|
if (CollUtil.isNotEmpty(dailyReports)) {
|
|
|
dailyReports.forEach(report -> {
|
|
dailyReports.forEach(report -> {
|
|
|
|
|
+ String rigStatus = report.getRigStatus();
|
|
|
|
|
+ String repairStatus = report.getRepairStatus();
|
|
|
|
|
+
|
|
|
if (ObjUtil.isNotEmpty(report.getDeptId()) && zjOrXjDeptIds.contains(report.getDeptId())) {
|
|
if (ObjUtil.isNotEmpty(report.getDeptId()) && zjOrXjDeptIds.contains(report.getDeptId())) {
|
|
|
- // 统计各个队伍的日报数量
|
|
|
|
|
- if (teamReportPair.containsKey(report.getDeptId())) {
|
|
|
|
|
- Integer tempCount = teamReportPair.get(report.getDeptId());
|
|
|
|
|
- teamReportPair.put(report.getDeptId(), ++tempCount);
|
|
|
|
|
- } else {
|
|
|
|
|
- teamReportPair.put(report.getDeptId(), 1);
|
|
|
|
|
|
|
+ if (!dtStatuses.contains(rigStatus) && !dtStatuses.contains(repairStatus)) {
|
|
|
|
|
+ // 统计各个队伍的日报数量
|
|
|
|
|
+ if (teamReportPair.containsKey(report.getDeptId())) {
|
|
|
|
|
+ Integer tempCount = teamReportPair.get(report.getDeptId());
|
|
|
|
|
+ teamReportPair.put(report.getDeptId(), ++tempCount);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ teamReportPair.put(report.getDeptId(), 1);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 累计进尺
|
|
// 累计进尺
|
|
@@ -2620,15 +2633,7 @@ public class IotRyDailyReportServiceImpl implements IotRyDailyReportService {
|
|
|
cumulativeFuelConsumptionPair.merge(report.getDeptId(), report.getDailyFuel(), BigDecimal::add);
|
|
cumulativeFuelConsumptionPair.merge(report.getDeptId(), report.getDailyFuel(), BigDecimal::add);
|
|
|
// 累计用电量
|
|
// 累计用电量
|
|
|
cumulativePowerConsumptionPair.merge(report.getDeptId(), report.getDailyPowerUsage(), BigDecimal::add);
|
|
cumulativePowerConsumptionPair.merge(report.getDeptId(), report.getDailyPowerUsage(), BigDecimal::add);
|
|
|
- // 统计各项目部的 累计施工井数 累计完工井数
|
|
|
|
|
- /* if (totalTasksPair.containsKey(report.getDeptId())) {
|
|
|
|
|
- Integer tempCount = totalTasksPair.get(report.getDeptId());
|
|
|
|
|
- cumulativeConstructWellsPair.put(report.getDeptId(), tempCount);
|
|
|
|
|
- }
|
|
|
|
|
- if (completedTasksPair.containsKey(report.getDeptId())) {
|
|
|
|
|
- Integer tempCompleteCount = completedTasksPair.get(report.getDeptId());
|
|
|
|
|
- cumulativeCompletedWellsPair.put(report.getDeptId(), tempCompleteCount);
|
|
|
|
|
- } */
|
|
|
|
|
|
|
+
|
|
|
// 额定生产时间
|
|
// 额定生产时间
|
|
|
if (taskRatedProductionTimePair.containsKey(report.getTaskId())) {
|
|
if (taskRatedProductionTimePair.containsKey(report.getTaskId())) {
|
|
|
BigDecimal ratedTime = taskRatedProductionTimePair.get(report.getTaskId());
|
|
BigDecimal ratedTime = taskRatedProductionTimePair.get(report.getTaskId());
|
|
@@ -2734,6 +2739,7 @@ public class IotRyDailyReportServiceImpl implements IotRyDailyReportService {
|
|
|
statistics.setSort(dept.getSort());
|
|
statistics.setSort(dept.getSort());
|
|
|
statistics.setType("3");
|
|
statistics.setType("3");
|
|
|
statistics.setNonProductiveTime(cumulativeNonProductionPair.get(teamDeptId));
|
|
statistics.setNonProductiveTime(cumulativeNonProductionPair.get(teamDeptId));
|
|
|
|
|
+ // 设备利用率
|
|
|
statistics.setUtilizationRate(deviceUtilizationPair.get(teamDeptId));
|
|
statistics.setUtilizationRate(deviceUtilizationPair.get(teamDeptId));
|
|
|
statistics.setCumulativeFootage(cumulativeFootagePair.get(teamDeptId));
|
|
statistics.setCumulativeFootage(cumulativeFootagePair.get(teamDeptId));
|
|
|
statistics.setCumulativeConstructWells(totalTasksPair.get(teamDeptId));
|
|
statistics.setCumulativeConstructWells(totalTasksPair.get(teamDeptId));
|