liurunyu
2024-07-25 7af935e6a092193adf309f3a2d700f049b4b63d8
解决冲突
26个文件已修改
20个文件已添加
2个文件已删除
2125 ■■■■■ 已修改文件
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmIntakeAmountDayLastMapper.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmIntakeAmountDayMapper.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmLossDayLastMapper.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmLossDayMapper.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmOnHourReportHistoryMapper.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeManagerCardMapper.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSt/StIntakeAmountMonthMapper.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmLossDay.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmLossDayLast.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeManagerCard.java 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voRm/VoIntakeAmountDay.java 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voRm/VoLossDay.java 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voRm/VoOnHour.java 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/application-global.yml 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmAlarmStateHistoryMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmAlarmStateLastMapper.xml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmClientAmountDayLastMapper.xml 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmClientAmountDayMapper.xml 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmIntakeAmountDayLastMapper.xml 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmIntakeAmountDayMapper.xml 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmLossDayLastMapper.xml 83 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmLossDayMapper.xml 91 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOnHourReportHistoryMapper.xml 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeManagerCardMapper.xml 124 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/ClientAmountDayQueryVo.java 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/ControllerAlarmStateQueryVo.java 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/RecordsCtrl.java 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/RecordsSv.java 58 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/clientAmountDay/ClientAmountDayCtrl.java 96 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/clientAmountDay/ClientAmountDaySv.java 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/controllerAlarmState/ControllerAlarmStateCtrl.java 97 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/controllerAlarmState/ControllerAlarmStateSv.java 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/intakeAmountDay/IntakeAmountDayCtrl.java 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/intakeAmountDay/IntakeAmountDayQueryVo.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/intakeAmountDay/IntakeAmountDaySv.java 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/lossDay/LossDayCtrl.java 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/lossDay/LossDayQueryVo.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/lossDay/LossDaySv.java 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/report/ReportCtrl.java 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/report/ReportSv.java 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/report/qo/ReportQO.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/CardOperateCtrl.java 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/CardOperateSv.java 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/dto/ManagerCard.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/result/SellResultCode.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/statistics/StClient.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/statistics/StIntakeSv.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/statistics/StatisticsJob.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmIntakeAmountDayLastMapper.java
@@ -2,9 +2,11 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dy.pipIrrGlobal.pojoRm.RmIntakeAmountDayLast;
import com.dy.pipIrrGlobal.voRm.VoIntakeAmountDay;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
/**
 * @Author: liurunyu
@@ -61,4 +63,18 @@
     * @return update count
     */
    int updateByPrimaryKey(RmIntakeAmountDayLast record);
    /**
     * 根据指定条件获取记录总数
     * @param params
     * @return
     */
    Long getRecordCount(Map<?, ?> params);
    /**
     * 根据指定条件获取记录
     * @param params
     * @return
     */
    List<VoIntakeAmountDay> getIntakeAmountDayLast(Map<?, ?> params);
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmIntakeAmountDayMapper.java
@@ -2,6 +2,7 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dy.pipIrrGlobal.pojoRm.RmIntakeAmountDay;
import com.dy.pipIrrGlobal.voRm.VoIntakeAmountDay;
import com.dy.pipIrrGlobal.voSt.VoIntakeAmountStatistics;
import com.dy.pipIrrGlobal.voSt.VoIntakeLossStatistics;
import org.apache.ibatis.annotations.Mapper;
@@ -9,6 +10,7 @@
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 * @Author: liurunyu
@@ -66,14 +68,27 @@
     */
    int updateByPrimaryKey(RmIntakeAmountDay record);
    /**
     * 根据指定条件获取记录总数
     * @param params
     * @return
     */
    Long getRecordCount(Map<?, ?> params);
    /**
     * 以取水口维度统计取水量
     * 根据指定条件获取记录
     * @param params
     * @return
     */
    List<VoIntakeAmountDay> getIntakeAmountDayHistory(Map<?, ?> params);
    /**
     * 以取水口维度统计取水口取水量
     * @param statisticsStartId 统计时间段开始时间对应的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/RmLossDayLastMapper.java
@@ -1,11 +1,15 @@
package com.dy.pipIrrGlobal.daoRm;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dy.pipIrrGlobal.voRm.VoLossDay;
import com.dy.pipIrrGlobal.voSt.VoIntakeLossStatistics;
import com.dy.pipIrrGlobal.pojoRm.RmLossDayLast;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 * @Author liurunyu
@@ -69,4 +73,21 @@
     * @return update count
     */
    int updateByPrimaryKey(RmLossDayLast record);
    /**
     * 根据指定条件获取记录总数
     * @param params
     * @return
     */
    Long getRecordCount(Map<?, ?> params);
    /**
     * 根据指定条件获取记录
     * @param params
     * @return
     */
    List<VoLossDay> getLossDayLast(Map<?, ?> params);
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmLossDayMapper.java
@@ -2,12 +2,14 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dy.pipIrrGlobal.pojoRm.RmLossDay;
import com.dy.pipIrrGlobal.voRm.VoLossDay;
import com.dy.pipIrrGlobal.voSt.VoIntakeLossStatistics;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 * @Author liurunyu
@@ -46,6 +48,13 @@
    RmLossDay selectByPrimaryKey(Long id);
    /**
     * select by rtuAddr
     * @param intakeId 控制器所绑取水口ID
     * @return object by rtuAddr
     */
    List<RmLossDay> selectByIntakeId(Long intakeId) ;
   /**
    /**
     * select by dt
     * @param date 日期(yyyy-mm-dd)
     * @return object by rtuAddr
@@ -67,12 +76,25 @@
    int updateByPrimaryKey(RmLossDay record);
    /**
     * 根据指定条件获取记录总数
     * @param params
     * @return
     */
    Long getRecordCount(Map<?, ?> params);
    /**
     * 根据指定条件获取记录
     * @param params
     * @return
     */
    List<VoLossDay> getLossDayHistory(Map<?, ?> params);
    /**
     * 以取水口维度统计漏损量
     * @param statisticsStartId 统计时间段开始时间对应的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/RmOnHourReportHistoryMapper.java
@@ -2,8 +2,11 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dy.pipIrrGlobal.pojoRm.RmOnHourReportHistory;
import com.dy.pipIrrGlobal.pojoRm.RmOnHourReportLast;
import com.dy.pipIrrGlobal.voRm.VoOnHour;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
/**
 * @Author: liurunyu
@@ -53,4 +56,18 @@
     * @return update count
     */
    int updateByPrimaryKey(RmOnHourReportHistory record);
    /**
     * 根据指定条件获取整点报历史记录数量
     * @param params
     * @return
     */
    Long getOnHourReportsCount_history(Map<?, ?> params);
    /**
     * 根据指定条件获取整点报历史记录
     * @param params
     * @return
     */
    List<VoOnHour> getOnHourReports_history(Map<?, ?> params);
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeManagerCardMapper.java
New file
@@ -0,0 +1,35 @@
package com.dy.pipIrrGlobal.daoSe;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dy.pipIrrGlobal.pojoSe.SeManagerCard;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
 * @author ZhuBaoMin
 * @date 2024-07-24 10:36
 * @LastEditTime 2024-07-24 10:36
 * @Description
 */
