|
|
@@ -1170,41 +1170,45 @@ public class IotRyDailyReportServiceImpl implements IotRyDailyReportService {
|
|
|
}
|
|
|
|
|
|
// 修井 非生产时间 用于计算非生产时效
|
|
|
+ // NPT 归类 设备故障repair_time 工程质量accident_time 技术受限complexity_time 生产组织rectification_time 不可抗力waiting_stop_time
|
|
|
+ // 甲方设计partya_design 甲方准备partya_prepare 甲方资源partya_resource 其他非生产时间other_npt_time
|
|
|
+ // 钻井 非生产时间 事故 修理 自停 复杂 搬迁 整改 等停 冬休
|
|
|
+ BigDecimal nonProductionTimeSum = Stream.of(
|
|
|
+ report.getAccidentTime(),
|
|
|
+ report.getRepairTime(),
|
|
|
+ report.getComplexityTime(),
|
|
|
+ report.getRectificationTime(),
|
|
|
+ report.getWaitingStopTime(),
|
|
|
+ report.getPartyaDesign(),
|
|
|
+ report.getPartyaPrepare(),
|
|
|
+ report.getPartyaResource(),
|
|
|
+ report.getOtherNptTime()
|
|
|
+ )
|
|
|
+ .map(time -> ObjUtil.defaultIfNull(time, BigDecimal.ZERO))
|
|
|
+ .reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
if ("2".equals(pageReqVO.getProjectClassification())) {
|
|
|
- BigDecimal nonProductionTime = report.getNonProductionTime();
|
|
|
- if (nonProductionTime.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
+ // BigDecimal nonProductionTime = report.getNonProductionTime();
|
|
|
+ if (nonProductionTimeSum.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
if (cumulativeNonProductionTimePair.containsKey(projectDeptId)) {
|
|
|
List<BigDecimal> tempNonProductionTimes = cumulativeNonProductionTimePair.get(projectDeptId);
|
|
|
- tempNonProductionTimes.add(nonProductionTime);
|
|
|
+ tempNonProductionTimes.add(nonProductionTimeSum);
|
|
|
cumulativeNonProductionTimePair.put(projectDeptId, tempNonProductionTimes);
|
|
|
} else {
|
|
|
List<BigDecimal> tempNonProductionTimes = new ArrayList<>();
|
|
|
- tempNonProductionTimes.add(nonProductionTime);
|
|
|
+ tempNonProductionTimes.add(nonProductionTimeSum);
|
|
|
cumulativeNonProductionTimePair.put(projectDeptId, tempNonProductionTimes);
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
// 钻井 非生产时间 事故 修理 自停 复杂 搬迁 整改 等停 冬休
|
|
|
- BigDecimal drillingNonProductionTimeSum = Stream.of(
|
|
|
- report.getAccidentTime(),
|
|
|
- report.getRepairTime(),
|
|
|
- report.getSelfStopTime(),
|
|
|
- report.getComplexityTime(),
|
|
|
- report.getRelocationTime(),
|
|
|
- report.getRectificationTime(),
|
|
|
- report.getWaitingStopTime(),
|
|
|
- report.getWinterBreakTime()
|
|
|
- )
|
|
|
- .map(time -> ObjUtil.defaultIfNull(time, BigDecimal.ZERO))
|
|
|
- .reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
- if (drillingNonProductionTimeSum.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
+ if (nonProductionTimeSum.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
if (cumulativeNonProductionTimePair.containsKey(projectDeptId)) {
|
|
|
List<BigDecimal> tempNonProductionTimes = cumulativeNonProductionTimePair.get(projectDeptId);
|
|
|
- tempNonProductionTimes.add(drillingNonProductionTimeSum);
|
|
|
+ tempNonProductionTimes.add(nonProductionTimeSum);
|
|
|
cumulativeNonProductionTimePair.put(projectDeptId, tempNonProductionTimes);
|
|
|
} else {
|
|
|
List<BigDecimal> tempNonProductionTimes = new ArrayList<>();
|
|
|
- tempNonProductionTimes.add(drillingNonProductionTimeSum);
|
|
|
+ tempNonProductionTimes.add(nonProductionTimeSum);
|
|
|
cumulativeNonProductionTimePair.put(projectDeptId, tempNonProductionTimes);
|
|
|
}
|
|
|
}
|
|
|
@@ -1246,19 +1250,6 @@ public class IotRyDailyReportServiceImpl implements IotRyDailyReportService {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
- if (CollUtil.isNotEmpty(cumulativeNonProductionTimePair)) {
|
|
|
- // 计算各项目部的平均时效
|
|
|
- cumulativeNonProductionTimePair.forEach((projectDeptId, nonProductTimes) -> {
|
|
|
- // nonProductTimes 集合中元素的数量就是 分母中应该计算非生产时效的天数
|
|
|
- BigDecimal totalNonProductionTime = nonProductTimes.stream()
|
|
|
- .reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
- BigDecimal denominator = new BigDecimal(nonProductTimes.size() * 24);
|
|
|
- BigDecimal nonProductionEfficiency = totalNonProductionTime
|
|
|
- .divide(denominator, 4, RoundingMode.HALF_UP);
|
|
|
- cumulativeNonProductionPair.put(projectDeptId, nonProductionEfficiency);
|
|
|
- });
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
Long days;
|
|
|
@@ -1276,6 +1267,22 @@ public class IotRyDailyReportServiceImpl implements IotRyDailyReportService {
|
|
|
days = 0l;
|
|
|
}
|
|
|
|
|
|
+ if (CollUtil.isNotEmpty(cumulativeNonProductionTimePair)) {
|
|
|
+ // 计算各项目部的非生产时效 分母为查询时间区间的总天数
|
|
|
+ cumulativeNonProductionTimePair.forEach((projectDeptId, nonProductTimes) -> {
|
|
|
+ // nonProductTimes 集合中元素的数量就是 分母中应该计算非生产时效的天数
|
|
|
+ BigDecimal totalNonProductionTime = nonProductTimes.stream()
|
|
|
+ .reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
+ if (days > 0 && projectTeamPair.containsKey(projectDeptId)) {
|
|
|
+ Set<Long> tempTeamIds = projectTeamPair.get(projectDeptId);
|
|
|
+ BigDecimal denominator = new BigDecimal(days * 24 * tempTeamIds.size());
|
|
|
+ BigDecimal nonProductionEfficiency = totalNonProductionTime
|
|
|
+ .divide(denominator, 4, RoundingMode.HALF_UP);
|
|
|
+ cumulativeNonProductionPair.put(projectDeptId, nonProductionEfficiency);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
// 计算各项目部的平均设备利用率
|
|
|
if (CollUtil.isNotEmpty(projectTeamPair)) {
|
|
|
projectTeamPair.forEach((projectDeptId, resultTeamIds) -> {
|
|
|
@@ -1559,6 +1566,10 @@ public class IotRyDailyReportServiceImpl implements IotRyDailyReportService {
|
|
|
Map<Long, BigDecimal> cumulativeRatedTimePair = new HashMap<>();
|
|
|
// key队伍id value累计运行时效
|
|
|
Map<Long, BigDecimal> cumulativeTransitTimePair = new HashMap<>();
|
|
|
+ // key队伍id/项目部id value非生产时间集合
|
|
|
+ Map<Long, List<BigDecimal>> cumulativeNonProductionTimePair = new HashMap<>();
|
|
|
+ // key队伍id/项目部id value非生产时效
|
|
|
+ Map<Long, BigDecimal> cumulativeNonProductionPair = new HashMap<>();
|
|
|
// key队伍id/项目部id value设备利用率
|
|
|
Map<Long, BigDecimal> deviceUtilizationPair = new HashMap<>();
|
|
|
|
|
|
@@ -1674,9 +1685,36 @@ public class IotRyDailyReportServiceImpl implements IotRyDailyReportService {
|
|
|
}
|
|
|
// 生产时间
|
|
|
cumulativeProductTimePair.merge(report.getDeptId(), report.getProductionTime(), BigDecimal::add);
|
|
|
+ // NPT 归类 设备故障repair_time 工程质量accident_time 技术受限complexity_time 生产组织rectification_time 不可抗力waiting_stop_time
|
|
|
+ // 甲方设计partya_design 甲方准备partya_prepare 甲方资源partya_resource 其他非生产时间other_npt_time
|
|
|
+ // BigDecimal nonProductionTime = report.getNonProductionTime();
|
|
|
+ BigDecimal nonProductionTimeSum = Stream.of(
|
|
|
+ report.getAccidentTime(),
|
|
|
+ report.getRepairTime(),
|
|
|
+ report.getComplexityTime(),
|
|
|
+ report.getRectificationTime(),
|
|
|
+ report.getWaitingStopTime(),
|
|
|
+ report.getPartyaDesign(),
|
|
|
+ report.getPartyaPrepare(),
|
|
|
+ report.getPartyaResource(),
|
|
|
+ report.getOtherNptTime()
|
|
|
+ )
|
|
|
+ .map(time -> ObjUtil.defaultIfNull(time, BigDecimal.ZERO))
|
|
|
+ .reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
+ if (nonProductionTimeSum.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
+ if (cumulativeNonProductionTimePair.containsKey(report.getDeptId())) {
|
|
|
+ List<BigDecimal> tempNonProductionTimes = cumulativeNonProductionTimePair.get(report.getDeptId());
|
|
|
+ tempNonProductionTimes.add(nonProductionTimeSum);
|
|
|
+ cumulativeNonProductionTimePair.put(report.getDeptId(), tempNonProductionTimes);
|
|
|
+ } else {
|
|
|
+ List<BigDecimal> tempNonProductionTimes = new ArrayList<>();
|
|
|
+ tempNonProductionTimes.add(nonProductionTimeSum);
|
|
|
+ cumulativeNonProductionTimePair.put(report.getDeptId(), tempNonProductionTimes);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
- // 根据 累计注气量 累计产能 计算指定队伍下的平均产能
|
|
|
+ // 根据 计算指定队伍下的平均产能
|
|
|
if (CollUtil.isNotEmpty(cumulativeProductTimePair) && CollUtil.isNotEmpty(cumulativeRatedTimePair)) {
|
|
|
cumulativeProductTimePair.forEach((teamDeptId, productionTime) -> {
|
|
|
if (cumulativeRatedTimePair.containsKey(teamDeptId)) {
|
|
|
@@ -1706,6 +1744,21 @@ public class IotRyDailyReportServiceImpl implements IotRyDailyReportService {
|
|
|
days = 0l;
|
|
|
}
|
|
|
|
|
|
+ if (CollUtil.isNotEmpty(cumulativeNonProductionTimePair)) {
|
|
|
+ // 计算各队伍的 非生产时效
|
|
|
+ cumulativeNonProductionTimePair.forEach((teamId, nonProductTimes) -> {
|
|
|
+ // nonProductTimes 集合中元素的数量就是 分母中应该计算非生产时效的天数
|
|
|
+ BigDecimal totalNonProductionTime = nonProductTimes.stream()
|
|
|
+ .reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
+ if (days > 0) {
|
|
|
+ BigDecimal denominator = new BigDecimal(days * 24);
|
|
|
+ BigDecimal nonProductionEfficiency = totalNonProductionTime
|
|
|
+ .divide(denominator, 4, RoundingMode.HALF_UP);
|
|
|
+ cumulativeNonProductionPair.put(teamId, nonProductionEfficiency);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
// 计算各队伍的平均设备利用率
|
|
|
if (CollUtil.isNotEmpty(teamReportPair)) {
|
|
|
teamReportPair.forEach((teamDeptId, reportCount) -> {
|
|
|
@@ -1729,6 +1782,7 @@ public class IotRyDailyReportServiceImpl implements IotRyDailyReportService {
|
|
|
statistics.setTeamName(dept.getName());
|
|
|
statistics.setSort(dept.getSort());
|
|
|
statistics.setType("3");
|
|
|
+ statistics.setNonProductiveTime(cumulativeNonProductionPair.get(teamDeptId));
|
|
|
statistics.setUtilizationRate(deviceUtilizationPair.get(teamDeptId));
|
|
|
statistics.setCumulativeFootage(cumulativeFootagePair.get(teamDeptId));
|
|
|
statistics.setCumulativeConstructWells(totalTasksPair.get(teamDeptId));
|