1、优化”时段未曾开阀“功能实现;
2、”截止时间“改为”结束时间“
10个文件已修改
1个文件已添加
198 ■■■■■ 已修改文件
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmClientAmountDayMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmIntakeAmountDayMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmLossDayMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmOpenCloseValveHistoryMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoIntakeUnOpenValve.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveHistoryMapper.xml 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/common/qo/QoCommand.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/qo/QoTransaction.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/qo/QoTransactionStatistics.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntakeSv.java 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntkeCtrl.java 84 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmClientAmountDayMapper.java
@@ -93,7 +93,7 @@
    /**
     * 以农户维度统计用水量及费用
     * @param statisticsStartId 统计时间段开始时间对应的ID
     * @param statisticsEndId 统计时间段截止时间对应的ID
     * @param statisticsEndId 统计时间段结束时间对应的ID
     * @return
     */
    List<VoClientAmountStatistics> statisticsByClient(@Param("startId")Long statisticsStartId, @Param("endId")Long statisticsEndId) ;
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmIntakeAmountDayMapper.java
@@ -85,7 +85,7 @@
    /**
     * 以取水口维度统计取水口取水量
     * @param statisticsStartId 统计时间段开始时间对应的ID
     * @param statisticsEndId 统计时间段截止时间对应的ID
     * @param statisticsEndId 统计时间段结束时间对应的ID
     * @return
     */
    List<VoIntakeAmountStatistics> statisticsByIntake(@Param("startId")Long statisticsStartId, @Param("endId")Long statisticsEndId) ;
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmLossDayMapper.java
@@ -94,7 +94,7 @@
    /**
     * 以取水口维度统计漏损量
     * @param statisticsStartId 统计时间段开始时间对应的ID
     * @param statisticsEndId 统计时间段截止时间对应的ID
     * @param statisticsEndId 统计时间段结束时间对应的ID
     * @return
     */
    List<VoIntakeLossStatistics> statisticsByIntake(@Param("startId")Long statisticsStartId, @Param("endId")Long statisticsEndId) ;
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmOpenCloseValveHistoryMapper.java
@@ -95,7 +95,7 @@
     * @param params
     * @return
     */
    List<VoIntake> getNeverOpenValveIntakes(Map<?, ?> params);
    List<VoIntakeUnOpenValve> getNeverOpenValveIntakes(Map<?, ?> params);
    /**
     * 获取指定时间段内开阀次数超过指定值的取水口数量
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoIntakeUnOpenValve.java
New file
@@ -0,0 +1,24 @@
package com.dy.pipIrrGlobal.voSt;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
 * @author :WuZeYu
 * @Date :2024/10/11  9:45
 * @LastEditTime :2024/10/11  9:45
 * @Description
 */
