BI月台作业准时率计算

This commit is contained in:
秦鸿展
2026-09-09 22:02:31 +08:00
parent 3907b126d9
commit 0493030620
3 changed files with 10 additions and 12 deletions
@@ -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());
}
@@ -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());
}