liurunyu
2023-12-19 6eab5ecc0a1cf8bcf1ee999457104e2281e767d2
Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV
24个文件已修改
15个文件已添加
1973 ■■■■ 已修改文件
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaClientMapper.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeActiveCardMapper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeClientCardMapper.java 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeRechargeHistoryMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeRechargeMapper.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeWalletMapper.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeWalletRechargeHistoryMapper.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeWalletRechargeMapper.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeActiveCard.java 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeClientCard.java 77 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeRecharge.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeRechargeHistory.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeWallet.java 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeWalletRecharge.java 118 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeWalletRechargeHistory.java 118 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voBa/VoAreaCode.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaClientMapper.xml 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeActiveCardMapper.xml 114 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeClientCardMapper.xml 100 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeRechargeHistoryMapper.xml 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeRechargeMapper.xml 135 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeWalletMapper.xml 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeWalletRechargeHistoryMapper.xml 137 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeWalletRechargeMapper.xml 137 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/PipIrrSellApplication.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/activeCard/ActiveCardCtrl.java 142 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/activeCard/ActiveCardSv.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/activeCard/DtoActiveCard.java 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/activeCard/QueryVo.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/activeCard/RechargeDtoMapper.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/clientCard/ClientCardSv.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/recharge/DtoRecharge.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/recharge/QueryVo.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/recharge/RechargeCtrl.java 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/recharge/RechargeSv.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wallet/DtoWallet.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wallet/DtoWalletRecharge.java 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wallet/WalletCtrl.java 105 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wallet/WalletSv.java 79 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaClientMapper.java
@@ -2,8 +2,9 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dy.pipIrrGlobal.pojoBa.BaClient;
import com.dy.pipIrrGlobal.pojoBa.BaClientType;
import com.dy.pipIrrGlobal.voBa.VoAreaCode;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
@@ -83,4 +84,11 @@
     */
    int deleteByPrimaryKey(Long id);
    /**
     * 根据农户编号获取5级行政区划代码
     * @param clientNum 农户编号
     * @return 5级行政区划代码
     */
    VoAreaCode getAreaCodeByNum(@Param("clientNum") String clientNum);
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeActiveCardMapper.java
@@ -1,6 +1,5 @@
package com.dy.pipIrrGlobal.daoSe;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dy.pipIrrGlobal.pojoSe.SeActiveCard;
import com.dy.pipIrrGlobal.voSe.VoActiveCard;
@@ -9,11 +8,11 @@
/**
 * @author ZhuBaoMin
 * @date 2023/12/8 16:53
 * @LastEditTime 2023/12/8 16:53
 * @date 2023/12/18 16:58
 * @LastEditTime 2023/12/18 16:58
 * @Description
 */
