diff --git a/hzims-service-api/hzims-ecological-api/pom.xml b/hzims-service-api/hzims-ecological-api/pom.xml deleted file mode 100644 index 71cf5e4..0000000 --- a/hzims-service-api/hzims-ecological-api/pom.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - 4.0.0 - - com.hnac.hzims - hzims-service-api - 4.0.0-SNAPSHOT - - - hzims-ecological-api - - - 8 - 8 - UTF-8 - - - - - - com.alibaba - easyexcel - 3.0.5 - - - - - - \ No newline at end of file diff --git a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/entity/Demo.java b/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/entity/Demo.java deleted file mode 100644 index f6aa071..0000000 --- a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/entity/Demo.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.hnac.hzims.suichang.entity; - -/** - * @Author: liangfan - * @Date: 2024-03-08 15:06 - * @Description: - */ - -public class Demo { -} diff --git a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/feign/ISuichangClient.java b/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/feign/ISuichangClient.java deleted file mode 100644 index fd61e11..0000000 --- a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/feign/ISuichangClient.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.hnac.hzims.suichang.feign; - -import com.hnac.hzims.suichang.vo.StationQueryReq; -import com.hnac.hzims.suichang.vo.StationVo; -import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.web.bind.annotation.GetMapping; - -import java.time.LocalDateTime; -import java.util.List; -import java.util.Map; - -@FeignClient( - value = "suichang" -) -public interface ISuichangClient { - String API_PREFIX = "/suichangClient"; - - String GET_STATION_BY_REQ = API_PREFIX + "/getStationListByReq"; - - String GET_DATA = API_PREFIX + "/getData"; - - @GetMapping(GET_STATION_BY_REQ) - List getStationListByReq(StationQueryReq req); - - @GetMapping(GET_DATA) - List> getData(String stcd, Integer accessRules, Integer saveTimeType, Integer timeInterval, - LocalDateTime startTime, LocalDateTime endTime); - -} diff --git a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/util/DateUtil.java b/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/util/DateUtil.java deleted file mode 100644 index b09590e..0000000 --- a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/util/DateUtil.java +++ /dev/null @@ -1,138 +0,0 @@ -package com.hnac.hzims.suichang.util; - -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.time.LocalTime; -import java.time.Month; -import java.time.format.DateTimeFormatter; -import java.time.temporal.ChronoUnit; -import java.util.Calendar; -import java.util.Date; -import java.util.HashMap; -import java.util.Map; - -public class DateUtil { - public static Map getStartEnd(String yearMonth) { - Map data = new HashMap<>(); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - try { - Date begin = sdf.parse(yearMonth + "-01 00:00:00"); - // 最大天数 - Date endSt = sdf.parse(yearMonth + "-" + getMaxDayByYearMonth(begin) + " 23:59:59"); - data.put("start", begin); - data.put("end", endSt); - } catch (ParseException e) { - e.printStackTrace(); - } - return data; - } - - public static int getMaxDayByYearMonth(Date start) { - Calendar calendar = Calendar.getInstance(); - calendar.setTime(start); - return calendar.getActualMaximum(Calendar.DAY_OF_MONTH); - } - - public static LocalDateTime getStartOfLastQuarter(LocalDateTime dateTime) { - int currentMonth = dateTime.getMonthValue(); - int currentYear = dateTime.getYear(); - - // 计算上个季度的开始月份 - int startMonthOfLastQuarter = (currentMonth - 1) / 3 * 3 + 1; - if (startMonthOfLastQuarter > currentMonth) { - // 如果当前月份在上个季度之后,则回到上一年的相应季度 - startMonthOfLastQuarter -= 3; - currentYear--; - } - - // 获取上个季度的开始时间(该季度的第一个月的第一天午夜) - return LocalDateTime.of(currentYear, startMonthOfLastQuarter, 1, 0, 0); - } - - public static LocalDateTime getEndOfLastQuarter(LocalDateTime dateTime) { - LocalDateTime startOfLastQuarter = getStartOfLastQuarter(dateTime); - - // 获取上个季度的结束时间(该季度的最后一个月的最后一天午夜) - int endMonthOfLastQuarter = startOfLastQuarter.getMonthValue() + 2; - int endYearOfLastQuarter = startOfLastQuarter.getYear(); - if (endMonthOfLastQuarter > 12) { - // 如果结束月份超过12,则回到下一年的相应月份 - endMonthOfLastQuarter -= 12; - endYearOfLastQuarter++; - } - - return LocalDateTime.of(endYearOfLastQuarter, endMonthOfLastQuarter, 1, 0, 0); - } - - public static LocalDateTime getStartOfHalfYear(LocalDateTime dateTime) { - int month = dateTime.getMonthValue(); - int year = dateTime.getYear(); - if (month <= 6) { - // 如果是上半年,则获取去年下半年的开始时间(7月1日) - year--; - return LocalDateTime.of(year, Month.JULY, 1, 0, 0); - } else { - return LocalDateTime.of(year, Month.JANUARY, 1, 0, 0); - } - } - - - public static LocalDateTime getEndOfHalfYear(LocalDateTime dateTime) { - int month = dateTime.getMonthValue(); - int year = dateTime.getYear(); - if (month <= 6) { - // 如果是上半年,则获取去年下半年的结束时间(1月1日) - return LocalDateTime.of(year, Month.JANUARY, 1, 0, 0, 0); - } else { - return LocalDateTime.of(year, Month.JULY, 1, 0, 0, 0); - } - - } - - public static long getHoursPassedToday() { - // 获取当前时间 - LocalTime currentTime = LocalTime.now(); - // 获取今天的开始时间(午夜0点) - LocalTime midnight = LocalTime.MIDNIGHT; - // 计算时间差,单位为小时 - return ChronoUnit.HOURS.between(midnight, currentTime); - } - - public static LocalDateTime getEndTime(String time) { - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); - java.time.LocalDate timeDate = java.time.LocalDate.parse(time, formatter); - LocalDateTime resultTime = LocalDateTime.of(timeDate, LocalTime.MIDNIGHT); - // 比较两个时间的大小 - LocalDateTime now = LocalDateTime.now().withHour(0).withMinute(0).withSecond(0).withNano(0); - if (now.compareTo(resultTime) > 0) { - resultTime = LocalDateTime.of(timeDate, LocalTime.MAX); - } else { - resultTime = LocalDateTime.now().withMinute(0).withSecond(0).withNano(0); - } - return resultTime; - } - - public static LocalDateTime getEndTimeByDay(String time) { - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); - java.time.LocalDate timeDate = java.time.LocalDate.parse(time, formatter); - return LocalDateTime.of(timeDate, LocalTime.MIDNIGHT).plusDays(1); - } - - public static LocalDateTime getStartTime(String time) { - // 创建一个 DateTimeFormatter 对象来解析日期字符串 - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); - java.time.LocalDate startDate = java.time.LocalDate.parse(time, formatter); - // 结合 LocalDate 和 LocalTime 创建 LocalDateTime 对象 - LocalDateTime startTime = LocalDateTime.of(startDate, LocalTime.MIDNIGHT); - return startTime; - } - - public static String getStringTime(LocalDateTime time) { - // 创建一个 DateTimeFormatter 对象,用于定义你想要的格式 - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); - // 使用 formatter 将 LocalDateTime 转换为 String - return time.format(formatter); - } -} diff --git a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/util/MemoryPagination.java b/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/util/MemoryPagination.java deleted file mode 100644 index 82d5ee4..0000000 --- a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/util/MemoryPagination.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.hnac.hzims.suichang.util; - -import org.springframework.util.CollectionUtils; - -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -/** - * @author tanghaihao - * @date 2023年07月12日 17:15 - */ -public class MemoryPagination { - /** - * 内存分页 - * - * @param records 待分页的数据 - * @param pageNum 当前页码 - * @param pageSize 每页显示的条数 - * @return 分页之后的数据 - */ - public static List pagination(List records, int pageNum, int pageSize) { - if (CollectionUtils.isEmpty(records)) { - return Collections.emptyList(); - } - int totalCount = records.size() ; - int remainder = totalCount % pageSize; - int pageCount = (remainder > 0) ? totalCount / pageSize + 1 : totalCount / pageSize; - if (remainder == 0) { - return records.stream().skip((pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); - } else { - if (pageNum == pageCount) { - return records.stream().skip((pageNum - 1) * pageSize).limit(totalCount).collect(Collectors.toList()); - } else { - return records.stream().skip((pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); - } - } - } -} diff --git a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/AvgMonitorCountVo.java b/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/AvgMonitorCountVo.java deleted file mode 100644 index d21ef16..0000000 --- a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/AvgMonitorCountVo.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.hnac.hzims.suichang.vo; - -import lombok.Data; - -import java.math.BigDecimal; -import java.util.List; - -/** - * @Author WL - * @Version v1.0 - * @Serial 1.0 - * @Date 2023/8/31 9:37 - */ -@Data -public class AvgMonitorCountVo { - - /** - * 电站名称 - */ - private String name; - /** - * 核定下限流量 - */ - private BigDecimal flowValue; - /** - * 考核天数 - */ - private Long count; - /** - * 合格天数 - */ - private Integer passCount; - /** - * 合格率 - */ - private String passPre; - - - private List infos; - - - -} diff --git a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/AvgMonitorReq.java b/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/AvgMonitorReq.java deleted file mode 100644 index 2f08a77..0000000 --- a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/AvgMonitorReq.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.hnac.hzims.suichang.vo; - -import lombok.Data; -import org.springblade.core.mp.support.Query; - -/** - * @Author WL - * @Version v1.0 - * @Serial 1.0 - * @Date 2023/8/31 9:37 - */ -@Data -public class AvgMonitorReq extends Query { - - /** - * 电站名称 - */ - private String name; - /** - * 开始时间 - */ - private String startTime; - /** - * 结束时间 - */ - private String endTime; - - -} diff --git a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/AvgMonitorVo.java b/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/AvgMonitorVo.java deleted file mode 100644 index c17ebd5..0000000 --- a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/AvgMonitorVo.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.hnac.hzims.suichang.vo; - -import lombok.Data; - -import java.math.BigDecimal; - -/** - * @Author WL - * @Version v1.0 - * @Serial 1.0 - * @Date 2023/8/31 9:37 - */ -@Data -public class AvgMonitorVo { - - /** - * 电站名称 - */ - private String name; - /** - * 核定下限流量 - */ - private BigDecimal flowValue; - /** - * 日均流量 - */ - private String avgFlow; - /** - * 实时流量 - */ - private String realFlow; - /** - * 现在的时间 - */ - private String dateNow; - - /** - * 经度(东经) - */ - private BigDecimal lgtd; - /** - * 纬度(北纬) - */ - private BigDecimal lttd; - /** - * 类型 1无节制电站 2流量计电站 - */ - private String stationType; - /** - * 上报率 - */ - private String passPre; - -} diff --git a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/EcologicalFlowVo.java b/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/EcologicalFlowVo.java deleted file mode 100644 index 028e033..0000000 --- a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/EcologicalFlowVo.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.hnac.hzims.suichang.vo; - -import lombok.Data; - -import java.math.BigDecimal; -import java.math.RoundingMode; - -/** - * @Author WL - * @Version v1.0 - * @Serial 1.0 - * @Date 2023/8/31 9:37 - */ -@Data -public class EcologicalFlowVo { - - /** - * 电站数 - */ - private Integer allStationListSize; - /** - * 无节制电站 - */ - private Integer noLimitStationListSize; - /** - * 流量计电站 - */ - private Integer flowStationListSize; - /** - * 昨日达标率 - */ - private String yesterdayFinishPer; - /** - * 昨日达标数量 - */ - private Integer yesterdayFinishCount; - /** - * 上月达标数量 - */ - private Integer monthFinishCount; - /** - * 上月达标率 - */ - private String monthFinishPer; - - /** - * 周达标率 - */ - private String weekFinishPer; - /** - * 季达标率 - */ - private String quarterFinishPer; - /** - * 半年达标率 - */ - private String halfYearFinishPer; - /** - * 年达标率 - */ - private String yearFinishPer; - /** - * 今天上报率 - */ - private String reportTodayPre; - /** - * 今天预警数 - */ - private Integer warnTodayCount; - /** - * 昨天上报率 - */ - private String reportYesTerdayPre; - /** - * 昨天预警数 - */ - private Integer warnYesTerdayCount; - - -} diff --git a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/ExamStationFlowDataReq.java b/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/ExamStationFlowDataReq.java deleted file mode 100644 index e03806f..0000000 --- a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/ExamStationFlowDataReq.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.hnac.hzims.suichang.vo; - -import lombok.Data; -import org.springblade.core.mp.support.Query; - -/** - * @Author WL - * @Version v1.0 - * @Serial 1.0 - * @Date 2023/8/31 9:37 - */ -@Data -public class ExamStationFlowDataReq extends Query { - - /** - * 电站名称 - */ - private String name; - /** - * 开始时间 - */ - private String startTime; - /** - * 结束时间 - */ - private String endTime; - - /** - * 1 无节制电站 2 流量计电站 - */ - private String stationType; - /** - * 是否达标 - */ - private String isPass; - -} diff --git a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/ExamStationFlowReportDayVo.java b/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/ExamStationFlowReportDayVo.java deleted file mode 100644 index 1e94e57..0000000 --- a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/ExamStationFlowReportDayVo.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.hnac.hzims.suichang.vo; - -import lombok.Data; - -import java.math.BigDecimal; -import java.util.List; - -/** - * @Author: liangfan - * @Date: 2024-03-15 18:33 - * @Description: - */ -@Data -public class ExamStationFlowReportDayVo { - - - /** - * 电站名称 - */ - private String name; - /** - * 所属区域 - */ - private String areaName; - - /** - * 状态 - */ - private String status; - /** - * 日泄放比 - */ - private String dayOutFlowPre; - /** - * 核定流量 - */ - private BigDecimal flowValue; - /** - * 前日日均流量 - */ - private BigDecimal yesTerDayAvgFlowValue; - /** - * 瞬时流量 - */ - private BigDecimal realFlowValue; - - /** - * 今日平均流量 - */ - private BigDecimal toDayAvgFlowValue; - - /** - * 实际下泄流量 - */ - private BigDecimal realOutFlow; - /** - * 核定下泄流量 - */ - private BigDecimal outFlow; -} diff --git a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/ExamStationFlowReportDetailVo.java b/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/ExamStationFlowReportDetailVo.java deleted file mode 100644 index 9099ad6..0000000 --- a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/ExamStationFlowReportDetailVo.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.hnac.hzims.suichang.vo; - -import lombok.Data; - -import java.math.BigDecimal; - -/** - * @Author: liangfan - * @Date: 2024-03-15 18:41 - * @Description: - */ -@Data -public class ExamStationFlowReportDetailVo { - - /** - * 核定流量 - */ - private BigDecimal ecologicalFlowValue; - /** - * 日均流量 - */ - private BigDecimal flowValue; - - /** - * 时间 - */ - private String tm; - - /** - * 是否合格 - */ - private String isPass; -} diff --git a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/ExamStationFlowReportVo.java b/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/ExamStationFlowReportVo.java deleted file mode 100644 index 8451be3..0000000 --- a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/ExamStationFlowReportVo.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.hnac.hzims.suichang.vo; - -import lombok.Data; - -import java.math.BigDecimal; -import java.util.List; - -/** - * @Author: liangfan - * @Date: 2024-03-15 18:33 - * @Description: - */ -@Data -public class ExamStationFlowReportVo { - - - /** - * 电站名称 - */ - private String name; - /** - * 所属区域 - */ - private String areaName; - /** - * 核定下限流量 - */ - private BigDecimal flowValue; - /** - * 考核天数 - */ - private Long count; - /** - * 合格天数 - */ - private Integer passCount; - /** - * 合格率 - */ - private String passPre; - - /** - * 是否合格 - */ - private String isPass; - - - private List infos; -} diff --git a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/FlowWarnQueryDTO.java b/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/FlowWarnQueryDTO.java deleted file mode 100644 index 07d9656..0000000 --- a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/FlowWarnQueryDTO.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.hnac.hzims.suichang.vo; - -import lombok.Data; - -/** - * @Author: liangfan - * @Date: 2024-03-20 17:23 - * @Description: - */ -@Data -public class FlowWarnQueryDTO { - /** - * 开始时间 - */ - private String startTime; - - - /** - * 结束时间 - */ - private String endTime; - /** - * 站点id - */ - private String objectCode; -} diff --git a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/FlowWarnVo.java b/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/FlowWarnVo.java deleted file mode 100644 index 629e5bf..0000000 --- a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/FlowWarnVo.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.hnac.hzims.suichang.vo; - -import lombok.Data; - -/** - * @Author: liangfan - * @Date: 2024-03-19 10:00 - * @Description: - */ -@Data -public class FlowWarnVo { - /** - * 站点名称 - */ - String name; - /** - * 消息内容 - */ - String content; - /** - * 发送时间 - */ - String sendTime; - - /** - * 发送人id - */ - String receiveUserId; - /** - * 发送人姓名 - */ - String receiveUserName; - /** - * 业务对象来源(数据平台、水库等) - */ - String objectSource; - - /** - * 业务对象编码 - */ - String objectCode; - - String alarmLevel; - -} diff --git a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/ImageReq.java b/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/ImageReq.java deleted file mode 100644 index 7fd99e5..0000000 --- a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/ImageReq.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.hnac.hzims.suichang.vo; - -import lombok.Data; - -/** - * @Author: liangfan - * @Date: 2024-03-21 19:04 - * @Description: - */ - -@Data -public class ImageReq { - /** - * 开始时间 - */ - private String startTime; - /** - * 结束时间 - */ - private String endTime; - /** - * 站点名称 - */ - private String name; - /** - * 设备编码 - */ - private String deviceCode; - /** - * 正常 异常 - */ - private String status; -} diff --git a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/ImageVo.java b/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/ImageVo.java deleted file mode 100644 index 2d8533f..0000000 --- a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/ImageVo.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.hnac.hzims.suichang.vo; - -import lombok.Data; - -/** - * @Author: liangfan - * @Date: 2024-03-21 19:04 - * @Description: - */ - -@Data -public class ImageVo { - - private Long id; - - private String stcd; - - private String time; - - private String data; - - private String manualpath; - - private String name; - - private String status; - -} diff --git a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/MissingImagesRes.java b/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/MissingImagesRes.java deleted file mode 100644 index 10dfeaa..0000000 --- a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/MissingImagesRes.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.hnac.hzims.suichang.vo; - -import lombok.Data; - -/** - * @Author: liangfan - * @Date: 2024-03-21 19:33 - * @Description: - */ -@Data -public class MissingImagesRes { - - String deviceCode; - - String name; - - String area; - - String month; - - String monthMissingPre; -} diff --git a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/RealMonitorExportDTO.java b/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/RealMonitorExportDTO.java deleted file mode 100644 index 4e2c0b3..0000000 --- a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/RealMonitorExportDTO.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.hnac.hzims.suichang.vo; - -import com.alibaba.excel.annotation.ExcelProperty; -import lombok.Data; - -import java.math.BigDecimal; - -/** - * @Author WL - * @Version v1.0 - * @Serial 1.0 - * @Date 2023/8/31 9:37 - */ -@Data -public class RealMonitorExportDTO { - - /** - * 电站名称 - */ - @ExcelProperty(value = "电站名称", index = 0) - private String name; - /** - * 核定下限流量 - */ - @ExcelProperty(value = "核定流量(m³/s)", index = 1) - private BigDecimal flowValue; - /** - * 监测流量 - */ - @ExcelProperty(value = "监测流量(m³/s)", index = 2) - private String realFlow; - - /** - * 上报个数 - */ - @ExcelProperty(value = "上报数(个)", index = 3) - private Integer reportCount; - - /** - * 时间 - */ - @ExcelProperty(value = "时间", index = 4) - private String dateNow; - - -} diff --git a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/RealMonitorRes.java b/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/RealMonitorRes.java deleted file mode 100644 index 86e0c3c..0000000 --- a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/RealMonitorRes.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.hnac.hzims.suichang.vo; - -import lombok.Data; - -import java.math.BigDecimal; -import java.util.List; - -/** - * @Author WL - * @Version v1.0 - * @Serial 1.0 - * @Date 2023/8/31 9:37 - */ -@Data -public class RealMonitorRes { - - /** - * 电站名称 - */ - private List realMonitorVos; - /** - * 应上报条数 - */ - private Long reportCount; - - -} diff --git a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/RealMonitorSingleInfoReq.java b/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/RealMonitorSingleInfoReq.java deleted file mode 100644 index 07bafd9..0000000 --- a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/RealMonitorSingleInfoReq.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.hnac.hzims.suichang.vo; - -import lombok.Data; -import org.springblade.core.mp.support.Query; - -/** - * @Author: liangfan - * @Date: 2024-03-14 09:56 - * @Description: - */ -@Data -public class RealMonitorSingleInfoReq extends Query { - - /** - * 设备编号 - */ - private String deviceCode; - - /** - * 开始时间 - */ - private String startTime; - /** - * 结束时间 - */ - private String endTime; -} diff --git a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/RealMonitorSingleInfoVo.java b/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/RealMonitorSingleInfoVo.java deleted file mode 100644 index 80738ed..0000000 --- a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/RealMonitorSingleInfoVo.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.hnac.hzims.suichang.vo; - -import com.alibaba.excel.annotation.ExcelProperty; -import lombok.Data; - -/** - * @Author: liangfan - * @Date: 2024-03-14 09:56 - * @Description: - */ -@Data -public class RealMonitorSingleInfoVo { - /** - * 实时值 - */ - @ExcelProperty(value = "流量值", index = 0) - private String value; - - /** - * 时间 - */ - @ExcelProperty(value = "监测时间", index = 1) - private String tm; - -} diff --git a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/RealMonitorVo.java b/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/RealMonitorVo.java deleted file mode 100644 index 71505a7..0000000 --- a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/RealMonitorVo.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.hnac.hzims.suichang.vo; - -import com.alibaba.excel.annotation.ExcelProperty; -import lombok.Data; - -import java.math.BigDecimal; - -/** - * @Author WL - * @Version v1.0 - * @Serial 1.0 - * @Date 2023/8/31 9:37 - */ -@Data -public class RealMonitorVo { - /** - * 设备编号 - */ - private String deviceCode; - - /** - * 电站名称 - */ - private String name; - /** - * 核定下限流量 - */ - private BigDecimal flowValue; - /** - * 监测流量 - */ - private String realFlow; - - /** - * 上报个数 - */ - private Integer reportCount; - - /** - * 时间 - */ - private String dateNow; - - private String areaName; - - -} diff --git a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/StationQueryReq.java b/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/StationQueryReq.java deleted file mode 100644 index 98cc6dc..0000000 --- a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/StationQueryReq.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.hnac.hzims.suichang.vo; - -import lombok.Data; - -/** - * @Author WL - * @Version v1.0 - * @Serial 1.0 - * @Date 2023/8/31 9:37 - */ -@Data -public class StationQueryReq { - - /** - * 电站名称 - */ - private String name; - - private String stationType; - -} diff --git a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/StationTreeRes.java b/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/StationTreeRes.java deleted file mode 100644 index 771346f..0000000 --- a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/StationTreeRes.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.hnac.hzims.suichang.vo; - -import lombok.Data; - -import java.util.List; - -/** - * @Author: liangfan - * @Date: 2024-03-25 17:21 - * @Description: - */ - -@Data -public class StationTreeRes { - StationVo stationVo; - /** - * 数量 - */ - int count; - /** - * 视频点位list - */ - List child; - -} diff --git a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/StationTypeVo.java b/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/StationTypeVo.java deleted file mode 100644 index a38aadd..0000000 --- a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/StationTypeVo.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.hnac.hzims.suichang.vo; - -import com.baomidou.mybatisplus.annotation.SqlCondition; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import com.fasterxml.jackson.databind.ser.std.NullSerializer; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import org.springblade.core.mp.support.QueryField; - -/** - * @Author: liangfan - * @Date: 2024-03-25 17:11 - * @Description: - */ - -@Data -public class StationTypeVo { - - @ApiModelProperty("主键ID") - private Long id; - - @ApiModelProperty("视频源配置名称") - private String name; - - @ApiModelProperty("站点ID") - private String stationId; - - @ApiModelProperty("机构ID") - private Long deptId; - - @ApiModelProperty("是否平台接入") - private Integer isHikvideo; - - @ApiModelProperty("类型") - private String type; - - @ApiModelProperty("视频类型;暂只包括清污机类型") - private String videoType; - - @ApiModelProperty("数据源地址") - private String liveSourceAddress; - - @ApiModelProperty("视频源编码") - private String pointCode; - - @ApiModelProperty("代理API网关nginx服务器ip端口") - private String videoHost; - - @ApiModelProperty("秘钥appkey") - private String appKey; - - @ApiModelProperty("秘钥appSecret") - private String appSecret; - - @ApiModelProperty("排序") - private Integer sort; - - @ApiModelProperty("站點排序") - private Integer stationSort; - - @ApiModelProperty("萤石云地址") - private String ysyUrl; - - @ApiModelProperty("视频归属类型 1代表防汛安全,2代表运行安全,3生态流量监视") - private Integer videoOwerType; - - @ApiModelProperty("拼音") - private String pingyin; - -} diff --git a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/StationVo.java b/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/StationVo.java deleted file mode 100644 index 053b8e6..0000000 --- a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/StationVo.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.hnac.hzims.suichang.vo; - -import lombok.Data; - -import java.math.BigDecimal; - -/** - * @Author WL - * @Version v1.0 - * @Serial 1.0 - * @Date 2023/8/31 9:37 - */ -@Data -public class StationVo { - - /** - * 名称 - */ - private String name; - /** - * 设备编号 - */ - private String deviceCode; - - - /** - * 核定流量 - */ - private BigDecimal flowValue; - - /** - * 电站类型 1 无节制电站 2流量计电站 - */ - private String stationType; - - /** - * 经度(东经) - */ - private BigDecimal lgtd; - /** - * 纬度(北纬) - */ - private BigDecimal lttd; - -} diff --git a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/StatisticsFlowDataDetailVo.java b/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/StatisticsFlowDataDetailVo.java deleted file mode 100644 index c35d2ff..0000000 --- a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/StatisticsFlowDataDetailVo.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.hnac.hzims.suichang.vo; - -import lombok.Data; - -import java.math.BigDecimal; - -/** - * @Author WL - * @Version v1.0 - * @Serial 1.0 - * @Date 2023/8/31 9:37 - */ -@Data -public class StatisticsFlowDataDetailVo { - - /** - * 电站名称 - */ - private String name; - - /** - * 核定流量 - */ - private String flowValue; - - /** - * 考核天数 - */ - private Integer examDays; - /** - * 合格天数 - */ - private Integer examPassDays = 0; - /** - * 合格率 - */ - private String examPassDayPre = "0.00%"; - - -} diff --git a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/StatisticsFlowDataReq.java b/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/StatisticsFlowDataReq.java deleted file mode 100644 index 3f8bc28..0000000 --- a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/StatisticsFlowDataReq.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.hnac.hzims.suichang.vo; - -import lombok.Data; -import org.springblade.core.mp.support.Query; - -/** - * @Author WL - * @Version v1.0 - * @Serial 1.0 - * @Date 2023/8/31 9:37 - */ -@Data -public class StatisticsFlowDataReq extends Query { - - /** - * 电站名称 - */ - private String name; - /** - * 开始时间 - */ - private String startTime; - /** - * 结束时间 - */ - private String endTime; - - -} diff --git a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/StatisticsFlowDataVo.java b/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/StatisticsFlowDataVo.java deleted file mode 100644 index 5c22822..0000000 --- a/hzims-service-api/hzims-ecological-api/src/main/java/com/hnac/hzims/suichang/vo/StatisticsFlowDataVo.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.hnac.hzims.suichang.vo; - -import lombok.Data; - -import java.util.List; - -/** - * @Author WL - * @Version v1.0 - * @Serial 1.0 - * @Date 2023/8/31 9:37 - */ -@Data -public class StatisticsFlowDataVo { - /** - * 区域名称 - */ - private String areaName; - /** - * 考核电站个数 - */ - private Integer examCount; - /** - * 达标电站个数 - */ - private Integer passCount; - /** - * 达标率 - */ - private String passPre; - /** - * 报表数据 - */ - private List detail; - - -} diff --git a/hzims-service-api/pom.xml b/hzims-service-api/pom.xml index 2eae475..9a242fe 100644 --- a/hzims-service-api/pom.xml +++ b/hzims-service-api/pom.xml @@ -25,7 +25,6 @@ middle-api alarm-api big-model-api - hzims-ecological-api diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/train/entity/InstitutionalEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/train/entity/InstitutionalEntity.java new file mode 100644 index 0000000..211bc4f --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/train/entity/InstitutionalEntity.java @@ -0,0 +1,20 @@ +package com.hnac.hzims.safeproduct.train.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.tenant.mp.TenantEntity; + + +/** + * @author xiashandong + * @created 2020/9/8 15:09 + **/ +@Data +@TableName("hzims_institutional_information") +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "制度资料实体类") +public class InstitutionalEntity extends TenantEntity { + +} \ No newline at end of file diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/train/entity/RectificationEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/train/entity/RectificationEntity.java new file mode 100644 index 0000000..bc97440 --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/train/entity/RectificationEntity.java @@ -0,0 +1,56 @@ +package com.hnac.hzims.safeproduct.train.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.tenant.mp.TenantEntity; + +import java.util.Date; + +/** + * @author ysj + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("hzims_rectification_supervision") +@ApiModel(value = "整改督办") +public class RectificationEntity extends TenantEntity { + + @ApiModelProperty(value = "站点编码") + private String stationId; + + @ApiModelProperty(value = "站点名称") + private String stationName; + + @ApiModelProperty(value = "责任人ID") + private Long personLiable; + + @ApiModelProperty(value = "责任人名称") + private String personLiableName; + + @ApiModelProperty(value = "整改类型: 0-整改闭环 1-会议督办") + private Integer rectificationType; + + @ApiModelProperty(value = "限时日期") + private Date limitTime; + + @ApiModelProperty(value = "提醒日期") + private Date remindTime; + + @ApiModelProperty(value = "完成日期") + private Date completeTime; + + @ApiModelProperty(value = "问题事项") + private String problemMatters; + + @ApiModelProperty(value = "措施") + private String measures; + + @ApiModelProperty(value = "问题附件路径") + private String problemAttachmentPath; + + @ApiModelProperty(value = "问题附件名称") + private String problemAttachmentName; +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/train/entity/TrainEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/train/entity/TrainEntity.java new file mode 100644 index 0000000..c3351f6 --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/train/entity/TrainEntity.java @@ -0,0 +1,20 @@ +package com.hnac.hzims.safeproduct.train.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.tenant.mp.TenantEntity; + + +/** + * @author xiashandong + * @created 2020/9/8 15:09 + **/ +@Data +@TableName("hzims_safety_training") +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "安全培训实体类") +public class TrainEntity extends TenantEntity { + +} \ No newline at end of file diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/train/entity/ViolationEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/train/entity/ViolationEntity.java new file mode 100644 index 0000000..0512f76 --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/train/entity/ViolationEntity.java @@ -0,0 +1,62 @@ +package com.hnac.hzims.safeproduct.train.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.tenant.mp.TenantEntity; +import org.springblade.core.tool.utils.DateUtil; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +/** + * @author ysj + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("hzims_violation_assessment") +@ApiModel(value = "违章考核实体类") +public class ViolationEntity extends TenantEntity { + + + @ApiModelProperty(value = "站点编码") + private String stationId; + + @ApiModelProperty(value = "站点名称") + private String stationName; + + @ApiModelProperty(value = "发现人ID") + private Long discoverer; + + @ApiModelProperty(value = "发现人名称") + private String discovererName; + + @ApiModelProperty(value = "被考核人ID") + private Long assessorCover; + + @ApiModelProperty(value = "被考核人名称") + private String assessorName; + + @ApiModelProperty(value = "发现时间") + @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME) + @JsonFormat(pattern = DateUtil.PATTERN_DATETIME) + private Date discoverTime; + + @ApiModelProperty(value = "问题事项") + private String problemMatters; + + @ApiModelProperty(value = "违规级别 : 0-严重 1-一般") + private Integer violationLevel; + + @ApiModelProperty(value = "处理结果") + private String processingResults; + + @ApiModelProperty(value = "通知单附件地址") + private String noticeAttachmentPath; + + @ApiModelProperty(value = "通知单附件名称") + private String noticeAttachmentName; +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/train/vo/RectificationParamVo.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/train/vo/RectificationParamVo.java new file mode 100644 index 0000000..e869841 --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/train/vo/RectificationParamVo.java @@ -0,0 +1,27 @@ +package com.hnac.hzims.safeproduct.train.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author ysj + */ +@Data +public class RectificationParamVo { + + @ApiModelProperty(value = "站点Id") + private String stationId; + + @ApiModelProperty(value = "月份") + private String month; + + @ApiModelProperty(value = "整改类型: 0-整改闭环 1-会议督办") + private Integer rectificationType; + + @ApiModelProperty(value = "整改状态: 0-未整改 1-已整改") + private Integer status; + + @ApiModelProperty(value = "责任人") + private String personLiableName; + +} \ No newline at end of file diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/train/vo/RectificationSummaryVo.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/train/vo/RectificationSummaryVo.java new file mode 100644 index 0000000..648e24b --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/train/vo/RectificationSummaryVo.java @@ -0,0 +1,23 @@ +package com.hnac.hzims.safeproduct.train.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author ysj + */ +@Data +public class RectificationSummaryVo { + + @ApiModelProperty(value = "站点Id") + private String stationId; + + @ApiModelProperty(value = "整改类型") + private Integer rectificationType; + + @ApiModelProperty(value = "应完成数量") + private Integer completeSum; + + @ApiModelProperty(value = "完成数量") + private Integer completeCount; +} \ No newline at end of file diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/train/vo/ViolationParamVo.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/train/vo/ViolationParamVo.java new file mode 100644 index 0000000..62705cf --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/train/vo/ViolationParamVo.java @@ -0,0 +1,29 @@ +package com.hnac.hzims.safeproduct.train.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author ysj + */ +@Data +public class ViolationParamVo { + + @ApiModelProperty(value = "站点Id") + private String stationId; + + @ApiModelProperty(value = "月份") + private String month; + + @ApiModelProperty(value = "发现开始时间") + private String startTime; + + @ApiModelProperty(value = "发现结束时间") + private String endTime; + + @ApiModelProperty(value = "违章等级") + private Integer violationLevel; + + @ApiModelProperty(value = "发现人") + private String discovererName; +} \ No newline at end of file diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/train/vo/ViolationSummaryVo.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/train/vo/ViolationSummaryVo.java new file mode 100644 index 0000000..7727dc6 --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/train/vo/ViolationSummaryVo.java @@ -0,0 +1,20 @@ +package com.hnac.hzims.safeproduct.train.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author ysj + */ +@Data +public class ViolationSummaryVo { + + @ApiModelProperty(value = "站点Id") + private String stationId; + + @ApiModelProperty(value = "站点名称") + private String stationName; + + @ApiModelProperty(value = "违规次数") + private Integer count; +} \ No newline at end of file diff --git a/hzims-service/hzims-ecological/pom.xml b/hzims-service/hzims-ecological/pom.xml deleted file mode 100644 index 56a114a..0000000 --- a/hzims-service/hzims-ecological/pom.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - 4.0.0 - - com.hnac.hzims - hzims-service - 4.0.0-SNAPSHOT - - - hzims-ecological - - - 8 - 8 - UTF-8 - - - - - - com.baomidou - dynamic-datasource-spring-boot-starter - - - com.hnac.hzinfo.data - hzinfo-data-sdk - - - com.hnac.hzims - hzims-ecological-api - ${hzims.project.version} - - - com.hnac.hzims - hzims-operational-api - ${hzims.project.version} - - - com.hnac.hzims - message-alarm-api - ${hzims.project.version} - - - - - ${project.name}-${project.version} - - - com.spotify - dockerfile-maven-plugin - - ${docker.username} - ${docker.password} - ${docker.registry.url}/${docker.namespace}/${project.artifactId} - ${project.version} - true - - target/${project.build.finalName}.jar - - false - - - - org.springframework.boot - spring-boot-maven-plugin - - - true - - - - - \ No newline at end of file diff --git a/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/SuiChangApplication.java b/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/SuiChangApplication.java deleted file mode 100644 index 1230279..0000000 --- a/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/SuiChangApplication.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.hnac.hzims.suichang; - -import org.mybatis.spring.annotation.MapperScan; -import org.springblade.core.cloud.feign.EnableBladeFeign; -import org.springblade.core.launch.BladeApplication; -import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; -import org.springframework.cloud.client.SpringCloudApplication; -import org.springframework.context.annotation.ComponentScan; - -@EnableBladeFeign(basePackages = {"org.springblade", "com.hnac"}) -@SpringCloudApplication -@MapperScan("com.hnac.hzims.**.mapper.**") -@ComponentScan(basePackages = {"com.hnac.hzims.*"}) -public class SuiChangApplication extends SpringBootServletInitializer { - public final static String APP_NAME = "hzims-ecological"; - - public static void main(String[] args) { - BladeApplication.run(APP_NAME, SuiChangApplication.class, args); - } - -} \ No newline at end of file diff --git a/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/controller/EcologicalFlowController.java b/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/controller/EcologicalFlowController.java deleted file mode 100644 index 83dc86c..0000000 --- a/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/controller/EcologicalFlowController.java +++ /dev/null @@ -1,111 +0,0 @@ -package com.hnac.hzims.suichang.controller; - -import com.hnac.hzims.suichang.service.EcologicalFlowService; -import com.hnac.hzims.suichang.service.RealMonitorService; -import com.hnac.hzims.suichang.util.MemoryPagination; -import com.hnac.hzims.suichang.vo.*; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springblade.core.mp.support.Query; -import org.springblade.core.tool.api.R; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; - -import javax.servlet.http.HttpServletResponse; -import java.util.HashMap; -import java.util.List; - -/** - * 遂昌生态流量 - * - * @author liangfan - */ -@RestController -@RequestMapping("/ecologicalFlow") -@Api(value = "遂昌生态流量", tags = "遂昌生态流量接口") -public class EcologicalFlowController { - - @Autowired - private EcologicalFlowService ecologicalFlowService; - - @Autowired - private RealMonitorService realMonitorService; - - @RequestMapping(value = "/getEcologicalFlowIndexInfo", method = {RequestMethod.POST}) - @ApiOperation(notes = "遂昌生态流量", value = "遂昌生态流量") - public R getEcologicalFlowIndexInfo() { - EcologicalFlowVo vo = ecologicalFlowService.getEcologicalFlowIndexInfo(); - return R.data(vo); - } - - @RequestMapping(value = "/getAvgMonitorInfo", method = {RequestMethod.POST}) - @ApiOperation(notes = "实时监测日均流量", value = "实时监测日均流量") - public R getAvgMonitorInfo() { - return R.data(realMonitorService.getAvgMonitorInfo()); - } - - @RequestMapping(value = "/getAvgMonitorCountInfo", method = {RequestMethod.POST}) - @ApiOperation(notes = "生态流量监管-日均流量", value = "生态流量监管-日均流量") - public R getAvgMonitorCountInfo(@RequestBody AvgMonitorReq req) { - List resultList = realMonitorService.getAvgMonitorCountInfo(req); - // 内存分页 - HashMap map = new HashMap<>(); - resultList = MemoryPagination.pagination(resultList, req.getCurrent(), req.getSize()); - map.put("records", resultList); - map.put("total", resultList.size()); - return R.data(map); - } - - @RequestMapping(value = "/getRealMonitorInfo", method = {RequestMethod.GET}) - @ApiOperation(notes = "实时流量页面", value = "实时流量页面") - public R getRealMonitorInfo(String name, Query query) { - RealMonitorRes res = realMonitorService.getRealMonitorInfo(name); - List resultList = res.getRealMonitorVos(); - HashMap map = new HashMap<>(); - resultList = MemoryPagination.pagination(resultList, query.getCurrent(), query.getSize()); - map.put("records", resultList); - map.put("total", resultList.size()); - map.put("reportCount", res.getReportCount()); - return R.data(map); - } - - @RequestMapping(value = "/getRealMonitorSingleInfo", method = {RequestMethod.POST}) - @ApiOperation(notes = "单个电站实时流量明细", value = "单个电站实时流量明细") - public R getRealMonitorSingleInfo(@RequestBody RealMonitorSingleInfoReq req) { - List resultList = realMonitorService.getRealMonitorSingleInfo(req); - HashMap map = new HashMap<>(); - resultList = MemoryPagination.pagination(resultList, req.getCurrent(), req.getSize()); - map.put("records", resultList); - map.put("total", resultList.size()); - return R.data(map); - } - - @RequestMapping(value = "/exportRealMonitorInfo", method = {RequestMethod.GET}) - @ApiOperation(notes = "导出实时流量页面数据", value = "导出实时流量页面数据") - public void exportRealMonitorInfo(HttpServletResponse response, String name) { - realMonitorService.exportRealMonitorInfo(response, name); - } - - @RequestMapping(value = "/exportRealMonitorSingleInfo", method = {RequestMethod.GET}) - @ApiOperation(notes = "导出单个电站实时流量明细", value = "导出单个电站实时流量明细") - public void exportRealMonitorSingleInfo(HttpServletResponse response, RealMonitorSingleInfoReq req) { - realMonitorService.exportRealMonitorSingleInfo(response, req); - } - - @RequestMapping(value = "/exportAvgMonitorCountInfo", method = {RequestMethod.GET}) - @ApiOperation(notes = "导出生态流量监管-日均流量", value = "导出生态流量监管-日均流量") - public void exportAvgMonitorCountInfo(HttpServletResponse response, AvgMonitorReq req) { - realMonitorService.exportAvgMonitorCountInfo(response, req); - } - - @RequestMapping(value = "/getRealData", method = {RequestMethod.GET}) - public R test(String deviceCode) { - return R.data(realMonitorService.getRealData(deviceCode)); - } - - - -} \ No newline at end of file diff --git a/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/controller/ExamController.java b/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/controller/ExamController.java deleted file mode 100644 index e42c01e..0000000 --- a/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/controller/ExamController.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.hnac.hzims.suichang.controller; - -import com.hnac.hzims.common.logs.utils.StringUtils; -import com.hnac.hzims.suichang.service.ExamStationDataService; -import com.hnac.hzims.suichang.util.MemoryPagination; -import com.hnac.hzims.suichang.vo.ExamStationFlowDataReq; -import com.hnac.hzims.suichang.vo.ExamStationFlowReportDayVo; -import com.hnac.hzims.suichang.vo.ExamStationFlowReportVo; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springblade.core.tool.api.R; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; - -import javax.servlet.http.HttpServletResponse; -import java.util.HashMap; -import java.util.List; -import java.util.stream.Collectors; - -/** - * @Author: liangfan - * @Date: 2024-03-15 15:08 - * @Description: - */ -@RestController -@RequestMapping("/exam") -@Api(value = "遂昌生态流量-考核管理", tags = "遂昌生态流量-考核管理") -public class ExamController { - - @Autowired - private ExamStationDataService examStationDataService; - - @RequestMapping(value = "/examStationFlowReportByTime", method = {RequestMethod.GET}) - @ApiOperation(notes = "电站月考核", value = "电站月考核") - public R examStatisticsFlowReportByTime(ExamStationFlowDataReq req) { - List resultList = - examStationDataService.examStationFlowReportByTime(req); - HashMap map = new HashMap<>(); - resultList = MemoryPagination.pagination(resultList, req.getCurrent(), req.getSize()); - map.put("records", resultList); - map.put("total", resultList.size()); - return R.data(map); - } - - - @RequestMapping(value = "/exportExamStationFlowReportByTime", method = {RequestMethod.GET}) - @ApiOperation(notes = "电站月考核", value = "电站月考核") - public void exportExamStationFlowReportByTime(HttpServletResponse response, ExamStationFlowDataReq req) { - examStationDataService.exportExamStationFlowReportByTime(response, req); - } - - - @RequestMapping(value = "/examStationFlowReportOfDay", method = {RequestMethod.GET}) - @ApiOperation(notes = "电站日考核", value = "电站日考核") - public R examStationFlowReportOfDay(ExamStationFlowDataReq req) { - List resultList = examStationDataService.examStationFlowReportOfDay(req); - String isPass = req.getIsPass(); - // 条件过滤 - if (StringUtils.isNotBlank(req.getIsPass())) { - resultList = - resultList.stream().filter(o -> o.getStatus().equals(isPass)).collect(Collectors.toList()); - } - HashMap map = new HashMap<>(); - resultList = MemoryPagination.pagination(resultList, req.getCurrent(), req.getSize()); - map.put("records", resultList); - map.put("total", resultList.size()); - return R.data(map); - } - -} diff --git a/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/controller/FlowWarnController.java b/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/controller/FlowWarnController.java deleted file mode 100644 index 07113f3..0000000 --- a/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/controller/FlowWarnController.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.hnac.hzims.suichang.controller; - -import com.hnac.hzims.suichang.service.FlowWarnService; -import com.hnac.hzims.suichang.vo.FlowWarnQueryDTO; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springblade.core.mp.support.Query; -import org.springblade.core.tool.api.R; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -/** - * 遂昌生态流量 - * - * @author liangfan - */ -@RestController -@RequestMapping("/flowWarn") -@Api(value = "遂昌生态流量预警信息", tags = "遂昌生态流量预警信息") -public class FlowWarnController { - @Autowired - private FlowWarnService flowWarnService; - - @RequestMapping(value = "/getFlowWarnList", method = {RequestMethod.GET}) - @ApiOperation(notes = "大屏遂昌生态流量预警信息", value = "大屏遂昌生态流量预警信息") - public R getFlowWarnList(FlowWarnQueryDTO dto, Query query) { - return R.data(flowWarnService.getFlowWarnList(dto, query)); - } - - - @RequestMapping(value = "/warningPush", method = {RequestMethod.GET}) - @ApiOperation(notes = "大屏遂昌生态流量预警信息", value = "大屏遂昌生态流量预警信息") - public R warningPush(FlowWarnQueryDTO dto) { - return R.data(flowWarnService.warningPush(dto)); - } - - -} \ No newline at end of file diff --git a/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/controller/ImageAndVideoController.java b/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/controller/ImageAndVideoController.java deleted file mode 100644 index 4888796..0000000 --- a/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/controller/ImageAndVideoController.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.hnac.hzims.suichang.controller; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.hnac.hzims.suichang.service.ImageAndVideoService; -import com.hnac.hzims.suichang.vo.ImageReq; -import com.hnac.hzims.suichang.vo.MissingImagesRes; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springblade.core.mp.support.Query; -import org.springblade.core.tool.api.R; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; - -/** - * @Author: liangfan - * @Date: 2024-03-15 15:08 - * @Description: - */ -@RestController -@RequestMapping("/imageAndVideo") -@Api(value = "图片和视频", tags = "图片和视频") -public class ImageAndVideoController { - - @Autowired - private ImageAndVideoService imageAndVideoService; - - @RequestMapping(value = "/getMissingImagesInfo", method = {RequestMethod.GET}) - @ApiOperation(notes = "照片缺失率", value = "照片缺失率") - public R> getMissingImagesInfo(ImageReq req, Query query) { - return R.data(imageAndVideoService.getMissingImagesInfo(req, query)); - } - - @RequestMapping(value = "/missingPush", method = {RequestMethod.GET}) - @ApiOperation(notes = "照片缺失日期及数据", value = "照片缺失日期及数据") - public R missingPush(ImageReq req) { - return R.data(imageAndVideoService.missingPush(req)); - } - - @RequestMapping(value = "/getImageInfoStatus", method = {RequestMethod.POST}) - @ApiOperation(notes = "照片缺失率详情", value = "照片缺失率详情") - public R getImageInfoStatus(@RequestBody ImageReq req) { - return R.data(imageAndVideoService.getImageInfoStatus(req)); - } - - @RequestMapping(value = "/getImageInfoByDeviceCode", method = {RequestMethod.GET}) - @ApiOperation(notes = "根据DeviceCode及时间查询照片", value = "根据DeviceCode及时间查询照片") - public R getImageInfoByDeviceCode(ImageReq req, Query query) { - return R.data(imageAndVideoService.getImageInfoByDeviceCode(req, query)); - } - - - @RequestMapping(value = "/selectNewestImage", method = {RequestMethod.GET}) - @ApiOperation(notes = "泄放照片", value = "泄放照片") - public R selectNewestImage(ImageReq req, Query query) { - return R.data(imageAndVideoService.selectNewestImage(req, query)); - } - - - @RequestMapping(value = "/getStationVideoType", method = {RequestMethod.GET, RequestMethod.POST}) - @ApiOperation(value = "获取视频byType", notes = "获取视频byType") - public R getStationTree(String videoType) { - return R.data(imageAndVideoService.getStationVideoType(videoType)); - } - - -} diff --git a/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/controller/StatisticsFlowDataController.java b/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/controller/StatisticsFlowDataController.java deleted file mode 100644 index d6477e7..0000000 --- a/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/controller/StatisticsFlowDataController.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.hnac.hzims.suichang.controller; - -import com.hnac.hzims.suichang.service.StatisticsDataService; -import com.hnac.hzims.suichang.util.MemoryPagination; -import com.hnac.hzims.suichang.vo.StatisticsFlowDataDetailVo; -import com.hnac.hzims.suichang.vo.StatisticsFlowDataReq; -import com.hnac.hzims.suichang.vo.StatisticsFlowDataVo; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springblade.core.tool.api.R; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; - -import javax.servlet.http.HttpServletResponse; -import java.util.HashMap; -import java.util.List; - -/** - * @Author: liangfan - * @Date: 2024-03-14 16:18 - * @Description: - */ -@RestController -@RequestMapping("/statisticsData") -@Api(value = "遂昌生态流量-统计报表", tags = "遂昌生态流量-统计报表") -public class StatisticsFlowDataController { - - @Autowired - private StatisticsDataService statisticsDataService; - - @RequestMapping(value = "/statisticsFlowReportByTime", method = {RequestMethod.GET}) - @ApiOperation(notes = "", value = "") - public R statisticsFlowReportByTime(StatisticsFlowDataReq req) { - StatisticsFlowDataVo res = statisticsDataService.statisticsFlowReportByTime(req); - List resultList = res.getDetail(); - HashMap map = new HashMap<>(); - // 内存分页 - resultList = MemoryPagination.pagination(resultList, req.getCurrent(), req.getSize()); - map.put("areaName", res.getAreaName()); - map.put("examCount", res.getExamCount()); - map.put("passCount", res.getPassCount()); - map.put("passPre", res.getPassPre()); - map.put("records", resultList); - map.put("total", resultList.size()); - return R.data(map); - } - - @RequestMapping(value = "/exportStatisticsFlowReportByTime", method = {RequestMethod.GET}) - @ApiOperation(notes = "", value = "") - public void exportStatisticsFlowReportByTime(HttpServletResponse response, StatisticsFlowDataReq req) { - statisticsDataService.exportStatisticsFlowReportByTime(response, req); - } - -} diff --git a/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/feign/SuichangClient.java b/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/feign/SuichangClient.java deleted file mode 100644 index 6997961..0000000 --- a/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/feign/SuichangClient.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.hnac.hzims.suichang.feign; - -import com.hnac.hzims.suichang.mapper.EcologicalFlowMapper; -import com.hnac.hzims.suichang.service.EcologicalFlowService; -import com.hnac.hzims.suichang.vo.StationQueryReq; -import com.hnac.hzims.suichang.vo.StationVo; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import java.time.LocalDateTime; -import java.util.List; -import java.util.Map; - -@RestController -@RequestMapping("/suichangClient") -@Slf4j -@RequiredArgsConstructor -public class SuichangClient implements ISuichangClient { - - @Autowired - private EcologicalFlowMapper ecologicalFlowMapper; - @Autowired - private EcologicalFlowService ecologicalFlowService; - - @Override - @PostMapping(GET_STATION_BY_REQ) - public List getStationListByReq(StationQueryReq req) { - return ecologicalFlowMapper.getStationListByReq(req); - } - - @Override - @PostMapping(GET_DATA) - public List> getData(String stcd, Integer accessRules, Integer saveTimeType, Integer timeInterval, - LocalDateTime startTime, LocalDateTime endTime) { - return ecologicalFlowService.getData(stcd, accessRules, saveTimeType, timeInterval, - startTime, endTime); - } - -} diff --git a/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/mapper/EcologicalFlowMapper.java b/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/mapper/EcologicalFlowMapper.java deleted file mode 100644 index 60a8c0f..0000000 --- a/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/mapper/EcologicalFlowMapper.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.hnac.hzims.suichang.mapper; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.hnac.hzims.message_alarm.entity.MessageAlarmInfo; -import com.hnac.hzims.message_alarm.entity.MessageReceiveInfo; -import com.hnac.hzims.suichang.vo.*; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springblade.system.user.entity.User; - -import java.util.List; - -/** - * 遂昌生态流量 - * - * @author liangfan - */ -@Mapper -public interface EcologicalFlowMapper { - - - List getStationListByName(String name); - - IPage getStationListByNamePage(StationQueryReq req, IPage page); - - List getStationListByReq(@Param("req") StationQueryReq req); - - IPage getFlowWarnList(FlowWarnQueryDTO dto, IPage page); - - List getFlowWarnCount(FlowWarnQueryDTO dto); - - -} \ No newline at end of file diff --git a/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/mapper/EcologicalFlowMapper.xml b/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/mapper/EcologicalFlowMapper.xml deleted file mode 100644 index 83d6d7d..0000000 --- a/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/mapper/EcologicalFlowMapper.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - SELECT - a.name as name, - a.code as deviceCode, - a.discharge as flowValue, - a.type as stationType, - a.LGTD as lgtd, - a.LTTD as lttd - FROM - hzims_station a - WHERE - a.IS_DELETED = '0' - - - - - - - - - - - - - - - diff --git a/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/mapper/ImageAndVideoMapper.java b/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/mapper/ImageAndVideoMapper.java deleted file mode 100644 index 086770d..0000000 --- a/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/mapper/ImageAndVideoMapper.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.hnac.hzims.suichang.mapper; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.hnac.hzims.suichang.vo.*; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 遂昌生态流量 - * - * @author liangfan - */ -@Mapper -public interface ImageAndVideoMapper { - - - IPage getImageInfo(ImageReq req, IPage page); - - - - /** - * 根据设备stcds查询各个设备最新图片信息 - * @param req - * @param page - * @return - */ - IPage selectNewestImage(ImageReq req, IPage page); - - /** - * 查询视频点位 - * @param videoType - * @return - */ - List selectStationTypeByOwerType(String videoType); - - -} \ No newline at end of file diff --git a/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/mapper/ImageAndVideoMapper.xml b/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/mapper/ImageAndVideoMapper.xml deleted file mode 100644 index 9964604..0000000 --- a/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/mapper/ImageAndVideoMapper.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - diff --git a/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/service/EcologicalFlowService.java b/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/service/EcologicalFlowService.java deleted file mode 100644 index bd458cb..0000000 --- a/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/service/EcologicalFlowService.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.hnac.hzims.suichang.service; - -import com.hnac.hzims.suichang.vo.EcologicalFlowVo; - -import java.time.LocalDateTime; -import java.util.List; -import java.util.Map; - -/** - * @Author: liangfan - * @Date: 2024-03-08 15:06 - * @Description: - */ - -public interface EcologicalFlowService { - /** - * 首页生态流量 - * - * @return - */ - EcologicalFlowVo getEcologicalFlowIndexInfo(); - - /** - * 查询历史数据 - * @param stcd - * @param accessRules 取数规则:0=最早值、1=最大值、2=最小值、3=平均值、4=(累计值/和值)、5=(变化值/差值)6=最新值") - * @param saveTimeType 周期类型: 0-> s(秒) 1->、m(分)、2->h(小时) 3->、d(天) 4->、w(周) 5->、n(自然月)、6->y(自然年) - * @param timeInterval - * @param startTime - * @param endTime - * @return - */ - List> getData(String stcd, Integer accessRules, Integer saveTimeType, Integer timeInterval, - LocalDateTime startTime, LocalDateTime endTime); - -} diff --git a/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/service/ExamStationDataService.java b/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/service/ExamStationDataService.java deleted file mode 100644 index ebcaa4f..0000000 --- a/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/service/ExamStationDataService.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.hnac.hzims.suichang.service; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.hnac.hzims.suichang.vo.*; -import org.springblade.core.mp.support.Query; - -import javax.servlet.http.HttpServletResponse; -import java.util.List; - -/** - * @Author: liangfan - * @Date: 2024-03-08 15:06 - * @Description: - */ - -public interface ExamStationDataService { - /** - * 电站月考核 - * @param req - * @return - */ - List examStationFlowReportByTime(ExamStationFlowDataReq req); - /** - * 电站月考核 导出 - * @param req - * @return - */ - void exportExamStationFlowReportByTime(HttpServletResponse response, ExamStationFlowDataReq req); - - /** - * 流量计电站日考核 - * @param req - * @return - */ - List examStationFlowReportOfDay(ExamStationFlowDataReq req); - -} diff --git a/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/service/FlowWarnService.java b/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/service/FlowWarnService.java deleted file mode 100644 index 45a7ed8..0000000 --- a/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/service/FlowWarnService.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.hnac.hzims.suichang.service; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.hnac.hzims.suichang.vo.FlowWarnQueryDTO; -import com.hnac.hzims.suichang.vo.FlowWarnVo; -import org.springblade.core.mp.support.Query; - -import java.util.List; -import java.util.Map; - -/** - * @author liangfan - */ -public interface FlowWarnService { - - IPage getFlowWarnList(FlowWarnQueryDTO dto, Query query); - - /** - * 分页查询预警信息及告警信息 - * @param dto - * @return - */ - Map> warningPush(FlowWarnQueryDTO dto); - -} diff --git a/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/service/ImageAndVideoService.java b/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/service/ImageAndVideoService.java deleted file mode 100644 index 62dbe65..0000000 --- a/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/service/ImageAndVideoService.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.hnac.hzims.suichang.service; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.hnac.hzims.suichang.vo.*; -import org.springblade.core.mp.support.Query; - -import java.util.List; -import java.util.Map; - -/** - * @Author: liangfan - * @Date: 2024-03-08 15:06 - * @Description: - */ - -public interface ImageAndVideoService { - /** - * 照片缺失率信息 - * @param req - * @param query - * @return - */ - IPage getMissingImagesInfo(ImageReq req, Query query); - - /** - * 照片条数 日期 - * @param req - * @return - */ - Map> missingPush(ImageReq req); - - /** - * 泄放照片详情 - * @param req - * @param query - * @return - */ - IPage getImageInfoByDeviceCode(ImageReq req, Query query); - - /** - * 照片缺失率详情 - * @param req - * @return - */ - List getImageInfoStatus(ImageReq req); - - IPage selectNewestImage(ImageReq req, Query query); - - List getStationVideoType(String videoType); - - -} diff --git a/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/service/RealMonitorService.java b/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/service/RealMonitorService.java deleted file mode 100644 index 1c5dd28..0000000 --- a/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/service/RealMonitorService.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.hnac.hzims.suichang.service; - -import com.hnac.hzims.suichang.vo.*; -import com.hnac.hzinfo.datasearch.analyse.domain.FieldsData; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.List; - -/** - * @Author: liangfan - * @Date: 2024-03-13 16:37 - * @Description: - */ -public interface RealMonitorService { - /** - * 查询日均流量数据 - */ - List getAvgMonitorInfo(); - - /** - * 查询一段时间的日均流量数据 - * @param req - * @return - */ - List getAvgMonitorCountInfo(AvgMonitorReq req); - - - /** - * 实时流量列表页面 - * @return - */ - RealMonitorRes getRealMonitorInfo(String name); - - void exportRealMonitorInfo(HttpServletResponse response, String name); - - void exportRealMonitorSingleInfo(HttpServletResponse response, RealMonitorSingleInfoReq req); - - void exportAvgMonitorCountInfo(HttpServletResponse response, AvgMonitorReq req); - - /** - * 实时流量列表页面单个电站 - * @return - */ - List getRealMonitorSingleInfo(RealMonitorSingleInfoReq req); - - - /** - * 查询实时流量数据 - * @param stcd - * @return - */ - String getRealData(String stcd, String signage); - - String getRealData(String stcd); -} diff --git a/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/service/StatisticsDataService.java b/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/service/StatisticsDataService.java deleted file mode 100644 index acb547f..0000000 --- a/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/service/StatisticsDataService.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.hnac.hzims.suichang.service; - -import com.hnac.hzims.suichang.vo.StatisticsFlowDataReq; -import com.hnac.hzims.suichang.vo.StatisticsFlowDataVo; - -import javax.servlet.http.HttpServletResponse; - -/** - * @Author: liangfan - * @Date: 2024-03-08 15:06 - * @Description: - */ - -public interface StatisticsDataService { - - StatisticsFlowDataVo statisticsFlowReportByTime(StatisticsFlowDataReq req); - - void exportStatisticsFlowReportByTime(HttpServletResponse response, StatisticsFlowDataReq req); - -} diff --git a/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/service/impl/EcologicalFlowServiceImpl.java b/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/service/impl/EcologicalFlowServiceImpl.java deleted file mode 100644 index 53b0bc2..0000000 --- a/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/service/impl/EcologicalFlowServiceImpl.java +++ /dev/null @@ -1,491 +0,0 @@ -package com.hnac.hzims.suichang.service.impl; - -import com.hnac.hzims.entity.ReportData; -import com.hnac.hzims.suichang.mapper.EcologicalFlowMapper; -import com.hnac.hzims.suichang.service.EcologicalFlowService; -import com.hnac.hzims.suichang.util.DateUtil; -import com.hnac.hzims.suichang.vo.EcologicalFlowVo; -import com.hnac.hzims.suichang.vo.FlowWarnQueryDTO; -import com.hnac.hzims.suichang.vo.FlowWarnVo; -import com.hnac.hzims.suichang.vo.StationVo; -import com.hnac.hzims.util.CommonUtil; -import com.hnac.hzinfo.datasearch.analyse.po.AnalyseCodeByAnalyseDataPO; -import com.hnac.hzinfo.datasearch.analyse.po.AnalyzeDataConditionPO; -import com.hnac.hzinfo.datasearch.analyse.vo.AnalyseDataTaosVO; -import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeDataConditionVO; -import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeInstanceFieldVO; -import com.hnac.hzinfo.sdk.analyse.AnalyseDataSearchClient; -import com.hnac.hzinfo.sdk.core.response.Result; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; -import org.springblade.core.mp.support.Condition; -import org.springblade.core.mp.support.Query; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; - -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.time.*; -import java.time.temporal.ChronoUnit; -import java.time.temporal.TemporalAdjusters; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -/** - * @Author: liangfan - * @Date: 2024-03-08 15:06 - * @Description: - */ -@Slf4j -@Service -public class EcologicalFlowServiceImpl implements EcologicalFlowService { - @Autowired - AnalyseDataSearchClient analyseDataSearchClient; - - @Autowired - private EcologicalFlowMapper ecologicalFlowMapper; - - @Value("${suichang.signage}") - String signage; - - @Override - public EcologicalFlowVo getEcologicalFlowIndexInfo() { - LocalDateTime startTime = LocalDateTime.now(); - EcologicalFlowVo ecologicalFlowVo = new EcologicalFlowVo(); - // 监测电站数 无节制电站 流量计电站 1.无节制电站 2.流量计电站 - List stationInfoList = ecologicalFlowMapper.getStationListByName(null); - List noLimitStationListSize = stationInfoList.stream().filter(o -> "1".equals(o.getStationType())).collect(Collectors.toList()); - List flowStationListSize = stationInfoList.stream().filter(o -> "2".equals(o.getStationType())).collect(Collectors.toList()); - if (CollectionUtils.isEmpty(stationInfoList)) { - return ecologicalFlowVo; - } - ecologicalFlowVo.setAllStationListSize(stationInfoList.size()); - ecologicalFlowVo.setNoLimitStationListSize(noLimitStationListSize.size()); - ecologicalFlowVo.setFlowStationListSize(flowStationListSize.size()); - - int yesterdayFinishCount = 0, weekCount = 0, monthFinishCount = 0, quarterCount = 0, halfYearCount = 0, yearCount = 0, - reportTodayCount = 0, reportYesTerdayCount = 0, warnTodayCount = 0, warnYesTerdayCount = 0; - // 得到所有设备实例code及核定下限流量 - log.info("站点信息list:{}", stationInfoList); - // 多线程优化 - List> yesterdayFinishCountList = new ArrayList<>(); - List> weekCountList = new ArrayList<>(); - List> monthFinishCountList = new ArrayList<>(); - List> quarterCountList = new ArrayList<>(); - List> halfYearCountList = new ArrayList<>(); - List> yearCountList = new ArrayList<>(); - List>> reportAndWarnTodayMapList = new ArrayList<>(); - List>> reportAndWarnYesTerdayMapList = new ArrayList<>(); - // 多线程 调用平台方法 - buildCompletableFutureList(stationInfoList, yesterdayFinishCountList, weekCountList, monthFinishCountList, - quarterCountList, halfYearCountList, yearCountList, reportAndWarnTodayMapList, reportAndWarnYesTerdayMapList); - try { - for (int i = 0; i < stationInfoList.size(); i++) { - // 1.昨日达标情况 达标率就是有没有达到核定下限流量 - yesterdayFinishCount = yesterdayFinishCountList.get(i).get() + yesterdayFinishCount; - // 2.上月达标情况 - weekCount = weekCountList.get(i).get() + weekCount; - // 3.上周达标情况 - monthFinishCount = monthFinishCountList.get(i).get() + monthFinishCount; - // 4.季度达标情况 - quarterCount = quarterCountList.get(i).get() + quarterCount; - // 5.半年达标情况 - halfYearCount = halfYearCountList.get(i).get() + halfYearCount; - // 6.年达标情况 - yearCount = yearCountList.get(i).get() + yearCount; - // 7.今日 预警数 上报率 - Map reportAndWarnTodayMap = reportAndWarnTodayMapList.get(i).get(); - reportTodayCount = reportTodayCount + reportAndWarnTodayMap.get("count"); - warnTodayCount = warnTodayCount + reportAndWarnTodayMap.get("warnCount"); - // 8.昨日 预警数 上报率 - Map reportAndWarnYesTerdayMap = reportAndWarnYesTerdayMapList.get(i).get(); - reportYesTerdayCount = reportYesTerdayCount + reportAndWarnYesTerdayMap.get("count"); - warnYesTerdayCount = warnYesTerdayCount + reportAndWarnYesTerdayMap.get("warnCount"); - } - } catch (Exception e) { - e.printStackTrace(); - } - log.info("yesterdayFinishCount = {}, weekCount = {}, monthFinishCount = {}, quarterCount = {}, halfYearCount = {}, yearCount = {}", - yesterdayFinishCount, weekCount, monthFinishCount, quarterCount, halfYearCount, yearCount); - // build返回信息 - buildRestultInfo(ecologicalFlowVo, stationInfoList.size(), - yesterdayFinishCount, monthFinishCount, weekCount, quarterCount, halfYearCount, - yearCount, reportTodayCount, warnTodayCount, reportYesTerdayCount, warnYesTerdayCount); - LocalDateTime endTime = LocalDateTime.now(); - log.info("耗时:{}", ChronoUnit.SECONDS.between(startTime, endTime)); - return ecologicalFlowVo; - } - - - @Override - public List> getData(String stcd, Integer accessRules, Integer saveTimeType, Integer timeInterval, - LocalDateTime startTime, LocalDateTime endTime) { - List> list = new ArrayList<>(); - List vos = getSignages(stcd); - if (vos == null || vos.isEmpty()) { - return null; - } - - Map> map = new HashMap<>(); - int count = 0; - for (AnalyzeInstanceFieldVO vo : vos) { - // accessRules 取数规则:0=最早值、1=最大值、2=最小值、3=平均值、4=(累计值/和值)、5=(变化值/差值)6=最新值") - // SaveTimeType 周期类型: 0-> s(秒) 1->、m(分)、2->h(小时) 3->、d(天) 4->、w(周) 5->、n(自然月)、6->y(自然年) - List reportDataList = - getDataByDeviceCode(stcd, accessRules, saveTimeType, timeInterval, startTime, endTime, vo.getSignage()); - map.put(vo.getSignage(), reportDataList); - count = reportDataList.size(); - } - - - for (int i = 0; i < count; i++) { - Map res = new HashMap<>(); - for (AnalyzeInstanceFieldVO vo : vos) { - List reportDataList = map.get(vo.getSignage()); - ReportData reportData = reportDataList.get(i); - res.put("tm", reportData.getKeyStr()); - res.put(vo.getSignage(), reportData.getVal()); - } - list.add(res); - } - - return list; - } - - - List getDataByDeviceCode(String deviceCode, Integer accessRules, Integer saveTimeType, Integer timeInterval, - LocalDateTime start, LocalDateTime end, String col) { - List reportData = new ArrayList<>(); - AnalyseCodeByAnalyseDataPO po = new AnalyseCodeByAnalyseDataPO(); - po.setDeviceCode(deviceCode); - - List signboardConditions = new ArrayList<>(); - AnalyzeDataConditionPO conditionPO = new AnalyzeDataConditionPO(); - conditionPO.setBeginTime(start); - conditionPO.setEndTime(end); - conditionPO.setSignages(col); -// conditionPO.setKeepFigures(3); - conditionPO.setAccessRules(accessRules); - conditionPO.setSaveTimeType(saveTimeType); - conditionPO.setTimeInterval(timeInterval); - conditionPO.setFull(1); - signboardConditions.add(conditionPO); - po.setSignboardConditions(signboardConditions); - - Result> result = analyseDataSearchClient.getAnalyzeDataByAnalyzeCodeAndSignages(po); - if (result == null || !result.isSuccess()) { - return reportData; - } - List datas = result.getData(); - if (datas == null || datas.isEmpty()) { - return reportData; - } - for (AnalyzeDataConditionVO vo : datas) { - List dataTaosVOs = vo.getList(); - for (AnalyseDataTaosVO vv : dataTaosVOs) { - if (vo.getSignage().equals(col)) { - ReportData data = new ReportData(); - data.setKeyStr(CommonUtil.getKeyBySaveTimeType(vv.getTs(), saveTimeType)); - String val = vv.getVal(); - data.setStcd(deviceCode); - data.setVal(val); - if (val != null && !"".equals(val)) { - data.setValue(Double.valueOf(vv.getVal())); - } else { - data.setValue(0.0); - } - data.setName(vo.getName()); - reportData.add(data); - } - } - } - return reportData; - } - - public List getSignages(String stcd) { - //查询列 - Result> result = - analyseDataSearchClient.getInstanceFieldByAnalyseCode(stcd, 1, ""); - if (result == null || !result.isSuccess()) { - return null; - } - - List analyzeInstanceFieldVOS = result.getData(); - return analyzeInstanceFieldVOS; - } - - int getDayInfo(String stcd, BigDecimal discharge) { - // 获取当前时间 - LocalDateTime now = LocalDateTime.now(); - // 获取昨天的日期 - LocalDateTime last = now.minusDays(1); - // 昨天的开始时间(00:00) 昨天的结束时间(00:00)yesterday: 2024-03-10 00:00:00 yesterday: 2024-03-11 00:00:00 - LocalDateTime startTime = last.withHour(0).withMinute(0).withSecond(0).withNano(0); - LocalDateTime endTime = last.plusDays(1).withHour(0).withMinute(0).withSecond(0).withNano(0); - // 昨日达标情况 达标率就是有没有达到核定下限流量 - // accessRules 取数规则:0=最早值、1=最大值、2=最小值、3=平均值、4=(累计值/和值)、5=(变化值/差值)6=最新值") - // SaveTimeType 周期类型: 0-> s(秒) 1->、m(分)、2->h(小时) 3->、d(天) 4->、w(周) 5->、n(自然月)、6->y(自然年) - List> dataList = getData(stcd, 3, 3, 1, startTime, endTime); - log.info("昨日达标情况data: {}, 设备编码为:{}", dataList, stcd); - return getCount(dataList, discharge); - } - - - int getWeekInfo(String stcd, BigDecimal discharge) { - LocalDate today = LocalDate.now(); - // 获取上周的星期一(假设周一是周的开始) - LocalDate lastWeekMonday = today.with(TemporalAdjusters.previousOrSame(DayOfWeek.MONDAY)).minusWeeks(1); - // 上周的开始时间:上周星期一的00:00 - LocalDateTime startTime = LocalDateTime.of(lastWeekMonday, LocalTime.MIN); - LocalDateTime endTime = startTime.plusDays(7).withHour(0).withMinute(0).withSecond(0).withNano(0); - // 周达标情况 达标率就是有没有达到核定下限流量 - // accessRules 取数规则:0=最早值、1=最大值、2=最小值、3=平均值、4=(累计值/和值)、5=(变化值/差值)6=最新值") - // SaveTimeType 周期类型: 0-> s(秒) 1->、m(分)、2->h(小时) 3->、d(天) 4->、w(周) 5->、n(自然月)、6->y(自然年) - List> dataList = getData(stcd, 3, 4, 1, startTime, endTime); - log.info("周达标情况data: {}, 设备编码为:{}", dataList, stcd); - return getCount(dataList, discharge); - } - - int getMouthInfo(String stcd, BigDecimal discharge) { - // 获取当前时间 - LocalDateTime now = LocalDateTime.now(); - // 获取上个月的开始日期 - LocalDateTime last = now.minusMonths(1); - // 上个月的开始时间(00:00) 上个月的结束时间(00:00) - LocalDateTime startTime = last.withHour(0).withDayOfMonth(1).withMinute(0).withSecond(0).withNano(0); - LocalDateTime endTime = last.plusMonths(1).withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0).withNano(0); - // 上月达标情况 达标率就是有没有达到核定下限流量 - // accessRules 取数规则:0=最早值、1=最大值、2=最小值、3=平均值、4=(累计值/和值)、5=(变化值/差值)6=最新值") - // SaveTimeType 周期类型: 0-> s(秒) 1->、m(分)、2->h(小时) 3->、d(天) 4->、w(周) 5->、n(自然月)、6->y(自然年) - List> dataList = getData(stcd, 3, 5, 1, startTime, endTime); - log.info("月达标情况data: {}, 设备编码为:{}", dataList, stcd); - return getCount(dataList, discharge); - } - - int getQuarterInfo(String stcd, BigDecimal discharge) { - LocalDateTime now = LocalDateTime.now(); - LocalDateTime startTime = DateUtil.getStartOfLastQuarter(now); - LocalDateTime endTime = DateUtil.getEndOfLastQuarter(now); - // 周达标情况 达标率就是有没有达到核定下限流量 - // accessRules 取数规则:0=最早值、1=最大值、2=最小值、3=平均值、4=(累计值/和值)、5=(变化值/差值)6=最新值") - // SaveTimeType 周期类型: 0-> s(秒) 1->、m(分)、2->h(小时) 3->、d(天) 4->、w(周) 5->、n(自然月)、6->y(自然年) - List> dataList = getData(stcd, 3, 5, 3, startTime, endTime); - log.info("季度达标情况data: {}, 设备编码为:{}", dataList, stcd); - return getCount(dataList, discharge); - } - - - int getHaltYearInfo(String stcd, BigDecimal discharge) { - LocalDateTime now = LocalDateTime.now(); - LocalDateTime startTime = DateUtil.getStartOfHalfYear(now); - LocalDateTime endTime = DateUtil.getEndOfHalfYear(now); - // 上月达标情况 达标率就是有没有达到核定下限流量 - // accessRules 取数规则:0=最早值、1=最大值、2=最小值、3=平均值、4=(累计值/和值)、5=(变化值/差值)6=最新值") - // SaveTimeType 周期类型: 0-> s(秒) 1->、m(分)、2->h(小时) 3->、d(天) 4->、w(周) 5->、n(自然月)、6->y(自然年) - List> dataList = getData(stcd, 3, 5, 6, startTime, endTime); - log.info("半年达标情况data: {}, 设备编码为:{}", dataList, stcd); - return getCount(dataList, discharge); - } - - int getYearInfo(String stcd, BigDecimal discharge) { - LocalDateTime startTime = LocalDateTime.of(Year.now().getValue() - 1, Month.JANUARY, 1, 0, 0); - LocalDateTime endTime = LocalDateTime.of(Year.now().getValue(), Month.JANUARY, 1, 0, 0, 0); - // 上月达标情况 达标率就是有没有达到核定下限流量 - // accessRules 取数规则:0=最早值、1=最大值、2=最小值、3=平均值、4=(累计值/和值)、5=(变化值/差值)6=最新值") - // SaveTimeType 周期类型: 0-> s(秒) 1->、m(分)、2->h(小时) 3->、d(天) 4->、w(周) 5->、n(自然月)、6->y(自然年) - - List> dataList = getData(stcd, 3, 6, 1, startTime, endTime); - log.info("去年达标情况data: {}, 设备编码为:{}", dataList, stcd); - return getCount(dataList, discharge); - } - - Map reportAndWarnToday(String stcd) { - // 获取当前时间 - LocalDateTime now = LocalDateTime.now(); - LocalDateTime startTime = now.withHour(0).withMinute(0).withSecond(0).withNano(0); - LocalDateTime endTime = now; - // accessRules 取数规则:0=最早值、1=最大值、2=最小值、3=平均值、4=(累计值/和值)、5=(变化值/差值)6=最新值") - // SaveTimeType 周期类型: 0-> s(秒) 1->、m(分)、2->h(小时) 3->、d(天) 4->、w(周) 5->、n(自然月)、6->y(自然年) - List> dataList = getData(stcd, 3, 2, 1, startTime, endTime); - log.info("今天上报data: {}, 设备编码为:{}", dataList, stcd); - int count = 0; - if (!CollectionUtils.isEmpty(dataList)) { - for (Map info : dataList) { - String ecologicalFlowValue = null == info.get(signage) ? null : - info.get(signage).toString(); - log.info("ecologicalFlowValue的值: {}", ecologicalFlowValue); - if (StringUtils.isNotBlank(ecologicalFlowValue)) { - count++; - } - } - } - HashMap map = new HashMap<>(); - map.put("count", count); - FlowWarnQueryDTO dto = new FlowWarnQueryDTO(); - dto.setStartTime(DateUtil.getStringTime(startTime)); - dto.setEndTime(DateUtil.getStringTime(endTime)); - dto.setObjectCode(stcd); - List flowWarnList = ecologicalFlowMapper.getFlowWarnCount(dto); - if (CollectionUtils.isEmpty(flowWarnList)) { - map.put("warnCount", 0); - } else { - map.put("warnCount", flowWarnList.size()); - } - return map; - } - - - Map reportAndWarnYesTerday(String stcd) { - // 获取当前时间 - LocalDateTime now = LocalDateTime.now(); - // 获取昨天的日期 - LocalDateTime last = now.minusDays(1); - // 昨天的开始时间(00:00) 昨天的结束时间(00:00)yesterday: 2024-03-10 00:00:00 yesterday: 2024-03-11 00:00:00 - LocalDateTime startTime = last.withHour(0).withMinute(0).withSecond(0).withNano(0); - LocalDateTime endTime = last.plusDays(1).withHour(0).withMinute(0).withSecond(0).withNano(0); - // accessRules 取数规则:0=最早值、1=最大值、2=最小值、3=平均值、4=(累计值/和值)、5=(变化值/差值)6=最新值") - // SaveTimeType 周期类型: 0-> s(秒) 1->、m(分)、2->h(小时) 3->、d(天) 4->、w(周) 5->、n(自然月)、6->y(自然年) - List> dataList = getData(stcd, 3, 2, 1, startTime, endTime); - log.info("昨天上报data: {}, 设备编码为:{}", dataList, stcd); - int count = 0; - if (!CollectionUtils.isEmpty(dataList)) { - for (Map info : dataList) { - String ecologicalFlowValue = null == info.get(signage) ? null : - info.get(signage).toString(); - log.info("ecologicalFlowValue的值: {}", ecologicalFlowValue); - if (StringUtils.isNotBlank(ecologicalFlowValue)) { - count++; - } - } - } - HashMap map = new HashMap<>(); - map.put("count", count); - FlowWarnQueryDTO dto = new FlowWarnQueryDTO(); - dto.setStartTime(DateUtil.getStringTime(startTime)); - dto.setEndTime(DateUtil.getStringTime(endTime)); - dto.setObjectCode(stcd); - Query query = new Query(); - query.setCurrent(1); - query.setSize(10000); - List flowWarnList = ecologicalFlowMapper.getFlowWarnList(dto, Condition.getPage(query)).getRecords(); - if (CollectionUtils.isEmpty(flowWarnList)) { - map.put("warnCount", 0); - } else { - map.put("warnCount", flowWarnList.size()); - } - return map; - } - - - - int getCount(List> dataList, BigDecimal discharge) { - int count = 0; - if (!CollectionUtils.isEmpty(dataList)) { - Map info = dataList.get(dataList.size() - 1); - String ecologicalFlowValue = null == info.get(signage) ? "0" : - info.get(signage).toString(); - log.info("ecologicalFlowValue的值: {}", ecologicalFlowValue); - if (new BigDecimal(ecologicalFlowValue).compareTo(discharge) >= 0) { - count++; - } - } - return count; - } - - - - - /** - * bulid info - * @param stationInfoList - * @param yesterdayFinishCountList - * @param weekCountList - * @param monthFinishCountList - * @param quarterCountList - * @param halfYearCountList - * @param yearCountList - * @param reportAndWarnTodayMapList - * @param reportAndWarnYesTerdayMapList - */ - void buildCompletableFutureList(List stationInfoList, - List> yesterdayFinishCountList , - List> weekCountList , - List> monthFinishCountList , - List> quarterCountList , - List> halfYearCountList , - List> yearCountList , - List>> reportAndWarnTodayMapList , - List>> reportAndWarnYesTerdayMapList ){ - for (int i = 0; i < stationInfoList.size(); i++) { - StationVo vo = stationInfoList.get(i); -// String stcd = "JSCZ001"; - // 设备编号 核定流量 - String stcd = vo.getDeviceCode(); - BigDecimal discharge = vo.getFlowValue(); - // 1.昨日达标情况 达标率就是有没有达到核定下限流量 - yesterdayFinishCountList.add(CompletableFuture.supplyAsync(() -> getDayInfo(stcd, discharge))); - // 2.上周达标情况 - weekCountList.add(CompletableFuture.supplyAsync(() -> getMouthInfo(stcd, discharge))); - // 3.上月达标情况 - monthFinishCountList.add(CompletableFuture.supplyAsync(() -> getWeekInfo(stcd, discharge))); - // 4.季度达标情况 - quarterCountList.add(CompletableFuture.supplyAsync(() -> getQuarterInfo(stcd, discharge))); - // 5.半年达标情况 - halfYearCountList.add(CompletableFuture.supplyAsync(() -> getHaltYearInfo(stcd, discharge))); - // 6.年达标情况 - yearCountList.add(CompletableFuture.supplyAsync(() -> getYearInfo(stcd, discharge))); - // 7.今日 预警数 上报率 - reportAndWarnTodayMapList.add(CompletableFuture.supplyAsync(() -> reportAndWarnToday(stcd))); - // 8.昨日 预警数 上报率 - reportAndWarnYesTerdayMapList.add(CompletableFuture.supplyAsync(() -> reportAndWarnYesTerday(stcd))); - } - } - - void buildRestultInfo(EcologicalFlowVo ecologicalFlowVo, Integer size, Integer yesterdayFinishCount, - Integer monthFinishCount, Integer weekCount, Integer quarterCount, Integer halfYearCount, - Integer yearCount, Integer reportTodayCount, Integer warnTodayCount, - Integer reportYesTerdayCount, Integer warnYesTerdayCount) { - // 昨日 - BigDecimal yesterdayFinishPer = BigDecimal.valueOf(yesterdayFinishCount).divide(BigDecimal.valueOf(size), 2, RoundingMode.HALF_UP); - ecologicalFlowVo.setYesterdayFinishPer(yesterdayFinishPer.multiply(BigDecimal.valueOf(100)) + "%"); - ecologicalFlowVo.setYesterdayFinishCount(yesterdayFinishCount); - // 上月 - BigDecimal monthFinishPer = BigDecimal.valueOf(monthFinishCount).divide(BigDecimal.valueOf(size), 2, RoundingMode.HALF_UP); - ecologicalFlowVo.setMonthFinishPer(monthFinishPer.multiply(BigDecimal.valueOf(100)) + "%"); - ecologicalFlowVo.setMonthFinishCount(monthFinishCount); - // 上周 - BigDecimal weekFinishPer = BigDecimal.valueOf(weekCount).divide(BigDecimal.valueOf(size), 2, RoundingMode.HALF_UP); - ecologicalFlowVo.setWeekFinishPer(weekFinishPer.multiply(BigDecimal.valueOf(100)) + "%"); - // 季度 - BigDecimal quarterFinishPer = BigDecimal.valueOf(quarterCount).divide(BigDecimal.valueOf(size), 2, RoundingMode.HALF_UP); - ecologicalFlowVo.setQuarterFinishPer(quarterFinishPer.multiply(BigDecimal.valueOf(100)) + "%"); - // 半年 - BigDecimal halfYearFinishPer = BigDecimal.valueOf(halfYearCount).divide(BigDecimal.valueOf(size), 2, RoundingMode.HALF_UP); - ecologicalFlowVo.setHalfYearFinishPer(halfYearFinishPer.multiply(BigDecimal.valueOf(100)) + "%"); - // 一年 - BigDecimal yearFinishPer = BigDecimal.valueOf(yearCount).divide(BigDecimal.valueOf(size), 2, RoundingMode.HALF_UP); - ecologicalFlowVo.setYearFinishPer(yearFinishPer.multiply(BigDecimal.valueOf(100)) + "%"); - // 今天预警数 上报率 - // 计算几天过了几个小时 - long hoursPassedToday = DateUtil.getHoursPassedToday() + 1; - BigDecimal reportTodayPre; - reportTodayPre = BigDecimal.valueOf(reportTodayCount).divide(BigDecimal.valueOf(hoursPassedToday * size), 2, RoundingMode.HALF_UP); - ecologicalFlowVo.setReportTodayPre(reportTodayPre.multiply(BigDecimal.valueOf(100)) + "%"); - ecologicalFlowVo.setWarnTodayCount(warnTodayCount); - // 昨天预警数 上报率 - BigDecimal reportYesTerdayPre = BigDecimal.valueOf(reportYesTerdayCount).divide(BigDecimal.valueOf(24L * size), 2, RoundingMode.HALF_UP); - ecologicalFlowVo.setReportYesTerdayPre(reportYesTerdayPre.multiply(BigDecimal.valueOf(100)) + "%"); - ecologicalFlowVo.setWarnYesTerdayCount(warnYesTerdayCount); - } - -} - - - - diff --git a/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/service/impl/ExamStationDataServiceImpl.java b/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/service/impl/ExamStationDataServiceImpl.java deleted file mode 100644 index 9e012d1..0000000 --- a/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/service/impl/ExamStationDataServiceImpl.java +++ /dev/null @@ -1,274 +0,0 @@ -package com.hnac.hzims.suichang.service.impl; - -import com.alibaba.excel.EasyExcel; -import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; -import com.hnac.hzims.suichang.mapper.EcologicalFlowMapper; -import com.hnac.hzims.suichang.service.EcologicalFlowService; -import com.hnac.hzims.suichang.service.ExamStationDataService; -import com.hnac.hzims.suichang.service.RealMonitorService; -import com.hnac.hzims.suichang.util.DateUtil; -import com.hnac.hzims.suichang.vo.*; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.net.URLEncoder; -import java.time.LocalDateTime; -import java.time.temporal.ChronoUnit; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -/** - * @Author: liangfan - * @Date: 2024-03-14 16:19 - * @Description: - */ - -@Slf4j -@Service -public class ExamStationDataServiceImpl implements ExamStationDataService { - @Autowired - private EcologicalFlowMapper ecologicalFlowMapper; - - @Autowired - private EcologicalFlowService ecologicalFlowService; - - @Autowired - private RealMonitorService realMonitorService; - - @Value("${suichang.signage}") - String signage; - - @Value("${suichang.passPreValue}") - String passPreValue; - - @Value("${suichang.timeSignage}") - String timeSignage; - - @Override - public List examStationFlowReportByTime(ExamStationFlowDataReq req) { - StationQueryReq queryReq = new StationQueryReq(); - queryReq.setStationType(req.getStationType()); - queryReq.setName(req.getName()); - // 查询电站 - List list = ecologicalFlowMapper.getStationListByReq(queryReq); - List result = new ArrayList<>(); - // 根据电站查询日均流量 - for (StationVo stationRelationVo : list) { -// String stcd = "JSCZ001"; - String stcd = stationRelationVo.getDeviceCode(); - LocalDateTime startTime = DateUtil.getStartTime(req.getStartTime()); - LocalDateTime endTime = DateUtil.getEndTimeByDay(req.getEndTime()); - // accessRules 取数规则:0=最早值、1=最大值、2=最小值、3=平均值、4=(累计值/和值)、5=(变化值/差值)6=最新值") - // SaveTimeType 周期类型: 0-> s(秒) 1->、m(分)、2->h(小时) 3->、d(天) 4->、w(周) 5->、n(自然月)、6->y(自然年) - List> dataList = ecologicalFlowService.getData(stcd, 3, 3, 1, startTime, endTime); - long days = ChronoUnit.DAYS.between(startTime, endTime); - log.info("dataList: {}, 设备编码为:{}, 天数:{}", dataList, stcd, days); - // 合格情况 - BigDecimal flowValue = stationRelationVo.getFlowValue(); - List infos = new ArrayList<>(); - int passCount = 0; - if (!CollectionUtils.isEmpty(dataList)) { - // 为了处理特殊返回情况 多查出一条数据的问题 - if (dataList.size() > days) { - dataList.remove(0); - } - for (Map info : dataList) { - ExamStationFlowReportDetailVo detailVo = new ExamStationFlowReportDetailVo(); - detailVo.setIsPass("不合格"); - String ecologicalFlowValue = null == info.get(signage) ? "0" : - info.get(signage).toString(); - log.info("ecologicalFlowValue的值: {}", ecologicalFlowValue); - if (new BigDecimal(ecologicalFlowValue).compareTo(flowValue) >= 0) { - passCount++; - detailVo.setIsPass("合格"); - } - detailVo.setFlowValue(flowValue); - detailVo.setEcologicalFlowValue(new BigDecimal(ecologicalFlowValue)); - detailVo.setTm(info.get(timeSignage).toString()); - infos.add(detailVo); - } - } - - ExamStationFlowReportVo examStationFlowReportVo = new ExamStationFlowReportVo(); - examStationFlowReportVo.setName(stationRelationVo.getName()); - examStationFlowReportVo.setAreaName("遂昌县"); - examStationFlowReportVo.setFlowValue(flowValue); - examStationFlowReportVo.setInfos(infos); - examStationFlowReportVo.setPassCount(passCount); - examStationFlowReportVo.setCount(days); - BigDecimal pre = BigDecimal.valueOf(passCount).divide(BigDecimal.valueOf(days), 2, RoundingMode.HALF_UP); - examStationFlowReportVo.setPassPre(pre.multiply(BigDecimal.valueOf(100)) + "%"); - String isPass = pre.compareTo(new BigDecimal(passPreValue)) >= 0 ? "合格" : "不合格"; - examStationFlowReportVo.setIsPass(isPass); - result.add(examStationFlowReportVo); - } - return result; - } - - @Override - public void exportExamStationFlowReportByTime(HttpServletResponse response, ExamStationFlowDataReq req) { - List examStationFlowReportVos = this.examStationFlowReportByTime(req); - // 动态生成的表头 - List firstHead = new ArrayList<>(Arrays.asList("电站名称", "所属区域", "核定流量")); - List endHead = new ArrayList<>(Arrays.asList("合格天数(天)", "考核天数(天)", "合格率", "是否合格")); - List allList = new ArrayList<>(); - allList.addAll(firstHead); - if (!CollectionUtils.isEmpty(examStationFlowReportVos)) { - ExamStationFlowReportVo examStationFlowReportVo = examStationFlowReportVos.get(0); - List infos = examStationFlowReportVo.getInfos(); - List mindHead = infos.stream().map(ExamStationFlowReportDetailVo::getTm).collect(Collectors.toList()); - allList.addAll(mindHead); - } - allList.addAll(endHead); - List> head = allList.stream().map(v -> { - List list = new ArrayList<>(); - list.add(v); - return list; - }).collect(Collectors.toList()); - - // 组合数据 - List> contentLists = new ArrayList<>(); - examStationFlowReportVos.forEach(o -> { - List list = new ArrayList<>(); - list.add(o.getName()); - list.add(o.getAreaName()); - list.add(o.getFlowValue().toString()); - List exVo = o.getInfos(); - exVo.forEach(k -> { - list.add(k.getIsPass()); - }); - list.add(o.getPassCount().toString()); - list.add(o.getCount().toString()); - list.add(o.getPassPre()); - list.add(o.getIsPass()); - contentLists.add(list); - }); - try { - //设置xlsx格式 - response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("电站月考核" + ".xlsx", "UTF-8")); - - EasyExcel.write(response.getOutputStream()).autoCloseStream(Boolean.TRUE).head(head).autoTrim(true) - .sheet(1, "电站月考核").registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) - .doWrite(contentLists); - - response.getOutputStream().close(); - } catch (IOException e) { - e.printStackTrace(); - } - - } - - @Override - public List examStationFlowReportOfDay(ExamStationFlowDataReq req) { - LocalDateTime startYesTodayTime = DateUtil.getStartTime(req.getStartTime()).minusDays(1); - LocalDateTime endYesTodayTime = DateUtil.getEndTimeByDay(req.getStartTime()).minusDays(1); - - LocalDateTime startTime = DateUtil.getStartTime(req.getStartTime()); - LocalDateTime endTime = DateUtil.getEndTimeByDay(req.getStartTime()); - - StationQueryReq queryReq = new StationQueryReq(); - queryReq.setStationType(req.getStationType()); - queryReq.setName(req.getName()); - // 查询电站 - List list = ecologicalFlowMapper.getStationListByReq(queryReq); - List result = new ArrayList<>(); - if (!CollectionUtils.isEmpty(list)) { - // 多线程优化 - List> yesTerDayAvgFlowValueList = new ArrayList<>(); - List> todayAvgFlowValueList = new ArrayList<>(); - List> realFlowValueList = new ArrayList<>(); - for (int i = 0; i < list.size(); i++) { - String stcd = list.get(i).getDeviceCode(); - yesTerDayAvgFlowValueList.add(CompletableFuture.supplyAsync(() -> getAvgOneDayData(stcd, startYesTodayTime, endYesTodayTime))); - todayAvgFlowValueList.add(CompletableFuture.supplyAsync(() -> getAvgOneDayData(stcd, startTime, endTime))); - realFlowValueList.add(CompletableFuture.supplyAsync(() -> realMonitorService.getRealData(stcd, signage))); - } - for (int i = 0; i < list.size(); i++) { - BigDecimal yesTerDayAvgFlowValue = null; - BigDecimal todayAvgFlowValue = null; - String realFlowValue = null; - try { - // 前日日均流量 - yesTerDayAvgFlowValue = yesTerDayAvgFlowValueList.get(i).get(); - // 当日日均流量 - todayAvgFlowValue = todayAvgFlowValueList.get(i).get(); - // 实时流量 - realFlowValue = realFlowValueList.get(i).get(); - } catch (Exception e) { - e.printStackTrace(); - } - result.add(buildVo(list.get(i), yesTerDayAvgFlowValue, realFlowValue, todayAvgFlowValue)); - } - } - return result; - } - - /** - * 计算单日日均流量 - * - * @param stcd - * @return - */ - BigDecimal getAvgOneDayData(String stcd, LocalDateTime startTime, LocalDateTime endTime) { - long days = ChronoUnit.DAYS.between(startTime, endTime); - // accessRules 取数规则:0=最早值、1=最大值、2=最小值、3=平均值、4=(累计值/和值)、5=(变化值/差值)6=最新值") - // SaveTimeType 周期类型: 0-> s(秒) 1->、m(分)、2->h(小时) 3->、d(天) 4->、w(周) 5->、n(自然月)、6->y(自然年) - List> dataList = - ecologicalFlowService.getData(stcd, 3, 3, 1, startTime, endTime); - log.info("dataList: {}, 设备编码为:{}, 开始:{}, 结束 {}, 天数:{}", dataList, stcd, startTime, endTime, days); - if (!CollectionUtils.isEmpty(dataList)) { - // 为了处理特殊返回情况 多查出一条数据的问题 - if (dataList.size() > days) { - dataList.remove(0); - } - Map info = dataList.get(0); - String ecologicalFlowValue = null == info.get(signage) ? "0" : - info.get(signage).toString(); - log.info("ecologicalFlowValue的值: {}", ecologicalFlowValue); - return new BigDecimal(ecologicalFlowValue); - } - return BigDecimal.ZERO; - } - - /** - * build vo - * @param stationRelationVo - * @param yesTerDayAvgFlowValue - * @param realFlowValue - * @param todayAvgFlowValue - * @return - */ - ExamStationFlowReportDayVo buildVo(StationVo stationRelationVo, BigDecimal yesTerDayAvgFlowValue, String realFlowValue, BigDecimal todayAvgFlowValue) { - ExamStationFlowReportDayVo vo = new ExamStationFlowReportDayVo(); - vo.setName(stationRelationVo.getName()); - vo.setAreaName("遂昌县"); - vo.setFlowValue(stationRelationVo.getFlowValue()); - vo.setYesTerDayAvgFlowValue(yesTerDayAvgFlowValue); - vo.setRealFlowValue(new BigDecimal(realFlowValue)); - vo.setToDayAvgFlowValue(todayAvgFlowValue); - BigDecimal realOutFlow = todayAvgFlowValue.multiply(new BigDecimal(86400)); - BigDecimal outFlow = stationRelationVo.getFlowValue().multiply(new BigDecimal(86400)); - vo.setRealOutFlow(realOutFlow); - vo.setOutFlow(outFlow); - BigDecimal dayOutFlowPre = realOutFlow.divide(outFlow, 2, RoundingMode.HALF_UP); - String status = "未达标"; - if (dayOutFlowPre.compareTo(new BigDecimal(passPreValue)) >= 0) { - status = "达标"; - } - vo.setStatus(status); - vo.setDayOutFlowPre(dayOutFlowPre.multiply(new BigDecimal(100)) + "%"); - return vo; - } -} - diff --git a/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/service/impl/FlowWarnServiceImpl.java b/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/service/impl/FlowWarnServiceImpl.java deleted file mode 100644 index 957d867..0000000 --- a/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/service/impl/FlowWarnServiceImpl.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.hnac.hzims.suichang.service.impl; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.hnac.hzims.suichang.mapper.EcologicalFlowMapper; -import com.hnac.hzims.suichang.service.FlowWarnService; -import com.hnac.hzims.suichang.vo.FlowWarnQueryDTO; -import com.hnac.hzims.suichang.vo.FlowWarnVo; -import com.hnac.hzims.suichang.vo.StationQueryReq; -import com.hnac.hzims.suichang.vo.StationVo; -import lombok.extern.slf4j.Slf4j; -import org.springblade.core.mp.support.Condition; -import org.springblade.core.mp.support.Query; -import org.springblade.core.tool.utils.Func; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; -import java.util.*; -import java.util.stream.Collectors; - -@Slf4j -@Service -public class FlowWarnServiceImpl implements FlowWarnService { - - @Autowired - private EcologicalFlowMapper ecologicalFlowMapper; - - @Override - public IPage getFlowWarnList(FlowWarnQueryDTO dto, Query query) { - return ecologicalFlowMapper.getFlowWarnList(dto, Condition.getPage(query)); - } - - @Override - public Map> warningPush(FlowWarnQueryDTO dto) { - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); - List stationList = ecologicalFlowMapper.getStationListByReq(new StationQueryReq()); - LocalDateTime startTime = LocalDateTime.parse(dto.getStartTime(), formatter); - LocalDateTime endTime = LocalDateTime.parse(dto.getEndTime(), formatter); - - List dayList = new ArrayList<>(); - while (!startTime.isAfter(endTime)) { - dayList.add(startTime); - startTime = startTime.plusDays(1); - } - Query query = new Query(); - query.setCurrent(1); - query.setSize(10000); - List list = ecologicalFlowMapper.getFlowWarnList(dto, Condition.getPage(query)).getRecords(); - - Map> stationMap = new HashMap<>(); - for (StationVo station : stationList) { - Map dayMap = new LinkedHashMap<>(); - List flowWarnVos = - list.stream().filter(var -> var.getObjectCode().equals(station.getDeviceCode())).collect(Collectors.toList()); - for (int i = 0; i < dayList.size() - 1; i++) { - int degree = 0; - for (FlowWarnVo flowWarnVo : flowWarnVos) { - LocalDateTime warningTime = - LocalDateTime.parse(flowWarnVo.getSendTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); - if (Func.isEmpty(warningTime)) { - continue; - } - if (warningTime.isAfter(dayList.get(i)) && warningTime.isBefore(dayList.get(i + 1))) { - degree = degree + 1; - } - } - dayMap.put(dayList.get(i).format(formatter), degree); - } - stationMap.put(station.getDeviceCode(), dayMap); - } - return stationMap; - } -} diff --git a/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/service/impl/ImageAndVideoServiceImpl.java b/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/service/impl/ImageAndVideoServiceImpl.java deleted file mode 100644 index b20e69b..0000000 --- a/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/service/impl/ImageAndVideoServiceImpl.java +++ /dev/null @@ -1,198 +0,0 @@ -package com.hnac.hzims.suichang.service.impl; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.hnac.hzims.suichang.mapper.EcologicalFlowMapper; -import com.hnac.hzims.suichang.mapper.ImageAndVideoMapper; -import com.hnac.hzims.suichang.service.ImageAndVideoService; -import com.hnac.hzims.suichang.util.DateUtil; -import com.hnac.hzims.suichang.vo.*; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.collections4.CollectionUtils; -import org.springblade.core.mp.support.Condition; -import org.springblade.core.mp.support.Query; -import org.springblade.core.tool.utils.Func; -import org.springblade.core.tool.utils.StringUtil; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; -import java.util.*; -import java.util.stream.Collectors; - -/** - * @Author: liangfan - * @Date: 2024-03-14 16:19 - * @Description: - */ - -@Slf4j -@Service -public class ImageAndVideoServiceImpl implements ImageAndVideoService { - - @Autowired - private EcologicalFlowMapper ecologicalFlowMapper; - - @Autowired - private ImageAndVideoMapper imageAndVideoMapper; - - @Override - public Page getMissingImagesInfo(ImageReq req, Query query) { - StationQueryReq stationQueryReq = new StationQueryReq(); - stationQueryReq.setName(req.getName()); - // 拿到电站列表 - IPage stationListByNamePage = - ecologicalFlowMapper.getStationListByNamePage(stationQueryReq, Condition.getPage(query)); - Page page = new Page<>(); - BeanUtils.copyProperties(stationListByNamePage, page); - List resultList = new ArrayList<>(); - DateTimeFormatter customFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); - LocalDateTime dateTime = LocalDateTime.parse(req.getStartTime(), customFormatter); - // 结合 LocalDate 和 LocalTime 创建 LocalDateTime 对象 - stationListByNamePage.getRecords().forEach(o -> { - MissingImagesRes res = new MissingImagesRes(); - res.setDeviceCode(o.getDeviceCode()); - res.setName(o.getName()); - res.setArea("遂昌县"); - res.setMonth(String.valueOf(dateTime.getMonthValue())); - resultList.add(res); - }); - page.setRecords(resultList); - return page; - } - - @Override - public Map> missingPush(ImageReq req) { - StationQueryReq stationQueryReq = new StationQueryReq(); - stationQueryReq.setName(req.getName()); - List stationList = ecologicalFlowMapper.getStationListByReq(stationQueryReq); - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); - LocalDateTime startTime = LocalDateTime.parse(req.getStartTime(), formatter); - LocalDateTime endTime = LocalDateTime.parse(req.getEndTime(), formatter); - - List dayList = new ArrayList<>(); - while (!startTime.isAfter(endTime)) { - dayList.add(startTime); - startTime = startTime.plusDays(1); - } - - // 查询时间段内的所有照片数据 - Query query = new Query(); - query.setCurrent(1); - query.setSize(10000); - List imageInfoList = imageAndVideoMapper.getImageInfo(req, Condition.getPage(query)).getRecords(); - - Map> stationMap = new HashMap<>(); - for (StationVo station : stationList) { - Map dayMap = new LinkedHashMap<>(); - List infos = - imageInfoList.stream().filter(o -> o.getStcd().equals(station.getDeviceCode())).collect(Collectors.toList()); - for (int i = 0; i < dayList.size() - 1; i++) { - int degree = 0; - for (ImageVo info : infos) { - LocalDateTime warningTime = - LocalDateTime.parse(info.getTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); - if (Func.isEmpty(warningTime)) { - continue; - } - if (!warningTime.isBefore(dayList.get(i)) && !warningTime.isAfter(dayList.get(i + 1))) { - degree = degree + 1; - } - } - dayMap.put(dayList.get(i).format(formatter), degree); - } - stationMap.put(station.getDeviceCode(), dayMap); - } - return stationMap; - } - - @Override - public IPage getImageInfoByDeviceCode(ImageReq req, Query query) { - // 根据deviceCode和时间段查询照片列表 - return imageAndVideoMapper.getImageInfo(req, Condition.getPage(query)); - } - - @Override - public List getImageInfoStatus(ImageReq req) { - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); - LocalDateTime startTime = LocalDateTime.parse(req.getStartTime(), formatter); - LocalDateTime endTime = LocalDateTime.parse(req.getEndTime(), formatter); - Query query = new Query(); - query.setCurrent(1); - query.setSize(10000); - List records = imageAndVideoMapper.getImageInfo(req, Condition.getPage(query)).getRecords(); - List hourList = new ArrayList<>(); - while (!startTime.isAfter(endTime)) { - hourList.add(startTime); - startTime = startTime.plusHours(1); - } - List resultList = new ArrayList<>(); - - for (int i = 0; i < hourList.size() - 1; i++) { - String stringTime = DateUtil.getStringTime(hourList.get(i)); - boolean notHasInfo = true; - for (ImageVo vo : records) { - LocalDateTime warningTime = - LocalDateTime.parse(vo.getTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); - if (Func.isEmpty(warningTime)) { - continue; - } - if (warningTime.isAfter(hourList.get(i)) && warningTime.isBefore(hourList.get(i + 1))) { - vo.setTime(stringTime); - vo.setStatus("正常"); - resultList.add(vo); - notHasInfo = false; - } - - } - - if (notHasInfo) { - ImageVo imageVo = new ImageVo(); - imageVo.setTime(stringTime); - imageVo.setName("暂无图片详情"); - imageVo.setStatus("异常"); - resultList.add(imageVo); - } - - - } - // 筛选 - if (StringUtil.isNotBlank(req.getStatus())) { - resultList = resultList.stream().filter(o -> o.getStatus().equals(req.getStatus())).collect(Collectors.toList()); - } - return resultList; - } - - @Override - public IPage selectNewestImage(ImageReq req, Query query) { - return imageAndVideoMapper.selectNewestImage(req, Condition.getPage(query)); - } - - @Override - public List getStationVideoType(String videoType) { - // 查询所有站点 - List stationList = ecologicalFlowMapper.getStationListByReq(new StationQueryReq()); - // 根据类型查询所有视频点位 - List videoList = imageAndVideoMapper.selectStationTypeByOwerType(videoType); - // 组装数据 - List resultList = new ArrayList<>(); - for (StationVo stationVo : stationList) { - StationTreeRes stationTreeRes = new StationTreeRes(); - List child = videoList.stream().filter(o -> - o.getStationId().equals(stationVo.getDeviceCode()) - ).collect(Collectors.toList()); - if (CollectionUtils.isEmpty(child)) { - continue; - } - stationTreeRes.setChild(child); - stationTreeRes.setCount(child.size()); - stationTreeRes.setStationVo(stationVo); - resultList.add(stationTreeRes); - } - return resultList; - } - -} - diff --git a/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/service/impl/RealMonitorServiceImpl.java b/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/service/impl/RealMonitorServiceImpl.java deleted file mode 100644 index 8611716..0000000 --- a/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/service/impl/RealMonitorServiceImpl.java +++ /dev/null @@ -1,419 +0,0 @@ -package com.hnac.hzims.suichang.service.impl; - -import com.alibaba.excel.EasyExcel; -import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; -import com.hnac.hzims.suichang.mapper.EcologicalFlowMapper; -import com.hnac.hzims.suichang.service.EcologicalFlowService; -import com.hnac.hzims.suichang.service.RealMonitorService; -import com.hnac.hzims.suichang.util.DateUtil; -import com.hnac.hzims.suichang.vo.*; -import com.hnac.hzinfo.datasearch.analyse.domain.FieldsData; -import com.hnac.hzinfo.datasearch.real.po.RealDataSearchPO; -import com.hnac.hzinfo.sdk.core.response.Result; -import com.hnac.hzinfo.sdk.real.RealDataSearchClient; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.net.URLEncoder; -import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; -import java.time.temporal.ChronoUnit; -import java.util.*; -import java.util.stream.Collectors; - -/** - * @Author: liangfan - * @Date: 2024-03-08 15:06 - * @Description: - */ -@Slf4j -@Service -public class RealMonitorServiceImpl implements RealMonitorService { - @Autowired - private EcologicalFlowService ecologicalFlowService; - - @Autowired - private EcologicalFlowMapper ecologicalFlowMapper; - - @Autowired - RealDataSearchClient realDataSearchClient; - - @Value("${suichang.signage}") - String signage; - - @Value("${suichang.timeSignage}") - String timeSignage; - - @Override - public List getAvgMonitorInfo() { - // 获取当前时间 - LocalDateTime now = LocalDateTime.now(); - // 昨天的开始时间(00:00) 昨天的结束时间(00:00)yesterday: 2024-03-12 00:00:00 yesterday: 2024-03-13 00:00:00 - LocalDateTime startTime = now.withHour(0).withMinute(0).withSecond(0).withNano(0); - LocalDateTime endTime = now.withMinute(0).withSecond(0).withNano(0); - int hours = (int)ChronoUnit.HOURS.between(startTime, endTime); - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); - String dateNow = now.format(formatter); - - List stationRelationList = ecologicalFlowMapper.getStationListByName(null); - - List resultList = new ArrayList<>(); - for (StationVo vo : stationRelationList) { - String stcd = vo.getDeviceCode(); - // accessRules 取数规则:0=最早值、1=最大值、2=最小值、3=平均值、4=(累计值/和值)、5=(变化值/差值)6=最新值") - // SaveTimeType 周期类型: 0-> s(秒) 1->、m(分)、2->h(小时) 3->、d(天) 4->、w(周) 5->、n(自然月)、6->y(自然年) - List> dataList = ecologicalFlowService.getData( - stcd, 3, 2, hours, startTime, endTime); - String realFlowValue = getRealData(stcd, signage); - log.info("dataList: {}, 实时流量为:{},设备编码为:{}", dataList, realFlowValue, stcd); - Map info = new HashMap<>(); - if (!CollectionUtils.isEmpty(dataList)) { - // 为了处理特殊返回情况 多查出一条数据的问题 - if (dataList.size() > 1) { - dataList.remove(0); - } - info = dataList.get(0); - } - - AvgMonitorVo realMonitorVo = new AvgMonitorVo(); - BeanUtils.copyProperties(vo, realMonitorVo); - realMonitorVo.setRealFlow(realFlowValue); - String ecologicalFlowValue = null == info.get(signage) ? "0" : - info.get(signage).toString(); - log.info("info: {}, key:{}, 值:{}", info, signage, ecologicalFlowValue); - realMonitorVo.setAvgFlow(ecologicalFlowValue); - realMonitorVo.setDateNow(dateNow); - // 上报率 - List> reportList = ecologicalFlowService.getData( - stcd, 3, 2, 1, startTime, endTime); - int reportCount = 0; - if (!CollectionUtils.isEmpty(reportList)) { - // 为了处理特殊返回情况 多查出一条数据的问题 - if (reportList.size() > hours) { - reportList.remove(0); - } - for (Map map : reportList) { - if (null != map.get(signage)) { - reportCount++; - } - } - } - BigDecimal pre = BigDecimal.valueOf(reportCount).divide(BigDecimal.valueOf(hours), 2, RoundingMode.HALF_UP); - pre = pre.compareTo(BigDecimal.ONE) >= 1 ? BigDecimal.ONE : pre; - realMonitorVo.setPassPre(pre.multiply(new BigDecimal(100))+ "%"); - resultList.add(realMonitorVo); - } - return resultList; - } - - @Override - public List getAvgMonitorCountInfo(AvgMonitorReq req) { - // 昨日传2024-03-13 2024-03-13 时间段 2024-03-10 2024-03-13 - - String dateString = req.getStartTime() + " 00:00:00"; - String endString = req.getEndTime() + " 00:00:00"; - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); - LocalDateTime startTime = LocalDateTime.parse(dateString, formatter); - LocalDateTime endTime = LocalDateTime.parse(endString, formatter).plusDays(1); - - long days = ChronoUnit.DAYS.between(startTime, endTime); - log.info("开始结束时间: {}, {},相差天数:{}", startTime, endTime, days); - - List stationRelationList = ecologicalFlowMapper.getStationListByName(req.getName()); - - List resultList = new ArrayList<>(); - for (StationVo vo : stationRelationList) { -// String stcd = "JSCZ001"; - String stcd = vo.getDeviceCode(); - // accessRules 取数规则:0=最早值、1=最大值、2=最小值、3=平均值、4=(累计值/和值)、5=(变化值/差值)6=最新值") - // SaveTimeType 周期类型: 0-> s(秒) 1->、m(分)、2->h(小时) 3->、d(天) 4->、w(周) 5->、n(自然月)、6->y(自然年) - List> dataList = ecologicalFlowService.getData( - stcd, 3, 3, 1, startTime, endTime); - log.info("dataList: {}, 设备编码为:{}", dataList, stcd); - if (!CollectionUtils.isEmpty(dataList)) { - int passCount = 0; - // 为了处理特殊返回情况 多查出一条数据的问题 - if (dataList.size() > days) { - dataList.remove(0); - } - List infos = new ArrayList<>(); - AvgMonitorCountVo realMonitorVo = new AvgMonitorCountVo(); - for (int j = 0 ; j < dataList.size(); j++) { - Map info = dataList.get(j); - log.info("info: {}, key:{}, 值:{}", info, signage, info.get(signage)); - String ecologicalFlowValue = null == info.get(signage) ? "0" : - info.get(signage).toString(); - if (vo.getFlowValue().compareTo(new BigDecimal(ecologicalFlowValue)) <= 0) { - passCount++; - } - RealMonitorSingleInfoVo realInfo = new RealMonitorSingleInfoVo(); - realInfo.setTm(info.get(timeSignage).toString()); - realInfo.setValue(ecologicalFlowValue); - infos.add(realInfo); - } - - realMonitorVo.setName(vo.getName()); - realMonitorVo.setFlowValue(vo.getFlowValue()); - realMonitorVo.setCount(days); - realMonitorVo.setPassCount(passCount); - BigDecimal pre = BigDecimal.valueOf(passCount).divide(BigDecimal.valueOf(days), 2, RoundingMode.HALF_UP); - - realMonitorVo.setPassPre(pre.multiply(BigDecimal.valueOf(100)) + "%"); - realMonitorVo.setInfos(infos); - resultList.add(realMonitorVo); - } - } - return resultList; - } - - - - - @Override - public RealMonitorRes getRealMonitorInfo(String name) { - // 创建一个 DateTimeFormatter 对象来指定输出格式 - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); - String dateNow = LocalDateTime.now().withMinute(0).withSecond(0).withNano(0).format(formatter); - // 查询所有站点 - List infos = ecologicalFlowMapper.getStationListByName(name); - // 查询每个站点的名称,核定流量,实时流量,上报个数 时间 - List resultList = new ArrayList<>(); - for (StationVo info : infos) { -// String stcd = "JSCZ001"; - String stcd = info.getDeviceCode(); - String stationName = info.getName(); - BigDecimal flowValue = info.getFlowValue(); - // 查询实时数据 - String realFlowValue = getRealData(stcd, signage); - // 查询历史条数(上报条数) - int historyDataCount = getHistoryDataCount(stcd); - RealMonitorVo realMonitorVo = new RealMonitorVo(); - realMonitorVo.setName(stationName); - realMonitorVo.setDeviceCode(stcd); - realMonitorVo.setFlowValue(flowValue); - realMonitorVo.setRealFlow(realFlowValue); - realMonitorVo.setReportCount(historyDataCount); - realMonitorVo.setDateNow(dateNow); - realMonitorVo.setAreaName("遂昌县"); - resultList.add(realMonitorVo); - } - // 应上报个数 - long hoursPassedToday = DateUtil.getHoursPassedToday() + 1; - RealMonitorRes realMonitorRes = new RealMonitorRes(); - realMonitorRes.setRealMonitorVos(resultList); - realMonitorRes.setReportCount(hoursPassedToday); - return realMonitorRes; - } - - @Override - public void exportRealMonitorInfo(HttpServletResponse response, String name) { - RealMonitorRes realMonitorInfo = this.getRealMonitorInfo(name); - List list = realMonitorInfo.getRealMonitorVos(); - List result = list.stream().map(o -> { - RealMonitorExportDTO dto = new RealMonitorExportDTO(); - BeanUtils.copyProperties(o, dto); - return dto; - }).collect(Collectors.toList()); - - // 下载导出 - String filename = "实时流量"; - // 设置头信息 - response.setCharacterEncoding("UTF-8"); - response.setContentType("application/vnd.ms-excel"); - try { - //设置xlsx格式 - response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(filename + ".xlsx", "UTF-8")); - //创建一个输出流 - EasyExcel.write(response.getOutputStream(), RealMonitorExportDTO.class) - .autoCloseStream(Boolean.TRUE).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) - .sheet(1,"实时流量") - .doWrite(result); - response.getOutputStream().close(); - } catch (IOException e) { - e.printStackTrace(); - } - - } - - @Override - public void exportRealMonitorSingleInfo(HttpServletResponse response, RealMonitorSingleInfoReq req) { - List realMonitorSingleInfos = getRealMonitorSingleInfo(req); - for (RealMonitorSingleInfoVo realMonitorSingleInfo : realMonitorSingleInfos) { - realMonitorSingleInfo.setTm(realMonitorSingleInfo.getTm() + ":00:00"); - } - // 下载导出 - String filename = "站点流量详情"; - // 设置头信息 - response.setCharacterEncoding("UTF-8"); - response.setContentType("application/vnd.ms-excel"); - try { - //设置xlsx格式 - response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(filename + ".xlsx", "UTF-8")); - //创建一个输出流 - EasyExcel.write(response.getOutputStream(), RealMonitorSingleInfoVo.class) - .autoCloseStream(Boolean.TRUE) - .sheet(1,"站点流量详情").registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) - .doWrite(realMonitorSingleInfos); - response.getOutputStream().close(); - } catch (IOException e) { - e.printStackTrace(); - } - - } - - - @Override - public List getRealMonitorSingleInfo(RealMonitorSingleInfoReq req) { - String stcd = req.getDeviceCode(); - LocalDateTime startTime = DateUtil.getStartTime(req.getStartTime()); - LocalDateTime endTime = DateUtil.getEndTime(req.getEndTime()); - log.info("开始时间结束时间: {}, {}", startTime, endTime); - // 昨日达标情况 达标率就是有没有达到核定下限流量 - // accessRules 取数规则:0=最早值、1=最大值、2=最小值、3=平均值、4=(累计值/和值)、5=(变化值/差值)6=最新值") - // SaveTimeType 周期类型: 0-> s(秒) 1->、m(分)、2->h(小时) 3->、d(天) 4->、w(周) 5->、n(自然月)、6->y(自然年) - List> dataList = ecologicalFlowService.getData( - stcd, 3, 2, 1, startTime, endTime); - log.info("拿到getHistoryDataCount dataList: {}, 设备编码为:{}", dataList, stcd); - List resultList = new ArrayList<>(); - if (!CollectionUtils.isEmpty(dataList)) { - resultList = dataList.stream().map(info -> { - String value = null == info.get(signage) ? "0" : - info.get(signage).toString(); - - String time = null == info.get(timeSignage) ? "" : - info.get(timeSignage).toString() + ":00:00"; - RealMonitorSingleInfoVo vo = new RealMonitorSingleInfoVo(); - vo.setValue(value); - vo.setTm(time); - return vo; - }).collect(Collectors.toList()); - } - return resultList; - } - - @Override - public String getRealData(String stcd, String signage) { - RealDataSearchPO po = new RealDataSearchPO(); - po.setAnalyzeCode(stcd); - List signages = new ArrayList<>(); - signages.add(signage); - po.setSignages(signages); - Result> result = realDataSearchClient.getRealDataByDeviceCode(po); - log.info("result: {}, 设备编码为:{}", result, stcd); - if (result == null || !result.isSuccess()) { - return null; - } - String value = "0"; - List data = result.getData(); - if (!CollectionUtils.isEmpty(data)) { - value = data.get(0).getValue(); - } - return value; - } - - - @Override - public void exportAvgMonitorCountInfo(HttpServletResponse response, AvgMonitorReq req) { - List avgMonitorCountInfo = getAvgMonitorCountInfo(req); - // 动态生成的表头 - List firstHead = new ArrayList<>(Arrays.asList("电站名称", "核定流量")); - List endHead = new ArrayList<>(Arrays.asList("考核天数", "合格天数", "合格率")); - List allList = new ArrayList<>(); - allList.addAll(firstHead); - if (avgMonitorCountInfo.size() > 0) { - AvgMonitorCountVo avgMonitorCountVo = avgMonitorCountInfo.get(0); - List infos = avgMonitorCountVo.getInfos(); - List mindHead = infos.stream().map(RealMonitorSingleInfoVo::getTm).collect(Collectors.toList()); - allList.addAll(mindHead); - } - allList.addAll(endHead); - List> head = allList.stream().map(v -> { - List list = new ArrayList<>(); - list.add(v); - return list; - }).collect(Collectors.toList()); - // 组合数据 - List> contentLists = new ArrayList<>(); - avgMonitorCountInfo.forEach(o -> { - List list = new ArrayList<>(); - list.add(o.getName()); - list.add(o.getFlowValue().toString()); - List rsVo = o.getInfos(); - rsVo.forEach(k -> { - list.add(k.getValue()); - }); - list.add(o.getCount().toString()); - list.add(o.getPassCount().toString()); - list.add(o.getPassPre()); - contentLists.add(list); - }); - try { - //设置xlsx格式 - response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("日均流量" + ".xlsx", "UTF-8")); - - EasyExcel.write(response.getOutputStream()).autoCloseStream(Boolean.TRUE).head(head) - .sheet(1,"日均流量").registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) - .doWrite(contentLists); - response.getOutputStream().close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - - - int getHistoryDataCount(String stcd) { - // 获取当前时间 - LocalDateTime now = LocalDateTime.now(); - LocalDateTime startTime = now.withHour(0).withMinute(0).withSecond(0).withNano(0); - LocalDateTime endTime = now; - // 昨日达标情况 达标率就是有没有达到核定下限流量 - // accessRules 取数规则:0=最早值、1=最大值、2=最小值、3=平均值、4=(累计值/和值)、5=(变化值/差值)6=最新值") - // SaveTimeType 周期类型: 0-> s(秒) 1->、m(分)、2->h(小时) 3->、d(天) 4->、w(周) 5->、n(自然月)、6->y(自然年) - List> dataList = ecologicalFlowService.getData( - stcd, 3, 2, 1, startTime, endTime); - log.info("拿到getHistoryDataCount dataList: {}, 设备编码为:{}", dataList, stcd); - int count = 0; - if (!CollectionUtils.isEmpty(dataList)) { - for (Map info : dataList) { - String ecologicalFlowValue = null == info.get(signage) ? null : - info.get(signage).toString(); - log.info("ecologicalFlowValue的值: {}", ecologicalFlowValue); - if (StringUtils.isNotBlank(ecologicalFlowValue)) { - count++; - } - } - } - return count; - } - - - @Override - public String getRealData(String stcd) { - RealDataSearchPO po = new RealDataSearchPO(); - po.setAnalyzeCode(stcd); - List signages = new ArrayList<>(); - signages.add(signage); - po.setSignages(signages); - Result> result = realDataSearchClient.getRealDataByDeviceCode(po); - log.info("result: {}, 设备编码为:{}", result, stcd); - if (result == null || !result.isSuccess()) { - return null; - } - String value = "0"; - List data = result.getData(); - if (!CollectionUtils.isEmpty(data)) { - value = data.get(0).getValue(); - } - return value; - } -} - diff --git a/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/service/impl/StatisticsDataServiceImpl.java b/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/service/impl/StatisticsDataServiceImpl.java deleted file mode 100644 index af54bf1..0000000 --- a/hzims-service/hzims-ecological/src/main/java/com/hnac/hzims/suichang/service/impl/StatisticsDataServiceImpl.java +++ /dev/null @@ -1,172 +0,0 @@ -package com.hnac.hzims.suichang.service.impl; - -import com.alibaba.excel.EasyExcel; -import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; -import com.hnac.hzims.suichang.mapper.EcologicalFlowMapper; -import com.hnac.hzims.suichang.service.EcologicalFlowService; -import com.hnac.hzims.suichang.service.StatisticsDataService; -import com.hnac.hzims.suichang.util.DateUtil; -import com.hnac.hzims.suichang.vo.StationVo; -import com.hnac.hzims.suichang.vo.StatisticsFlowDataDetailVo; -import com.hnac.hzims.suichang.vo.StatisticsFlowDataReq; -import com.hnac.hzims.suichang.vo.StatisticsFlowDataVo; -import lombok.extern.slf4j.Slf4j; -import org.springblade.core.tool.utils.ObjectUtil; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.net.URLEncoder; -import java.time.LocalDateTime; -import java.time.temporal.ChronoUnit; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; - -/** - * @Author: liangfan - * @Date: 2024-03-14 16:19 - * @Description: - */ - -@Slf4j -@Service -public class StatisticsDataServiceImpl implements StatisticsDataService { - @Autowired - private EcologicalFlowMapper ecologicalFlowMapper; - - @Autowired - private EcologicalFlowService ecologicalFlowService; - - @Value("${suichang.signage}") - String signage; - - @Value("${suichang.passPreValue}") - String passPreValueInfo; - - @Override - public StatisticsFlowDataVo statisticsFlowReportByTime(StatisticsFlowDataReq req) { - // 查询所有站点 - List infos = ecologicalFlowMapper.getStationListByName(req.getName()); - // 电站信息 - List dataDetailVos = new ArrayList<>(); - // 构建detail 并返回达标数 - int stationPassCount = buildInfos(req, infos, dataDetailVos, passPreValueInfo); - // 总览信息 - StatisticsFlowDataVo result = new StatisticsFlowDataVo(); - result.setAreaName("遂昌县"); - result.setExamCount(infos.size()); - result.setPassCount(stationPassCount); - BigDecimal pre = BigDecimal.valueOf(stationPassCount).divide(BigDecimal.valueOf(infos.size()), 2, RoundingMode.HALF_UP); - result.setPassPre(pre.multiply(BigDecimal.valueOf(100)) + "%"); - result.setDetail(dataDetailVos); - return result; - } - - @Override - public void exportStatisticsFlowReportByTime(HttpServletResponse response, StatisticsFlowDataReq req) { - StatisticsFlowDataVo statisticsFlowDataVo = statisticsFlowReportByTime(req); - // 动态生成的表头 - String areaName = statisticsFlowDataVo.getAreaName(); - Integer examCount = statisticsFlowDataVo.getExamCount(); - Integer passCount = statisticsFlowDataVo.getPassCount(); - String passPre = statisticsFlowDataVo.getPassPre(); - - List firstHead = new ArrayList<>(Arrays.asList("区域名称:" + areaName, "考核电站数:" + examCount, - "达标电站数:" + passCount, "达标率(%):" + passPre, "安装流量计的电站数:" + examCount)); - List endHead = new ArrayList<>(Arrays.asList("电站名称", "核定生态流量", "考核天数", "合格天数", "合格率")); - // 构建表头 - List> head = new ArrayList<>(); - for (int i = 0; i < endHead.size(); i++) { - List list = new ArrayList<>(); - list.add(firstHead.get(i)); - list.add(endHead.get(i)); - head.add(list); - } - // 组合数据 - List> contentLists = new ArrayList<>(); - List detail = statisticsFlowDataVo.getDetail(); - detail.forEach(o -> { - List list = new ArrayList<>(); - list.add(o.getName()); - list.add(o.getFlowValue()); - list.add(o.getExamDays().toString()); - list.add(o.getExamPassDays().toString()); - list.add(o.getExamPassDayPre()); - contentLists.add(list); - }); - try { - //设置xlsx格式 - response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("报表" + ".xlsx", "UTF-8")); - - EasyExcel.write(response.getOutputStream()).autoCloseStream(Boolean.TRUE).head(head).autoTrim(true) - .sheet(1, "报表").registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) - .doWrite(contentLists); - - response.getOutputStream().close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - - int buildInfos(StatisticsFlowDataReq req, List infos, - List dataDetailVos, String passPreValue) { - int stationPassCount = 0; - for (StationVo stationRelationVo : infos) { -// String stcd = "JSCZ001"; - String stcd = stationRelationVo.getDeviceCode(); - BigDecimal flowValue = stationRelationVo.getFlowValue(); - LocalDateTime startTime = DateUtil.getStartTime(req.getStartTime()); - LocalDateTime endTime = DateUtil.getEndTimeByDay(req.getEndTime()); - int days = (int) ChronoUnit.DAYS.between(startTime, endTime); - - log.info("开始时间结束时间: {}, {},相差天数:{}", startTime, endTime, days); - // 查询单个站点一个时间段的日均数据 - // accessRules 取数规则:0=最早值、1=最大值、2=最小值、3=平均值、4=(累计值/和值)、5=(变化值/差值)6=最新值") - // SaveTimeType 周期类型: 0-> s(秒) 1->、m(分)、2->h(小时) 3->、d(天) 4->、w(周) 5->、n(自然月)、6->y(自然年) - List> dataList = ecologicalFlowService.getData( - stcd, 3, 3, 1, startTime, endTime); - log.info("dataList: {}, 设备编码为:{}", dataList, stcd); - StatisticsFlowDataDetailVo detailVo = new StatisticsFlowDataDetailVo(); - if (!CollectionUtils.isEmpty(dataList)) { - int passCount = 0; - // 为了处理特殊返回情况 多查出一条数据的问题 跳过第一条 - if (dataList.size() > days) { - dataList.remove(0); - } - for (int j = 0; j < dataList.size(); j++) { - Map info = dataList.get(j); - log.info("info: {}, key:{}, 值:{}", info, signage, info.get(signage)); - String ecologicalFlowValue = null == info.get(signage) ? "0" : - info.get(signage).toString(); - if (flowValue.compareTo(new BigDecimal(ecologicalFlowValue)) <= 0) { - passCount++; - } - } - // 计算合格率 - BigDecimal singlePassPre = BigDecimal.valueOf(passCount).divide(BigDecimal.valueOf(days), 2, RoundingMode.HALF_UP); - if (new BigDecimal(passPreValue).compareTo(singlePassPre) <= 0) { - stationPassCount++; - } - detailVo.setExamPassDays(passCount); - detailVo.setExamPassDayPre(singlePassPre.multiply(BigDecimal.valueOf(100)) + "%"); - } - // 组装数据 - detailVo.setName(stationRelationVo.getName()); - if(ObjectUtil.isNotEmpty(stationRelationVo.getFlowValue())){ - detailVo.setFlowValue(stationRelationVo.getFlowValue().toString()); - } - detailVo.setExamDays(days); - dataDetailVos.add(detailVo); - - } - return stationPassCount; - } -} - diff --git a/hzims-service/hzims-ecological/src/main/resources/application.yml b/hzims-service/hzims-ecological/src/main/resources/application.yml deleted file mode 100644 index 89d4aa8..0000000 --- a/hzims-service/hzims-ecological/src/main/resources/application.yml +++ /dev/null @@ -1,16 +0,0 @@ -#mybatis-plus配置 -mybatis-plus: - mapper-locations: classpath:com/hnac/hzims/**/mapper/*Mapper.xml - #实体扫描,多个package用逗号或者分号分隔 - typeAliasesPackage: com.hnac.hzims.**.entity - -#swagger扫描路径配置 -swagger: - base-packages: - - org.springbalde - - com.hnac - -#服务器端口 -server: - port: 18999 - diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessLibraryServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessLibraryServiceImpl.java index 5610484..077bc8e 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessLibraryServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessLibraryServiceImpl.java @@ -92,7 +92,9 @@ public class OperAccessLibraryServiceImpl extends ServiceImpl 1){ + CellRangeAddress region3 = new CellRangeAddress(rowNumber, endRow - 1, (short) 3, (short) 3); + CellRangeAddress region4 = new CellRangeAddress(rowNumber, endRow - 1, (short) 4, (short) 4); + CellRangeAddress region5 = new CellRangeAddress(rowNumber, endRow - 1, (short) 5, (short) 5); + CellRangeAddress region6 = new CellRangeAddress(rowNumber, endRow - 1, (short) 6, (short) 6); + CellRangeAddress region7 = new CellRangeAddress(rowNumber, endRow - 1, (short) 7, (short) 7); + sheet.addMergedRegion(region3); + sheet.addMergedRegion(region4); + sheet.addMergedRegion(region5); + sheet.addMergedRegion(region6); + sheet.addMergedRegion(region7); + } return endRow; } diff --git a/hzims-service/pom.xml b/hzims-service/pom.xml index 08f17ec..e318515 100644 --- a/hzims-service/pom.xml +++ b/hzims-service/pom.xml @@ -25,7 +25,6 @@ hzims-alarm hzims-basic hzims-big-model - hzims-ecological diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/controller/InstitutionalController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/controller/InstitutionalController.java new file mode 100644 index 0000000..3ad05cc --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/controller/InstitutionalController.java @@ -0,0 +1,24 @@ +package com.hnac.hzims.safeproduct.train.controller; + +import com.hnac.hzims.safeproduct.Constants; +import com.hnac.hzims.safeproduct.train.service.IInstitutionalService; +import com.hnac.hzinfo.log.annotation.Business; +import io.swagger.annotations.Api; +import lombok.AllArgsConstructor; +import org.springblade.core.boot.ctrl.BladeController; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author ysj + */ +@RestController +@AllArgsConstructor +@RequestMapping("/institutional") +@Business(module = Constants.APP_NAME, value = "制度资料") +@Api(tags = "制度资料") +public class InstitutionalController extends BladeController { + + private final IInstitutionalService institutionalService; + +} \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/controller/RectificationController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/controller/RectificationController.java new file mode 100644 index 0000000..fd81ac0 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/controller/RectificationController.java @@ -0,0 +1,72 @@ +package com.hnac.hzims.safeproduct.train.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.hzims.safeproduct.Constants; +import com.hnac.hzims.safeproduct.train.entity.RectificationEntity; +import com.hnac.hzims.safeproduct.train.entity.ViolationEntity; +import com.hnac.hzims.safeproduct.train.service.IRectificlationService; +import com.hnac.hzims.safeproduct.train.vo.RectificationParamVo; +import com.hnac.hzims.safeproduct.train.vo.RectificationSummaryVo; +import com.hnac.hzims.safeproduct.train.vo.ViolationParamVo; +import com.hnac.hzims.safeproduct.train.vo.ViolationSummaryVo; +import com.hnac.hzinfo.log.annotation.Business; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import lombok.AllArgsConstructor; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; + + +/** + * @author ysj + */ +@RestController +@AllArgsConstructor +@RequestMapping("/rectification") +@Business(module = Constants.APP_NAME, value = "整改督办") +@Api(value = "整改督办", tags = "整改督办接口") +public class RectificationController extends BladeController { + + private final IRectificlationService service; + + @PostMapping("/save") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "新增违章考核", notes = "传入RectificationEntity") + public R save(@RequestBody RectificationEntity entity) { + return R.status(service.save(entity)); + } + + @PostMapping("/update") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "修改违章考核", notes = "传入RectificationEntity") + public R update(@RequestBody RectificationEntity entity) { + return R.status(service.updateById(entity)); + } + + @PostMapping("/remove") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "删除违章考核", notes = "ids") + public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) { + return R.status(service.removeByIds(Func.toLongList(ids))); + } + + @GetMapping("/pages") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "分页查询", notes = "查询条件:entity") + public R> pageCondition(RectificationParamVo params, Query query) { + return R.data(service.pageCondition(params, Condition.getPage(query))); + } + + @GetMapping("/summary") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "汇总", notes = "查询条件:站点ID、月份") + public R> summary(RectificationParamVo params, Query query) { + return R.data(service.summary(params,Condition.getPage(query))); + } +} \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/controller/TrainController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/controller/TrainController.java new file mode 100644 index 0000000..18624e4 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/controller/TrainController.java @@ -0,0 +1,23 @@ +package com.hnac.hzims.safeproduct.train.controller; + +import com.hnac.hzims.safeproduct.Constants; +import com.hnac.hzims.safeproduct.train.service.ITrainService; +import com.hnac.hzinfo.log.annotation.Business; +import io.swagger.annotations.Api; +import lombok.AllArgsConstructor; +import org.springblade.core.boot.ctrl.BladeController; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author ysj + */ +@RestController +@AllArgsConstructor +@RequestMapping("/train") +@Business(module = Constants.APP_NAME, value = "培训管理") +@Api(value = "培训管理", tags = "培训管理接口") +public class TrainController extends BladeController { + + private final ITrainService trainService; +} \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/controller/ViolationController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/controller/ViolationController.java new file mode 100644 index 0000000..be5d618 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/controller/ViolationController.java @@ -0,0 +1,70 @@ +package com.hnac.hzims.safeproduct.train.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.hzims.safeproduct.Constants; +import com.hnac.hzims.safeproduct.train.entity.ViolationEntity; +import com.hnac.hzims.safeproduct.train.service.IViolationService; +import com.hnac.hzims.safeproduct.train.vo.ViolationParamVo; +import com.hnac.hzims.safeproduct.train.vo.ViolationSummaryVo; +import com.hnac.hzinfo.log.annotation.Business; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import lombok.AllArgsConstructor; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; + + +/** + * @author ysj + */ +@RestController +@AllArgsConstructor +@RequestMapping("/violation") +@Business(module = Constants.APP_NAME, value = "违章考核") +@Api(value = "违章考核", tags = "违章考核接口") +public class ViolationController extends BladeController { + + private final IViolationService service; + + @PostMapping("/save") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "新增违章考核", notes = "传入ViolationEntity") + public R save(@RequestBody ViolationEntity entity) { + return R.status(service.save(entity)); + } + + @PostMapping("/update") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "修改违章考核", notes = "传入HazardDetailsVo") + public R update(@RequestBody ViolationEntity entity) { + return R.status(service.updateById(entity)); + } + + @PostMapping("/remove") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "删除违章考核", notes = "ids") + public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) { + return R.status(service.removeByIds(Func.toLongList(ids))); + } + + @GetMapping("/pages") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "分页查询", notes = "查询条件:entity") + public R> pageCondition(ViolationParamVo params, Query query) { + return R.data(service.pageCondition(params,Condition.getPage(query))); + } + + @GetMapping("/summary") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "汇总", notes = "查询条件:站点ID、月份") + public R> summary(ViolationParamVo params, Query query) { + return R.data(service.summary(params,Condition.getPage(query))); + } + +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/mapper/InstitutionalMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/mapper/InstitutionalMapper.java new file mode 100644 index 0000000..58ce0e6 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/mapper/InstitutionalMapper.java @@ -0,0 +1,11 @@ +package com.hnac.hzims.safeproduct.train.mapper; + +import com.hnac.hzims.safeproduct.train.entity.InstitutionalEntity; +import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; + +/** + * @author ysj + */ +public interface InstitutionalMapper extends UserDataScopeBaseMapper { + +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/mapper/InstitutionalMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/mapper/InstitutionalMapper.xml new file mode 100644 index 0000000..42b0f64 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/mapper/InstitutionalMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/mapper/RectificationMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/mapper/RectificationMapper.java new file mode 100644 index 0000000..a610152 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/mapper/RectificationMapper.java @@ -0,0 +1,18 @@ +package com.hnac.hzims.safeproduct.train.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.hnac.hzims.safeproduct.train.entity.RectificationEntity; +import com.hnac.hzims.safeproduct.train.vo.RectificationParamVo; +import com.hnac.hzims.safeproduct.train.vo.RectificationSummaryVo; +import com.hnac.hzims.safeproduct.train.vo.ViolationSummaryVo; +import org.apache.ibatis.annotations.Param; +import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; + + +/** + * @author ysj + */ +public interface RectificationMapper extends UserDataScopeBaseMapper { + + IPage summary(@Param("params") RectificationParamVo params, IPage page); +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/mapper/RectificationMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/mapper/RectificationMapper.xml new file mode 100644 index 0000000..7d7114f --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/mapper/RectificationMapper.xml @@ -0,0 +1,23 @@ + + + + + + + \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/mapper/TrainMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/mapper/TrainMapper.java new file mode 100644 index 0000000..ac9736c --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/mapper/TrainMapper.java @@ -0,0 +1,13 @@ +package com.hnac.hzims.safeproduct.train.mapper; + +import com.hnac.hzims.safeproduct.train.entity.TrainEntity; +import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; + + +/** + * @author ysj + */ +public interface TrainMapper extends UserDataScopeBaseMapper { + + +} \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/mapper/TrainMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/mapper/TrainMapper.xml new file mode 100644 index 0000000..773c9e3 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/mapper/TrainMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/mapper/ViolationMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/mapper/ViolationMapper.java new file mode 100644 index 0000000..2175fd3 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/mapper/ViolationMapper.java @@ -0,0 +1,17 @@ +package com.hnac.hzims.safeproduct.train.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.hnac.hzims.safeproduct.train.entity.ViolationEntity; +import com.hnac.hzims.safeproduct.train.vo.ViolationParamVo; +import com.hnac.hzims.safeproduct.train.vo.ViolationSummaryVo; +import org.apache.ibatis.annotations.Param; +import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; + + +/** + * @author ysj + */ +public interface ViolationMapper extends UserDataScopeBaseMapper { + + IPage summary(@Param("params") ViolationParamVo params, IPage page); +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/mapper/ViolationMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/mapper/ViolationMapper.xml new file mode 100644 index 0000000..9d7b175 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/mapper/ViolationMapper.xml @@ -0,0 +1,21 @@ + + + + + + + \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/service/IInstitutionalService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/service/IInstitutionalService.java new file mode 100644 index 0000000..571e06c --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/service/IInstitutionalService.java @@ -0,0 +1,11 @@ +package com.hnac.hzims.safeproduct.train.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.hnac.hzims.safeproduct.train.entity.InstitutionalEntity; + +/** + * @author ysj + */ +public interface IInstitutionalService extends IService { + +} \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/service/IRectificlationService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/service/IRectificlationService.java new file mode 100644 index 0000000..5ab7496 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/service/IRectificlationService.java @@ -0,0 +1,20 @@ +package com.hnac.hzims.safeproduct.train.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; +import com.hnac.hzims.safeproduct.train.entity.RectificationEntity; +import com.hnac.hzims.safeproduct.train.vo.RectificationParamVo; +import com.hnac.hzims.safeproduct.train.vo.RectificationSummaryVo; +import com.hnac.hzims.safeproduct.train.vo.ViolationSummaryVo; + + +/** + * @author ysj + */ +public interface IRectificlationService extends IService { + + + IPage pageCondition(RectificationParamVo params, IPage page); + + IPage summary(RectificationParamVo params, IPage page); +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/service/IViolationService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/service/IViolationService.java new file mode 100644 index 0000000..075e94b --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/service/IViolationService.java @@ -0,0 +1,19 @@ +package com.hnac.hzims.safeproduct.train.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; +import com.hnac.hzims.safeproduct.train.entity.ViolationEntity; +import com.hnac.hzims.safeproduct.train.vo.ViolationParamVo; +import com.hnac.hzims.safeproduct.train.vo.ViolationSummaryVo; + + +/** + * @author ysj + */ +public interface IViolationService extends IService { + + + IPage pageCondition(ViolationParamVo params, IPage page); + + IPage summary(ViolationParamVo stationId, IPage page); +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/service/impl/InstitutionalServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/service/impl/InstitutionalServiceImpl.java new file mode 100644 index 0000000..3c87632 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/service/impl/InstitutionalServiceImpl.java @@ -0,0 +1,19 @@ +package com.hnac.hzims.safeproduct.train.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.hnac.hzims.safeproduct.train.entity.InstitutionalEntity; +import com.hnac.hzims.safeproduct.train.mapper.InstitutionalMapper; +import com.hnac.hzims.safeproduct.train.service.IInstitutionalService; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + + +/** + * 制度资料 + * @author ysj + */ +@Service +@RequiredArgsConstructor +public class InstitutionalServiceImpl extends ServiceImpl implements IInstitutionalService { + +} \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/service/impl/RectificlationServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/service/impl/RectificlationServiceImpl.java new file mode 100644 index 0000000..1d576d2 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/service/impl/RectificlationServiceImpl.java @@ -0,0 +1,60 @@ +package com.hnac.hzims.safeproduct.train.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.hnac.hzims.safeproduct.train.entity.RectificationEntity; +import com.hnac.hzims.safeproduct.train.mapper.RectificationMapper; +import com.hnac.hzims.safeproduct.train.service.IRectificlationService; +import com.hnac.hzims.safeproduct.train.vo.RectificationParamVo; +import com.hnac.hzims.safeproduct.train.vo.RectificationSummaryVo; +import com.hnac.hzims.safeproduct.train.vo.ViolationSummaryVo; +import org.springblade.core.tool.utils.ObjectUtil; +import org.springblade.core.tool.utils.StringUtil; +import org.springframework.stereotype.Service; + +/** + * 整改督办 + * @author ysj + */ +@Service +public class RectificlationServiceImpl extends ServiceImpl implements IRectificlationService { + + /** + * 分页列表查询整改督办 + * @param params + * @param page + * @return + */ + @Override + public IPage pageCondition(RectificationParamVo params, IPage page) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper(); + wrapper.orderByDesc(RectificationEntity::getCreateTime); + if(StringUtil.isNotBlank(params.getStationId())){ + wrapper.eq(RectificationEntity::getStationId,params.getStationId()); + } + if(ObjectUtil.isNotEmpty(params.getRectificationType())){ + wrapper.eq(RectificationEntity::getRectificationType,params.getRectificationType()); + } + if(ObjectUtil.isNotEmpty(params.getStatus())){ + wrapper.eq(RectificationEntity::getStatus,params.getStatus()); + } + if(ObjectUtil.isNotEmpty(params.getPersonLiableName())){ + wrapper.like(RectificationEntity::getPersonLiableName,params.getPersonLiableName()); + } + return super.page(page,wrapper); + } + + /** + * 分页列表查询整改督办汇总 + * @param params + * @param page + * @return + */ + @Override + public IPage summary(RectificationParamVo params, IPage page) { + return this.baseMapper.summary(params,page); + } + + +} \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/service/impl/ViolationServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/service/impl/ViolationServiceImpl.java new file mode 100644 index 0000000..da585f3 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/service/impl/ViolationServiceImpl.java @@ -0,0 +1,61 @@ +package com.hnac.hzims.safeproduct.train.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.hnac.hzims.safeproduct.train.entity.ViolationEntity; +import com.hnac.hzims.safeproduct.train.mapper.ViolationMapper; +import com.hnac.hzims.safeproduct.train.service.IViolationService; +import com.hnac.hzims.safeproduct.train.vo.ViolationParamVo; +import com.hnac.hzims.safeproduct.train.vo.ViolationSummaryVo; +import org.springblade.core.tool.utils.ObjectUtil; +import org.springblade.core.tool.utils.StringUtil; +import org.springframework.stereotype.Service; + +/** + * 违章考核 + * @author ysj + */ +@Service +public class ViolationServiceImpl extends ServiceImpl implements IViolationService { + + /** + * 分页列表查询违章考核记录 + * @param params + * @param page + * @return + */ + @Override + public IPage pageCondition(ViolationParamVo params, IPage page) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper(); + wrapper.orderByDesc(ViolationEntity::getCreateTime); + if(StringUtil.isNotBlank(params.getStationId())){ + wrapper.eq(ViolationEntity::getStationId,params.getStartTime()); + } + if(StringUtil.isNotBlank(params.getStartTime())){ + wrapper.ge(ViolationEntity::getDiscoverTime,params.getStartTime()); + } + if(StringUtil.isNotBlank(params.getEndTime())){ + wrapper.eq(ViolationEntity::getDiscoverTime,params.getEndTime()); + } + if(ObjectUtil.isNotEmpty(params.getViolationLevel())){ + wrapper.eq(ViolationEntity::getViolationLevel,params.getViolationLevel()); + } + if(ObjectUtil.isNotEmpty(params.getDiscovererName())){ + wrapper.like(ViolationEntity::getDiscovererName,params.getDiscovererName()); + } + return super.page(page,wrapper); + } + + /** + * 分页列表查询违章考核汇总 + * @param params + * @param page + * @return + */ + @Override + public IPage summary(ViolationParamVo params, IPage page) { + return this.baseMapper.summary(params,page); + } + +} \ No newline at end of file