@Data
@JsonPropertyOrder({ "intakeId", "intakeNum", "blockName", "lng", "lat"
        ,"rtuAddr"
})
@EqualsAndHashCode(callSuper=false)
public class VoIntakeUnOpenValve extends VoIntake{
    /**
     * 阀控器地址
     */
    public String rtuAddr;
}
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveHistoryMapper.xml
@@ -553,30 +553,50 @@
            </if>
        </trim>
    </select>
    <!--获取指定时间段内从未开过阀的取水口数量-->
    <select id="getNeverOpenValveIntakesCount" resultType="java.lang.Long">
        SELECT COUNT(*) AS recordCount
        FROM pr_intake inta
                 INNER JOIN ba_block blo ON blo.id = inta.blockId
        WHERE inta.deleted = 0
          AND NOT EXISTS(SELECT *
                         FROM rm_open_close_valve_history
                         WHERE op_dt BETWEEN #{timeStart} AND #{timeStop}
                           AND intake_id = inta.id)
        LEFT JOIN
        (SELECT intake_id FROM rm_on_hour_report_history
        <where>
            <if test = "idStart != null">
                id <![CDATA[>=]]> #{idStart}
            </if>
            <if test = "idEnd != null">
                AND id <![CDATA[<=]]> #{idEnd}
            </if>
        </where>) his
        ON his.intake_id = inta.id
        LEFT JOIN ba_block blo ON blo.id = inta.blockId
        LEFT JOIN pr_controller pct ON inta.id = pct.intakeId
        WHERE his.intake_id IS NULL AND inta.deleted = 0
    </select>
    <!--获取指定时间段内从未开过阀的取水口-->
    <select id="getNeverOpenValveIntakes" resultType="com.dy.pipIrrGlobal.voSt.VoIntake">
    <select id="getNeverOpenValveIntakes" resultType="com.dy.pipIrrGlobal.voSt.VoIntakeUnOpenValve">
        SELECT inta.id   AS intakeId,
               inta.name AS intakeNum,
               blo.name  AS blockName
               inta.lng     AS lng,
               inta.lat     AS lat,
               blo.name     AS blockName,
               pct.rtuAddr  AS rtuAddr
        FROM pr_intake inta
                 INNER JOIN ba_block blo ON blo.id = inta.blockId
        WHERE inta.deleted = 0
          AND NOT EXISTS(SELECT *
                         FROM rm_open_close_valve_history
                         WHERE op_dt BETWEEN #{timeStart} AND #{timeStop}
                           AND intake_id = inta.id)
        ORDER BY inta.id
        LEFT JOIN
        (SELECT intake_id FROM rm_on_hour_report_history
        <where>
            <if test = "idStart != null">
                id <![CDATA[>=]]> #{idStart}
            </if>
            <if test = "idEnd != null">
                AND id <![CDATA[<=]]> #{idEnd}
            </if>
        </where>) his
        ON his.intake_id = inta.id
        LEFT JOIN ba_block blo ON blo.id = inta.blockId
        LEFT JOIN pr_controller pct ON inta.id = pct.intakeId
        WHERE his.intake_id IS NULL AND inta.deleted = 0
        ORDER BY inta.id DESC
        <trim prefix="limit ">
            <if test="start != null and count != null">
                #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/common/qo/QoCommand.java