public interface SeActiveCardMapper extends BaseMapper<SeActiveCard> {
public interface SeActiveCardMapper {
    int deleteByPrimaryKey(Long id);
    int insert(SeActiveCard record);
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeClientCardMapper.java
@@ -3,10 +3,12 @@
import com.dy.pipIrrGlobal.pojoSe.SeClientCard;
import org.apache.ibatis.annotations.Param;
import java.util.Map;
/**
 * @author ZhuBaoMin
 * @date 2023/12/7 9:06
 * @LastEditTime 2023/12/7 9:06
 * @date 2023/12/18 16:26
 * @LastEditTime 2023/12/18 16:26
 * @Description
 */
public interface SeClientCardMapper {
@@ -23,10 +25,30 @@
    int updateByPrimaryKey(SeClientCard record);
    /**
     * 依据水卡地址获取水卡编号(主键)
     * 依据水卡地址获取水卡编号(12月19日废弃)
     * @param cardAddr
     * @return
     */
    Long getCardIdByAddr(@Param("cardAddr") String cardAddr);
    /**
     * 根据水卡编号获取水卡表主键(12月19日添加后废弃)
     * @param cardNum 16位水卡编号
     * @return 水卡表主键
     */
    Long getCardIdByNum(@Param("cardNum") String cardNum);
    /**
     * 根据行政区划串模块查询水卡编号
     * @param areaCode
     * @return
     */
    String getCardNumOfMax(@Param("areaCode") String areaCode);
    /**
     * 根据水卡编号获取水卡表主键及农户编号
     * @param cardNum
     * @return
     */
    Map getCardIdAndClientNum(@Param("cardNum") String cardNum);
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeRechargeHistoryMapper.java
@@ -4,8 +4,8 @@
/**
 * @author ZhuBaoMin
 * @date 2023/12/8 15:25
 * @LastEditTime 2023/12/8 15:25
 * @date 2023/12/19 10:35
 * @LastEditTime 2023/12/19 10:35
 * @Description
 */
public interface SeRechargeHistoryMapper {
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeRechargeMapper.java
@@ -9,8 +9,8 @@
/**
 * @author ZhuBaoMin
 * @date 2023/12/8 15:25
 * @LastEditTime 2023/12/8 15:25
 * @date 2023/12/19 10:18
 * @LastEditTime 2023/12/19 10:18
 * @Description
 */
public interface SeRechargeMapper {
@@ -28,12 +28,18 @@
    Long getRecordCount(Map<?, ?> params);
    /**
     * 根据指定的条件获取充值记录
     * @param params
     * @return
     */
    List<VoRecharge> getRecharges(Map<?, ?> params);
    /**
     * 根据水卡编号删除充值记录
     * @param cardId
     * @param cardNum
     * @return
     */
    Integer deleteByCardId(@Param("cardId") Long cardId);
    //Integer deleteByCardId(@Param("cardId") Long cardId);
    Integer deleteByCardNum(@Param("cardNum") String cardNum);
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeWalletMapper.java
New file
@@ -0,0 +1,23 @@
package com.dy.pipIrrGlobal.daoSe;
import com.dy.pipIrrGlobal.pojoSe.SeWallet;
/**
 * @author ZhuBaoMin
 * @date 2023/12/11 16:29
 * @LastEditTime 2023/12/11 16:29
 * @Description
 */
public interface SeWalletMapper {
    int deleteByPrimaryKey(Long id);
    int insert(SeWallet record);
    int insertSelective(SeWallet record);
    SeWallet selectByPrimaryKey(Long id);
    int updateByPrimaryKeySelective(SeWallet record);
    int updateByPrimaryKey(SeWallet record);
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeWalletRechargeHistoryMapper.java
New file
@@ -0,0 +1,23 @@
package com.dy.pipIrrGlobal.daoSe;
import com.dy.pipIrrGlobal.pojoSe.SeWalletRechargeHistory;
/**
 * @author ZhuBaoMin
 * @date 2023/12/12 9:06
 * @LastEditTime 2023/12/12 9:06
 * @Description
 */
public interface SeWalletRechargeHistoryMapper {
    int deleteByPrimaryKey(Long id);
    int insert(SeWalletRechargeHistory record);
    int insertSelective(SeWalletRechargeHistory record);
    SeWalletRechargeHistory selectByPrimaryKey(Long id);
    int updateByPrimaryKeySelective(SeWalletRechargeHistory record);
    int updateByPrimaryKey(SeWalletRechargeHistory record);
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeWalletRechargeMapper.java
New file
@@ -0,0 +1,23 @@
package com.dy.pipIrrGlobal.daoSe;
import com.dy.pipIrrGlobal.pojoSe.SeWalletRecharge;
/**
 * @author ZhuBaoMin
 * @date 2023/12/12 9:06
 * @LastEditTime 2023/12/12 9:06
 * @Description
 */
public interface SeWalletRechargeMapper {
    int deleteByPrimaryKey(Long id);
    int insert(SeWalletRecharge record);
    int insertSelective(SeWalletRecharge record);
    SeWalletRecharge selectByPrimaryKey(Long id);
    int updateByPrimaryKeySelective(SeWalletRecharge record);
    int updateByPrimaryKey(SeWalletRecharge record);
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeActiveCard.java
@@ -9,6 +9,7 @@
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Positive;
import lombok.*;
import org.hibernate.validator.constraints.Length;
@@ -37,26 +38,26 @@
    public static final long serialVersionUID = 202312071927001L;
    /**
    * 主键
    */
     * 主键
     */
    @JSONField(serializeUsing= ObjectWriterImplToString.class)
    @TableId(type = IdType.INPUT)
    @Schema(description = "实体id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Long id;
    /**
    * 水卡编号
    */
     * 水卡编号
     */
    @Schema(description = "水卡编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Length(message = "水卡编号不小于{min}", min = 1)
    private Long cardid;
    @NotBlank(message = "水卡编号不能为空")
    private String cardnum;
    /**
    * 农户编号
    */
     * 农户编号
     */
    @Schema(description = "农户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Length(message = "农户编号不小于{min}", min = 1)
    private Long clientid;
    @NotBlank(message = "农户编号不能为空")
    private String clientnum;
    /**
     * 卡片费用
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeClientCard.java
@@ -18,8 +18,8 @@
/**
 * @author ZhuBaoMin
 * @date 2023/12/7 9:06
 * @LastEditTime 2023/12/7 9:06
 * @Description
 * @LastEditTime 2023/12/18 10:14
 * @Description 添加水卡编号(cardnum)字段
 */
/**
@@ -37,100 +37,107 @@
    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.NOT_REQUIRED)
    @NotBlank(message = "水卡地址不能为空")
    private String cardaddr;
    /**
    * 农户ID
    */
    @Schema(description = "农户ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Positive(message = "农户ID必须为大于0的整数")
    private Long clientid;
     * 水卡编号
     */
    @Schema(description = "水卡编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotBlank(message = "水卡编号不能为空")
    private String cardnum;
    /**
    * 余额
    */
     * 农户编号
     */
    @Schema(description = "农户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotBlank(message = "农户编号不能为空")
    private String clientnum;
    /**
     * 余额
     */
    @Schema(description = "余额", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Double money;
    /**
    * 卡片状态;1-正常,2-已注销,3-已挂失
    */
     * 卡片状态;1-正常,2-已注销,3-已挂失
     */
    @Schema(description = "卡片状态", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Positive(message = "卡片状态必须为1或2或3")
    @Size(min = 1, max = 3)
    private Byte state;
    /**
    * 开卡时间
    */
     * 开卡时间
     */
    @Schema(description = "开卡时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Date createdt;
    /**
    * 补卡时间
    */
     * 补卡时间
     */
    @Schema(description = "补卡时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Date replacedt;
    /**
    * 充值时间
    */
     * 充值时间
     */
    @Schema(description = "充值时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Date rechargedt;
    /**
    * 挂失时间
    */
     * 挂失时间
     */
    @Schema(description = "挂失时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Date lossdtdt;
    /**
    * 注销时间
    */
     * 注销时间
     */
    @Schema(description = "注销时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Date canceldt;
    /**
    * 解锁时间
    */
     * 解锁时间
     */
    @Schema(description = "解锁时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Date unlockdt;
    /**
    * 冲正时间
    */
     * 冲正时间
     */
    @Schema(description = "冲正时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Date reversaldt;
    /**
    * 消费时间
    */
     * 消费时间
     */
    @Schema(description = "消费时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Date consumedt;
    /**
    * 最后操作类型;1-开卡,2-补卡,3-充值,4-挂失,5-注销,6-解锁,7-冲正,8-消费
    */
     * 最后操作类型;1-开卡,2-补卡,3-充值,4-挂失,5-注销,6-解锁,7-冲正,8-消费
     */
    @Schema(description = "最后操作类型", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Positive(message = "卡片状态必须为1到8的正整数")
    @Size(min = 1, max = 8)
    private Byte lastoper;
    /**
    * 备注信息
    */
     * 备注信息
     */
    @Schema(description = "备注", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Length(message = "备注长度小于{max}字", min = 1, max = 200)
    private String remarks;
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeRecharge.java
@@ -7,6 +7,7 @@
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 jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Positive;
import lombok.*;
@@ -41,15 +42,15 @@
     * 水卡编号
     */
    @Schema(description = "水卡编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Length(message = "水卡编号不小于{min}", min = 1)
    private Long cardid;
    @NotBlank(message = "水卡编号不能为空")
    private String cardnum;
    /**
     * 农户编号
     */
    @Schema(description = "农户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Length(message = "农户编号不小于{min}", min = 1)
    private Long clientid;
    @NotBlank(message = "农户编号不能为空")
    private String clientnum;
    /**
     * 卡片余额
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeRechargeHistory.java
@@ -7,6 +7,7 @@
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 jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Positive;
import lombok.*;
@@ -47,15 +48,15 @@
     * 水卡编号
     */
    @Schema(description = "水卡编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Length(message = "水卡编号不小于{min}", min = 1)
    private Long cardid;
    @NotBlank(message = "水卡编号不能为空")
    private String cardnum;
    /**
     * 农户编号
     */
    @Schema(description = "农户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Length(message = "农户编号不小于{min}", min = 1)
    private Long clientid;
    @NotBlank(message = "农户编号不能为空")
    private String clientnum;
    /**
     * 卡片余额
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeWallet.java
New file
@@ -0,0 +1,65 @@
package com.dy.pipIrrGlobal.pojoSe;
import com.alibaba.fastjson2.annotation.JSONField;
import com.alibaba.fastjson2.writer.ObjectWriterImplToString;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dy.common.po.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Positive;
import lombok.*;
import org.hibernate.validator.constraints.Length;
import java.util.Date;
/**
 * @author ZhuBaoMin
 * @date 2023/12/11 16:29
 * @LastEditTime 2023/12/11 16:29
 * @Description
 */
/**
 * 电子钱包表
 */
@TableName(value="se_wallet", autoResultMap = true)
@Data
@Builder
@ToString
@NoArgsConstructor
@AllArgsConstructor
@Schema(name = "电子钱包表实体")
public class SeWallet implements BaseEntity {
    public static final long serialVersionUID = 1L;
    /**
    * 主键
    */
    @JSONField(serializeUsing= ObjectWriterImplToString.class)
    @TableId(type = IdType.INPUT)
    @Schema(description = "实体id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Positive(message = "主键必须为大于0的整数")
    private Long id;
    /**
    * 用水户编号
    */
    @Schema(description = "农户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Length(message = "农户编号不小于{min}", min = 1)
    private Long clientid;
    /**
    * 钱包余额
    */
    @Schema(description = "钱包余额", requiredMode = Schema.RequiredMode.REQUIRED)
    @Length(message = "钱包余额不小于{min}", min = 0)
    private Float money;
    /**
    * 创建时间
    */
    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Date createdt;
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeWalletRecharge.java
New file
@@ -0,0 +1,118 @@
package com.dy.pipIrrGlobal.pojoSe;
import java.util.Date;
/**
 * @author ZhuBaoMin
 * @date 2023/12/12 9:06
 * @LastEditTime 2023/12/12 9:06
 * @Description
 */
/**
    * 电子钱包充值表
    */
public class SeWalletRecharge {
    /**
    * 主键
    */
    private Long id;
    /**
    * 钱包编号
    */
    private Long walletid;
    /**
    * 农户编号
    */
    private Long clientid;
    /**
    * 钱包余额
    */
    private Double money;
    /**
    * 充值金额
    */
    private Double amount;
    /**
    * 充值后余额
    */
    private Double afterrecharge;
    /**
    * 充值时间
    */
    private Date rechargedt;
    /**
    * 备注信息
    */
    private String remarks;
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public Long getWalletid() {
        return walletid;
    }
    public void setWalletid(Long walletid) {
        this.walletid = walletid;
    }
    public Long getClientid() {
        return clientid;
    }
    public void setClientid(Long clientid) {
        this.clientid = clientid;
    }
    public Double getMoney() {
        return money;
    }
    public void setMoney(Double money) {
        this.money = money;
    }
    public Double getAmount() {
        return amount;
    }
    public void setAmount(Double amount) {
        this.amount = amount;
    }
    public Double getAfterrecharge() {
        return afterrecharge;
    }
    public void setAfterrecharge(Double afterrecharge) {
        this.afterrecharge = afterrecharge;
    }
    public Date getRechargedt() {
        return rechargedt;
    }
    public void setRechargedt(Date rechargedt) {
        this.rechargedt = rechargedt;
    }
    public String getRemarks() {
        return remarks;
    }
    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeWalletRechargeHistory.java
New file
@@ -0,0 +1,118 @@
package com.dy.pipIrrGlobal.pojoSe;
import java.util.Date;
/**
 * @author ZhuBaoMin
 * @date 2023/12/12 9:06
 * @LastEditTime 2023/12/12 9:06
 * @Description
 */
/**
    * 电子钱包充值历史表
    */
public class SeWalletRechargeHistory {
    /**
    * 主键
    */
    private Long id;
    /**
    * 钱包编号
    */
    private Long walletid;
    /**
    * 农户编号
    */
    private Long clientid;
    /**
    * 钱包余额
    */
    private Double money;
    /**
    * 充值金额
    */
    private Double amount;
    /**
    * 充值后余额
    */
    private Double afterrecharge;
    /**
    * 充值时间
    */
    private Date rechargedt;
    /**
    * 备注信息
    */
    private String remarks;
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public Long getWalletid() {
        return walletid;
    }
    public void setWalletid(Long walletid) {
        this.walletid = walletid;
    }
    public Long getClientid() {
        return clientid;
    }
    public void setClientid(Long clientid) {
        this.clientid = clientid;
    }
    public Double getMoney() {
        return money;
    }
    public void setMoney(Double money) {
        this.money = money;
    }
    public Double getAmount() {
        return amount;
    }
    public void setAmount(Double amount) {
        this.amount = amount;
    }
    public Double getAfterrecharge() {
        return afterrecharge;
    }
    public void setAfterrecharge(Double afterrecharge) {
        this.afterrecharge = afterrecharge;
    }
    public Date getRechargedt() {
        return rechargedt;
    }
    public void setRechargedt(Date rechargedt) {
        this.rechargedt = rechargedt;
    }
    public String getRemarks() {
        return remarks;
    }
    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voBa/VoAreaCode.java
New file
@@ -0,0 +1,33 @@
package com.dy.pipIrrGlobal.voBa;
import com.dy.common.po.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
 * @author ZhuBaoMin
 * @date 2023/12/18 14:32
 * @LastEditTime 2023/12/18 14:32
 * @Description
 */
@Data
@Schema(title = "5级行政区划视图对象")
public class VoAreaCode implements BaseEntity {
    private static final long serialVersionUID = 1L;
    @Schema(title = "省级区划代码")
    private String provinceId;
    @Schema(title = "市级区划代码")
    private String cityId;
    @Schema(title = "县级区划代码")
    private String countryId;
    @Schema(title = "镇级区划代码")
    private String townId;
    @Schema(title = "村级区划代码")
    private String villageId;
}
pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaClientMapper.xml
@@ -336,4 +336,20 @@
        where id = #{id,jdbcType=BIGINT}
    </delete>
    <!--根据农户编号获取5级行政区划代码-->
    <select id="getAreaCodeByNum" resultType="com.dy.pipIrrGlobal.voBa.VoAreaCode">
        SELECT
            pro.num AS provinceId,
            cit.num AS cityId,
            con.num AS countryId,
            tow.num AS townId,
            vil.num AS villageId
        FROM ba_client cli
                 INNER JOIN ba_district con ON cli.countyId = con.id
                 INNER JOIN ba_district tow ON cli.townId = tow.id
                 INNER JOIN ba_district vil ON cli.villageId = vil.id
                 INNER JOIN ba_district cit ON cit.id = con.supperId
                 INNER JOIN ba_district pro ON pro.id = cit.supperId
        WHERE cli.num = #{clientNum}
    </select>
</mapper>
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeActiveCardMapper.xml
@@ -5,8 +5,8 @@
    <!--@mbg.generated-->
    <!--@Table se_active_card-->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="cardId" jdbcType="BIGINT" property="cardid" />
    <result column="clientId" jdbcType="BIGINT" property="clientid" />
    <result column="cardNum" jdbcType="VARCHAR" property="cardnum" />
    <result column="clientNum" jdbcType="VARCHAR" property="clientnum" />
    <result column="cardCost" jdbcType="INTEGER" property="cardcost" />
    <result column="paymentId" jdbcType="BIGINT" property="paymentid" />
    <result column="reissueAmount" jdbcType="DOUBLE" property="reissueamount" />
@@ -17,8 +17,8 @@
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    id, cardId, clientId, cardCost, paymentId, reissueAmount, operateType, remarks, `operator`,
    operateDt
    id, cardNum, clientNum, cardCost, paymentId, reissueAmount, operateType, remarks,
    `operator`, operateDt
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    <!--@mbg.generated-->
@@ -35,40 +35,28 @@
  <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSe.SeActiveCard">
    <!--@mbg.generated-->
    insert into se_active_card (id, cardId, clientId, cardCost, paymentId, reissueAmount, operateType, remarks, `operator`, operateDt)
    insert into se_active_card (id, cardNum, clientNum, cardCost, paymentId, reissueAmount, operateType, remarks, `operator`, operateDt)
    values (#{id,jdbcType=BIGINT},
            #{cardid,jdbcType=BIGINT},
            #{clientid,jdbcType=BIGINT},
            #{cardcost,jdbcType=INTEGER},
            #{paymentid,jdbcType=BIGINT},
            #{reissueamount,jdbcType=DOUBLE},
            #{operatetype,jdbcType=TINYINT},
            #{remarks,jdbcType=VARCHAR},
            #{operator,jdbcType=BIGINT},
            #{operatedt,jdbcType=TIMESTAMP})
    #{cardnum,jdbcType=VARCHAR},
    #{clientnum,jdbcType=VARCHAR},
    #{cardcost,jdbcType=INTEGER},
    #{paymentid,jdbcType=BIGINT},
    #{reissueamount,jdbcType=DOUBLE},
    #{operatetype,jdbcType=TINYINT},
    #{remarks,jdbcType=VARCHAR},
    #{operator,jdbcType=BIGINT},
    #{operatedt,jdbcType=TIMESTAMP})
  </insert>
<!--  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeActiveCard" useGeneratedKeys="true">-->
<!--    &lt;!&ndash;@mbg.generated&ndash;&gt;-->
<!--    insert into se_active_card (cardId, clientId, cardCost, -->
<!--      paymentId, reissueAmount, operateType, -->
<!--      remarks, `operator`, operateDt-->
<!--      )-->
<!--    values (#{cardid,jdbcType=BIGINT}, #{clientid,jdbcType=BIGINT}, #{cardcost,jdbcType=INTEGER}, -->
<!--      #{paymentid,jdbcType=BIGINT}, #{reissueamount,jdbcType=DOUBLE}, #{operatetype,jdbcType=TINYINT}, -->
<!--      #{remarks,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT}, #{operatedt,jdbcType=TIMESTAMP}-->
<!--      )-->
<!--  </insert>-->
  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeActiveCard" useGeneratedKeys="true">
    <!--@mbg.generated-->
    insert into se_active_card
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="cardid != null">
        cardId,
      <if test="cardnum != null">
        cardNum,
      </if>
      <if test="clientid != null">
        clientId,
      <if test="clientnum != null">
        clientNum,
      </if>
      <if test="cardcost != null">
        cardCost,
@@ -93,11 +81,11 @@
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="cardid != null">
        #{cardid,jdbcType=BIGINT},
      <if test="cardnum != null">
        #{cardnum,jdbcType=VARCHAR},
      </if>
      <if test="clientid != null">
        #{clientid,jdbcType=BIGINT},
      <if test="clientnum != null">
        #{clientnum,jdbcType=VARCHAR},
      </if>
      <if test="cardcost != null">
        #{cardcost,jdbcType=INTEGER},
@@ -126,11 +114,11 @@
    <!--@mbg.generated-->
    update se_active_card
    <set>
      <if test="cardid != null">
        cardId = #{cardid,jdbcType=BIGINT},
      <if test="cardnum != null">
        cardNum = #{cardnum,jdbcType=VARCHAR},
      </if>
      <if test="clientid != null">
        clientId = #{clientid,jdbcType=BIGINT},
      <if test="clientnum != null">
        clientNum = #{clientnum,jdbcType=VARCHAR},
      </if>
      <if test="cardcost != null">
        cardCost = #{cardcost,jdbcType=INTEGER},
@@ -159,8 +147,8 @@
  <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSe.SeActiveCard">
    <!--@mbg.generated-->
    update se_active_card
    set cardId = #{cardid,jdbcType=BIGINT},
      clientId = #{clientid,jdbcType=BIGINT},
    set cardNum = #{cardnum,jdbcType=VARCHAR},
      clientNum = #{clientnum,jdbcType=VARCHAR},
      cardCost = #{cardcost,jdbcType=INTEGER},
      paymentId = #{paymentid,jdbcType=BIGINT},
      reissueAmount = #{reissueamount,jdbcType=DOUBLE},
@@ -176,9 +164,9 @@
    SELECT
        COUNT(*) AS recordCount
    FROM se_active_card act
    INNER JOIN ba_client cli ON act.clientId = cli.id
    INNER JOIN se_client_card card ON act.cardId = card.id
    , (SELECT @i:=0) AS itable
        INNER JOIN ba_client cli ON act.clientNum = cli.num
        INNER JOIN se_client_card card ON act.cardNum = card.cardNum
        , (SELECT @i:=0) AS itable
    <where>
      <if test = "operateType != null and operateType > 0">
        AND act.operateType = ${operateType}
@@ -188,8 +176,12 @@
        AND cli.name like CONCAT('%',#{clientName},'%')
      </if>
      <if test = "cardAddr != null and cardAddr !=''">
        AND card.cardAddr like CONCAT('%',#{cardAddr},'%')
      <!--      <if test = "cardAddr != null and cardAddr !=''">-->
      <!--        AND card.cardAddr like CONCAT('%',#{cardAddr},'%')-->
      <!--      </if>-->
      <if test = "cardNum != null and cardNum !=''">
        AND card.cardNum like CONCAT('%',#{cardNum},'%')
      </if>
      <if test = "state != null and state > 0">
@@ -211,19 +203,19 @@
        card.cardAddr,
        card.state,
        (CASE
            WHEN card.state = 1 THEN "正常"
            WHEN card.state = 2 THEN "已注销"
            ELSE "已挂失"
        WHEN card.state = 1 THEN "正常"
        WHEN card.state = 2 THEN "已注销"
        ELSE "已挂失"
        END) AS stateName,
      act.reissueAmount,
      act.cardCost,
      act.paymentId,
      (SELECT `name` FROM ba_user WHERE id =  act.operator) AS operator,
      act.operateDt
        act.reissueAmount,
        act.cardCost,
        act.paymentId,
        (SELECT `name` FROM ba_user WHERE id =  act.operator) AS operator,
        act.operateDt
    FROM se_active_card act
      INNER JOIN ba_client cli ON act.clientId = cli.id
      INNER JOIN se_client_card card ON act.cardId = card.id
      , (SELECT @i:=0) AS itable
        INNER JOIN ba_client cli ON act.clientNum = cli.num
        INNER JOIN se_client_card card ON act.cardNum = card.cardNum
        , (SELECT @i:=0) AS itable
    <where>
      <if test = "operateType != null and operateType > 0">
        AND act.operateType = ${operateType}
@@ -233,8 +225,12 @@
        AND cli.name like CONCAT('%',#{clientName},'%')
      </if>
      <if test = "cardAddr != null and cardAddr !=''">
        AND card.cardAddr like CONCAT('%',#{cardAddr},'%')
<!--      <if test = "cardAddr != null and cardAddr !=''">-->
<!--        AND card.cardAddr like CONCAT('%',#{cardAddr},'%')-->
<!--      </if>-->
      <if test = "cardNum != null and cardNum !=''">
        AND card.cardNum like CONCAT('%',#{cardNum},'%')
      </if>
      <if test = "state != null and state > 0">
@@ -245,7 +241,7 @@
        AND act.operateDt BETWEEN #{activeTimeStart} AND #{activeTimeStop}
      </if>
    </where>
    ORDER BY act.operateDt DESC
    <if test="pageCurr != null and pageSize != null">
      LIMIT ${pageCurr}, ${pageSize}
    </if>
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeClientCardMapper.xml
@@ -6,7 +6,8 @@
    <!--@Table se_client_card-->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="cardAddr" jdbcType="VARCHAR" property="cardaddr" />
    <result column="clientId" jdbcType="BIGINT" property="clientid" />
    <result column="cardNum" jdbcType="VARCHAR" property="cardnum" />
    <result column="clientNum" jdbcType="VARCHAR" property="clientnum" />
    <result column="money" jdbcType="FLOAT" property="money" />
    <result column="state" jdbcType="TINYINT" property="state" />
    <result column="createDt" jdbcType="TIMESTAMP" property="createdt" />
@@ -22,8 +23,8 @@
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    id, cardAddr, clientId, money, `state`, createDt, replaceDt, rechargeDt, lossDtDt,
    cancelDt, unlockDt, reversalDt, consumeDt, lastOper, remarks
    id, cardAddr, cardNum, clientNum, money, `state`, createDt, replaceDt, rechargeDt,
    lossDtDt, cancelDt, unlockDt, reversalDt, consumeDt, lastOper, remarks
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    <!--@mbg.generated-->
@@ -38,44 +39,47 @@
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <!--依据水卡地址获取水卡编号(主键)-->
  <!--依据水卡地址获取水卡编号(12月19日废弃)-->
  <select id="getCardIdByAddr" resultType="java.lang.Long">
    SELECT id AS cardId FROM se_client_card WHERE cardAddr = #{cardAddr}
  </select>
  <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClientCard">
    <!--@mbg.generated-->
    insert into se_client_card (id, cardAddr, clientId, money, `state`, createDt, replaceDt, rechargeDt, lossDtDt, cancelDt, unlockDt, reversalDt, consumeDt, lastOper, remarks)
    values (#{id,jdbcType=BIGINT},
            #{cardaddr,jdbcType=VARCHAR},
            #{clientid,jdbcType=BIGINT},
            #{money,jdbcType=FLOAT},
            #{state,jdbcType=TINYINT},
            #{createdt,jdbcType=TIMESTAMP},
            #{replacedt,jdbcType=TIMESTAMP},
            #{rechargedt,jdbcType=TIMESTAMP},
            #{lossdtdt,jdbcType=TIMESTAMP},
            #{canceldt,jdbcType=TIMESTAMP},
            #{unlockdt,jdbcType=TIMESTAMP},
            #{reversaldt,jdbcType=TIMESTAMP},
            #{consumedt,jdbcType=TIMESTAMP},
            #{lastoper,jdbcType=TINYINT},
            #{remarks,jdbcType=VARCHAR})
  </insert>
  <!--根据水卡编号获取水卡表主键(12月19日添加后废弃)-->
  <select id="getCardIdByNum" resultType="java.lang.Long">
    SELECT id AS cardId FROM se_client_card WHERE cardNum = #{cardNum}
  </select>
<!--  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClientCard" useGeneratedKeys="true">-->
<!--    &lt;!&ndash;@mbg.generated&ndash;&gt;-->
<!--    insert into se_client_card (cardAddr, clientId, money, -->
<!--      `state`, createDt, replaceDt, -->
<!--      rechargeDt, lossDtDt, cancelDt, -->
<!--      unlockDt, reversalDt, consumeDt, -->
<!--      lastOper, remarks)-->
<!--    values (#{cardaddr,jdbcType=VARCHAR}, #{clientid,jdbcType=BIGINT}, #{money,jdbcType=FLOAT}, -->
<!--      #{state,jdbcType=TINYINT}, #{createdt,jdbcType=TIMESTAMP}, #{replacedt,jdbcType=TIMESTAMP}, -->
<!--      #{rechargedt,jdbcType=TIMESTAMP}, #{lossdtdt,jdbcType=TIMESTAMP}, #{canceldt,jdbcType=TIMESTAMP}, -->
<!--      #{unlockdt,jdbcType=TIMESTAMP}, #{reversaldt,jdbcType=TIMESTAMP}, #{consumedt,jdbcType=TIMESTAMP}, -->
<!--      #{lastoper,jdbcType=TINYINT}, #{remarks,jdbcType=VARCHAR})-->
<!--  </insert>-->
  <!--根据水卡编号获取水卡表主键及农户编号-->
  <select id="getCardIdAndClientNum" resultType="java.util.Map">
    SELECT id AS cardId, clientNum FROM se_client_card WHERE cardNum = #{cardNum}
  </select>
  <!--根据行政区划串模块查询水卡编号-->
  <select id="getCardNumOfMax"  resultType="java.lang.String">
    SELECT cardNum
    FROM se_client_card
    WHERE cardNum LIKE CONCAT('%',#{areaCode},'%')
    ORDER BY cardNum desc
    LIMIT 0,1
  </select>
  <!--添加水卡记录-->
  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClientCard" useGeneratedKeys="true">
    <!--@mbg.generated-->
    insert into se_client_card (id, cardAddr, cardNum, clientNum,
      money, `state`, createDt,
      replaceDt, rechargeDt, lossDtDt,
      cancelDt, unlockDt, reversalDt,
      consumeDt, lastOper, remarks
      )
    values (#{id,jdbcType=BIGINT}, #{cardaddr,jdbcType=VARCHAR}, #{cardnum,jdbcType=VARCHAR}, #{clientnum,jdbcType=VARCHAR},
      #{money,jdbcType=FLOAT}, #{state,jdbcType=TINYINT}, #{createdt,jdbcType=TIMESTAMP},
      #{replacedt,jdbcType=TIMESTAMP}, #{rechargedt,jdbcType=TIMESTAMP}, #{lossdtdt,jdbcType=TIMESTAMP},
      #{canceldt,jdbcType=TIMESTAMP}, #{unlockdt,jdbcType=TIMESTAMP}, #{reversaldt,jdbcType=TIMESTAMP},
      #{consumedt,jdbcType=TIMESTAMP}, #{lastoper,jdbcType=TINYINT}, #{remarks,jdbcType=VARCHAR}
      )
  </insert>
  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClientCard" useGeneratedKeys="true">
    <!--@mbg.generated-->
@@ -84,8 +88,11 @@
      <if test="cardaddr != null">
        cardAddr,
      </if>
      <if test="clientid != null">
        clientId,
      <if test="cardnum != null">
        cardNum,
      </if>
      <if test="clientnum != null">
        clientNum,
      </if>
      <if test="money != null">
        money,
@@ -128,8 +135,11 @@
      <if test="cardaddr != null">
        #{cardaddr,jdbcType=VARCHAR},
      </if>
      <if test="clientid != null">
        #{clientid,jdbcType=BIGINT},
      <if test="cardnum != null">
        #{cardnum,jdbcType=VARCHAR},
      </if>
      <if test="clientnum != null">
        #{clientnum,jdbcType=VARCHAR},
      </if>
      <if test="money != null">
        #{money,jdbcType=FLOAT},
@@ -176,8 +186,11 @@
      <if test="cardaddr != null">
        cardAddr = #{cardaddr,jdbcType=VARCHAR},
      </if>
      <if test="clientid != null">
        clientId = #{clientid,jdbcType=BIGINT},
      <if test="cardnum != null">
        cardNum = #{cardnum,jdbcType=VARCHAR},
      </if>
      <if test="clientnum != null">
        clientNum = #{clientnum,jdbcType=VARCHAR},
      </if>
      <if test="money != null">
        money = #{money,jdbcType=FLOAT},
@@ -222,7 +235,8 @@
    <!--@mbg.generated-->
    update se_client_card
    set cardAddr = #{cardaddr,jdbcType=VARCHAR},
      clientId = #{clientid,jdbcType=BIGINT},
      cardNum = #{cardnum,jdbcType=VARCHAR},
      clientNum = #{clientnum,jdbcType=VARCHAR},
      money = #{money,jdbcType=FLOAT},
      `state` = #{state,jdbcType=TINYINT},
      createDt = #{createdt,jdbcType=TIMESTAMP},
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeRechargeHistoryMapper.xml
@@ -5,8 +5,8 @@
    <!--@mbg.generated-->
    <!--@Table se_recharge_history-->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="cardId" jdbcType="BIGINT" property="cardid" />
    <result column="clientId" jdbcType="BIGINT" property="clientid" />
    <result column="cardNum" jdbcType="VARCHAR" property="cardnum" />
    <result column="clientNum" jdbcType="VARCHAR" property="clientnum" />
    <result column="money" jdbcType="FLOAT" property="money" />
    <result column="amount" jdbcType="FLOAT" property="amount" />
    <result column="gift" jdbcType="FLOAT" property="gift" />
@@ -19,7 +19,7 @@
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    id, cardId, clientId, money, amount, gift, afterRecharge, paymentId, price, remarks,
    id, cardNum, clientNum, money, amount, gift, afterRecharge, paymentId, price, remarks,
    `operator`, operateDt
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
@@ -35,33 +35,27 @@
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeRechargeHistory" useGeneratedKeys="true">
  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeRechargeHistory">
    <!--@mbg.generated-->
    insert into se_recharge_history (id, cardId, clientId, money, amount, gift, afterRecharge, paymentId, price, remarks, `operator`, operateDt)
    values (#{id,jdbcType=BIGINT},
            #{cardid,jdbcType=BIGINT},
            #{clientid,jdbcType=BIGINT},
            #{money,jdbcType=FLOAT},
            #{amount,jdbcType=FLOAT},
            #{gift,jdbcType=FLOAT},
            #{afterrecharge,jdbcType=FLOAT},
            #{paymentid,jdbcType=BIGINT},
            #{price,jdbcType=FLOAT},
            #{remarks,jdbcType=VARCHAR},
            #{operator,jdbcType=BIGINT},
            #{operatedt,jdbcType=TIMESTAMP})
    insert into se_recharge_history (id, cardNum, clientNum, money,
      amount, gift, afterRecharge,
      paymentId, price, remarks,
      `operator`, operateDt)
    values (#{id,jdbcType=BIGINT}, #{cardnum,jdbcType=VARCHAR}, #{clientnum,jdbcType=VARCHAR}, #{money,jdbcType=FLOAT},
      #{amount,jdbcType=FLOAT}, #{gift,jdbcType=FLOAT}, #{afterrecharge,jdbcType=FLOAT},
      #{paymentid,jdbcType=BIGINT}, #{price,jdbcType=FLOAT}, #{remarks,jdbcType=VARCHAR},
      #{operator,jdbcType=BIGINT}, #{operatedt,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeRechargeHistory" useGeneratedKeys="true">
    <!--@mbg.generated-->
    insert into se_recharge_history
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="cardid != null">
        cardId,
      <if test="cardnum != null">
        cardNum,
      </if>
      <if test="clientid != null">
        clientId,
      <if test="clientnum != null">
        clientNum,
      </if>
      <if test="money != null">
        money,
@@ -92,11 +86,11 @@
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="cardid != null">
        #{cardid,jdbcType=BIGINT},
      <if test="cardnum != null">
        #{cardnum,jdbcType=VARCHAR},
      </if>
      <if test="clientid != null">
        #{clientid,jdbcType=BIGINT},
      <if test="clientnum != null">
        #{clientnum,jdbcType=VARCHAR},
      </if>
      <if test="money != null">
        #{money,jdbcType=FLOAT},
@@ -131,11 +125,11 @@
    <!--@mbg.generated-->
    update se_recharge_history
    <set>
      <if test="cardid != null">
        cardId = #{cardid,jdbcType=BIGINT},
      <if test="cardnum != null">
        cardNum = #{cardnum,jdbcType=VARCHAR},
      </if>
      <if test="clientid != null">
        clientId = #{clientid,jdbcType=BIGINT},
      <if test="clientnum != null">
        clientNum = #{clientnum,jdbcType=VARCHAR},
      </if>
      <if test="money != null">
        money = #{money,jdbcType=FLOAT},
@@ -170,8 +164,8 @@
  <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSe.SeRechargeHistory">
    <!--@mbg.generated-->
    update se_recharge_history
    set cardId = #{cardid,jdbcType=BIGINT},
      clientId = #{clientid,jdbcType=BIGINT},
    set cardNum = #{cardnum,jdbcType=VARCHAR},
      clientNum = #{clientnum,jdbcType=VARCHAR},
      money = #{money,jdbcType=FLOAT},
      amount = #{amount,jdbcType=FLOAT},
      gift = #{gift,jdbcType=FLOAT},
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeRechargeMapper.xml
@@ -5,8 +5,8 @@
    <!--@mbg.generated-->
    <!--@Table se_recharge-->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="cardId" jdbcType="BIGINT" property="cardid" />
    <result column="clientId" jdbcType="BIGINT" property="clientid" />
    <result column="cardNum" jdbcType="VARCHAR" property="cardnum" />
    <result column="clientNum" jdbcType="VARCHAR" property="clientnum" />
    <result column="money" jdbcType="FLOAT" property="money" />
    <result column="amount" jdbcType="FLOAT" property="amount" />
    <result column="gift" jdbcType="FLOAT" property="gift" />
@@ -19,7 +19,7 @@
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    id, cardId, clientId, money, amount, gift, afterRecharge, paymentId, price, remarks,
    id, cardNum, clientNum, money, amount, gift, afterRecharge, paymentId, price, remarks,
    `operator`, operateDt
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
@@ -35,44 +35,29 @@
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSe.SeRecharge">
<!--  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeRecharge" useGeneratedKeys="true">-->
  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeRecharge">
    <!--@mbg.generated-->
    insert into se_recharge (id, cardId, clientId, money, amount, gift, afterRecharge, paymentId, price, remarks, `operator`, operateDt)
    values (#{id,jdbcType=BIGINT},
            #{cardid,jdbcType=BIGINT},
            #{clientid,jdbcType=BIGINT},
            #{money,jdbcType=FLOAT},
            #{amount,jdbcType=FLOAT},
            #{gift,jdbcType=FLOAT},
            #{afterrecharge,jdbcType=FLOAT},
            #{paymentid,jdbcType=BIGINT},
            #{price,jdbcType=FLOAT},
            #{remarks,jdbcType=VARCHAR},
            #{operator,jdbcType=BIGINT},
            #{operatedt,jdbcType=TIMESTAMP})
    insert into se_recharge (id, cardNum, clientNum, money,
      amount, gift, afterRecharge,
      paymentId, price, remarks,
      `operator`, operateDt)
    values (#{id,jdbcType=BIGINT} ,#{cardnum,jdbcType=VARCHAR}, #{clientnum,jdbcType=VARCHAR}, #{money,jdbcType=FLOAT},
      #{amount,jdbcType=FLOAT}, #{gift,jdbcType=FLOAT}, #{afterrecharge,jdbcType=FLOAT},
      #{paymentid,jdbcType=BIGINT}, #{price,jdbcType=FLOAT}, #{remarks,jdbcType=VARCHAR},
      #{operator,jdbcType=BIGINT}, #{operatedt,jdbcType=TIMESTAMP})
  </insert>
<!--  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeRecharge" useGeneratedKeys="true">-->
<!--    &lt;!&ndash;@mbg.generated&ndash;&gt;-->
<!--    insert into se_recharge (cardId, clientId, money, -->
<!--      amount, gift, afterRecharge, -->
<!--      paymentId, price, remarks, -->
<!--      `operator`, operateDt)-->
<!--    values (#{cardid,jdbcType=BIGINT}, #{clientid,jdbcType=BIGINT}, #{money,jdbcType=FLOAT}, -->
<!--      #{amount,jdbcType=FLOAT}, #{gift,jdbcType=FLOAT}, #{afterrecharge,jdbcType=FLOAT}, -->
<!--      #{paymentid,jdbcType=BIGINT}, #{price,jdbcType=FLOAT}, #{remarks,jdbcType=VARCHAR}, -->
<!--      #{operator,jdbcType=BIGINT}, #{operatedt,jdbcType=TIMESTAMP})-->
<!--  </insert>-->
  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeRecharge" useGeneratedKeys="true">
    <!--@mbg.generated-->
    insert into se_recharge
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="cardid != null">
        cardId,
      <if test="cardnum != null">
        cardNum,
      </if>
      <if test="clientid != null">
        clientId,
      <if test="clientnum != null">
        clientNum,
      </if>
      <if test="money != null">
        money,
@@ -103,11 +88,11 @@
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="cardid != null">
        #{cardid,jdbcType=BIGINT},
      <if test="cardnum != null">
        #{cardnum,jdbcType=VARCHAR},
      </if>
      <if test="clientid != null">
        #{clientid,jdbcType=BIGINT},
      <if test="clientnum != null">
        #{clientnum,jdbcType=VARCHAR},
      </if>
      <if test="money != null">
        #{money,jdbcType=FLOAT},
@@ -142,11 +127,11 @@
    <!--@mbg.generated-->
    update se_recharge
    <set>
      <if test="cardid != null">
        cardId = #{cardid,jdbcType=BIGINT},
      <if test="cardnum != null">
        cardNum = #{cardnum,jdbcType=VARCHAR},
      </if>
      <if test="clientid != null">
        clientId = #{clientid,jdbcType=BIGINT},
      <if test="clientnum != null">
        clientNum = #{clientnum,jdbcType=VARCHAR},
      </if>
      <if test="money != null">
        money = #{money,jdbcType=FLOAT},
@@ -181,8 +166,8 @@
  <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSe.SeRecharge">
    <!--@mbg.generated-->
    update se_recharge
    set cardId = #{cardid,jdbcType=BIGINT},
      clientId = #{clientid,jdbcType=BIGINT},
    set cardNum = #{cardnum,jdbcType=VARCHAR},
      clientNum = #{clientnum,jdbcType=VARCHAR},
      money = #{money,jdbcType=FLOAT},
      amount = #{amount,jdbcType=FLOAT},
      gift = #{gift,jdbcType=FLOAT},
@@ -196,25 +181,35 @@
  </update>
  <!--根据水卡编号删除充值记录-->
  <delete id="deleteByCardId" parameterType="java.lang.Long">
    DELETE FROM    se_recharge WHERE cardId = ${cardId}
  <delete id="deleteByCardNum" parameterType="java.lang.String">
    DELETE FROM    se_recharge WHERE cardNum = #{cardNum}
  </delete>
  <!--根据指定的条件获取充值记录-->
  <select id="getRecordCount" parameterType="java.util.Map" resultType="java.lang.Long">
    select
    COUNT(*) AS recordCount
        COUNT(*) AS recordCount
    FROM se_recharge_history rec
    INNER JOIN se_client_card card ON rec.cardId = card.id
    INNER JOIN ba_client cli ON rec.clientId = cli.id
    INNER JOIN se_client_card card ON rec.cardNum = card.cardNum
    INNER JOIN ba_client cli ON rec.clientNum = cli.num
    , (SELECT @i:=0) AS itable
    <where>
      <if test = "clientName != null and clientName !=''">
        AND cli.name like CONCAT('%',#{clientName},'%')
      </if>
      <if test = "cardAddr != null and cardAddr !=''">
        AND card.cardAddr like CONCAT('%',#{cardAddr},'%')
      <!--      <if test = "clientId != null and clientId > 0">-->
      <!--        AND rec.clientId like CONCAT('%',#{clientId},'%')-->
      <!--      </if>-->
      <if test = "clientNum != null and clientNum > 0">
        AND rec.clientNum like CONCAT('%',#{clientNum},'%')
      </if>
      <!--      <if test = "cardAddr != null and cardAddr !=''">-->
      <!--        AND card.cardAddr like CONCAT('%',#{cardAddr},'%')-->
      <!--      </if>-->
      <if test = "cardNum != null and cardNum !=''">
        AND card.cardNum like CONCAT('%',#{cardNum},'%')
      </if>
      <if test = "paymentId != null and paymentId > 0">
@@ -230,27 +225,37 @@
  <!--根据指定的条件获取充值记录-->
  <select id="getRecharges" resultType="com.dy.pipIrrGlobal.voSe.VoRecharge">
    SELECT
    (@i:=@i+1) AS id,
    cli.name AS clientName,
    rec.clientId,
    card.cardAddr,
    rec.amount,
    rec.afterRecharge,
    rec.paymentId,
    rec.price,
    (SELECT `name` FROM ba_user WHERE id =  rec.operator) AS operator,
    rec.operateDt
        (@i:=@i+1) AS id,
        cli.name AS clientName,
        cli.num AS clientNum,
        card.cardNum,
        rec.amount,
        rec.afterRecharge,
        rec.paymentId,
        rec.price,
        (SELECT `name` FROM ba_user WHERE id =  rec.operator) AS operator,
        rec.operateDt
    FROM se_recharge_history rec
    INNER JOIN se_client_card card ON rec.cardId = card.id
    INNER JOIN ba_client cli ON rec.clientId = cli.id
    , (SELECT @i:=0) AS itable
        INNER JOIN se_client_card card ON rec.cardNum = card.cardNum
        INNER JOIN ba_client cli ON rec.clientNum = cli.num
        , (SELECT @i:=0) AS itable
    <where>
      <if test = "clientName != null and clientName !=''">
        AND cli.name like CONCAT('%',#{clientName},'%')
      </if>
      <if test = "cardAddr != null and cardAddr !=''">
        AND card.cardAddr like CONCAT('%',#{cardAddr},'%')
<!--      <if test = "clientId != null and clientId > 0">-->
<!--        AND rec.clientId like CONCAT('%',#{clientId},'%')-->
<!--      </if>-->
      <if test = "clientNum != null and clientNum > 0">
        AND rec.clientNum like CONCAT('%',#{clientNum},'%')
      </if>
<!--      <if test = "cardAddr != null and cardAddr !=''">-->
<!--        AND card.cardAddr like CONCAT('%',#{cardAddr},'%')-->
<!--      </if>-->
      <if test = "cardNum != null and cardNum !=''">
        AND card.cardNum like CONCAT('%',#{cardNum},'%')
      </if>
      <if test = "paymentId != null and paymentId > 0">
@@ -261,7 +266,7 @@
        AND rec.operateDt BETWEEN #{rechargeTimeStart} AND #{rechargeTimeStop}
      </if>
    </where>
    ORDER BY rec.operateDt DESC
    <if test="pageCurr != null and pageSize != null">
      LIMIT ${pageCurr}, ${pageSize}
    </if>
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeWalletMapper.xml
New file
@@ -0,0 +1,90 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dy.pipIrrGlobal.daoSe.SeWalletMapper">
  <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoSe.SeWallet">
    <!--@mbg.generated-->
    <!--@Table se_wallet-->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="clientId" jdbcType="BIGINT" property="clientid" />
    <result column="money" jdbcType="FLOAT" property="money" />
    <result column="createDt" jdbcType="TIMESTAMP" property="createdt" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    id, clientId, money, createDt
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    <!--@mbg.generated-->
    select
    <include refid="Base_Column_List" />
    from se_wallet
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    <!--@mbg.generated-->
    delete from se_wallet
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSe.SeWallet">
    <!--@mbg.generated-->
    insert into se_wallet (id, clientId, money, createDt)
    values (#{id,jdbcType=BIGINT}, #{clientid,jdbcType=BIGINT}, #{money,jdbcType=FLOAT},
      #{createdt,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeWallet">
    <!--@mbg.generated-->
    insert into se_wallet
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="clientid != null">
        clientId,
      </if>
      <if test="money != null">
        money,
      </if>
      <if test="createdt != null">
        createDt,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="clientid != null">
        #{clientid,jdbcType=BIGINT},
      </if>
      <if test="money != null">
        #{money,jdbcType=FLOAT},
      </if>
      <if test="createdt != null">
        #{createdt,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeWallet">
    <!--@mbg.generated-->
    update se_wallet
    <set>
      <if test="clientid != null">
        clientId = #{clientid,jdbcType=BIGINT},
      </if>
      <if test="money != null">
        money = #{money,jdbcType=FLOAT},
      </if>
      <if test="createdt != null">
        createDt = #{createdt,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSe.SeWallet">
    <!--@mbg.generated-->
    update se_wallet
    set clientId = #{clientid,jdbcType=BIGINT},
      money = #{money,jdbcType=FLOAT},
      createDt = #{createdt,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeWalletRechargeHistoryMapper.xml
New file
@@ -0,0 +1,137 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dy.pipIrrGlobal.daoSe.SeWalletRechargeHistoryMapper">
  <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoSe.SeWalletRechargeHistory">
    <!--@mbg.generated-->
    <!--@Table se_wallet_recharge_history-->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="walletId" jdbcType="BIGINT" property="walletid" />
    <result column="clientId" jdbcType="BIGINT" property="clientid" />
    <result column="money" jdbcType="FLOAT" property="money" />
    <result column="amount" jdbcType="FLOAT" property="amount" />
    <result column="afterRecharge" jdbcType="FLOAT" property="afterrecharge" />
    <result column="rechargeDt" jdbcType="TIMESTAMP" property="rechargedt" />
    <result column="remarks" jdbcType="VARCHAR" property="remarks" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    id, walletId, clientId, money, amount, afterRecharge, rechargeDt, remarks
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    <!--@mbg.generated-->
    select
    <include refid="Base_Column_List" />
    from se_wallet_recharge_history
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    <!--@mbg.generated-->
    delete from se_wallet_recharge_history
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSe.SeWalletRechargeHistory">
    <!--@mbg.generated-->
    insert into se_wallet_recharge_history (id, walletId, clientId,
      money, amount, afterRecharge,
      rechargeDt, remarks)
    values (#{id,jdbcType=BIGINT}, #{walletid,jdbcType=BIGINT}, #{clientid,jdbcType=BIGINT},
      #{money,jdbcType=FLOAT}, #{amount,jdbcType=FLOAT}, #{afterrecharge,jdbcType=FLOAT},
      #{rechargedt,jdbcType=TIMESTAMP}, #{remarks,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeWalletRechargeHistory">
    <!--@mbg.generated-->
    insert into se_wallet_recharge_history
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="walletid != null">
        walletId,
      </if>
      <if test="clientid != null">
        clientId,
      </if>
      <if test="money != null">
        money,
      </if>
      <if test="amount != null">
        amount,
      </if>
      <if test="afterrecharge != null">
        afterRecharge,
      </if>
      <if test="rechargedt != null">
        rechargeDt,
      </if>
      <if test="remarks != null">
        remarks,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="walletid != null">
        #{walletid,jdbcType=BIGINT},
      </if>
      <if test="clientid != null">
        #{clientid,jdbcType=BIGINT},
      </if>
      <if test="money != null">
        #{money,jdbcType=FLOAT},
      </if>
      <if test="amount != null">
        #{amount,jdbcType=FLOAT},
      </if>
      <if test="afterrecharge != null">
        #{afterrecharge,jdbcType=FLOAT},
      </if>
      <if test="rechargedt != null">
        #{rechargedt,jdbcType=TIMESTAMP},
      </if>
      <if test="remarks != null">
        #{remarks,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeWalletRechargeHistory">
    <!--@mbg.generated-->
    update se_wallet_recharge_history
    <set>
      <if test="walletid != null">
        walletId = #{walletid,jdbcType=BIGINT},
      </if>
      <if test="clientid != null">
        clientId = #{clientid,jdbcType=BIGINT},
      </if>
      <if test="money != null">
        money = #{money,jdbcType=FLOAT},
      </if>
      <if test="amount != null">
        amount = #{amount,jdbcType=FLOAT},
      </if>
      <if test="afterrecharge != null">
        afterRecharge = #{afterrecharge,jdbcType=FLOAT},
      </if>
      <if test="rechargedt != null">
        rechargeDt = #{rechargedt,jdbcType=TIMESTAMP},
      </if>
      <if test="remarks != null">
        remarks = #{remarks,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSe.SeWalletRechargeHistory">
    <!--@mbg.generated-->
    update se_wallet_recharge_history
    set walletId = #{walletid,jdbcType=BIGINT},
      clientId = #{clientid,jdbcType=BIGINT},
      money = #{money,jdbcType=FLOAT},
      amount = #{amount,jdbcType=FLOAT},
      afterRecharge = #{afterrecharge,jdbcType=FLOAT},
      rechargeDt = #{rechargedt,jdbcType=TIMESTAMP},
      remarks = #{remarks,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeWalletRechargeMapper.xml
New file
@@ -0,0 +1,137 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dy.pipIrrGlobal.daoSe.SeWalletRechargeMapper">
  <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoSe.SeWalletRecharge">
    <!--@mbg.generated-->
    <!--@Table se_wallet_recharge-->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="walletId" jdbcType="BIGINT" property="walletid" />
    <result column="clientId" jdbcType="BIGINT" property="clientid" />
    <result column="money" jdbcType="FLOAT" property="money" />
    <result column="amount" jdbcType="FLOAT" property="amount" />
    <result column="afterRecharge" jdbcType="FLOAT" property="afterrecharge" />
    <result column="rechargeDt" jdbcType="TIMESTAMP" property="rechargedt" />
    <result column="remarks" jdbcType="VARCHAR" property="remarks" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    id, walletId, clientId, money, amount, afterRecharge, rechargeDt, remarks
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    <!--@mbg.generated-->
    select
    <include refid="Base_Column_List" />
    from se_wallet_recharge
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    <!--@mbg.generated-->
    delete from se_wallet_recharge
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSe.SeWalletRecharge">
    <!--@mbg.generated-->
    insert into se_wallet_recharge (id, walletId, clientId,
      money, amount, afterRecharge,
      rechargeDt, remarks)
    values (#{id,jdbcType=BIGINT}, #{walletid,jdbcType=BIGINT}, #{clientid,jdbcType=BIGINT},
      #{money,jdbcType=FLOAT}, #{amount,jdbcType=FLOAT}, #{afterrecharge,jdbcType=FLOAT},
      #{rechargedt,jdbcType=TIMESTAMP}, #{remarks,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeWalletRecharge">
    <!--@mbg.generated-->
    insert into se_wallet_recharge
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="walletid != null">
        walletId,
      </if>
      <if test="clientid != null">
        clientId,
      </if>
      <if test="money != null">
        money,
      </if>
      <if test="amount != null">
        amount,
      </if>
      <if test="afterrecharge != null">
        afterRecharge,
      </if>
      <if test="rechargedt != null">
        rechargeDt,
      </if>
      <if test="remarks != null">
        remarks,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="walletid != null">
        #{walletid,jdbcType=BIGINT},
      </if>
      <if test="clientid != null">
        #{clientid,jdbcType=BIGINT},
      </if>
      <if test="money != null">
        #{money,jdbcType=FLOAT},
      </if>
      <if test="amount != null">
        #{amount,jdbcType=FLOAT},
      </if>
      <if test="afterrecharge != null">
        #{afterrecharge,jdbcType=FLOAT},
      </if>
      <if test="rechargedt != null">
        #{rechargedt,jdbcType=TIMESTAMP},
      </if>
      <if test="remarks != null">
        #{remarks,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeWalletRecharge">
    <!--@mbg.generated-->
    update se_wallet_recharge
    <set>
      <if test="walletid != null">
        walletId = #{walletid,jdbcType=BIGINT},
      </if>
      <if test="clientid != null">
        clientId = #{clientid,jdbcType=BIGINT},
      </if>
      <if test="money != null">
        money = #{money,jdbcType=FLOAT},
      </if>
      <if test="amount != null">
        amount = #{amount,jdbcType=FLOAT},
      </if>
      <if test="afterrecharge != null">
        afterRecharge = #{afterrecharge,jdbcType=FLOAT},
      </if>
      <if test="rechargedt != null">
        rechargeDt = #{rechargedt,jdbcType=TIMESTAMP},
      </if>
      <if test="remarks != null">
        remarks = #{remarks,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSe.SeWalletRecharge">
    <!--@mbg.generated-->
    update se_wallet_recharge
    set walletId = #{walletid,jdbcType=BIGINT},
      clientId = #{clientid,jdbcType=BIGINT},
      money = #{money,jdbcType=FLOAT},
      amount = #{amount,jdbcType=FLOAT},
      afterRecharge = #{afterrecharge,jdbcType=FLOAT},
      rechargeDt = #{rechargedt,jdbcType=TIMESTAMP},
      remarks = #{remarks,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/PipIrrSellApplication.java
@@ -17,7 +17,7 @@
@EnableAspectJAutoProxy
@EnableMultiDataSource
@ComponentScan(basePackages = {"com.dy.common", "com.dy.pipIrrGlobal", "com.dy.pipIrrSell"})
@MapperScan(basePackages={"com.dy.pipIrrGlobal.daoSe"})
@MapperScan({"com.dy.pipIrrGlobal.daoSe", "com.dy.pipIrrGlobal.daoBa"})
public class PipIrrSellApplication {
    public static void main(String[] args) {
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/activeCard/ActiveCardCtrl.java
@@ -5,11 +5,15 @@
import com.dy.common.webUtil.BaseResponseUtils;
import com.dy.common.webUtil.QueryResultVo;
import com.dy.common.webUtil.ResultCodeMsg;
import com.dy.pipIrrGlobal.pojoSe.*;
import com.dy.pipIrrGlobal.pojoSe.SeActiveCard;
import com.dy.pipIrrGlobal.pojoSe.SeClientCard;
import com.dy.pipIrrGlobal.voBa.VoAreaCode;
import com.dy.pipIrrGlobal.voSe.VoActiveCard;
import com.dy.pipIrrSell.clientCard.CardStateENUM;
import com.dy.pipIrrSell.clientCard.ClientCardSv;
import com.dy.pipIrrSell.clientCard.LastOperateENUM;
import com.dy.pipIrrSell.recharge.DtoRecharge;
import com.dy.pipIrrSell.recharge.RechargeCtrl;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
@@ -25,11 +29,7 @@
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
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
@@ -46,6 +46,8 @@
public class ActiveCardCtrl {
    private final ActiveCardSv activeCardSv;
    private final ClientCardSv clientCardSv;
    private final RechargeCtrl rechargeCtrl;
    @Operation(summary = "获得一页开卡记录", description = "返回一页开卡数据")
    @ApiResponses(value = {
@@ -81,44 +83,85 @@
    @Transactional(rollbackFor = Exception.class)
    @SsoAop("-1")//@SsoAop(power = "-1")
    public BaseResponse<Boolean> add_active(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid DtoActiveCard 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());
        }
        /**
         * 获取5级行政区划串areaCode
         * provinceId   省级区划代码
         * cityId       市级区划代码
         * countryId    县级区划代码
         * townId       镇级区划代码
         * villageId    村级区划代码
         */
        VoAreaCode voAreaCode = activeCardSv.getAreaCodeByNum(po.getClientNum());
        if(voAreaCode == null) {
            return BaseResponseUtils.buildFail("该农户行政区划异常,请联系系统管理员");
        }
        String provinceId = voAreaCode.getProvinceId();
        String cityId = voAreaCode.getCityId();
        String countryId = voAreaCode.getCountryId();
        String townId = voAreaCode.getTownId();
        String villageId = voAreaCode.getVillageId();
        String areaCode = provinceId + cityId + countryId + townId + villageId;
        /**
         * 根据行政区划串(areaCode)在水卡表中针对水卡编号(cardNum)进行模糊查询
         * 如果4位顺序号已经达到最大值,提示用户联系系统管理员
         * 如果4位顺序号未达到最大值,则加1
         * cardNum为新的卡号
         */
        String cardNum = Optional.ofNullable(activeCardSv.getCardNumOfMax(areaCode)).orElse("");
        if(cardNum != null && cardNum.trim().length() > 0) {
            Integer number = Integer.parseInt(cardNum.substring(12));
            number = number + 1;
            if(number > 9999) {
                return BaseResponseUtils.buildFail("水卡编号已满,请联系系统管理员");
            }
            cardNum = cardNum.substring(0, 12) + String.format("%04d", number);
        } else {
            cardNum = areaCode + "0001";
        }
        /**
         * cardId           水卡编号(插入记录后生成)
         * cardAddr         水卡地址
         * clientId         农户编号
         * cardAddr         水卡地址(仅仅写入,无业务)
         * clientNum        农户编号
         * cardCost         卡片费用
         * amount           充值金额
         * reissueAmount    补卡金额,补卡时使用
         * paymentId        支付方式编号
         * remarks          备注
         * operator         操作人编号
         * activeTime       开卡时间
         */
        Long cardId = 0L;
        //Long cardId = 0L;
        String cardAddr = po.getCardAddr();
        Long clientId = po.getClientId();
        //Long clientId = po.getClientId();
        String clientNum = po.getClientNum();
        Integer cardCost = po.getCardCost();
        Float amount = po.getAmount();
        Long paymentId = po.getPaymentId();
        String remarks = po.getRemarks();
        Long operator = po.getOperator();
        Date activeTime = new Date();
        //LocalDateTime activeTime = LocalDateTime.parse(dtf.format(LocalDateTime.now()), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
        Date createTime = new Date();
        /**
         * 添加农户卡记录
         */
        SeClientCard clientCard = new SeClientCard();
        clientCard.setCardaddr(cardAddr);
        clientCard.setClientid(clientId);
        clientCard.setMoney(0.0);
        clientCard.setState(CardStateENUM.NORMAL.getCode());
        clientCard.setCreatedt(activeTime);
        clientCard.setLastoper(LastOperateENUM.ACTIVE.getCode());
        SeClientCard seClientCard = new SeClientCard();
        seClientCard.setCardaddr(cardAddr);
        //seClientCard.setClientid(clientId);
        seClientCard.setCardnum(cardNum);
        seClientCard.setClientnum(clientNum);
        seClientCard.setMoney(0.0);
        seClientCard.setState(CardStateENUM.NORMAL.getCode());
        seClientCard.setCreatedt(createTime);
        seClientCard.setLastoper(LastOperateENUM.ACTIVE.getCode());
        cardId = Optional.ofNullable(clientCardSv.add(clientCard)).orElse(0L) ;
        Long cardId = Optional.ofNullable(clientCardSv.add(seClientCard)).orElse(0L) ;
        if(cardId == 0) {
            return BaseResponseUtils.buildFail("开卡失败-农户卡写入异常");
        }
@@ -127,20 +170,37 @@
         * 添加开卡记录
         */
        SeActiveCard activeCard = new SeActiveCard();
        activeCard.setCardid(cardId);
        activeCard.setClientid(clientId);
        activeCard.setCardnum(cardNum);
        activeCard.setClientnum(clientNum);
        //activeCard.setCardid(cardId);
        //activeCard.setClientid(clientId);
        activeCard.setCardcost(cardCost);
        activeCard.setPaymentid(paymentId);
        activeCard.setOperatetype(OperateTypeENUM.ACTIVE.getCode());
        activeCard.setRemarks(remarks);
        activeCard.setOperator(operator);
        activeCard.setOperatedt(activeTime);
        activeCard.setOperatedt(createTime);
        Long rec = Optional.ofNullable(activeCardSv.add(activeCard)).orElse(0L);
        if(rec == 0) {
            return BaseResponseUtils.buildFail("开卡失败-开卡记录写入异常");
        }
        return BaseResponseUtils.buildSuccess(true) ;
        /**
         * 如果操作人员开卡时输入了充值金额,则开卡后调用充值功能
         */
        po.setCardNum(cardNum);
        if(amount != null && amount > 0) {
            DtoRecharge dtoRecharge = RechargeDtoMapper.INSTANCT.po2vo(po);
            dtoRecharge.setMoney(0f);
            dtoRecharge.setGift(0f);
            dtoRecharge.setPrice(0f);
            BaseResponse<Boolean> job = rechargeCtrl.addRecharge(dtoRecharge);
            if(!job.getCode().equals("0001")) {
                return BaseResponseUtils.buildFail("开卡成功,但充值失败");
            }
        }
        return BaseResponseUtils.buildSuccess(cardNum) ;
    }
    @Operation(summary = "补卡", description = "补卡")
@@ -156,15 +216,14 @@
    @Transactional(rollbackFor = Exception.class)
    @SsoAop("-1")//@SsoAop(power = "-1")
    public BaseResponse<Boolean> add_reissue(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid DtoActiveCard 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());
        }
        /**
         * cardId           水卡编号(非传入参数,由cardAddr反查)
         * cardAddr         水卡地址
         * clientId         农户编号
         * cardId           水卡编号(非传入参数,由cardNum反查,更新水卡表用)
         * cardNum          水卡编号
         * clientNum        农户编号(非传入参数,由cardNum反查,添加补卡使用)
         * cardCost         卡片费用
         * reissueAmount    补卡金额,补卡时使用
         * paymentId        支付方式编号
@@ -173,22 +232,25 @@
         * activeTime       补卡时间
         */
        Long cardId = 0L;
        String cardAddr = po.getCardAddr();
        Long clientId = po.getClientId();
        String cardNum = po.getCardNum();
        //String clientNum = po.getClientNum();
        String clientNum = "";
        Integer cardCost = po.getCardCost();
        Double reissueAmount = po.getReissueAmount();
        Long paymentId = po.getPaymentId();
        String remarks = po.getRemarks();
        Long operator = po.getOperator();
        Date activeTime = new Date();
        Date replaceTime = new Date();
        /**
         * 依据水卡地址获取水卡编号(主键)
         * 依据水卡编号获取水卡表主键及农户编号
         */
        cardId = Optional.ofNullable(clientCardSv.getCardIdByAddr(cardAddr)).orElse(0L);
        if(cardId == 0) {
        Map map = Optional.ofNullable(clientCardSv.getCardIdAndClientNum(cardNum)).orElse(new HashMap());
        if(map == null || map.size() <= 0) {
            return BaseResponseUtils.buildFail("卡号错误,该卡不存在");
        }
        cardId = Long.parseLong(map.get("cardId").toString());
        clientNum = map.get("clientNum").toString();
        /**
         * 修改农户卡信息:
@@ -197,7 +259,7 @@
         */
        SeClientCard seClientCard = new SeClientCard();
        seClientCard.setId(cardId);
        seClientCard.setReplacedt(activeTime);
        seClientCard.setReplacedt(replaceTime);
        seClientCard.setLastoper(LastOperateENUM.REPLACE.getCode());
        Integer rec_updateClientCard = Optional.ofNullable(clientCardSv.UpdateClientCard(seClientCard)).orElse(0);
        if(rec_updateClientCard == 0) {
@@ -208,15 +270,17 @@
         * 添加补卡记录
         */
        SeActiveCard activeCard = new SeActiveCard();
        activeCard.setCardid(cardId);
        activeCard.setClientid(clientId);
        activeCard.setCardnum(cardNum);
        activeCard.setClientnum(clientNum);
        //activeCard.setCardid(cardId);
        //activeCard.setClientid(clientId);
        activeCard.setCardcost(cardCost);
        activeCard.setPaymentid(paymentId);
        activeCard.setReissueamount(reissueAmount);
        activeCard.setOperatetype(OperateTypeENUM.REPLACE.getCode());
        activeCard.setRemarks(remarks);
        activeCard.setOperator(operator);
        activeCard.setOperatedt(activeTime);
        activeCard.setOperatedt(replaceTime);
        Long rec = Optional.ofNullable(activeCardSv.add(activeCard)).orElse(0L);
        if(rec == 0) {
            return BaseResponseUtils.buildFail("补卡失败-补卡记录写入异常");
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/activeCard/ActiveCardSv.java
@@ -1,8 +1,11 @@
package com.dy.pipIrrSell.activeCard;
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pipIrrGlobal.daoBa.BaClientMapper;
import com.dy.pipIrrGlobal.daoSe.SeActiveCardMapper;
import com.dy.pipIrrGlobal.daoSe.SeClientCardMapper;
import com.dy.pipIrrGlobal.pojoSe.SeActiveCard;
import com.dy.pipIrrGlobal.voBa.VoAreaCode;
import com.dy.pipIrrGlobal.voSe.VoActiveCard;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.common.utils.PojoUtils;
@@ -26,6 +29,12 @@
public class ActiveCardSv {
    @Autowired
    private SeActiveCardMapper seActiveCardMapper;
    @Autowired
    private SeClientCardMapper seClientCardMapper;
    @Autowired
    private BaClientMapper baClientMapper;
    public QueryResultVo<List<VoActiveCard>> getActiveCards(QueryVo queryVo) {
        //完善查询开卡记录的起止时间
@@ -59,4 +68,22 @@
        seActiveCardMapper.insert(po);
        return po.getId();
    }
    /**
     * 根据农户编号获取5级行政区划代码
     * @param clientNum 农户编号
     * @return 5级行政区划代码
     */
    public VoAreaCode getAreaCodeByNum(String clientNum) {
        return baClientMapper.getAreaCodeByNum(clientNum);
    }
    /**
     * 根据行政区划串模块查询水卡编号
     * @param areaCode
     * @return
     */
    String getCardNumOfMax(String areaCode) {
        return seClientCardMapper.getCardNumOfMax(areaCode);
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/activeCard/DtoActiveCard.java
@@ -24,15 +24,30 @@
     * 水卡地址
     */
    @Schema(description = "水卡地址", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotBlank
    @NotBlank(message = "水卡地址不能为空")
    private String cardAddr;
    /**
     * 农户ID
     * 农户编号
     * 开卡时使用
     */
    @Schema(description = "农户ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Positive(message = "农户ID必须为大于0的整数")
    private Long clientId;
    @Schema(description = "农户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private String clientNum;
    /**
     * 农户ID(主键)
     * 废弃,改用clientNum
     */
    //@Schema(description = "农户ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    //@Positive(message = "农户ID必须为大于0的整数")
    //private Long clientId;
    /**
     * 水卡编号
     * 补卡时使用
     */
    @Schema(description = "水卡编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private String cardNum;
    /**
     * 卡片费用
@@ -42,6 +57,13 @@
    private Integer cardCost;
    /**
     * 充值金额
     */
    @Schema(description = "充值金额", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Min(value = 0, message="充值金额不能小于0")
    private Float amount;
    /**
     * 补卡金额
     */
    @Schema(description = "补卡金额", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/activeCard/QueryVo.java
@@ -29,7 +29,8 @@
    public String clientName;
    @Schema(description = "IC卡号")
    public String cardAddr;
    //public String cardAddr;
    public String cardNum;
    @Schema(description = "卡片状态")
    private Byte state;
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/activeCard/RechargeDtoMapper.java
New file
@@ -0,0 +1,28 @@
package com.dy.pipIrrSell.activeCard;
import com.dy.pipIrrSell.recharge.DtoRecharge;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;
/**
 * @author ZhuBaoMin
 * @date 2023/12/15 13:34
 * @LastEditTime 2023/12/15 13:34
 * @Description 将DtoActiveCard映射为DtoRecharge
 */
@Mapper
public interface RechargeDtoMapper {
    RechargeDtoMapper INSTANCT = Mappers.getMapper(RechargeDtoMapper.class);
    //@Mapping(target = "cardAddr", source = "cardAddr")
    //@Mapping(target = "clientId", source = "clientId")
    @Mapping(target = "cardNum", source = "cardNum")
    @Mapping(target = "clientNum", source = "clientNum")
    @Mapping(target = "amount", source = "amount")
    @Mapping(target = "paymentId", source = "paymentId")
    @Mapping(target = "remarks", source = "remarks")
    @Mapping(target = "operator", source = "operator")
    DtoRecharge po2vo(DtoActiveCard po);
}
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/clientCard/ClientCardSv.java
@@ -6,6 +6,8 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Map;
/**
 * @author ZhuBaoMin
 * @date 2023/12/7 9:18
@@ -30,7 +32,7 @@
    }
    /**
     * 依据水卡地址获取水卡编号(主键)
     * 依据水卡地址获取水卡编号(12月19日废弃)
     * @param cardAddr
     * @return
     */
@@ -39,6 +41,23 @@
    }
    /**
     * 根据水卡编号获取水卡表主键(12月19日添加后废弃)
     * @param cardNum 16位水卡编号
     * @return 水卡表主键
     */
    public Long getCardIdByNum(String cardNum) {
        return seClientCardMapper.getCardIdByNum(cardNum);
    }
    /**
     * 根据水卡编号获取水卡表主键及农户编号
     * @param cardNum
     * @return
     */
    public Map getCardIdAndClientNum(String cardNum) {
        return seClientCardMapper.getCardIdAndClientNum(cardNum);
    }
    /**
     * 根据水卡编号(主键)修改农户卡信息
     * @param po
     * @return
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/recharge/DtoRecharge.java
@@ -27,13 +27,15 @@
     */
    @Schema(description = "水卡地址", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotBlank
    private String cardAddr;
    //private String cardAddr;
    private String cardNum;
    /**
     * 农户编号
     */
    @Schema(description = "农户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Long clientId;
    //private Long clientId;
    private String clientNum;
    /**
     * 卡片余额
@@ -59,9 +61,9 @@
    /**
     * 充值后余额
     */
    @Schema(description = "充值后余额", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Min(value = 0, message="充值后余额不能小于0")
    private Float afterRecharge;
    //@Schema(description = "充值后余额", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    //@Min(value = 0, message="充值后余额不能小于0")
    //private Float afterRecharge;
    /**
     * 付款方式编号
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/recharge/QueryVo.java
@@ -24,6 +24,9 @@
    @Schema(description = "农户姓名")
    public String clientName;
    @Schema(description = "农户编号")
    private Long clientId;
    @Schema(description = "IC卡号")
    public String cardAddr;
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/recharge/RechargeCtrl.java
@@ -5,7 +5,9 @@
import com.dy.common.webUtil.BaseResponseUtils;
import com.dy.common.webUtil.QueryResultVo;
import com.dy.common.webUtil.ResultCodeMsg;
import com.dy.pipIrrGlobal.pojoSe.*;
import com.dy.pipIrrGlobal.pojoSe.SeClientCard;
import com.dy.pipIrrGlobal.pojoSe.SeRecharge;
import com.dy.pipIrrGlobal.pojoSe.SeRechargeHistory;
import com.dy.pipIrrGlobal.voSe.VoRecharge;
import com.dy.pipIrrSell.clientCard.ClientCardSv;
import com.dy.pipIrrSell.clientCard.LastOperateENUM;
@@ -24,11 +26,7 @@
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.*;
@Slf4j
@Tag(name = "充值管理", description = "充值操作")
@@ -73,15 +71,22 @@
    @Transactional(rollbackFor = Exception.class)
    @SsoAop("-1")//@SsoAop(power = "-1")
    public BaseResponse<Boolean> add(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid DtoRecharge 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());
        }
        return addRecharge(po);
    }
    /**
     * 添加充值记录
     * @param po
     * @return
     */
    public BaseResponse<Boolean> addRecharge(DtoRecharge po){
        /**
         * cardId           水卡编号(非传入参数,由cardAddr反查)
         * cardAddr         水卡地址
         * clientId         农户编号
         * cardId           水卡编号(插入记录后生成)
         * cardAddr         水卡地址(仅仅写入,无业务)
         * clientNum        农户编号(非传入参数,由cardNum反查,添加充值使用)
         * money            卡片余额
         * amount           充值金额
         * gift             赠送金额
@@ -93,12 +98,15 @@
         * rechargeTime     充值时间
         */
        Long cardId = 0L;
        String cardAddr = po.getCardAddr();
        Long clientId = po.getClientId();
        //String cardAddr = po.getCardAddr();
        //Long clientId = po.getClientId();
        String cardNum = po.getCardNum();
        //String clientNum = po.getClientNum();
        String clientNum = "";
        Float money = po.getMoney();
        Float amount = po.getAmount();
        Float gift = po.getGift();
        Float afterRecharge = po.getAfterRecharge();
        Float afterRecharge = money + amount + gift;
        Long paymentId = po.getPaymentId();
        Float price = po.getPrice();
        String remarks = po.getRemarks();
@@ -106,12 +114,14 @@
        Date rechargeTime = new Date();
        /**
         * 依据水卡地址获取水卡编号(主键)
         * 依据水卡编号获取水卡表主键及农户编号
         */
        cardId = Optional.ofNullable(clientCardSv.getCardIdByAddr(cardAddr)).orElse(0L);
        if(cardId == 0) {
        Map map = Optional.ofNullable(clientCardSv.getCardIdAndClientNum(cardNum)).orElse(new HashMap());
        if(map == null || map.size() <= 0) {
            return BaseResponseUtils.buildFail("卡号错误,该卡不存在");
        }
        cardId = Long.parseLong(map.get("cardId").toString());
        clientNum = map.get("clientNum").toString();
        /**
         * 修改农户卡信息:
@@ -130,13 +140,15 @@
        /**
         * 删除充值表该卡的充值记录
         */
        Integer rec_deleteRecharge = Optional.ofNullable(rechargeSv.deleteByCardId(cardId)).orElse(0);
        Integer rec_deleteRecharge = Optional.ofNullable(rechargeSv.deleteByCardNum(cardNum)).orElse(0);
        /**
         * 添加充值记录
         */
        SeRecharge seRecharge = new SeRecharge();
        seRecharge.setCardid(cardId);
        seRecharge.setClientid(clientId);
        //seRecharge.setCardid(cardId);
        //seRecharge.setClientid(clientId);
        seRecharge.setCardnum(cardNum);
        seRecharge.setClientnum(clientNum);
        seRecharge.setMoney(money);
        seRecharge.setAmount(amount);
        seRecharge.setGift(gift);
@@ -155,8 +167,10 @@
         * 添加补卡历史记录
         */
        SeRechargeHistory seRechargeHistory = new SeRechargeHistory();
        seRechargeHistory.setCardid(cardId);
        seRechargeHistory.setClientid(clientId);
        //seRechargeHistory.setCardid(cardId);
        //seRechargeHistory.setClientid(clientId);
        seRechargeHistory.setCardnum(cardNum);
        seRechargeHistory.setClientnum(clientNum);
        seRechargeHistory.setMoney(money);
        seRechargeHistory.setAmount(amount);
        seRechargeHistory.setGift(gift);
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/recharge/RechargeSv.java
@@ -66,9 +66,9 @@
     * @param cardId
     * @return
     */
    public Integer deleteByPrimaryKey(Long cardId) {
        return seRechargeMapper.deleteByPrimaryKey(cardId);
    }
    //public Integer deleteByPrimaryKey(Long cardId) {
    //    return seRechargeMapper.deleteByPrimaryKey(cardId);
    //}
    /**
     * 添加充值记录
@@ -82,11 +82,14 @@
    /**
     * 根据水卡编号删除充值记录
     * @param cardId
     * @param cardNum
     * @return
     */
    public Integer deleteByCardId(Long cardId) {
        return seRechargeMapper.deleteByCardId(cardId);
    //public Integer deleteByCardId(Long cardId) {
    //    return seRechargeMapper.deleteByCardId(cardId);
    //}
    public Integer deleteByCardNum(String cardNum) {
        return seRechargeMapper.deleteByCardNum(cardNum);
    }
    /**
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wallet/DtoWallet.java
New file
@@ -0,0 +1,29 @@
package com.dy.pipIrrSell.wallet;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.*;
/**
 * @author ZhuBaoMin
 * @date 2023/12/11 17:28
 * @LastEditTime 2023/12/11 17:28
 * @Description
 */
@Data
@Builder
@ToString
@NoArgsConstructor
@AllArgsConstructor
@Schema(name = "注册电子钱包传入对象")
public class DtoWallet {
    public static final long serialVersionUID = 1L;
    /**
     * 农户编号
     */
    @Schema(description = "农户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotNull(message = "农户编号不能为空")
    private Long clientId;
}
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wallet/DtoWalletRecharge.java
New file
@@ -0,0 +1,50 @@
package com.dy.pipIrrSell.wallet;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import lombok.*;
/**
 * @author ZhuBaoMin
 * @date 2023/12/12 11:46
 * @LastEditTime 2023/12/12 11:46
 * @Description
 */
@Data
@Builder
@ToString
@NoArgsConstructor
@AllArgsConstructor
@Schema(name = "电子钱包充值传入对象")
public class DtoWalletRecharge {
    public static final long serialVersionUID = 1L;
    /**
     * 钱包编号
     */
    @Schema(description = "钱包编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotNull(message = "钱包编号不能为空")
    private Long walletId;
    /**
     * 农户编号
     */
    @Schema(description = "农户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotNull(message = "农户编号不能为空")
    private Long clientId;
    /**
     * 充值金额
     */
    @Schema(description = "充值金额", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Min(value = 0, message="充值金额不能小于0")
    private Float amount;
    /**
     * 备注信息
     */
    @Schema(description = "备注", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private String remarks;
}
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wallet/WalletCtrl.java
New file
@@ -0,0 +1,105 @@
package com.dy.pipIrrSell.wallet;
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.pojoSe.SeWallet;
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.constraints.NotNull;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
import java.util.Optional;
/**
 * @author ZhuBaoMin
 * @date 2023/12/11 16:36
 * @LastEditTime 2023/12/11 16:36
 * @Description
 */
@Slf4j
@Tag(name = "电子钱包管理", description = "电子钱包管理")
@RestController
@RequestMapping(path="wallet")
@RequiredArgsConstructor
@Validated
public class WalletCtrl {
    private final WalletSv walletSv;
    @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")
    @Transactional(rollbackFor = Exception.class)
    @SsoAop("-1")//@SsoAop(power = "-1")
    //public BaseResponse<Boolean> add(@RequestBody Long clientId){
    public BaseResponse<Boolean> add(@RequestParam("clientId") @NotNull(message = "农户编号不能为空") Long clientId){
        if(clientId == null || clientId < 0) {
            return BaseResponseUtils.buildFail("农户编号不能为空");
        }
        SeWallet seWallet = new SeWallet();
        seWallet.setClientid(clientId);
        seWallet.setMoney(0f);
        seWallet.setCreatedt(new Date());
        Integer rec = Optional.ofNullable(walletSv.add(seWallet)).orElse(0);
        if(rec == 0) {
            return BaseResponseUtils.buildFail("注册电子钱包-电子钱包记录写入异常");
        }
        return BaseResponseUtils.buildSuccess(true) ;
    }
    //@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 = "addRecharge")
    //@Transactional(rollbackFor = Exception.class)
    //@SsoAop("-1")//@SsoAop(power = "-1")
    //public BaseResponse<Boolean> addRecharge(@RequestBody @Parameter(description = "form表单json数据", required = true) @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());
    //    }
    //
    //
    //
    //    SeWallet seWallet = new SeWallet();
    //    seWallet.setClientid(clientId);
    //    seWallet.setMoney(0f);
    //    seWallet.setCreatedt(new Date());
    //    Integer rec = Optional.ofNullable(walletSv.add(seWallet)).orElse(0);
    //    if(rec == 0) {
    //        return BaseResponseUtils.buildFail("注册电子钱包-电子钱包记录写入异常");
    //    }
    //
    //    return BaseResponseUtils.buildSuccess(true) ;
    //}
}
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wallet/WalletSv.java
New file
@@ -0,0 +1,79 @@
package com.dy.pipIrrSell.wallet;
import com.dy.pipIrrGlobal.daoSe.SeWalletMapper;
import com.dy.pipIrrGlobal.daoSe.SeWalletRechargeHistoryMapper;
import com.dy.pipIrrGlobal.daoSe.SeWalletRechargeMapper;
import com.dy.pipIrrGlobal.pojoSe.SeWallet;
import com.dy.pipIrrGlobal.pojoSe.SeWalletRechargeHistory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
 * @author ZhuBaoMin
 * @date 2023/12/11 16:36
 * @LastEditTime 2023/12/11 16:36
 * @Description
 */
@Slf4j
@Service
public class WalletSv {
    @Autowired
    private SeWalletMapper seWalletMapper;
    @Autowired
    private SeWalletRechargeMapper seWalletRechargeMapper;
    @Autowired
    private SeWalletRechargeHistoryMapper seWalletRechargeHistoryMapper;
    /**
     * 注册电子钱包账号
     * @param po
     * @return
     */
    public Integer add(SeWallet po) {
        return seWalletMapper.insert(po);
    }
    /**
     * 根据编号从钱包表中获取该钱包余额
     * @param id
     * @return
     */
    public Float getMoneyById(Long id) {
        SeWallet po = seWalletMapper.selectByPrimaryKey(id);
        return po.getMoney();
    }
    /**
     * 根据钱包编号修改钱包余额
     * @param id 钱包编号(主键)
     * @param money 钱包余额
     * @return 修改记录数量
     */
    public Integer updateMoneyById(Long id, Float money) {
        SeWallet po = seWalletMapper.selectByPrimaryKey(id);
        po.setMoney(money);
        return seWalletMapper.updateByPrimaryKey(po);
    }
    /**
     * 根据id删除充值记录
     * @param id
     * @return
     */
    public Integer deleteWallerRechargeById(Long id) {
        return seWalletMapper.deleteByPrimaryKey(id);
    }
    /**
     * 将充值记录添加到充值历史表
     * @param po 充值历史实体
     * @return
     */
    public Integer addWallerRechargeHistory(SeWalletRechargeHistory po) {
        return seWalletRechargeHistoryMapper.insert(po);
    }
}