From 23fab39fddc350b82231c5eb27298a719aef72b5 Mon Sep 17 00:00:00 2001
From: xyc <jc_xiong@hotmail.com>
Date: 星期三, 07 十月 2026 09:13:31 +0800
Subject: [PATCH] docs(交接): 补充 10-07 上午国省道调整更正与新会话接手说明
---
traffic-audit-server/src/main/java/com/trafficaudit/holiday/service/HolidayBulletinService.java | 28 ++++++++++++++++++++++------
1 files changed, 22 insertions(+), 6 deletions(-)
diff --git a/traffic-audit-server/src/main/java/com/trafficaudit/holiday/service/HolidayBulletinService.java b/traffic-audit-server/src/main/java/com/trafficaudit/holiday/service/HolidayBulletinService.java
index 312d18f..77f85f9 100644
--- a/traffic-audit-server/src/main/java/com/trafficaudit/holiday/service/HolidayBulletinService.java
+++ b/traffic-audit-server/src/main/java/com/trafficaudit/holiday/service/HolidayBulletinService.java
@@ -44,6 +44,8 @@
private static final BigDecimal EPSILON = new BigDecimal("0.0000001");
private static final int EXCEL_ONE_DECIMAL_PERCENT = 1;
private static final int EXCEL_TWO_DECIMAL_PERCENT = 2;
+ private static final int EXCEL_SEVEN_DECIMAL_YI = 7;
+ private static final BigDecimal TEN_THOUSAND = new BigDecimal("10000");
@Value("${holiday.bulletin-template:docs/涓撻」缁熻/閲嶈鑺傚亣鏃�/婀栧寳鐪佸浗搴嗗亣鏈熺患鍚堣繍杈撳娴佸揩鎶ユā鏉�.docx}")
private String bulletinTemplatePath;
@@ -63,7 +65,7 @@
throw new IllegalArgumentException("鎵�閫夋棩鏈熶笉鍦ㄥ凡閰嶇疆鐨勮妭鍋囨棩鑼冨洿鍐�");
}
DailyMetrics previousDay = current.getDayIndex() > 1
- ? statService.dailyMetrics(current.getYear(), current.getHolidayType(), current.getDayIndex() - 1) : null;
+ ? statService.ringRatioBaseMetrics(current.getYear(), current.getHolidayType(), current.getDayIndex()) : null;
HolidayCalendar previousDayConfig = configService.findPreviousDay(current.getYear(), current.getHolidayType());
LocalDate previousDayDate = previousDayConfig == null || previousDayConfig.getHolidayDate() == null
? current.getDate().minusDays(1) : previousDayConfig.getHolidayDate();
@@ -139,7 +141,7 @@
EXCEL_ONE_DECIMAL_PERCENT),
ratio(current.getNonBusinessPersonFlow(), twoYearsAgo == null ? null : twoYearsAgo.getNonBusinessPersonFlow(),
EXCEL_ONE_DECIMAL_PERCENT),
- number(currentCumulative.getNonBusinessPersonFlow()),
+ numberCumulative(currentCumulative.getNonBusinessPersonFlow()),
ratio(currentCumulative.getNonBusinessPersonFlow(),
previousYearCumulative == null ? null : previousYearCumulative.getNonBusinessPersonFlow(),
EXCEL_TWO_DECIMAL_PERCENT),
@@ -151,7 +153,7 @@
number(current.getRoad()),
ratio(current.getRoad(), previousDay == null ? null : previousDay.getRoad(), EXCEL_ONE_DECIMAL_PERCENT),
ratio(current.getRoad(), previousYear == null ? null : previousYear.getRoad(), EXCEL_ONE_DECIMAL_PERCENT),
- ratio(current.getRoad(), twoYearsAgo == null ? null : twoYearsAgo.getRoad(), EXCEL_ONE_DECIMAL_PERCENT),
+ ratio(current.getRoad(), twoYearsAgo == null ? null : twoYearsAgo.getRoad(), EXCEL_TWO_DECIMAL_PERCENT),
number(currentCumulative.getRoad()),
ratio(currentCumulative.getRoad(), previousYearCumulative == null ? null : previousYearCumulative.getRoad(),
EXCEL_ONE_DECIMAL_PERCENT),
@@ -166,7 +168,7 @@
EXCEL_ONE_DECIMAL_PERCENT),
ratio(current.getRoadPersonFlow(), twoYearsAgo == null ? null : twoYearsAgo.getRoadPersonFlow(),
EXCEL_ONE_DECIMAL_PERCENT),
- number(currentCumulative.getRoadPersonFlow()),
+ numberCumulative(currentCumulative.getRoadPersonFlow()),
ratio(currentCumulative.getRoadPersonFlow(),
previousYearCumulative == null ? null : previousYearCumulative.getRoadPersonFlow(),
EXCEL_TWO_DECIMAL_PERCENT),
@@ -206,7 +208,7 @@
EXCEL_ONE_DECIMAL_PERCENT),
ratio(current.getTotalPersonFlow(), twoYearsAgo == null ? null : twoYearsAgo.getTotalPersonFlow(),
EXCEL_ONE_DECIMAL_PERCENT),
- number(currentCumulative.getTotalPersonFlow()),
+ numberCumulative(currentCumulative.getTotalPersonFlow()),
ratio(currentCumulative.getTotalPersonFlow(),
previousYearCumulative == null ? null : previousYearCumulative.getTotalPersonFlow(),
EXCEL_TWO_DECIMAL_PERCENT),
@@ -376,7 +378,7 @@
DailyMetrics twoYearsAgoCumulative) {
BigDecimal total = currentCumulative == null ? null : currentCumulative.getTotalPersonFlow();
return String.format("鍋囨湡浠ユ潵锛屽叏鐪佸叏绀句細璺ㄥ尯鍩熶汉鍛樻祦鍔ㄩ噺绱%s涓囦汉娆★紝姣�2025骞村悓鏈�%s锛屾瘮2024骞村悓鏈�%s銆�",
- formatNumber(total),
+ formatNumber(displayedCumulativeWan(total)),
ratioPhrase(total, previousYearCumulative == null ? null : previousYearCumulative.getTotalPersonFlow(),
EXCEL_TWO_DECIMAL_PERCENT),
ratioPhrase(total, twoYearsAgoCumulative == null ? null : twoYearsAgoCumulative.getTotalPersonFlow(),
@@ -407,6 +409,20 @@
return value == null ? "鈥�" : formatNumber(value);
}
+ private String numberCumulative(BigDecimal value) {
+ return value == null ? "鈥�" : formatNumber(displayedCumulativeWan(value));
+ }
+
+ /**
+ * Source cumulative cells U5/X5/AA5 are stored in 100-million units and displayed with seven decimals.
+ * Mirror that displayed precision before the bulletin converts the value to 10-thousand units.
+ */
+ private BigDecimal displayedCumulativeWan(BigDecimal cumulativeWan) {
+ if (cumulativeWan == null) return null;
+ BigDecimal yi = cumulativeWan.divide(TEN_THOUSAND, EXCEL_SEVEN_DECIMAL_YI, RoundingMode.HALF_UP);
+ return HolidayNumberUtils.normalize(yi.multiply(TEN_THOUSAND));
+ }
+
private String formatNumber(BigDecimal value) {
if (value == null) return "";
return HolidayNumberUtils.format2(value);
--
Gitblit v1.9.1