@@ -39,7 +39,7 @@
    private String timeStart;
    /**
     * 查询截止时间
     * 查询结束时间
     */
    private String timeStop;
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/qo/QoTransaction.java
@@ -28,7 +28,7 @@
    @Schema(description = "交易查询起始时间")
    public String operateTimeStart;
    @Schema(description = "交易查询截止时间")
    @Schema(description = "交易查询结束时间")
    public String operateTimeStop;
    @Schema(description = "收银员ID")
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/qo/QoTransactionStatistics.java
@@ -22,6 +22,6 @@
    @Schema(description = "交易查询起始时间")
    public String operateTimeStart;
    @Schema(description = "交易查询截止时间")
    @Schema(description = "交易查询结束时间")
    public String operateTimeStop;
}
pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntakeSv.java
@@ -185,33 +185,21 @@
    /**
     * 获取从未开过阀的取水口
     * @param qo
     * @param idStart
     * @param idEnd
     * @return
     */
    public QueryResultVo<List<VoIntake>> getNeverOpenValveIntakes(CommonQO qo) {
        String timeStart = qo.getTimeStart();
        String timeStop = qo.getTimeStop();
        if(timeStart != null && timeStart != "") {
            timeStart = timeStart + " 00:00:00";
        } else {
            timeStart = LocalDate.now() + " 00:00:00";
        }
        qo.setTimeStart(timeStart);
        if(timeStop != null && timeStop != "") {
            timeStop = timeStop + " 23:59:59";
        }else {
            timeStop = LocalDate.now() + " 23:59:59";
        }
        qo.setTimeStop(timeStop);
    public QueryResultVo<List<VoIntakeUnOpenValve>> getNeverOpenValveIntakes(CommonQO qo, Long idStart, Long idEnd) {
        // 生成查询参数
        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo) ;
        params.put("idStart", idStart) ;
        params.put("idEnd", idEnd) ;
        // 获取符合条件的记录数
        Long itemTotal = Optional.ofNullable(rmOpenCloseValveHistoryMapper.getNeverOpenValveIntakesCount(params)).orElse(0L);
        QueryResultVo<List<VoIntake>> rsVo = new QueryResultVo<>() ;
        QueryResultVo<List<VoIntakeUnOpenValve>> rsVo = new QueryResultVo<>() ;
        rsVo.pageSize = qo.pageSize ;
        rsVo.pageCurr = qo.pageCurr ;
pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntkeCtrl.java
@@ -63,7 +63,7 @@
        }
        if(startId != null && endId != null){
            if(endId < startId){
                return BaseResponseUtils.buildErrorMsg("截止时间不能早于开始时间");
                return BaseResponseUtils.buildErrorMsg("结束时间不能早于开始时间");
            }
        }
        try {
@@ -97,6 +97,47 @@
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
    }
    /** ok 113
     * 获取从未开过阀的取水口
     * @param
     * @return
     */
    @GetMapping(path = "/getNeverOpenValveIntakes")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoIntakeUnOpenValve>>> getNeverOpenValveIntakes(@Valid CommonQO qo, BindingResult bindingResult) {
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
        String timeStart = qo.getTimeStart();
        String timeStop = qo.getTimeStop();
        Long startId = null ;
        Long endId = null ;
        if(timeStart != null && !timeStart.trim().equals("")){
            int[] ymdStart = DateTime.yyyy_MM_dd_2_ymdGroup(timeStart) ;
            startId = IDLongGenerator.generateOneDayStartId(ymdStart[0], ymdStart[1], ymdStart[2]) ;
        }
        if(timeStop != null && !timeStop.trim().equals("")){
            int[] ymdEnd = DateTime.yyyy_MM_dd_2_ymdGroup(timeStop) ;
            endId = IDLongGenerator.generateOneDayStartId(ymdEnd[0], ymdEnd[1], ymdEnd[2]) ;
        }
        if(startId != null && endId != null){
            if(endId < startId){
                return BaseResponseUtils.buildErrorMsg("结束时间不能早于开始时间");
            }
        }
        try {
            QueryResultVo<List<VoIntakeUnOpenValve>> res = intakeSv.getNeverOpenValveIntakes(qo, startId, endId) ;
            return BaseResponseUtils.buildSuccess(res);
        } catch (Exception e) {
            log.error("获取记录异常", e);
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
    }
    /** ok 1
     * 获取累计流量超过指定值的取水口
     * @param qo
@@ -190,11 +231,11 @@
            return BaseResponseUtils.buildErrorMsg("请设置查询开始时间");
        }
        if(timeStop == null || timeStop.trim().equals("")){
            return BaseResponseUtils.buildErrorMsg("请设置查询截止时间");
            return BaseResponseUtils.buildErrorMsg("请设置查询结束时间");
        }
        long dur = DateTime.daysBetweenyyyy_MM_dd(timeStop, timeStart) ;
        if(dur < 0){
            return BaseResponseUtils.buildErrorMsg("截止时间不能早于开始时间");
            return BaseResponseUtils.buildErrorMsg("结束时间不能早于开始时间");
        }
        if(dur > 366){
            return BaseResponseUtils.buildErrorMsg("时间跨度不能超过一年");
@@ -228,11 +269,11 @@
            return BaseResponseUtils.buildErrorMsg("请设置查询开始时间");
        }
        if(timeStop == null || timeStop.trim().equals("")){
            return BaseResponseUtils.buildErrorMsg("请设置查询截止时间");
            return BaseResponseUtils.buildErrorMsg("请设置查询结束时间");
        }
        long dur = DateTime.daysBetweenyyyy_MM_dd(timeStop, timeStart) ;
        if(dur < 0){
            return BaseResponseUtils.buildErrorMsg("截止时间不能早于开始时间");
            return BaseResponseUtils.buildErrorMsg("结束时间不能早于开始时间");
        }
        if(dur > 366){
            return BaseResponseUtils.buildErrorMsg("时间跨度不能超过一年");
@@ -266,11 +307,11 @@
            return BaseResponseUtils.buildErrorMsg("请设置查询开始时间");
        }
        if(timeStop == null || timeStop.trim().equals("")){
            return BaseResponseUtils.buildErrorMsg("请设置查询截止时间");
            return BaseResponseUtils.buildErrorMsg("请设置查询结束时间");
        }
        long dur = DateTime.daysBetweenyyyy_MM_dd(timeStop, timeStart) ;
        if(dur < 0){
            return BaseResponseUtils.buildErrorMsg("截止时间不能早于开始时间");
            return BaseResponseUtils.buildErrorMsg("结束时间不能早于开始时间");
        }
        if(dur > 366){
            return BaseResponseUtils.buildErrorMsg("时间跨度不能超过一年");
@@ -305,11 +346,11 @@
            return BaseResponseUtils.buildErrorMsg("请设置查询开始时间");
        }
        if(timeStop == null || timeStop.trim().equals("")){
            return BaseResponseUtils.buildErrorMsg("请设置查询截止时间");
            return BaseResponseUtils.buildErrorMsg("请设置查询结束时间");
        }
        long dur = DateTime.daysBetweenyyyy_MM_dd(timeStop, timeStart) ;
        if(dur < 0){
            return BaseResponseUtils.buildErrorMsg("截止时间不能早于开始时间");
            return BaseResponseUtils.buildErrorMsg("结束时间不能早于开始时间");
        }
        if(dur > 366){
            return BaseResponseUtils.buildErrorMsg("时间跨度不能超过一年");
@@ -327,23 +368,6 @@
        }
    }
    /**
     * 获取从未开过阀的取水口
     * @param
     * @return
     */
    @GetMapping(path = "/getNeverOpenValveIntakes")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoIntake>>> getNeverOpenValveIntakes(CommonQO qo) {
        try {
            QueryResultVo<List<VoIntake>> res = intakeSv.getNeverOpenValveIntakes(qo);
            return BaseResponseUtils.buildSuccess(res);
        } catch (Exception e) {
            log.error("获取记录异常", e);
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
    }
    /**
     * 指定时间段内累积流量(定时报里的累积流量)超过指定值的取水口
@@ -444,11 +468,11 @@
            return BaseResponseUtils.buildErrorMsg("请设置查询开始时间");
        }
        if(timeStop == null || timeStop.trim().equals("")){
            return BaseResponseUtils.buildErrorMsg("请设置查询截止时间");
            return BaseResponseUtils.buildErrorMsg("请设置查询结束时间");
        }
        long dur = DateTime.daysBetweenyyyy_MM_dd(timeStop, timeStart) ;
        if(dur < 0){
            return BaseResponseUtils.buildErrorMsg("截止时间不能早于开始时间");
            return BaseResponseUtils.buildErrorMsg("结束时间不能早于开始时间");
        }
        if(dur > 366){
            return BaseResponseUtils.buildErrorMsg("时间跨度不能超过一年");
@@ -480,11 +504,11 @@
            return BaseResponseUtils.buildErrorMsg("请设置查询开始时间");
        }
        if(timeStop == null || timeStop.trim().equals("")){
            return BaseResponseUtils.buildErrorMsg("请设置查询截止时间");
            return BaseResponseUtils.buildErrorMsg("请设置查询结束时间");
        }
        long dur = DateTime.daysBetweenyyyy_MM_dd(timeStop, timeStart) ;
        if(dur < 0){
            return BaseResponseUtils.buildErrorMsg("截止时间不能早于开始时间");
            return BaseResponseUtils.buildErrorMsg("结束时间不能早于开始时间");
        }
        if(dur > 366){
            return BaseResponseUtils.buildErrorMsg("时间跨度不能超过一年");