Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV
1 文件已重命名
39个文件已修改
13个文件已添加
3个文件已删除
| | |
| | | */ |
| | | @Schema(description = "当前页", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @NotNull(message = "当前页不能为空") //不能为空也不能为null |
| | | public Integer pageCurr ; |
| | | public Integer pageCurr; |
| | | |
| | | /** |
| | | * 每页数据条数 |
| | | */ |
| | | @Schema(description = "每页记录数", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @NotNull(message = "每页记录数不能为空") //不能为空也不能为null |
| | | public Integer pageSize ; |
| | | public Integer pageSize; |
| | | |
| | | /** |
| | | * 设置当前默认第一页 |
| | | * @return |
| | | */ |
| | | public Integer getPageCurr() { |
| | | if (pageCurr == null){ |
| | | return 1; |
| | | } |
| | | return pageCurr; |
| | | } |
| | | |
| | | /** |
| | | * 设置当前默认一页十条 |
| | | * @return |
| | | */ |
| | | public Integer getPageSize() { |
| | | if (pageSize == null){ |
| | | return 10; |
| | | } |
| | | return pageSize; |
| | | } |
| | | } |
| | |
| | | * 未传入分页参数时,取全部记录 |
| | | */ |
| | | //this.pageSize = 1 ;//供下面作为除数 |
| | | this.pageSize = 10000 ;//供下面作为除数 |
| | | this.pageSize = 10 ;//供下面作为除数 |
| | | } |
| | | |
| | | pageTotal = (int)Math.ceil((itemTotal==null?0.0D:itemTotal.doubleValue())/pageSize); |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoOp.OpeFeedbackReply; |
| | | import com.dy.pipIrrGlobal.voOp.Vofeedback; |
| | | import com.dy.pipIrrGlobal.voOp.VofeedbackReply; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | |
| | | |
| | | int updateByPrimaryKey(OpeFeedbackReply record); |
| | | |
| | | /** |
| | | * 获取反馈回复数量 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Long getRecordCount(Map<String, Object> params); |
| | | |
| | | List<Vofeedback> getFeedbackReplys(Map<String, Object> params); |
| | | /** |
| | | * 获取反馈回复 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VofeedbackReply> getFeedbackReply(Map<String, Object> params); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | List<Long> getIntakeIdByNameExcludeId(@Param("id")Long id, @Param("intakeName")String intakeName); |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmOnHourReportHistory; |
| | | import com.dy.pipIrrGlobal.voRm.VoOnHour; |
| | | import com.dy.pipIrrGlobal.voSt.VoIntake; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | |
| | | */ |
| | | List<VoOnHour> getOnHourReports_history(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 获取指定时间段内未上线取水口数量 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Long getNotOnlineIntakesCount(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 获取指定时间段内未上线的取水口 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoIntake> getNotOnlineIntakes(Map<?, ?> params); |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmOnHourReportLast; |
| | | import com.dy.pipIrrGlobal.voRm.VoOnHour; |
| | | import com.dy.pipIrrGlobal.voSt.VoBatteryVolt; |
| | | import com.dy.pipIrrGlobal.voSt.VoCumulativeFlow; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | |
| | | * @return |
| | | */ |
| | | List<VoOnHour> getOnHourReports_last(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 获取累计流量超过指定值的取水口数量 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Long getLargeFlowIntakesCount(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 获取累计流量超过指定值的取水口 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoCumulativeFlow> getLargeFlowIntakes(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 获取累计流量低于指定值的取水口数量 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Long getSmallFlowIntakesCount(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 获取累计流量低于指定值的取水口 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoCumulativeFlow> getSmallFlowIntakes(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 获取欠压取水口数量 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Long getUnderVoltIntakesCount(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 获取欠压取水口 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoBatteryVolt> getUnderVoltIntakes(Map<?, ?> params); |
| | | } |
| | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import jakarta.validation.constraints.NotNull; |
| | | import lombok.*; |
| | | import org.apache.logging.log4j.core.config.plugins.validation.constraints.NotBlank; |
| | | |
| | | import java.util.Date; |
| | | |
| | |
| | | /** |
| | | * 回复内容 |
| | | */ |
| | | @NotNull |
| | | @NotBlank |
| | | private String replyContent; |
| | | |
| | | /** |
| | |
| | | * 回复人ID |
| | | */ |
| | | @NotNull |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | private Long replierId; |
| | | |
| | | |
New file |
| | |
| | | package com.dy.pipIrrGlobal.voOp; |
| | | |
| | | import com.dy.common.po.BaseEntity; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | | * @Date :2024/8/1 20:07 |
| | | * @LastEditTime :2024/8/1 20:07 |
| | | * @Description |
| | | */ |
| | | @Data |
| | | public class VofeedbackReply implements BaseEntity { |
| | | private static final long serialVersionUID = 202408012009001L; |
| | | /** |
| | | * 主键id |
| | | */ |
| | | private String id; |
| | | /** |
| | | * 反馈编号 |
| | | */ |
| | | private String feedbackId; |
| | | |
| | | /** |
| | | * 回复内容 |
| | | */ |
| | | private String replyContent; |
| | | |
| | | /** |
| | | * 回复时间 |
| | | */ |
| | | private Date replyTime; |
| | | |
| | | /** |
| | | * 回复人ID |
| | | */ |
| | | private String replierId; |
| | | } |
| | |
| | | private String intakeNum; |
| | | |
| | | /** |
| | | * 取水口经度 |
| | | */ |
| | | private Double lng; |
| | | |
| | | /** |
| | | * 取水口纬度 |
| | | */ |
| | | private Double lat; |
| | | |
| | | /** |
| | | * 是否在线 |
| | | */ |
| | | private Boolean isOnLine; |
| | | |
| | | /** |
| | | * 是否绑定 |
| | | */ |
| | | private Boolean isBinded; |
| | | |
| | | |
| | | /** |
| | | * 报警信息Json数组 |
| | | */ |
| | | private String alarm; |
| | | } |
| | |
| | | private Double money; |
| | | |
| | | @Schema(description = "统计日期(yyyy-mm-dd)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private java.sql.Date dt; |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private java.util.Date dt; |
| | | |
| | | @Schema(description = "统计日最后一次开阀日期时间(yyyy-mm-dd HH:MM:SS)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | | * @Date :2024/7/24 10:27 |
| | |
| | | private Double amount; |
| | | |
| | | @Schema(description = "统计日期(yyyy-mm-dd)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private java.sql.Date dt; |
| | | // private java.sql.Date dt; |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date dt; |
| | | |
| | | @Schema(description = "最后计水量上报数据接收时间(yyyy-mm-dd hh:mm:ss)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | |
| | | private String rtuAddr; |
| | | |
| | | @Schema(description = "统计日期(yyyy-mm-dd)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private java.sql.Date dt; |
| | | |
| | | @Schema(description = "控制器最后上报数据日期时间(yyyy-mm-dd hh:mm:ss)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
New file |
| | |
| | | package com.dy.pipIrrGlobal.voSt; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-08-03 10:10 |
| | | * @LastEditTime 2024-08-03 10:10 |
| | | * @Description 电池电压视图 |
| | | */ |
| | | |
| | | @Data |
| | | public class VoBatteryVolt extends VoIntake { |
| | | |
| | | /** |
| | | * 电池电压 |
| | | */ |
| | | private Double batteryVolt; |
| | | |
| | | /** |
| | | * 数据获取日期 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date getDate; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.voSt; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-08-01 16:12 |
| | | * @LastEditTime 2024-08-01 16:12 |
| | | * @Description 累计流量视图 |
| | | */ |
| | | |
| | | @Data |
| | | public class VoCumulativeFlow extends VoIntake { |
| | | |
| | | /** |
| | | * 累计流量 |
| | | */ |
| | | private Double cumulativeFlow; |
| | | |
| | | /** |
| | | * 数据获取日期 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date getDate; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.voSt; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-08-01 14:03 |
| | | * @LastEditTime 2024-08-01 14:03 |
| | | * @Description 取水口统计结果视图对象 |
| | | */ |
| | | |
| | | @Data |
| | | public class VoIntake { |
| | | private static final long serialVersionUID = 202408311404001L; |
| | | |
| | | /** |
| | | * 取水口ID |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | private Long intakeId; |
| | | |
| | | /** |
| | | * 取水口编号 |
| | | */ |
| | | private String intakeNum; |
| | | |
| | | /** |
| | | * 取水口所属片区 |
| | | */ |
| | | private String blockName; |
| | | |
| | | } |
| | |
| | | |
| | | pipIrr: |
| | | global: |
| | | dev: true #是否开发阶段,true或false |
| | | dev: false #是否开发阶段,true或false |
| | | dsName: ym #开发阶段,设置临时的数据库名称 |
| | | mw: |
| | | webPort: 8070 |
| | |
| | | access-token: fecef8e7725998f8912af05419580861aafc73413c4920036c07c050fa33055f |
| | | secret: SEC6042bc964d08899a5853eb321eb5a4d842a395982777f815bd07451c879228b7 |
| | | at-all: true |
| | | mobile: 18602657034 |
| | | mobile: 18602657034 |
| | | |
| | | #阀控器参数 |
| | | rtu: |
| | | batteryVolt: 17 |
| | |
| | | from ope_feedback ofb |
| | | left join se_client sc on ofb.feedbacker_id = sc.id |
| | | <where> |
| | | <if test="feedbackerId != null"> |
| | | <if test="feedbackerId != null and feedbackerId != '' "> |
| | | and ofb.feedbacker_id = #{feedbackerId,jdbcType=BIGINT} |
| | | </if> |
| | | <if test="feedbackerName != null"> |
| | | <if test="feedbackerName != null and feedbackerName != '' "> |
| | | and sc.name = #{feedbackerName,jdbcType=VARCHAR} |
| | | </if> |
| | | <if test="timeStart != null"> |
| | |
| | | replier_id = #{replierId,jdbcType=BIGINT} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <select id="getRecordCount" resultType="java.lang.Long"> |
| | | select count(*) from ope_feedback_reply ofbr |
| | | inner join ope_feedback ofb on ofbr.feedback_id = ofb.id |
| | | <where> |
| | | <if test="feedbackId != null and feedbackId != '' "> |
| | | and ofbr.feedback_id = #{feedbackId,jdbcType=BIGINT} |
| | | </if> |
| | | <if test="replierId != null and replierId != '' "> |
| | | and ofbr.replier_id = #{replierId,jdbcType=BIGINT} |
| | | </if> |
| | | <if test="replyTimeStart != null"> |
| | | and ofbr.reply_time >= #{replyTimeStart} |
| | | </if> |
| | | <if test="replyTimeStop != null"> |
| | | and ofbr.reply_time <= #{replyTimeStop} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="getFeedbackReply" resultType="com.dy.pipIrrGlobal.voOp.VofeedbackReply"> |
| | | select |
| | | CAST(ofbr.id as char) AS id, |
| | | CAST(ofbr.feedback_id as char) AS feedbackId, |
| | | ofbr.reply_content as replyContent, |
| | | ofbr.reply_time as replyTime, |
| | | CAST(ofbr.replier_id as char) AS replierId |
| | | from ope_feedback_reply ofbr |
| | | inner join ope_feedback ofb on ofbr.feedback_id = ofb.id |
| | | <where> |
| | | <if test="feedbackId != null and feedbackId != '' "> |
| | | and ofbr.feedback_id = #{feedbackId,jdbcType=BIGINT} |
| | | </if> |
| | | <if test="replierId != null and replierId != '' "> |
| | | and ofbr.replier_id = #{replierId,jdbcType=BIGINT} |
| | | </if> |
| | | <if test="replyTimeStart != null"> |
| | | and ofbr.reply_time >= #{replyTimeStart} |
| | | </if> |
| | | <if test="replyTimeStop != null"> |
| | | and ofbr.reply_time <= #{replyTimeStop} |
| | | </if> |
| | | </where> |
| | | order by ofbr.id desc |
| | | <if test="pageCurr != null and pageSize != null"> |
| | | LIMIT ${(pageCurr-1)*pageSize}, ${pageSize} |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | <select id="getOnLineIntakesCount" resultType="java.lang.Long"> |
| | | SELECT |
| | | COUNT(*) AS recordCount |
| | | FROM pr_controller con |
| | | INNER JOIN pr_intake inta ON con.intakeId = inta.id |
| | | left JOIN JSON_TABLE( |
| | | <!--'[{"rtuAddr":"37142501020100215","isOnLine":true},{"rtuAddr":"4000004","isOnLine":true},{"rtuAddr":"dy20240325","isOnLine":false}]',--> |
| | | FROM pr_intake inta |
| | | LEFT JOIN pr_controller con ON con.intakeId = inta.id |
| | | LEFT JOIN( |
| | | SELECT |
| | | intake_id AS intakeId, |
| | | CONCAT( |
| | | IF(alarm_loss = 1, IF(alarm_water_meter_fault = 1, '流量计故障,', ''), IF(alarm_water_meter_fault = 1, '流量计故障', '')), |
| | | IF(alarm_battery_volt = 1, IF(alarm_loss = 1, '漏损(偷水)报警,', ''), IF(alarm_loss = 1, '漏损(偷水)报警', '')), |
| | | IF(alarm_valve = 1, IF(alarm_battery_volt = 1, '蓄电池电压报警,', ''), IF(alarm_battery_volt = 1, '蓄电池电压报警', '')), |
| | | IF(alarm_valve = 1, '阀门报警', '') |
| | | ) AS alarm |
| | | FROM rm_alarm_state_last |
| | | WHERE (alarm_water_meter_fault = 1 OR alarm_loss = 1 OR alarm_battery_volt = 1 OR alarm_valve = 1) |
| | | AND dt >= DATE_SUB(NOW(),INTERVAL 12 HOUR) |
| | | ) alarm ON alarm.intakeId = inta.id |
| | | LEFT JOIN JSON_TABLE( |
| | | <!--'[{"rtuAddr":"37142501020100215","isOnLine":true},{"rtuAddr":"4000004","isOnLine":true},{"rtuAddr":"dy20240325","isOnLine":false}]',--> |
| | | #{onLineMap}, |
| | | '$[*]' COLUMNS( |
| | | rtuAddr VARCHAR(20) PATH '$.rtuAddr', |
| | |
| | | <if test="intakeNum != null and intakeNum != ''"> |
| | | AND inta.name = #{intakeNum} |
| | | </if> |
| | | <if test="isBinded == false "> |
| | | AND con.rtuAddr IS NULL |
| | | </if> |
| | | <if test="isBinded == true "> |
| | | AND con.rtuAddr IS NOT NULL |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!--获取取水口列表(在线和不在先)--> |
| | | <select id="getOnLineIntakes" resultType="com.dy.pipIrrGlobal.voPr.VoOnLineIntake"> |
| | | SELECT |
| | | con.intakeId, |
| | | con.rtuAddr, |
| | | inta.name AS intakeNum, |
| | | rtus.isOnLine |
| | | FROM pr_controller con |
| | | INNER JOIN pr_intake inta ON con.intakeId = inta.id |
| | | left JOIN JSON_TABLE( |
| | | <!--'[{"rtuAddr":"37142501020100215","isOnLine":true},{"rtuAddr":"4000004","isOnLine":true},{"rtuAddr":"dy20240325","isOnLine":false}]',--> |
| | | #{onLineMap}, |
| | | '$[*]' COLUMNS( |
| | | rtuAddr VARCHAR(20) PATH '$.rtuAddr', |
| | | isOnLine BOOLEAN PATH '$.isOnLine' |
| | | ) |
| | | ) rtus ON con.rtuAddr = rtus.rtuAddr |
| | | inta.id AS intakeId, |
| | | con.rtuAddr, |
| | | inta.name AS intakeNum, |
| | | inta.lng, |
| | | inta.lat, |
| | | (CASE |
| | | WHEN con.rtuAddr IS NULL THEN "false" |
| | | WHEN con.rtuAddr IS NOT NULL THEN "true" |
| | | END) AS isBinded, |
| | | rtus.isOnLine, |
| | | alarm.alarm |
| | | FROM pr_intake inta |
| | | LEFT JOIN pr_controller con ON con.intakeId = inta.id |
| | | LEFT JOIN( |
| | | SELECT |
| | | intake_id AS intakeId, |
| | | CONCAT( |
| | | IF(alarm_loss = 1, IF(alarm_water_meter_fault = 1, '流量计故障,', ''), IF(alarm_water_meter_fault = 1, '流量计故障', '')), |
| | | IF(alarm_battery_volt = 1, IF(alarm_loss = 1, '漏损(偷水)报警,', ''), IF(alarm_loss = 1, '漏损(偷水)报警', '')), |
| | | IF(alarm_valve = 1, IF(alarm_battery_volt = 1, '蓄电池电压报警,', ''), IF(alarm_battery_volt = 1, '蓄电池电压报警', '')), |
| | | IF(alarm_valve = 1, '阀门报警', '') |
| | | ) AS alarm |
| | | FROM rm_alarm_state_last |
| | | WHERE (alarm_water_meter_fault = 1 OR alarm_loss = 1 OR alarm_battery_volt = 1 OR alarm_valve = 1) |
| | | AND dt >= DATE_SUB(NOW(),INTERVAL 12 HOUR) |
| | | ) alarm ON alarm.intakeId = inta.id |
| | | LEFT JOIN JSON_TABLE( |
| | | <!--'[{"rtuAddr":"37142501020100215","isOnLine":true},{"rtuAddr":"4000004","isOnLine":true},{"rtuAddr":"dy20240325","isOnLine":false}]',--> |
| | | #{onLineMap}, |
| | | '$[*]' COLUMNS( |
| | | rtuAddr VARCHAR(20) PATH '$.rtuAddr', |
| | | isOnLine BOOLEAN PATH '$.isOnLine' |
| | | ) |
| | | ) rtus ON con.rtuAddr = rtus.rtuAddr |
| | | <where> |
| | | <if test="isOnLine != null"> |
| | | rtus.isOnLine = #{isOnLine} |
| | |
| | | <if test="intakeNum != null and intakeNum != ''"> |
| | | AND inta.name = #{intakeNum} |
| | | </if> |
| | | <if test="isBinded == false "> |
| | | AND con.rtuAddr IS NULL |
| | | </if> |
| | | <if test="isBinded == true "> |
| | | AND con.rtuAddr IS NOT NULL |
| | | </if> |
| | | </where> |
| | | order by con.id ASC |
| | | <if test="pageCurr != null and pageSize != null"> |
| | |
| | | <if test="valveState != null"> |
| | | and rash.valve_state = #{valveState,jdbcType=TINYINT} |
| | | </if> |
| | | <if test="intakeId != null"> |
| | | <if test="intakeId != null and intakeId != '' "> |
| | | and rash.intake_id = #{intakeId} |
| | | </if> |
| | | <if test="intakeName != null"> |
| | | <if test="intakeName != null and intakeName != '' "> |
| | | and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%') |
| | | </if> |
| | | <if test="startDt != null"> |
| | |
| | | <if test="valveState != null"> |
| | | and rash.valve_state = #{valveState,jdbcType=TINYINT} |
| | | </if> |
| | | <if test="intakeId != null"> |
| | | <if test="intakeId != null and intakeId != '' "> |
| | | and rash.intake_id = #{intakeId} |
| | | </if> |
| | | <if test="intakeName != null"> |
| | | <if test="intakeName != null and intakeName != '' "> |
| | | and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%') |
| | | </if> |
| | | <if test="startDt != null"> |
| | |
| | | <if test="valveState != null"> |
| | | and rasl.valve_state = #{valveState,jdbcType=TINYINT} |
| | | </if> |
| | | <if test="intakeId != null"> |
| | | and rasl.intake_id = #{intakeId} |
| | | <if test="intakeId != null and intakeId != '' "> |
| | | and rash.intake_id = #{intakeId} |
| | | </if> |
| | | <if test="intakeName != null"> |
| | | <if test="intakeName != null and intakeName != '' "> |
| | | and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%') |
| | | </if> |
| | | <if test="startDt != null"> |
| | |
| | | <if test="valveState != null"> |
| | | and rasl.valve_state = #{valveState,jdbcType=TINYINT} |
| | | </if> |
| | | <if test="intakeId != null"> |
| | | and rasl.intake_id = #{intakeId} |
| | | <if test="intakeId != null and intakeId != '' "> |
| | | and rash.intake_id = #{intakeId} |
| | | </if> |
| | | <if test="intakeName != null"> |
| | | <if test="intakeName != null and intakeName != '' "> |
| | | and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%') |
| | | </if> |
| | | <if test="startDt != null"> |
| | |
| | | from rm_client_amount_day_last rcadl |
| | | Left join se_client sc on sc.id = rcadl.client_id |
| | | <where> |
| | | <if test="clientName != null"> |
| | | <if test="clientName != null and clientName != '' "> |
| | | and sc.name like CONCAT('%',#{clientName,jdbcType=VARCHAR},'%') |
| | | </if> |
| | | <if test="clientId != null"> |
| | | and rcadl.client_id = #{clientId} |
| | | <if test="clientId != null and clientId != ''"> |
| | | and rcad.client_id = #{clientId} |
| | | </if> |
| | | <if test="startDt != null"> |
| | | and rcadl.dt >= #{startDt,jdbcType=DATE} |
| | |
| | | from rm_client_amount_day_last rcadl |
| | | Left join se_client sc on sc.id = rcadl.client_id |
| | | <where> |
| | | <if test="clientName != null"> |
| | | <if test="clientName != null and clientName != '' "> |
| | | and sc.name like CONCAT('%',#{clientName,jdbcType=VARCHAR},'%') |
| | | </if> |
| | | <if test="clientId != null"> |
| | | and rcadl.client_id = #{clientId} |
| | | <if test="clientId != null and clientId != ''"> |
| | | and rcad.client_id = #{clientId} |
| | | </if> |
| | | <if test="startDt != null"> |
| | | and rcadl.dt >= #{startDt,jdbcType=DATE} |
| | |
| | | from rm_client_amount_day rcad |
| | | Left join se_client sc on sc.id = rcad.client_id |
| | | <where> |
| | | <if test="clientName != null"> |
| | | <if test="clientName != null and clientName != '' "> |
| | | and sc.name like CONCAT('%',#{clientName,jdbcType=VARCHAR},'%') |
| | | </if> |
| | | <if test="clientId != null"> |
| | | <if test="clientId != null and clientId != ''"> |
| | | and rcad.client_id = #{clientId} |
| | | </if> |
| | | <if test="startDt != null"> |
| | |
| | | from rm_client_amount_day rcad |
| | | Left join se_client sc on sc.id = rcad.client_id |
| | | <where> |
| | | <if test="clientName != null"> |
| | | <if test="clientName != null and clientName != '' "> |
| | | and sc.name like CONCAT('%',#{clientName,jdbcType=VARCHAR},'%') |
| | | </if> |
| | | <if test="clientId != null"> |
| | | <if test="clientId != null and clientId != ''"> |
| | | and rcad.client_id = #{clientId} |
| | | </if> |
| | | <if test="startDt != null"> |
| | |
| | | LEFT JOIN se_client cli ON cli.id = his.operator |
| | | LEFT JOIN ba_user user ON user.id = his.operator |
| | | <where> |
| | | <if test="intakeId != null"> |
| | | AND his.intake_id = #{intakeId} |
| | | </if> |
| | | <if test = "commandName != null and commandName !=''"> |
| | | AND his.command_name LIKE CONCAT('%',#{commandName},'%') |
| | | </if> |
| | |
| | | LEFT JOIN se_client cli ON cli.id = his.operator |
| | | LEFT JOIN ba_user user ON user.id = his.operator |
| | | <where> |
| | | <if test="intakeId != null"> |
| | | AND his.intake_id = #{intakeId} |
| | | </if> |
| | | <if test = "commandName != null and commandName !=''"> |
| | | AND his.command_name LIKE CONCAT('%',#{commandName},'%') |
| | | </if> |
| | |
| | | from rm_intake_amount_day_last riadl |
| | | Left join pr_intake pint on pint.id = riadl.intake_id |
| | | <where> |
| | | <if test="intakeName != null"> |
| | | and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%') |
| | | <if test="intakeId != null and intakeId != '' "> |
| | | and rash.intake_id = #{intakeId} |
| | | </if> |
| | | <if test="intakeId != null"> |
| | | and riadl.intake_id = #{intakeId} |
| | | <if test="intakeName != null and intakeName != '' "> |
| | | and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%') |
| | | </if> |
| | | <if test="startDt != null"> |
| | | and riadl.dt >= #{startDt,jdbcType=DATE} |
| | |
| | | from rm_intake_amount_day_last riadl |
| | | Left join pr_intake pint on pint.id = riadl.intake_id |
| | | <where> |
| | | <if test="intakeName != null"> |
| | | and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%') |
| | | <if test="intakeId != null and intakeId != '' "> |
| | | and rash.intake_id = #{intakeId} |
| | | </if> |
| | | <if test="intakeId != null"> |
| | | and riadl.intake_id = #{intakeId} |
| | | <if test="intakeName != null and intakeName != '' "> |
| | | and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%') |
| | | </if> |
| | | <if test="startDt != null"> |
| | | and riadl.dt >= #{startDt,jdbcType=DATE} |
| | |
| | | from rm_intake_amount_day riad |
| | | Left join pr_intake pint on pint.id = riad.intake_id |
| | | <where> |
| | | <if test="intakeName != null"> |
| | | and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%') |
| | | <if test="intakeId != null and intakeId != '' "> |
| | | and rash.intake_id = #{intakeId} |
| | | </if> |
| | | <if test="intakeId != null"> |
| | | and riad.intake_id = #{intakeId} |
| | | <if test="intakeName != null and intakeName != '' "> |
| | | and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%') |
| | | </if> |
| | | <if test="startDt != null"> |
| | | and riad.dt >= #{startDt,jdbcType=DATE} |
| | |
| | | from rm_intake_amount_day riad |
| | | Left join pr_intake pint on pint.id = riad.intake_id |
| | | <where> |
| | | <if test="intakeName != null"> |
| | | and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%') |
| | | <if test="intakeId != null and intakeId != '' "> |
| | | and rash.intake_id = #{intakeId} |
| | | </if> |
| | | <if test="intakeId != null"> |
| | | and riad.intake_id = #{intakeId} |
| | | <if test="intakeName != null and intakeName != '' "> |
| | | and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%') |
| | | </if> |
| | | <if test="startDt != null"> |
| | | and riad.dt >= #{startDt,jdbcType=DATE} |
| | |
| | | from rm_loss_day_last rldl |
| | | Left join pr_intake pint on pint.id = rldl.intake_id |
| | | <where> |
| | | <if test="intakeName != null"> |
| | | and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%') |
| | | <if test="intakeId != null and intakeId != '' "> |
| | | and rash.intake_id = #{intakeId} |
| | | </if> |
| | | <if test="intakeId != null"> |
| | | and rldl.intake_id = #{intakeId} |
| | | <if test="intakeName != null and intakeName != '' "> |
| | | and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%') |
| | | </if> |
| | | <if test="startDt != null"> |
| | | and rldl.dt >= #{startDt,jdbcType=DATE} |
| | |
| | | from rm_loss_day_last rldl |
| | | Left join pr_intake pint on pint.id = rldl.intake_id |
| | | <where> |
| | | <if test="intakeName != null"> |
| | | and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%') |
| | | <if test="intakeId != null and intakeId != '' "> |
| | | and rash.intake_id = #{intakeId} |
| | | </if> |
| | | <if test="intakeId != null"> |
| | | and rldl.intake_id = #{intakeId} |
| | | <if test="intakeName != null and intakeName != '' "> |
| | | and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%') |
| | | </if> |
| | | <if test="startDt != null"> |
| | | and rldl.dt >= #{startDt,jdbcType=DATE} |
| | |
| | | and rldl.dt <= #{endDt,jdbcType=DATE} |
| | | </if> |
| | | </where> |
| | | ORDER BY rld.dt DESC , rld.loss_amount DESC |
| | | ORDER BY rldl.dt DESC , rldl.loss_amount DESC |
| | | <if test="pageCurr != null and pageSize != null"> |
| | | LIMIT ${(pageCurr-1)*pageSize}, ${pageSize} |
| | | </if> |
| | |
| | | from rm_loss_day rld |
| | | Left join pr_intake pint on pint.id = rld.intake_id |
| | | <where> |
| | | <if test="intakeName != null"> |
| | | and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%') |
| | | <if test="intakeId != null and intakeId != '' "> |
| | | and rash.intake_id = #{intakeId} |
| | | </if> |
| | | <if test="intakeId != null"> |
| | | and rld.intake_id = #{intakeId} |
| | | <if test="intakeName != null and intakeName != '' "> |
| | | and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%') |
| | | </if> |
| | | <if test="startDt != null"> |
| | | and rld.dt >= #{startDt,jdbcType=DATE} |
| | |
| | | from rm_loss_day rld |
| | | Left join pr_intake pint on pint.id = rld.intake_id |
| | | <where> |
| | | <if test="intakeName != null"> |
| | | and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%') |
| | | <if test="intakeId != null and intakeId != '' "> |
| | | and rash.intake_id = #{intakeId} |
| | | </if> |
| | | <if test="intakeId != null"> |
| | | and rld.intake_id = #{intakeId} |
| | | <if test="intakeName != null and intakeName != '' "> |
| | | and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%') |
| | | </if> |
| | | <if test="startDt != null"> |
| | | and rld.dt >= #{startDt,jdbcType=DATE} |
| | |
| | | </trim> |
| | | </select> |
| | | |
| | | <!--获取指定时间段内未上线取水口数量--> |
| | | <select id="getNotOnlineIntakesCount" resultType="java.lang.Long"> |
| | | SELECT |
| | | COUNT(*) AS recordCount |
| | | FROM pr_intake inta |
| | | LEFT JOIN (SELECT * FROM rm_on_hour_report_history WHERE dt BETWEEN #{timeStart} AND #{timeStop}) his ON his.intake_id = inta.id |
| | | INNER JOIN ba_block blo ON blo.id = inta.blockId |
| | | WHERE his.intake_id IS NULL AND inta.deleted = 0 |
| | | |
| | | </select> |
| | | |
| | | <!--获取指定时间段内未上线的取水口--> |
| | | <select id="getNotOnlineIntakes" resultType="com.dy.pipIrrGlobal.voSt.VoIntake"> |
| | | SELECT |
| | | inta.id AS intakeId, |
| | | inta.name AS intakeNum, |
| | | blo.name AS blockName |
| | | FROM pr_intake inta |
| | | LEFT JOIN (SELECT * FROM rm_on_hour_report_history WHERE dt BETWEEN #{timeStart} AND #{timeStop}) his ON his.intake_id = inta.id |
| | | INNER JOIN ba_block blo ON blo.id = inta.blockId |
| | | WHERE his.intake_id IS NULL AND inta.deleted = 0 |
| | | ORDER BY inta.id |
| | | <trim prefix="limit " > |
| | | <if test="start != null and count != null"> |
| | | #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | |
| | | |
| | | |
| | | </mapper> |
| | |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | |
| | | <!--获取累计流量超过指定值的取水口数量--> |
| | | <select id="getLargeFlowIntakesCount" resultType="java.lang.Long"> |
| | | SELECT |
| | | COUNT(*) AS recordCount |
| | | FROM pr_intake inta |
| | | INNER JOIN rm_on_hour_report_last hou ON hou.intake_id = inta.id |
| | | INNER JOIN ba_block blo ON blo.id = inta.blockId |
| | | WHERE inta.deleted = 0 AND hou.total_amount > #{totalAmount} |
| | | </select> |
| | | |
| | | <!--获取累计流量超过指定值的取水口--> |
| | | <select id="getLargeFlowIntakes" resultType="com.dy.pipIrrGlobal.voSt.VoCumulativeFlow"> |
| | | SELECT |
| | | inta.id AS intakeId, |
| | | inta.name AS intakeNum, |
| | | blo.name AS blockName, |
| | | CAST(hou.total_amount AS DECIMAL(10, 2)) AS cumulativeFlow, |
| | | hou.dt AS getDate |
| | | FROM pr_intake inta |
| | | INNER JOIN rm_on_hour_report_last hou ON hou.intake_id = inta.id |
| | | INNER JOIN ba_block blo ON blo.id = inta.blockId |
| | | WHERE inta.deleted = 0 AND hou.total_amount > #{totalAmount} |
| | | ORDER BY hou.dt |
| | | <trim prefix="limit " > |
| | | <if test="start != null and count != null"> |
| | | #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | |
| | | <!--获取累计流量低于指定值的取水口数量--> |
| | | <select id="getSmallFlowIntakesCount" resultType="java.lang.Long"> |
| | | SELECT |
| | | COUNT(*) AS recordCount |
| | | FROM pr_intake inta |
| | | INNER JOIN rm_on_hour_report_last hou ON hou.intake_id = inta.id |
| | | INNER JOIN ba_block blo ON blo.id = inta.blockId |
| | | WHERE inta.deleted = 0 AND hou.total_amount < #{totalAmount} |
| | | </select> |
| | | |
| | | <!--获取累计流量低于指定值的取水口--> |
| | | <select id="getSmallFlowIntakes" resultType="com.dy.pipIrrGlobal.voSt.VoCumulativeFlow"> |
| | | SELECT |
| | | inta.id AS intakeId, |
| | | inta.name AS intakeNum, |
| | | blo.name AS blockName, |
| | | <!-- FORMAT(hou.total_amount,2) AS cumulativeFlow,--> |
| | | CAST(hou.total_amount AS DECIMAL(10, 2)) AS cumulativeFlow, |
| | | hou.dt AS getDate |
| | | FROM pr_intake inta |
| | | INNER JOIN rm_on_hour_report_last hou ON hou.intake_id = inta.id |
| | | INNER JOIN ba_block blo ON blo.id = inta.blockId |
| | | WHERE inta.deleted = 0 AND hou.total_amount < #{totalAmount} |
| | | ORDER BY hou.dt |
| | | <trim prefix="limit " > |
| | | <if test="start != null and count != null"> |
| | | #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | |
| | | <!--获取欠压取水口数量--> |
| | | <select id="getUnderVoltIntakesCount" resultType="java.lang.Long"> |
| | | SELECT |
| | | COUNT(*) AS recordCount |
| | | FROM pr_intake inta |
| | | INNER JOIN rm_on_hour_report_last hou ON hou.intake_id = inta.id |
| | | INNER JOIN ba_block blo ON blo.id = inta.blockId |
| | | WHERE inta.deleted = 0 AND hou.battery_volt < #{batteryVolt} |
| | | </select> |
| | | |
| | | <!--获取欠压取水口--> |
| | | <select id="getUnderVoltIntakes" resultType="com.dy.pipIrrGlobal.voSt.VoBatteryVolt"> |
| | | SELECT |
| | | inta.id AS intakeId, |
| | | inta.name AS intakeNum, |
| | | blo.name AS blockName, |
| | | hou.battery_volt AS batteryVolt, |
| | | hou.dt AS getDate |
| | | FROM pr_intake inta |
| | | INNER JOIN rm_on_hour_report_last hou ON hou.intake_id = inta.id |
| | | INNER JOIN ba_block blo ON blo.id = inta.blockId |
| | | WHERE inta.deleted = 0 AND hou.battery_volt < #{batteryVolt} |
| | | ORDER BY hou.dt |
| | | <trim prefix="limit " > |
| | | <if test="start != null and count != null"> |
| | | #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | </mapper> |
File was renamed from pipIrr-platform/pipIrr-web/pipIrr-web-operation/src/main/java/com/dy/pipIrrOperation/PipIrrWebOperationApplication.java |
| | |
| | | } |
| | | ) |
| | | @MapperScan(basePackages={"com.dy.pipIrrGlobal.daoRm", "com.dy.pipIrrGlobal.daoPr", "com.dy.pipIrrGlobal.daoSe", "com.dy.pipIrrGlobal.daoBa","com.dy.pipIrrGlobal.daoOp"}) |
| | | public class PipIrrWebOperationApplication { |
| | | public class PipIrrOperationApplication { |
| | | |
| | | public static void main(String[] args) { |
| | | SpringApplication.run(PipIrrWebOperationApplication.class, args); |
| | | SpringApplication.run(PipIrrOperationApplication.class, args); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.pojoOp.OpeFeedback; |
| | | import com.dy.pipIrrGlobal.pojoOp.OpeFeedbackReply; |
| | | import com.dy.pipIrrGlobal.voOp.Vofeedback; |
| | | import com.dy.pipIrrGlobal.voOp.VofeedbackReply; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import jakarta.validation.Valid; |
| | | import lombok.RequiredArgsConstructor; |
| | |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加问题反馈回复 |
| | | * @param reply |
| | | * @param bindingResult |
| | | * @return |
| | | */ |
| | | @PostMapping(path = "addReply", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @SsoAop |
| | | public BaseResponse<Boolean> addReply(@RequestBody @Valid OpeFeedbackReply reply, @Parameter(hidden = true) BindingResult bindingResult){ |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | Integer rec = Optional.ofNullable(feedbackSv.addReply(reply)).orElse(0); |
| | | if (rec == 0) { |
| | | return BaseResponseUtils.buildFail("添加回复失败"); |
| | | } |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | |
| | | /** |
| | | * 修改问题反馈回复 |
| | | * @param reply |
| | | * @param bindingResult |
| | | * @return |
| | | */ |
| | | @PostMapping(path = "updateReply", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> updateReply(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid OpeFeedbackReply reply, @Parameter(hidden = true) BindingResult bindingResult) { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | int count ; |
| | | try { |
| | | count = feedbackSv.updateReply(reply); |
| | | } catch (Exception e) { |
| | | log.error("修改问题反馈回复异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | if (count <= 0) { |
| | | return BaseResponseUtils.buildFail("修改反馈回复失败"); |
| | | } else { |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 删除问题反馈回复 |
| | | * @param map |
| | | * @return |
| | | */ |
| | | @PostMapping(path = "deleteReply") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> deleteReply(@RequestBody Map map) { |
| | | if (map == null || map.size() <= 0) { |
| | | return BaseResponseUtils.buildFail("请传入id"); |
| | | } |
| | | Long id = Long.parseLong(map.get("id").toString()); |
| | | try { |
| | | Integer recordCount = Optional.ofNullable(feedbackSv.deleteReply(id)).orElse(0); |
| | | if (recordCount == 0) { |
| | | return BaseResponseUtils.buildFail("删除失败"); |
| | | } else { |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("删除异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 分页查询问题反馈回复 |
| | | * @param qo |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "getFeedbackReply") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VofeedbackReply>>> getFeedbackReply(ReplyQueryVo qo) { |
| | | try { |
| | | QueryResultVo<List<VofeedbackReply>> res = feedbackSv.getFeedbackReply(qo); |
| | | if (res == null) { |
| | | return BaseResponseUtils.buildFail("查询失败"); |
| | | } |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("查询异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.daoOp.OpeFeedbackMapper; |
| | | import com.dy.pipIrrGlobal.daoOp.OpeFeedbackReplyMapper; |
| | | import com.dy.pipIrrGlobal.pojoOp.OpeFeedback; |
| | | import com.dy.pipIrrGlobal.pojoOp.OpeFeedbackReply; |
| | | import com.dy.pipIrrGlobal.voOp.Vofeedback; |
| | | import com.dy.pipIrrGlobal.voOp.VofeedbackReply; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.dubbo.common.utils.PojoUtils; |
| | |
| | | public class FeedbackSv { |
| | | @Autowired |
| | | private OpeFeedbackMapper opeFeedbackMapper; |
| | | |
| | | @Autowired |
| | | private OpeFeedbackReplyMapper opeFeedbackReplyMapper; |
| | | |
| | | /** |
| | | * 添加问题反馈 |
| | |
| | | rsVo.obj = opeFeedbackMapper.getFeedbacks(params); |
| | | return rsVo; |
| | | } |
| | | |
| | | /** |
| | | * 添加问题反馈回复 |
| | | * @param reply |
| | | * @return |
| | | */ |
| | | public Integer addReply(OpeFeedbackReply reply) { |
| | | reply.setReplyTime(new Date()); |
| | | return opeFeedbackReplyMapper.insertSelective(reply); |
| | | } |
| | | |
| | | /** |
| | | * 修改问题反馈回复 |
| | | * @param reply |
| | | * @return |
| | | */ |
| | | public int updateReply(OpeFeedbackReply reply) { |
| | | reply.setReplyTime(new Date()); |
| | | return opeFeedbackReplyMapper.updateByPrimaryKeySelective(reply); |
| | | } |
| | | |
| | | /** |
| | | * 删除问题反馈回复 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public Integer deleteReply(Long id) { |
| | | return opeFeedbackReplyMapper.deleteByPrimaryKey(id); |
| | | } |
| | | |
| | | /** |
| | | * 获取反馈回复 |
| | | * @param qo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VofeedbackReply>> getFeedbackReply(ReplyQueryVo qo) { |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo); |
| | | Long itemTotal = opeFeedbackReplyMapper.getRecordCount(params); |
| | | |
| | | QueryResultVo<List<VofeedbackReply>> rsVo = new QueryResultVo<>(); |
| | | rsVo.pageSize = qo.pageSize; |
| | | rsVo.pageCurr = qo.pageCurr; |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = opeFeedbackReplyMapper.getFeedbackReply(params); |
| | | return rsVo; |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 查询开始日期 |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date timeStart; |
| | | |
| | | /** |
| | | * 查询结束日期 |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date timeStop; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrOperation.feedback; |
| | | |
| | | import com.dy.common.webUtil.QueryConditionVo; |
| | | import lombok.*; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | | * @Date :2024/8/1 19:40 |
| | | * @LastEditTime :2024/8/1 19:40 |
| | | * @Description |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ToString(callSuper = true) |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Builder |
| | | public class ReplyQueryVo extends QueryConditionVo { |
| | | /** |
| | | * 反馈编号 |
| | | */ |
| | | private String feedbackId; |
| | | |
| | | /** |
| | | * 回复人 |
| | | */ |
| | | private String replierId; |
| | | /** |
| | | * 回复时间开始日期 |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date replyTimeStart; |
| | | |
| | | /** |
| | | * 回复时间结束日期 |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date replyTimeStop; |
| | | |
| | | } |
| | |
| | | /** |
| | | * 是否在线 |
| | | */ |
| | | @Max(value = 1,message = "是否在线仅允许为真或假") |
| | | @Min(value = 0,message = "是否在线仅允许为真或假") |
| | | |
| | | private Boolean isOnLine; |
| | | |
| | | /** |
| | | * 是否绑定 |
| | | */ |
| | | |
| | | private Boolean isBinded; |
| | | } |
| | |
| | | public class QoCommand extends QueryConditionVo { |
| | | |
| | | /** |
| | | * 取水口ID |
| | | */ |
| | | private Long intakeId; |
| | | |
| | | /** |
| | | * 命令名称 |
| | | */ |
| | | private String commandName; |
| | |
| | | }) |
| | | @GetMapping(path = "/getClientAmountDayHistory") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoClientAmountDay>>> getClientAmountDayHistory(@RequestParam ClientAmountDayQueryVo vo) { |
| | | public BaseResponse<QueryResultVo<List<VoClientAmountDay>>> getClientAmountDayHistory( ClientAmountDayQueryVo vo) { |
| | | try { |
| | | QueryResultVo<List<VoClientAmountDay>> res = clientAmountDaySv.getClientAmountDayHistory(vo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | |
| | | }) |
| | | @GetMapping(path = "/getClientAmountDayLast") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoClientAmountDay>>> getClientAmountDayLast(@RequestParam ClientAmountDayQueryVo vo) { |
| | | public BaseResponse<QueryResultVo<List<VoClientAmountDay>>> getClientAmountDayLast( ClientAmountDayQueryVo vo) { |
| | | try { |
| | | QueryResultVo<List<VoClientAmountDay>> res = clientAmountDaySv.getClientAmountDayLast(vo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | |
| | | package com.dy.pipIrrRemote.records.clientAmountDay; |
| | | |
| | | import com.dy.common.webUtil.QueryConditionVo; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.sql.Date; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | |
| | | private String clientName; |
| | | |
| | | @Schema(description = "统计开始日期", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date startDt; |
| | | |
| | | @Schema(description = "统计结束日期", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date endDt; |
| | | } |
| | |
| | | }) |
| | | @GetMapping(path = "/getControllerAlarmStateHistory") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoControllerAlarmState>>> getControllerAlarmStateHistory(@RequestParam ControllerAlarmStateQueryVo vo) { |
| | | public BaseResponse<QueryResultVo<List<VoControllerAlarmState>>> getControllerAlarmStateHistory( ControllerAlarmStateQueryVo vo) { |
| | | try { |
| | | QueryResultVo<List<VoControllerAlarmState>> res = controllerAlarmStateSv.getControllerAlarmStateHistory(vo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | |
| | | }) |
| | | @GetMapping(path = "/getControllerAlarmStateLast") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoControllerAlarmState>>> getControllerAlarmStateLast(@RequestParam ControllerAlarmStateQueryVo vo) { |
| | | public BaseResponse<QueryResultVo<List<VoControllerAlarmState>>> getControllerAlarmStateLast( ControllerAlarmStateQueryVo vo) { |
| | | try { |
| | | QueryResultVo<List<VoControllerAlarmState>> res = controllerAlarmStateSv.getControllerAlarmStateLast(vo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | |
| | | private Byte valveState; |
| | | |
| | | @Schema(description = "开始时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date startDt; |
| | | |
| | | @Schema(description = "结束时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date endDt; |
| | | |
| | | @Schema(description = "报警状态", requiredMode = Schema.RequiredMode.NOT_REQUIRED)//(0正常、1报警) |
| | |
| | | }) |
| | | @GetMapping(path = "/getIntakeAmountDayHistory") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoIntakeAmountDay>>> getIntakeAmountDayHistory(@RequestParam IntakeAmountDayQueryVo vo) { |
| | | public BaseResponse<QueryResultVo<List<VoIntakeAmountDay>>> getIntakeAmountDayHistory( IntakeAmountDayQueryVo vo) { |
| | | try { |
| | | QueryResultVo<List<VoIntakeAmountDay>> res = intakeAmountDaySv.getIntakeAmountDayHistory(vo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | |
| | | }) |
| | | @GetMapping(path = "/getIntakeAmountDayLast") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoIntakeAmountDay>>> getIntakeAmountDayLast(@RequestParam IntakeAmountDayQueryVo vo) { |
| | | public BaseResponse<QueryResultVo<List<VoIntakeAmountDay>>> getIntakeAmountDayLast( IntakeAmountDayQueryVo vo) { |
| | | try { |
| | | QueryResultVo<List<VoIntakeAmountDay>> res = intakeAmountDaySv.getIntakeAmountDayLast(vo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | |
| | | import com.dy.common.webUtil.QueryConditionVo; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | import org.apache.logging.log4j.core.config.plugins.validation.constraints.NotBlank; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.sql.Date; |
| | | import java.util.Date; |
| | | |
| | | //import java.sql.Date; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | |
| | | @Schema(description = "取水口ID") |
| | | private String intakeId; |
| | | |
| | | @Schema(description = "统计开始日期", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | // @Schema(description = "统计开始日期", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | // private java.sql.Date startDt; |
| | | // @NotBlank(message = "开始时间不能为空") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date startDt; |
| | | |
| | | @Schema(description = "统计结束日期", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | |
| | | // @Schema(description = "统计结束日期", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | // private java.sql.Date endDt; |
| | | // @NotBlank(message = "结束时间不能为空") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date endDt; |
| | | } |
| | |
| | | }) |
| | | @GetMapping(path = "/getLossDayHistory") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoLossDay>>> getLossDayHistory(@RequestParam LossDayQueryVo vo) { |
| | | public BaseResponse<QueryResultVo<List<VoLossDay>>> getLossDayHistory( LossDayQueryVo vo) { |
| | | try { |
| | | QueryResultVo<List<VoLossDay>> res = lossDaySv.getLossDayHistory(vo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | |
| | | }) |
| | | @GetMapping(path = "/getLossDayLast") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoLossDay>>> getLossDayLast(@RequestParam LossDayQueryVo vo) { |
| | | public BaseResponse<QueryResultVo<List<VoLossDay>>> getLossDayLast( LossDayQueryVo vo) { |
| | | try { |
| | | QueryResultVo<List<VoLossDay>> res = lossDaySv.getLossDayLast(vo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | |
| | | package com.dy.pipIrrRemote.records.lossDay; |
| | | |
| | | import com.dy.common.webUtil.QueryConditionVo; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.sql.Date; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | |
| | | private String intakeId; |
| | | |
| | | @Schema(description = "统计开始日期", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date startDt; |
| | | |
| | | @Schema(description = "统计结束日期", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date endDt; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrStatistics.config; |
| | | |
| | | import com.dy.common.webFilter.DevOfDataSourceNameSetFilter; |
| | | import com.dy.common.webFilter.UserTokenFilter; |
| | | import jakarta.servlet.Filter; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.boot.web.servlet.FilterRegistrationBean; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023/12/5 10:32 |
| | | * @LastEditTime 2023/12/5 10:32 |
| | | * @Description |
| | | */ |
| | | @Configuration |
| | | public class WebFilterConfiguration { |
| | | |
| | | @Value("${pipIrr.global.dev}") |
| | | public String isDevStage ;//是否为开发阶段 |
| | | @Value("${pipIrr.global.dsName}") |
| | | public String dsName ;//开发阶段的数据源名称 |
| | | |
| | | /** |
| | | * DevOfDataSourceNameSetFilter与UserTokenFilter只能一个被配置上, |
| | | * 所以他们的order都是1 |
| | | */ |
| | | private static final int order_UserTokenFilter = 1 ;//与下面 |
| | | private static final int order_DevOfDataSourceNameSetFilter = 1 ; |
| | | |
| | | |
| | | @Bean |
| | | public FilterRegistrationBean<? extends Filter> RegFilter() { |
| | | FilterRegistrationBean<Filter> filterRegistrationBean = new FilterRegistrationBean<>(); |
| | | if(this.isDevStage != null && !this.isDevStage.trim().equals("") && this.isDevStage.trim().equalsIgnoreCase("true")){ |
| | | filterRegistrationBean.setFilter(new DevOfDataSourceNameSetFilter()); |
| | | filterRegistrationBean.addUrlPatterns("/*");//配置过滤规则 |
| | | filterRegistrationBean.addInitParameter("dataSourceName",dsName);//设置init参数 |
| | | filterRegistrationBean.setName("DevOfDataSourceNameSetFilter");//设置过滤器名称 |
| | | filterRegistrationBean.setOrder(order_DevOfDataSourceNameSetFilter);//执行次序 |
| | | }else{ |
| | | filterRegistrationBean.setFilter(new UserTokenFilter()); |
| | | filterRegistrationBean.addUrlPatterns("/*");//配置过滤规则 |
| | | filterRegistrationBean.setName("UserTokenFilter");//设置过滤器名称 |
| | | filterRegistrationBean.setOrder(order_UserTokenFilter);//执行次序 |
| | | } |
| | | return filterRegistrationBean; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrStatistics.config; |
| | | |
| | | import com.dy.common.webListener.GenerateIdSetSuffixListener; |
| | | import jakarta.servlet.ServletContextListener; |
| | | import org.springframework.boot.web.servlet.ServletListenerRegistrationBean; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023/12/5 10:33 |
| | | * @LastEditTime 2023/12/5 10:33 |
| | | * @Description |
| | | */ |
| | | @Configuration |
| | | public class WebListenerConfiguration { |
| | | |
| | | /** |
| | | * 启动顺序 |
| | | */ |
| | | //private static final int order_config = 0 ; |
| | | private static final int order_idSetSuffix = 1 ; |
| | | //private static final int order_init = 2 ; |
| | | |
| | | /* |
| | | * 解析各种***.config配置的ConfigListener,暂时不采用此种配置方式 |
| | | * |
| | | @Bean |
| | | public ConfigListener getGlConfigListener(){ |
| | | return new ConfigListener() ; |
| | | } |
| | | /** |
| | | * 外部提供Listener |
| | | * @param listener 外部提供Listener |
| | | * @return 注册Bean |
| | | @Bean |
| | | public ServletListenerRegistrationBean<? extends ServletContextListener> regConfigListener(ConfigListener listener) { |
| | | ServletListenerRegistrationBean<ConfigListener> listenerRegistrationBean = new ServletListenerRegistrationBean<>(); |
| | | listenerRegistrationBean.setListener(listener); |
| | | listenerRegistrationBean.setOrder(order_config); |
| | | return listenerRegistrationBean; |
| | | } |
| | | */ |
| | | |
| | | /** |
| | | * 内部提供listener,该listener在系统启动时,根据配置 设置ID产生器的后缀 |
| | | * @return 注册Bean |
| | | */ |
| | | @Bean |
| | | public ServletListenerRegistrationBean<? extends ServletContextListener> regSsoListener() { |
| | | ServletListenerRegistrationBean<GenerateIdSetSuffixListener> listenerRegistrationBean = new ServletListenerRegistrationBean<>(); |
| | | listenerRegistrationBean.setListener(new GenerateIdSetSuffixListener()); |
| | | listenerRegistrationBean.setOrder(order_idSetSuffix); |
| | | return listenerRegistrationBean; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrStatistics.intake; |
| | | |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.daoRm.RmOnHourReportHistoryMapper; |
| | | import com.dy.pipIrrGlobal.daoRm.RmOnHourReportLastMapper; |
| | | import com.dy.pipIrrGlobal.voSt.VoBatteryVolt; |
| | | import com.dy.pipIrrGlobal.voSt.VoCumulativeFlow; |
| | | import com.dy.pipIrrGlobal.voSt.VoIntake; |
| | | import com.dy.pipIrrStatistics.intake.qo.BatteryVoltQO; |
| | | import com.dy.pipIrrStatistics.intake.qo.CumulativeFlowQO; |
| | | import com.dy.pipIrrStatistics.intake.qo.IntakeQO; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.dubbo.common.utils.PojoUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.text.DecimalFormat; |
| | | import java.time.LocalDate; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Optional; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-08-01 13:58 |
| | | * @LastEditTime 2024-08-01 13:58 |
| | | * @Description |
| | | */ |
| | | |
| | | @Slf4j |
| | | @Service |
| | | public class IntakeSv { |
| | | @Autowired |
| | | private RmOnHourReportHistoryMapper rmOnHourReportHistoryMapper; |
| | | @Autowired |
| | | private RmOnHourReportLastMapper rmOnHourReportLastMapper; |
| | | |
| | | @Value("${rtu.batteryVolt}") |
| | | private Double batteryVolt; |
| | | |
| | | /** |
| | | * 获取指定时间段内未上线的取水口 |
| | | * @param qo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoIntake>> getNotOnlineIntakes(IntakeQO qo) { |
| | | DecimalFormat df = new DecimalFormat("0.00"); |
| | | /** |
| | | * 补齐起止时间,如果开始时间为空,则默认为当前日期 |
| | | */ |
| | | String timeStart = qo.getTimeStart(); |
| | | String timeStop = qo.getTimeStop(); |
| | | if(timeStart != null) { |
| | | timeStart = timeStart + " 00:00:00"; |
| | | }else { |
| | | timeStart = LocalDate.now() + " 00:00:00"; |
| | | } |
| | | if(timeStop != null) { |
| | | timeStop = timeStop + " 23:59:59"; |
| | | } |
| | | qo.setTimeStart(timeStart); |
| | | qo.setTimeStop(timeStop); |
| | | |
| | | // 生成查询参数 |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo) ; |
| | | |
| | | // 获取符合条件的记录数 |
| | | Long itemTotal = Optional.ofNullable(rmOnHourReportHistoryMapper.getNotOnlineIntakesCount(params)).orElse(0L); |
| | | |
| | | QueryResultVo<List<VoIntake>> rsVo = new QueryResultVo<>() ; |
| | | |
| | | rsVo.pageSize = qo.pageSize ; |
| | | rsVo.pageCurr = qo.pageCurr ; |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = rmOnHourReportHistoryMapper.getNotOnlineIntakes(params); |
| | | return rsVo ; |
| | | } |
| | | |
| | | /** |
| | | * 获取累计流量超过指定值的取水口 |
| | | * @param qo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoCumulativeFlow>> getLargeFlowIntakes(CumulativeFlowQO qo) { |
| | | // 生成查询参数 |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo) ; |
| | | |
| | | // 获取符合条件的记录数 |
| | | Long itemTotal = Optional.ofNullable(rmOnHourReportLastMapper.getLargeFlowIntakesCount(params)).orElse(0L); |
| | | |
| | | QueryResultVo<List<VoCumulativeFlow>> rsVo = new QueryResultVo<>() ; |
| | | |
| | | rsVo.pageSize = qo.pageSize ; |
| | | rsVo.pageCurr = qo.pageCurr ; |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = rmOnHourReportLastMapper.getLargeFlowIntakes(params); |
| | | return rsVo ; |
| | | } |
| | | |
| | | /** |
| | | * 获取累计流量低于指定值的取水口 |
| | | * @param qo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoCumulativeFlow>> getSmallFlowIntakes(CumulativeFlowQO qo) { |
| | | // 生成查询参数 |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo) ; |
| | | |
| | | // 获取符合条件的记录数 |
| | | Long itemTotal = Optional.ofNullable(rmOnHourReportLastMapper.getSmallFlowIntakesCount(params)).orElse(0L); |
| | | |
| | | QueryResultVo<List<VoCumulativeFlow>> rsVo = new QueryResultVo<>() ; |
| | | |
| | | rsVo.pageSize = qo.pageSize ; |
| | | rsVo.pageCurr = qo.pageCurr ; |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = rmOnHourReportLastMapper.getSmallFlowIntakes(params); |
| | | return rsVo ; |
| | | } |
| | | |
| | | /** |
| | | * 获取欠压取水口 |
| | | * @param qo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoBatteryVolt>> getUnderVoltIntakes(BatteryVoltQO qo) { |
| | | qo.setBatteryVolt(batteryVolt); |
| | | // 生成查询参数 |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo) ; |
| | | |
| | | // 获取符合条件的记录数 |
| | | Long itemTotal = Optional.ofNullable(rmOnHourReportLastMapper.getUnderVoltIntakesCount(params)).orElse(0L); |
| | | |
| | | QueryResultVo<List<VoBatteryVolt>> rsVo = new QueryResultVo<>() ; |
| | | |
| | | rsVo.pageSize = qo.pageSize ; |
| | | rsVo.pageCurr = qo.pageCurr ; |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = rmOnHourReportLastMapper.getUnderVoltIntakes(params); |
| | | return rsVo ; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrStatistics.intake; |
| | | |
| | | import com.dy.common.aop.SsoAop; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.voSt.VoBatteryVolt; |
| | | import com.dy.pipIrrGlobal.voSt.VoCumulativeFlow; |
| | | import com.dy.pipIrrGlobal.voSt.VoIntake; |
| | | import com.dy.pipIrrStatistics.intake.qo.BatteryVoltQO; |
| | | import com.dy.pipIrrStatistics.intake.qo.CumulativeFlowQO; |
| | | import com.dy.pipIrrStatistics.intake.qo.IntakeQO; |
| | | import com.dy.pipIrrStatistics.result.StatisticlResultCode; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-08-01 13:57 |
| | | * @LastEditTime 2024-08-01 13:57 |
| | | * @Description |
| | | */ |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping(path="statistics") |
| | | @RequiredArgsConstructor |
| | | public class IntkeCtrl { |
| | | private final IntakeSv intakeSv; |
| | | |
| | | /** |
| | | * 获取指定时间段内未上线的取水口 |
| | | * @param qo |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "/getNotOnlineIntakes") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoIntake>>> getNotOnlineIntakes(IntakeQO qo) { |
| | | try { |
| | | QueryResultVo<List<VoIntake>> res = intakeSv.getNotOnlineIntakes(qo); |
| | | if(res.itemTotal == 0) { |
| | | return BaseResponseUtils.buildErrorMsg(StatisticlResultCode.NO_RECORDS.getMessage()); |
| | | } |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("获取开卡记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取累计流量超过指定值的取水口 |
| | | * @param qo |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "/getLargeFlowIntakes") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoCumulativeFlow>>> getLargeFlowIntakes(CumulativeFlowQO qo) { |
| | | try { |
| | | QueryResultVo<List<VoCumulativeFlow>> res = intakeSv.getLargeFlowIntakes(qo); |
| | | if(res.itemTotal == 0) { |
| | | return BaseResponseUtils.buildErrorMsg(StatisticlResultCode.NO_RECORDS.getMessage()); |
| | | } |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("获取开卡记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取累计流量低于指定值的取水口 |
| | | * @param qo |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "/getSmallFlowIntakes") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoCumulativeFlow>>> getSmallFlowIntakes(CumulativeFlowQO qo) { |
| | | try { |
| | | QueryResultVo<List<VoCumulativeFlow>> res = intakeSv.getSmallFlowIntakes(qo); |
| | | if(res.itemTotal == 0) { |
| | | return BaseResponseUtils.buildErrorMsg(StatisticlResultCode.NO_RECORDS.getMessage()); |
| | | } |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("获取开卡记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取欠压取水口 |
| | | * @param qo |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "/getUnderVoltIntakes") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoBatteryVolt>>> getUnderVoltIntakes(BatteryVoltQO qo) { |
| | | try { |
| | | QueryResultVo<List<VoBatteryVolt>> res = intakeSv.getUnderVoltIntakes(qo); |
| | | if(res.itemTotal == 0) { |
| | | return BaseResponseUtils.buildErrorMsg(StatisticlResultCode.NO_RECORDS.getMessage()); |
| | | } |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("获取开卡记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrStatistics.intake.qo; |
| | | |
| | | import com.dy.common.webUtil.QueryConditionVo; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-08-03 10:47 |
| | | * @LastEditTime 2024-08-03 10:47 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | public class BatteryVoltQO extends QueryConditionVo { |
| | | |
| | | /** |
| | | * 电池电压 |
| | | */ |
| | | private Double batteryVolt; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrStatistics.intake.qo; |
| | | |
| | | import com.dy.common.webUtil.QueryConditionVo; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-08-01 16:20 |
| | | * @LastEditTime 2024-08-01 16:20 |
| | | * @Description 累计流量查询对象 |
| | | */ |
| | | |
| | | @Data |
| | | public class CumulativeFlowQO extends QueryConditionVo { |
| | | |
| | | /** |
| | | * 累计流量 |
| | | */ |
| | | private Double totalAmount; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrStatistics.intake.qo; |
| | | |
| | | import com.dy.common.webUtil.QueryConditionVo; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import jakarta.validation.constraints.NotBlank; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-08-01 14:31 |
| | | * @LastEditTime 2024-08-01 14:31 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | public class IntakeQO extends QueryConditionVo { |
| | | |
| | | /** |
| | | * 开始时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private String timeStart; |
| | | |
| | | /** |
| | | * 结束时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @NotBlank(message = "结束时间不能为空") |
| | | private String timeStop; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrStatistics.result; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-08-01 15:03 |
| | | * @LastEditTime 2024-08-01 15:03 |
| | | * @Description |
| | | */ |
| | | |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum StatisticlResultCode { |
| | | NO_RECORDS(10001, "没有符合条件的记录"); |
| | | |
| | | private final Integer code; |
| | | private final String message; |
| | | } |