diff --git a/mhd-bi/src/main/java/com/mhd/bi/domain/biPlatformRealData/service/BiPlatformRealDataService.java b/mhd-bi/src/main/java/com/mhd/bi/domain/biPlatformRealData/service/BiPlatformRealDataService.java index de0a5597e..6eb351b2d 100644 --- a/mhd-bi/src/main/java/com/mhd/bi/domain/biPlatformRealData/service/BiPlatformRealDataService.java +++ b/mhd-bi/src/main/java/com/mhd/bi/domain/biPlatformRealData/service/BiPlatformRealDataService.java @@ -194,9 +194,8 @@ public class BiPlatformRealDataService { } /** - * 今日作业准时率 = 准时车辆数 / 今日预约车辆总数 × 100% - * 准时:今日(TARGET_DATE=今天)已进场且实际进场时间不超过该预约的预约结束时间 bookingEndTime; - * 实际进场时间超过 bookingEndTime 视为不准时。 + * 今日作业准时率 = 今日准时车辆数 / 今日预约总数 × 100%(四舍五入取整) + * 准时:实际进入时间 < 预约日期(TARGET_DATE) + 预约结束时间(BOOKING_END_TIME)。 * 今日预约总数为 0 时返回 0。 */ public int calcTodayOnTimeRate() { @@ -206,7 +205,7 @@ public class BiPlatformRealDataService { long total = po.getTotal() == null ? 0L : po.getTotal(); long onTime = po.getOnTimeCount() == null ? 0L : po.getOnTimeCount(); if (total <= 0) return 0; - // 四舍五入到整数百分比 + // 四舍五入到整数百分比(取整) return (int) Math.round(((double) onTime / (double) total) * 100.0); } catch (Exception e) { log.error("【YMS】计算今日作业准时率失败: {}", e.getMessage(), e); @@ -394,7 +393,7 @@ public class BiPlatformRealDataService { template.getPlatformOverview().setCurrentOccupancyRate(rate); template.getPlatformOverview().setTodayTasks(todayTasks); - // 作业准时率:准时车辆数 / 今日预约总数 × 100%(今日总数为 0 时返回 0) + // 作业准时率(实际进入时间 < 预约日期+预约结束时间 的车辆 / 今日预约总数 × 100% 取整) if (template.getEfficiencyStatistics() != null) { template.getEfficiencyStatistics().setPlatformOnTimeRate(calcTodayOnTimeRate()); } diff --git a/mhd-bi/src/main/java/com/mhd/bi/domain/biSnapshotSync/service/BiReportSnapshotSyncService.java b/mhd-bi/src/main/java/com/mhd/bi/domain/biSnapshotSync/service/BiReportSnapshotSyncService.java index a149ecf61..297a1331e 100644 --- a/mhd-bi/src/main/java/com/mhd/bi/domain/biSnapshotSync/service/BiReportSnapshotSyncService.java +++ b/mhd-bi/src/main/java/com/mhd/bi/domain/biSnapshotSync/service/BiReportSnapshotSyncService.java @@ -194,9 +194,7 @@ public class BiReportSnapshotSyncService { template.getPlatformOverview().setCurrentOccupancyRate(rate); template.getPlatformOverview().setTodayTasks(todayTasks); - // 作业准时率 = 准时车辆数 / 今日预约总数 × 100% - // 准时:今日(TARGET_DATE=今天)已进场且 ENTRY_TIME <= bookingEndTime(预约结束时间),超过视为不准时 - // 今日预约总数 = 0 时返回 0 + // 作业准时率 = 实际进入时间 < 预约日期+预约结束时间 的车辆 / 今日预约总数 × 100%(取整) if (template.getEfficiencyStatistics() != null) { template.getEfficiencyStatistics().setPlatformOnTimeRate(biPlatformRealDataService.calcTodayOnTimeRate()); } diff --git a/mhd-bi/src/main/resources/mapper/biPlatformRealData/BiPlatformRealDataMapper.xml b/mhd-bi/src/main/resources/mapper/biPlatformRealData/BiPlatformRealDataMapper.xml index 7d8e96670..10fc82463 100644 --- a/mhd-bi/src/main/resources/mapper/biPlatformRealData/BiPlatformRealDataMapper.xml +++ b/mhd-bi/src/main/resources/mapper/biPlatformRealData/BiPlatformRealDataMapper.xml @@ -50,16 +50,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"