增加删除取水口水量月统计年统计重复数据功能,增加删除农户用水量月统计年统计重复数据功能,
5 文件已复制
3个文件已修改
1个文件已删除
1 文件已重命名
3个文件已添加
569 ■■■■ 已修改文件
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoTmp/DeleteMapper.java 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStClientAmountMonth.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStClientAmountYear.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStIntakeAmountMonth.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStIntakeAmountYear.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStLossAmountMonth.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStLossAmountYear.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/Temp4DeleteMapper.xml 106 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-temp/src/main/java/com/dy/pipIrrTemp/delSome/DelSomeClientAmountSv.java 96 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-temp/src/main/java/com/dy/pipIrrTemp/delSome/DelSomeCtrl.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-temp/src/main/java/com/dy/pipIrrTemp/delSome/DelSomeIntakeAmountSv.java 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-temp/src/main/java/com/dy/pipIrrTemp/delSome/DelSomeLossAmountSv.java 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-temp/src/main/java/com/dy/pipIrrTemp/delSome/DelSomeSv.java 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoTmp/DeleteMapper.java
@@ -1,7 +1,7 @@
package com.dy.pipIrrGlobal.daoTmp;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dy.pipIrrGlobal.voTmp.VoStLossMonth;
import com.dy.pipIrrGlobal.voTmp.*;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@@ -16,9 +16,58 @@
    /**
     * 查询全部漏损月统计
     *
     * @return 实体集合
     */
    List<VoStLossMonth> selectAllStLossMonth() ;
    List<VoStLossAmountMonth> selectAllStLossMonth();
    int deleteStLossMonthById(Long id) ;
    int deleteStLossMonthById(Long id);
    /**
     * 查询全部漏损年统计
     *
     * @return 实体集合
     */
    List<VoStLossAmountYear> selectAllStLossYear();
    int deleteStLossYearById(Long id);
    /**
     * 查询全部取水口月统计
     *
     * @return 实体集合
     */
    List<VoStIntakeAmountMonth> selectAllStIntakeMonth();
    int deleteStIntakeMonthById(Long id);
    /**
     * 查询全部取水口年统计
     *
     * @return 实体集合
     */
    List<VoStIntakeAmountYear> selectAllStIntakeYear();
    int deleteStIntakeYearById(Long id);
    /**
     * 查询全部农户月统计
     *
     * @return 实体集合
     */
    List<VoStClientAmountMonth> selectAllStClientMonth();
    int deleteStClientMonthById(Long id);
    /**
     * 查询全部农户年统计
     *
     * @return 实体集合
     */
    List<VoStClientAmountYear> selectAllStClientYear();
    int deleteStClientYearById(Long id);
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStClientAmountMonth.java
copy from pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStLossMonth.java copy to pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStClientAmountMonth.java
File was copied from pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStLossMonth.java
@@ -8,9 +8,9 @@
 * @Description
 */
