|
@@ -119,6 +119,29 @@ class CockpitMultidimensionalAnalysisControllerTest {
|
|
|
.andExpect(jsonPath("$.data.mapFilter.deviceCodes", hasSize(2)));
|
|
.andExpect(jsonPath("$.data.mapFilter.deviceCodes", hasSize(2)));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 票 130:预警 publish_time 为空、update_time 在窗内时,多维窗口判据必须回退到 update_time,
|
|
|
|
|
+ * 该预警不得被整批抹掉(总数为 0)。
|
|
|
|
|
+ */
|
|
|
|
|
+ @Test
|
|
|
|
|
+ void warningWithMissingPublishTimeButPresentUpdateTimeIsCounted() throws Exception {
|
|
|
|
|
+ when(adapter.load()).thenReturn(new CockpitMultidimensionalAnalysisSnapshot(
|
|
|
|
|
+ "2026-09-02T15:59:50+08:00",
|
|
|
|
|
+ Arrays.asList(type("GAS_SENSOR", "燃气浓度计", "GAS")),
|
|
|
|
|
+ Arrays.asList(
|
|
|
|
|
+ warningWithUpdateTime("MD-NOPUB", "GAS_CONCENTRATION", "浓度超限", 2,
|
|
|
|
|
+ null, "2026-09-02T09:30:00+08:00", 0, "GAS_SENSOR", "D-1", "CLOSED")),
|
|
|
|
|
+ Collections.emptyList()));
|
|
|
|
|
+
|
|
|
|
|
+ mockMvc.perform(get(ENDPOINT)
|
|
|
|
|
+ .param("eventFamily", "WARNING")
|
|
|
|
|
+ .param("startTime", START)
|
|
|
|
|
+ .param("endTime", END))
|
|
|
|
|
+ .andExpect(status().isOk())
|
|
|
|
|
+ .andExpect(jsonPath("$.data.totalCount").value(1))
|
|
|
|
|
+ .andExpect(jsonPath("$.data.mapFilter.deviceCodes", hasSize(1)));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Test
|
|
@Test
|
|
|
void alarmFamilyIsIsolatedFromWarnings() throws Exception {
|
|
void alarmFamilyIsIsolatedFromWarnings() throws Exception {
|
|
|
mockMvc.perform(get(ENDPOINT)
|
|
mockMvc.perform(get(ENDPOINT)
|
|
@@ -526,15 +549,24 @@ class CockpitMultidimensionalAnalysisControllerTest {
|
|
|
private static CockpitMultidimensionalAnalysisSnapshot.SourceWarning warning(
|
|
private static CockpitMultidimensionalAnalysisSnapshot.SourceWarning warning(
|
|
|
String no, String eventType, String cause, Integer level, String eventTime,
|
|
String no, String eventType, String cause, Integer level, String eventTime,
|
|
|
Integer district, String typeCode, String deviceCode) {
|
|
Integer district, String typeCode, String deviceCode) {
|
|
|
- return warning(no, eventType, cause, level, eventTime, district, typeCode, deviceCode, null);
|
|
|
|
|
|
|
+ return new CockpitMultidimensionalAnalysisSnapshot.SourceWarning(
|
|
|
|
|
+ no, eventType, cause, level, eventTime, null, district, typeCode, deviceCode, null);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /** 票 126:带业务状态的样本(DRAFT 用于验证草稿排除)。 */
|
|
|
|
|
|
|
+ /** 票 126:带业务状态的样本(DRAFT 用于验证草稿排除);票 130:更新时刻留空。 */
|
|
|
private static CockpitMultidimensionalAnalysisSnapshot.SourceWarning warning(
|
|
private static CockpitMultidimensionalAnalysisSnapshot.SourceWarning warning(
|
|
|
String no, String eventType, String cause, Integer level, String eventTime,
|
|
String no, String eventType, String cause, Integer level, String eventTime,
|
|
|
Integer district, String typeCode, String deviceCode, String status) {
|
|
Integer district, String typeCode, String deviceCode, String status) {
|
|
|
return new CockpitMultidimensionalAnalysisSnapshot.SourceWarning(
|
|
return new CockpitMultidimensionalAnalysisSnapshot.SourceWarning(
|
|
|
- no, eventType, cause, level, eventTime, district, typeCode, deviceCode, status);
|
|
|
|
|
|
|
+ no, eventType, cause, level, eventTime, null, district, typeCode, deviceCode, status);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /** 票 130:带更新时刻的样本 —— 发布时刻为 null、更新时刻在窗内,验证窗口回退。 */
|
|
|
|
|
+ private static CockpitMultidimensionalAnalysisSnapshot.SourceWarning warningWithUpdateTime(
|
|
|
|
|
+ String no, String eventType, String cause, Integer level, String eventTime, String updateTime,
|
|
|
|
|
+ Integer district, String typeCode, String deviceCode, String status) {
|
|
|
|
|
+ return new CockpitMultidimensionalAnalysisSnapshot.SourceWarning(
|
|
|
|
|
+ no, eventType, cause, level, eventTime, updateTime, district, typeCode, deviceCode, status);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private static CockpitMultidimensionalAnalysisSnapshot.SourceAlarm alarm(
|
|
private static CockpitMultidimensionalAnalysisSnapshot.SourceAlarm alarm(
|