diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java index 1ee7499..0a555b3 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java @@ -86,7 +86,7 @@ } @GetMapping("/warn_month_alarms") - @ApiOperation(value = "告警月份分析", position = 50) + @ApiOperation(value = "告警分析", position = 50) public Result warnMonthAlarms(WarnMonthAlarmsRequest request){ WarnMonthAlarmsResponse response = statisticsService.warnMonthAlarms(request); return success(response); diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java index 1ee7499..0a555b3 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java @@ -86,7 +86,7 @@ } @GetMapping("/warn_month_alarms") - @ApiOperation(value = "告警月份分析", position = 50) + @ApiOperation(value = "告警分析", position = 50) public Result warnMonthAlarms(WarnMonthAlarmsRequest request){ WarnMonthAlarmsResponse response = statisticsService.warnMonthAlarms(request); return success(response); diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/KillRecord.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/KillRecord.java index 7c88f5c..be1dc26 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/KillRecord.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/KillRecord.java @@ -55,6 +55,11 @@ + /** + * 项目编码 + */ + @ApiModelProperty(value = "项目编码") + private String projectCode; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java index 1ee7499..0a555b3 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java @@ -86,7 +86,7 @@ } @GetMapping("/warn_month_alarms") - @ApiOperation(value = "告警月份分析", position = 50) + @ApiOperation(value = "告警分析", position = 50) public Result warnMonthAlarms(WarnMonthAlarmsRequest request){ WarnMonthAlarmsResponse response = statisticsService.warnMonthAlarms(request); return success(response); diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/KillRecord.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/KillRecord.java index 7c88f5c..be1dc26 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/KillRecord.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/KillRecord.java @@ -55,6 +55,11 @@ + /** + * 项目编码 + */ + @ApiModelProperty(value = "项目编码") + private String projectCode; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/killRecord/KillRecordQueryRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/killRecord/KillRecordQueryRequest.java index cef6e02..dda1a69 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/killRecord/KillRecordQueryRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/killRecord/KillRecordQueryRequest.java @@ -41,4 +41,11 @@ @ApiModelProperty(value = "状态") private String status; + + /** + * 项目编码 + */ + @ApiModelProperty(value = "项目编码") + private String projectCode; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java index 1ee7499..0a555b3 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java @@ -86,7 +86,7 @@ } @GetMapping("/warn_month_alarms") - @ApiOperation(value = "告警月份分析", position = 50) + @ApiOperation(value = "告警分析", position = 50) public Result warnMonthAlarms(WarnMonthAlarmsRequest request){ WarnMonthAlarmsResponse response = statisticsService.warnMonthAlarms(request); return success(response); diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/KillRecord.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/KillRecord.java index 7c88f5c..be1dc26 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/KillRecord.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/KillRecord.java @@ -55,6 +55,11 @@ + /** + * 项目编码 + */ + @ApiModelProperty(value = "项目编码") + private String projectCode; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/killRecord/KillRecordQueryRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/killRecord/KillRecordQueryRequest.java index cef6e02..dda1a69 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/killRecord/KillRecordQueryRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/killRecord/KillRecordQueryRequest.java @@ -41,4 +41,11 @@ @ApiModelProperty(value = "状态") private String status; + + /** + * 项目编码 + */ + @ApiModelProperty(value = "项目编码") + private String projectCode; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/KillRecordAnalysisResponse.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/KillRecordAnalysisResponse.java index 5701989..64fec64 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/KillRecordAnalysisResponse.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/KillRecordAnalysisResponse.java @@ -9,11 +9,11 @@ @Data public class KillRecordAnalysisResponse { - /** - * 项目编号 - */ - @ApiModelProperty(value = "项目编号") - private String projectCode; +// /** +// * 项目编号 +// */ +// @ApiModelProperty(value = "项目编号") +// private String projectCode; /** * 消杀站点记录list @@ -30,5 +30,11 @@ */ private Integer KillRecordAccrual; + + /** + * 站点累计天数 + */ + private Integer KillRecordCountDay; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java index 1ee7499..0a555b3 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java @@ -86,7 +86,7 @@ } @GetMapping("/warn_month_alarms") - @ApiOperation(value = "告警月份分析", position = 50) + @ApiOperation(value = "告警分析", position = 50) public Result warnMonthAlarms(WarnMonthAlarmsRequest request){ WarnMonthAlarmsResponse response = statisticsService.warnMonthAlarms(request); return success(response); diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/KillRecord.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/KillRecord.java index 7c88f5c..be1dc26 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/KillRecord.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/KillRecord.java @@ -55,6 +55,11 @@ + /** + * 项目编码 + */ + @ApiModelProperty(value = "项目编码") + private String projectCode; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/killRecord/KillRecordQueryRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/killRecord/KillRecordQueryRequest.java index cef6e02..dda1a69 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/killRecord/KillRecordQueryRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/killRecord/KillRecordQueryRequest.java @@ -41,4 +41,11 @@ @ApiModelProperty(value = "状态") private String status; + + /** + * 项目编码 + */ + @ApiModelProperty(value = "项目编码") + private String projectCode; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/KillRecordAnalysisResponse.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/KillRecordAnalysisResponse.java index 5701989..64fec64 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/KillRecordAnalysisResponse.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/KillRecordAnalysisResponse.java @@ -9,11 +9,11 @@ @Data public class KillRecordAnalysisResponse { - /** - * 项目编号 - */ - @ApiModelProperty(value = "项目编号") - private String projectCode; +// /** +// * 项目编号 +// */ +// @ApiModelProperty(value = "项目编号") +// private String projectCode; /** * 消杀站点记录list @@ -30,5 +30,11 @@ */ private Integer KillRecordAccrual; + + /** + * 站点累计天数 + */ + private Integer KillRecordCountDay; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponse.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponse.java index 6452d15..a6c16fd 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponse.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponse.java @@ -40,7 +40,7 @@ * 对应月份告警站点总数 */ @ApiModelProperty(value = "告警站点总数") - private Integer warnDeviceCount; + private Long warnDeviceCount; /** diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java index 1ee7499..0a555b3 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java @@ -86,7 +86,7 @@ } @GetMapping("/warn_month_alarms") - @ApiOperation(value = "告警月份分析", position = 50) + @ApiOperation(value = "告警分析", position = 50) public Result warnMonthAlarms(WarnMonthAlarmsRequest request){ WarnMonthAlarmsResponse response = statisticsService.warnMonthAlarms(request); return success(response); diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/KillRecord.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/KillRecord.java index 7c88f5c..be1dc26 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/KillRecord.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/KillRecord.java @@ -55,6 +55,11 @@ + /** + * 项目编码 + */ + @ApiModelProperty(value = "项目编码") + private String projectCode; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/killRecord/KillRecordQueryRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/killRecord/KillRecordQueryRequest.java index cef6e02..dda1a69 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/killRecord/KillRecordQueryRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/killRecord/KillRecordQueryRequest.java @@ -41,4 +41,11 @@ @ApiModelProperty(value = "状态") private String status; + + /** + * 项目编码 + */ + @ApiModelProperty(value = "项目编码") + private String projectCode; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/KillRecordAnalysisResponse.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/KillRecordAnalysisResponse.java index 5701989..64fec64 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/KillRecordAnalysisResponse.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/KillRecordAnalysisResponse.java @@ -9,11 +9,11 @@ @Data public class KillRecordAnalysisResponse { - /** - * 项目编号 - */ - @ApiModelProperty(value = "项目编号") - private String projectCode; +// /** +// * 项目编号 +// */ +// @ApiModelProperty(value = "项目编号") +// private String projectCode; /** * 消杀站点记录list @@ -30,5 +30,11 @@ */ private Integer KillRecordAccrual; + + /** + * 站点累计天数 + */ + private Integer KillRecordCountDay; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponse.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponse.java index 6452d15..a6c16fd 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponse.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponse.java @@ -40,7 +40,7 @@ * 对应月份告警站点总数 */ @ApiModelProperty(value = "告警站点总数") - private Integer warnDeviceCount; + private Long warnDeviceCount; /** diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponseInfo.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponseInfo.java index 99b03c9..86e0935 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponseInfo.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponseInfo.java @@ -1,11 +1,19 @@ package com.newfiber.termite.domain.response; import io.swagger.annotations.ApiModelProperty; +import lombok.Data; import java.util.List; +@Data public class WarnMonthAlarmsResponseInfo { /** + * 统计告警年份相关信息 + */ + @ApiModelProperty(value = "告警年份") + private Integer warnYear; + + /** * 统计告警月份相关信息 */ @ApiModelProperty(value = "告警月份") @@ -15,5 +23,5 @@ * 统计告警站点 */ @ApiModelProperty(value = "告警站点个数") - private Integer warnNumber; + private Long warnNumber; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java index 1ee7499..0a555b3 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java @@ -86,7 +86,7 @@ } @GetMapping("/warn_month_alarms") - @ApiOperation(value = "告警月份分析", position = 50) + @ApiOperation(value = "告警分析", position = 50) public Result warnMonthAlarms(WarnMonthAlarmsRequest request){ WarnMonthAlarmsResponse response = statisticsService.warnMonthAlarms(request); return success(response); diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/KillRecord.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/KillRecord.java index 7c88f5c..be1dc26 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/KillRecord.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/KillRecord.java @@ -55,6 +55,11 @@ + /** + * 项目编码 + */ + @ApiModelProperty(value = "项目编码") + private String projectCode; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/killRecord/KillRecordQueryRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/killRecord/KillRecordQueryRequest.java index cef6e02..dda1a69 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/killRecord/KillRecordQueryRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/killRecord/KillRecordQueryRequest.java @@ -41,4 +41,11 @@ @ApiModelProperty(value = "状态") private String status; + + /** + * 项目编码 + */ + @ApiModelProperty(value = "项目编码") + private String projectCode; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/KillRecordAnalysisResponse.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/KillRecordAnalysisResponse.java index 5701989..64fec64 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/KillRecordAnalysisResponse.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/KillRecordAnalysisResponse.java @@ -9,11 +9,11 @@ @Data public class KillRecordAnalysisResponse { - /** - * 项目编号 - */ - @ApiModelProperty(value = "项目编号") - private String projectCode; +// /** +// * 项目编号 +// */ +// @ApiModelProperty(value = "项目编号") +// private String projectCode; /** * 消杀站点记录list @@ -30,5 +30,11 @@ */ private Integer KillRecordAccrual; + + /** + * 站点累计天数 + */ + private Integer KillRecordCountDay; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponse.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponse.java index 6452d15..a6c16fd 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponse.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponse.java @@ -40,7 +40,7 @@ * 对应月份告警站点总数 */ @ApiModelProperty(value = "告警站点总数") - private Integer warnDeviceCount; + private Long warnDeviceCount; /** diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponseInfo.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponseInfo.java index 99b03c9..86e0935 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponseInfo.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponseInfo.java @@ -1,11 +1,19 @@ package com.newfiber.termite.domain.response; import io.swagger.annotations.ApiModelProperty; +import lombok.Data; import java.util.List; +@Data public class WarnMonthAlarmsResponseInfo { /** + * 统计告警年份相关信息 + */ + @ApiModelProperty(value = "告警年份") + private Integer warnYear; + + /** * 统计告警月份相关信息 */ @ApiModelProperty(value = "告警月份") @@ -15,5 +23,5 @@ * 统计告警站点 */ @ApiModelProperty(value = "告警站点个数") - private Integer warnNumber; + private Long warnNumber; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/MonitoringWarnRecordMapper.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/MonitoringWarnRecordMapper.java index bb26eea..8b0000e 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/MonitoringWarnRecordMapper.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/MonitoringWarnRecordMapper.java @@ -5,6 +5,7 @@ import com.newfiber.termite.domain.MonitoringWarnResponseStatistics; import com.newfiber.termite.domain.request.monitoringWarnRecord.MonitoringWarnRecordQueryRequest; import com.newfiber.termite.domain.MonitoringWarnRecord; +import com.newfiber.termite.domain.response.WarnMonthAlarmsResponseInfo; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -36,4 +37,7 @@ List selectListTotal(@Param("request") MonitoringWarnRecordQueryRequest request); + + List selectWarnMonthListTotal(@Param("request") String projectCode); + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java index 1ee7499..0a555b3 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java @@ -86,7 +86,7 @@ } @GetMapping("/warn_month_alarms") - @ApiOperation(value = "告警月份分析", position = 50) + @ApiOperation(value = "告警分析", position = 50) public Result warnMonthAlarms(WarnMonthAlarmsRequest request){ WarnMonthAlarmsResponse response = statisticsService.warnMonthAlarms(request); return success(response); diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/KillRecord.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/KillRecord.java index 7c88f5c..be1dc26 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/KillRecord.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/KillRecord.java @@ -55,6 +55,11 @@ + /** + * 项目编码 + */ + @ApiModelProperty(value = "项目编码") + private String projectCode; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/killRecord/KillRecordQueryRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/killRecord/KillRecordQueryRequest.java index cef6e02..dda1a69 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/killRecord/KillRecordQueryRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/killRecord/KillRecordQueryRequest.java @@ -41,4 +41,11 @@ @ApiModelProperty(value = "状态") private String status; + + /** + * 项目编码 + */ + @ApiModelProperty(value = "项目编码") + private String projectCode; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/KillRecordAnalysisResponse.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/KillRecordAnalysisResponse.java index 5701989..64fec64 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/KillRecordAnalysisResponse.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/KillRecordAnalysisResponse.java @@ -9,11 +9,11 @@ @Data public class KillRecordAnalysisResponse { - /** - * 项目编号 - */ - @ApiModelProperty(value = "项目编号") - private String projectCode; +// /** +// * 项目编号 +// */ +// @ApiModelProperty(value = "项目编号") +// private String projectCode; /** * 消杀站点记录list @@ -30,5 +30,11 @@ */ private Integer KillRecordAccrual; + + /** + * 站点累计天数 + */ + private Integer KillRecordCountDay; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponse.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponse.java index 6452d15..a6c16fd 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponse.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponse.java @@ -40,7 +40,7 @@ * 对应月份告警站点总数 */ @ApiModelProperty(value = "告警站点总数") - private Integer warnDeviceCount; + private Long warnDeviceCount; /** diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponseInfo.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponseInfo.java index 99b03c9..86e0935 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponseInfo.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponseInfo.java @@ -1,11 +1,19 @@ package com.newfiber.termite.domain.response; import io.swagger.annotations.ApiModelProperty; +import lombok.Data; import java.util.List; +@Data public class WarnMonthAlarmsResponseInfo { /** + * 统计告警年份相关信息 + */ + @ApiModelProperty(value = "告警年份") + private Integer warnYear; + + /** * 统计告警月份相关信息 */ @ApiModelProperty(value = "告警月份") @@ -15,5 +23,5 @@ * 统计告警站点 */ @ApiModelProperty(value = "告警站点个数") - private Integer warnNumber; + private Long warnNumber; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/MonitoringWarnRecordMapper.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/MonitoringWarnRecordMapper.java index bb26eea..8b0000e 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/MonitoringWarnRecordMapper.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/MonitoringWarnRecordMapper.java @@ -5,6 +5,7 @@ import com.newfiber.termite.domain.MonitoringWarnResponseStatistics; import com.newfiber.termite.domain.request.monitoringWarnRecord.MonitoringWarnRecordQueryRequest; import com.newfiber.termite.domain.MonitoringWarnRecord; +import com.newfiber.termite.domain.response.WarnMonthAlarmsResponseInfo; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -36,4 +37,7 @@ List selectListTotal(@Param("request") MonitoringWarnRecordQueryRequest request); + + List selectWarnMonthListTotal(@Param("request") String projectCode); + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/IMonitoringWarnRecordService.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/IMonitoringWarnRecordService.java index 11a7adb..4f8c759 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/IMonitoringWarnRecordService.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/IMonitoringWarnRecordService.java @@ -7,6 +7,9 @@ import com.newfiber.termite.domain.request.monitoringWarnRecord.MonitoringWarnRecordQueryRequest; import com.newfiber.termite.domain.request.monitoringWarnRecord.MonitoringWarnRecordSaveRequest; import com.newfiber.termite.domain.request.monitoringWarnRecord.MonitoringWarnRecordUpdateRequest; +import com.newfiber.termite.domain.response.WarnMonthAlarmsResponse; +import com.newfiber.termite.domain.response.WarnMonthAlarmsResponseInfo; + import java.util.List; /** @@ -79,4 +82,6 @@ * @return 历史告警记录统计 */ List selectListTotal(MonitoringWarnRecordQueryRequest request); + + List selectWarnMonthListTotal(String projectCode); } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java index 1ee7499..0a555b3 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java @@ -86,7 +86,7 @@ } @GetMapping("/warn_month_alarms") - @ApiOperation(value = "告警月份分析", position = 50) + @ApiOperation(value = "告警分析", position = 50) public Result warnMonthAlarms(WarnMonthAlarmsRequest request){ WarnMonthAlarmsResponse response = statisticsService.warnMonthAlarms(request); return success(response); diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/KillRecord.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/KillRecord.java index 7c88f5c..be1dc26 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/KillRecord.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/KillRecord.java @@ -55,6 +55,11 @@ + /** + * 项目编码 + */ + @ApiModelProperty(value = "项目编码") + private String projectCode; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/killRecord/KillRecordQueryRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/killRecord/KillRecordQueryRequest.java index cef6e02..dda1a69 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/killRecord/KillRecordQueryRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/killRecord/KillRecordQueryRequest.java @@ -41,4 +41,11 @@ @ApiModelProperty(value = "状态") private String status; + + /** + * 项目编码 + */ + @ApiModelProperty(value = "项目编码") + private String projectCode; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/KillRecordAnalysisResponse.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/KillRecordAnalysisResponse.java index 5701989..64fec64 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/KillRecordAnalysisResponse.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/KillRecordAnalysisResponse.java @@ -9,11 +9,11 @@ @Data public class KillRecordAnalysisResponse { - /** - * 项目编号 - */ - @ApiModelProperty(value = "项目编号") - private String projectCode; +// /** +// * 项目编号 +// */ +// @ApiModelProperty(value = "项目编号") +// private String projectCode; /** * 消杀站点记录list @@ -30,5 +30,11 @@ */ private Integer KillRecordAccrual; + + /** + * 站点累计天数 + */ + private Integer KillRecordCountDay; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponse.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponse.java index 6452d15..a6c16fd 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponse.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponse.java @@ -40,7 +40,7 @@ * 对应月份告警站点总数 */ @ApiModelProperty(value = "告警站点总数") - private Integer warnDeviceCount; + private Long warnDeviceCount; /** diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponseInfo.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponseInfo.java index 99b03c9..86e0935 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponseInfo.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponseInfo.java @@ -1,11 +1,19 @@ package com.newfiber.termite.domain.response; import io.swagger.annotations.ApiModelProperty; +import lombok.Data; import java.util.List; +@Data public class WarnMonthAlarmsResponseInfo { /** + * 统计告警年份相关信息 + */ + @ApiModelProperty(value = "告警年份") + private Integer warnYear; + + /** * 统计告警月份相关信息 */ @ApiModelProperty(value = "告警月份") @@ -15,5 +23,5 @@ * 统计告警站点 */ @ApiModelProperty(value = "告警站点个数") - private Integer warnNumber; + private Long warnNumber; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/MonitoringWarnRecordMapper.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/MonitoringWarnRecordMapper.java index bb26eea..8b0000e 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/MonitoringWarnRecordMapper.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/MonitoringWarnRecordMapper.java @@ -5,6 +5,7 @@ import com.newfiber.termite.domain.MonitoringWarnResponseStatistics; import com.newfiber.termite.domain.request.monitoringWarnRecord.MonitoringWarnRecordQueryRequest; import com.newfiber.termite.domain.MonitoringWarnRecord; +import com.newfiber.termite.domain.response.WarnMonthAlarmsResponseInfo; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -36,4 +37,7 @@ List selectListTotal(@Param("request") MonitoringWarnRecordQueryRequest request); + + List selectWarnMonthListTotal(@Param("request") String projectCode); + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/IMonitoringWarnRecordService.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/IMonitoringWarnRecordService.java index 11a7adb..4f8c759 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/IMonitoringWarnRecordService.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/IMonitoringWarnRecordService.java @@ -7,6 +7,9 @@ import com.newfiber.termite.domain.request.monitoringWarnRecord.MonitoringWarnRecordQueryRequest; import com.newfiber.termite.domain.request.monitoringWarnRecord.MonitoringWarnRecordSaveRequest; import com.newfiber.termite.domain.request.monitoringWarnRecord.MonitoringWarnRecordUpdateRequest; +import com.newfiber.termite.domain.response.WarnMonthAlarmsResponse; +import com.newfiber.termite.domain.response.WarnMonthAlarmsResponseInfo; + import java.util.List; /** @@ -79,4 +82,6 @@ * @return 历史告警记录统计 */ List selectListTotal(MonitoringWarnRecordQueryRequest request); + + List selectWarnMonthListTotal(String projectCode); } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/KillRecordServiceImpl.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/KillRecordServiceImpl.java index 96465be..b609d89 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/KillRecordServiceImpl.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/KillRecordServiceImpl.java @@ -1,9 +1,10 @@ package com.newfiber.termite.service.impl; -import java.util.List; +import java.time.LocalDate; +import java.util.*; +import java.util.stream.Collectors; + import com.newfiber.common.core.utils.DateUtils; -import java.util.Optional; -import java.util.ArrayList; import com.newfiber.common.core.web.domain.BaseEntity; import com.newfiber.common.core.exception.ServiceException; import com.newfiber.common.core.web.service.BaseServiceImpl; @@ -74,7 +75,22 @@ @Override public KillRecordAnalysisResponse analysis(KillRecordAnalysisRequest request) { - return new KillRecordAnalysisResponse(); + KillRecordQueryRequest killRecordQueryRequest = new KillRecordQueryRequest(); + KillRecordAnalysisResponse killRecordAnalysisResponse = new KillRecordAnalysisResponse(); + killRecordQueryRequest.setProjectCode(request.getProjectCode()); + //消杀记录站点所有信息 + List killRecordList = killRecordMapper.selectByCondition(killRecordQueryRequest); + killRecordAnalysisResponse.setKillRecords(killRecordList); + Collections.sort(killRecordList, Comparator.comparingInt(KillRecord::getContinueWarnDays).reversed()); + List topThreeRecords = killRecordList.subList(0, Math.min(3, killRecordList.size())); + int totalDaysOfTopThree = topThreeRecords.stream() + .mapToInt(KillRecord::getContinueWarnDays) + .sum(); + double percentage = (double) 3 / killRecordList.size() * 100; + killRecordAnalysisResponse.setKillRecordAccrual(killRecordList.size()); + killRecordAnalysisResponse.setKillRecordsProportion(percentage); + killRecordAnalysisResponse.setKillRecordCountDay(totalDaysOfTopThree); + return killRecordAnalysisResponse; } } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java index 1ee7499..0a555b3 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java @@ -86,7 +86,7 @@ } @GetMapping("/warn_month_alarms") - @ApiOperation(value = "告警月份分析", position = 50) + @ApiOperation(value = "告警分析", position = 50) public Result warnMonthAlarms(WarnMonthAlarmsRequest request){ WarnMonthAlarmsResponse response = statisticsService.warnMonthAlarms(request); return success(response); diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/KillRecord.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/KillRecord.java index 7c88f5c..be1dc26 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/KillRecord.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/KillRecord.java @@ -55,6 +55,11 @@ + /** + * 项目编码 + */ + @ApiModelProperty(value = "项目编码") + private String projectCode; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/killRecord/KillRecordQueryRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/killRecord/KillRecordQueryRequest.java index cef6e02..dda1a69 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/killRecord/KillRecordQueryRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/killRecord/KillRecordQueryRequest.java @@ -41,4 +41,11 @@ @ApiModelProperty(value = "状态") private String status; + + /** + * 项目编码 + */ + @ApiModelProperty(value = "项目编码") + private String projectCode; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/KillRecordAnalysisResponse.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/KillRecordAnalysisResponse.java index 5701989..64fec64 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/KillRecordAnalysisResponse.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/KillRecordAnalysisResponse.java @@ -9,11 +9,11 @@ @Data public class KillRecordAnalysisResponse { - /** - * 项目编号 - */ - @ApiModelProperty(value = "项目编号") - private String projectCode; +// /** +// * 项目编号 +// */ +// @ApiModelProperty(value = "项目编号") +// private String projectCode; /** * 消杀站点记录list @@ -30,5 +30,11 @@ */ private Integer KillRecordAccrual; + + /** + * 站点累计天数 + */ + private Integer KillRecordCountDay; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponse.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponse.java index 6452d15..a6c16fd 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponse.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponse.java @@ -40,7 +40,7 @@ * 对应月份告警站点总数 */ @ApiModelProperty(value = "告警站点总数") - private Integer warnDeviceCount; + private Long warnDeviceCount; /** diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponseInfo.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponseInfo.java index 99b03c9..86e0935 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponseInfo.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponseInfo.java @@ -1,11 +1,19 @@ package com.newfiber.termite.domain.response; import io.swagger.annotations.ApiModelProperty; +import lombok.Data; import java.util.List; +@Data public class WarnMonthAlarmsResponseInfo { /** + * 统计告警年份相关信息 + */ + @ApiModelProperty(value = "告警年份") + private Integer warnYear; + + /** * 统计告警月份相关信息 */ @ApiModelProperty(value = "告警月份") @@ -15,5 +23,5 @@ * 统计告警站点 */ @ApiModelProperty(value = "告警站点个数") - private Integer warnNumber; + private Long warnNumber; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/MonitoringWarnRecordMapper.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/MonitoringWarnRecordMapper.java index bb26eea..8b0000e 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/MonitoringWarnRecordMapper.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/MonitoringWarnRecordMapper.java @@ -5,6 +5,7 @@ import com.newfiber.termite.domain.MonitoringWarnResponseStatistics; import com.newfiber.termite.domain.request.monitoringWarnRecord.MonitoringWarnRecordQueryRequest; import com.newfiber.termite.domain.MonitoringWarnRecord; +import com.newfiber.termite.domain.response.WarnMonthAlarmsResponseInfo; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -36,4 +37,7 @@ List selectListTotal(@Param("request") MonitoringWarnRecordQueryRequest request); + + List selectWarnMonthListTotal(@Param("request") String projectCode); + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/IMonitoringWarnRecordService.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/IMonitoringWarnRecordService.java index 11a7adb..4f8c759 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/IMonitoringWarnRecordService.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/IMonitoringWarnRecordService.java @@ -7,6 +7,9 @@ import com.newfiber.termite.domain.request.monitoringWarnRecord.MonitoringWarnRecordQueryRequest; import com.newfiber.termite.domain.request.monitoringWarnRecord.MonitoringWarnRecordSaveRequest; import com.newfiber.termite.domain.request.monitoringWarnRecord.MonitoringWarnRecordUpdateRequest; +import com.newfiber.termite.domain.response.WarnMonthAlarmsResponse; +import com.newfiber.termite.domain.response.WarnMonthAlarmsResponseInfo; + import java.util.List; /** @@ -79,4 +82,6 @@ * @return 历史告警记录统计 */ List selectListTotal(MonitoringWarnRecordQueryRequest request); + + List selectWarnMonthListTotal(String projectCode); } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/KillRecordServiceImpl.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/KillRecordServiceImpl.java index 96465be..b609d89 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/KillRecordServiceImpl.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/KillRecordServiceImpl.java @@ -1,9 +1,10 @@ package com.newfiber.termite.service.impl; -import java.util.List; +import java.time.LocalDate; +import java.util.*; +import java.util.stream.Collectors; + import com.newfiber.common.core.utils.DateUtils; -import java.util.Optional; -import java.util.ArrayList; import com.newfiber.common.core.web.domain.BaseEntity; import com.newfiber.common.core.exception.ServiceException; import com.newfiber.common.core.web.service.BaseServiceImpl; @@ -74,7 +75,22 @@ @Override public KillRecordAnalysisResponse analysis(KillRecordAnalysisRequest request) { - return new KillRecordAnalysisResponse(); + KillRecordQueryRequest killRecordQueryRequest = new KillRecordQueryRequest(); + KillRecordAnalysisResponse killRecordAnalysisResponse = new KillRecordAnalysisResponse(); + killRecordQueryRequest.setProjectCode(request.getProjectCode()); + //消杀记录站点所有信息 + List killRecordList = killRecordMapper.selectByCondition(killRecordQueryRequest); + killRecordAnalysisResponse.setKillRecords(killRecordList); + Collections.sort(killRecordList, Comparator.comparingInt(KillRecord::getContinueWarnDays).reversed()); + List topThreeRecords = killRecordList.subList(0, Math.min(3, killRecordList.size())); + int totalDaysOfTopThree = topThreeRecords.stream() + .mapToInt(KillRecord::getContinueWarnDays) + .sum(); + double percentage = (double) 3 / killRecordList.size() * 100; + killRecordAnalysisResponse.setKillRecordAccrual(killRecordList.size()); + killRecordAnalysisResponse.setKillRecordsProportion(percentage); + killRecordAnalysisResponse.setKillRecordCountDay(totalDaysOfTopThree); + return killRecordAnalysisResponse; } } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/MonitoringWarnRecordServiceImpl.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/MonitoringWarnRecordServiceImpl.java index 9d3a995..87f7302 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/MonitoringWarnRecordServiceImpl.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/MonitoringWarnRecordServiceImpl.java @@ -10,6 +10,8 @@ import com.newfiber.termite.domain.request.monitoringWarnRecord.MonitoringWarnRecordQueryRequest; import com.newfiber.termite.domain.request.monitoringWarnRecord.MonitoringWarnRecordSaveRequest; import com.newfiber.termite.domain.request.monitoringWarnRecord.MonitoringWarnRecordUpdateRequest; +import com.newfiber.termite.domain.response.WarnMonthAlarmsResponse; +import com.newfiber.termite.domain.response.WarnMonthAlarmsResponseInfo; import com.newfiber.termite.enums.EExistsAnt; import com.newfiber.termite.mapper.MonitoringWarnRecordMapper; import com.newfiber.termite.service.IMonitoringWarnRecordService; @@ -93,4 +95,9 @@ return monitoringWarnRecordMapper.selectListTotal(request); } + @Override + public List selectWarnMonthListTotal(String projectCode) { + return monitoringWarnRecordMapper.selectWarnMonthListTotal(projectCode); + } + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java index 1ee7499..0a555b3 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java @@ -86,7 +86,7 @@ } @GetMapping("/warn_month_alarms") - @ApiOperation(value = "告警月份分析", position = 50) + @ApiOperation(value = "告警分析", position = 50) public Result warnMonthAlarms(WarnMonthAlarmsRequest request){ WarnMonthAlarmsResponse response = statisticsService.warnMonthAlarms(request); return success(response); diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/KillRecord.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/KillRecord.java index 7c88f5c..be1dc26 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/KillRecord.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/KillRecord.java @@ -55,6 +55,11 @@ + /** + * 项目编码 + */ + @ApiModelProperty(value = "项目编码") + private String projectCode; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/killRecord/KillRecordQueryRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/killRecord/KillRecordQueryRequest.java index cef6e02..dda1a69 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/killRecord/KillRecordQueryRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/killRecord/KillRecordQueryRequest.java @@ -41,4 +41,11 @@ @ApiModelProperty(value = "状态") private String status; + + /** + * 项目编码 + */ + @ApiModelProperty(value = "项目编码") + private String projectCode; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/KillRecordAnalysisResponse.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/KillRecordAnalysisResponse.java index 5701989..64fec64 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/KillRecordAnalysisResponse.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/KillRecordAnalysisResponse.java @@ -9,11 +9,11 @@ @Data public class KillRecordAnalysisResponse { - /** - * 项目编号 - */ - @ApiModelProperty(value = "项目编号") - private String projectCode; +// /** +// * 项目编号 +// */ +// @ApiModelProperty(value = "项目编号") +// private String projectCode; /** * 消杀站点记录list @@ -30,5 +30,11 @@ */ private Integer KillRecordAccrual; + + /** + * 站点累计天数 + */ + private Integer KillRecordCountDay; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponse.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponse.java index 6452d15..a6c16fd 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponse.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponse.java @@ -40,7 +40,7 @@ * 对应月份告警站点总数 */ @ApiModelProperty(value = "告警站点总数") - private Integer warnDeviceCount; + private Long warnDeviceCount; /** diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponseInfo.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponseInfo.java index 99b03c9..86e0935 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponseInfo.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponseInfo.java @@ -1,11 +1,19 @@ package com.newfiber.termite.domain.response; import io.swagger.annotations.ApiModelProperty; +import lombok.Data; import java.util.List; +@Data public class WarnMonthAlarmsResponseInfo { /** + * 统计告警年份相关信息 + */ + @ApiModelProperty(value = "告警年份") + private Integer warnYear; + + /** * 统计告警月份相关信息 */ @ApiModelProperty(value = "告警月份") @@ -15,5 +23,5 @@ * 统计告警站点 */ @ApiModelProperty(value = "告警站点个数") - private Integer warnNumber; + private Long warnNumber; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/MonitoringWarnRecordMapper.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/MonitoringWarnRecordMapper.java index bb26eea..8b0000e 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/MonitoringWarnRecordMapper.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/MonitoringWarnRecordMapper.java @@ -5,6 +5,7 @@ import com.newfiber.termite.domain.MonitoringWarnResponseStatistics; import com.newfiber.termite.domain.request.monitoringWarnRecord.MonitoringWarnRecordQueryRequest; import com.newfiber.termite.domain.MonitoringWarnRecord; +import com.newfiber.termite.domain.response.WarnMonthAlarmsResponseInfo; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -36,4 +37,7 @@ List selectListTotal(@Param("request") MonitoringWarnRecordQueryRequest request); + + List selectWarnMonthListTotal(@Param("request") String projectCode); + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/IMonitoringWarnRecordService.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/IMonitoringWarnRecordService.java index 11a7adb..4f8c759 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/IMonitoringWarnRecordService.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/IMonitoringWarnRecordService.java @@ -7,6 +7,9 @@ import com.newfiber.termite.domain.request.monitoringWarnRecord.MonitoringWarnRecordQueryRequest; import com.newfiber.termite.domain.request.monitoringWarnRecord.MonitoringWarnRecordSaveRequest; import com.newfiber.termite.domain.request.monitoringWarnRecord.MonitoringWarnRecordUpdateRequest; +import com.newfiber.termite.domain.response.WarnMonthAlarmsResponse; +import com.newfiber.termite.domain.response.WarnMonthAlarmsResponseInfo; + import java.util.List; /** @@ -79,4 +82,6 @@ * @return 历史告警记录统计 */ List selectListTotal(MonitoringWarnRecordQueryRequest request); + + List selectWarnMonthListTotal(String projectCode); } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/KillRecordServiceImpl.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/KillRecordServiceImpl.java index 96465be..b609d89 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/KillRecordServiceImpl.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/KillRecordServiceImpl.java @@ -1,9 +1,10 @@ package com.newfiber.termite.service.impl; -import java.util.List; +import java.time.LocalDate; +import java.util.*; +import java.util.stream.Collectors; + import com.newfiber.common.core.utils.DateUtils; -import java.util.Optional; -import java.util.ArrayList; import com.newfiber.common.core.web.domain.BaseEntity; import com.newfiber.common.core.exception.ServiceException; import com.newfiber.common.core.web.service.BaseServiceImpl; @@ -74,7 +75,22 @@ @Override public KillRecordAnalysisResponse analysis(KillRecordAnalysisRequest request) { - return new KillRecordAnalysisResponse(); + KillRecordQueryRequest killRecordQueryRequest = new KillRecordQueryRequest(); + KillRecordAnalysisResponse killRecordAnalysisResponse = new KillRecordAnalysisResponse(); + killRecordQueryRequest.setProjectCode(request.getProjectCode()); + //消杀记录站点所有信息 + List killRecordList = killRecordMapper.selectByCondition(killRecordQueryRequest); + killRecordAnalysisResponse.setKillRecords(killRecordList); + Collections.sort(killRecordList, Comparator.comparingInt(KillRecord::getContinueWarnDays).reversed()); + List topThreeRecords = killRecordList.subList(0, Math.min(3, killRecordList.size())); + int totalDaysOfTopThree = topThreeRecords.stream() + .mapToInt(KillRecord::getContinueWarnDays) + .sum(); + double percentage = (double) 3 / killRecordList.size() * 100; + killRecordAnalysisResponse.setKillRecordAccrual(killRecordList.size()); + killRecordAnalysisResponse.setKillRecordsProportion(percentage); + killRecordAnalysisResponse.setKillRecordCountDay(totalDaysOfTopThree); + return killRecordAnalysisResponse; } } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/MonitoringWarnRecordServiceImpl.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/MonitoringWarnRecordServiceImpl.java index 9d3a995..87f7302 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/MonitoringWarnRecordServiceImpl.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/MonitoringWarnRecordServiceImpl.java @@ -10,6 +10,8 @@ import com.newfiber.termite.domain.request.monitoringWarnRecord.MonitoringWarnRecordQueryRequest; import com.newfiber.termite.domain.request.monitoringWarnRecord.MonitoringWarnRecordSaveRequest; import com.newfiber.termite.domain.request.monitoringWarnRecord.MonitoringWarnRecordUpdateRequest; +import com.newfiber.termite.domain.response.WarnMonthAlarmsResponse; +import com.newfiber.termite.domain.response.WarnMonthAlarmsResponseInfo; import com.newfiber.termite.enums.EExistsAnt; import com.newfiber.termite.mapper.MonitoringWarnRecordMapper; import com.newfiber.termite.service.IMonitoringWarnRecordService; @@ -93,4 +95,9 @@ return monitoringWarnRecordMapper.selectListTotal(request); } + @Override + public List selectWarnMonthListTotal(String projectCode) { + return monitoringWarnRecordMapper.selectWarnMonthListTotal(projectCode); + } + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/StatisticsServiceImpl.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/StatisticsServiceImpl.java index 2032c40..ebcb4ed 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/StatisticsServiceImpl.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/StatisticsServiceImpl.java @@ -1,5 +1,6 @@ package com.newfiber.termite.service.impl; +import com.newfiber.common.core.exception.InnerAuthException; import com.newfiber.termite.domain.*; import com.newfiber.termite.domain.request.WarnMonitoringRequest; import com.newfiber.termite.domain.request.WarnMonthAlarmsRequest; @@ -11,6 +12,7 @@ import com.newfiber.termite.domain.request.statistic.SiteWarnTotalCountStatisticRequest; import com.newfiber.termite.domain.response.WarnMonitoringResponse; import com.newfiber.termite.domain.response.WarnMonthAlarmsResponse; +import com.newfiber.termite.domain.response.WarnMonthAlarmsResponseInfo; import com.newfiber.termite.domain.response.statistic.ProjectStatistic; import com.newfiber.termite.domain.response.statistic.ProjectStatisticDetail; import com.newfiber.termite.domain.response.statistic.SiteDailyWarnCount; @@ -22,6 +24,8 @@ import com.newfiber.termite.service.IMonitoringWarnRecordService; import com.newfiber.termite.service.IProjectInfoService; import com.newfiber.termite.service.IStatisticsService; + +import java.time.LocalDate; import java.util.ArrayList; import java.util.Comparator; import java.util.List; @@ -195,8 +199,41 @@ } @Override - public WarnMonthAlarmsResponse warnMonthAlarms(WarnMonthAlarmsRequest request) { - return new WarnMonthAlarmsResponse(); + public WarnMonthAlarmsResponse warnMonthAlarms( WarnMonthAlarmsRequest request) { + WarnMonthAlarmsResponse warnMonthAlarmsResponse = new WarnMonthAlarmsResponse(); + List warnMonthAlarmsResponseInfoList = monitoringWarnRecordService.selectWarnMonthListTotal(request.getProjectCode()); + LocalDate now = LocalDate.now(); + int currentYear = now.getYear(); + warnMonthAlarmsResponseInfoList.stream().filter(info -> info.getWarnYear() == currentYear).collect(Collectors.toList()); + if(warnMonthAlarmsResponseInfoList.isEmpty()){ + throw new InnerAuthException("该项目下没有告警信息"); + } + warnMonthAlarmsResponse.setWarnListInfo(warnMonthAlarmsResponseInfoList); + warnMonthAlarmsResponse.setProjectCode(request.getProjectCode()); + Map monthCounts = new TreeMap<>(); + long totalSnCount = 0; + for (WarnMonthAlarmsResponseInfo info : warnMonthAlarmsResponseInfoList) { + // String key = info.getWarnYear() + "-" + info.getWarnMonth(); + String key = info.getWarnMonth(); + monthCounts.merge(key, info.getWarnNumber(), Long::sum); + totalSnCount += info.getWarnNumber(); + } + List> sortedEntries = new ArrayList<>(monthCounts.entrySet()); + sortedEntries.sort(Map.Entry.comparingByValue(Comparator.reverseOrder())); + if (sortedEntries.size() >= 2) { + long sumOfTopTwo = sortedEntries.get(0).getValue() + sortedEntries.get(1).getValue(); + double percentage = ((double) sumOfTopTwo / totalSnCount) * 100; + warnMonthAlarmsResponse.setDeviceCountProportion(percentage); + warnMonthAlarmsResponse.setWarnDeviceCount(sumOfTopTwo); + warnMonthAlarmsResponse.setEndMonth(sortedEntries.get(0).getKey()); + warnMonthAlarmsResponse.setMaxStartMonth(sortedEntries.get(1).getKey()); + } else { + warnMonthAlarmsResponse.setDeviceCountProportion(100D); + warnMonthAlarmsResponse.setWarnDeviceCount(1L); + warnMonthAlarmsResponse.setEndMonth(sortedEntries.get(0).getKey()); + warnMonthAlarmsResponse.setMaxStartMonth(sortedEntries.get(0).getKey()); + } + return warnMonthAlarmsResponse; } @Override diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java index 1ee7499..0a555b3 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/controller/StatisticsController.java @@ -86,7 +86,7 @@ } @GetMapping("/warn_month_alarms") - @ApiOperation(value = "告警月份分析", position = 50) + @ApiOperation(value = "告警分析", position = 50) public Result warnMonthAlarms(WarnMonthAlarmsRequest request){ WarnMonthAlarmsResponse response = statisticsService.warnMonthAlarms(request); return success(response); diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/KillRecord.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/KillRecord.java index 7c88f5c..be1dc26 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/KillRecord.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/KillRecord.java @@ -55,6 +55,11 @@ + /** + * 项目编码 + */ + @ApiModelProperty(value = "项目编码") + private String projectCode; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/killRecord/KillRecordQueryRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/killRecord/KillRecordQueryRequest.java index cef6e02..dda1a69 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/killRecord/KillRecordQueryRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/killRecord/KillRecordQueryRequest.java @@ -41,4 +41,11 @@ @ApiModelProperty(value = "状态") private String status; + + /** + * 项目编码 + */ + @ApiModelProperty(value = "项目编码") + private String projectCode; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/KillRecordAnalysisResponse.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/KillRecordAnalysisResponse.java index 5701989..64fec64 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/KillRecordAnalysisResponse.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/KillRecordAnalysisResponse.java @@ -9,11 +9,11 @@ @Data public class KillRecordAnalysisResponse { - /** - * 项目编号 - */ - @ApiModelProperty(value = "项目编号") - private String projectCode; +// /** +// * 项目编号 +// */ +// @ApiModelProperty(value = "项目编号") +// private String projectCode; /** * 消杀站点记录list @@ -30,5 +30,11 @@ */ private Integer KillRecordAccrual; + + /** + * 站点累计天数 + */ + private Integer KillRecordCountDay; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponse.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponse.java index 6452d15..a6c16fd 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponse.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponse.java @@ -40,7 +40,7 @@ * 对应月份告警站点总数 */ @ApiModelProperty(value = "告警站点总数") - private Integer warnDeviceCount; + private Long warnDeviceCount; /** diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponseInfo.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponseInfo.java index 99b03c9..86e0935 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponseInfo.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/WarnMonthAlarmsResponseInfo.java @@ -1,11 +1,19 @@ package com.newfiber.termite.domain.response; import io.swagger.annotations.ApiModelProperty; +import lombok.Data; import java.util.List; +@Data public class WarnMonthAlarmsResponseInfo { /** + * 统计告警年份相关信息 + */ + @ApiModelProperty(value = "告警年份") + private Integer warnYear; + + /** * 统计告警月份相关信息 */ @ApiModelProperty(value = "告警月份") @@ -15,5 +23,5 @@ * 统计告警站点 */ @ApiModelProperty(value = "告警站点个数") - private Integer warnNumber; + private Long warnNumber; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/MonitoringWarnRecordMapper.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/MonitoringWarnRecordMapper.java index bb26eea..8b0000e 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/MonitoringWarnRecordMapper.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/MonitoringWarnRecordMapper.java @@ -5,6 +5,7 @@ import com.newfiber.termite.domain.MonitoringWarnResponseStatistics; import com.newfiber.termite.domain.request.monitoringWarnRecord.MonitoringWarnRecordQueryRequest; import com.newfiber.termite.domain.MonitoringWarnRecord; +import com.newfiber.termite.domain.response.WarnMonthAlarmsResponseInfo; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -36,4 +37,7 @@ List selectListTotal(@Param("request") MonitoringWarnRecordQueryRequest request); + + List selectWarnMonthListTotal(@Param("request") String projectCode); + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/IMonitoringWarnRecordService.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/IMonitoringWarnRecordService.java index 11a7adb..4f8c759 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/IMonitoringWarnRecordService.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/IMonitoringWarnRecordService.java @@ -7,6 +7,9 @@ import com.newfiber.termite.domain.request.monitoringWarnRecord.MonitoringWarnRecordQueryRequest; import com.newfiber.termite.domain.request.monitoringWarnRecord.MonitoringWarnRecordSaveRequest; import com.newfiber.termite.domain.request.monitoringWarnRecord.MonitoringWarnRecordUpdateRequest; +import com.newfiber.termite.domain.response.WarnMonthAlarmsResponse; +import com.newfiber.termite.domain.response.WarnMonthAlarmsResponseInfo; + import java.util.List; /** @@ -79,4 +82,6 @@ * @return 历史告警记录统计 */ List selectListTotal(MonitoringWarnRecordQueryRequest request); + + List selectWarnMonthListTotal(String projectCode); } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/KillRecordServiceImpl.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/KillRecordServiceImpl.java index 96465be..b609d89 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/KillRecordServiceImpl.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/KillRecordServiceImpl.java @@ -1,9 +1,10 @@ package com.newfiber.termite.service.impl; -import java.util.List; +import java.time.LocalDate; +import java.util.*; +import java.util.stream.Collectors; + import com.newfiber.common.core.utils.DateUtils; -import java.util.Optional; -import java.util.ArrayList; import com.newfiber.common.core.web.domain.BaseEntity; import com.newfiber.common.core.exception.ServiceException; import com.newfiber.common.core.web.service.BaseServiceImpl; @@ -74,7 +75,22 @@ @Override public KillRecordAnalysisResponse analysis(KillRecordAnalysisRequest request) { - return new KillRecordAnalysisResponse(); + KillRecordQueryRequest killRecordQueryRequest = new KillRecordQueryRequest(); + KillRecordAnalysisResponse killRecordAnalysisResponse = new KillRecordAnalysisResponse(); + killRecordQueryRequest.setProjectCode(request.getProjectCode()); + //消杀记录站点所有信息 + List killRecordList = killRecordMapper.selectByCondition(killRecordQueryRequest); + killRecordAnalysisResponse.setKillRecords(killRecordList); + Collections.sort(killRecordList, Comparator.comparingInt(KillRecord::getContinueWarnDays).reversed()); + List topThreeRecords = killRecordList.subList(0, Math.min(3, killRecordList.size())); + int totalDaysOfTopThree = topThreeRecords.stream() + .mapToInt(KillRecord::getContinueWarnDays) + .sum(); + double percentage = (double) 3 / killRecordList.size() * 100; + killRecordAnalysisResponse.setKillRecordAccrual(killRecordList.size()); + killRecordAnalysisResponse.setKillRecordsProportion(percentage); + killRecordAnalysisResponse.setKillRecordCountDay(totalDaysOfTopThree); + return killRecordAnalysisResponse; } } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/MonitoringWarnRecordServiceImpl.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/MonitoringWarnRecordServiceImpl.java index 9d3a995..87f7302 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/MonitoringWarnRecordServiceImpl.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/MonitoringWarnRecordServiceImpl.java @@ -10,6 +10,8 @@ import com.newfiber.termite.domain.request.monitoringWarnRecord.MonitoringWarnRecordQueryRequest; import com.newfiber.termite.domain.request.monitoringWarnRecord.MonitoringWarnRecordSaveRequest; import com.newfiber.termite.domain.request.monitoringWarnRecord.MonitoringWarnRecordUpdateRequest; +import com.newfiber.termite.domain.response.WarnMonthAlarmsResponse; +import com.newfiber.termite.domain.response.WarnMonthAlarmsResponseInfo; import com.newfiber.termite.enums.EExistsAnt; import com.newfiber.termite.mapper.MonitoringWarnRecordMapper; import com.newfiber.termite.service.IMonitoringWarnRecordService; @@ -93,4 +95,9 @@ return monitoringWarnRecordMapper.selectListTotal(request); } + @Override + public List selectWarnMonthListTotal(String projectCode) { + return monitoringWarnRecordMapper.selectWarnMonthListTotal(projectCode); + } + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/StatisticsServiceImpl.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/StatisticsServiceImpl.java index 2032c40..ebcb4ed 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/StatisticsServiceImpl.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/StatisticsServiceImpl.java @@ -1,5 +1,6 @@ package com.newfiber.termite.service.impl; +import com.newfiber.common.core.exception.InnerAuthException; import com.newfiber.termite.domain.*; import com.newfiber.termite.domain.request.WarnMonitoringRequest; import com.newfiber.termite.domain.request.WarnMonthAlarmsRequest; @@ -11,6 +12,7 @@ import com.newfiber.termite.domain.request.statistic.SiteWarnTotalCountStatisticRequest; import com.newfiber.termite.domain.response.WarnMonitoringResponse; import com.newfiber.termite.domain.response.WarnMonthAlarmsResponse; +import com.newfiber.termite.domain.response.WarnMonthAlarmsResponseInfo; import com.newfiber.termite.domain.response.statistic.ProjectStatistic; import com.newfiber.termite.domain.response.statistic.ProjectStatisticDetail; import com.newfiber.termite.domain.response.statistic.SiteDailyWarnCount; @@ -22,6 +24,8 @@ import com.newfiber.termite.service.IMonitoringWarnRecordService; import com.newfiber.termite.service.IProjectInfoService; import com.newfiber.termite.service.IStatisticsService; + +import java.time.LocalDate; import java.util.ArrayList; import java.util.Comparator; import java.util.List; @@ -195,8 +199,41 @@ } @Override - public WarnMonthAlarmsResponse warnMonthAlarms(WarnMonthAlarmsRequest request) { - return new WarnMonthAlarmsResponse(); + public WarnMonthAlarmsResponse warnMonthAlarms( WarnMonthAlarmsRequest request) { + WarnMonthAlarmsResponse warnMonthAlarmsResponse = new WarnMonthAlarmsResponse(); + List warnMonthAlarmsResponseInfoList = monitoringWarnRecordService.selectWarnMonthListTotal(request.getProjectCode()); + LocalDate now = LocalDate.now(); + int currentYear = now.getYear(); + warnMonthAlarmsResponseInfoList.stream().filter(info -> info.getWarnYear() == currentYear).collect(Collectors.toList()); + if(warnMonthAlarmsResponseInfoList.isEmpty()){ + throw new InnerAuthException("该项目下没有告警信息"); + } + warnMonthAlarmsResponse.setWarnListInfo(warnMonthAlarmsResponseInfoList); + warnMonthAlarmsResponse.setProjectCode(request.getProjectCode()); + Map monthCounts = new TreeMap<>(); + long totalSnCount = 0; + for (WarnMonthAlarmsResponseInfo info : warnMonthAlarmsResponseInfoList) { + // String key = info.getWarnYear() + "-" + info.getWarnMonth(); + String key = info.getWarnMonth(); + monthCounts.merge(key, info.getWarnNumber(), Long::sum); + totalSnCount += info.getWarnNumber(); + } + List> sortedEntries = new ArrayList<>(monthCounts.entrySet()); + sortedEntries.sort(Map.Entry.comparingByValue(Comparator.reverseOrder())); + if (sortedEntries.size() >= 2) { + long sumOfTopTwo = sortedEntries.get(0).getValue() + sortedEntries.get(1).getValue(); + double percentage = ((double) sumOfTopTwo / totalSnCount) * 100; + warnMonthAlarmsResponse.setDeviceCountProportion(percentage); + warnMonthAlarmsResponse.setWarnDeviceCount(sumOfTopTwo); + warnMonthAlarmsResponse.setEndMonth(sortedEntries.get(0).getKey()); + warnMonthAlarmsResponse.setMaxStartMonth(sortedEntries.get(1).getKey()); + } else { + warnMonthAlarmsResponse.setDeviceCountProportion(100D); + warnMonthAlarmsResponse.setWarnDeviceCount(1L); + warnMonthAlarmsResponse.setEndMonth(sortedEntries.get(0).getKey()); + warnMonthAlarmsResponse.setMaxStartMonth(sortedEntries.get(0).getKey()); + } + return warnMonthAlarmsResponse; } @Override diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/resources/mapper/termite/MonitoringWarnRecordMapper.xml b/newfiber-termites/newfiber-termites-dataup/src/main/resources/mapper/termite/MonitoringWarnRecordMapper.xml index 8956280..294f166 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/resources/mapper/termite/MonitoringWarnRecordMapper.xml +++ b/newfiber-termites/newfiber-termites-dataup/src/main/resources/mapper/termite/MonitoringWarnRecordMapper.xml @@ -104,6 +104,28 @@ GROUP BY tpi.project_code + +