@Mapper
public interface SeManagerCardMapper extends BaseMapper<SeManagerCard> {
    int deleteByPrimaryKey(Long id);
    int insert(SeManagerCard record);
    int insertSelective(SeManagerCard record);
    SeManagerCard selectByPrimaryKey(Long id);
    int updateByPrimaryKeySelective(SeManagerCard record);
    int updateByPrimaryKey(SeManagerCard record);
    /**
     * 根据行政区划串模糊查询管理卡编号
     * @param areaCode
     * @return
     */
    String getManagerCardNumOfMax(@Param("areaCode") String areaCode);
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSt/StIntakeAmountMonthMapper.java
@@ -63,5 +63,11 @@
     * @param year 统计年度
     * @return
     */
    List<VoIntakeAmountStatistics> statisticsByIntake(Integer year, Integer month, Long startId, Long endId) ;
    /**
     * 以取水口维度统计取水量
     * @param year 统计年度
     * @return
     */
    List<VoIntakeAmountStatistics> statisticsByIntake(Integer year) ;
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmLossDay.java
@@ -21,13 +21,13 @@
 * @LastEditTime 2024/2/28 15:31
 * @Description 控制器日漏损水量历史数据
 */
@TableName(value="rm_loss_day", autoResultMap = true)
@TableName(value="rm_loss_history_history", autoResultMap = true)
@Data
@Builder
@ToString
@NoArgsConstructor
@AllArgsConstructor
@Schema(name = "取水口日漏损统计")
@Schema(name = "控制器日漏损水量历史数据 ")
public class RmLossDay implements BaseEntity {
    public static final long serialVersionUID = 202402281620001L;
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmLossDayLast.java
@@ -21,13 +21,13 @@
 * @LastEditTime 2024/2/28 15:31
 * @Description 控制器日漏损水量最新数据
 */
@TableName(value="rm_loss_day_last", autoResultMap = true)
@TableName(value="rm_loss_last_history", autoResultMap = true)
@Data
@Builder
@ToString
@NoArgsConstructor
@AllArgsConstructor
@Schema(name = "取水口日漏损最新数据")
@Schema(name = "控制器日漏损水量最新数据")
public class RmLossDayLast implements BaseEntity {
    public static final long serialVersionUID = 202402281621001L;
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeManagerCard.java
New file
@@ -0,0 +1,72 @@
package com.dy.pipIrrGlobal.pojoSe;
import com.alibaba.fastjson2.annotation.JSONField;
import com.alibaba.fastjson2.writer.ObjectWriterImplToString;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dy.common.po.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.*;
import org.hibernate.validator.constraints.Length;
import java.util.Date;
/**
 * @author ZhuBaoMin
 * @date 2024-07-24 10:36
 * @LastEditTime 2024-07-24 10:36
 * @Description
 */
/**
 * 管理员水卡表
 */
@TableName(value = "se_manager_card", autoResultMap = true)
@Data
@Builder
@ToString
@NoArgsConstructor
@AllArgsConstructor
public class SeManagerCard implements BaseEntity {
    public static final long serialVersionUID = 202407241040001L;
    /**
    * 主键
    */
    @JSONField(serializeUsing= ObjectWriterImplToString.class)
    @TableId(type = IdType.INPUT)
    private Long id;
    /**
    * 卡片地址
    */
    @NotBlank(message = "卡片地址不能为空")
    private String cardAddr;
    /**
    * 卡片编号
    */
    @NotBlank(message = "卡片编号不能为空")
    private String cardNum;
    /**
    * 卡片类型;2-管理科,4-开关阀卡,5清空卡
    */
    @NotNull(message = "卡片类型不能为空")
    private Byte cardType;
    /**
    * 开卡时间
    */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    /**
    * 备注信息
    */
    @Length(max = 200)
    private String remarks;
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voRm/VoIntakeAmountDay.java
New file
@@ -0,0 +1,52 @@
package com.dy.pipIrrGlobal.voRm;
import com.dy.common.po.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
/**
 * @author :WuZeYu
 * @Date :2024/7/24  10:27
 * @LastEditTime :2024/7/24  10:27
 * @Description
 */
@Data
@Schema(title = "取水口日取水量漏损量视图对象")
public class VoIntakeAmountDay implements BaseEntity {
    private static final long serialVersionUID = 202407241028001L;
    @Schema(description = "取水口ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private String intakeId;
    @Schema(description = "取水口名称", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private String intakeName;
    @Schema(description = "日取水量(不包括漏损水量)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Double amount;
    @Schema(description = "统计日期(yyyy-mm-dd)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private java.sql.Date dt;
    @Schema(description = "最后计水量上报数据接收时间(yyyy-mm-dd hh:mm:ss)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private java.util.Date dtLast;
    @Schema(description = "最后计水量的控制器地址", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private String rtuAddrLast;
    @Schema(description = "最后计水量的控制器ID(外键)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private String controllerIdLast;
    @Schema(description = "最后计水量时控制器累计水量", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Double totalAmountLast;
    @Schema(description = "最后计水量时控制器时钟(yyyy-mm-dd HH:MM:SS)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private java.util.Date rtuDtLast;
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voRm/VoLossDay.java
New file
@@ -0,0 +1,48 @@
package com.dy.pipIrrGlobal.voRm;
import com.dy.common.po.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
/**
 * @author :WuZeYu
 * @Date :2024/7/24  15:50
 * @LastEditTime :2024/7/24  15:50
 * @Description
 */
@Data
@Schema(title = "漏损记录视图对象")
public class VoLossDay implements BaseEntity {
    private static final long serialVersionUID = 202407241551001L;
    @Schema(description = "控制器ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private String controllerId;
    @Schema(description = "取水口ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private String intakeId;
    @Schema(description = "取水口名称", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private String intakeName;
    @Schema(description = "控制器地址", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private String rtuAddr;
    @Schema(description = "统计日期(yyyy-mm-dd)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private java.sql.Date dt;
    @Schema(description = "控制器最后上报数据日期时间(yyyy-mm-dd hh:mm:ss)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private java.util.Date dtLast;
    @Schema(description = "控制器时钟(yyyy-mm-dd HH:MM:SS)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private java.util.Date dtRtu;
    @Schema(description = "日漏损流量", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Double lossAmount;
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voRm/VoOnHour.java
New file
@@ -0,0 +1,75 @@
package com.dy.pipIrrGlobal.voRm;
import com.alibaba.fastjson2.annotation.JSONField;
import com.alibaba.fastjson2.writer.ObjectWriterImplToString;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
/**
 * @author ZhuBaoMin
 * @date 2024-07-23 17:12
 * @LastEditTime 2024-07-23 17:12
 * @Description 整点报数据视图对象
 */
@Data
public class VoOnHour {
    private static final long serialVersionUID = 202407231713001L;
    /**
     * 取水口ID
     */
    @JSONField(serializeUsing= ObjectWriterImplToString.class)
    private Long intakeId;
    /**
     * 取水口编号
     */
    private String intakeNum;
    /**
     * 阀控器地址
     */
    private String rtuAddr;
    /**
     * 数据接收时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private String receiveTime;
    /**
     * 瞬时流量
     */
    private Double instantAmount;
    /**
     * 累计流量
     */
    private Double totalAmount;
    /**
     * 损失流量,从当日0时到当前的漏损累计流量
     */
    private Double lossAmount;
    /**
     * 水压
     */
    private Double waterPress;
    /**
     * 蓄电池电压
     */
    private Double batteryVolt;
    /**
     * 信号强度
     */
    private Integer signalValue;
    /**
     * 水价
     */
    private Double waterPrice;
}
pipIrr-platform/pipIrr-global/src/main/resources/application-global.yml
@@ -72,7 +72,7 @@
pipIrr:
    global:
        dev: false   #是否开发阶段,true或false
        dev: true   #是否开发阶段,true或false
        dsName: ym  #开发阶段,设置临时的数据库名称
    mw:
        webPort: 8070
@@ -136,6 +136,8 @@
    projectNo: 10
    #控制器类型
    controllerType: 57
    #默认行政区划编码(天津-天津市-武清区-京滨工业园-大禹节水)
    divisionCode: 120114403100
#通讯协议
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmAlarmStateHistoryMapper.xml
@@ -397,7 +397,7 @@
            and rash.valve_state = #{valveState,jdbcType=TINYINT}
        </if>
        <if test="intakeName != null">
             and pint.name = #{intakeName,jdbcType=VARCHAR}
            and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%')
        </if>
        <if test="startDt != null">
             and rash.dt &gt;= #{startDt,jdbcType=TIMESTAMP}
@@ -487,7 +487,7 @@
                and rash.dt &lt;= #{endDt,jdbcType=TIMESTAMP}
            </if>
        </where>
        ORDER BY rash.dt DESC
        ORDER BY rash.id DESC
        <if test="pageCurr != null and pageSize != null">
            LIMIT ${(pageCurr-1)*pageSize}, ${pageSize}
        </if>
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmAlarmStateLastMapper.xml
@@ -379,7 +379,7 @@
        and rasl.valve_state = #{valveState,jdbcType=TINYINT}
      </if>
      <if test="intakeName != null">
        and pint.name = #{intakeName,jdbcType=VARCHAR}
        and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%')
      </if>
      <if test="startDt != null">
        and rasl.dt &gt;= #{startDt,jdbcType=TIMESTAMP}
@@ -416,7 +416,7 @@
    rasl.alarm_valve as alarmValve,
    rasl.power_type as powerType
    from rm_alarm_state_last rasl
    Left join pr_intake pint on intake_id = pint.id
    Left join pr_intake pint on rasl.intake_id = pint.id
    <where>
      <if test="alarmState == 1">
        and (
@@ -469,7 +469,7 @@
        and rasl.dt &lt;= #{endDt,jdbcType=TIMESTAMP}
      </if>
    </where>
    ORDER BY rasl.dt DESC
    ORDER BY rasl.id DESC
    <if test="pageCurr != null and pageSize != null">
      LIMIT ${(pageCurr-1)*pageSize}, ${pageSize}
    </if>
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmClientAmountDayLastMapper.xml
@@ -195,13 +195,13 @@
    Left join se_client sc on sc.id = rcadl.client_id
    <where>
      <if test="clientName != null">
        and sc.name = #{clientName,jdbcType=VARCHAR}
        and sc.name like CONCAT('%',#{clientName,jdbcType=VARCHAR},'%')
      </if>
      <if test="startDt != null">
        and rash.dt &gt;= #{startDt,jdbcType=TIMESTAMP}
        and rcadl.dt &gt;= #{startDt,jdbcType=DATE}
      </if>
      <if test="endDt != null">
        and rash.dt &lt;= #{endDt,jdbcType=TIMESTAMP}
        and rcadl.dt &lt;= #{endDt,jdbcType=DATE}
      </if>
    </where>
    </select>
@@ -223,16 +223,16 @@
    Left join se_client sc on sc.id = rcadl.client_id
    <where>
      <if test="clientName != null">
        and sc.name = #{clientName,jdbcType=VARCHAR}
        and sc.name like CONCAT('%',#{clientName,jdbcType=VARCHAR},'%')
      </if>
      <if test="startDt != null">
        and rash.dt &gt;= #{startDt,jdbcType=TIMESTAMP}
        and rcadl.dt &gt;= #{startDt,jdbcType=DATE}
      </if>
      <if test="endDt != null">
        and rash.dt &lt;= #{endDt,jdbcType=TIMESTAMP}
        and rcadl.dt &lt;= #{endDt,jdbcType=DATE}
      </if>
    </where>
    ORDER BY rcadl.dt DESC
    ORDER BY rcadl.id DESC
    <if test="pageCurr != null and pageSize != null">
      LIMIT ${(pageCurr-1)*pageSize}, ${pageSize}
    </if>
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmClientAmountDayMapper.xml
@@ -185,13 +185,13 @@
           Left join se_client sc on sc.id = rcad.client_id
    <where>
      <if test="clientName != null">
        and sc.name = #{clientName,jdbcType=VARCHAR}
        and sc.name like CONCAT('%',#{clientName,jdbcType=VARCHAR},'%')
      </if>
      <if test="startDt != null">
        and rash.dt &gt;= #{startDt,jdbcType=TIMESTAMP}
        and rcad.dt &gt;= #{startDt,jdbcType=DATE}
      </if>
      <if test="endDt != null">
        and rash.dt &lt;= #{endDt,jdbcType=TIMESTAMP}
        and rcad.dt &lt;= #{endDt,jdbcType=DATE}
      </if>
    </where>
    </select>
@@ -213,16 +213,16 @@
    Left join se_client sc on sc.id = rcad.client_id
    <where>
      <if test="clientName != null">
        and sc.name = #{clientName,jdbcType=VARCHAR}
        and sc.name like CONCAT('%',#{clientName,jdbcType=VARCHAR},'%')
      </if>
      <if test="startDt != null">
        and rash.dt &gt;= #{startDt,jdbcType=TIMESTAMP}
        and rcad.dt &gt;= #{startDt,jdbcType=DATE}
      </if>
      <if test="endDt != null">
        and rash.dt &lt;= #{endDt,jdbcType=TIMESTAMP}
        and rcad.dt &lt;= #{endDt,jdbcType=DATE}
      </if>
    </where>
    ORDER BY rcad.dt DESC
    ORDER BY rcad.id DESC
    <if test="pageCurr != null and pageSize != null">
      LIMIT ${(pageCurr-1)*pageSize}, ${pageSize}
    </if>
@@ -230,7 +230,7 @@
  <select id="statisticsByClient" resultType="com.dy.pipIrrGlobal.voSt.VoClientAmountStatistics">
    select client_id, sum(amount) as amount, sum(money) as amount
    select client_id, sum(amount) as amount, sum(money) as money
    from rm_client_amount_day
    where id <![CDATA[>=]]> #{startId,jdbcType=BIGINT} and id <![CDATA[<]]> #{endId,jdbcType=BIGINT}
    group by client_id
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmIntakeAmountDayLastMapper.xml
@@ -167,4 +167,51 @@
      rtu_dt_last = #{rtuDtLast,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=BIGINT}
  </update>
  <!--根据指定条件获取记录总数-->
  <select id="getRecordCount" resultType="java.lang.Long">
    select count(*)
    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>
      <if test="startDt != null">
        and riadl.dt &gt;= #{startDt,jdbcType=DATE}
      </if>
      <if test="endDt != null">
        and riadl.dt &lt;= #{endDt,jdbcType=DATE}
      </if>
    </where>
    </select>
  <!--根据指定条件获取记录-->
  <select id="getIntakeAmountDayLast" resultType="com.dy.pipIrrGlobal.voRm.VoIntakeAmountDay">
    select
    CAST(riadl.intake_id AS char)AS intakeId,
    pint.name as intakeName,
    riadl.dt as dt,
    riadl.amount as amount,
    riadl.dt_last as dtLast,
    riadl.rtu_addr_last as rtuAddrLast,
    CAST(riadl.controller_id_last AS char)AS controllerIdLast,
    riadl.total_amount_last as totalAmountLast,
    riadl.rtu_dt_last as rtuDtLast
    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>
      <if test="startDt != null">
        and riadl.dt &gt;= #{startDt,jdbcType=DATE}
      </if>
      <if test="endDt != null">
        and riadl.dt &lt;= #{endDt,jdbcType=DATE}
      </if>
    </where>
    ORDER BY riadl.id DESC
    <if test="pageCurr != null and pageSize != null">
      LIMIT ${(pageCurr-1)*pageSize}, ${pageSize}
    </if>
  </select>
</mapper>
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmIntakeAmountDayMapper.xml
@@ -155,13 +155,59 @@
      rtu_dt_last = #{rtuDtLast,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=BIGINT}
  </update>
  <!--根据指定条件获取记录总数-->
  <select id="getRecordCount" resultType="java.lang.Long">
    select count(*)
    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>
      <if test="startDt != null">
        and riad.dt &gt;= #{startDt,jdbcType=DATE}
      </if>
      <if test="endDt != null">
        and riad.dt &lt;= #{endDt,jdbcType=DATE}
      </if>
    </where>
    </select>
  <!--根据指定条件获取记录-->
  <select id="getIntakeAmountDayHistory" resultType="com.dy.pipIrrGlobal.voRm.VoIntakeAmountDay">
    select
    CAST(riad.intake_id AS char)AS intakeId,
    pint.name as intakeName,
    riad.dt as dt,
    riad.amount as amount,
    riad.dt_last as dtLast,
    riad.rtu_addr_last as rtuAddrLast,
    CAST(riad.controller_id_last AS char)AS controllerIdLast,
    riad.total_amount_last as totalAmountLast,
    riad.rtu_dt_last as rtuDtLast
    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>
      <if test="startDt != null">
        and riad.dt &gt;= #{startDt,jdbcType=DATE}
      </if>
      <if test="endDt != null">
        and riad.dt &lt;= #{endDt,jdbcType=DATE}
      </if>
    </where>
    ORDER BY riad.id DESC
    <if test="pageCurr != null and pageSize != null">
      LIMIT ${(pageCurr-1)*pageSize}, ${pageSize}
    </if>
  </select>
  <select id="statisticsByIntake" resultType="com.dy.pipIrrGlobal.voSt.VoIntakeAmountStatistics">
    select intake_id, sum(amount) as amount
    select intake_id, sum(amount) amount
    from rm_intake_amount_day
    where id <![CDATA[>=]]> #{startId,jdbcType=BIGINT} and id <![CDATA[<]]> #{endId,jdbcType=BIGINT}
    where id <![CDATA[>=]]> #{startId, jdbcType=BIGINT} and id <![CDATA[<]]> #{endId, jdbcType=BIGINT}
    group by intake_id
  </select>
</mapper>
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmLossDayLastMapper.xml
@@ -20,7 +20,7 @@
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    <!--@mbg.generated-->
    select
    select
    <include refid="Base_Column_List" />
    from rm_loss_day_last
    where id = #{id,jdbcType=BIGINT}
@@ -46,12 +46,12 @@
  </delete>
  <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoRm.RmLossDayLast">
    <!--@mbg.generated-->
    insert into rm_loss_day_last (id, last_history_id, controller_id,
      intake_id, rtu_addr, dt, dt_last, dt_rtu,
      loss_amount)
    values (#{id,jdbcType=BIGINT}, #{lastHistoryId,jdbcType=BIGINT}, #{controllerId,jdbcType=BIGINT},
      #{intakeId,jdbcType=BIGINT}, #{rtuAddr,jdbcType=VARCHAR}, #{dt,jdbcType=DATE}, #{dtLast,jdbcType=TIMESTAMP}, #{dtRtu,jdbcType=TIMESTAMP},
      #{lossAmount,jdbcType=DOUBLE})
    insert into rm_loss_day_last (id, last_history_id, controller_id,
    intake_id, rtu_addr, dt, dt_last, dt_rtu,
    loss_amount)
    values (#{id,jdbcType=BIGINT}, #{lastHistoryId,jdbcType=BIGINT}, #{controllerId,jdbcType=BIGINT},
    #{intakeId,jdbcType=BIGINT}, #{rtuAddr,jdbcType=VARCHAR}, #{dt,jdbcType=DATE}, #{dtLast,jdbcType=TIMESTAMP}, #{dtRtu,jdbcType=TIMESTAMP},
    #{lossAmount,jdbcType=DOUBLE})
  </insert>
  <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmLossDayLast">
    <!--@mbg.generated-->
@@ -134,11 +134,11 @@
      <if test="dt != null">
        dt = #{dt,jdbcType=DATE},
      </if>
     <if test="dtLast != null">
       dt_last = #{dtLast,jdbcType=TIMESTAMP},
      <if test="dtLast != null">
        dt_last = #{dtLast,jdbcType=TIMESTAMP},
      </if>
     <if test="dtRtu != null">
       dt_rtu = #{dtRtu,jdbcType=TIMESTAMP},
      <if test="dtRtu != null">
        dt_rtu = #{dtRtu,jdbcType=TIMESTAMP},
      </if>
      <if test="lossAmount != null">
        loss_amount = #{lossAmount,jdbcType=DOUBLE},
@@ -150,13 +150,60 @@
    <!--@mbg.generated-->
    update rm_loss_day_last
    set last_history_id = #{lastHistoryId,jdbcType=BIGINT},
      controller_id = #{controllerId,jdbcType=BIGINT},
      intake_id = #{intakeId,jdbcType=BIGINT},
      rtu_addr = #{rtuAddr,jdbcType=VARCHAR},
      dt = #{dt,jdbcType=DATE},
      dt_last = #{dtLast,jdbcType=TIMESTAMP},
      dt_rtu = #{dtRtu,jdbcType=TIMESTAMP},
      loss_amount = #{lossAmount,jdbcType=DOUBLE}
    controller_id = #{controllerId,jdbcType=BIGINT},
    intake_id = #{intakeId,jdbcType=BIGINT},
    rtu_addr = #{rtuAddr,jdbcType=VARCHAR},
    dt = #{dt,jdbcType=DATE},
    dt_last = #{dtLast,jdbcType=TIMESTAMP},
    dt_rtu = #{dtRtu,jdbcType=TIMESTAMP},
    loss_amount = #{lossAmount,jdbcType=DOUBLE}
    where id = #{id,jdbcType=BIGINT}
  </update>
  <!--根据指定条件获取记录总数-->
  <select id="getRecordCount" resultType="java.lang.Long">
    select count(*)
    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>
      <if test="startDt != null">
        and rldl.dt &gt;= #{startDt,jdbcType=DATE}
      </if>
      <if test="endDt != null">
        and rldl.dt &lt;= #{endDt,jdbcType=DATE}
      </if>
    </where>
  </select>
  <!--根据指定条件获取记录-->
  <select id="getLossDayLast" resultType="com.dy.pipIrrGlobal.voRm.VoLossDay">
    select
    CAST(rldl.intake_id AS char)AS intakeId,
    CAST(rldl.controller_id AS char)AS controllerId,
    pint.name as intakeName,
    rldl.rtu_addr as rtuAddr,
    rldl.dt as dt,
    rldl.dt_last as dtLast,
    rldl.dt_rtu as dtRtu,
    rldl.loss_amount as lossAmount
    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>
      <if test="startDt != null">
        and rldl.dt &gt;= #{startDt,jdbcType=DATE}
      </if>
      <if test="endDt != null">
        and rldl.dt &lt;= #{endDt,jdbcType=DATE}
      </if>
    </where>
    ORDER BY rldl.id DESC
    <if test="pageCurr != null and pageSize != null">
      LIMIT ${(pageCurr-1)*pageSize}, ${pageSize}
    </if>
  </select>
</mapper>
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmLossDayMapper.xml
@@ -19,11 +19,19 @@
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    <!--@mbg.generated-->
    select
    select
    <include refid="Base_Column_List" />
    from rm_loss_day
    where id = #{id,jdbcType=BIGINT}
  </select>
  <select id="selectByIntakeId" parameterType="java.lang.Long" resultMap="BaseResultMap">
    <!--@mbg.generated-->
    select
    <include refid="Base_Column_List" />
    from rm_loss_day
    where intake_id = #{intakeId,jdbcType=BIGINT}
  </select>
  <select id="selectByDate" parameterType="java.util.Date" resultMap="BaseResultMap">
    <!--@mbg.generated-->
    select
@@ -39,11 +47,11 @@
  <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoRm.RmLossDay">
    <!--@mbg.generated-->
    insert into rm_loss_day (id, controller_id, intake_id,
      rtu_addr, dt, dt_last, dt_rtu, loss_amount
      )
    values (#{id,jdbcType=BIGINT}, #{controllerId,jdbcType=BIGINT}, #{intakeId,jdbcType=BIGINT},
      #{rtuAddr,jdbcType=VARCHAR}, #{dt,jdbcType=DATE}, #{dtLast,jdbcType=TIMESTAMP}, #{dtRtu,jdbcType=TIMESTAMP}, #{lossAmount,jdbcType=DOUBLE}
      )
    rtu_addr, dt, dt_last, dt_rtu, loss_amount
    )
    values (#{id,jdbcType=BIGINT}, #{controllerId,jdbcType=BIGINT}, #{intakeId,jdbcType=BIGINT},
    #{rtuAddr,jdbcType=VARCHAR}, #{dt,jdbcType=DATE}, #{dtLast,jdbcType=TIMESTAMP}, #{dtRtu,jdbcType=TIMESTAMP}, #{lossAmount,jdbcType=DOUBLE}
    )
  </insert>
  <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmLossDay">
    <!--@mbg.generated-->
@@ -67,7 +75,7 @@
      <if test="dtLast != null">
        dt_last,
      </if>
     <if test="dtRtu != null">
      <if test="dtRtu != null">
        dt_rtu,
      </if>
      <if test="lossAmount != null">
@@ -133,20 +141,65 @@
    <!--@mbg.generated-->
    update rm_loss_day
    set controller_id = #{controllerId,jdbcType=BIGINT},
      intake_id = #{intakeId,jdbcType=BIGINT},
      rtu_addr = #{rtuAddr,jdbcType=VARCHAR},
      dt = #{dt,jdbcType=DATE},
      dt_last = #{dtLast,jdbcType=TIMESTAMP},
      dt_rtu = #{dtRtu,jdbcType=TIMESTAMP},
      loss_amount = #{lossAmount,jdbcType=DOUBLE}
    intake_id = #{intakeId,jdbcType=BIGINT},
    rtu_addr = #{rtuAddr,jdbcType=VARCHAR},
    dt = #{dt,jdbcType=DATE},
    dt_last = #{dtLast,jdbcType=TIMESTAMP},
    dt_rtu = #{dtRtu,jdbcType=TIMESTAMP},
    loss_amount = #{lossAmount,jdbcType=DOUBLE}
    where id = #{id,jdbcType=BIGINT}
  </update>
  <select id="statisticsByIntake" resultType="com.dy.pipIrrGlobal.voSt.VoIntakeLossStatistics">
    select intake_id, sum(loss_amount) as amount
    from rm_loss_day
    where id <![CDATA[>=]]> #{startId,jdbcType=BIGINT} and id <![CDATA[<]]> #{endId,jdbcType=BIGINT}
    group by intake_id
  <!--根据指定条件获取记录总数-->
  <select id="getRecordCount" resultType="java.lang.Long">
    select count(*)
    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>
      <if test="startDt != null">
        and rld.dt &gt;= #{startDt,jdbcType=DATE}
      </if>
      <if test="endDt != null">
        and rld.dt &lt;= #{endDt,jdbcType=DATE}
      </if>
    </where>
  </select>
  <!--根据指定条件获取记录-->
  <select id="getLossDayHistory" resultType="com.dy.pipIrrGlobal.voRm.VoLossDay">
    select
    CAST(rld.intake_id AS char)AS intakeId,
    CAST(rld.controller_id AS char)AS controllerId,
    pint.name as intakeName,
    rld.rtu_addr as rtuAddr,
    rld.dt as dt,
    rld.dt_last as dtLast,
    rld.dt_rtu as dtRtu,
    rld.loss_amount as lossAmount
    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>
      <if test="startDt != null">
        and rld.dt &gt;= #{startDt,jdbcType=DATE}
      </if>
      <if test="endDt != null">
        and rld.dt &lt;= #{endDt,jdbcType=DATE}
      </if>
    </where>
    ORDER BY rld.id DESC
    <if test="pageCurr != null and pageSize != null">
      LIMIT ${(pageCurr-1)*pageSize}, ${pageSize}
    </if>
  </select>
  <select id="statisticsByIntake" resultType="com.dy.pipIrrGlobal.voSt.VoIntakeLossStatistics">
    select intake_id, sum(loss_amount) amount
    from rm_loss_day
    where id <![CDATA[>=]]> #{startId, jdbcType=BIGINT} and id <![CDATA[<]]> #{endId, jdbcType=BIGINT}
    group by intake_id
  </select>
</mapper>
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOnHourReportHistoryMapper.xml
@@ -194,4 +194,58 @@
      water_price = #{waterPrice,jdbcType=FLOAT}
    where id = #{id,jdbcType=BIGINT}
  </update>
  <!--根据指定条件获取整点报历史记录数量-->
  <select id="getOnHourReportsCount_history" resultType="java.lang.Long">
    SELECT
        COUNT(*) AS recordCount
    FROM rm_on_hour_report_history oh
    INNER JOIN pr_intake inta ON inta.id = oh.intake_id
    <where>
      <if test = "intakeName != null and intakeName !=''">
        AND inta.name LIKE CONCAT('%',#{intakeName},'%')
      </if>
      <if test = "rtuAddr != null and rtuAddr !=''">
        AND oh.rtu_addr LIKE CONCAT('%',#{rtuAddr},'%')
      </if>
      <if test = "timeStart != null and timeStop != null">
        AND oh.dt BETWEEN #{timeStart} AND #{timeStop}
      </if>
    </where>
  </select>
  <!--根据指定条件获取整点报历史记录-->
  <select id="getOnHourReports_history" resultType="com.dy.pipIrrGlobal.voRm.VoOnHour">
    SELECT
      oh.intake_id AS intakeId,
      inta.`name` AS intakeNum,
      oh.rtu_addr AS rtuAddr,
      oh.dt AS receiveTime,
      oh.instant_amount AS instantAmount,
      oh.total_amount AS totalAmount,
      oh.loss_amount AS lossAmount,
      oh.water_press AS waterPress,
      oh.battery_volt AS batteryVolt,
      oh.signal_value AS signalValue,
      oh.water_price AS waterPrice
    FROM rm_on_hour_report_history oh
        INNER JOIN pr_intake inta ON inta.id = oh.intake_id
    <where>
      <if test = "intakeNum != null and intakeNum !=''">
        AND inta.name LIKE CONCAT('%',#{intakeNum},'%')
      </if>
      <if test = "rtuAddr != null and rtuAddr !=''">
        AND oh.rtu_addr LIKE CONCAT('%',#{rtuAddr},'%')
      </if>
      <if test = "timeStart != null and timeStop != null">
        AND oh.dt BETWEEN #{timeStart} AND #{timeStop}
      </if>
    </where>
    ORDER BY oh.dt DESC
    <trim prefix="limit " >
      <if test="start != null and count != null">
        #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
      </if>
    </trim>
  </select>
</mapper>
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeManagerCardMapper.xml
New file
@@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dy.pipIrrGlobal.daoSe.SeManagerCardMapper">
  <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoSe.SeManagerCard">
    <!--@mbg.generated-->
    <!--@Table se_manager_card-->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="card_addr" jdbcType="VARCHAR" property="cardAddr" />
    <result column="card_num" jdbcType="VARCHAR" property="cardNum" />
    <result column="card_type" jdbcType="TINYINT" property="cardType" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="remarks" jdbcType="VARCHAR" property="remarks" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    id, card_addr, card_num, card_type, create_time, remarks
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    <!--@mbg.generated-->
    select
    <include refid="Base_Column_List" />
    from se_manager_card
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    <!--@mbg.generated-->
    delete from se_manager_card
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSe.SeManagerCard">
    <!--@mbg.generated-->
    insert into se_manager_card (id, card_addr, card_num,
      card_type, create_time, remarks
      )
    values (#{id,jdbcType=BIGINT}, #{cardAddr,jdbcType=VARCHAR}, #{cardNum,jdbcType=VARCHAR},
      #{cardType,jdbcType=TINYINT}, #{createTime,jdbcType=TIMESTAMP}, #{remarks,jdbcType=VARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeManagerCard">
    <!--@mbg.generated-->
    insert into se_manager_card
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="cardAddr != null">
        card_addr,
      </if>
      <if test="cardNum != null">
        card_num,
      </if>
      <if test="cardType != null">
        card_type,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="remarks != null">
        remarks,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="cardAddr != null">
        #{cardAddr,jdbcType=VARCHAR},
      </if>
      <if test="cardNum != null">
        #{cardNum,jdbcType=VARCHAR},
      </if>
      <if test="cardType != null">
        #{cardType,jdbcType=TINYINT},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="remarks != null">
        #{remarks,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeManagerCard">
    <!--@mbg.generated-->
    update se_manager_card
    <set>
      <if test="cardAddr != null">
        card_addr = #{cardAddr,jdbcType=VARCHAR},
      </if>
      <if test="cardNum != null">
        card_num = #{cardNum,jdbcType=VARCHAR},
      </if>
      <if test="cardType != null">
        card_type = #{cardType,jdbcType=TINYINT},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="remarks != null">
        remarks = #{remarks,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSe.SeManagerCard">
    <!--@mbg.generated-->
    update se_manager_card
    set card_addr = #{cardAddr,jdbcType=VARCHAR},
      card_num = #{cardNum,jdbcType=VARCHAR},
      card_type = #{cardType,jdbcType=TINYINT},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      remarks = #{remarks,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
  <!--根据行政区划串模糊查询管理卡编号-->
  <select id="getManagerCardNumOfMax"  resultType="java.lang.String">
    SELECT card_num
    FROM se_manager_card
    WHERE card_num LIKE CONCAT(#{areaCode},'%')
    ORDER BY card_num desc
    LIMIT 0,1
  </select>
</mapper>
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/ClientAmountDayQueryVo.java
File was deleted
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/ControllerAlarmStateQueryVo.java
File was deleted
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/RecordsCtrl.java
@@ -7,7 +7,11 @@
import com.dy.common.webUtil.ResultCodeMsg;
import com.dy.pipIrrGlobal.voRm.VoClientAmountDay;
import com.dy.pipIrrGlobal.voRm.VoControllerAlarmState;
import com.dy.pipIrrGlobal.voRm.VoIntakeAmountDay;
import com.dy.pipIrrGlobal.voSe.VoActiveCard;
import com.dy.pipIrrRemote.records.clientAmountDay.ClientAmountDayQueryVo;
import com.dy.pipIrrRemote.records.controllerAlarmState.ControllerAlarmStateQueryVo;
import com.dy.pipIrrRemote.records.intakeAmountDay.IntakeAmountDayQueryVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
@@ -106,7 +110,7 @@
    @ApiResponses(value = {
            @ApiResponse(
                    responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
                    description = "返回一页控制器报警与状态数据(BaseResponse.content:QueryResultVo[{}])",
                    description = "返回一页农户日用水量统计数据(BaseResponse.content:QueryResultVo[{}])",
                    content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
                            schema = @Schema(implementation = VoActiveCard.class))}
            )
@@ -134,7 +138,7 @@
    @ApiResponses(value = {
            @ApiResponse(
                    responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
                    description = "返回一页控制器报警与状态数据(BaseResponse.content:QueryResultVo[{}])",
                    description = "返回一页农户日用水量统计数据(BaseResponse.content:QueryResultVo[{}])",
                    content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
                            schema = @Schema(implementation = VoActiveCard.class))}
            )
@@ -150,4 +154,59 @@
            return BaseResponseUtils.buildException(e.getMessage());
        }
    }
    /**
     * 根据指定条件获取取水口日取水量漏损列表(历史)
     *
     * @param vo 查询条件
     * @return 符合条件的取水口日取水量漏损列表(历史)
     */
    @Operation(summary = "获得一页取水口日取水量漏损记录", description = "返回一页取水口日取水量漏损数据")
    @ApiResponses(value = {
            @ApiResponse(
                    responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
                    description = "返回一页取水口日取水量漏损数据(BaseResponse.content:QueryResultVo[{}])",
                    content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
                            schema = @Schema(implementation = VoActiveCard.class))}
            )
    })
    @GetMapping(path = "/getIntakeAmountDayHistory")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoIntakeAmountDay>>> getIntakeAmountDayHistory(@RequestBody IntakeAmountDayQueryVo vo) {
        try {
            QueryResultVo<List<VoIntakeAmountDay>> res = recordsSv.getIntakeAmountDayHistory(vo);
            return BaseResponseUtils.buildSuccess(res);
        } catch (Exception e) {
            log.error("获取农户日用水量统计记录异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
    }
    /**
     * 根据指定条件获取取水口日取水量漏损列表(最新)
     *
     * @param vo 查询条件
     * @return 符合条件的取水口日取水量漏损列表(最新)
     */
    @Operation(summary = "获得一页取水口日取水量漏损记录", description = "返回一页取水口日取水量漏损数据")
    @ApiResponses(value = {
            @ApiResponse(
                    responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
                    description = "返回一页取水口日取水量漏损数据(BaseResponse.content:QueryResultVo[{}])",
                    content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
                            schema = @Schema(implementation = VoActiveCard.class))}
            )
    })
    @GetMapping(path = "/getIntakeAmountDayLast")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoIntakeAmountDay>>> getIntakeAmountDayLast(@RequestBody IntakeAmountDayQueryVo vo) {
        try {
            QueryResultVo<List<VoIntakeAmountDay>> res = recordsSv.getIntakeAmountDayLast(vo);
            return BaseResponseUtils.buildSuccess(res);
        } catch (Exception e) {
            log.error("获取农户日用水量统计记录异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/RecordsSv.java
@@ -1,12 +1,13 @@
package com.dy.pipIrrRemote.records;
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pipIrrGlobal.daoRm.RmAlarmStateHistoryMapper;
import com.dy.pipIrrGlobal.daoRm.RmAlarmStateLastMapper;
import com.dy.pipIrrGlobal.daoRm.RmClientAmountDayLastMapper;
import com.dy.pipIrrGlobal.daoRm.RmClientAmountDayMapper;
import com.dy.pipIrrGlobal.daoRm.*;
import com.dy.pipIrrGlobal.voRm.VoClientAmountDay;
import com.dy.pipIrrGlobal.voRm.VoControllerAlarmState;
import com.dy.pipIrrGlobal.voRm.VoIntakeAmountDay;
import com.dy.pipIrrRemote.records.clientAmountDay.ClientAmountDayQueryVo;
import com.dy.pipIrrRemote.records.controllerAlarmState.ControllerAlarmStateQueryVo;
import com.dy.pipIrrRemote.records.intakeAmountDay.IntakeAmountDayQueryVo;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.common.utils.PojoUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -30,9 +31,14 @@
    private RmAlarmStateLastMapper rmAlarmStateLastMapper;
    @Autowired
    private RmClientAmountDayLastMapper rmClientAmountDayLastMapper;
    @Autowired
    private RmClientAmountDayMapper rmClientAmountDayMapper;
    @Autowired
    private RmClientAmountDayLastMapper rmClientAmountDayLastMapper;
    @Autowired
    private RmIntakeAmountDayMapper rmIntakeAmountDayMapper;
    @Autowired
    private RmIntakeAmountDayLastMapper rmIntakeAmountDayLastMapper;
    /**
@@ -118,4 +124,44 @@
        rsVo.obj = rmClientAmountDayLastMapper.getClientAmountDayLast(params);
        return rsVo;
    }
    /**
     * 获得一页取水口日取水量漏损记录(历史)
     * @param vo
     * @return
     */
    public QueryResultVo<List<VoIntakeAmountDay>> getIntakeAmountDayHistory(IntakeAmountDayQueryVo vo) {
        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(vo);
        Long itemTotal = rmIntakeAmountDayMapper.getRecordCount(params);
        QueryResultVo<List<VoIntakeAmountDay>> rsVo = new QueryResultVo<>();
        rsVo.pageSize = vo.pageSize;
        rsVo.pageCurr = vo.pageCurr;
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = rmIntakeAmountDayMapper.getIntakeAmountDayHistory(params);
        return rsVo;
    }
    /**
     * 获得一页取水口日取水量漏损记录(最新)
     * @param vo
     * @return
     */
    public QueryResultVo<List<VoIntakeAmountDay>> getIntakeAmountDayLast(IntakeAmountDayQueryVo vo) {
        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(vo);
        Long itemTotal = rmIntakeAmountDayLastMapper.getRecordCount(params);
        QueryResultVo<List<VoIntakeAmountDay>> rsVo = new QueryResultVo<>();
        rsVo.pageSize = vo.pageSize;
        rsVo.pageCurr = vo.pageCurr;
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = rmIntakeAmountDayLastMapper.getIntakeAmountDayLast(params);
        return rsVo;
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/clientAmountDay/ClientAmountDayCtrl.java
New file
@@ -0,0 +1,96 @@
package com.dy.pipIrrRemote.records.clientAmountDay;
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.common.webUtil.ResultCodeMsg;
import com.dy.pipIrrGlobal.voRm.VoClientAmountDay;
import com.dy.pipIrrGlobal.voSe.VoActiveCard;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
 * @author :WuZeYu
 * @Date :2024/7/24  14:30
 * @LastEditTime :2024/7/24  14:30
 * @Description
 */
@Slf4j
@Tag(name = "农户日用水量统计查询", description = "农户日用水量统计查询")
@RestController
@RequestMapping(path = "clientAmountDay")
public class ClientAmountDayCtrl {
    @Autowired
    private ClientAmountDaySv clientAmountDaySv;
    /**
     * 根据指定条件获取农户日用水量统计列表(历史)
     *
     * @param vo 查询条件
     * @return 符合条件的农户日用水量统计列表(历史)
     */
    @Operation(summary = "获得一页农户日用水量统计记录", description = "返回一页农户日用水量统计数据")
    @ApiResponses(value = {
            @ApiResponse(
                    responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
                    description = "返回一页农户日用水量统计数据(BaseResponse.content:QueryResultVo[{}])",
                    content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
                            schema = @Schema(implementation = VoActiveCard.class))}
            )
    })
    @GetMapping(path = "/getClientAmountDayHistory")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoClientAmountDay>>> getClientAmountDayHistory(@RequestBody ClientAmountDayQueryVo vo) {
        try {
            QueryResultVo<List<VoClientAmountDay>> res = clientAmountDaySv.getClientAmountDayHistory(vo);
            return BaseResponseUtils.buildSuccess(res);
        } catch (Exception e) {
            log.error("获取农户日用水量统计记录异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
    }
    /**
     * 根据指定条件获取农户日用水量统计列表(最新)
     *
     * @param vo 查询条件
     * @return 符合条件的农户日用水量统计列表(最新)
     */
    @Operation(summary = "获得一页农户日用水量统计记录", description = "返回一页农户日用水量统计数据")
    @ApiResponses(value = {
            @ApiResponse(
                    responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
                    description = "返回一页农户日用水量统计数据(BaseResponse.content:QueryResultVo[{}])",
                    content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
                            schema = @Schema(implementation = VoActiveCard.class))}
            )
    })
    @GetMapping(path = "/getClientAmountDayLast")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoClientAmountDay>>> getClientAmountDayLast(@RequestBody ClientAmountDayQueryVo vo) {
        try {
            QueryResultVo<List<VoClientAmountDay>> res = clientAmountDaySv.getClientAmountDayLast(vo);
            return BaseResponseUtils.buildSuccess(res);
        } catch (Exception e) {
            log.error("获取农户日用水量统计记录异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/clientAmountDay/ClientAmountDaySv.java
New file
@@ -0,0 +1,72 @@
package com.dy.pipIrrRemote.records.clientAmountDay;
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pipIrrGlobal.daoRm.RmClientAmountDayLastMapper;
import com.dy.pipIrrGlobal.daoRm.RmClientAmountDayMapper;
import com.dy.pipIrrGlobal.voRm.VoClientAmountDay;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.common.utils.PojoUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
 * @author :WuZeYu
 * @Date :2024/7/24  14:30
 * @LastEditTime :2024/7/24  14:30
 * @Description
 */
@Slf4j
@Service
public class ClientAmountDaySv {
    @Autowired
    private RmClientAmountDayMapper rmClientAmountDayMapper;
    @Autowired
    private RmClientAmountDayLastMapper rmClientAmountDayLastMapper;
    /**
     * 获得一页农户日用水量统计记录(历史)
     * @param vo
     * @return
     */
    public QueryResultVo<List<VoClientAmountDay>> getClientAmountDayHistory(ClientAmountDayQueryVo vo) {
        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(vo);
        Long itemTotal = rmClientAmountDayMapper.getRecordCount(params);
        QueryResultVo<List<VoClientAmountDay>> rsVo = new QueryResultVo<>();
        rsVo.pageSize = vo.pageSize;
        rsVo.pageCurr = vo.pageCurr;
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = rmClientAmountDayMapper.getClientAmountDayHistory(params);
        return rsVo;
    }
    /**
     * 获得一页农户日用水量统计记录(最新)
     * @param vo
     * @return
     */
    public QueryResultVo<List<VoClientAmountDay>> getClientAmountDayLast(ClientAmountDayQueryVo vo) {
        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(vo);
        Long itemTotal = rmClientAmountDayLastMapper.getRecordCount(params);
        QueryResultVo<List<VoClientAmountDay>> rsVo = new QueryResultVo<>();
        rsVo.pageSize = vo.pageSize;
        rsVo.pageCurr = vo.pageCurr;
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = rmClientAmountDayLastMapper.getClientAmountDayLast(params);
        return rsVo;
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/controllerAlarmState/ControllerAlarmStateCtrl.java
New file
@@ -0,0 +1,97 @@
package com.dy.pipIrrRemote.records.controllerAlarmState;
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.common.webUtil.ResultCodeMsg;
import com.dy.pipIrrGlobal.voRm.VoControllerAlarmState;
import com.dy.pipIrrGlobal.voSe.VoActiveCard;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
 * @author :WuZeYu
 * @Date :2024/7/24  14:22
 * @LastEditTime :2024/7/24  14:22
 * @Description
 */
@Slf4j
@Tag(name = "控制器报警与状态查询", description = "控制器报警与状态查询")
@RestController
@RequestMapping(path = "controllerAlarmState")
public class ControllerAlarmStateCtrl {
    @Autowired
    private ControllerAlarmStateSv controllerAlarmStateSv;
    /**
     * 根据指定条件获取控制器报警与状态列表(历史)
     *
     * @param vo 查询条件
     * @return 符合条件的控制器报警与状态列表(历史)
     */
    @Operation(summary = "获得一页控制器报警与状态记录", description = "返回一页控制器报警与状态数据")
    @ApiResponses(value = {
            @ApiResponse(
                    responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
                    description = "返回一页控制器报警与状态数据(BaseResponse.content:QueryResultVo[{}])",
                    content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
                            schema = @Schema(implementation = VoActiveCard.class))}
            )
    })
    @GetMapping(path = "/getControllerAlarmStateHistory")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoControllerAlarmState>>> getControllerAlarmStateHistory(@RequestBody ControllerAlarmStateQueryVo vo) {
        try {
            QueryResultVo<List<VoControllerAlarmState>> res = controllerAlarmStateSv.getControllerAlarmStateHistory(vo);
            return BaseResponseUtils.buildSuccess(res);
        } catch (Exception e) {
            log.error("获取控制器报警与状态记录异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
    }
    /**
     * 根据指定条件获取控制器报警与状态列表(最新)
     *
     * @param vo 查询条件
     * @return 符合条件的控制器报警与状态列表(最新)
     */
    @Operation(summary = "获得一页控制器报警与状态记录", description = "返回一页控制器报警与状态数据")
    @ApiResponses(value = {
            @ApiResponse(
                    responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
                    description = "返回一页控制器报警与状态数据(BaseResponse.content:QueryResultVo[{}])",
                    content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
                            schema = @Schema(implementation = VoActiveCard.class))}
            )
    })
    @GetMapping(path = "/getControllerAlarmStateLast")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoControllerAlarmState>>> getControllerAlarmStateLast(@RequestBody ControllerAlarmStateQueryVo vo) {
        try {
            QueryResultVo<List<VoControllerAlarmState>> res = controllerAlarmStateSv.getControllerAlarmStateLast(vo);
            return BaseResponseUtils.buildSuccess(res);
        } catch (Exception e) {
            log.error("获取控制器记录异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/controllerAlarmState/ControllerAlarmStateSv.java
New file
@@ -0,0 +1,72 @@
package com.dy.pipIrrRemote.records.controllerAlarmState;
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pipIrrGlobal.daoRm.RmAlarmStateHistoryMapper;
import com.dy.pipIrrGlobal.daoRm.RmAlarmStateLastMapper;
import com.dy.pipIrrGlobal.voRm.VoControllerAlarmState;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.common.utils.PojoUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
 * @author :WuZeYu
 * @Date :2024/7/24  14:22
 * @LastEditTime :2024/7/24  14:22
 * @Description
 */
@Slf4j
@Service
public class ControllerAlarmStateSv {
    @Autowired
    private RmAlarmStateHistoryMapper rmAlarmStateHistoryMapper;
    @Autowired
    private RmAlarmStateLastMapper rmAlarmStateLastMapper;
    /**
     * 获得一页控制器报警与状态记录(历史)
     * @param vo
     * @return
     */
    public QueryResultVo<List<VoControllerAlarmState>> getControllerAlarmStateHistory(ControllerAlarmStateQueryVo vo) {
        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(vo);
        Long itemTotal = rmAlarmStateHistoryMapper.getRecordCount(params);
        QueryResultVo<List<VoControllerAlarmState>> rsVo = new QueryResultVo<>();
        rsVo.pageSize = vo.pageSize;
        rsVo.pageCurr = vo.pageCurr;
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = rmAlarmStateHistoryMapper.getControllerAlarmStateHistory(params);
        return rsVo;
    }
    /**
     * 获得一页控制器报警与状态记录(最新)
     * @param vo
     * @return
     */
    public QueryResultVo<List<VoControllerAlarmState>> getControllerAlarmStateLast(ControllerAlarmStateQueryVo vo) {
        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(vo);
        Long itemTotal = rmAlarmStateLastMapper.getRecordCount(params);
        QueryResultVo<List<VoControllerAlarmState>> rsVo = new QueryResultVo<>();
        rsVo.pageSize = vo.pageSize;
        rsVo.pageCurr = vo.pageCurr;
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = rmAlarmStateLastMapper.getControllerAlarmStateLast(params);
        return rsVo;
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/intakeAmountDay/IntakeAmountDayCtrl.java
New file
@@ -0,0 +1,94 @@
package com.dy.pipIrrRemote.records.intakeAmountDay;
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.common.webUtil.ResultCodeMsg;
import com.dy.pipIrrGlobal.voRm.VoIntakeAmountDay;
import com.dy.pipIrrGlobal.voSe.VoActiveCard;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
 * @author :WuZeYu
 * @Date :2024/7/24  14:37
 * @LastEditTime :2024/7/24  14:37
 * @Description
 */
@Slf4j
@Tag(name = "取水口日取水量漏损量查询", description = "取水口日取水量漏损量查询")
@RestController
@RequestMapping(path = "intakeAmountDay")
public class IntakeAmountDayCtrl {
    @Autowired
    private IntakeAmountDaySv intakeAmountDaySv;
    /**
     * 根据指定条件获取取水口日取水量漏损量列表(历史)
     *
     * @param vo 查询条件
     * @return 符合条件的取水口日取水量漏损量列表(历史)
     */
    @Operation(summary = "获得一页取水口日取水量漏损量记录", description = "返回一页取水口日取水量漏损量数据")
    @ApiResponses(value = {
            @ApiResponse(
                    responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
                    description = "返回一页取水口日取水量漏损数据(BaseResponse.content:QueryResultVo[{}])",
                    content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
                            schema = @Schema(implementation = VoActiveCard.class))}
            )
    })
    @GetMapping(path = "/getIntakeAmountDayHistory")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoIntakeAmountDay>>> getIntakeAmountDayHistory(@RequestBody IntakeAmountDayQueryVo vo) {
        try {
            QueryResultVo<List<VoIntakeAmountDay>> res = intakeAmountDaySv.getIntakeAmountDayHistory(vo);
            return BaseResponseUtils.buildSuccess(res);
        } catch (Exception e) {
            log.error("获取取水口日取水量漏损量记录异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
    }
    /**
     * 根据指定条件获取取水口日取水量漏损量列表(最新)
     *
     * @param vo 查询条件
     * @return 符合条件的取水口日取水量漏损量列表(最新)
     */
    @Operation(summary = "获得一页取水口日取水量漏损量记录", description = "返回一页取水口日取水量漏损量数据")
    @ApiResponses(value = {
            @ApiResponse(
                    responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
                    description = "返回一页取水口日取水量漏损量数据(BaseResponse.content:QueryResultVo[{}])",
                    content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
                            schema = @Schema(implementation = VoActiveCard.class))}
            )
    })
    @GetMapping(path = "/getIntakeAmountDayLast")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoIntakeAmountDay>>> getIntakeAmountDayLast(@RequestBody IntakeAmountDayQueryVo vo) {
        try {
            QueryResultVo<List<VoIntakeAmountDay>> res = intakeAmountDaySv.getIntakeAmountDayLast(vo);
            return BaseResponseUtils.buildSuccess(res);
        } catch (Exception e) {
            log.error("获取取水口日取水量漏损量记录异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/intakeAmountDay/IntakeAmountDayQueryVo.java
New file
@@ -0,0 +1,32 @@
package com.dy.pipIrrRemote.records.intakeAmountDay;
import com.dy.common.webUtil.QueryConditionVo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.sql.Date;
/**
 * @author :WuZeYu
 * @Date :2024/7/24  10:21
 * @LastEditTime :2024/7/24  10:21
 * @Description
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ToString(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Schema(name = "取水口日取水量漏损查询条件")
public class IntakeAmountDayQueryVo extends QueryConditionVo {
    @Schema(description = "取水口名称", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private String intakeName;
    @Schema(description = "统计开始日期", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Date startDt;
    @Schema(description = "统计结束日期", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Date endDt;
}
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/intakeAmountDay/IntakeAmountDaySv.java
New file
@@ -0,0 +1,71 @@
package com.dy.pipIrrRemote.records.intakeAmountDay;
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pipIrrGlobal.daoRm.RmIntakeAmountDayLastMapper;
import com.dy.pipIrrGlobal.daoRm.RmIntakeAmountDayMapper;
import com.dy.pipIrrGlobal.voRm.VoIntakeAmountDay;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.common.utils.PojoUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
 * @author :WuZeYu
 * @Date :2024/7/24  14:38
 * @LastEditTime :2024/7/24  14:38
 * @Description
 */
@Slf4j
@Service
public class IntakeAmountDaySv {
    @Autowired
    private RmIntakeAmountDayMapper rmIntakeAmountDayMapper;
    @Autowired
    private RmIntakeAmountDayLastMapper rmIntakeAmountDayLastMapper;
    /**
     * 获得一页取水口日取水量漏损记录(历史)
     * @param vo
     * @return
     */
    public QueryResultVo<List<VoIntakeAmountDay>> getIntakeAmountDayHistory(IntakeAmountDayQueryVo vo) {
        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(vo);
        Long itemTotal = rmIntakeAmountDayMapper.getRecordCount(params);
        QueryResultVo<List<VoIntakeAmountDay>> rsVo = new QueryResultVo<>();
        rsVo.pageSize = vo.pageSize;
        rsVo.pageCurr = vo.pageCurr;
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = rmIntakeAmountDayMapper.getIntakeAmountDayHistory(params);
        return rsVo;
    }
    /**
     * 获得一页取水口日取水量漏损记录(最新)
     * @param vo
     * @return
     */
    public QueryResultVo<List<VoIntakeAmountDay>> getIntakeAmountDayLast(IntakeAmountDayQueryVo vo) {
        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(vo);
        Long itemTotal = rmIntakeAmountDayLastMapper.getRecordCount(params);
        QueryResultVo<List<VoIntakeAmountDay>> rsVo = new QueryResultVo<>();
        rsVo.pageSize = vo.pageSize;
        rsVo.pageCurr = vo.pageCurr;
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = rmIntakeAmountDayLastMapper.getIntakeAmountDayLast(params);
        return rsVo;
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/lossDay/LossDayCtrl.java
New file
@@ -0,0 +1,98 @@
package com.dy.pipIrrRemote.records.lossDay;
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.common.webUtil.ResultCodeMsg;
import com.dy.pipIrrGlobal.voRm.VoIntakeAmountDay;
import com.dy.pipIrrGlobal.voRm.VoLossDay;
import com.dy.pipIrrGlobal.voSe.VoActiveCard;
import com.dy.pipIrrRemote.records.intakeAmountDay.IntakeAmountDayQueryVo;
import com.dy.pipIrrRemote.records.intakeAmountDay.IntakeAmountDaySv;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
 * @author :WuZeYu
 * @Date :2024/7/24  15:29
 * @LastEditTime :2024/7/24  15:29
 * @Description
 */
@Slf4j
@Tag(name = "漏损记录查询", description = "漏损记录查询")
@RestController
@RequestMapping(path = "lossDay")
public class LossDayCtrl {
    @Autowired
    private LossDaySv lossDaySv;
    /**
     * 根据指定条件获取漏损记录列表(历史)
     *
     * @param vo 查询条件
     * @return 符合条件的漏损记录列表(历史)
     */
    @Operation(summary = "获得一页漏损记录记录", description = "返回一页漏损记录数据")
    @ApiResponses(value = {
            @ApiResponse(
                    responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
                    description = "返回一页漏损记录数据(BaseResponse.content:QueryResultVo[{}])",
                    content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
                            schema = @Schema(implementation = VoActiveCard.class))}
            )
    })
    @GetMapping(path = "/getLossDayHistory")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoLossDay>>> getLossDayHistory(@RequestBody LossDayQueryVo vo) {
        try {
            QueryResultVo<List<VoLossDay>> res = lossDaySv.getLossDayHistory(vo);
            return BaseResponseUtils.buildSuccess(res);
        } catch (Exception e) {
            log.error("获取漏损记录记录异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
    }
    /**
     * 根据指定条件获取漏损记录列表(最新)
     *
     * @param vo 查询条件
     * @return 符合条件的漏损记录列表(最新)
     */
    @Operation(summary = "获得一页漏损记录记录", description = "返回一页漏损记录数据")
    @ApiResponses(value = {
            @ApiResponse(
                    responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
                    description = "返回一页漏损记录数据(BaseResponse.content:QueryResultVo[{}])",
                    content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
                            schema = @Schema(implementation = VoActiveCard.class))}
            )
    })
    @GetMapping(path = "/getLossDayLast")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoLossDay>>> getLossDayLast(@RequestBody LossDayQueryVo vo) {
        try {
            QueryResultVo<List<VoLossDay>> res = lossDaySv.getLossDayLast(vo);
            return BaseResponseUtils.buildSuccess(res);
        } catch (Exception e) {
            log.error("获取漏损记录记录异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/lossDay/LossDayQueryVo.java
New file
@@ -0,0 +1,33 @@
package com.dy.pipIrrRemote.records.lossDay;
import com.dy.common.webUtil.QueryConditionVo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.sql.Date;
/**
 * @author :WuZeYu
 * @Date :2024/7/24  15:44
 * @LastEditTime :2024/7/24  15:44
 * @Description
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ToString(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Schema(name = "漏损记录查询条件")
public class LossDayQueryVo extends QueryConditionVo {
    @Schema(description = "取水口名称", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private String intakeName;
    @Schema(description = "统计开始日期", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Date startDt;
    @Schema(description = "统计结束日期", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Date endDt;
}
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/lossDay/LossDaySv.java
New file
@@ -0,0 +1,71 @@
package com.dy.pipIrrRemote.records.lossDay;
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pipIrrGlobal.daoRm.RmLossDayMapper;
import com.dy.pipIrrGlobal.daoRm.RmLossDayLastMapper;
import com.dy.pipIrrGlobal.voRm.VoLossDay;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.common.utils.PojoUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
 * @author :WuZeYu
 * @Date :2024/7/24  15:29
 * @LastEditTime :2024/7/24  15:29
 * @Description
 */
@Slf4j
@Service
public class LossDaySv {
    @Autowired
    private RmLossDayMapper rmLossHistoryMapper;
    @Autowired
    private RmLossDayLastMapper rmLossLastMapper;
    /**
     * 获得一页漏损记录查询(历史)
     * @param vo
     * @return
     */
    public QueryResultVo<List<VoLossDay>> getLossDayHistory(LossDayQueryVo vo) {
        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(vo);
        Long itemTotal = rmLossHistoryMapper.getRecordCount(params);
        QueryResultVo<List<VoLossDay>> rsVo = new QueryResultVo<>();
        rsVo.pageSize = vo.pageSize;
        rsVo.pageCurr = vo.pageCurr;
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = rmLossHistoryMapper.getLossDayHistory(params);
        return rsVo;
    }
    /**
     * 获得一页漏损记录查询(最新)
     * @param vo
     * @return
     */
    public QueryResultVo<List<VoLossDay>> getLossDayLast(LossDayQueryVo vo) {
        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(vo);
        Long itemTotal = rmLossLastMapper.getRecordCount(params);
        QueryResultVo<List<VoLossDay>> rsVo = new QueryResultVo<>();
        rsVo.pageSize = vo.pageSize;
        rsVo.pageCurr = vo.pageCurr;
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = rmLossLastMapper.getLossDayLast(params);
        return rsVo;
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/report/ReportCtrl.java
New file
@@ -0,0 +1,45 @@
package com.dy.pipIrrRemote.report;
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.voRm.VoOnHour;
import com.dy.pipIrrRemote.report.qo.ReportQO;
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-07-23 16:01
 * @LastEditTime 2024-07-23 16:01
 * @Description 各类数据报控制类
 */
@Slf4j
@RestController
@RequestMapping(path = "report")
@RequiredArgsConstructor
public class ReportCtrl {
    private final ReportSv reportSv;
    /**
     * 根据指定条件获取整点报历史记录
     * @param qo
     * @return
     */
    @GetMapping(path = "/on_hour_report_history")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoOnHour>>> getOnHourReportHistory(ReportQO qo){
        try {
            return BaseResponseUtils.buildSuccess(reportSv.getOnHourReportsHistory(qo));
        } catch (Exception e) {
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/report/ReportSv.java
New file
@@ -0,0 +1,72 @@
package com.dy.pipIrrRemote.report;
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pipIrrGlobal.daoRm.*;
import com.dy.pipIrrGlobal.voRm.VoOnHour;
import com.dy.pipIrrRemote.report.qo.ReportQO;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.common.utils.PojoUtils;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
 * @author ZhuBaoMin
 * @date 2024-07-23 16:02
 * @LastEditTime 2024-07-23 16:02
 * @Description 各类数据报服务类
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class ReportSv {
    // 阀控器整点报DAO
    private final RmOnHourReportHistoryMapper rmOnHourReportHistoryMapper;
    private final RmOnHourReportLastMapper rmOnHourReportLastMapper;
    // 阀控器开关阀报DAO
    private final RmOpenCloseValveHistoryMapper rmOpenCloseValveHistoryMapper;
    private final RmOpenCloseValveLastMapper rmOpenCloseValveLastMapper;
    // 阀控器定时报DAO
    private final RmTimingReportHistoryMapper rmTimingReportHistoryMapper;
    private final RmTimingReportLastMapper rmTimingReportLastMapper;
    // 工作报DAO
    private final RmWorkReportHistoryMapper rmWorkReportHistoryMapper;
    private final RmWorkReportLastMapper rmWorkReportLastMapper;
    /**
     * 根据指定条件获取整点报历史记录
     * @param qo
     * @return
     */
    public QueryResultVo<List<VoOnHour>> getOnHourReportsHistory(ReportQO qo) {
        String timeStart = qo.getTimeStart();
        String timeStop = qo.getTimeStop();
        if(timeStart != null) {
            timeStart = timeStart + " 00:00:00";
            qo.setTimeStart(timeStart);
        }
        if(timeStop != null) {
            timeStop = timeStop + " 23:59:59";
            qo.setTimeStop(timeStop);
        }
        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo);
        Long itemTotal = rmOnHourReportHistoryMapper.getOnHourReportsCount_history(params);
        QueryResultVo<List<VoOnHour>> rsVo = new QueryResultVo<>() ;
        rsVo.pageSize = qo.pageSize ;
        rsVo.pageCurr = qo.pageCurr ;
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = rmOnHourReportHistoryMapper.getOnHourReports_history(params);
        return rsVo ;
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/report/qo/ReportQO.java
New file
@@ -0,0 +1,40 @@
package com.dy.pipIrrRemote.report.qo;
import com.dy.common.webUtil.QueryConditionVo;
import lombok.*;
/**
 * @author ZhuBaoMin
 * @date 2024-07-23 16:31
 * @LastEditTime 2024-07-23 16:31
 * @Description
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ToString(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class ReportQO extends QueryConditionVo {
    /**
     * 取水口编号
     */
    private String intakeNum;
    /**
     * 阀控器地址
     */
    private String rtuAddr;
    /**
     * 查询开始日期
     */
    private String timeStart;
    /**
     * 查询结束日期
     */
    private String timeStop;
}
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/CardOperateCtrl.java
@@ -10,6 +10,7 @@
import com.dy.pipIrrGlobal.pojoBa.BaClient;
import com.dy.pipIrrGlobal.pojoSe.SeCardOperate;
import com.dy.pipIrrGlobal.pojoSe.SeClientCard;
import com.dy.pipIrrGlobal.pojoSe.SeManagerCard;
import com.dy.pipIrrGlobal.util.AmountToChinese;
import com.dy.pipIrrGlobal.voSe.VoActiveCard;
import com.dy.pipIrrGlobal.voSe.VoOperate;
@@ -31,6 +32,7 @@
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.BindingResult;
@@ -55,6 +57,8 @@
    private final CardOperateSv cardOperateSv;
    private final ClientCardSv clientCardSv;
    @Value("${project.divisionCode}")
    private String divisionCode;
    /**
     * 开卡
     * @param po 开卡传入对象
@@ -748,6 +752,57 @@
    }
    /**
     * 创建管理卡
     * @param po
     * @param bindingResult
     * @return
     */
    @PostMapping(path = "create_manager_card", consumes = MediaType.APPLICATION_JSON_VALUE)
    @Transactional(rollbackFor = Exception.class)
    @SsoAop()
    public BaseResponse<Boolean> createManagerCard(@RequestBody @Valid ManagerCard po, BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
        /**
         * 根据行政区划串(divisionCode)在管理卡表中针对卡片编号(cardNum)进行模糊查询
         * 如果顺序号已经达到最大值,提示用户联系系统管理员
         * 如果顺序号未达到最大值,则加1
         * cardNum为新的卡号
         */
        String cardNum = Optional.ofNullable(cardOperateSv.getManagerCardNumOfMax(divisionCode)).orElse("");
        if(cardNum != null && cardNum.trim().length() > 0) {
            Integer number = Integer.parseInt(cardNum.substring(12));
            number = number + 1;
            if(number > 65535) {
                return BaseResponseUtils.buildErrorMsg(SellResultCode.CARD_NUMBER_OVERRUN.getMessage());
            }
            cardNum = cardNum.substring(0, 12) + String.format("%05d", number);
        } else {
            cardNum = divisionCode + "00001";
        }
        SeManagerCard seManagerCard = new SeManagerCard();
        seManagerCard.setCardAddr(po.getCardAddr());
        seManagerCard.setCardNum(cardNum);
        seManagerCard.setCardType(po.getCardType());
        seManagerCard.setCreateTime(new Date());
        seManagerCard.setRemarks(po.getRemarks());
        Long managerCardId = cardOperateSv.addManagerCard(seManagerCard);
        if(managerCardId == 0) {
            return BaseResponseUtils.buildErrorMsg(SellResultCode.CREATE_MANAGER_CARD_ERROR.getMessage());
        }
        return BaseResponseUtils.buildSuccess(cardNum);
        //Map map = new HashMap();
        //map.put("cardNum", cardNum);
        //return BaseResponseUtils.buildSuccess(map) ;
    }
    /**
     * 获取充值记录
     * @param vo
     * @return
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/CardOperateSv.java
@@ -7,12 +7,10 @@
import com.dy.common.webUtil.BaseResponseUtils;
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pipIrrGlobal.daoBa.BaSettingsMapper;
import com.dy.pipIrrGlobal.daoSe.SeCardOperateMapper;
import com.dy.pipIrrGlobal.daoSe.SeClientCardMapper;
import com.dy.pipIrrGlobal.daoSe.SeClientMapper;
import com.dy.pipIrrGlobal.daoSe.SeGeneralMapper;
import com.dy.pipIrrGlobal.daoSe.*;
import com.dy.pipIrrGlobal.pojoSe.SeCardOperate;
import com.dy.pipIrrGlobal.pojoSe.SeClientCard;
import com.dy.pipIrrGlobal.pojoSe.SeManagerCard;
import com.dy.pipIrrGlobal.voSe.*;
import com.dy.pipIrrSell.cardOperate.dto.DtoRecharge;
import com.dy.pipIrrSell.cardOperate.enums.OperateTypeENUM;
@@ -56,6 +54,9 @@
    @Autowired
    private BaSettingsMapper baSettingsMapper;
    @Autowired
    private SeManagerCardMapper seManagerCardMapper;
    /**
     * 添加开卡记录
@@ -88,16 +89,36 @@
    public Long getAreaCodeById(Long clientId) {
        return seClientMapper.getAreaCodeById(clientId);
    }
    /**
     * 根据行政区划串模块查询水卡编号,开卡使用
     * @param areaCode
     * @return
     */
    String getCardNumOfMax(String areaCode) {
    public String getCardNumOfMax(String areaCode) {
        return seClientCardMapper.getCardNumOfMax(areaCode);
    }
    /**
     * 根据行政区划串模糊查询管理卡编号,创建管理卡使用
     * @param areaCode
     * @return
     */
    public String getManagerCardNumOfMax(String areaCode) {
        return seManagerCardMapper.getManagerCardNumOfMax(areaCode);
    }
    /**
     * 创建管理卡
     * @param po
     * @return
     */
    public Long addManagerCard(SeManagerCard po) {
        seManagerCardMapper.insert(po);
        return po.getId();
    }
    /**
     * 根据农户编号获取农户ID,开卡使用
     * @param clientNum
     * @return
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/dto/ManagerCard.java
New file
@@ -0,0 +1,33 @@
package com.dy.pipIrrSell.cardOperate.dto;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
/**
 * @author ZhuBaoMin
 * @date 2024-07-24 11:25
 * @LastEditTime 2024-07-24 11:25
 * @Description 管理卡传输对象
 */
@Data
public class ManagerCard {
    public static final long serialVersionUID = 202407241125001L;
    /**
     * 水卡地址,仅保存,无业务
     */
    @NotBlank(message = "水卡地址不能为空")
    private String cardAddr;
    /**
     * 卡片类型,2-管理科,4-开关阀卡,5-清空卡
     */
    private Byte cardType;
    /**
     * 备注信息
     */
    private String remarks;
}
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/result/SellResultCode.java
@@ -28,13 +28,12 @@
    No_ActiveCards(10009, "没有符合条件的开卡数据"),
    No_RECHARGES(10010, "没有符合条件的充值数据"),
    No_ReissueCards(10011, "没有符合条件的补卡数据"),
    No_CANCELS(10010, "没有符合条件的注销数据"),
    PARAMS_ERROR(10010, "操作类型参数错误"),
    THE_CARD_NOT_EXIST(10012, "没有符合条件的水卡"),
    THE_CARD_NOT_SUPPORT_THIS_OPERATION(10013, "水卡状态不支持当前操作"),
    THE_FEE_CANNOT_BE_REFUNDED(10014, "原卡挂失时已退款,补卡时不能补费用"),
    No_CANCELS(10012, "没有符合条件的注销数据"),
    PARAMS_ERROR(10013, "操作类型参数错误"),
    CREATE_MANAGER_CARD_ERROR(10014, "创建管理卡失败"),
    THE_CARD_NOT_EXIST(10015, "没有符合条件的水卡"),
    THE_CARD_NOT_SUPPORT_THIS_OPERATION(10016, "水卡状态不支持当前操作"),
    THE_FEE_CANNOT_BE_REFUNDED(10017, "原卡挂失时已退款,补卡时不能补费用"),
    /**
     * 充值
pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/statistics/StClient.java
@@ -1,6 +1,5 @@
package com.dy.pipIrrStatistics.statistics;
import com.dy.pipIrrGlobal.daoRm.RmClientAmountDayMapper;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/statistics/StIntakeSv.java
@@ -5,7 +5,9 @@
import com.dy.pipIrrGlobal.daoSt.StIntakeAmountYearMapper;
import com.dy.pipIrrGlobal.pojoSt.StIntakeAmountMonth;
import com.dy.pipIrrGlobal.pojoSt.StIntakeAmountYear;
import com.dy.pipIrrGlobal.pojoSt.StLossYear;
import com.dy.pipIrrGlobal.voSt.VoIntakeAmountStatistics;
import com.dy.pipIrrGlobal.voSt.VoIntakeLossStatistics;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
@@ -63,4 +65,5 @@
            }
        }
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/statistics/StatisticsJob.java
@@ -36,7 +36,6 @@
    @Override
    public void execute(JobExecutionContext ctx) throws JobExecutionException {
        stLoss = SpringContextUtil.getBean(StLoss.class);
        stIntake = SpringContextUtil.getBean(StIntake.class);
        stClient = SpringContextUtil.getBean(StClient.class);