wuzeyu
2024-01-02 5683c6a1ee9839ce3d87265865ca9b284730b9f4
Merge remote-tracking branch 'origin/master'
56个文件已修改
27个文件已添加
3364 ■■■■■ 已修改文件
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/CodeV1_0_1.java 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/CommonV1_0_1.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/DataCd10Vo.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/DataCd21Vo.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/DataCd92Vo.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/DataCd93Vo.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/DataV1_0_1.java 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_10_Down.java 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_10_Up.java 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_21_Down.java 106 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_21_Up.java 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_66_Down.java 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_66_Up.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_71_Down.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_83_Down.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_83_Up.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_84_Down.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_92_Down.java 97 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_92_Up.java 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_93_Down.java 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_93_Up.java 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_C0_Down.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/global/GlCreate.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/ByteUtil.java 60 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaDistrictMapper.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoPr/PrControllerMapper.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoPr/PrDivideMapper.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeClientCardMapper.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeClientMapper.java 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoPr/PrController.java 84 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeClient.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeClientCard.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voPr/VoController.java 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoCardInfo.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoClient.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoOperate.java 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoStatistics.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/application-global.yml 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaDistrictMapper.xml 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrControllerMapper.xml 128 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrDivideMapper.xml 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeClientCardMapper.xml 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeClientMapper.xml 306 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/web/com/CommandCtrl.java 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/web/comResult/CommandResultDeal.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/block/BlockCtrl.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/client/ClientCtrl.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/clientType/ClientTypeCtrl.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/district/DistrictCtrl.java 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/district/DistrictSv.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/divide/DivideCtrl.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/role/RoleCtrl.java 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserCtrl.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/PipIrrProjectApplication.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/controller/ControllerCtrl.java 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/controller/ControllerSv.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/controller/QueryVo.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/divide/DivideCtrl.java 147 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/divide/DivideSv.java 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/divide/QueryVo.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/result/ProjectResultCode.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/activeCard/ActiveCardCtrl.java 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/activeCard/ActiveCardSv.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cancel/CancelCtrl.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cancel/CancelSv.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cancel/QueryVo.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/ClientCtrl.java 120 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/ClientSv.java 156 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/DtoClient.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/DtoClientToSeClient.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/QueryOperate.java 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/QueryStatistic.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/clientCard/ClientCardCtrl.java 116 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/clientCard/ClientCardSv.java 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/loss/LossCtrl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/loss/LossSv.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/recharge/RechargeCtrl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/recharge/RechargeSv.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/reversal/ReversalCtrl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/reversal/ReversalSv.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/unlock/UnlockCtrl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/unlock/UnlockSv.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wallet/WalletCtrl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/CodeV1_0_1.java
@@ -3,18 +3,30 @@
public class CodeV1_0_1 {
    //功能码为字符串,十六进制数据
    public static final String cd_02 = "02" ;//遥测站链路检测
    public static final String cd_10 = "10" ;//设置遥测站终端地址
    public static final String cd_21 = "21" ;//设置服务端IP和端口
    public static final String cd_50 = "50" ;//查询遥测站终端地址
    public static final String cd_66 = "66" ;//查询阀门状态(靳总把该命令设计成召测83功能码数据的命令了,因为这个命令回执没有阀门状态数据域,所以这个命令只能作为召测命令用了)
    public static final String cd_71 = "71" ;//设置工作模式(李天赐制定的协议,当前未实现)
    public static final String cd_83 = "83" ;//遥测站开关阀自报
    public static final String cd_84 = "84" ;//开阀工作报
    public static final String cd_92 = "92" ;//遥控启动阀门
    public static final String cd_93 = "93" ;//遥控关闭阀门
    public static final String cd_C0 = "C0" ;//遥测站自报实时数据
    public static String getCodeName(String code) {
        String name = (code.equals(cd_02) ? "链路检测" :
            (code.equals(cd_71) ? "查询阀门状态" :
            (code.equals(cd_10) ? "设置遥测站终端地址" :
            (code.equals(cd_21) ? "设置IP和端口" :
            (code.equals(cd_50) ? "查询遥测站终端地址" :
            (code.equals(cd_66) ? "查询阀门状态" :
            (code.equals(cd_71) ? "设置工作模式" :
            (code.equals(cd_83) ? "开关阀自报" :
            (code.equals(cd_84) ? "开阀工作报" :
            (code.equals(cd_92) ? "遥控启动阀门" :
            (code.equals(cd_93) ? "遥控关闭阀门" :
            (code.equals(cd_C0) ? "自报实时数据" :
            ""))))) ;
            ""))))))))))) ;
        return name ;
    }
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/CommonV1_0_1.java
@@ -88,6 +88,24 @@
        return rtuAddrBCD + rtuAddrStr ;
    }
    /**
     * 分析Rtu地址
     * @param bs 上行字节数组
     * @param index 启始位
     * @return 控制器地址
     * @throws Exception 异常
     */
    public String parseRtuAddr(byte[] bs, int index)throws Exception{
        String rtuAddrBCD = "" + ByteUtil.BCD2Long_BE(bs, index, index + 2) ;
        String rtuAddrStr = "" + ByteUtilUnsigned.bytes2Short_BE(bs, index + 3) ;
        while(rtuAddrStr.length() < 4){
            rtuAddrStr = "0" + rtuAddrStr ;
        }
        return rtuAddrBCD + rtuAddrStr ;
    }
    /**
     * 分析功能码
     * @param bs 上行字节数组
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/DataCd10Vo.java
New file
@@ -0,0 +1,24 @@
package com.dy.common.mw.protocol.p206V1_0_0;
import lombok.Data;
/**
 * @Author liurunyu
 * @Date 2023/12/25 11:28
 * @LastEditTime 2023/12/25 11:28
 * @Description
 */
@Data
public class DataCd10Vo {
    public String newRtuAddr ;
    public String toString(){
        StringBuilder sb = new StringBuilder() ;
        sb.append("   设备RTU地址应答:\n");
        sb.append("      新地址:");
        sb.append(newRtuAddr);
        sb.append("\n");
        return sb.toString() ;
    }
}
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/DataCd21Vo.java
New file
@@ -0,0 +1,27 @@
package com.dy.common.mw.protocol.p206V1_0_0;
import lombok.Data;
/**
 * @Author liurunyu
 * @Date 2023/12/25 21:14
 * @LastEditTime 2023/12/25 21:14
 * @Description
 */
@Data
public class DataCd21Vo {
    public String ip ;
    public Integer port ;
    public String toString(){
        StringBuilder sb = new StringBuilder() ;
        sb.append("   设置IP应答:\n");
        sb.append("      IP:");
        sb.append(ip);
        sb.append("      端口:");
        sb.append(port);
        sb.append("\n");
        return sb.toString() ;
    }
}
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/DataCd92Vo.java
New file
@@ -0,0 +1,24 @@
package com.dy.common.mw.protocol.p206V1_0_0;
import lombok.Data;
/**
 * @Author liurunyu
 * @Date 2023/12/25 21:14
 * @LastEditTime 2023/12/25 21:14
 * @Description
 */
@Data
public class DataCd92Vo {
    public boolean success;
    public String toString(){
        StringBuilder sb = new StringBuilder() ;
        sb.append("   开阀应答:\n");
        sb.append("      结果:");
        sb.append(success?"执行":"失败");
        sb.append("\n");
        return sb.toString() ;
    }
}
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/DataCd93Vo.java
New file
@@ -0,0 +1,24 @@
package com.dy.common.mw.protocol.p206V1_0_0;
import lombok.Data;
/**
 * @Author liurunyu
 * @Date 2023/12/25 21:14
 * @LastEditTime 2023/12/25 21:14
 * @Description
 */
@Data
public class DataCd93Vo {
    public boolean success;
    public String toString(){
        StringBuilder sb = new StringBuilder() ;
        sb.append("   关阀应答:\n");
        sb.append("      结果:");
        sb.append(success?"执行":"失败");
        sb.append("\n");
        return sb.toString() ;
    }
}
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/DataV1_0_1.java
@@ -10,11 +10,15 @@
    public String rtuAddr ;//RtuAddr
    public DataCd02Vo dataCd02Vo;//链路检测
    public DataCdC0Vo dataCdC0Vo;//终端自报实时数据
    public DataCd10Vo dataCd10Vo;//设置RTU地址
    public DataCd21Vo dataCd21Vo;//设置IP地址
    public DataCd71Vo dataCd71Vo;//查询阀门状态
    public DataCd83OpenVo dataCd83OpenVo;//开阀自报
    public DataCd83CloseVo dataCd83CloseVo;//关阀自报
    public DataCd84Vo dataCd84Vo;//开阀工作报
    public DataCd71Vo dataCd71Vo;//查询阀门状态
    public DataCd92Vo dataCd92Vo;//开阀应答
    public DataCd93Vo dataCd93Vo;//关阀应答
    public DataCdC0Vo dataCdC0Vo;//终端自报实时数据
    public String dt ;//通信中间件产生发报时间(yyyy-MM-dd hh:mm:ss)
