|
|
@@ -2597,14 +2597,6 @@ public class IotRhDailyReportServiceImpl implements IotRhDailyReportService {
|
|
|
// 找到队伍所属的上级项目部
|
|
|
Long projectDeptId = teamProjectIdPair.get(report.getDeptId());
|
|
|
if (teamProjectIdPair.containsKey(report.getDeptId())) {
|
|
|
- // 设置各项目部的日报总数量
|
|
|
- if (projectTotalReportPair.containsKey(projectDeptId)) {
|
|
|
- Integer tempCount = projectTotalReportPair.get(projectDeptId);
|
|
|
- projectTotalReportPair.put(projectDeptId, ++tempCount);
|
|
|
- } else {
|
|
|
- projectTotalReportPair.put(projectDeptId, 1);
|
|
|
- }
|
|
|
-
|
|
|
if (deviceDeptIds.contains(report.getDeptId())) {
|
|
|
// 动迁 准备 完工 都算作 准备
|
|
|
// 施工sg 观察使用gcsy 待维修dwx 待保养dby
|
|
|
@@ -2700,6 +2692,15 @@ public class IotRhDailyReportServiceImpl implements IotRhDailyReportService {
|
|
|
if (ObjUtil.isNotEmpty(deptId) && teamProjectIdPair.containsKey(deptId)) {
|
|
|
Long projectDeptId = teamProjectIdPair.get(deptId);
|
|
|
if (ObjUtil.isNotEmpty(projectDeptId) && projectDeptPair.containsKey(projectDeptId)) {
|
|
|
+
|
|
|
+ // 设置各项目部的日报总数量
|
|
|
+ if (projectTotalReportPair.containsKey(projectDeptId)) {
|
|
|
+ Integer tempCount = projectTotalReportPair.get(projectDeptId);
|
|
|
+ projectTotalReportPair.put(projectDeptId, ++tempCount);
|
|
|
+ } else {
|
|
|
+ projectTotalReportPair.put(projectDeptId, 1);
|
|
|
+ }
|
|
|
+
|
|
|
// 累计注气量
|
|
|
cumulativeGasInjectionPair.merge(projectDeptId, report.getDailyGasInjection(), BigDecimal::add);
|
|
|
// 累计注水量
|
|
|
@@ -3348,6 +3349,9 @@ public class IotRhDailyReportServiceImpl implements IotRhDailyReportService {
|
|
|
// key日期yyyy-MM-dd value日期对应的日报总数量
|
|
|
Map<String, Integer> dateTotalReportPair = new HashMap<>();
|
|
|
|
|
|
+ // key日期yyyy-MM-dd value日期对应的工作时间总和
|
|
|
+ Map<String, BigDecimal> dateWorkTimePair = new HashMap<>();
|
|
|
+
|
|
|
// 累计计算各项指标
|
|
|
if (CollUtil.isNotEmpty(dailyReports)) {
|
|
|
dailyReports.forEach(report -> {
|
|
|
@@ -3390,6 +3394,20 @@ public class IotRhDailyReportServiceImpl implements IotRhDailyReportService {
|
|
|
} else {
|
|
|
dateTotalReportPair.put(reportDateStr, 1);
|
|
|
}
|
|
|
+
|
|
|
+ // 按小时数 统计设备利用率
|
|
|
+ BigDecimal gasInjectionTime = ObjUtil.defaultIfNull(report.getDailyInjectGasTime(), BigDecimal.ZERO);
|
|
|
+ BigDecimal waterInjectionTime = ObjUtil.defaultIfNull(report.getDailyInjectWaterTime(), BigDecimal.ZERO);
|
|
|
+ BigDecimal workTime = gasInjectionTime.compareTo(BigDecimal.ZERO) > 0
|
|
|
+ ? gasInjectionTime
|
|
|
+ : waterInjectionTime.compareTo(BigDecimal.ZERO) > 0
|
|
|
+ ? waterInjectionTime
|
|
|
+ : BigDecimal.ZERO;
|
|
|
+ if (workTime.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
+ // 取 注气时间 注水时间 的较大者
|
|
|
+ // 存在则累加,不存在则赋值
|
|
|
+ dateWorkTimePair.merge(reportDateStr, workTime, BigDecimal::add);
|
|
|
+ }
|
|
|
});
|
|
|
// 根据 累计注气量 累计产能 计算指定日期范围的平均产能
|
|
|
if (CollUtil.isNotEmpty(dateGasInjectionPair) && CollUtil.isNotEmpty(dateCapacityPair)) {
|
|
|
@@ -3430,6 +3448,17 @@ public class IotRhDailyReportServiceImpl implements IotRhDailyReportService {
|
|
|
statistics.setCumulativeWaterInjection(dateWaterInjectionPair.get(date));
|
|
|
statistics.setCumulativePowerConsumption(datePowerConsumptionPair.get(date));
|
|
|
statistics.setCumulativeFuelConsumption(dateFuelConsumptionPair.get(date));
|
|
|
+ // 平均时效 20260920修改成 按照小时统计的设备利用率
|
|
|
+ if (dateWorkTimePair.containsKey(date)) {
|
|
|
+ BigDecimal reportWorkTime = dateWorkTimePair.get(date);
|
|
|
+ BigDecimal rate = BigDecimal.ZERO;
|
|
|
+ if (dateTotalReportPair.containsKey(date)) {
|
|
|
+ Integer totalReportNum = dateTotalReportPair.get(date);
|
|
|
+ BigDecimal denominator = new BigDecimal(totalReportNum * 24);
|
|
|
+ rate = reportWorkTime.divide(denominator, 4, RoundingMode.HALF_UP);
|
|
|
+ }
|
|
|
+ statistics.setHourUtilizationRate(rate);
|
|
|
+ }
|
|
|
statistics.setTransitTime(dateTransitTimePair.get(date));
|
|
|
// 设置每个日期的设备利用率
|
|
|
if (dateUtilizationDeptPair.containsKey(date)) {
|
|
|
@@ -3539,12 +3568,15 @@ public class IotRhDailyReportServiceImpl implements IotRhDailyReportService {
|
|
|
// key队伍id value队伍下相关设备产能
|
|
|
Map<Long, BigDecimal> teamCapacityPair = queryCapacities(new ArrayList<>(allRhChildDeptIds));
|
|
|
|
|
|
- // key日期yyyy-MM-dd value日报id集合
|
|
|
+ // key日期yyyy-MM value日报id集合
|
|
|
Map<String, Set<Long>> dateUtilizationDeptPair = new HashMap<>();
|
|
|
|
|
|
- // key日期yyyy-MM-dd value日期对应的日报总数量
|
|
|
+ // key日期yyyy-MM value日期对应的日报总数量
|
|
|
Map<String, Integer> dateTotalReportPair = new HashMap<>();
|
|
|
|
|
|
+ // key日期yyyy-MM value日期对应的工作时间总和
|
|
|
+ Map<String, BigDecimal> dateWorkTimePair = new HashMap<>();
|
|
|
+
|
|
|
// 累计计算各项指标
|
|
|
if (CollUtil.isNotEmpty(dailyReports)) {
|
|
|
dailyReports.forEach(report -> {
|
|
|
@@ -3589,6 +3621,20 @@ public class IotRhDailyReportServiceImpl implements IotRhDailyReportService {
|
|
|
} else {
|
|
|
dateTotalReportPair.put(reportMonth, 1);
|
|
|
}
|
|
|
+
|
|
|
+ // 按小时数 统计设备利用率
|
|
|
+ BigDecimal gasInjectionTime = ObjUtil.defaultIfNull(report.getDailyInjectGasTime(), BigDecimal.ZERO);
|
|
|
+ BigDecimal waterInjectionTime = ObjUtil.defaultIfNull(report.getDailyInjectWaterTime(), BigDecimal.ZERO);
|
|
|
+ BigDecimal workTime = gasInjectionTime.compareTo(BigDecimal.ZERO) > 0
|
|
|
+ ? gasInjectionTime
|
|
|
+ : waterInjectionTime.compareTo(BigDecimal.ZERO) > 0
|
|
|
+ ? waterInjectionTime
|
|
|
+ : BigDecimal.ZERO;
|
|
|
+ if (workTime.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
+ // 取 注气时间 注水时间 的较大者
|
|
|
+ // 存在则累加,不存在则赋值
|
|
|
+ dateWorkTimePair.merge(reportMonth, workTime, BigDecimal::add);
|
|
|
+ }
|
|
|
});
|
|
|
// 根据 累计注气量 累计产能 计算指定日期范围的平均产能
|
|
|
if (CollUtil.isNotEmpty(dateGasInjectionPair) && CollUtil.isNotEmpty(dateCapacityPair)) {
|
|
|
@@ -3629,6 +3675,17 @@ public class IotRhDailyReportServiceImpl implements IotRhDailyReportService {
|
|
|
statistics.setCumulativeWaterInjection(dateWaterInjectionPair.get(date));
|
|
|
statistics.setCumulativePowerConsumption(datePowerConsumptionPair.get(date));
|
|
|
statistics.setCumulativeFuelConsumption(dateFuelConsumptionPair.get(date));
|
|
|
+ // 平均时效 20260920修改成 按照小时统计的设备利用率
|
|
|
+ if (dateWorkTimePair.containsKey(date)) {
|
|
|
+ BigDecimal reportWorkTime = dateWorkTimePair.get(date);
|
|
|
+ BigDecimal rate = BigDecimal.ZERO;
|
|
|
+ if (dateTotalReportPair.containsKey(date)) {
|
|
|
+ Integer totalReportNum = dateTotalReportPair.get(date);
|
|
|
+ BigDecimal denominator = new BigDecimal(totalReportNum * 24);
|
|
|
+ rate = reportWorkTime.divide(denominator, 4, RoundingMode.HALF_UP);
|
|
|
+ }
|
|
|
+ statistics.setHourUtilizationRate(rate);
|
|
|
+ }
|
|
|
statistics.setTransitTime(dateTransitTimePair.get(date));
|
|
|
// 设置每个日期的设备利用率
|
|
|
if (dateUtilizationDeptPair.containsKey(date)) {
|
|
|
@@ -4460,6 +4517,12 @@ public class IotRhDailyReportServiceImpl implements IotRhDailyReportService {
|
|
|
// key日期yyyy-MM-dd value指定日期内包含主设备队伍id集合
|
|
|
Map<String, Set<Long>> dateUtilizationDeptPair = new HashMap<>();
|
|
|
|
|
|
+ // key日期yyyy-MM-dd value日期对应的日报总数量
|
|
|
+ Map<String, Integer> dateTotalReportPair = new HashMap<>();
|
|
|
+
|
|
|
+ // key日期yyyy-MM-dd value项目部下包含设备的队伍注气时间或注水时间总和
|
|
|
+ Map<String, BigDecimal> dateWorkTimePair = new HashMap<>();
|
|
|
+
|
|
|
// 累计计算各项指标
|
|
|
if (CollUtil.isNotEmpty(dailyReports)) {
|
|
|
dailyReports.forEach(report -> {
|
|
|
@@ -4495,6 +4558,28 @@ public class IotRhDailyReportServiceImpl implements IotRhDailyReportService {
|
|
|
dateUtilizationDeptPair.put(reportDateStr, tempDeptIds);
|
|
|
}
|
|
|
}
|
|
|
+ // 统计当前日期下所有日报总数量
|
|
|
+ if (dateTotalReportPair.containsKey(reportDateStr)) {
|
|
|
+ Integer tempCount = dateTotalReportPair.get(reportDateStr);
|
|
|
+ dateTotalReportPair.put(reportDateStr, ++tempCount);
|
|
|
+ } else {
|
|
|
+ dateTotalReportPair.put(reportDateStr, 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 按小时数 统计设备利用率
|
|
|
+ BigDecimal gasInjectionTime = ObjUtil.defaultIfNull(report.getDailyInjectGasTime(), BigDecimal.ZERO);
|
|
|
+ BigDecimal waterInjectionTime = ObjUtil.defaultIfNull(report.getDailyInjectWaterTime(), BigDecimal.ZERO);
|
|
|
+ BigDecimal workTime = gasInjectionTime.compareTo(BigDecimal.ZERO) > 0
|
|
|
+ ? gasInjectionTime
|
|
|
+ : waterInjectionTime.compareTo(BigDecimal.ZERO) > 0
|
|
|
+ ? waterInjectionTime
|
|
|
+ : BigDecimal.ZERO;
|
|
|
+ if (workTime.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
+ // 取 注气时间 注水时间 的较大者
|
|
|
+ // 存在则累加,不存在则赋值
|
|
|
+ dateWorkTimePair.merge(reportDateStr, workTime, BigDecimal::add);
|
|
|
+ }
|
|
|
+
|
|
|
});
|
|
|
// 根据 累计注气量 累计产能 计算指定队伍下的平均产能
|
|
|
if (CollUtil.isNotEmpty(dateGasInjectionPair) && CollUtil.isNotEmpty(dateCapacityPair)) {
|
|
|
@@ -4532,15 +4617,27 @@ public class IotRhDailyReportServiceImpl implements IotRhDailyReportService {
|
|
|
statistics.setCumulativeWaterInjection(dateWaterInjectionPair.get(date));
|
|
|
statistics.setCumulativePowerConsumption(datePowerConsumptionPair.get(date));
|
|
|
statistics.setCumulativeFuelConsumption(dateFuelConsumptionPair.get(date));
|
|
|
+ // 平均时效 20260920修改成 按照小时统计的设备利用率
|
|
|
+ if (dateWorkTimePair.containsKey(date)) {
|
|
|
+ BigDecimal reportWorkTime = dateWorkTimePair.get(date);
|
|
|
+ BigDecimal rate = BigDecimal.ZERO;
|
|
|
+ if (dateTotalReportPair.containsKey(date)) {
|
|
|
+ Integer totalReportNum = dateTotalReportPair.get(date);
|
|
|
+ BigDecimal denominator = new BigDecimal(totalReportNum * 24);
|
|
|
+ rate = reportWorkTime.divide(denominator, 4, RoundingMode.HALF_UP);
|
|
|
+ }
|
|
|
+ statistics.setHourUtilizationRate(rate);
|
|
|
+ }
|
|
|
statistics.setTransitTime(dateTransitTimePair.get(date));
|
|
|
+
|
|
|
// 设置每个日期的设备利用率
|
|
|
if (dateUtilizationDeptPair.containsKey(date)) {
|
|
|
Set<Long> dateDeptIds = dateUtilizationDeptPair.get(date);
|
|
|
Integer dateDeptIdCount = dateDeptIds.size();
|
|
|
- Integer mainDeviceIdCount = currentDeviceDeptIds.size();
|
|
|
BigDecimal rate = BigDecimal.ZERO;
|
|
|
- if (mainDeviceIdCount > 0) {
|
|
|
- BigDecimal total = new BigDecimal(mainDeviceIdCount);
|
|
|
+ if (dateTotalReportPair.containsKey(date)) {
|
|
|
+ Integer totalReportNum = dateTotalReportPair.get(date);
|
|
|
+ BigDecimal total = new BigDecimal(totalReportNum);
|
|
|
BigDecimal current = new BigDecimal(dateDeptIdCount);
|
|
|
rate = current.divide(total, 4, RoundingMode.HALF_UP);
|
|
|
}
|
|
|
@@ -4640,44 +4737,74 @@ public class IotRhDailyReportServiceImpl implements IotRhDailyReportService {
|
|
|
// key队伍id value队伍下相关设备产能
|
|
|
Map<Long, BigDecimal> teamCapacityPair = queryCapacities(new ArrayList<>(allRhChildDeptIds));
|
|
|
|
|
|
- // key日期yyyy-MM-dd value指定日期内包含主设备队伍id集合
|
|
|
+ // key日期yyyy-MM value指定日期内包含主设备队伍id集合
|
|
|
Map<String, Set<Long>> dateUtilizationDeptPair = new HashMap<>();
|
|
|
|
|
|
+ // key日期yyyy-MM value日期对应的日报总数量
|
|
|
+ Map<String, Integer> dateTotalReportPair = new HashMap<>();
|
|
|
+
|
|
|
+ // key日期yyyy-MM-dd value日期对应的工作时间总和
|
|
|
+ Map<String, BigDecimal> dateWorkTimePair = new HashMap<>();
|
|
|
+
|
|
|
// 累计计算各项指标
|
|
|
if (CollUtil.isNotEmpty(dailyReports)) {
|
|
|
dailyReports.forEach(report -> {
|
|
|
+ Long reportId = report.getId();
|
|
|
Long currentDeptId = report.getDeptId();
|
|
|
// 按照日期维度统计各 工作量数据 累计用电量 累计油耗 累计注气量 累计注水量
|
|
|
LocalDateTime reportLocalDate = report.getCreateTime();
|
|
|
+
|
|
|
+ String reportMonth = getReportMonthGroup(reportLocalDate);
|
|
|
// 将日期格式转换成 字符串
|
|
|
String reportDateStr = LocalDateTimeUtil.format(reportLocalDate, DatePattern.NORM_DATE_PATTERN);
|
|
|
// 累计注气量
|
|
|
- dateGasInjectionPair.merge(reportDateStr, report.getDailyGasInjection(), BigDecimal::add);
|
|
|
+ dateGasInjectionPair.merge(reportMonth, report.getDailyGasInjection(), BigDecimal::add);
|
|
|
// 累计注水量
|
|
|
- dateWaterInjectionPair.merge(reportDateStr, report.getDailyWaterInjection(), BigDecimal::add);
|
|
|
+ dateWaterInjectionPair.merge(reportMonth, report.getDailyWaterInjection(), BigDecimal::add);
|
|
|
// 累计用电量
|
|
|
- datePowerConsumptionPair.merge(reportDateStr, report.getDailyPowerUsage(), BigDecimal::add);
|
|
|
+ datePowerConsumptionPair.merge(reportMonth, report.getDailyPowerUsage(), BigDecimal::add);
|
|
|
// 累计油耗
|
|
|
- dateFuelConsumptionPair.merge(reportDateStr, report.getDailyOilUsage(), BigDecimal::add);
|
|
|
+ dateFuelConsumptionPair.merge(reportMonth, report.getDailyOilUsage(), BigDecimal::add);
|
|
|
// 累计产能
|
|
|
if (teamCapacityPair.containsKey(currentDeptId)) {
|
|
|
BigDecimal tempCapacity = teamCapacityPair.get(currentDeptId);
|
|
|
- dateCapacityPair.merge(reportDateStr, tempCapacity, BigDecimal::add);
|
|
|
+ dateCapacityPair.merge(reportMonth, tempCapacity, BigDecimal::add);
|
|
|
}
|
|
|
// 统计各日期的设备利用率 注气量 或 注水量 >0 的日报数量
|
|
|
BigDecimal dailyGasInjection = report.getDailyGasInjection();
|
|
|
BigDecimal dailyWaterInjection = report.getDailyWaterInjection();
|
|
|
if (haveDeviceDeptIds.contains(currentDeptId) && (dailyGasInjection.compareTo(BigDecimal.ZERO)>0 || dailyWaterInjection.compareTo(BigDecimal.ZERO)>0)) {
|
|
|
- if (dateUtilizationDeptPair.containsKey(reportDateStr)) {
|
|
|
- Set<Long> tempDeptIds = dateUtilizationDeptPair.get(reportDateStr);
|
|
|
- tempDeptIds.add(currentDeptId);
|
|
|
- dateUtilizationDeptPair.put(reportDateStr, tempDeptIds);
|
|
|
+ if (dateUtilizationDeptPair.containsKey(reportMonth)) {
|
|
|
+ Set<Long> tempDeptIds = dateUtilizationDeptPair.get(reportMonth);
|
|
|
+ tempDeptIds.add(reportId);
|
|
|
+ dateUtilizationDeptPair.put(reportMonth, tempDeptIds);
|
|
|
} else {
|
|
|
Set<Long> tempDeptIds = new HashSet<>();
|
|
|
- tempDeptIds.add(currentDeptId);
|
|
|
- dateUtilizationDeptPair.put(reportDateStr, tempDeptIds);
|
|
|
+ tempDeptIds.add(reportId);
|
|
|
+ dateUtilizationDeptPair.put(reportMonth, tempDeptIds);
|
|
|
}
|
|
|
}
|
|
|
+ // 统计当前日期下所有日报总数量
|
|
|
+ if (dateTotalReportPair.containsKey(reportMonth)) {
|
|
|
+ Integer tempCount = dateTotalReportPair.get(reportMonth);
|
|
|
+ dateTotalReportPair.put(reportMonth, ++tempCount);
|
|
|
+ } else {
|
|
|
+ dateTotalReportPair.put(reportMonth, 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 按小时数 统计设备利用率
|
|
|
+ BigDecimal gasInjectionTime = ObjUtil.defaultIfNull(report.getDailyInjectGasTime(), BigDecimal.ZERO);
|
|
|
+ BigDecimal waterInjectionTime = ObjUtil.defaultIfNull(report.getDailyInjectWaterTime(), BigDecimal.ZERO);
|
|
|
+ BigDecimal workTime = gasInjectionTime.compareTo(BigDecimal.ZERO) > 0
|
|
|
+ ? gasInjectionTime
|
|
|
+ : waterInjectionTime.compareTo(BigDecimal.ZERO) > 0
|
|
|
+ ? waterInjectionTime
|
|
|
+ : BigDecimal.ZERO;
|
|
|
+ if (workTime.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
+ // 取 注气时间 注水时间 的较大者
|
|
|
+ // 存在则累加,不存在则赋值
|
|
|
+ dateWorkTimePair.merge(reportMonth, workTime, BigDecimal::add);
|
|
|
+ }
|
|
|
});
|
|
|
// 根据 累计注气量 累计产能 计算指定队伍下的平均产能
|
|
|
if (CollUtil.isNotEmpty(dateGasInjectionPair) && CollUtil.isNotEmpty(dateCapacityPair)) {
|
|
|
@@ -4695,8 +4822,8 @@ public class IotRhDailyReportServiceImpl implements IotRhDailyReportService {
|
|
|
}
|
|
|
|
|
|
// 新增:日期字符串集合
|
|
|
- List<String> dateRangeList = new ArrayList<>();
|
|
|
- if (createTimes.length >= 2) {
|
|
|
+ List<String> dateRangeList = getMonthRangeList(createTimes);
|
|
|
+ /* if (createTimes.length >= 2) {
|
|
|
LocalDate startDate = createTimes[0].toLocalDate();
|
|
|
LocalDate endDate = createTimes[1].toLocalDate();
|
|
|
// 生成从起始日期到结束日期的所有日期
|
|
|
@@ -4705,7 +4832,7 @@ public class IotRhDailyReportServiceImpl implements IotRhDailyReportService {
|
|
|
date = date.plusDays(1)) {
|
|
|
dateRangeList.add(date.format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN)));
|
|
|
}
|
|
|
- }
|
|
|
+ } */
|
|
|
|
|
|
if (CollUtil.isNotEmpty(dateRangeList)) {
|
|
|
dateRangeList.forEach(date -> {
|
|
|
@@ -4715,6 +4842,17 @@ public class IotRhDailyReportServiceImpl implements IotRhDailyReportService {
|
|
|
statistics.setCumulativeWaterInjection(dateWaterInjectionPair.get(date));
|
|
|
statistics.setCumulativePowerConsumption(datePowerConsumptionPair.get(date));
|
|
|
statistics.setCumulativeFuelConsumption(dateFuelConsumptionPair.get(date));
|
|
|
+ // 平均时效 20260920修改成 按照小时统计的设备利用率
|
|
|
+ if (dateWorkTimePair.containsKey(date)) {
|
|
|
+ BigDecimal reportWorkTime = dateWorkTimePair.get(date);
|
|
|
+ BigDecimal rate = BigDecimal.ZERO;
|
|
|
+ if (dateTotalReportPair.containsKey(date)) {
|
|
|
+ Integer totalReportNum = dateTotalReportPair.get(date);
|
|
|
+ BigDecimal denominator = new BigDecimal(totalReportNum * 24);
|
|
|
+ rate = reportWorkTime.divide(denominator, 4, RoundingMode.HALF_UP);
|
|
|
+ }
|
|
|
+ statistics.setHourUtilizationRate(rate);
|
|
|
+ }
|
|
|
statistics.setTransitTime(dateTransitTimePair.get(date));
|
|
|
// 设置每个日期的设备利用率
|
|
|
if (dateUtilizationDeptPair.containsKey(date)) {
|
|
|
@@ -4722,8 +4860,9 @@ public class IotRhDailyReportServiceImpl implements IotRhDailyReportService {
|
|
|
Integer dateDeptIdCount = dateDeptIds.size();
|
|
|
Integer mainDeviceIdCount = currentDeviceDeptIds.size();
|
|
|
BigDecimal rate = BigDecimal.ZERO;
|
|
|
- if (mainDeviceIdCount > 0) {
|
|
|
- BigDecimal total = new BigDecimal(mainDeviceIdCount);
|
|
|
+ if (dateTotalReportPair.containsKey(date)) {
|
|
|
+ Integer totalReportNum = dateTotalReportPair.get(date);
|
|
|
+ BigDecimal total = new BigDecimal(totalReportNum);
|
|
|
BigDecimal current = new BigDecimal(dateDeptIdCount);
|
|
|
rate = current.divide(total, 4, RoundingMode.HALF_UP);
|
|
|
}
|