|
@@ -53,6 +53,15 @@ public class CockpitOverviewModulesService {
|
|
|
// 排行不再截断(维护者 2026-10-26:近 30 日共 27 起,页面只列出 14+6+3=23 起,读者对不上数)。
|
|
// 排行不再截断(维护者 2026-10-26:近 30 日共 27 起,页面只列出 14+6+3=23 起,读者对不上数)。
|
|
|
// 保留常量为 0 表达「全部」,比删掉更明确 —— 调用点读到它就知道这是刻意口径。
|
|
// 保留常量为 0 表达「全部」,比删掉更明确 —— 调用点读到它就知道这是刻意口径。
|
|
|
private static final int RANKING_TOP_SIZE = 0;
|
|
private static final int RANKING_TOP_SIZE = 0;
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 类型排行里代表「预警类型未填」的占位码(mapper 把空 / NULL 归入它)。
|
|
|
|
|
+ *
|
|
|
|
|
+ * 为什么需要它:{@code warning_type} 是 NOT NULL 但可为空串。旧实现让空串单独成一行,
|
|
|
|
|
+ * 服务层又把空 code 丢掉,于是「近30日共 XX 起」总是大于各行之和(维护者 2026-11-12)。
|
|
|
|
|
+ * 归一个显式占位码后行之和与 total 同源;界面用中文名,不露码值。
|
|
|
|
|
+ */
|
|
|
|
|
+ private static final String UNKNOWN_WARNING_TYPE = "UNKNOWN";
|
|
|
|
|
+ private static final String UNKNOWN_WARNING_TYPE_NAME = "未分类";
|
|
|
private static final int TREND_DAYS = 7;
|
|
private static final int TREND_DAYS = 7;
|
|
|
private static final int WORK_ORDER_CLOSED = 5;
|
|
private static final int WORK_ORDER_CLOSED = 5;
|
|
|
private static final int OPER_TYPE_RECEIVE = 2;
|
|
private static final int OPER_TYPE_RECEIVE = 2;
|
|
@@ -404,7 +413,7 @@ public class CockpitOverviewModulesService {
|
|
|
snapshot == null ? null : snapshot.getTypeCounts())) {
|
|
snapshot == null ? null : snapshot.getTypeCounts())) {
|
|
|
String code = row.getTypeCode();
|
|
String code = row.getTypeCode();
|
|
|
top.add(new CockpitOverviewWarningStudyResponse.TopType(
|
|
top.add(new CockpitOverviewWarningStudyResponse.TopType(
|
|
|
- code, typeName(code, typeNames, normalizedNames), row.getCount()));
|
|
|
|
|
|
|
+ code, rankingTypeName(code, typeNames, normalizedNames), row.getCount()));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
int rankingTotal = snapshot == null ? 0 : snapshot.getRankingTotal();
|
|
int rankingTotal = snapshot == null ? 0 : snapshot.getRankingTotal();
|
|
@@ -661,6 +670,17 @@ public class CockpitOverviewModulesService {
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 排行行的展示名:占位码给中文名(界面不露码值),其余沿用 warning_type 词表的降级链。
|
|
|
|
|
+ */
|
|
|
|
|
+ private static String rankingTypeName(
|
|
|
|
|
+ String code, Map<String, String> typeNames, Map<String, String> normalizedNames) {
|
|
|
|
|
+ if (UNKNOWN_WARNING_TYPE.equals(code)) {
|
|
|
|
|
+ return UNKNOWN_WARNING_TYPE_NAME;
|
|
|
|
|
+ }
|
|
|
|
|
+ return typeName(code, typeNames, normalizedNames);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
private static String typeName(
|
|
private static String typeName(
|
|
|
String code, Map<String, String> typeNames, Map<String, String> normalizedNames) {
|
|
String code, Map<String, String> typeNames, Map<String, String> normalizedNames) {
|
|
|
String name = code == null ? null : typeNames.get(code);
|
|
String name = code == null ? null : typeNames.get(code);
|