@@ -25,8 +29,14 @@
        if(dataCd02Vo != null){
            sb.append(dataCd02Vo.toString()) ;
        }
        if(dataCdC0Vo != null){
            sb.append(dataCdC0Vo.toString()) ;
        if(dataCd10Vo != null){
            sb.append(dataCd10Vo.toString()) ;
        }
        if(dataCd21Vo != null){
            sb.append(dataCd21Vo.toString()) ;
        }
        if(dataCd71Vo != null){
            sb.append(dataCd71Vo.toString()) ;
        }
        if(dataCd83OpenVo != null){
            sb.append(dataCd83OpenVo.toString()) ;
@@ -37,8 +47,14 @@
        if(dataCd84Vo != null){
            sb.append(dataCd84Vo.toString()) ;
        }
        if(dataCd71Vo != null){
            sb.append(dataCd71Vo.toString()) ;
        if(dataCd92Vo != null){
            sb.append(dataCd92Vo.toString()) ;
        }
        if(dataCd93Vo != null){
            sb.append(dataCd93Vo.toString()) ;
        }
        if(dataCdC0Vo != null){
            sb.append(dataCdC0Vo.toString()) ;
        }
        return sb.toString() ;
    }
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_10_Down.java
New file
@@ -0,0 +1,98 @@
package com.dy.common.mw.protocol.p206V1_0_0.parse;
import com.dy.common.mw.protocol.*;
import com.dy.common.mw.protocol.p206V1_0_0.CodeV1_0_1;
import com.dy.common.mw.protocol.p206V1_0_0.CommonV1_0_1;
import com.dy.common.mw.protocol.p206V1_0_0.ParseParamsForDownV1_0_1;
import com.dy.common.mw.protocol.p206V1_0_0.ProtocolConstantV206V1_0_0;
import com.dy.common.mw.protocol.p206V1_0_0.parse.global.GlCreate;
import com.dy.common.util.ByteUtil;
/**
 * @Author liurunyu
 * @Date 2023/12/25 11:11
 * @LastEditTime 2023/12/25 11:11
 * @Description
 */
@AnnotationCodeDown(ifAny={
        CodeV1_0_1.cd_10
})
public class Cd_10_Down implements CodeParse {
    @Override
    public MidResult[] parse(Boolean isLowPower, CodeParseParams params, CodeParseCallback callback) throws Exception {
        ParseParamsForDownV1_0_1 para = (ParseParamsForDownV1_0_1) params ;
        byte[] bs = this.doParse(para) ;
        MidResultToRtu midRs = new MidResultToRtu() ;
        midRs.rtuResultSendWebUrl = para.rtuResultSendWebUrl ;//rtu返回命令结果 发向目的地web URL
        midRs.protocolName = para.protocolName ;//协议名称
        midRs.rtuAddr = para.rtuAddr ;//Rtu地址(电信平台设备IMEI)
        midRs.commandId = para.commandId ;//命令ID,发起命令的客户端(web端)生成,以匹配命令结果
        midRs.downCode = para.commandCode ;//下行命令功能码;
        midRs.downBuffer = bs ;//下行命令数据
        midRs.downBufHex = ByteUtil.bytes2Hex(bs, true) ;//下行命令数据十六进制形式
        midRs.hasResponse = true ;//是否有应答
        midRs.maxSendTimes = null ;//命令最大发送次数(当收不到应答时,将重发),如果不设置,命令缓存器进行补充设置
        midRs.isCachForOffLine = false ;//RTU不在线,命令是否缓存,低功耗时为true
        if(isLowPower != null && isLowPower.booleanValue()){
            //低功耗时,尽快发送
            midRs.isQuickSend = true ;
        }
        return new MidResult[]{midRs} ;
    }
    /**
     * 构造下行数据
     * @param para 参数
     * @return 字节数组
     * @throws Exception 异常
     */
    public byte[] doParse(ParseParamsForDownV1_0_1 para) throws Exception {
        CommonV1_0_1 commonV1_0_1 = new CommonV1_0_1() ;
        byte[] bytes ;
        byte[] bsHead = new byte[ProtocolConstantV206V1_0_0.lenHead2Code] ;
        byte index = 0 ;
        bsHead[index] = ProtocolConstantV206V1_0_0.P_Head_Byte ;
        index++ ;
        bsHead[index] = 0 ;//帧长度
        index++ ;
        bsHead[index] = ProtocolConstantV206V1_0_0.P_Head_Byte ;
        index++ ;
        bsHead[index] = commonV1_0_1.createCtrl((byte)0, (byte)0) ;
        index++ ;
        GlCreate.createRtuAddr(para.rtuAddr, bsHead, index);
        index += 5 ;
        ByteUtil.hex2Bytes(para.commandCode, bsHead, index) ;
        if(para.param == null){
            throw new Exception("未提供命令参数数据,不能构造功能码为" + CodeV1_0_1.cd_10 + "的下行命令") ;
        }else{
            index = 0 ;
            byte[] bs = new byte[12] ;
            String newRtuAddr = (String)para.param ;
            GlCreate.createRtuAddr(newRtuAddr, bs, index);
            index += 5 ;
            GlCreate.createPw(bs, index);
            index += 2 ;
            GlCreate.createTp(bs, index);
            bytes = ByteUtil.bytesMerge(bsHead, bs) ;
        }
        GlCreate.createLen(bytes);//长度放字节数组中
        byte[] bsTail = GlCreate.createCrcTail(bytes) ;//CRC和尾叠加字节数组中
        bytes = ByteUtil.bytesMerge(bytes, bsTail) ;
        return bytes ;
    }
}
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_10_Up.java
New file
@@ -0,0 +1,64 @@
package com.dy.common.mw.protocol.p206V1_0_0.parse;
import com.dy.common.mw.protocol.*;
import com.dy.common.mw.protocol.p206V1_0_0.*;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
/**
 * @Author liurunyu
 * @Date 2023/12/25 11:27
 * @LastEditTime 2023/12/25 11:27
 * @Description
 */
@AnnotationCodeUp(ifAny={
        CodeV1_0_1.cd_10
})
public class Cd_10_Up implements CodeParse {
    private static final Logger log = LogManager.getLogger(Cd_10_Up.class);
    /**
     * 分析上行数据
     */
    @Override
    public MidResult[] parse(Boolean isLowPower, CodeParseParams params, CodeParseCallback callback)throws Exception {
        ParseParamsForUpV1_0_1 para = (ParseParamsForUpV1_0_1)params ;
        int bsLen = new CommonV1_0_1().parseDataLen(para.upBuffer) ;
        if(bsLen > 0){
            this.doParse(para.upBuffer,
                    bsLen,
                    para.upCode,
                    para.data) ;
        }
        log.info("分析命令应答数据<" + CodeV1_0_1.getCodeName(para.upCode) + " RTU地址=" + para.rtuAddr + ">:\n" + para.data.toString());
        MidResultFromRtu midRs = new MidResultFromRtu() ;
        midRs.protocolName = para.protocolName ;//协议名称
        midRs.rtuAddr = para.rtuAddr ;//Rtu地址
        midRs.upCode = para.upCode ;//上行数据中的功能码
        midRs.upHex = para.upHex ;//上行数据十六进制形式
        midRs.upBuffer = para.upBuffer ;//上行数据字节数组
        midRs.data = para.data ;//解析后的数据
        midRs.reportOrResponse_trueOrFalse = false ;//命令应答
        callback.callback(midRs.reportOrResponse_trueOrFalse);
        return new MidResult[]{midRs} ;
    }
    /**
     * 执行分析
     * @param bs 字节数组
     * @param bsLen 字节长度(总包长,包括包头和包尾)
     * @param dataCode 功能码
     * @param data 数据
     * @throws Exception 异常
     */
    protected void doParse(byte[] bs, int bsLen, String dataCode, Data data) throws Exception {
        DataV1_0_1 dV1 = (DataV1_0_1)data.getSubData() ;
        DataCd10Vo cdData = new DataCd10Vo() ;
        dV1.dataCd10Vo = cdData ;
        cdData.newRtuAddr = new CommonV1_0_1().parseRtuAddr(bs, ProtocolConstantV206V1_0_0.dataIndex) ;
    }
}
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_21_Down.java
New file
@@ -0,0 +1,106 @@
package com.dy.common.mw.protocol.p206V1_0_0.parse;
import com.dy.common.mw.protocol.*;
import com.dy.common.mw.protocol.p206V1_0_0.CodeV1_0_1;
import com.dy.common.mw.protocol.p206V1_0_0.CommonV1_0_1;
import com.dy.common.mw.protocol.p206V1_0_0.ParseParamsForDownV1_0_1;
import com.dy.common.mw.protocol.p206V1_0_0.ProtocolConstantV206V1_0_0;
import com.dy.common.mw.protocol.p206V1_0_0.parse.global.GlCreate;
import com.dy.common.util.ByteUtil;
import com.dy.common.util.ByteUtilUnsigned;
/**
 * @Author liurunyu
 * @Date 2023/12/25 11:37
 * @LastEditTime 2023/12/25 11:37
 * @Description
 */
@AnnotationCodeDown(ifAny={
        CodeV1_0_1.cd_21
})
public class Cd_21_Down implements CodeParse {
    @Override
    public MidResult[] parse(Boolean isLowPower, CodeParseParams params, CodeParseCallback callback) throws Exception {
        ParseParamsForDownV1_0_1 para = (ParseParamsForDownV1_0_1) params ;
        byte[] bs = this.doParse(para) ;
        MidResultToRtu midRs = new MidResultToRtu() ;
        midRs.rtuResultSendWebUrl = para.rtuResultSendWebUrl ;//rtu返回命令结果 发向目的地web URL
        midRs.protocolName = para.protocolName ;//协议名称
        midRs.rtuAddr = para.rtuAddr ;//Rtu地址(电信平台设备IMEI)
        midRs.commandId = para.commandId ;//命令ID,发起命令的客户端(web端)生成,以匹配命令结果
        midRs.downCode = para.commandCode ;//下行命令功能码;
        midRs.downBuffer = bs ;//下行命令数据
        midRs.downBufHex = ByteUtil.bytes2Hex(bs, true) ;//下行命令数据十六进制形式
        midRs.hasResponse = true ;//是否有应答
        midRs.maxSendTimes = null ;//命令最大发送次数(当收不到应答时,将重发),如果不设置,命令缓存器进行补充设置
        midRs.isCachForOffLine = false ;//RTU不在线,命令是否缓存,低功耗时为true
        if(isLowPower != null && isLowPower.booleanValue()){
            //低功耗时,尽快发送
            midRs.isQuickSend = true ;
        }
        return new MidResult[]{midRs} ;
    }
    /**
     * 构造下行数据
     * @param para 参数
     * @return 字节数组
     * @throws Exception 异常
     */
    public byte[] doParse(ParseParamsForDownV1_0_1 para) throws Exception {
        CommonV1_0_1 commonV1_0_1 = new CommonV1_0_1() ;
        byte[] bytes ;
        byte[] bsHead = new byte[ProtocolConstantV206V1_0_0.lenHead2Code] ;
        byte index = 0 ;
        bsHead[index] = ProtocolConstantV206V1_0_0.P_Head_Byte ;
        index++ ;
        bsHead[index] = 0 ;//帧长度
        index++ ;
        bsHead[index] = ProtocolConstantV206V1_0_0.P_Head_Byte ;
        index++ ;
        bsHead[index] = commonV1_0_1.createCtrl((byte)0, (byte)0) ;
        index++ ;
        GlCreate.createRtuAddr(para.rtuAddr, bsHead, index);
        index += 5 ;
        ByteUtil.hex2Bytes(para.commandCode, bsHead, index) ;
        if(para.param == null){
            throw new Exception("未提供命令参数数据,不能构造功能码为" + CodeV1_0_1.cd_21 + "的下行命令") ;
        }else{
            index = 0 ;
            byte[] bs = new byte[14] ;
            String ipPort = (String)para.param ;
            String[] ipPorts = ipPort.split(",") ;
            ByteUtilUnsigned.short2Bytes_LE(bs, (byte) Integer.parseInt(ipPorts[0]), index++);
            ByteUtilUnsigned.short2Bytes_LE(bs, (byte) Integer.parseInt(ipPorts[1]), index++);
            ByteUtilUnsigned.short2Bytes_LE(bs, (byte) Integer.parseInt(ipPorts[2]), index++);
            ByteUtilUnsigned.short2Bytes_LE(bs, (byte) Integer.parseInt(ipPorts[3]), index++);
            ByteUtilUnsigned.short2Bytes_LE(bs, Integer.parseInt(ipPorts[4]), index);
            index += 2 ;
            GlCreate.createPw(bs, index);
            index += 2 ;
            GlCreate.createTp(bs, index);
            bytes = ByteUtil.bytesMerge(bsHead, bs) ;
        }
        GlCreate.createLen(bytes);//长度放字节数组中
        byte[] bsTail = GlCreate.createCrcTail(bytes) ;//CRC和尾叠加字节数组中
        bytes = ByteUtil.bytesMerge(bytes, bsTail) ;
        return bytes ;
    }
}
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_21_Up.java
New file
@@ -0,0 +1,74 @@
package com.dy.common.mw.protocol.p206V1_0_0.parse;
import com.dy.common.mw.protocol.*;
import com.dy.common.mw.protocol.p206V1_0_0.*;
import com.dy.common.util.ByteUtilUnsigned;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
/**
 * @Author liurunyu
 * @Date 2023/12/25 13:40
 * @LastEditTime 2023/12/25 13:40
 * @Description
 */
@AnnotationCodeUp(ifAny={
        CodeV1_0_1.cd_21
})
@SuppressWarnings("unused")
public class Cd_21_Up implements CodeParse {
    private static final Logger log = LogManager.getLogger(Cd_21_Up.class);
    /**
     * 分析上行数据
     */
    @Override
    public MidResult[] parse(Boolean isLowPower, CodeParseParams params, CodeParseCallback callback)throws Exception {
        ParseParamsForUpV1_0_1 para = (ParseParamsForUpV1_0_1)params ;
        int bsLen = new CommonV1_0_1().parseDataLen(para.upBuffer) ;
        if(bsLen > 0){
            this.doParse(para.upBuffer,
                    bsLen,
                    para.upCode,
                    para.data) ;
        }
        log.info("分析命令应答数据<" + CodeV1_0_1.getCodeName(para.upCode) + " RTU地址=" + para.rtuAddr + ">:\n" + para.data.toString());
        MidResultFromRtu midRs = new MidResultFromRtu() ;
        midRs.protocolName = para.protocolName ;//协议名称
        midRs.rtuAddr = para.rtuAddr ;//Rtu地址
        midRs.upCode = para.upCode ;//上行数据中的功能码
        midRs.upHex = para.upHex ;//上行数据十六进制形式
        midRs.upBuffer = para.upBuffer ;//上行数据字节数组
        midRs.data = para.data ;//解析后的数据
        midRs.reportOrResponse_trueOrFalse = false ;//命令应答
        callback.callback(midRs.reportOrResponse_trueOrFalse);
        return new MidResult[]{midRs} ;
    }
    /**
     * 执行分析
     * @param bs 字节数组
     * @param bsLen 字节长度(总包长,包括包头和包尾)
     * @param dataCode 功能码
     * @param data 数据
     * @throws Exception 异常
     */
    protected void doParse(byte[] bs, int bsLen, String dataCode, Data data) throws Exception {
        DataV1_0_1 dV1 = (DataV1_0_1)data.getSubData() ;
        DataCd21Vo cdData = new DataCd21Vo() ;
        dV1.dataCd21Vo = cdData ;
        short index = ProtocolConstantV206V1_0_0.dataIndex ;
        String ip1 = "" +ByteUtilUnsigned.byte2Byte(bs, index++) ;
        String ip2 = "" +ByteUtilUnsigned.byte2Byte(bs, index++) ;
        String ip3 = "" +ByteUtilUnsigned.byte2Byte(bs, index++) ;
        String ip4 = "" +ByteUtilUnsigned.byte2Byte(bs, index++) ;
        cdData.ip = ip1 + "." + ip2 + "." + ip3 + "." + ip4 ;
        String port = "" +ByteUtilUnsigned.bytes2Short_LE(bs, index++) ;
        cdData.port = Integer.parseInt(port) ;
    }
}
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_66_Down.java
New file
@@ -0,0 +1,94 @@
package com.dy.common.mw.protocol.p206V1_0_0.parse;
import com.dy.common.mw.protocol.*;
import com.dy.common.mw.protocol.p206V1_0_0.CodeV1_0_1;
import com.dy.common.mw.protocol.p206V1_0_0.CommonV1_0_1;
import com.dy.common.mw.protocol.p206V1_0_0.ParseParamsForDownV1_0_1;
import com.dy.common.mw.protocol.p206V1_0_0.ProtocolConstantV206V1_0_0;
import com.dy.common.mw.protocol.p206V1_0_0.parse.global.GlCreate;
import com.dy.common.util.ByteUtil;
/**
 * @Author liurunyu
 * @Date 2023/12/23 9:35
 * @LastEditTime 2023/12/23 9:35
 * @Description
 */
@AnnotationCodeDown(ifAny={
        CodeV1_0_1.cd_66
})
public class Cd_66_Down implements CodeParse {
    //private static Logger log = LogManager.getLogger(Cd_66_Down.class);
    @Override
    public MidResult[] parse(Boolean isLowPower, CodeParseParams params, CodeParseCallback callback) throws Exception {
        ParseParamsForDownV1_0_1 para = (ParseParamsForDownV1_0_1) params ;
        byte[] bs = this.doParse(para) ;
        MidResultToRtu midRs = new MidResultToRtu() ;
        midRs.rtuResultSendWebUrl = para.rtuResultSendWebUrl ;//rtu返回命令结果 发向目的地web URL
        midRs.protocolName = para.protocolName ;//协议名称
        midRs.rtuAddr = para.rtuAddr ;//Rtu地址(电信平台设备IMEI)
        midRs.commandId = para.commandId ;//命令ID,发起命令的客户端(web端)生成,以匹配命令结果
        midRs.downCode = para.commandCode ;//下行命令功能码;
        midRs.downBuffer = bs ;//下行命令数据
        midRs.downBufHex = ByteUtil.bytes2Hex(bs, true) ;//下行命令数据十六进制形式
        midRs.hasResponse = true ;//是否有应答
        midRs.maxSendTimes = null ;//命令最大发送次数(当收不到应答时,将重发),如果不设置,命令缓存器进行补充设置
        midRs.isCachForOffLine = false ;//RTU不在线,命令是否缓存,低功耗时为true
        if(isLowPower != null && isLowPower.booleanValue()){
            //低功耗时,尽快发送
            midRs.isQuickSend = true ;
        }
        return new MidResult[]{midRs} ;
    }
    /**
     * 构造下行数据
     * @param para 参数
     * @return 字节数组
     * @throws Exception 异常
     */
    public byte[] doParse(ParseParamsForDownV1_0_1 para) throws Exception {
        CommonV1_0_1 commonV1_0_1 = new CommonV1_0_1() ;
        byte[] bytes ;
        byte[] bsHead = new byte[ProtocolConstantV206V1_0_0.lenHead2Code] ;
        byte index = 0 ;
        bsHead[index] = ProtocolConstantV206V1_0_0.P_Head_Byte ;
        index++ ;
        bsHead[index] = 0 ;//帧长度
        index++ ;
        bsHead[index] = ProtocolConstantV206V1_0_0.P_Head_Byte ;
        index++ ;
        bsHead[index] = commonV1_0_1.createCtrl((byte)0, (byte)0) ;
        index++ ;
        GlCreate.createRtuAddr(para.rtuAddr, bsHead, index);
        index += 5 ;
        ByteUtil.hex2Bytes(para.commandCode, bsHead, index) ;
        if(para.param == null){
            throw new Exception("未提供命令参数数据,不能构造功能码为" + CodeV1_0_1.cd_66 + "的下行命令") ;
        }else{
            byte flag = ((Integer)para.param).byteValue() ;
            byte[] bs = new byte[]{flag} ;
            bytes = ByteUtil.bytesMerge(bsHead, bs) ;
        }
        GlCreate.createLen(bytes);//长度放字节数组中
        byte[] bsTail = GlCreate.createCrcTail(bytes) ;//CRC和尾叠加字节数组中
        bytes = ByteUtil.bytesMerge(bytes, bsTail) ;
        return bytes ;
    }
}
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_66_Up.java
New file
@@ -0,0 +1,61 @@
package com.dy.common.mw.protocol.p206V1_0_0.parse;
import com.dy.common.mw.protocol.*;
import com.dy.common.mw.protocol.p206V1_0_0.*;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
/**
 * @Author liurunyu
 * @Date 2023/12/23 9:48
 * @LastEditTime 2023/12/23 9:48
 * @Description
 */
@AnnotationCodeUp(ifAny={
        CodeV1_0_1.cd_66
})
@SuppressWarnings("unused")
public class Cd_66_Up implements CodeParse {
    private static final Logger log = LogManager.getLogger(Cd_66_Up.class);
    /**
     * 分析上行数据
     */
    @Override
    public MidResult[] parse(Boolean isLowPower, CodeParseParams params, CodeParseCallback callback)throws Exception {
        ParseParamsForUpV1_0_1 para = (ParseParamsForUpV1_0_1)params ;
        int bsLen = new CommonV1_0_1().parseDataLen(para.upBuffer) ;
        if(bsLen > 0){
            this.doParse(para.upBuffer,
                    bsLen,
                    para.upCode,
                    para.data) ;
        }
        log.info("分析命令应答数据<" + CodeV1_0_1.getCodeName(para.upCode) + " RTU地址=" + para.rtuAddr + ">:\n" + para.data.toString());
        MidResultFromRtu midRs = new MidResultFromRtu() ;
        midRs.protocolName = para.protocolName ;//协议名称
        midRs.rtuAddr = para.rtuAddr ;//Rtu地址
        midRs.upCode = para.upCode ;//上行数据中的功能码
        midRs.upHex = para.upHex ;//上行数据十六进制形式
        midRs.upBuffer = para.upBuffer ;//上行数据字节数组
        midRs.data = para.data ;//解析后的数据
        midRs.reportOrResponse_trueOrFalse = false ;//命令应答
        callback.callback(midRs.reportOrResponse_trueOrFalse);
        return new MidResult[]{midRs} ;
    }
    /**
     * 执行分析
     * @param bs 字节数组
     * @param bsLen 字节长度(总包长,包括包头和包尾)
     * @param dataCode 功能码
     * @param data 数据
     * @throws Exception 异常
     */
    protected void doParse(byte[] bs, int bsLen, String dataCode, Data data) throws Exception {
    }
}
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_71_Down.java
@@ -21,7 +21,7 @@
        byte[] bs = this.doParse(para) ;
        MidResultToRtu midRs = new MidResultToRtu() ;
        midRs.rtuResultSendWebUrl = para.rtuResultSendWebUrl ;////rtu返回命令结果 发向目的地web URL
        midRs.rtuResultSendWebUrl = para.rtuResultSendWebUrl ;//rtu返回命令结果 发向目的地web URL
        midRs.protocolName = para.protocolName ;//协议名称
        midRs.rtuAddr = para.rtuAddr ;//Rtu地址(电信平台设备IMEI)
        midRs.commandId = para.commandId ;//命令ID,发起命令的客户端(web端)生成,以匹配命令结果
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_83_Down.java
@@ -21,7 +21,7 @@
        byte[] bs = this.doParse(para) ;
        MidResultToRtu midRs = new MidResultToRtu() ;
        midRs.rtuResultSendWebUrl = para.rtuResultSendWebUrl ;////rtu返回命令结果 发向目的地web URL
        midRs.rtuResultSendWebUrl = para.rtuResultSendWebUrl ;//rtu返回命令结果 发向目的地web URL
        midRs.protocolName = para.protocolName ;//协议名称
        midRs.rtuAddr = para.rtuAddr ;//Rtu地址(电信平台设备IMEI)
        midRs.commandId = para.commandId ;//命令ID,发起命令的客户端(web端)生成,以匹配命令结果
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_83_Up.java
@@ -82,7 +82,6 @@
     * @throws Exception 异常
     */
    protected void doParse(byte[] bs, int bsLen, String dataCode, Data data) throws Exception {
        short index = ProtocolConstantV206V1_0_0.dataIndex ;
        byte opType = bs[ProtocolConstantV206V1_0_0.dataIndex];
        if(opType == 1 || opType == 3 || opType == 8){
            this.doParseOpen(opType, bs, bsLen, dataCode, data);
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_84_Down.java
@@ -21,7 +21,7 @@
        byte[] bs = this.doParse(para) ;
        MidResultToRtu midRs = new MidResultToRtu() ;
        midRs.rtuResultSendWebUrl = para.rtuResultSendWebUrl ;////rtu返回命令结果 发向目的地web URL
        midRs.rtuResultSendWebUrl = para.rtuResultSendWebUrl ;//rtu返回命令结果 发向目的地web URL
        midRs.protocolName = para.protocolName ;//协议名称
        midRs.rtuAddr = para.rtuAddr ;//Rtu地址(电信平台设备IMEI)
        midRs.commandId = para.commandId ;//命令ID,发起命令的客户端(web端)生成,以匹配命令结果
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_92_Down.java
New file
@@ -0,0 +1,97 @@
package com.dy.common.mw.protocol.p206V1_0_0.parse;
import com.dy.common.mw.protocol.*;
import com.dy.common.mw.protocol.p206V1_0_0.CodeV1_0_1;
import com.dy.common.mw.protocol.p206V1_0_0.CommonV1_0_1;
import com.dy.common.mw.protocol.p206V1_0_0.ParseParamsForDownV1_0_1;
import com.dy.common.mw.protocol.p206V1_0_0.ProtocolConstantV206V1_0_0;
import com.dy.common.mw.protocol.p206V1_0_0.parse.global.GlCreate;
import com.dy.common.util.ByteUtil;
/**
 * @Author liurunyu
 * @Date 2023/12/26 8:49
 * @LastEditTime 2023/12/26 8:49
 * @Description
 */
@AnnotationCodeDown(ifAny={
        CodeV1_0_1.cd_92
})
public class Cd_92_Down implements CodeParse {
    @Override
    public MidResult[] parse(Boolean isLowPower, CodeParseParams params, CodeParseCallback callback) throws Exception {
        ParseParamsForDownV1_0_1 para = (ParseParamsForDownV1_0_1) params ;
        byte[] bs = this.doParse(para) ;
        MidResultToRtu midRs = new MidResultToRtu() ;
        midRs.rtuResultSendWebUrl = para.rtuResultSendWebUrl ;//rtu返回命令结果 发向目的地web URL
        midRs.protocolName = para.protocolName ;//协议名称
        midRs.rtuAddr = para.rtuAddr ;//Rtu地址(电信平台设备IMEI)
        midRs.commandId = para.commandId ;//命令ID,发起命令的客户端(web端)生成,以匹配命令结果
        midRs.downCode = para.commandCode ;//下行命令功能码;
        midRs.downBuffer = bs ;//下行命令数据
        midRs.downBufHex = ByteUtil.bytes2Hex(bs, true) ;//下行命令数据十六进制形式
        midRs.hasResponse = true ;//是否有应答
        midRs.maxSendTimes = null ;//命令最大发送次数(当收不到应答时,将重发),如果不设置,命令缓存器进行补充设置
        midRs.isCachForOffLine = false ;//RTU不在线,命令是否缓存,低功耗时为true
        if(isLowPower != null && isLowPower.booleanValue()){
            //低功耗时,尽快发送
            midRs.isQuickSend = true ;
        }
        return new MidResult[]{midRs} ;
    }
    /**
     * 构造下行数据
     * @param para 参数
     * @return 字节数组
     * @throws Exception 异常
     */
    public byte[] doParse(ParseParamsForDownV1_0_1 para) throws Exception {
        CommonV1_0_1 commonV1_0_1 = new CommonV1_0_1() ;
        byte[] bytes ;
        byte[] bsHead = new byte[ProtocolConstantV206V1_0_0.lenHead2Code] ;
        byte index = 0 ;
        bsHead[index] = ProtocolConstantV206V1_0_0.P_Head_Byte ;
        index++ ;
        bsHead[index] = 0 ;//帧长度
        index++ ;
        bsHead[index] = ProtocolConstantV206V1_0_0.P_Head_Byte ;
        index++ ;
        bsHead[index] = commonV1_0_1.createCtrl((byte)0, (byte)0) ;
        index++ ;
        GlCreate.createRtuAddr(para.rtuAddr, bsHead, index);
        index += 5 ;
        ByteUtil.hex2Bytes(para.commandCode, bsHead, index) ;
        if(para.param == null){
            throw new Exception("未提供命令参数数据,不能构造功能码为" + CodeV1_0_1.cd_92 + "的下行命令") ;
        }else{
            index = 0 ;
            byte[] bs = new byte[9] ;
            bs[index++] = (byte)0xF0 ;
            GlCreate.createPw(bs, index);
            index += 2 ;
            GlCreate.createTp(bs, index);
            bytes = ByteUtil.bytesMerge(bsHead, bs) ;
        }
        GlCreate.createLen(bytes);//长度放字节数组中
        byte[] bsTail = GlCreate.createCrcTail(bytes) ;//CRC和尾叠加字节数组中
        bytes = ByteUtil.bytesMerge(bytes, bsTail) ;
        return bytes ;
    }
}
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_92_Up.java
New file
@@ -0,0 +1,70 @@
package com.dy.common.mw.protocol.p206V1_0_0.parse;
import com.dy.common.mw.protocol.*;
import com.dy.common.mw.protocol.p206V1_0_0.*;
import com.dy.common.util.ByteUtil;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
/**
 * @Author liurunyu
 * @Date 2023/12/26 8:49
 * @LastEditTime 2023/12/26 8:49
 * @Description
 */
@AnnotationCodeUp(ifAny={
        CodeV1_0_1.cd_92
})
@SuppressWarnings("unused")
public class Cd_92_Up implements CodeParse {
    private static final Logger log = LogManager.getLogger(Cd_92_Up.class);
    /**
     * 分析上行数据
     */
    @Override
    public MidResult[] parse(Boolean isLowPower, CodeParseParams params, CodeParseCallback callback)throws Exception {
        ParseParamsForUpV1_0_1 para = (ParseParamsForUpV1_0_1)params ;
        int bsLen = new CommonV1_0_1().parseDataLen(para.upBuffer) ;
        if(bsLen > 0){
            this.doParse(para.upBuffer,
                    bsLen,
                    para.upCode,
                    para.data) ;
        }
        log.info("分析上行数据<" + CodeV1_0_1.getCodeName(para.upCode) + " RTU地址=" + para.rtuAddr + ">:\n" + para.data.toString());
        MidResultFromRtu midRs = new MidResultFromRtu() ;
        midRs.protocolName = para.protocolName ;//协议名称
        midRs.rtuAddr = para.rtuAddr ;//Rtu地址
        midRs.upCode = para.upCode ;//上行数据中的功能码
        midRs.upHex = para.upHex ;//上行数据十六进制形式
        midRs.upBuffer = para.upBuffer ;//上行数据字节数组
        midRs.data = para.data ;//解析后的数据
        midRs.reportOrResponse_trueOrFalse = false ;//主动上报
        callback.callback(midRs.reportOrResponse_trueOrFalse);
        return new MidResult[]{midRs} ;
    }
    /**
     * 执行分析
     * @param bs 字节数组
     * @param bsLen 字节长度(总包长,包括包头和包尾)
     * @param dataCode 功能码
     * @param data 数据
     * @throws Exception 异常
     */
    protected void doParse(byte[] bs, int bsLen, String dataCode, Data data) throws Exception {
        DataV1_0_1 dV1 = (DataV1_0_1)data.getSubData() ;
        DataCd92Vo cdData = new DataCd92Vo() ;
        dV1.dataCd92Vo = cdData ;
        String bin = ByteUtil.byte2Binary(bs[ProtocolConstantV206V1_0_0.dataIndex]);
        if(bin.startsWith("1010")){
            cdData.success = true ;
        }else{
            cdData.success = false ;
        }
    }
}
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_93_Down.java
New file
@@ -0,0 +1,98 @@
package com.dy.common.mw.protocol.p206V1_0_0.parse;
import com.dy.common.mw.protocol.*;
import com.dy.common.mw.protocol.p206V1_0_0.CodeV1_0_1;
import com.dy.common.mw.protocol.p206V1_0_0.CommonV1_0_1;
import com.dy.common.mw.protocol.p206V1_0_0.ParseParamsForDownV1_0_1;
import com.dy.common.mw.protocol.p206V1_0_0.ProtocolConstantV206V1_0_0;
import com.dy.common.mw.protocol.p206V1_0_0.parse.global.GlCreate;
import com.dy.common.util.ByteUtil;
/**
 * @Author liurunyu
 * @Date 2023/12/26 8:50
 * @LastEditTime 2023/12/26 8:50
 * @Description
 */
@AnnotationCodeDown(ifAny={
        CodeV1_0_1.cd_93
})
public class Cd_93_Down implements CodeParse {
    @Override
    public MidResult[] parse(Boolean isLowPower, CodeParseParams params, CodeParseCallback callback) throws Exception {
        ParseParamsForDownV1_0_1 para = (ParseParamsForDownV1_0_1) params ;
        byte[] bs = this.doParse(para) ;
        MidResultToRtu midRs = new MidResultToRtu() ;
        midRs.rtuResultSendWebUrl = para.rtuResultSendWebUrl ;//rtu返回命令结果 发向目的地web URL
        midRs.protocolName = para.protocolName ;//协议名称
        midRs.rtuAddr = para.rtuAddr ;//Rtu地址(电信平台设备IMEI)
        midRs.commandId = para.commandId ;//命令ID,发起命令的客户端(web端)生成,以匹配命令结果
        midRs.downCode = para.commandCode ;//下行命令功能码;
        midRs.downBuffer = bs ;//下行命令数据
        midRs.downBufHex = ByteUtil.bytes2Hex(bs, true) ;//下行命令数据十六进制形式
        midRs.hasResponse = true ;//是否有应答
        midRs.maxSendTimes = null ;//命令最大发送次数(当收不到应答时,将重发),如果不设置,命令缓存器进行补充设置
        midRs.isCachForOffLine = false ;//RTU不在线,命令是否缓存,低功耗时为true
        if(isLowPower != null && isLowPower.booleanValue()){
            //低功耗时,尽快发送
            midRs.isQuickSend = true ;
        }
        return new MidResult[]{midRs} ;
    }
    /**
     * 构造下行数据
     * @param para 参数
     * @return 字节数组
     * @throws Exception 异常
     */
    public byte[] doParse(ParseParamsForDownV1_0_1 para) throws Exception {
        CommonV1_0_1 commonV1_0_1 = new CommonV1_0_1() ;
        byte[] bytes ;
        byte[] bsHead = new byte[ProtocolConstantV206V1_0_0.lenHead2Code] ;
        byte index = 0 ;
        bsHead[index] = ProtocolConstantV206V1_0_0.P_Head_Byte ;
        index++ ;
        bsHead[index] = 0 ;//帧长度
        index++ ;
        bsHead[index] = ProtocolConstantV206V1_0_0.P_Head_Byte ;
        index++ ;
        bsHead[index] = commonV1_0_1.createCtrl((byte)0, (byte)0) ;
        index++ ;
        GlCreate.createRtuAddr(para.rtuAddr, bsHead, index);
        index += 5 ;
        ByteUtil.hex2Bytes(para.commandCode, bsHead, index) ;
        if(para.param == null){
            throw new Exception("未提供命令参数数据,不能构造功能码为" + CodeV1_0_1.cd_93 + "的下行命令") ;
        }else{
            index = 0 ;
            byte[] bs = new byte[9] ;
            bs[index++] = (byte)0xF0 ;
            GlCreate.createPw(bs, index);
            index += 2 ;
            GlCreate.createTp(bs, index);
            bytes = ByteUtil.bytesMerge(bsHead, bs) ;
        }
        GlCreate.createLen(bytes);//长度放字节数组中
        byte[] bsTail = GlCreate.createCrcTail(bytes) ;//CRC和尾叠加字节数组中
        bytes = ByteUtil.bytesMerge(bytes, bsTail) ;
        return bytes ;
    }
}
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_93_Up.java
New file
@@ -0,0 +1,70 @@
package com.dy.common.mw.protocol.p206V1_0_0.parse;
import com.dy.common.mw.protocol.*;
import com.dy.common.mw.protocol.p206V1_0_0.*;
import com.dy.common.util.ByteUtil;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
/**
 * @Author liurunyu
 * @Date 2023/12/26 8:49
 * @LastEditTime 2023/12/26 8:49
 * @Description
 */
@AnnotationCodeUp(ifAny={
        CodeV1_0_1.cd_93
})
@SuppressWarnings("unused")
public class Cd_93_Up implements CodeParse {
    private static final Logger log = LogManager.getLogger(Cd_93_Up.class);
    /**
     * 分析上行数据
     */
    @Override
    public MidResult[] parse(Boolean isLowPower, CodeParseParams params, CodeParseCallback callback)throws Exception {
        ParseParamsForUpV1_0_1 para = (ParseParamsForUpV1_0_1)params ;
        int bsLen = new CommonV1_0_1().parseDataLen(para.upBuffer) ;
        if(bsLen > 0){
            this.doParse(para.upBuffer,
                    bsLen,
                    para.upCode,
                    para.data) ;
        }
        log.info("分析上行数据<" + CodeV1_0_1.getCodeName(para.upCode) + " RTU地址=" + para.rtuAddr + ">:\n" + para.data.toString());
        MidResultFromRtu midRs = new MidResultFromRtu() ;
        midRs.protocolName = para.protocolName ;//协议名称
        midRs.rtuAddr = para.rtuAddr ;//Rtu地址
        midRs.upCode = para.upCode ;//上行数据中的功能码
        midRs.upHex = para.upHex ;//上行数据十六进制形式
        midRs.upBuffer = para.upBuffer ;//上行数据字节数组
        midRs.data = para.data ;//解析后的数据
        midRs.reportOrResponse_trueOrFalse = false ;//主动上报
        callback.callback(midRs.reportOrResponse_trueOrFalse);
        return new MidResult[]{midRs} ;
    }
    /**
     * 执行分析
     * @param bs 字节数组
     * @param bsLen 字节长度(总包长,包括包头和包尾)
     * @param dataCode 功能码
     * @param data 数据
     * @throws Exception 异常
     */
    protected void doParse(byte[] bs, int bsLen, String dataCode, Data data) throws Exception {
        DataV1_0_1 dV1 = (DataV1_0_1)data.getSubData() ;
        DataCd93Vo cdData = new DataCd93Vo() ;
        dV1.dataCd93Vo = cdData ;
        String bin = ByteUtil.byte2Binary(bs[ProtocolConstantV206V1_0_0.dataIndex]);
        if(bin.startsWith("1010")){
            cdData.success = true ;
        }else{
            cdData.success = false ;
        }
    }
}
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_C0_Down.java
@@ -21,7 +21,7 @@
        byte[] bs = this.doParse(para) ;
        MidResultToRtu midRs = new MidResultToRtu() ;
        midRs.rtuResultSendWebUrl = para.rtuResultSendWebUrl ;////rtu返回命令结果 发向目的地web URL
        midRs.rtuResultSendWebUrl = para.rtuResultSendWebUrl ;//rtu返回命令结果 发向目的地web URL
        midRs.protocolName = para.protocolName ;//协议名称
        midRs.rtuAddr = para.rtuAddr ;//Rtu地址(电信平台设备IMEI)
        midRs.commandId = para.commandId ;//命令ID,发起命令的客户端(web端)生成,以匹配命令结果
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/global/GlCreate.java
@@ -19,6 +19,11 @@
        ByteUtilUnsigned.short2Bytes_BE(bs, rtuAddr2Int.shortValue(), index);
    }
    public static void createPw(byte[] bs, int index) throws Exception {
        bs[index] = 0;
        bs[index + 1] = 0;
    }
    public static void createTp(byte[] bs, int index) throws Exception {
        ByteUtil.string2BCD_LE(bs, DateTime.yyMMddhhmmss(), index) ;
    }
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/ByteUtil.java
@@ -33,9 +33,8 @@
     * @param index 下标位
     * @param len 长度
     * @return 返回 返回
     * @throws Exception 异常
     */
    public static boolean bytesIsAll0xFF(byte[] bs, int index, int len)throws Exception {
    public static boolean bytesIsAll0xFF(byte[] bs, int index, int len){
        int count = 0 ;
        for(int i = index; i < index + len; i++){
            if(bs[i] == (byte)0xFF){
@@ -47,26 +46,11 @@
    /**
     * 二进制转十进制数
     * @param str
     * @param str 二进制字符串
     * @return 返回
     * @throws Exception 异常
     */
    public static int binary2Int(String str) throws Exception {
        int cnt=0;
        int sum=0;
        str=new StringBuilder(str).reverse().toString();//反转字符串
        for(int i=0;i<str.length();i++){
            cnt++;
            if (str.charAt(i)=='1'){
                int mul=1;
                for (int j=1;j<cnt;j++){
                    mul*=2;
                }
                sum+=mul;
            }
            else continue;
        }
        return sum;
    public static int binary2Int(String str) {
        return Integer.parseInt(str, 2);
    }
@@ -74,26 +58,18 @@
     * 字节转存二进制
     *
     * @param b byte
     * @throws Exception 异常
     * @return 返回 String
     */
    public static String byte2Binary(byte b) throws Exception {
        int n = (b + 256) % 256 + 256;
        try {
            return Integer.toBinaryString(n).substring(1);
        } catch (Exception e) {
            throw new Exception("字节转换成二进制的字符串出错!", null);
        }
    public static String byte2Binary(byte b) {
        return Integer.toBinaryString(b & 0xFF) ;
    }
    /**
     * 字节转存8位二进制
     *
     * @param b
     *            byte
     * @throws Exception 异常
     * @param b  byte
     * @return 返回 String
     */
    public static String byte2bit8Binary(byte b) throws Exception {
    public static String byte2bit8Binary(byte b) {
        String s = byte2Binary(b);
        int len = s.length();
        for (int i = 0; i < 8 - len; i++) {
@@ -103,13 +79,11 @@
    }
    /**
     * 字节取bit
     * @param b
     * @param b
     * @throws Exception 异常
     * 字节数 取出8个bit
     * @param b 字节数
     * @return 返回 String
     */
    public static byte[] getBit(byte b) throws Exception {
    public static byte[] getBit(byte b) {
        byte[] bs = new byte[8] ;
        bs[0] = (byte)(b & 1) ;
        bs[1] = (byte)((b & 2) >> 1) ;
@@ -123,8 +97,8 @@
    }
    /**
     * 字节取bit
     * @param b
     * 字节数 取出bit
     * @param b 字节数
     * @param index 下标位
     * @throws Exception 异常
     * @return 返回 String
@@ -178,8 +152,7 @@
    public static void double2Bytes_BE(byte[] bs, double value, int from)throws Exception {
        boolean b = isOutOfArrLength(bs.length, (from - 1) + 8);
        if (b) {
            Long l = Double.doubleToLongBits(value);
            long2Bytes_BE(bs, l, from);
            long2Bytes_BE(bs, Double.doubleToLongBits(value), from);
        } else {
            throw new Exception("double2Bytes时数组越界");
        }
@@ -195,8 +168,7 @@
    public static void double2Bytes_LE(byte[] bs, double value, int from)throws Exception {
        boolean b = isOutOfArrLength(bs.length, (from - 1) + 8);
        if (b) {
            Long l = Double.doubleToLongBits(value);
            long2Bytes_LE(bs, l, from);
            long2Bytes_LE(bs, Double.doubleToLongBits(value), from);
        } else {
            throw new Exception("double2Bytes时数组越界");
        }
@@ -452,7 +424,7 @@
        boolean b = isOutOfArrLength(bs.length, (from - 1) + 8);
        if (b) {
            long s = 0;
            long s0 = bs[from + 0] ;// 最低位
            long s0 = bs[from] ;// 最低位
            long s1 = bs[from + 1] ;
            long s2 = bs[from + 2] ;
            long s3 = bs[from + 3] ;
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaDistrictMapper.java
@@ -82,4 +82,17 @@
     */
    Map getDistrictsByVillageId(@Param("villageId") Long villageId);
    /**
     * 根据级别获取行政区划列表
     * @param level 行政区划层级
     * @return 行政区划列表
     */
    List<Map<String, Object>> getDistrictgsByLevel(@Param("level") Integer level);
    /**
     * 根据父ID获取行政区划列表
     * @param supperId 行政区划父级ID
     * @return 行政区划列表
     */
    List<Map<String, Object>> getDistrictsBySupperId(@Param("supperId") Long supperId);
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoPr/PrControllerMapper.java
New file
@@ -0,0 +1,27 @@
package com.dy.pipIrrGlobal.daoPr;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dy.pipIrrGlobal.pojoPr.PrController;
import org.apache.ibatis.annotations.Mapper;
/**
 * @author ZhuBaoMin
 * @date 2023-12-29 9:59
 * @LastEditTime 2023-12-29 9:59
 * @Description
 */
@Mapper
public interface PrControllerMapper extends BaseMapper<PrController> {
    int deleteByPrimaryKey(Long id);
    int insert(PrController record);
    int insertSelective(PrController record);
    PrController selectByPrimaryKey(Long id);
    int updateByPrimaryKeySelective(PrController record);
    int updateByPrimaryKey(PrController record);
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoPr/PrDivideMapper.java
@@ -1,7 +1,10 @@
package com.dy.pipIrrGlobal.daoPr;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dy.pipIrrGlobal.pojoPr.PrDivide;
import com.dy.pipIrrGlobal.voPr.VoDivide;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
@@ -12,7 +15,8 @@
 * @LastEditTime 2023/12/21 9:16
 * @Description
 */
public interface PrDivideMapper {
@Mapper
public interface PrDivideMapper extends BaseMapper<PrDivide> {
    int deleteByPrimaryKey(Long id);
    int insert(PrDivide record);
@@ -38,4 +42,18 @@
     * @return
     */
    List<VoDivide> getDivides(Map<?, ?> params);
    /**
     * 根据分水房ID逻辑删除分水房
     * @param id
     * @return
     */
    Integer deleteDivideById(@Param("id") Long id);
    /**
     * 根据分水房编号获取所属片区编号
     * @param divideId
     * @return
     */
    Long getBlockIdById(@Param("divideId") Long divideId);
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeClientCardMapper.java
@@ -2,9 +2,11 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dy.pipIrrGlobal.pojoSe.SeClientCard;
import com.dy.pipIrrGlobal.voSe.VoCardInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
@@ -56,4 +58,38 @@
     */
    Map getCardIdAndClientNum(@Param("cardNum") String cardNum);
    /**
     * 根据农户主键获取水卡列表
     * @param clientId
     * @return
     */
    List<VoCardInfo> getCardInfoByClientId(@Param("clientId") Long clientId);
    /**
     * 根据水卡编号获取操作记录列表
     * @param cardNum 水卡编号
     * @return 水卡操作记录列表
     */
    List<Map<String, Object>> getOperateRecordsByCardNum(@Param("cardNum") Long cardNum);
    /**
     * 根据水卡编号获取余额
     * @param cardNum 水卡编号
     * @return 余额
     */
    Float getMoneyByCardNum(@Param("cardNum") Long cardNum);
    /**
     * 根据水卡编号获取充值总额
     * @param cardNum
     * @return
     */
    Float sumRechargeByCardNum(@Param("cardNum") Long cardNum);
    /**
     * 根据水卡编号获取卡片状态
     * @param cardNum
     * @return
     */
    String getCardStateByCardNum(@Param("cardNum") Long cardNum);
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeClientMapper.java
@@ -3,6 +3,8 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dy.pipIrrGlobal.pojoSe.SeClient;
import com.dy.pipIrrGlobal.voSe.VoClient;
import com.dy.pipIrrGlobal.voSe.VoOperate;
import com.dy.pipIrrGlobal.voSe.VoStatistics;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@@ -11,8 +13,8 @@
/**
 * @author ZhuBaoMin
 * @date 2023/12/22 9:50
 * @LastEditTime 2023/12/22 9:50
 * @date 2023-12-26 10:32
 * @LastEditTime 2023-12-26 10:32
 * @Description
 */
@@ -78,4 +80,58 @@
     * @return 村主键
     */
    Long getVillageIdById(@Param("id") Long id);
    /**
     * 获取虚拟卡号最大值
     * @return
     */
    Long getMa1xVirtualId();
    /**
     * 获取用水方式列表
     * @return
     */
    List<Map<String, Object>> getWaterTypes();
    /**
     * 根据指定条件获取购水汇总和购卡汇总
     * @param params 统计条件
     * @return 购水金额、购卡金额
     */
    Map getSums(Map<?, ?> params);
    /**
     * 根据指定条件获取操作记录数
     * @param params 查询条件
     * @return 符合条件的记录数
     */
    Long getOperateRecordCount(Map<?, ?> params);
    /**
     * 根据指定条件获取操作记录
     * @param params 查询条件
     * @return 符合条件的交易记录
     */
    List<VoOperate> getOperates(Map<?, ?> params);
    /**
     * 根据指定条件获取交易笔数汇总和交易金额汇总
     * @param params
     * @return
     */
    Map getStatisticSums(Map<?, ?> params);
    /**
     * 根据指定条件获取汇总记录数
     * @param params
     * @return
     */
    Long getStatisticRecordCount(Map<?, ?> params);
    /**
     * 根据指定条件获取统计记录
     * @param params
     * @return
     */
    List<VoStatistics> getStatistics(Map<?, ?> params);
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoPr/PrController.java
New file
@@ -0,0 +1,84 @@
package com.dy.pipIrrGlobal.pojoPr;
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 io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.*;
import org.hibernate.validator.constraints.Length;
import java.util.Date;
/**
 * @author ZhuBaoMin
 * @date 2023-12-29 9:59
 * @LastEditTime 2023-12-29 9:59
 * @Description
 */
/**
 * 控制器表
 */
@TableName(value="pr_controller", autoResultMap = true)
@Data
@Builder
@ToString
@NoArgsConstructor
@AllArgsConstructor
@Schema(name = "控制器实体")
public class PrController implements BaseEntity {
    public static final long serialVersionUID = 1L;
    /**
    * 主键
    */
    @JSONField(serializeUsing= ObjectWriterImplToString.class)
    @TableId(type = IdType.INPUT)
    @Schema(description = "实体id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Long id;
    /**
    * 编号
    */
    @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "控制器编号不能为空")
    @Length(message = "控制器编号不大于{max}字",max = 25)
    private String code;
    /**
    * 通讯协议
    */
    @Schema(description = "通讯协议", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "通讯协议不能为空")
    @Length(message = "通讯协议不大于{max}字",max = 25)
    private String protocol;
    /**
    * 添加方式;1-系统自动,2-手动
    */
    @Schema(description = "添加方式", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Byte addways;
    /**
    * 操作人编号
    */
    @Schema(description = "操作人编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Long operator;
    /**
    * 操作时间
    */
    @Schema(description = "操作时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Date operatedt;
    /**
    * 逻辑删除标识;0-未删除,1-删除
    */
    @Schema(description = "删除标识", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Byte deleted;
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeClient.java
@@ -89,6 +89,13 @@
    private String name;
    /**
     * 虚拟卡号;10位,从1000000000开始
     */
    @Schema(description = "虚拟卡号", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "虚拟卡号不能为空")
    private Long virtualid;
    /**
     * 农户编号;6位区划 + 4为顺序号
     */
    @JSONField(serializeUsing= ObjectWriterImplToString.class)
@@ -134,6 +141,12 @@
    private Double area;
    /**
     * 用水类型ID
     */
    @Schema(description = "用水类型ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Long typeid;
    /**
     * 街道及门牌号
     */
    @Schema(description = "街道+门牌号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeClientCard.java
@@ -69,7 +69,7 @@
     * 余额
     */
    @Schema(description = "余额", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Double money;
    private Float money;
    /**
     * 卡片状态;1-正常,2-已注销,3-已挂失
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voPr/VoController.java
New file
@@ -0,0 +1,56 @@
package com.dy.pipIrrGlobal.voPr;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
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;
import java.util.Date;
/**
 * @author ZhuBaoMin
 * @date 2023-12-29 10:27
 * @LastEditTime 2023-12-29 10:27
 * @Description
 */
@Data
@Schema(title = "控制器视图对象")
public class VoController implements BaseEntity {
    private static final long serialVersionUID = 1L;
    @Schema(title = "ID")
    @ExcelProperty("ID")
    @ColumnWidth(10)
    private Long id;
    @Schema(title = "控制器编号")
    @ExcelProperty("控制器编号")
    @ColumnWidth(15)
    private String code;
    @Schema(title = "在线状态")
    @ExcelProperty("在线状态")
    @ColumnWidth(15)
    private String state;
    @Schema(title = "绑定取水口")
    @ExcelProperty("绑定取水口")
    @ColumnWidth(10)
    private String intakeName;
    @Schema(title = "绑定次数")
    @ExcelProperty("绑定次数")
    @ColumnWidth(10)
    private Integer bindings;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Schema(title = "最近上报时间")
    @ExcelProperty("最近上报时间")
    @ColumnWidth(30)
    private Date operateDt;
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoCardInfo.java
New file
@@ -0,0 +1,31 @@
package com.dy.pipIrrGlobal.voSe;
import com.dy.common.po.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
 * @author ZhuBaoMin
 * @date 2023-12-27 19:22
 * @LastEditTime 2023-12-27 19:22
 * @Description
 */
@Data
@Schema(title = "IC卡视图对象")
public class VoCardInfo implements BaseEntity {
    private static final long serialVersionUID = 1L;
    @Schema(title = "水卡编号")
    private Long cardNum;
    @Schema(title = "卡片类型")
    private String cardType;
    @Schema(title = "余额")
    private Float money;
    @Schema(title = "水卡状态")
    private String state;
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoClient.java
@@ -23,6 +23,39 @@
    @Schema(title = "ID")
    private Long id;
    @Schema(title = "县ID")
    private String countyId;
    @Schema(title = "县名称")
    private String countryName;
    @Schema(title = "镇ID")
    private String townId;
    @Schema(title = "镇名称")
    private String townName;
    @Schema(title = "村ID")
    private String villageId;
    @Schema(title = "村名称")
    private String villageName;
    @Schema(title = "片区ID")
    private String blockId;
    @Schema(title = "片区名称")
    private String bolckName;
    @Schema(title = "分水房ID")
    private String divideId;
    @Schema(title = "分水房名称")
    private String divideName;
    @Schema(title = "用户类型ID")
    private String waterTypeId;
    @Schema(title = "用户类型名称")
    private String waterTypeName;
    @Schema(title = "农户ID")
    private String clientId;
    @Schema(title = "农户姓名")
    private String name;
@@ -33,7 +66,10 @@
    private String phone;
    @Schema(title = "身份证号")
    private String idCard;
    private String idcard;
    @Schema(title = "种植面积")
    private Double area;
    @Schema(title = "卡片数量")
    private Integer cardCount;
@@ -41,10 +77,11 @@
    @Schema(title = "地址")
    private String address;
    @Schema(title = "备注")
    private String remarks;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Schema(title = "注册时间")
    private Date operateDt;
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoOperate.java
New file
@@ -0,0 +1,66 @@
package com.dy.pipIrrGlobal.voSe;
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;
import java.util.Date;
/**
 * @author ZhuBaoMin
 * @date 2023-12-26 20:44
 * @LastEditTime 2023-12-26 20:44
 * @Description
 */
@Data
@Schema(title = "操作记录视图对象")
public class VoOperate implements BaseEntity {
    private static final long serialVersionUID = 1L;
    @Schema(title = "村ID")
    private Long villageId;
    @Schema(title = "区划名称串")
    private String districtTitle;
    @Schema(title = "农户编号")
    private String clientNum;
    @Schema(title = "农户姓名")
    private String name;
    @Schema(title = "水卡编号")
    private Long cardNum;
    @Schema(title = "身份证号")
    private String idCard;
    @Schema(title = "手机号")
    private String phone;
    @Schema(title = "充值金额")
    private Float money;
    @Schema(title = "购卡金额")
    private Integer cardCost;
    @Schema(title = "支付方式编号")
    private Long paymentId;
    @Schema(title = "支付方式名称")
    private String paymentMethod;
    @Schema(title = "业务类型")
    private String operateType;
    @Schema(title = "交易时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date operateDt;
    @Schema(title = "操作员")
    private String operatorName;
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoStatistics.java
New file
@@ -0,0 +1,42 @@
package com.dy.pipIrrGlobal.voSe;
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;
import java.util.Date;
/**
 * @author ZhuBaoMin
 * @date 2023-12-27 15:01
 * @LastEditTime 2023-12-27 15:01
 * @Description
 */
@Data
@Schema(title = "交易汇总视图对象")
public class VoStatistics implements BaseEntity {
    private static final long serialVersionUID = 1L;
    @Schema(title = "村庄ID")
    private Long villageId;
    @Schema(title = "村庄")
    private String districtTitle;
    @Schema(title = "业务类型")
    private String operateType;
    @Schema(title = "交易日期")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date operateDt;
    @Schema(title = "交易笔数")
    private Integer count;
    @Schema(title = "交易金额")
    private Float money;
}
pipIrr-platform/pipIrr-global/src/main/resources/application-global.yml
@@ -110,4 +110,12 @@
    project:
        webPort: 8085
        actutorPort: 9085
        idSuffix: 7
        idSuffix: 7
#项目编号
projectCode:
    ym: 100
    pj: 101
#通讯协议
protocol: DYJS_2023,DYJS_2024
pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaDistrictMapper.xml
@@ -165,4 +165,20 @@
        INNER JOIN ba_district pro ON cit.supperId = pro.id
    WHERE vil.id = ${villageId}
  </select>
    <!--根据级别获取行政区划列表-->
    <select id="getDistrictgsByLevel" resultType="java.util.Map">
        SELECT
            CAST(id AS char) AS id,
            name
        FROM ba_district WHERE `level` = ${level}
    </select>
    <!--根据父ID获取行政区划列表-->
    <select id="getDistrictsBySupperId" resultType="java.util.Map">
        SELECT
            CAST(id AS char) AS id,
            name
        FROM ba_district WHERE supperId = ${supperId}
    </select>
</mapper>
pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrControllerMapper.xml
New file
@@ -0,0 +1,128 @@
<?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.daoPr.PrControllerMapper">
  <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoPr.PrController">
    <!--@mbg.generated-->
    <!--@Table pr_controller-->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="code" jdbcType="VARCHAR" property="code" />
    <result column="protocol" jdbcType="VARCHAR" property="protocol" />
    <result column="addWays" jdbcType="TINYINT" property="addways" />
    <result column="operator" jdbcType="BIGINT" property="operator" />
    <result column="operateDt" jdbcType="TIMESTAMP" property="operatedt" />
    <result column="deleted" jdbcType="TINYINT" property="deleted" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    id, code, protocol, addWays, `operator`, operateDt, deleted
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    <!--@mbg.generated-->
    select
    <include refid="Base_Column_List" />
    from pr_controller
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    <!--@mbg.generated-->
    delete from pr_controller
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoPr.PrController">
    <!--@mbg.generated-->
    insert into pr_controller (id, code, protocol,
      addWays, `operator`, operateDt,
      deleted)
    values (#{id,jdbcType=BIGINT}, #{code,jdbcType=VARCHAR}, #{protocol,jdbcType=VARCHAR},
      #{addways,jdbcType=TINYINT}, #{operator,jdbcType=BIGINT}, #{operatedt,jdbcType=TIMESTAMP},
      #{deleted,jdbcType=TINYINT})
  </insert>
  <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoPr.PrController">
    <!--@mbg.generated-->
    insert into pr_controller
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="code != null">
        code,
      </if>
      <if test="protocol != null">
        protocol,
      </if>
      <if test="addways != null">
        addWays,
      </if>
      <if test="operator != null">
        `operator`,
      </if>
      <if test="operatedt != null">
        operateDt,
      </if>
      <if test="deleted != null">
        deleted,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="code != null">
        #{code,jdbcType=VARCHAR},
      </if>
      <if test="protocol != null">
        #{protocol,jdbcType=VARCHAR},
      </if>
      <if test="addways != null">
        #{addways,jdbcType=TINYINT},
      </if>
      <if test="operator != null">
        #{operator,jdbcType=BIGINT},
      </if>
      <if test="operatedt != null">
        #{operatedt,jdbcType=TIMESTAMP},
      </if>
      <if test="deleted != null">
        #{deleted,jdbcType=TINYINT},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoPr.PrController">
    <!--@mbg.generated-->
    update pr_controller
    <set>
      <if test="code != null">
        code = #{code,jdbcType=VARCHAR},
      </if>
      <if test="protocol != null">
        protocol = #{protocol,jdbcType=VARCHAR},
      </if>
      <if test="addways != null">
        addWays = #{addways,jdbcType=TINYINT},
      </if>
      <if test="operator != null">
        `operator` = #{operator,jdbcType=BIGINT},
      </if>
      <if test="operatedt != null">
        operateDt = #{operatedt,jdbcType=TIMESTAMP},
      </if>
      <if test="deleted != null">
        deleted = #{deleted,jdbcType=TINYINT},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoPr.PrController">
    <!--@mbg.generated-->
    update pr_controller
    set code = #{code,jdbcType=VARCHAR},
      protocol = #{protocol,jdbcType=VARCHAR},
      addWays = #{addways,jdbcType=TINYINT},
      `operator` = #{operator,jdbcType=BIGINT},
      operateDt = #{operatedt,jdbcType=TIMESTAMP},
      deleted = #{deleted,jdbcType=TINYINT}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>
pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrDivideMapper.xml
@@ -227,8 +227,9 @@
      lat = #{lat,jdbcType=DOUBLE},
      remarks = #{remarks,jdbcType=VARCHAR},
      `operator` = #{operator,jdbcType=BIGINT},
      operateDt = #{operatedt,jdbcType=TIMESTAMP},
      deleted = #{deleted,jdbcType=TINYINT}
      operateDt = #{operatedt,jdbcType=TIMESTAMP}
<!--    ,-->
<!--      deleted = #{deleted,jdbcType=TINYINT}-->
    where id = #{id,jdbcType=BIGINT}
  </update>
@@ -243,6 +244,7 @@
        INNER JOIN ba_district village ON divi.villageid = village.id
        , (SELECT @i:=0) AS itable
    <where>
      AND divi. deleted = 0
      <if test = "divideName != null and divideName !=''">
        AND divi.name LIKE CONCAT('%',#{divideName},'%')
      </if>
@@ -270,6 +272,7 @@
        INNER JOIN ba_district village ON divi.villageid = village.id
        , (SELECT @i:=0) AS itable
    <where>
      AND divi. deleted = 0
      <if test = "divideName != null and divideName !=''">
        AND divi.name LIKE CONCAT('%',#{divideName},'%')
      </if>
@@ -284,4 +287,19 @@
    </if>
  </select>
  <!--根据分水房ID逻辑删除分水房-->
  <update id="deleteDivideById" parameterType="java.lang.Long">
    update pr_divide set deleted = 1
    <where>
      <if test = "id != null and id > 0">
        AND id = ${id}
      </if>
    </where>
  </update>
  <!--根据分水房编号获取所属片区编号-->
  <select id="getBlockIdById" resultType="java.lang.Long">
    SELECT blockId FROM pr_divide WHERE id = ${divideId}}
  </select>
</mapper>
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeClientCardMapper.xml
@@ -257,4 +257,55 @@
      remarks = #{remarks,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
  <!--根据农户主键获取水卡列表-->
  <select id="getCardInfoByClientId" resultType="com.dy.pipIrrGlobal.voSe.VoCardInfo">
    SELECT
        cardNum,
        '用户卡' AS cardType,
        money,
        (CASE
            WHEN state = 1 THEN "正常"
            WHEN state = 2 THEN "已注销"
            ELSE "已挂失"
        END) AS state
    FROM se_client_card
    WHERE clientId = ${clientId}
  </select>
  <!--根据水卡编号获取操作记录列表-->
  <select id="getOperateRecordsByCardNum" resultType="java.util.HashMap">
    SELECT * FROM v_operate WHERE cardNum = ${cardNum}
  </select>
  <!--根据水卡编号获取余额-->
  <select id="getMoneyByCardNum" resultType="java.lang.Float">
    SELECT money FROM se_client_card WHERE cardNum = ${cardNum}
  </select>
  <!--根据水卡编号获取充值总额-->
  <select id="sumRechargeByCardNum" resultType="java.lang.Float">
    SELECT
      SUM(his.amount) AS amount
    FROM se_recharge_history his
        INNER JOIN se_client_card card ON his.cardId = card.id
    WHERE card.cardNum = ${cardNum}
  </select>
  <!--根据水卡编号获取卡片状态:1-开卡,2-补卡,3-充值,4-挂失,5-注销,6-解锁,7-冲正,8-消费-->
  <select id="getCardStateByCardNum" resultType="java.lang.String">
    SELECT
      (CASE
         WHEN lastOper = 1 THEN "开卡"
         WHEN lastOper = 2 THEN "补卡"
         WHEN lastOper = 3 THEN "充值"
         WHEN lastOper = 4 THEN "挂失"
         WHEN lastOper = 5 THEN "注销"
         WHEN lastOper = 6 THEN "解锁"
         WHEN lastOper = 7 THEN "冲正"
         WHEN lastOper = 8 THEN "消费"
        END) AS stateName
    FROM se_client_card
    WHERE cardNum = ${cardNum}
  </select>
</mapper>
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeClientMapper.xml
@@ -11,12 +11,14 @@
    <result column="blockId" jdbcType="BIGINT" property="blockid" />
    <result column="divideId" jdbcType="BIGINT" property="divideid" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="virtualId" jdbcType="BIGINT" property="virtualid" />
    <result column="clientNum" jdbcType="VARCHAR" property="clientnum" />
    <result column="districtNum" jdbcType="BIGINT" property="districtnum" />
    <result column="districtTitle" jdbcType="VARCHAR" property="districttitle" />
    <result column="phone" jdbcType="VARCHAR" property="phone" />
    <result column="idCard" jdbcType="VARCHAR" property="idcard" />
    <result column="area" jdbcType="DOUBLE" property="area" />
    <result column="typeId" jdbcType="BIGINT" property="typeid" />
    <result column="address" jdbcType="VARCHAR" property="address" />
    <result column="remarks" jdbcType="VARCHAR" property="remarks" />
    <result column="operator" jdbcType="BIGINT" property="operator" />
@@ -26,9 +28,9 @@
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    id, countyId, townId, villageId, blockId, divideId, `name`, clientNum, districtNum,
    districtTitle, phone, idCard, area, address, remarks, `operator`, operateDt, disabled,
    deleted
    id, countyId, townId, villageId, blockId, divideId, `name`, virtualId, clientNum,
    districtNum, districtTitle, phone, idCard, area, typeId, address, remarks, `operator`,
    operateDt, disabled, deleted
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    <!--@mbg.generated-->
@@ -42,23 +44,27 @@
    delete from se_client
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClient">
    <!--@mbg.generated-->
    insert into se_client (id, countyId, townId, 
      villageId, blockId, divideId, 
      `name`, clientNum, districtNum,
      districtTitle, phone, idCard,
      area, address, remarks,
      `operator`, operateDt, disabled,
      deleted)
      `name`, virtualId, clientNum,
      districtNum, districtTitle, phone,
      idCard, area, typeId,
      address, remarks, `operator`,
      operateDt, disabled, deleted
      )
    values (#{id,jdbcType=BIGINT}, #{countyid,jdbcType=BIGINT}, #{townid,jdbcType=BIGINT}, 
      #{villageid,jdbcType=BIGINT}, #{blockid,jdbcType=BIGINT}, #{divideid,jdbcType=BIGINT}, 
      #{name,jdbcType=VARCHAR}, #{clientnum,jdbcType=VARCHAR}, #{districtnum,jdbcType=BIGINT},
      #{districttitle,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, #{idcard,jdbcType=VARCHAR},
      #{area,jdbcType=DOUBLE}, #{address,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR},
      #{operator,jdbcType=BIGINT}, #{operatedt,jdbcType=TIMESTAMP}, #{disabled,jdbcType=TINYINT},
      #{deleted,jdbcType=TINYINT})
      #{name,jdbcType=VARCHAR}, #{virtualid,jdbcType=BIGINT}, #{clientnum,jdbcType=VARCHAR},
      #{districtnum,jdbcType=BIGINT}, #{districttitle,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR},
      #{idcard,jdbcType=VARCHAR}, #{area,jdbcType=DOUBLE}, #{typeid,jdbcType=BIGINT},
      #{address,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT},
      #{operatedt,jdbcType=TIMESTAMP}, #{disabled,jdbcType=TINYINT}, #{deleted,jdbcType=TINYINT}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClient">
    <!--@mbg.generated-->
    insert into se_client
@@ -84,6 +90,9 @@
      <if test="name != null">
        `name`,
      </if>
      <if test="virtualid != null">
        virtualId,
      </if>
      <if test="clientnum != null">
        clientNum,
      </if>
@@ -101,6 +110,9 @@
      </if>
      <if test="area != null">
        area,
      </if>
      <if test="typeid != null">
        typeId,
      </if>
      <if test="address != null">
        address,
@@ -143,6 +155,9 @@
      <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="virtualid != null">
        #{virtualid,jdbcType=BIGINT},
      </if>
      <if test="clientnum != null">
        #{clientnum,jdbcType=VARCHAR},
      </if>
@@ -160,6 +175,9 @@
      </if>
      <if test="area != null">
        #{area,jdbcType=DOUBLE},
      </if>
      <if test="typeid != null">
        #{typeid,jdbcType=BIGINT},
      </if>
      <if test="address != null">
        #{address,jdbcType=VARCHAR},
@@ -203,6 +221,9 @@
      <if test="name != null">
        `name` = #{name,jdbcType=VARCHAR},
      </if>
      <if test="virtualid != null">
        virtualId = #{virtualid,jdbcType=BIGINT},
      </if>
      <if test="clientnum != null">
        clientNum = #{clientnum,jdbcType=VARCHAR},
      </if>
@@ -220,6 +241,9 @@
      </if>
      <if test="area != null">
        area = #{area,jdbcType=DOUBLE},
      </if>
      <if test="typeid != null">
        typeId = #{typeid,jdbcType=BIGINT},
      </if>
      <if test="address != null">
        address = #{address,jdbcType=VARCHAR},
@@ -251,17 +275,18 @@
      blockId = #{blockid,jdbcType=BIGINT},
      divideId = #{divideid,jdbcType=BIGINT},
      `name` = #{name,jdbcType=VARCHAR},
<!--      virtualId = #{virtualid,jdbcType=BIGINT},-->
      clientNum = #{clientnum,jdbcType=VARCHAR},
      districtNum = #{districtnum,jdbcType=BIGINT},
      districtTitle = #{districttitle,jdbcType=VARCHAR},
      phone = #{phone,jdbcType=VARCHAR},
      idCard = #{idcard,jdbcType=VARCHAR},
      area = #{area,jdbcType=DOUBLE},
      typeId = #{typeid,jdbcType=BIGINT},
      address = #{address,jdbcType=VARCHAR},
      remarks = #{remarks,jdbcType=VARCHAR},
      `operator` = #{operator,jdbcType=BIGINT},
      operateDt = #{operatedt,jdbcType=TIMESTAMP}
<!--    ,-->
      operateDt = #{operatedt,jdbcType=TIMESTAMP},
<!--      disabled = #{disabled,jdbcType=TINYINT},-->
<!--      deleted = #{deleted,jdbcType=TINYINT}-->
    where id = #{id,jdbcType=BIGINT}
@@ -283,18 +308,22 @@
    FROM se_client cli
    , (SELECT @i:=0) AS itable
    <where>
      AND disabled = 0
      AND deleted = 0
      AND cli.disabled = 0
      AND cli.deleted = 0
      <if test = "name != null and name !=''">
        AND name like CONCAT('%',#{name},'%')
        AND cli.name like CONCAT('%',#{name},'%')
      </if>
      <if test = "num != null and num !=''">
        AND clientNum like CONCAT('%',#{num},'%')
      <if test = "clientNum != null and clientNum !=''">
        AND cli.clientNum like CONCAT('%',#{clientNum},'%')
      </if>
      <if test = "phone != null and phone !=''">
        AND phone like CONCAT('%',#{phone},'%')
        AND cli.phone like CONCAT('%',#{phone},'%')
      </if>
      <if test = "address != null and address !=''">
        AND cli.address like CONCAT('%',#{address},'%')
      </if>
    </where>
@@ -305,35 +334,56 @@
  <select id="getClients" resultType="com.dy.pipIrrGlobal.voSe.VoClient">
    SELECT
        (@i:=@i+1) AS id,
        name,
        clientNum,
        phone,
        idCard,
        (SELECT COUNT(*) FROM se_client_card WHERE clientNum = cli.clientNum) AS cardCount,
        address,
        operateDt
        CAST(cli.countyId AS char) AS countyId,
        dis_con.name AS countryName,
        CAST(cli.townId AS char) AS townId,
        dis_town.name AS townName,
        CAST(cli.villageId AS char) AS villageId,
        dis_village.name AS villageName,
        CAST(cli.blockId AS char) AS blockId,
        blo.name AS bolckName,
        CAST(cli.divideId AS char) AS divideId,
        divi.name AS divideName,
        CAST(cli.typeId AS char) AS waterTypeId,
        wat.typeName AS waterTypeName,
        CAST(cli.id AS char) AS clientId,
        cli.name,
        cli.clientNum,
        cli.phone,
        cli.idCard,
        cli.area,
        (SELECT COUNT(*) FROM se_client_card WHERE clientId = cli.id) AS cardCount,
        cli.address,
        cli.remarks,
        cli.operateDt
    FROM se_client cli
        , (SELECT @i:=0) AS itable
    LEFT JOIN ba_district dis_con ON cli.countyId = dis_con.id
    LEFT JOIN ba_district dis_town ON cli.townId = dis_town.id
    LEFT JOIN ba_district dis_village ON cli.villageId = dis_village.id
    LEFT JOIN ba_block blo ON cli.blockId = blo.id
    LEFT JOIN pr_divide divi ON cli.divideId = divi.id
    LEFT JOIN se_water_type wat ON cli.typeId = wat.id
    , (SELECT @i:=0) AS itable
    <where>
      AND disabled = 0
      AND deleted = 0
      AND cli.disabled = 0
      AND cli.deleted = 0
      <if test = "name != null and name !=''">
        AND name like CONCAT('%',#{name},'%')
        AND cli.name like CONCAT('%',#{name},'%')
      </if>
      <if test = "clientNum != null and clientNum !=''">
        AND clientNum like CONCAT('%',#{clientNum},'%')
        AND cli.clientNum like CONCAT('%',#{clientNum},'%')
      </if>
      <if test = "phone != null and phone !=''">
        AND phone like CONCAT('%',#{phone},'%')
        AND cli.phone like CONCAT('%',#{phone},'%')
      </if>
      <if test = "address != null and address !=''">
        AND address like CONCAT('%',#{address},'%')
        AND cli.address like CONCAT('%',#{address},'%')
      </if>
    </where>
    ORDER BY operateDt DESC
    ORDER BY cli.operateDt DESC
    <if test="pageCurr != null and pageSize != null">
      LIMIT ${pageCurr}, ${pageSize}
    </if>
@@ -363,4 +413,188 @@
  <select id="getVillageIdById" parameterType="java.lang.Long" resultType="java.lang.Long">
    SELECT villageId FROM se_client WHERE id = ${id}
  </select>
  <!--获取虚拟卡号最大值-->
  <select id="getMa1xVirtualId" resultType="java.lang.Long">
    SELECT virtualId FROM se_client ORDER BY id DESC LIMIT 0,1
  </select>
  <!--获取用水方式列表-->
  <select id="getWaterTypes" resultType="java.util.Map">
    SELECT id, typeName from se_water_type
  </select>
  <!-- 下列内容为交易明细查询 -->
  <!--根据指定条件获取购水汇总和购卡汇总-->
  <select id="getSums" resultType="java.util.Map">
    SELECT
        SUM(money) AS money,
        SUM(cardCost) AS cardCost
    FROM v_operate
    <where>
      <if test = "villageId != null and villageId > 0">
        AND villageId = ${villageId}
      </if>
      <if test = "paymentId != null and paymentId >0">
        AND paymentId = ${paymentId}
      </if>
      <if test = "operateTimeStart != null and operateTimeStop != null">
        AND operateDt BETWEEN #{operateTimeStart} AND #{operateTimeStop}
      </if>
    </where>
  </select>
  <!--根据指定条件获取交易记录数-->
  <select id="getOperateRecordCount" parameterType="java.util.Map" resultType="java.lang.Long">
    SELECT
        COUNT(*) AS recordCount
    FROM v_operate
    <where>
      <if test = "villageId != null and villageId > 0">
        AND villageId = ${villageId}
      </if>
      <if test = "paymentId != null and paymentId >0">
        AND paymentId = ${paymentId}
      </if>
      <if test = "operateTimeStart != null and operateTimeStop != null">
        AND operateDt BETWEEN #{operateTimeStart} AND #{operateTimeStop}
      </if>
    </where>
  </select>
  <!--根据指定条件获取交易记录-->
  <select id="getOperates" resultType="com.dy.pipIrrGlobal.voSe.VoOperate">
    SELECT
        villageId,
        districtTitle,
        clientNum,
        `name`,
        cardNum,
        idCard,
        phone,
        money,
        cardCost,
        paymentId,
        paymentMethod,
        operateType,
        operateDt,
        operatorName
    FROM v_operate
    <where>
      <if test = "villageId != null and villageId > 0">
        AND villageId = ${villageId}
      </if>
      <if test = "paymentId != null and paymentId >0">
        AND paymentId = ${paymentId}
      </if>
      <if test = "operateTimeStart != null and operateTimeStop != null">
        AND operateDt BETWEEN #{operateTimeStart} AND #{operateTimeStop}
      </if>
    </where>
    ORDER BY operateDt
    <if test="pageCurr != null and pageSize != null">
      LIMIT ${pageCurr}, ${pageSize}
    </if>
  </select>
  <!-- 下列内容为交易统计查询 -->
  <!--根据指定条件获取交易笔数汇总和交易金额汇总-->
  <select id="getStatisticSums" resultType="java.util.Map">
    SELECT
    SUM(count) AS count,
    SUM(money) AS money
    FROM
    (
      SELECT
      villageId,
      districtTitle,
      operateType,
      operateDt,
      count(*) AS count,
      (sum(money) + sum(cardCost)) AS money
      FROM v_operate
      <where>
        <if test = "villageId != null and villageId > 0">
          AND villageId = ${villageId}
        </if>
<!--        <if test = "paymentId != null and paymentId >0">-->
<!--          AND paymentId = ${paymentId}-->
<!--        </if>-->
        <if test = "operateTimeStart != null and operateTimeStop != null">
          AND operateDt BETWEEN #{operateTimeStart} AND #{operateTimeStop}
        </if>
      </where>
      GROUP BY villageId, districtTitle, operateType, operateDt
    ) temp
  </select>
  <!--根据指定条件获取汇总记录数-->
  <select id="getStatisticRecordCount" parameterType="java.util.Map" resultType="java.lang.Long">
    SELECT
        COUNT(*) AS recordCount
    FROM
    (
        SELECT
          villageId,
          districtTitle,
          operateType,
          operateDt,
          count(*) AS count,
          (sum(money) + sum(cardCost)) AS money
        FROM v_operate
        <where>
          <if test = "villageId != null and villageId > 0">
            AND villageId = ${villageId}
          </if>
<!--          <if test = "paymentId != null and paymentId >0">-->
<!--            AND paymentId = ${paymentId}-->
<!--          </if>-->
          <if test = "operateTimeStart != null and operateTimeStop != null">
            AND operateDt BETWEEN #{operateTimeStart} AND #{operateTimeStop}
          </if>
        </where>
        GROUP BY villageId, districtTitle, operateType, operateDt
    ) temp
  </select>
  <!--根据指定条件获取统计记录-->
  <select id="getStatistics" resultType="com.dy.pipIrrGlobal.voSe.VoStatistics">
    SELECT
        villageId,
        districtTitle,
        operateType,
        operateDt,
        count(*) AS count,
        (sum(money) + sum(cardCost)) AS money
    FROM v_operate
    <where>
      <if test = "villageId != null and villageId > 0">
        AND villageId = ${villageId}
      </if>
<!--      <if test = "paymentId != null and paymentId >0">-->
<!--        AND paymentId = ${paymentId}-->
<!--      </if>-->
      <if test = "operateTimeStart != null and operateTimeStop != null">
        AND operateDt BETWEEN #{operateTimeStart} AND #{operateTimeStop}
      </if>
    </where>
    GROUP BY villageId, districtTitle, operateType, operateDt
    ORDER BY operateDt
    <if test="pageCurr != null and pageSize != null">
      LIMIT ${pageCurr}, ${pageSize}
    </if>
  </select>
</mapper>
pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/web/com/CommandCtrl.java
@@ -1,5 +1,6 @@
package com.dy.aceMw.web.com;
import com.dy.aceMw.server.ServerProperties;
import com.dy.aceMw.server.forTcp.TcpSessionCache;
import com.dy.aceMw.server.local.CommandInnerDeaLer;
import com.dy.aceMw.server.local.ReturnCommand;
@@ -97,7 +98,9 @@
        if(onLine == null){
            return BaseResponseUtils.buildError(ReturnCommand.errored("出错,RTU(地址=" + rtuAddr + ")未上线!", command.getId(), command.getCode())) ;
        }else if(!onLine.booleanValue()){
            return BaseResponseUtils.buildError(ReturnCommand.errored("出错,RTU(地址=" + rtuAddr + ")离线!", command.getId(), command.getCode())) ;
            if(!ServerProperties.isLowPower){
                return BaseResponseUtils.buildError(ReturnCommand.errored("出错,RTU(地址=" + rtuAddr + ")离线!", command.getId(), command.getCode())) ;
            }
        }
        //生成异步任务
@@ -114,21 +117,4 @@
        return BaseResponseUtils.buildSuccess(ReturnCommand.successed("命令已接受,即将构造并下发命令。", command.getId(), command.getCode()));
    }
    /**
     * 收到命令结果
     * @param command
    private void dealCommandResult(String jgSenderName, Command command){
        Object obj = command.getParam() ;
        if(obj != null){
            CommandBackParam p = (CommandBackParam)obj ;
            if(p.getSuccess()){
                log.info("命令" + (command.getId().equals(Command.defaultId)?"":("(id=" + command.getId() + ")")) + "执行成功"
                        + (p.getMessage() == null?"":(p.getMessage().equals("")?"":("," + p.getMessage()))));
            }else{
                log.error("命令" + (command.getId().equals(Command.defaultId)?"":("(id=" + command.getId() + ")")) + "执行失败"
                        + (p.getMessage() == null?"":(p.getMessage().equals("")?"":("," + p.getMessage()))));
            }
        }
    }
    */
}
pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/web/comResult/CommandResultDeal.java
@@ -28,7 +28,6 @@
        this.restTemplate = restTemplate ;
    }
    public void deal(Data data) {
        if (data.rtuResultSendWebUrl != null && data.rtuResultSendWebUrl.trim().equals("")) {
            String url = UriComponentsBuilder.fromUriString(data.rtuResultSendWebUrl)
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/block/BlockCtrl.java
@@ -7,7 +7,6 @@
import com.dy.common.webUtil.ResultCodeMsg;
import com.dy.pipIrrGlobal.pojoBa.BaBlock;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
@@ -77,7 +76,7 @@
    })
    @PostMapping(path = "some", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop()
    public BaseResponse<QueryResultVo<List<BaBlock>>> some(@RequestBody @Parameter(description = "查询form表单json数据", required = true) QueryVo vo){
    public BaseResponse<QueryResultVo<List<BaBlock>>> some(@RequestBody QueryVo vo){
        try {
            QueryResultVo<List<BaBlock>> res = this.sv.selectSome(vo) ;
            return BaseResponseUtils.buildSuccess(res);
@@ -102,7 +101,7 @@
    })
    @GetMapping(path = "one", consumes = MediaType.TEXT_PLAIN_VALUE)
    @SsoAop()
    public BaseResponse<BaBlock> one(@Parameter(description = "实体id", required = true) Long id){
    public BaseResponse<BaBlock> one(Long id){
        return BaseResponseUtils.buildSuccess(this.sv.selectById(id));
    }
@@ -122,7 +121,7 @@
    })
    @PostMapping(path = "save", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop()
    public BaseResponse<Boolean> save(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid BaBlock po, @Parameter(hidden = true) BindingResult bindingResult){
    public BaseResponse<Boolean> save(@RequestBody @Valid BaBlock po, BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
@@ -157,7 +156,7 @@
    })
    @PostMapping(path = "update", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop()
    public BaseResponse<Boolean> update(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid BaBlock po, @Parameter(hidden = true) BindingResult bindingResult){
    public BaseResponse<Boolean> update(@RequestBody @Valid BaBlock po, BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
@@ -195,7 +194,7 @@
    })
    @GetMapping(path = "delete", consumes = MediaType.TEXT_PLAIN_VALUE)
    @SsoAop()
    public BaseResponse<Boolean> delete(@Parameter(description = "实体id", required = true) Long id){
    public BaseResponse<Boolean> delete(Long id){
        if(id == null){
            return BaseResponseUtils.buildFail("id不能为空") ;
        }
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/client/ClientCtrl.java
@@ -8,7 +8,6 @@
import com.dy.common.webUtil.ResultCodeMsg;
import com.dy.pipIrrGlobal.pojoBa.BaClient;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
@@ -53,7 +52,7 @@
    })
    @PostMapping(path = "some", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop()
    public BaseResponse<QueryResultVo<List<BaClient>>> some(@RequestBody @Parameter(description = "查询form表单json数据", required = true) QueryVo vo){
    public BaseResponse<QueryResultVo<List<BaClient>>> some(@RequestBody QueryVo vo){
        try {
            QueryResultVo<List<BaClient>> res = this.sv.selectSome(vo) ;
            return BaseResponseUtils.buildSuccess(res);
@@ -78,7 +77,7 @@
    })
    @GetMapping(path = "one", consumes = MediaType.TEXT_PLAIN_VALUE)
    @SsoAop()
    public BaseResponse<BaClient> one(@Parameter(description = "实体id", required = true) Long id){
    public BaseResponse<BaClient> one(Long id){
        return BaseResponseUtils.buildSuccess(this.sv.selectById(id));
    }
@@ -98,7 +97,7 @@
    })
    @PostMapping(path = "save", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop()
    public BaseResponse<Boolean> save(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid BaClient po, @Parameter(hidden = true) BindingResult bindingResult){
    public BaseResponse<Boolean> save(@RequestBody @Valid BaClient po, BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
@@ -133,7 +132,7 @@
    })
    @PostMapping(path = "update", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop()
    public BaseResponse<Boolean> update(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid BaClient po, @Parameter(hidden = true) BindingResult bindingResult){
    public BaseResponse<Boolean> update(@RequestBody @Valid BaClient po, BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
@@ -171,7 +170,7 @@
    })
    @GetMapping(path = "delete", consumes = MediaType.TEXT_PLAIN_VALUE)
    @SsoAop()
    public BaseResponse<Boolean> delete(@Parameter(description = "实体id", required = true) Long id){
    public BaseResponse<Boolean> delete(Long id){
        if(id == null){
            return BaseResponseUtils.buildFail("id不能为空") ;
        }
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/clientType/ClientTypeCtrl.java
@@ -9,7 +9,6 @@
import com.dy.pipIrrBase.user.QueryVo;
import com.dy.pipIrrGlobal.pojoBa.BaClientType;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
@@ -79,7 +78,7 @@
    })
    @PostMapping(path = "some", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop()
    public BaseResponse<QueryResultVo<List<BaClientType>>> some(@RequestBody @Parameter(description = "查询form表单json数据", required = true) @Valid QueryVo vo){
    public BaseResponse<QueryResultVo<List<BaClientType>>> some(@RequestBody @Valid QueryVo vo){
        try {
            QueryResultVo<List<BaClientType>> res = this.sv.selectSome(vo) ;
            return BaseResponseUtils.buildSuccess(res);
@@ -104,7 +103,7 @@
    })
    @GetMapping(path = "one", consumes = MediaType.TEXT_PLAIN_VALUE)
    @SsoAop()
    public BaseResponse<BaClientType> one(@Parameter(description = "实体id", required = true) Long id){
    public BaseResponse<BaClientType> one(Long id){
        return BaseResponseUtils.buildSuccess(this.sv.selectById(id));
    }
@@ -124,7 +123,7 @@
    })
    @PostMapping(path = "save", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop()
    public BaseResponse<Boolean> save(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid BaClientType po, @Parameter(hidden = true) BindingResult bindingResult){
    public BaseResponse<Boolean> save(@RequestBody @Valid BaClientType po, BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
@@ -159,7 +158,7 @@
    })
    @PostMapping(path = "update", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop()
    public BaseResponse<Boolean> update(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid BaClientType po, @Parameter(hidden = true) BindingResult bindingResult){
    public BaseResponse<Boolean> update(@RequestBody @Valid BaClientType po, BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
@@ -197,7 +196,7 @@
    })
    @GetMapping(path = "delete", consumes = MediaType.TEXT_PLAIN_VALUE)
    @SsoAop()
    public BaseResponse<Boolean> delete(@Parameter(description = "实体id", required = true) Long id){
    public BaseResponse<Boolean> delete(Long id){
        if(id == null){
            return BaseResponseUtils.buildFail("id不能为空") ;
        }
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/district/DistrictCtrl.java
@@ -4,11 +4,12 @@
import com.dy.common.mybatis.envm.Deleted;
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.pojoBa.BaClient;
import com.dy.pipIrrGlobal.pojoBa.BaDistrict;
import com.dy.pipIrrGlobal.util.DistrictLevel;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
@@ -21,8 +22,7 @@
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Objects;
import java.util.*;
@Slf4j
@Tag(name = "行政区划管理", description = "行政区划增删改查等操作")
@@ -92,7 +92,7 @@
    })
    @GetMapping(path = "one", consumes = MediaType.TEXT_PLAIN_VALUE)
    @SsoAop()
    public BaseResponse<BaDistrict> one(@Parameter(description = "实体id", required = true) Long id){
    public BaseResponse<BaDistrict> one(Long id){
        return BaseResponseUtils.buildSuccess(this.sv.selectById(id));
    }
@@ -112,7 +112,7 @@
    })
    @PostMapping(path = "save", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop()
    public BaseResponse<Boolean> save(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid DistrictVo vo, @Parameter(hidden = true) BindingResult bindingResult){
    public BaseResponse<Boolean> save(@RequestBody @Valid DistrictVo vo, BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
@@ -154,7 +154,7 @@
    })
    @PostMapping(path = "update", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop()
    public BaseResponse<Boolean> update(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid DistrictVo vo, @Parameter(hidden = true) BindingResult bindingResult){
    public BaseResponse<Boolean> update(@RequestBody @Valid DistrictVo vo, BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
@@ -190,7 +190,7 @@
    })
    @GetMapping(path = "delete", consumes = MediaType.TEXT_PLAIN_VALUE)
    @SsoAop()
    public BaseResponse<Boolean> delete(@Parameter(description = "实体id", required = true) Long id){
    public BaseResponse<Boolean> delete(Long id){
        if(id == null){
            return BaseResponseUtils.buildFail("id不能为空") ;
        }
@@ -207,4 +207,60 @@
            return BaseResponseUtils.buildSuccess(true) ;
        }
    }
    /**
     * 根据级别获取行政区划列表
     * @param id
     * @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 = BaClient.class))}
            )
    })
    @GetMapping(path = "/level/{id}")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<Map<String, Object>>>> getDistrictgsByLevel(@PathVariable("id") Integer id){
        if(id == null || id <= 0){
            return BaseResponseUtils.buildFail("id不能为空") ;
        }
        List<Map<String, Object>> map_Districts = Optional.ofNullable(sv.getDistrictgsByLevel(id)).orElse(new ArrayList<>());
        if(map_Districts == null || map_Districts.size() == 0) {
            return BaseResponseUtils.buildFail("您输入的层级有误") ;
        }
        return BaseResponseUtils.buildSuccess(map_Districts);
    }
    /**
     * 根据父ID获取行政区划列表
     * @param supperId
     * @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 = BaClient.class))}
            )
    })
    @GetMapping(path = "/supperid/{supperId}")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<Map<String, Object>>>> getDistrictsBySupperId(@PathVariable("supperId") Long supperId){
        if(supperId == null || supperId <= 0){
            return BaseResponseUtils.buildFail("父ID不能为空") ;
        }
        List<Map<String, Object>> map_Districts = Optional.ofNullable(sv.getDistrictsBySupperId(supperId)).orElse(new ArrayList<>());
        if(map_Districts == null || map_Districts.size() == 0) {
            return BaseResponseUtils.buildFail("您输入的父级ID有误") ;
        }
        return BaseResponseUtils.buildSuccess(map_Districts);
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/district/DistrictSv.java
@@ -9,6 +9,7 @@
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
@Slf4j
@Service
@@ -98,4 +99,22 @@
            }
        }
    }
    /**
     * 根据级别获取行政区划列表
     * @param level
     * @return
     */
    public List<Map<String, Object>> getDistrictgsByLevel(Integer level) {
        return dao.getDistrictgsByLevel(level);
    }
    /**
     * 根据父ID获取行政区划列表
     * @param supperId
     * @return
     */
    public List<Map<String, Object>> getDistrictsBySupperId(Long supperId) {
        return dao.getDistrictsBySupperId(supperId);
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/divide/DivideCtrl.java
@@ -7,7 +7,6 @@
import com.dy.common.webUtil.ResultCodeMsg;
import com.dy.pipIrrGlobal.pojoBa.BaDivide;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
@@ -76,7 +75,7 @@
    })
    @GetMapping(path = "one", consumes = MediaType.TEXT_PLAIN_VALUE)
    @SsoAop()
    public BaseResponse<BaDivide> one(@Parameter(description = "实体id", required = true) Long id){
    public BaseResponse<BaDivide> one(Long id){
        return BaseResponseUtils.buildSuccess(this.sv.selectById(id));
    }
    /**
@@ -94,7 +93,7 @@
    })
    @PostMapping(path = "some", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop()
    public BaseResponse<QueryResultVo<List<BaDivide>>> some(@RequestBody @Parameter(description = "查询form表单json数据", required = true) DivideVo vo){
    public BaseResponse<QueryResultVo<List<BaDivide>>> some(@RequestBody DivideVo vo){
        try {
            QueryResultVo<List<BaDivide>> res = this.sv.selectSome(vo) ;
            return BaseResponseUtils.buildSuccess(res);
@@ -120,7 +119,7 @@
    })
    @PostMapping(path = "save", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop()
    public BaseResponse<Boolean> save(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid BaDivide po, @Parameter(hidden = true) BindingResult bindingResult){
    public BaseResponse<Boolean> save(@RequestBody @Valid BaDivide po, BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
@@ -154,7 +153,7 @@
    })
    @PostMapping(path = "update", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop()
    public BaseResponse<Boolean> update(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid BaDivide po, @Parameter(hidden = true) BindingResult bindingResult){
    public BaseResponse<Boolean> update(@RequestBody @Valid BaDivide po, BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
@@ -192,7 +191,7 @@
    })
    @GetMapping(path = "delete", consumes = MediaType.TEXT_PLAIN_VALUE)
    @SsoAop()
    public BaseResponse<Boolean> delete(@Parameter(description = "实体id", required = true) Long id){
    public BaseResponse<Boolean> delete(Long id){
        if(id == null){
            return BaseResponseUtils.buildFail("id不能为空") ;
        }
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/role/RoleCtrl.java
@@ -11,7 +11,6 @@
import com.dy.pipIrrGlobal.pojoBa.BaRole;
import com.dy.pipIrrGlobal.pojoBa.BaRolePermissions;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
@@ -26,7 +25,9 @@
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import java.util.*;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
@Slf4j
@Tag(name = "角色管理", description = "角色增删改查等操作")
@@ -84,7 +85,7 @@
    })
    @PostMapping(path = "some", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop()
    public BaseResponse<QueryResultVo<List<BaRole>>> some(@RequestBody @Parameter(description = "查询form表单json数据", required = true) @Valid QueryVo vo){
    public BaseResponse<QueryResultVo<List<BaRole>>> some(@RequestBody @Valid QueryVo vo){
        try {
            QueryResultVo<List<BaRole>> res = this.sv.selectSome(vo) ;
            return BaseResponseUtils.buildSuccess(res);
@@ -109,7 +110,7 @@
    })
    @GetMapping(path = "one", consumes = MediaType.TEXT_PLAIN_VALUE)
    @SsoAop()
    public BaseResponse<BaRole> one(@Parameter(description = "实体id", required = true) Long id){
    public BaseResponse<BaRole> one(Long id){
        return BaseResponseUtils.buildSuccess(this.sv.selectById(id));
    }
@@ -129,7 +130,7 @@
    })
    @PostMapping(path = "save", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop()
    public BaseResponse<Boolean> save(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid BaRole po, @Parameter(hidden = true) BindingResult bindingResult){
    public BaseResponse<Boolean> save(@RequestBody @Valid BaRole po, BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
@@ -165,7 +166,7 @@
    })
    @PostMapping(path = "update", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop()
    public BaseResponse<Boolean> update(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid BaRole po, @Parameter(hidden = true) BindingResult bindingResult){
    public BaseResponse<Boolean> update(@RequestBody @Valid BaRole po, BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
@@ -205,8 +206,7 @@
    })
    @GetMapping(path = "setPrivs", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop()
    public BaseResponse<Boolean> setPrivileges(@Parameter(description = "实体id", required = true) Long id,
                                          @Parameter(description = "权限id数组") Long[] privIds){
    public BaseResponse<Boolean> setPrivileges(Long id, Long[] privIds){
        Long[] privIds_lg = null ;
        if(privIds != null && privIds.length > 0){
            privIds_lg = new Long[privIds.length] ;
@@ -239,7 +239,7 @@
    })
    @GetMapping(path = "delete", consumes = MediaType.TEXT_PLAIN_VALUE)
    @SsoAop()
    public BaseResponse<Boolean> delete(@Parameter(description = "实体id", required = true) Long id){
    public BaseResponse<Boolean> delete(Long id){
        if(id == null){
            return BaseResponseUtils.buildFail("id不能为空") ;
        }
@@ -269,7 +269,7 @@
    @PostMapping(path = "addPermissions", consumes = MediaType.APPLICATION_JSON_VALUE)
    @Transactional(rollbackFor = Exception.class)
    @SsoAop()
    public BaseResponse<Boolean> permission(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid BaRolePermissions po, @Parameter(hidden = true) BindingResult bindingResult){
    public BaseResponse<Boolean> permission(@RequestBody  @Valid BaRolePermissions po, BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserCtrl.java
@@ -14,7 +14,6 @@
import com.dy.pipIrrGlobal.voBa.VoUserInfo;
import com.mysql.cj.util.StringUtils;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
@@ -90,7 +89,7 @@
    })
    @PostMapping(path = "some", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop()
    public BaseResponse<QueryResultVo<List<BaUser>>> some(@RequestBody @Parameter(description = "查询form表单json数据", required = true) @Valid QueryVo vo) {
    public BaseResponse<QueryResultVo<List<BaUser>>> some(@RequestBody @Valid QueryVo vo) {
        try {
            QueryResultVo<List<BaUser>> res = this.sv.selectSome(vo);
            return BaseResponseUtils.buildSuccess(res);
@@ -116,7 +115,7 @@
    })
    @GetMapping(path = "one", consumes = MediaType.TEXT_PLAIN_VALUE)
    @SsoAop()
    public BaseResponse<BaUser> one(@Parameter(description = "实体id", required = true) String id) {
    public BaseResponse<BaUser> one(String id) {
        return BaseResponseUtils.buildSuccess(this.sv.selectById(Long.parseLong(id)));
    }
@@ -137,7 +136,7 @@
    })
    @PostMapping(path = "save", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop()
    public BaseResponse<Boolean> save(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid BaUser po, @Parameter(hidden = true) BindingResult bindingResult) {
    public BaseResponse<Boolean> save(@RequestBody @Valid BaUser po, BindingResult bindingResult) {
        if (bindingResult != null && bindingResult.hasErrors()) {
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
@@ -187,7 +186,7 @@
    })
    @PostMapping(path = "update", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop()
    public BaseResponse<Boolean> update(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid BaUser po, @Parameter(hidden = true) BindingResult bindingResult) {
    public BaseResponse<Boolean> update(@RequestBody @Valid BaUser po, BindingResult bindingResult) {
        if (bindingResult != null && bindingResult.hasErrors()) {
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
@@ -230,9 +229,7 @@
    })
    @GetMapping(path = "changePassword", consumes = MediaType.TEXT_PLAIN_VALUE)
    @SsoAop()
    public BaseResponse<Boolean> changePassword(@Parameter(description = "实体id", required = true) String id,
                                                @Parameter(description = "旧密码", required = true) String oldPassword,
                                                @Parameter(description = "新密码", required = true) String newPassword) throws Exception {
    public BaseResponse<Boolean> changePassword(String id, String oldPassword, String newPassword) throws Exception {
        if (id == null) {
            return BaseResponseUtils.buildFail("id不能为空");
        }
@@ -290,7 +287,7 @@
    })
    @PostMapping(path = "resetPassword", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop()
    public BaseResponse<Boolean> resetPassword(@RequestBody @Parameter(description = "form表单json数据", required = true) ResetPasswordVo vo) throws Exception {
    public BaseResponse<Boolean> resetPassword(@RequestBody  ResetPasswordVo vo) throws Exception {
        if (vo.id == null) {
            return BaseResponseUtils.buildFail("id不能为空");
        }
@@ -332,7 +329,7 @@
    })
    @GetMapping(path = "resetPasswordByDefault", consumes = MediaType.TEXT_PLAIN_VALUE)
    @SsoAop()
    public BaseResponse<Boolean> resetPasswordByDefault(@Parameter(description = "实体id", required = true) String id) throws Exception {
    public BaseResponse<Boolean> resetPasswordByDefault(String id) throws Exception {
        if (id == null) {
            return BaseResponseUtils.buildFail("id不能为空");
        }
@@ -375,7 +372,7 @@
    })
    @GetMapping(path = "resetPasswordByRandom", consumes = MediaType.TEXT_PLAIN_VALUE)
    @SsoAop()
    public BaseResponse<String> resetPasswordByRandom(@Parameter(description = "实体id", required = true) String id) throws Exception {
    public BaseResponse<String> resetPasswordByRandom(String id) throws Exception {
        if (id == null) {
            return BaseResponseUtils.buildFail("id不能为空");
        }
@@ -420,7 +417,7 @@
    })
    @GetMapping(path = "setRoles", consumes = MediaType.TEXT_PLAIN_VALUE)
    @SsoAop()
    public BaseResponse<Boolean> setRoles(@Parameter(description = "实体id", required = true) String id,
    public BaseResponse<Boolean> setRoles(String id,
                                          @Parameter(description = "角色id数组") String[] roleIds) {
        Long[] roleId_lg = null;
        if (roleIds != null && roleIds.length > 0) {
@@ -457,7 +454,7 @@
    })
    @GetMapping(path = "delete", consumes = MediaType.TEXT_PLAIN_VALUE)
    @SsoAop()
    public BaseResponse<Boolean> delete(@Parameter(description = "实体id", required = true) String id) {
    public BaseResponse<Boolean> delete(String id) {
        if (id == null) {
            return BaseResponseUtils.buildFail("id不能为空");
        }
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/PipIrrProjectApplication.java
@@ -18,7 +18,7 @@
@EnableAspectJAutoProxy
@EnableMultiDataSource
@ComponentScan(basePackages = {"com.dy.common", "com.dy.pipIrrGlobal", "com.dy.pipIrrProject"})
@MapperScan({"com.dy.pipIrrGlobal.daoPr"})
@MapperScan({"com.dy.pipIrrGlobal.daoPr", "com.dy.pipIrrGlobal.daoBa"})
public class PipIrrProjectApplication {
    public static void main(String[] args) {
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/controller/ControllerCtrl.java
New file
@@ -0,0 +1,71 @@
package com.dy.pipIrrProject.controller;
import com.dy.common.aop.SsoAop;
import com.dy.common.webUtil.BaseResponse;
import com.dy.common.webUtil.BaseResponseUtils;
import com.dy.common.webUtil.ResultCodeMsg;
import com.dy.pipIrrGlobal.pojoPr.PrController;
import com.dy.pipIrrProject.result.ProjectResultCode;
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 jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
import java.util.Objects;
import java.util.Optional;
/**
 * @author ZhuBaoMin
 * @date 2023-12-29 10:06
 * @LastEditTime 2023-12-29 10:06
 * @Description
 */
@Slf4j
@Tag(name = "控制器管理", description = "控制器操作")
@RestController
@RequestMapping(path="controller")
@RequiredArgsConstructor
public class ControllerCtrl {
    private final ControllerSv controllerSv;
    @Operation(summary = "添加控制器记录", description = "添加控制器记录")
    @ApiResponses(value = {
            @ApiResponse(
                    responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
                    description = "操作结果:true:成功,false:失败(BaseResponse.content)",
                    content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
                            schema = @Schema(implementation = Boolean.class))}
            )
    })
    @PostMapping(path = "add", consumes = MediaType.APPLICATION_JSON_VALUE)
    @Transactional(rollbackFor = Exception.class)
    @SsoAop()
    public BaseResponse<Boolean> add(@RequestBody @Valid PrController po, BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
        Date operateTime = new Date();
        po.setOperatedt(operateTime);
        po.setDeleted((byte)0);
        Integer rec = Optional.ofNullable(controllerSv.addController(po)).orElse(0);
        if(rec == 0) {
            return BaseResponseUtils.buildFail(ProjectResultCode.CONTROLLER_FAIL.getMessage());
        }
        return BaseResponseUtils.buildSuccess(true) ;
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/controller/ControllerSv.java
New file
@@ -0,0 +1,30 @@
package com.dy.pipIrrProject.controller;
import com.dy.pipIrrGlobal.daoPr.PrControllerMapper;
import com.dy.pipIrrGlobal.pojoPr.PrController;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
 * @author ZhuBaoMin
 * @date 2023-12-29 10:06
 * @LastEditTime 2023-12-29 10:06
 * @Description
 */
@Slf4j
@Service
public class ControllerSv {
    @Autowired
    private PrControllerMapper prControllerMapper;
    /**
     * 添加控制器
     * @param po
     * @return
     */
    public Integer addController(PrController po) {
        return prControllerMapper.insert(po);
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/controller/QueryVo.java
New file
@@ -0,0 +1,10 @@
package com.dy.pipIrrProject.controller;
/**
 * @author ZhuBaoMin
 * @date 2023-12-29 10:07
 * @LastEditTime 2023-12-29 10:07
 * @Description
 */
public class QueryVo {
}
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/divide/DivideCtrl.java
@@ -7,12 +7,12 @@
import com.dy.common.webUtil.BaseResponseUtils;
import com.dy.common.webUtil.QueryResultVo;
import com.dy.common.webUtil.ResultCodeMsg;
import com.dy.pipIrrGlobal.pojoBa.BaClient;
import com.dy.pipIrrGlobal.pojoPr.PrDivide;
import com.dy.pipIrrGlobal.voPr.VoDivide;
import com.dy.pipIrrGlobal.voSe.VoActiveCard;
import com.dy.pipIrrProject.result.ProjectResultCode;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
@@ -32,11 +32,7 @@
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.*;
/**
 * @author ZhuBaoMin
@@ -53,6 +49,11 @@
public class DivideCtrl {
    private final DivideSv divideSv;
    /**
     * 分页获取分水房记录
     * @param vo
     * @return
     */
    @Operation(summary = "获得一页分水房记录", description = "返回一页分水房数据")
    @ApiResponses(value = {
            @ApiResponse(
@@ -62,9 +63,9 @@
                            schema = @Schema(implementation = VoActiveCard.class))}
            )
    })
    @GetMapping(path = "/getDivides", consumes = MediaType.APPLICATION_JSON_VALUE)
    @GetMapping(path = "/getDivides")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoDivide>>> getDivides(@RequestBody @Parameter(description = "查询form表单json数据", required = true) QueryVo vo){
    public BaseResponse<QueryResultVo<List<VoDivide>>> getDivides(QueryVo vo){
        try {
            QueryResultVo<List<VoDivide>> res = divideSv.getDivides(vo);
            return BaseResponseUtils.buildSuccess(res);
@@ -74,6 +75,38 @@
        }
    }
    /**
     * 根据分水房主键获取分水房对象
     * @param id
     * @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 = BaClient.class))}
            )
    })
    @GetMapping(path = "/getone/{id}")
    @SsoAop()
    public BaseResponse<PrDivide> getOneDivide(@PathVariable("id") Long id){
        try {
            PrDivide res = divideSv.getOneDivide(id);
            return BaseResponseUtils.buildSuccess(res);
        } catch (Exception e) {
            log.error("查询农户异常", e);
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
    }
    /**
     * 添加分水房记录
     * @param po
     * @param bindingResult
     * @return
     */
    @Operation(summary = "添加分水房记录", description = "添加分水房记录")
    @ApiResponses(value = {
            @ApiResponse(
@@ -86,14 +119,29 @@
    @PostMapping(path = "add", consumes = MediaType.APPLICATION_JSON_VALUE)
    @Transactional(rollbackFor = Exception.class)
    @SsoAop()
    public BaseResponse<Boolean> add(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid PrDivide po, @Parameter(hidden = true) BindingResult bindingResult){
        DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
    public BaseResponse<Boolean> add(@RequestBody @Valid PrDivide po, BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
        // 接收村编号(主键)
        Long villageId = po.getVillageid();
        /**
         * 获取5级行政区划信息
         */
        Map map_districts = Optional.ofNullable(divideSv.getDistrictsByVillageId(villageId)).orElse(new HashMap());
        if(map_districts.size() <= 0) {
            return BaseResponseUtils.buildFail("区划信息有误");
        }
        Long countryId = Long.parseLong(map_districts.get("countryId").toString());
        Long townId = Long.parseLong(map_districts.get("townId").toString());
        po.setCountyid(countryId);
        po.setTownid(townId);
        Date operateTime = new Date();
        po.setOperatedt(operateTime);
        po.setDeleted((byte)0);
        Integer rec = Optional.ofNullable(divideSv.addDivide(po)).orElse(0);
        if(rec == 0) {
            return BaseResponseUtils.buildFail(ProjectResultCode.DIVIDE_FAIL.getMessage());
@@ -101,6 +149,85 @@
        return BaseResponseUtils.buildSuccess(true) ;
    }
    /**
     * 根据分水房ID逻辑删除分水房
     * @param id
     * @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 = BaClient.class))}
            )
    })
    @GetMapping(path = "/delone/{id}")
    @SsoAop()
    public BaseResponse<Boolean> deleteDivideById(@PathVariable("id") Long id){
        try {
            Integer res = Optional.ofNullable(divideSv.deleteDivideById(id)).orElse(0);
            if(res == 0) {
                return BaseResponseUtils.buildFail("分水房删除失败");
            }
            return BaseResponseUtils.buildSuccess(true);
        } catch (Exception e) {
            log.error("删除分水房异常", e);
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
    }
    /**
     * 修改分水房
     * @param po
     * @param bindingResult
     * @return
     */
    @Operation(summary = "修改分水房记录", description = "修改分水房记录")
    @ApiResponses(value = {
            @ApiResponse(
                    responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
                    description = "操作结果:true:成功,false:失败(BaseResponse.content)",
                    content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
                            schema = @Schema(implementation = Boolean.class))}
            )
    })
    @PostMapping(path = "update", consumes = MediaType.APPLICATION_JSON_VALUE)
    @Transactional(rollbackFor = Exception.class)
    @SsoAop()
    public BaseResponse<Boolean> update(@RequestBody @Valid PrDivide po, BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
        // 接收村编号(主键)
        Long villageId = po.getVillageid();
        /**
         * 获取5级行政区划信息
         */
        Map map_districts = Optional.ofNullable(divideSv.getDistrictsByVillageId(villageId)).orElse(new HashMap());
        if(map_districts.size() <= 0) {
            return BaseResponseUtils.buildFail("区划信息有误");
        }
        Long countryId = Long.parseLong(map_districts.get("countryId").toString());
        Long townId = Long.parseLong(map_districts.get("townId").toString());
        po.setCountyid(countryId);
        po.setTownid(townId);
        Date operateTime = new Date();
        po.setOperatedt(operateTime);
        Integer rec = Optional.ofNullable(divideSv.updateByPrimaryKey(po)).orElse(0);
        if(rec == 0) {
            return BaseResponseUtils.buildFail("分水房修改失败");
        }
        return BaseResponseUtils.buildSuccess(true) ;
    }
    /**
     * 导出分水房列表
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/divide/DivideSv.java
@@ -1,6 +1,7 @@
package com.dy.pipIrrProject.divide;
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pipIrrGlobal.daoBa.BaDistrictMapper;
import com.dy.pipIrrGlobal.daoPr.PrDivideMapper;
import com.dy.pipIrrGlobal.pojoPr.PrDivide;
import com.dy.pipIrrGlobal.voPr.VoDivide;
@@ -26,6 +27,9 @@
    @Autowired
    private PrDivideMapper prDivideMapper;
    @Autowired
    private BaDistrictMapper baDistrictMapper;
    /**
     * 添加分水房
     * @param po
@@ -43,11 +47,24 @@
    public QueryResultVo<List<VoDivide>> getDivides(QueryVo queryVo) {
        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo);
        // 计算符合条件的记录数
        Long itemTotal = prDivideMapper.getRecordCount(params);
        QueryResultVo<List<VoDivide>> rsVo = new QueryResultVo<>() ;
        rsVo.pageSize = queryVo.pageSize ;
        rsVo.pageCurr = queryVo.pageCurr ;
        Integer pageCurr = 0;
        Integer pageSize = 10000;
        rsVo.pageCurr = 1;
        rsVo.pageSize = 10000;
        if(queryVo.pageSize != null && queryVo.pageCurr != null) {
            rsVo.pageSize = queryVo.pageSize ;
            rsVo.pageCurr = queryVo.pageCurr;
            pageSize = queryVo.pageSize ;
            pageCurr = (Integer.parseInt(params.get("pageCurr").toString()) - 1) * Integer.parseInt(params.get("pageSize").toString());
        }
        params.put("pageCurr", pageCurr);
        params.put("pageSize", pageSize);
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = prDivideMapper.getDivides(params);
        return rsVo ;
@@ -64,4 +81,49 @@
        rsVo = prDivideMapper.getDivides(params);
        return rsVo ;
    }
    /**
     * 根据分水房主键获取分水房对象
     * @param id
     * @return
     */
    public PrDivide getOneDivide(Long id) {
        return prDivideMapper.selectByPrimaryKey(id);
    }
    /**
     * 根据主键逻辑删除一个分水房
     * @param id
     * @return
     */
    public Integer deleteDivideById(Long id) {
        return prDivideMapper.deleteDivideById(id);
    }
    /**
     * 根据村编号获取5级区划信息
     * @param villageId 村编号(主键)
     * @return 5级行政区划信息
     */
    public Map getDistrictsByVillageId(Long villageId) {
        return baDistrictMapper.getDistrictsByVillageId(villageId);
    }
    /**
     * 修改分水房对象
     * @param po 农户对象
     * @return 修改记录条数
     */
    public Integer updateByPrimaryKey(PrDivide po) {
        return prDivideMapper.updateByPrimaryKey(po);
    }
    /**
     * 根据分水房编号获取所属片区编号
     * @param divideId 分水房ID
     * @return 所属片区ID
     */
    public Long getBlockIdById(Long divideId) {
        return prDivideMapper.getBlockIdById(divideId);
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/divide/QueryVo.java
@@ -22,6 +22,6 @@
    @Schema(description = "农户姓名")
    public String divideName;
    @Schema(description = "IC卡号")
    @Schema(description = "片区名称")
    public String blockName;
}
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/result/ProjectResultCode.java
@@ -16,7 +16,16 @@
    /**
     * 分水房
     */
    DIVIDE_FAIL(10001, "分水房添加失败");
    DIVIDE_FAIL(10001, "分水房添加失败"),
    /**
     * 取水口
     */
    /**
     * 控制器
     */
    CONTROLLER_FAIL(30001, "控制器添加失败");
    private final Integer code;
    private final String message;
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/activeCard/ActiveCardCtrl.java
@@ -15,7 +15,6 @@
import com.dy.pipIrrSell.recharge.RechargeCtrl;
import com.dy.pipIrrSell.result.SellResultCode;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
@@ -24,6 +23,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;
@@ -48,6 +48,14 @@
    private final ClientCardSv clientCardSv;
    private final RechargeCtrl rechargeCtrl;
    @Value("${projectCode.ym}")
    private Integer projectCode;
    /**
     * 获取开卡记录
     * @param vo
     * @return
     */
    @Operation(summary = "获得一页开卡记录", description = "返回一页开卡数据")
    @ApiResponses(value = {
            @ApiResponse(
@@ -57,7 +65,6 @@
                            schema = @Schema(implementation = VoActiveCard.class))}
            )
    })
    //@GetMapping(path = "/getActiveCards", consumes = MediaType.APPLICATION_JSON_VALUE)
    @GetMapping(path = "/getActiveCards")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoActiveCard>>> getActiveCards(QueryVo vo){
@@ -70,6 +77,12 @@
        }
    }
    /**
     * 开卡操作
     * @param po
     * @param bindingResult
     * @return
     */
    @Operation(summary = "开卡", description = "新开农户卡")
    @ApiResponses(value = {
            @ApiResponse(
@@ -82,7 +95,7 @@
    @PostMapping(path = "add_active", consumes = MediaType.APPLICATION_JSON_VALUE)
    @Transactional(rollbackFor = Exception.class)
    @SsoAop()
    public BaseResponse<Boolean> add_active(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid DtoActiveCard po, @Parameter(hidden = true) BindingResult bindingResult){
    public BaseResponse<Boolean> add_active(@RequestBody @Valid DtoActiveCard po, BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
@@ -162,7 +175,7 @@
        seClientCard.setCardnum(cardNum);
        //seClientCard.setClientnum(clientNum);
        seClientCard.setClientid(clientId);
        seClientCard.setMoney(0.0);
        seClientCard.setMoney(0f);
        seClientCard.setState(CardStateENUM.NORMAL.getCode());
        seClientCard.setCreatedt(createTime);
        seClientCard.setLastoper(LastOperateENUM.ACTIVE.getCode());
@@ -208,7 +221,10 @@
            }
        }
        return BaseResponseUtils.buildSuccess(cardNum) ;
        Map map = new HashMap();
        map.put("projectCode", projectCode);
        map.put("cardNum", cardNum);
        return BaseResponseUtils.buildSuccess(map) ;
    }
    @Operation(summary = "补卡", description = "补卡")
@@ -223,7 +239,7 @@
    @PostMapping(path = "add_reissue", consumes = MediaType.APPLICATION_JSON_VALUE)
    @Transactional(rollbackFor = Exception.class)
    @SsoAop()
    public BaseResponse<Boolean> add_reissue(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid DtoActiveCard po, @Parameter(hidden = true) BindingResult bindingResult){
    public BaseResponse<Boolean> add_reissue(@RequestBody @Valid DtoActiveCard po, BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/activeCard/ActiveCardSv.java
@@ -11,7 +11,6 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.Map;
@@ -39,29 +38,12 @@
    public QueryResultVo<List<VoActiveCard>> getActiveCards(QueryVo queryVo) {
        //完善查询开卡记录的起止时间
        DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd");
        //LocalDateTime activeTimeStart = queryVo.activeTimeStart;
        //LocalDateTime activeTimeStop = queryVo.activeTimeStop;
        //if(activeTimeStart != null) {
        //    activeTimeStart = LocalDateTime.parse(df.format(activeTimeStart) + " 00:00:00", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
        //    queryVo.setActiveTimeStart(activeTimeStart);
        //}
        //if(activeTimeStop != null) {
        //    activeTimeStop = LocalDateTime.parse(df.format(activeTimeStop) + " 23:59:59", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
        //    queryVo.setActiveTimeStop(activeTimeStop);
        //}
        String activeTimeStart = queryVo.activeTimeStart;
        String activeTimeStop = queryVo.activeTimeStop;
        if(activeTimeStart != null) {
            activeTimeStart = activeTimeStart + " 00:00:00";
            queryVo.setActiveTimeStart(activeTimeStart);
        }
        if(activeTimeStop != null) {
            activeTimeStop = activeTimeStop + " 23:59:59";
            queryVo.setActiveTimeStop(activeTimeStop);
@@ -72,8 +54,19 @@
        Long itemTotal = seActiveCardMapper.getRecordCount(params);
        QueryResultVo<List<VoActiveCard>> rsVo = new QueryResultVo<>() ;
        rsVo.pageSize = queryVo.pageSize ;
        rsVo.pageCurr = queryVo.pageCurr ;
        Integer pageCurr = 0;
        Integer pageSize = 10000;
        rsVo.pageCurr = 1;
        rsVo.pageSize = 10000;
        if(queryVo.pageSize != null && queryVo.pageCurr != null) {
            rsVo.pageSize = queryVo.pageSize ;
            rsVo.pageCurr = queryVo.pageCurr;
            pageSize = queryVo.pageSize ;
            pageCurr = (Integer.parseInt(params.get("pageCurr").toString()) - 1) * Integer.parseInt(params.get("pageSize").toString());
        }
        params.put("pageCurr", pageCurr);
        params.put("pageSize", pageSize);
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = seActiveCardMapper.getActiveCards(params);
        return rsVo ;
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cancel/CancelCtrl.java
@@ -8,11 +8,11 @@
import com.dy.pipIrrGlobal.pojoSe.SeCancel;
import com.dy.pipIrrGlobal.pojoSe.SeClientCard;
import com.dy.pipIrrGlobal.voSe.VoCancel;
import com.dy.pipIrrSell.clientCard.CardStateENUM;
import com.dy.pipIrrSell.clientCard.ClientCardSv;
import com.dy.pipIrrSell.clientCard.LastOperateENUM;
import com.dy.pipIrrSell.result.SellResultCode;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
@@ -54,9 +54,9 @@
                            schema = @Schema(implementation = VoCancel.class))}
            )
    })
    @GetMapping(path = "/getCancels", consumes = MediaType.APPLICATION_JSON_VALUE)
    @GetMapping(path = "/getCancels")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoCancel>>> getCancels(@RequestBody @Parameter(description = "查询form表单json数据", required = true) QueryVo vo){
    public BaseResponse<QueryResultVo<List<VoCancel>>> getCancels(QueryVo vo){
        try {
            QueryResultVo<List<VoCancel>> res = cancelSv.getCancels(vo);
            return BaseResponseUtils.buildSuccess(res);
@@ -78,7 +78,7 @@
    @PostMapping(path = "add", consumes = MediaType.APPLICATION_JSON_VALUE)
    @Transactional(rollbackFor = Exception.class)
    @SsoAop()
    public BaseResponse<Boolean> add(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid DtoCancel po, @Parameter(hidden = true) BindingResult bindingResult){
    public BaseResponse<Boolean> add(@RequestBody @Valid DtoCancel po, BindingResult bindingResult){
        DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
@@ -115,12 +115,14 @@
        /**
         * 修改农户卡信息:
         *      挂失时间
         *      注销时间
         *      最后操作类型-4
         */
        SeClientCard seClientCard = new SeClientCard();
        seClientCard.setId(cardId);
        seClientCard.setCanceldt(cancelTime);
        seClientCard.setMoney(0f);
        seClientCard.setState(CardStateENUM.CANCELLED.getCode());
        seClientCard.setLastoper(LastOperateENUM.CANCEL.getCode());
        Integer rec_updateClientCard = Optional.ofNullable(clientCardSv.UpdateClientCard(seClientCard)).orElse(0);
        if(rec_updateClientCard == 0) {
@@ -128,7 +130,7 @@
        }
        /**
         * 添加挂失记录
         * 添加注销记录
         */
        SeCancel seCancel = new SeCancel();
        //seCancel.setCardnum(cardNum);
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cancel/CancelSv.java
@@ -9,8 +9,6 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.Map;
@@ -29,17 +27,14 @@
    public QueryResultVo<List<VoCancel>> getCancels(QueryVo queryVo) {
        //完善查询注销记录的起止时间
        DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd");
        LocalDateTime cancelTimeStart = queryVo.cancelTimeStart;
        LocalDateTime cancelTimeStop = queryVo.cancelTimeStop;
        String cancelTimeStart = queryVo.cancelTimeStart;
        String cancelTimeStop = queryVo.cancelTimeStop;
        if(cancelTimeStart != null) {
            cancelTimeStart = LocalDateTime.parse(df.format(cancelTimeStart) + " 00:00:00", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
            cancelTimeStart = cancelTimeStart + " 00:00:00";
            queryVo.setCancelTimeStart(cancelTimeStart);
        }
        if(cancelTimeStop != null) {
            cancelTimeStop = LocalDateTime.parse(df.format(cancelTimeStop) + " 23:59:59", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
            cancelTimeStop = cancelTimeStop + " 23:59:59";
            queryVo.setCancelTimeStop(cancelTimeStop);
        }
@@ -48,8 +43,19 @@
        Long itemTotal = seCancelMapper.getRecordCount(params);
        QueryResultVo<List<VoCancel>> rsVo = new QueryResultVo<>() ;
        rsVo.pageSize = queryVo.pageSize ;
        rsVo.pageCurr = queryVo.pageCurr ;
        Integer pageCurr = 0;
        Integer pageSize = 10000;
        rsVo.pageCurr = 1;
        rsVo.pageSize = 10000;
        if(queryVo.pageSize != null && queryVo.pageCurr != null) {
            rsVo.pageSize = queryVo.pageSize ;
            rsVo.pageCurr = queryVo.pageCurr;
            pageSize = queryVo.pageSize ;
            pageCurr = (Integer.parseInt(params.get("pageCurr").toString()) - 1) * Integer.parseInt(params.get("pageSize").toString());
        }
        params.put("pageCurr", pageCurr);
        params.put("pageSize", pageSize);
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = seCancelMapper.getCancels(params);
        return rsVo ;
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cancel/QueryVo.java
@@ -4,8 +4,6 @@
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.time.LocalDateTime;
/**
 * @author ZhuBaoMin
 * @date 2023/12/6 14:18
@@ -29,8 +27,8 @@
    @Schema(description = "注销时间_开始")
    public LocalDateTime cancelTimeStart;
    public String cancelTimeStart;
    @Schema(description = "注销时间_结束")
    public LocalDateTime cancelTimeStop;
    public String cancelTimeStop;
}
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/ClientCtrl.java
@@ -9,7 +9,6 @@
import com.dy.pipIrrGlobal.pojoSe.SeClient;
import com.dy.pipIrrGlobal.voSe.VoClient;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
@@ -40,6 +39,11 @@
public class ClientCtrl {
    private final ClientSv clientSv;
    /**
     * 获取农户列表
     * @param vo
     * @return
     */
    @Operation(summary = "获得一页农户", description = "返回一页农户数据")
    @ApiResponses(value = {
            @ApiResponse(
@@ -61,6 +65,63 @@
        }
    }
    /**
     * 获取交易记录
     * @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 = BaClient.class))}
            )
    })
    @GetMapping(path = "getOperates")
    @SsoAop()
    public BaseResponse<Map> getOperates(QueryOperate vo){
        try {
           Map res = clientSv.getOperates(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 = BaClient.class))}
            )
    })
    @GetMapping(path = "getStatistics")
    @SsoAop()
    public BaseResponse<Map> getStatistics(QueryStatistic vo){
        try {
            Map res = clientSv.getStatistics(vo);
            return BaseResponseUtils.buildSuccess(res);
        } catch (Exception e) {
            log.error("查询交易汇总记录异常", e);
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
    }
    /**
     * 根据主键获取一个农户对象
     * @param id
     * @return
     */
    @Operation(summary = "获得一个农户", description = "返回一个农户数据")
    @ApiResponses(value = {
            @ApiResponse(
@@ -83,6 +144,12 @@
    }
    /**
     * 添加一个农户对象
     * @param po
     * @param bindingResult
     * @return
     */
    @Operation(summary = "添加农户记录", description = "添加农户记录")
    @ApiResponses(value = {
            @ApiResponse(
@@ -95,13 +162,13 @@
    @PostMapping(path = "add", consumes = MediaType.APPLICATION_JSON_VALUE)
    @Transactional(rollbackFor = Exception.class)
    @SsoAop()
    public BaseResponse<Boolean> add(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid DtoClient po, @Parameter(hidden = true) BindingResult bindingResult){
    public BaseResponse<Boolean> add(@RequestBody @Valid DtoClient po, BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
        // 接收村编号(主键)
        Long villageId = po.getVillageid();
        Long villageId = po.getVillageId();
        /**
         * 获取5级行政区划信息
@@ -130,9 +197,21 @@
        Long districtNum = Long.parseLong(provinceNum + cityNum + district8);
        String districtTitle = countryName + townName + villageName;
        // 生成虚拟卡号
        Long virtualId = Optional.ofNullable(clientSv.getMa1xVirtualId()).orElse(0L);
        if(virtualId == 0) {
            virtualId = 1000000000L;
        }else {
            virtualId = virtualId + 1;
            if(virtualId > 10000000000L) {
                return BaseResponseUtils.buildFail("虚拟卡号超限");
            }
        }
        SeClient seClient = DtoClientToSeClient.INSTANCT.po2vo(po);
        seClient.setCountyid(countryId);
        seClient.setTownid(townId);
        seClient.setVirtualid(virtualId);
        seClient.setClientnum(clientNum);
        seClient.setDistrictnum(districtNum);
        seClient.setDistricttitle(districtTitle);
@@ -176,7 +255,7 @@
    }
    /**
     * 修改农户对象
     * 修改农户对象(虚拟卡号、禁止标志、逻辑删除标识不参与修改)
     * @param po 农户对象
     * @param bindingResult
     * @return
@@ -193,13 +272,13 @@
    @PostMapping(path = "update", consumes = MediaType.APPLICATION_JSON_VALUE)
    @Transactional(rollbackFor = Exception.class)
    @SsoAop()
    public BaseResponse<Boolean> update(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid DtoClient po, @Parameter(hidden = true) BindingResult bindingResult){
    public BaseResponse<Boolean> update(@RequestBody @Valid DtoClient po, BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
        // 接收村编号(主键)
        Long villageId = po.getVillageid();
        Long villageId = po.getVillageId();
        /**
         * 获取5级行政区划信息
@@ -236,13 +315,10 @@
        seClient.setDistricttitle(districtTitle);
        Date operateTime = new Date();
        seClient.setOperatedt(operateTime);
        //
        //seClient.setDisabled((byte)0);
        //seClient.setDeleted((byte)0);
        Integer rec = Optional.ofNullable(clientSv.updateByPrimaryKey(seClient)).orElse(0);
        if(rec == 0) {
            return BaseResponseUtils.buildFail("添加农户失败");
            return BaseResponseUtils.buildFail("农户修改失败");
        }
        return BaseResponseUtils.buildSuccess(true) ;
    }
@@ -276,4 +352,28 @@
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
    }
    /**
     * 获取用水方式列表
     * @param
     * @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 = BaClient.class))}
            )
    })
    @GetMapping(path = "/watertypes")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<Map<String, Object>>>> getWaterTypes(){
        List<Map<String, Object>> map_WaterTypes = Optional.ofNullable(clientSv.getWaterTypes()).orElse(new ArrayList<>());
        if(map_WaterTypes == null || map_WaterTypes.size() == 0) {
            return BaseResponseUtils.buildFail("没有用水方式") ;
        }
        return BaseResponseUtils.buildSuccess(map_WaterTypes);
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/ClientSv.java
@@ -5,13 +5,17 @@
import com.dy.pipIrrGlobal.daoSe.SeClientMapper;
import com.dy.pipIrrGlobal.pojoSe.SeClient;
import com.dy.pipIrrGlobal.voSe.VoClient;
import com.dy.pipIrrGlobal.voSe.VoOperate;
import com.dy.pipIrrGlobal.voSe.VoStatistics;
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.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
/**
 * @author ZhuBaoMin
@@ -31,20 +35,147 @@
    /**
     * 根据指定条件获取农户数据
     * @param vo
     * @param queryVo
     * @return
     */
    public QueryResultVo<List<VoClient>> getClients(QueryVo vo){
        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(vo) ;
    public QueryResultVo<List<VoClient>> getClients(QueryVo queryVo){
        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo) ;
        Long itemTotal = seClientMapper.getRecordCount(params);
        QueryResultVo<List<VoClient>> rsVo = new QueryResultVo<>() ;
        rsVo.pageSize = vo.pageSize ;
        rsVo.pageCurr = vo.pageCurr ;
        Integer pageCurr = 0;
        Integer pageSize = 10000;
        rsVo.pageCurr = 1;
        rsVo.pageSize = 10000;
        if(queryVo.pageSize != null && queryVo.pageCurr != null) {
            rsVo.pageSize = queryVo.pageSize ;
            rsVo.pageCurr = queryVo.pageCurr;
            pageSize = queryVo.pageSize ;
            pageCurr = (Integer.parseInt(params.get("pageCurr").toString()) - 1) * Integer.parseInt(params.get("pageSize").toString());
        }
        params.put("pageCurr", pageCurr);
        params.put("pageSize", pageSize);
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = seClientMapper.getClients(params);
        return rsVo ;
    }
    /**
     * 根据指定条件获取交易记录
     * @param vo
     * @return
     */
    public Map getOperates(QueryOperate vo){
        // 补齐查询时间
        String operateTimeStart = vo.operateTimeStart;
        String operateTimeStop = vo.operateTimeStop;
        if(operateTimeStart != null) {
            operateTimeStart = operateTimeStart + " 00:00:00";
            vo.setOperateTimeStart(operateTimeStart);
        }
        if(operateTimeStop != null) {
            operateTimeStop = operateTimeStop + " 23:59:59";
            vo.setOperateTimeStop(operateTimeStop);
        }
        // 生成查询参数
        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(vo) ;
        // 获取汇总的购水金额、购卡金额
        Float money = 0f;
        Float cardCost = 0f;
        Map map_sum = Optional.ofNullable(seClientMapper.getSums(params)).orElse(new HashMap());
        if(map_sum.size() > 0) {
            money = Float.parseFloat(map_sum.get("money").toString());
            cardCost = Float.parseFloat(map_sum.get("cardCost").toString());
        }
        // 获取符合条件的记录数
        Long itemTotal = seClientMapper.getOperateRecordCount(params);
        Integer pageSize = vo.getPageSize();
        // 计算总页数
        Integer pageTotal ;
        pageTotal = (int)Math.ceil((itemTotal==null?0.0D:itemTotal.doubleValue())/pageSize);
        // 根据当前页码及每页数量计算偏移量
        Integer pageCurr = (Integer.parseInt(params.get("pageCurr").toString()) - 1) * Integer.parseInt(params.get("pageSize").toString());
        params.put("pageCurr", pageCurr);
        List<VoOperate> lit = seClientMapper.getOperates(params);
        Map map_record = new HashMap();
        map_record.put("itemTotal", itemTotal);
        map_record.put("pageCurr", vo.pageCurr);
        map_record.put("pageSize", pageSize);
        map_record.put("pageTotal", pageTotal);
        map_record.put("list", lit);
        Map map_result = new HashMap();
        map_result.put("money", money);
        map_result.put("cardCost", cardCost);
        map_result.put("records", map_record);
        return map_result;
    }
    /**
     * 根据指定条件获取统计记录
     * @param vo 交易汇总查询条件
     * @return 交易汇总记录
     */
    public Map getStatistics(QueryStatistic vo){
        // 补齐查询时间
        String operateTimeStart = vo.operateTimeStart;
        String operateTimeStop = vo.operateTimeStop;
        if(operateTimeStart != null) {
            operateTimeStart = operateTimeStart + " 00:00:00";
            vo.setOperateTimeStart(operateTimeStart);
        }
        if(operateTimeStop != null) {
            operateTimeStop = operateTimeStop + " 23:59:59";
            vo.setOperateTimeStop(operateTimeStop);
        }
        // 生成查询参数
        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(vo) ;
        // 获取汇总的交易笔数、交易金额
        Integer count = 0;
        Float money = 0f;
        Map map_sum = Optional.ofNullable(seClientMapper.getStatisticSums(params)).orElse(new HashMap());
        if(map_sum.size() > 0) {
            count = Integer.parseInt(map_sum.get("count").toString());
            money = Float.parseFloat(map_sum.get("money").toString());
        }
        // 获取符合条件的记录数
        Long itemTotal = seClientMapper.getStatisticRecordCount(params);
        Integer pageSize = vo.getPageSize();
        // 计算总页数
        Integer pageTotal ;
        pageTotal = (int)Math.ceil((itemTotal==null?0.0D:itemTotal.doubleValue())/pageSize);
        // 根据当前页码及每页数量计算偏移量
        Integer pageCurr = (Integer.parseInt(params.get("pageCurr").toString()) - 1) * Integer.parseInt(params.get("pageSize").toString());
        params.put("pageCurr", pageCurr);
        List<VoStatistics> lit = seClientMapper.getStatistics(params);
        Map map_record = new HashMap();
        map_record.put("itemTotal", itemTotal);
        map_record.put("pageCurr", vo.pageCurr);
        map_record.put("pageSize", pageSize);
        map_record.put("pageTotal", pageTotal);
        map_record.put("list", lit);
        Map map_result = new HashMap();
        map_result.put("count", count);
        map_result.put("money", money);
        map_result.put("records", map_record);
        return map_result;
    }
    /**
@@ -109,4 +240,19 @@
        return seClientMapper.getVillageIdById(id);
    }
    /**
     * 获取虚拟卡号最大值
     * @return
     */
    public Long getMa1xVirtualId() {
        return seClientMapper.getMa1xVirtualId();
    }
    /**
     * 获取用水方式列表
     * @return
     */
    public List<Map<String, Object>> getWaterTypes() {
        return seClientMapper.getWaterTypes();
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/DtoClient.java
@@ -32,21 +32,21 @@
     */
    @Schema(description = "所在村ID", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "所在村不能为空")
    private Long villageid;
    private Long villageId;
    /**
     * 片区ID
     */
    @Schema(description = "所在片区ID", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "所在片区不能为空")
    private Long blockid;
    private Long blockId;
    /**
     * 分水房ID
     */
    @Schema(description = "所在分水房ID", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "所在分水房不能为空")
    private Long divideid;
    private Long divideId;
    /**
     * 农户姓名
@@ -70,7 +70,7 @@
    @Schema(description = "农户身份证号", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "农户身份证号不能为空") //不能为空也不能为null
    @Length(message = "农户身份证号必须{max}位数据", min = 18, max = 18)
    private String idcard;
    private String idCard;
    /**
     * 种植面积
@@ -79,6 +79,12 @@
    private Double area;
    /**
     * 用水方式
     */
    @Schema(description = "用水方式", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Long typeId;
    /**
     * 街道及门牌号
     */
    @Schema(description = "街道+门牌号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/DtoClientToSeClient.java
@@ -16,17 +16,17 @@
public interface DtoClientToSeClient {
    DtoClientToSeClient INSTANCT = Mappers.getMapper(DtoClientToSeClient.class);
    @Mapping(target = "villageid", source = "villageid")
    @Mapping(target = "blockid", source = "blockid")
    @Mapping(target = "divideid", source = "divideid")
    @Mapping(target = "villageid", source = "villageId")
    @Mapping(target = "blockid", source = "blockId")
    @Mapping(target = "divideid", source = "divideId")
    @Mapping(target = "name", source = "name")
    @Mapping(target = "phone", source = "phone")
    @Mapping(target = "idcard", source = "idcard")
    @Mapping(target = "idcard", source = "idCard")
    @Mapping(target = "area", source = "area")
    @Mapping(target = "typeid", source = "typeId")
    @Mapping(target = "address", source = "address")
    @Mapping(target = "remarks", source = "remarks")
    @Mapping(target = "operator", source = "operator")
    @Mapping(target = "disabled", ignore=true)
    @Mapping(target = "deleted", ignore=true)
    SeClient po2vo(DtoClient po);
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/QueryOperate.java
New file
@@ -0,0 +1,34 @@
package com.dy.pipIrrSell.client;
import com.dy.common.webUtil.QueryConditionVo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
/**
 * @author ZhuBaoMin
 * @date 2023-12-26 21:00
 * @LastEditTime 2023-12-26 21:00
 * @Description
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ToString(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Schema(name = "交易查询条件")
public class QueryOperate extends QueryConditionVo {
    @Schema(description = "村ID")
    public Long villageId;
    @Schema(description = "支付方式编号")
    public Long paymentId;
    @Schema(description = "交易查询起始时间")
    public String operateTimeStart;
    @Schema(description = "交易查询截止时间")
    public String operateTimeStop;
}
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/QueryStatistic.java
New file
@@ -0,0 +1,33 @@
package com.dy.pipIrrSell.client;
import com.dy.common.webUtil.QueryConditionVo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
/**
 * @author ZhuBaoMin
 * @date 2023-12-27 15:33
 * @LastEditTime 2023-12-27 15:33
 * @Description
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ToString(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Schema(name = "交易汇总查询条件")
public class QueryStatistic extends QueryConditionVo {
    @Schema(description = "村ID")
    public Long villageId;
    //@Schema(description = "支付方式编号")
    //public Long paymentId;
    @Schema(description = "交易查询起始时间")
    public String operateTimeStart;
    @Schema(description = "交易查询截止时间")
    public String operateTimeStop;
}
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/clientCard/ClientCardCtrl.java
New file
@@ -0,0 +1,116 @@
package com.dy.pipIrrSell.clientCard;
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.pojoBa.BaClient;
import com.dy.pipIrrGlobal.voSe.VoCardInfo;
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.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
 * @author ZhuBaoMin
 * @date 2023-12-27 19:36
 * @LastEditTime 2023-12-27 19:36
 * @Description
 */
@Slf4j
@Tag(name = "农户水卡", description = "农户水卡")
@RestController
@RequestMapping(path="clientcard")
@RequiredArgsConstructor
public class ClientCardCtrl {
    private final ClientCardSv clientCardSv;
    /**
     * 获取指定用户名下全部水卡
     * @param clientId
     * @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 = BaClient.class))}
            )
    })
    @GetMapping(path = "clientcard/{clientId}")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoCardInfo>>> get(@PathVariable("clientId") Long clientId){
        try {
            List<VoCardInfo> list = clientCardSv.getCardInfoByClientId(clientId);
            return BaseResponseUtils.buildSuccess(list);
        } catch (Exception e) {
            log.error("查询农户异常", e);
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
    }
    /**
     * 根据水卡编号获取操作记录及余额
     * @param cardNum 水卡编号
     * @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 = BaClient.class))}
            )
    })
    @GetMapping(path = "/getoperaterecords")
    @SsoAop()
    public BaseResponse<List<Map<String, Object>>> getOperateRecordsAndMoney(@RequestParam("cardNum") Long cardNum){
        try {
            Map map = clientCardSv.getOperateRecordsAndMoney(cardNum);
            return BaseResponseUtils.buildSuccess(map);
        } catch (Exception e) {
            log.error("查询操作记录异常", e);
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
    }
    /**
     * 根据水卡编号获取卡片状态
     * @param cardNum
     * @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 = BaClient.class))}
            )
    })
    @GetMapping(path = "/cardstate")
    @SsoAop()
    public BaseResponse<String> getCardStateByCardNum(@RequestParam("cardNum") Long cardNum){
        try {
            String stateName = clientCardSv.getCardStateByCardNum(cardNum);
            return BaseResponseUtils.buildSuccess(stateName);
        } catch (Exception e) {
            log.error("查询操作记录异常", e);
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/clientCard/ClientCardSv.java
@@ -2,11 +2,12 @@
import com.dy.pipIrrGlobal.daoSe.SeClientCardMapper;
import com.dy.pipIrrGlobal.pojoSe.SeClientCard;
import com.dy.pipIrrGlobal.voSe.VoCardInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Map;
import java.util.*;
/**
 * @author ZhuBaoMin
@@ -65,4 +66,45 @@
    public Integer UpdateClientCard(SeClientCard po) {
        return seClientCardMapper.updateByPrimaryKeySelective(po);
    }
    /**
     * 根据农户主键获取水卡列表
     * @param clientId
     * @return
     */
    public List<VoCardInfo> getCardInfoByClientId(Long clientId){
        List<VoCardInfo> list = Optional.ofNullable(seClientCardMapper.getCardInfoByClientId(clientId)).orElse(new ArrayList<>());
        if(list.size() > 0) {
            return list;
        }else {
            return new ArrayList<>();
        }
    }
    /**
     * 根据水卡编号获取操作记录及余额
     * @param cardNum
     * @return
     */
    public Map getOperateRecordsAndMoney(Long cardNum) {
        List<Map<String, Object>> list = Optional.ofNullable(seClientCardMapper.getOperateRecordsByCardNum(cardNum)).orElse(new ArrayList<>());
        Float mondy = Optional.ofNullable(seClientCardMapper.getMoneyByCardNum(cardNum)).orElse(0f);
        Float amount = Optional.ofNullable(seClientCardMapper.sumRechargeByCardNum(cardNum)).orElse(0f);
        Map map = new HashMap();
        map.put("mondy", mondy);
        map.put("amount", amount);
        map.put("list", list);
        return map;
    }
    /**
     * 根据水卡编号获取卡片状态
     * @param cardNum
     * @return
     */
    public String getCardStateByCardNum(Long cardNum) {
        String stateName = Optional.ofNullable(seClientCardMapper.getCardStateByCardNum(cardNum)).orElse("");
        return stateName;
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/loss/LossCtrl.java
@@ -8,11 +8,11 @@
import com.dy.pipIrrGlobal.pojoSe.SeClientCard;
import com.dy.pipIrrGlobal.pojoSe.SeLoss;
import com.dy.pipIrrGlobal.voSe.VoLoss;
import com.dy.pipIrrSell.clientCard.CardStateENUM;
import com.dy.pipIrrSell.clientCard.ClientCardSv;
import com.dy.pipIrrSell.clientCard.LastOperateENUM;
import com.dy.pipIrrSell.result.SellResultCode;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
@@ -77,7 +77,7 @@
    @PostMapping(path = "add", consumes = MediaType.APPLICATION_JSON_VALUE)
    @Transactional(rollbackFor = Exception.class)
    @SsoAop()
    public BaseResponse<Boolean> add(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid DtoLoss po, @Parameter(hidden = true) BindingResult bindingResult){
    public BaseResponse<Boolean> add(@RequestBody @Valid DtoLoss po, BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
@@ -118,7 +118,9 @@
         */
        SeClientCard seClientCard = new SeClientCard();
        seClientCard.setId(cardId);
        seClientCard.setMoney(money);
        seClientCard.setLossdtdt(lossTime);
        seClientCard.setState(CardStateENUM.LOSS.getCode());
        seClientCard.setLastoper(LastOperateENUM.LOSS.getCode());
        Integer rec_updateClientCard = Optional.ofNullable(clientCardSv.UpdateClientCard(seClientCard)).orElse(0);
        if(rec_updateClientCard == 0) {
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/loss/LossSv.java
@@ -59,8 +59,19 @@
        Long itemTotal = seLossMapper.getRecordCount(params);
        QueryResultVo<List<VoLoss>> rsVo = new QueryResultVo<>() ;
        rsVo.pageSize = queryVo.pageSize ;
        rsVo.pageCurr = queryVo.pageCurr ;
        Integer pageCurr = 0;
        Integer pageSize = 10000;
        rsVo.pageCurr = 1;
        rsVo.pageSize = 10000;
        if(queryVo.pageSize != null && queryVo.pageCurr != null) {
            rsVo.pageSize = queryVo.pageSize ;
            rsVo.pageCurr = queryVo.pageCurr;
            pageSize = queryVo.pageSize ;
            pageCurr = (Integer.parseInt(params.get("pageCurr").toString()) - 1) * Integer.parseInt(params.get("pageSize").toString());
        }
        params.put("pageCurr", pageCurr);
        params.put("pageSize", pageSize);
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = seLossMapper.getLosses(params);
        return rsVo ;
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/recharge/RechargeCtrl.java
@@ -13,7 +13,6 @@
import com.dy.pipIrrSell.clientCard.LastOperateENUM;
import com.dy.pipIrrSell.result.SellResultCode;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
@@ -72,7 +71,7 @@
    @PostMapping(path = "add", consumes = MediaType.APPLICATION_JSON_VALUE)
    @Transactional(rollbackFor = Exception.class)
    @SsoAop()
    public BaseResponse<Boolean> add(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid DtoRecharge po, @Parameter(hidden = true) BindingResult bindingResult){
    public BaseResponse<Boolean> add(@RequestBody @Valid DtoRecharge po, BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
@@ -132,6 +131,7 @@
         */
        SeClientCard seClientCard = new SeClientCard();
        seClientCard.setId(cardId);
        seClientCard.setMoney(afterRecharge);
        seClientCard.setRechargedt(rechargeTime);
        seClientCard.setLastoper(LastOperateENUM.RECHARGE.getCode ());
        Integer rec_updateClientCard = Optional.ofNullable(clientCardSv.UpdateClientCard(seClientCard)).orElse(0);
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/recharge/RechargeSv.java
@@ -11,7 +11,6 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.Map;
@@ -33,40 +32,35 @@
    public QueryResultVo<List<VoRecharge>> getRecharges(QueryVo queryVo) {
        //完善查询充值记录的起止时间
        DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd");
        //LocalDateTime rechargeTimeStart = queryVo.rechargeTimeStart;
        //LocalDateTime rechargeTimeStop = queryVo.rechargeTimeStop;
        //if(rechargeTimeStart != null) {
        //    rechargeTimeStart = LocalDateTime.parse(df.format(rechargeTimeStart) + " 00:00:00", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
        //    queryVo.setRechargeTimeStart(rechargeTimeStart);
        //}
        //
        //if(rechargeTimeStop != null) {
        //    rechargeTimeStop = LocalDateTime.parse(df.format(rechargeTimeStop) + " 23:59:59", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
        //    queryVo.setRechargeTimeStop(rechargeTimeStop);
        //}
        String rechargeTimeStart = queryVo.rechargeTimeStart;
        String rechargeTimeStop = queryVo.rechargeTimeStop;
        if(rechargeTimeStart != null) {
            rechargeTimeStart = rechargeTimeStart + " 00:00:00";
            queryVo.setRechargeTimeStart(rechargeTimeStart);
        }
        if(rechargeTimeStop != null) {
            rechargeTimeStop = rechargeTimeStop + " 23:59:59";
            queryVo.setRechargeTimeStop(rechargeTimeStop);
        }
        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo);
        Long itemTotal = seRechargeMapper.getRecordCount(params);
        QueryResultVo<List<VoRecharge>> rsVo = new QueryResultVo<>() ;
        rsVo.pageSize = queryVo.pageSize ;
        rsVo.pageCurr = queryVo.pageCurr ;
        Integer pageCurr = 0;
        Integer pageSize = 10000;
        rsVo.pageCurr = 1;
        rsVo.pageSize = 10000;
        if(queryVo.pageSize != null && queryVo.pageCurr != null) {
            rsVo.pageSize = queryVo.pageSize ;
            rsVo.pageCurr = queryVo.pageCurr;
            pageSize = queryVo.pageSize ;
            pageCurr = (Integer.parseInt(params.get("pageCurr").toString()) - 1) * Integer.parseInt(params.get("pageSize").toString());
        }
        params.put("pageCurr", pageCurr);
        params.put("pageSize", pageSize);
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = seRechargeMapper.getRecharges(params);
        return rsVo ;
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/reversal/ReversalCtrl.java
@@ -12,7 +12,6 @@
import com.dy.pipIrrSell.clientCard.LastOperateENUM;
import com.dy.pipIrrSell.result.SellResultCode;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
@@ -77,7 +76,7 @@
    @PostMapping(path = "add", consumes = MediaType.APPLICATION_JSON_VALUE)
    @Transactional(rollbackFor = Exception.class)
    @SsoAop()
    public BaseResponse<Boolean> add(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid DtoReversal po, @Parameter(hidden = true) BindingResult bindingResult){
    public BaseResponse<Boolean> add(@RequestBody @Valid DtoReversal po, BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
@@ -119,6 +118,7 @@
        SeClientCard seClientCard = new SeClientCard();
        seClientCard.setId(cardId);
        seClientCard.setReversaldt(reversalTime);
        seClientCard.setMoney(cardBalance);
        seClientCard.setLastoper(LastOperateENUM.REVERSAL.getCode());
        Integer rec_updateClientCard = Optional.ofNullable(clientCardSv.UpdateClientCard(seClientCard)).orElse(0);
        if(rec_updateClientCard == 0) {
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/reversal/ReversalSv.java
@@ -47,8 +47,19 @@
        Long itemTotal = seReversalMapper.getRecordCount(params);
        QueryResultVo<List<VoReversal>> rsVo = new QueryResultVo<>() ;
        rsVo.pageSize = queryVo.pageSize ;
        rsVo.pageCurr = queryVo.pageCurr ;
        Integer pageCurr = 0;
        Integer pageSize = 10000;
        rsVo.pageCurr = 1;
        rsVo.pageSize = 10000;
        if(queryVo.pageSize != null && queryVo.pageCurr != null) {
            rsVo.pageSize = queryVo.pageSize ;
            rsVo.pageCurr = queryVo.pageCurr;
            pageSize = queryVo.pageSize ;
            pageCurr = (Integer.parseInt(params.get("pageCurr").toString()) - 1) * Integer.parseInt(params.get("pageSize").toString());
        }
        params.put("pageCurr", pageCurr);
        params.put("pageSize", pageSize);
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = seReversalMapper.getReversals(params);
        return rsVo ;
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/unlock/UnlockCtrl.java
@@ -12,7 +12,6 @@
import com.dy.pipIrrSell.clientCard.LastOperateENUM;
import com.dy.pipIrrSell.result.SellResultCode;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
@@ -78,7 +77,7 @@
    @PostMapping(path = "add", consumes = MediaType.APPLICATION_JSON_VALUE)
    @Transactional(rollbackFor = Exception.class)
    @SsoAop()
    public BaseResponse<Boolean> add(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid DtoUnlock po, @Parameter(hidden = true) BindingResult bindingResult){
    public BaseResponse<Boolean> add(@RequestBody @Valid DtoUnlock po, BindingResult bindingResult){
        DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
@@ -119,6 +118,7 @@
        SeClientCard seClientCard = new SeClientCard();
        seClientCard.setId(cardId);
        seClientCard.setUnlockdt(unlockTime);
        seClientCard.setMoney(money);
        seClientCard.setLastoper(LastOperateENUM.UNLOCK.getCode());
        Integer rec_updateClientCard = Optional.ofNullable(clientCardSv.UpdateClientCard(seClientCard)).orElse(0);
        if(rec_updateClientCard == 0) {
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/unlock/UnlockSv.java
@@ -47,8 +47,19 @@
        Long itemTotal = seUnlockMapper.getRecordCount(params);
        QueryResultVo<List<VoUnlock>> rsVo = new QueryResultVo<>() ;
        rsVo.pageSize = queryVo.pageSize ;
        rsVo.pageCurr = queryVo.pageCurr ;
        Integer pageCurr = 0;
        Integer pageSize = 10000;
        rsVo.pageCurr = 1;
        rsVo.pageSize = 10000;
        if(queryVo.pageSize != null && queryVo.pageCurr != null) {
            rsVo.pageSize = queryVo.pageSize ;
            rsVo.pageCurr = queryVo.pageCurr;
            pageSize = queryVo.pageSize ;
            pageCurr = (Integer.parseInt(params.get("pageCurr").toString()) - 1) * Integer.parseInt(params.get("pageSize").toString());
        }
        params.put("pageCurr", pageCurr);
        params.put("pageSize", pageSize);
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = seUnlockMapper.getUnlocks(params);
        return rsVo ;
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wallet/WalletCtrl.java
@@ -83,7 +83,7 @@
    //@PostMapping(path = "addRecharge")
    //@Transactional(rollbackFor = Exception.class)
    //@SsoAop()
    //public BaseResponse<Boolean> addRecharge(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid DtoWalletRecharge po, @Parameter(hidden = true) BindingResult bindingResult){
    //public BaseResponse<Boolean> addRecharge(@RequestBody  @Valid DtoWalletRecharge po, @Parameter(hidden = true) BindingResult bindingResult){
    //    DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
    //    if(bindingResult != null && bindingResult.hasErrors()){
    //        return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());