@Data
public class VoStLossMonth {
public class VoStClientAmountMonth {
    public Long id ;
    public Long intakeId ;
    public Long clientId ;
    public Integer year ;
    public Integer month ;
    public Double amount ;
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStClientAmountYear.java
copy from pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStLossMonth.java copy to pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStClientAmountYear.java
File was copied from pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStLossMonth.java
@@ -8,10 +8,9 @@
 * @Description
 */
@Data
public class VoStLossMonth {
public class VoStClientAmountYear {
    public Long id ;
    public Long intakeId ;
    public Long clientId ;
    public Integer year ;
    public Integer month ;
    public Double amount ;
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStIntakeAmountMonth.java
copy from pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStLossMonth.java copy to pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStIntakeAmountMonth.java
File was copied from pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStLossMonth.java
@@ -8,7 +8,7 @@
 * @Description
 */
@Data
public class VoStLossMonth {
public class VoStIntakeAmountMonth {
    public Long id ;
    public Long intakeId ;
    public Integer year ;
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStIntakeAmountYear.java
copy from pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStLossMonth.java copy to pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStIntakeAmountYear.java
File was copied from pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStLossMonth.java
@@ -8,10 +8,9 @@
 * @Description
 */
@Data
public class VoStLossMonth {
public class VoStIntakeAmountYear {
    public Long id ;
    public Long intakeId ;
    public Integer year ;
    public Integer month ;
    public Double amount ;
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStLossAmountMonth.java
File was renamed from pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStLossMonth.java
@@ -8,7 +8,7 @@
 * @Description
 */
@Data
public class VoStLossMonth {
public class VoStLossAmountMonth {
    public Long id ;
    public Long intakeId ;
    public Integer year ;
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStLossAmountYear.java
copy from pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStLossMonth.java copy to pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStLossAmountYear.java
File was copied from pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStLossMonth.java
@@ -8,10 +8,9 @@
 * @Description
 */
@Data
public class VoStLossMonth {
public class VoStLossAmountYear {
    public Long id ;
    public Long intakeId ;
    public Integer year ;
    public Integer month ;
    public Double amount ;
}
pipIrr-platform/pipIrr-global/src/main/resources/mapper/Temp4DeleteMapper.xml
@@ -1,18 +1,98 @@
<?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.daoTmp.DeleteMapper">
  <select id="selectAllStLossMonth" resultType="com.dy.pipIrrGlobal.voTmp.VoStLossMonth">
    select id as id,
            intake_id as intakeId ,
            year as year,
            month as month,
            amount as amount
    from  st_loss_month
    order by intake_id DESC, id DESC
  </select>
    <!-- 漏损统计相关 -->
    <select id="selectAllStLossMonth" resultType="com.dy.pipIrrGlobal.voTmp.VoStLossAmountMonth">
        select id as id,
               intake_id as intakeId ,
               year as year,
               month as month,
               amount as amount
        from  st_loss_month
        order by intake_id DESC, id DESC
    </select>
  <delete id="deleteStLossMonthById" parameterType="java.lang.Long">
    delete from st_loss_month
    where id = #{id,jdbcType=BIGINT}
  </delete>
    <delete id="deleteStLossMonthById" parameterType="java.lang.Long">
        delete from st_loss_month
        where id = #{id,jdbcType=BIGINT}
    </delete>
    <select id="selectAllStLossYear" resultType="com.dy.pipIrrGlobal.voTmp.VoStLossAmountYear">
        select id as id,
               intake_id as intakeId ,
               year as year,
               amount as amount
        from  st_loss_year
        order by intake_id DESC, id DESC
    </select>
    <delete id="deleteStLossYearById" parameterType="java.lang.Long">
        delete from st_loss_year
        where id = #{id,jdbcType=BIGINT}
    </delete>
    <!-- 取水口统计相关 -->
    <select id="selectAllStIntakeMonth" resultType="com.dy.pipIrrGlobal.voTmp.VoStIntakeAmountMonth">
        select id as id,
               intake_id as intakeId ,
               year as year,
               month as month,
               amount as amount
        from  st_intake_amount_month
        order by intake_id DESC, id DESC
    </select>
    <delete id="deleteStIntakeMonthById" parameterType="java.lang.Long">
        delete from st_intake_amount_month
        where id = #{id,jdbcType=BIGINT}
    </delete>
    <select id="selectAllStIntakeYear" resultType="com.dy.pipIrrGlobal.voTmp.VoStIntakeAmountYear">
        select id as id,
               intake_id as intakeId ,
               year as year,
               amount as amount
        from  st_intake_amount_year
        order by intake_id DESC, id DESC
    </select>
    <delete id="deleteStIntakeYearById" parameterType="java.lang.Long">
        delete from st_intake_amount_year
        where id = #{id,jdbcType=BIGINT}
    </delete>
    <!-- 农户统计相关 -->
    <select id="selectAllStClientMonth" resultType="com.dy.pipIrrGlobal.voTmp.VoStClientAmountMonth">
        select id as id,
               client_id as clientId ,
               year as year,
               month as month,
               amount as amount
        from  st_client_amount_month
        order by client_id DESC, id DESC
    </select>
    <delete id="deleteStClientMonthById" parameterType="java.lang.Long">
        delete from st_client_amount_month
        where id = #{id,jdbcType=BIGINT}
    </delete>
    <select id="selectAllStClientYear" resultType="com.dy.pipIrrGlobal.voTmp.VoStClientAmountYear">
        select id as id,
               client_id as clientId ,
               year as year,
               amount as amount
        from  st_client_amount_year
        order by client_id DESC, id DESC
    </select>
    <delete id="deleteStClientYearById" parameterType="java.lang.Long">
        delete from st_client_amount_year
        where id = #{id,jdbcType=BIGINT}
    </delete>
</mapper>
pipIrr-platform/pipIrr-web/pipIrr-web-temp/src/main/java/com/dy/pipIrrTemp/delSome/DelSomeClientAmountSv.java
New file
@@ -0,0 +1,96 @@
package com.dy.pipIrrTemp.delSome;
import com.dy.pipIrrGlobal.daoTmp.DeleteMapper;
import com.dy.pipIrrGlobal.voTmp.VoStClientAmountMonth;
import com.dy.pipIrrGlobal.voTmp.VoStClientAmountYear;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
 * @Author: liurunyu
 * @Date: 2024/12/11 10:54
 * @Description
 */
@Slf4j
@Service
public class DelSomeClientAmountSv {
    private DeleteMapper dao;
    @Autowired
    private void setDao(DeleteMapper dao){
        this.dao = dao;
    }
    public void delStClientMonth(){
        VoStClientAmountMonth first = null ;
        List<VoStClientAmountMonth> list = dao.selectAllStClientMonth() ;
        if(list != null && list.size() > 0){
            for(VoStClientAmountMonth vo : list){
                if(first == null){
                    first = vo ;
                }else{
                    if(first.clientId.longValue() != vo.clientId.longValue()){
                        //农户变了
                        first = vo ;
                    }else{
                        if(first.year.intValue() != vo.year.intValue()) {
                            //年度变了
                            first = vo ;
                        }else{
                            if(first.month.intValue() != vo.month.intValue()){
                                //月份变了
                                first = vo ;
                            }else{
                                //同一个农户同年同月
                                doDelStClientMonth(vo.id) ;
                            }
                        }
                    }
                }
            }
        }
    }
    public void delStClientYear(){
        VoStClientAmountYear first = null ;
        List<VoStClientAmountYear> list = dao.selectAllStClientYear() ;
        if(list != null && list.size() > 0){
            for(VoStClientAmountYear vo : list){
                if(first == null){
                    first = vo ;
                }else{
                    if(first.clientId.longValue() != vo.clientId.longValue()){
                        //农户变了
                        first = vo ;
                    }else{
                        if(first.year.intValue() != vo.year.intValue()) {
                            //年度变了
                            first = vo ;
                        }else{
                            //同一个农户同年
                            doDelStClientYear(vo.id) ;
                        }
                    }
                }
            }
        }
    }
    @Transactional
    int doDelStClientMonth(Long id){
        return dao.deleteStClientMonthById(id) ;
    }
    @Transactional
    int doDelStClientYear(Long id){
        return dao.deleteStClientYearById(id) ;
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-temp/src/main/java/com/dy/pipIrrTemp/delSome/DelSomeCtrl.java
@@ -20,11 +20,18 @@
@SuppressWarnings("unchecked")//java版本越高,对泛型约束越严,所以配置SuppressWarnings("unchecked")
public class DelSomeCtrl {
    private DelSomeSv sv;
    private DelSomeLossAmountSv lossAmountSv;
    private DelSomeIntakeAmountSv intakeAmountSv;
    private DelSomeClientAmountSv clientAmountSv;
    @Autowired
    private void setSv(DelSomeSv sv) {
        this.sv = sv;
    private void setSv(DelSomeLossAmountSv sv) {
        this.lossAmountSv = sv;
    }
    @Autowired
    private void setSv(DelSomeIntakeAmountSv sv) {
        this.intakeAmountSv = sv;
    }
    /**
@@ -34,7 +41,32 @@
    @GetMapping(path = "deleteSomeStatisticLossAmount")
    @SsoAop()
    public BaseResponse<Boolean> deleteSomeStatisticLossAmount(){
        this.sv.delStLossMonth();
        this.lossAmountSv.delStLossMonth();
        this.lossAmountSv.delStLossYear();
        return BaseResponseUtils.buildSuccess(true);
    }
    /**
     * 删除一些取水口统计
     * @return
     */
    @GetMapping(path = "deleteSomeStatisticIntakeAmount")
    @SsoAop()
    public BaseResponse<Boolean> deleteSomeStatisticIntakeAmount(){
        this.intakeAmountSv.delStIntakeMonth();
        this.intakeAmountSv.delStIntakeYear();
        return BaseResponseUtils.buildSuccess(true);
    }
    /**
     * 删除一些农户统计
     * @return
     */
    @GetMapping(path = "deleteSomeStatisticClientAmount")
    @SsoAop()
    public BaseResponse<Boolean> deleteSomeStatisticClientAmount(){
        this.clientAmountSv.delStClientMonth();
        this.clientAmountSv.delStClientYear();
        return BaseResponseUtils.buildSuccess(true);
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-temp/src/main/java/com/dy/pipIrrTemp/delSome/DelSomeIntakeAmountSv.java
New file
@@ -0,0 +1,95 @@
package com.dy.pipIrrTemp.delSome;
import com.dy.pipIrrGlobal.daoTmp.DeleteMapper;
import com.dy.pipIrrGlobal.voTmp.VoStIntakeAmountMonth;
import com.dy.pipIrrGlobal.voTmp.VoStIntakeAmountYear;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
 * @Author: liurunyu
 * @Date: 2024/12/11 10:54
 * @Description
 */
@Slf4j
@Service
public class DelSomeIntakeAmountSv {
    private DeleteMapper dao;
    @Autowired
    private void setDao(DeleteMapper dao){
        this.dao = dao;
    }
    public void delStIntakeMonth(){
        VoStIntakeAmountMonth first = null ;
        List<VoStIntakeAmountMonth> list = dao.selectAllStIntakeMonth() ;
        if(list != null && list.size() > 0){
            for(VoStIntakeAmountMonth vo : list){
                if(first == null){
                    first = vo ;
                }else{
                    if(first.intakeId.longValue() != vo.intakeId.longValue()){
                        //取水口变了
                        first = vo ;
                    }else{
                        if(first.year.intValue() != vo.year.intValue()) {
                            //年度变了
                            first = vo ;
                        }else{
                            if(first.month.intValue() != vo.month.intValue()){
                                //月份变了
                                first = vo ;
                            }else{
                                //同一个取水口同年同月
                                doDelStIntakeMonth(vo.id) ;
                            }
                        }
                    }
                }
            }
        }
    }
    public void delStIntakeYear(){
        VoStIntakeAmountYear first = null ;
        List<VoStIntakeAmountYear> list = dao.selectAllStIntakeYear() ;
        if(list != null && list.size() > 0){
            for(VoStIntakeAmountYear vo : list){
                if(first == null){
                    first = vo ;
                }else{
                    if(first.intakeId.longValue() != vo.intakeId.longValue()){
                        //取水口变了
                        first = vo ;
                    }else{
                        if(first.year.intValue() != vo.year.intValue()) {
                            //年度变了
                            first = vo ;
                        }else{
                            //同一个取水口同年
                            doDelStIntakeYear(vo.id) ;
                        }
                    }
                }
            }
        }
    }
    @Transactional
    int doDelStIntakeMonth(Long id){
        return dao.deleteStIntakeMonthById(id) ;
    }
    @Transactional
    int doDelStIntakeYear(Long id){
        return dao.deleteStIntakeYearById(id) ;
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-temp/src/main/java/com/dy/pipIrrTemp/delSome/DelSomeLossAmountSv.java
New file
@@ -0,0 +1,95 @@
package com.dy.pipIrrTemp.delSome;
import com.dy.pipIrrGlobal.daoTmp.DeleteMapper;
import com.dy.pipIrrGlobal.voTmp.VoStLossAmountMonth;
import com.dy.pipIrrGlobal.voTmp.VoStLossAmountYear;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
 * @Author: liurunyu
 * @Date: 2024/12/11 10:54
 * @Description
 */
@Slf4j
@Service
public class DelSomeLossAmountSv {
    private DeleteMapper dao;
    @Autowired
    private void setDao(DeleteMapper dao){
        this.dao = dao;
    }
    public void delStLossMonth(){
        VoStLossAmountMonth first = null ;
        List<VoStLossAmountMonth> list = dao.selectAllStLossMonth() ;
        if(list != null && list.size() > 0){
            for(VoStLossAmountMonth vo : list){
                if(first == null){
                    first = vo ;
                }else{
                    if(first.intakeId.longValue() != vo.intakeId.longValue()){
                        //取水口变了
                        first = vo ;
                    }else{
                        if(first.year.intValue() != vo.year.intValue()) {
                            //年度变了
                            first = vo ;
                        }else{
                            if(first.month.intValue() != vo.month.intValue()){
                                //月份变了
                                first = vo ;
                            }else{
                                //同一个取水口同年同月
                                doDelStLossMonth(vo.id) ;
                            }
                        }
                    }
                }
            }
        }
    }
    public void delStLossYear(){
        VoStLossAmountYear first = null ;
        List<VoStLossAmountYear> list = dao.selectAllStLossYear() ;
        if(list != null && list.size() > 0){
            for(VoStLossAmountYear vo : list){
                if(first == null){
                    first = vo ;
                }else{
                    if(first.intakeId.longValue() != vo.intakeId.longValue()){
                        //取水口变了
                        first = vo ;
                    }else{
                        if(first.year.intValue() != vo.year.intValue()) {
                            //年度变了
                            first = vo ;
                        }else{
                            //同一个取水口同年
                            doDelStLossYear(vo.id) ;
                        }
                    }
                }
            }
        }
    }
    @Transactional
    int doDelStLossMonth(Long id){
        return dao.deleteStLossMonthById(id) ;
    }
    @Transactional
    int doDelStLossYear(Long id){
        return dao.deleteStLossYearById(id) ;
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-temp/src/main/java/com/dy/pipIrrTemp/delSome/DelSomeSv.java
File was deleted