Administrator
2023-12-23 02fe533245eb42140b98e55eec7cfab673e2bd44
2023-12-23 朱宝民 开卡、补卡、充值重构,开卡/补卡记录查询改为参数传递
22个文件已修改
559 ■■■■■ 已修改文件
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeActiveCardMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeClientCardMapper.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeClientMapper.java 20 ●●●●● 补丁 | 查看 | 原始文档 | 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 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeActiveCard.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeClientCard.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeRecharge.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeRechargeHistory.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeActiveCardMapper.xml 75 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeClientCardMapper.xml 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeClientMapper.xml 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeRechargeHistoryMapper.xml 38 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeRechargeMapper.xml 65 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/activeCard/ActiveCardCtrl.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/activeCard/ActiveCardSv.java 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/activeCard/DtoActiveCard.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/activeCard/QueryVo.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/activeCard/RechargeDtoMapper.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/recharge/DtoRecharge.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/recharge/RechargeCtrl.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/recharge/RechargeSv.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeActiveCardMapper.java
@@ -10,8 +10,8 @@
/**
 * @author ZhuBaoMin
 * @date 2023/12/18 16:58
 * @LastEditTime 2023/12/18 16:58
 * @date 2023/12/22 16:26
 * @LastEditTime 2023/12/22 16:26
 * @Description
 */
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeClientCardMapper.java
@@ -9,8 +9,8 @@
/**
 * @author ZhuBaoMin
 * @date 2023/12/18 16:26
 * @LastEditTime 2023/12/18 16:26
 * @date 2023/12/22 16:04
 * @LastEditTime 2023/12/22 16:04
 * @Description
 */
@@ -55,4 +55,5 @@
     * @return
     */
    Map getCardIdAndClientNum(@Param("cardNum") String cardNum);
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeClientMapper.java
@@ -1,7 +1,9 @@
package com.dy.pipIrrGlobal.daoSe;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dy.pipIrrGlobal.pojoSe.SeClient;
import com.dy.pipIrrGlobal.voSe.VoClient;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -13,7 +15,9 @@
 * @LastEditTime 2023/12/22 9:50
 * @Description
 */
public interface SeClientMapper {
@Mapper
public interface SeClientMapper extends BaseMapper<SeClient> {
    int deleteByPrimaryKey(Long id);
    int insert(SeClient record);
@@ -34,6 +38,20 @@
    String getClientNumOfMax(@Param("district8") String district8);
    /**
     * 根据农户编号获取5级行政区划代码
     * @param clientNum 农户编号
     * @return 5级行政区划代码
     */
    Long getAreaCodeByNum(@Param("clientNum") String clientNum);
    /**
     * 根据农户编号获取农户ID
     * @param clientNum
     * @return
     */
    Long getClientIdByNum(@Param("clientNum") String clientNum);
    /**
     * 根据指定条件获取农户记录数
     * @param params
     * @return
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeRechargeHistoryMapper.java
@@ -6,8 +6,8 @@
/**
 * @author ZhuBaoMin
 * @date 2023/12/19 10:35
 * @LastEditTime 2023/12/19 10:35
 * @date 2023/12/23 8:47
 * @LastEditTime 2023/12/23 8:47
 * @Description
 */
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeRechargeMapper.java
@@ -11,8 +11,8 @@
/**
 * @author ZhuBaoMin
 * @date 2023/12/19 10:18
 * @LastEditTime 2023/12/19 10:18
 * @date 2023/12/23 8:47
 * @LastEditTime 2023/12/23 8:47
 * @Description
 */
@@ -30,6 +30,11 @@
    int updateByPrimaryKey(SeRecharge record);
    /**
     * 根据指定的条件获取充值记录
     * @param params
     * @return
     */
    Long getRecordCount(Map<?, ?> params);
    /**
@@ -40,10 +45,11 @@
    List<VoRecharge> getRecharges(Map<?, ?> params);
    /**
     * 根据水卡编号删除充值记录
     * @param cardNum
     * 根据水卡ID删除充值记录
     * @param cardId
     * @return
     */
    //Integer deleteByCardId(@Param("cardId") Long cardId);
    Integer deleteByCardNum(@Param("cardNum") String cardNum);
    //Integer deleteByCardNum(@Param("cardNum") String cardNum);
    Integer deleteByCardId(@Param("cardId") Long cardId);
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeActiveCard.java
@@ -7,10 +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.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Positive;
import jakarta.validation.constraints.*;
import lombok.*;
import org.hibernate.validator.constraints.Length;
@@ -48,16 +45,30 @@
    /**
     * 水卡编号
     */
    @Schema(description = "水卡编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotBlank(message = "水卡编号不能为空")
    private String cardnum;
    //@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)
    //@NotBlank(message = "农户编号不能为空")
    //private String clientnum;
    /**
     * 水卡ID;水卡主键
     */
    @Schema(description = "水卡ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotNull(message = "水卡ID不能为空")
    private Long cardid;
    /**
     * 农户ID;农户主键
     */
    @Schema(description = "农户ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotNull(message = "农户ID不能为空")
    private Long clientid;
    /**
     * 卡片费用
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeClientCard.java
@@ -59,11 +59,11 @@
    private String cardnum;
    /**
     * 农户编号
     * 农户ID
     */
    @Schema(description = "农户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotBlank(message = "农户编号不能为空")
    private String clientnum;
    @Schema(description = "农户ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotBlank(message = "农户ID不能为空")
    private Long clientid;
    /**
     * 余额
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeRecharge.java
@@ -7,7 +7,6 @@
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.*;
@@ -39,18 +38,22 @@
    private Long id;
    /**
     * 水卡编号
     * 水卡ID
     */
    @Schema(description = "水卡编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotBlank(message = "水卡编号不能为空")
    private String cardnum;
    @Schema(description = "水卡ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    //@NotBlank(message = "水卡ID不能为空")
    //private String cardnum;
    @NotNull(message = "水卡ID不能为空")
    private Long cardid;
    /**
     * 农户编号
     * 农户ID
     */
    @Schema(description = "农户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotBlank(message = "农户编号不能为空")
    private String clientnum;
    @Schema(description = "农户ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    //@NotBlank(message = "农户ID不能为空")
    //private String clientnum;
    @NotNull(message = "农户ID不能为空")
    private Long clientid;
    /**
     * 卡片余额
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeRechargeHistory.java
@@ -7,7 +7,6 @@
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.*;
@@ -45,18 +44,22 @@
    private Long id;
    /**
     * 水卡编号
     * 水卡ID
     */
    @Schema(description = "水卡编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotBlank(message = "水卡编号不能为空")
    private String cardnum;
    @Schema(description = "水卡ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    //@NotBlank(message = "水卡ID不能为空")
    //private String cardnum;
    @NotNull(message = "水卡ID不能为空")
    private Long cardid;
    /**
     * 农户编号
     * 农户ID
     */
    @Schema(description = "农户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotBlank(message = "农户编号不能为空")
    private String clientnum;
    @Schema(description = "农户ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    //@NotBlank(message = "农户ID不能为空")
    //private String clientnum;
    @NotNull(message = "农户ID不能为空")
    private Long clientid;
    /**
     * 卡片余额
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="cardNum" jdbcType="VARCHAR" property="cardnum" />
    <result column="clientNum" jdbcType="VARCHAR" property="clientnum" />
    <result column="cardId" jdbcType="BIGINT" property="cardid" />
    <result column="clientId" jdbcType="BIGINT" property="clientid" />
    <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, cardNum, clientNum, cardCost, paymentId, reissueAmount, operateType, remarks,
    `operator`, operateDt
    id, cardId, clientId, cardCost, paymentId, reissueAmount, operateType, remarks, `operator`,
    operateDt
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    <!--@mbg.generated-->
@@ -33,30 +33,27 @@
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSe.SeActiveCard">
  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeActiveCard">
    <!--@mbg.generated-->
    insert into se_active_card (id, cardNum, clientNum, cardCost, paymentId, reissueAmount, operateType, remarks, `operator`, operateDt)
    values (#{id,jdbcType=BIGINT},
    #{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 into se_active_card (id, cardId, clientId, 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}
      )
  </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="cardnum != null">
        cardNum,
      <if test="cardid != null">
        cardId,
      </if>
      <if test="clientnum != null">
        clientNum,
      <if test="clientid != null">
        clientId,
      </if>
      <if test="cardcost != null">
        cardCost,
@@ -81,11 +78,11 @@
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="cardnum != null">
        #{cardnum,jdbcType=VARCHAR},
      <if test="cardid != null">
        #{cardid,jdbcType=BIGINT},
      </if>
      <if test="clientnum != null">
        #{clientnum,jdbcType=VARCHAR},
      <if test="clientid != null">
        #{clientid,jdbcType=BIGINT},
      </if>
      <if test="cardcost != null">
        #{cardcost,jdbcType=INTEGER},
@@ -114,11 +111,11 @@
    <!--@mbg.generated-->
    update se_active_card
    <set>
      <if test="cardnum != null">
        cardNum = #{cardnum,jdbcType=VARCHAR},
      <if test="cardid != null">
        cardId = #{cardid,jdbcType=BIGINT},
      </if>
      <if test="clientnum != null">
        clientNum = #{clientnum,jdbcType=VARCHAR},
      <if test="clientid != null">
        clientId = #{clientid,jdbcType=BIGINT},
      </if>
      <if test="cardcost != null">
        cardCost = #{cardcost,jdbcType=INTEGER},
@@ -147,8 +144,8 @@
  <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSe.SeActiveCard">
    <!--@mbg.generated-->
    update se_active_card
    set cardNum = #{cardnum,jdbcType=VARCHAR},
      clientNum = #{clientnum,jdbcType=VARCHAR},
    set cardId = #{cardid,jdbcType=BIGINT},
      clientId = #{clientid,jdbcType=BIGINT},
      cardCost = #{cardcost,jdbcType=INTEGER},
      paymentId = #{paymentid,jdbcType=BIGINT},
      reissueAmount = #{reissueamount,jdbcType=DOUBLE},
@@ -164,9 +161,9 @@
    SELECT
        COUNT(*) AS recordCount
    FROM se_active_card act
      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
    INNER JOIN se_client cli ON act.clientId = cli.id
    INNER JOIN se_client_card card ON act.cardId = card.id
    , (SELECT @i:=0) AS itable
    <where>
      <if test = "operateType != null and operateType > 0">
        AND act.operateType = ${operateType}
@@ -195,13 +192,13 @@
    SELECT
        (@i:=@i+1) AS id,
        cli.`name` AS clientName,
        cli.num AS clientNum,
        cli.clientNum,
        card.cardNum,
        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,
@@ -209,8 +206,8 @@
        (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.clientNum = cli.num
        INNER JOIN se_client_card card ON act.cardNum = card.cardNum
        INNER JOIN se_client cli ON act.clientId = cli.id
        INNER JOIN se_client_card card ON act.cardId = card.id
        , (SELECT @i:=0) AS itable
    <where>
      <if test = "operateType != null and operateType > 0">
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeClientCardMapper.xml
@@ -6,8 +6,8 @@
    <!--@Table se_client_card-->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="cardAddr" jdbcType="VARCHAR" property="cardaddr" />
    <result column="cardNum" jdbcType="VARCHAR" property="cardnum" />
    <result column="clientNum" jdbcType="VARCHAR" property="clientnum" />
    <result column="cardNum" jdbcType="BIGINT" property="cardnum" />
    <result column="clientId" jdbcType="BIGINT" property="clientid" />
    <result column="money" jdbcType="FLOAT" property="money" />
    <result column="state" jdbcType="TINYINT" property="state" />
    <result column="createDt" jdbcType="TIMESTAMP" property="createdt" />
@@ -23,7 +23,7 @@
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    id, cardAddr, cardNum, clientNum, money, `state`, createDt, replaceDt, rechargeDt,
    id, cardAddr, cardNum, clientId, money, `state`, createDt, replaceDt, rechargeDt,
    lossDtDt, cancelDt, unlockDt, reversalDt, consumeDt, lastOper, remarks
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
@@ -51,11 +51,18 @@
  <!--根据水卡编号获取水卡表主键及农户编号-->
  <select id="getCardIdAndClientNum" resultType="java.util.Map">
    SELECT id AS cardId, clientNum FROM se_client_card WHERE cardNum = #{cardNum}
<!--    SELECT id AS cardId, clientNum FROM se_client_card WHERE cardNum = #{cardNum}-->
    SELECT
        card.id AS cardId,
        cli.clientNum,
        cli.id AS clientId
    FROM se_client_card card
        INNER JOIN se_client cli ON card.clientId = cli.id
    WHERE card.cardNum = #{cardNum}
  </select>
  <!--根据行政区划串模块查询水卡编号-->
  <!--根据行政区划串模糊查询水卡编号-->
  <select id="getCardNumOfMax"  resultType="java.lang.String">
    SELECT cardNum
    FROM se_client_card
@@ -64,23 +71,22 @@
    LIMIT 0,1
  </select>
  <!--添加水卡记录-->
  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClientCard" useGeneratedKeys="true">
  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClientCard">
    <!--@mbg.generated-->
    insert into se_client_card (id, cardAddr, cardNum, clientNum,
      money, `state`, createDt,
      replaceDt, rechargeDt, lossDtDt,
      cancelDt, unlockDt, reversalDt,
    insert into se_client_card (id, cardAddr, cardNum, clientId,
      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},
    values (#{id,jdbcType=BIGINT}, #{cardaddr,jdbcType=VARCHAR}, #{cardnum,jdbcType=BIGINT}, #{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>
  </insert>
  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClientCard" useGeneratedKeys="true">
    <!--@mbg.generated-->
    insert into se_client_card
@@ -91,8 +97,8 @@
      <if test="cardnum != null">
        cardNum,
      </if>
      <if test="clientnum != null">
        clientNum,
      <if test="clientid != null">
        clientId,
      </if>
      <if test="money != null">
        money,
@@ -136,10 +142,10 @@
        #{cardaddr,jdbcType=VARCHAR},
      </if>
      <if test="cardnum != null">
        #{cardnum,jdbcType=VARCHAR},
        #{cardnum,jdbcType=BIGINT},
      </if>
      <if test="clientnum != null">
        #{clientnum,jdbcType=VARCHAR},
      <if test="clientid != null">
        #{clientid,jdbcType=BIGINT},
      </if>
      <if test="money != null">
        #{money,jdbcType=FLOAT},
@@ -187,10 +193,10 @@
        cardAddr = #{cardaddr,jdbcType=VARCHAR},
      </if>
      <if test="cardnum != null">
        cardNum = #{cardnum,jdbcType=VARCHAR},
        cardNum = #{cardnum,jdbcType=BIGINT},
      </if>
      <if test="clientnum != null">
        clientNum = #{clientnum,jdbcType=VARCHAR},
      <if test="clientid != null">
        clientId = #{clientid,jdbcType=BIGINT},
      </if>
      <if test="money != null">
        money = #{money,jdbcType=FLOAT},
@@ -235,8 +241,8 @@
    <!--@mbg.generated-->
    update se_client_card
    set cardAddr = #{cardaddr,jdbcType=VARCHAR},
      cardNum = #{cardnum,jdbcType=VARCHAR},
      clientNum = #{clientnum,jdbcType=VARCHAR},
      cardNum = #{cardnum,jdbcType=BIGINT},
      clientId = #{clientid,jdbcType=BIGINT},
      money = #{money,jdbcType=FLOAT},
      `state` = #{state,jdbcType=TINYINT},
      createDt = #{createdt,jdbcType=TIMESTAMP},
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeClientMapper.xml
@@ -337,4 +337,14 @@
      LIMIT ${pageCurr}, ${pageSize}
    </if>
  </select>
  <!--根据农户编号获取5级行政区划代码-->
  <select id="getAreaCodeByNum" resultType="java.lang.Long">
    SELECT districtNum FROM se_client WHERE clientNum = ${clientNum}
  </select>
  <!--根据农户编号获取农户ID-->
  <select id="getClientIdByNum" resultType="java.lang.Long">
    SELECT id FROM se_client WHERE clientNum = ${clientNum}
  </select>
</mapper>
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="cardNum" jdbcType="VARCHAR" property="cardnum" />
    <result column="clientNum" jdbcType="VARCHAR" property="clientnum" />
    <result column="cardId" jdbcType="BIGINT" property="cardid" />
    <result column="clientId" jdbcType="BIGINT" property="clientid" />
    <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, cardNum, clientNum, money, amount, gift, afterRecharge, paymentId, price, remarks,
    id, cardId, clientId, money, amount, gift, afterRecharge, paymentId, price, remarks,
    `operator`, operateDt
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
@@ -37,11 +37,11 @@
  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeRechargeHistory">
    <!--@mbg.generated-->
    insert into se_recharge_history (id, cardNum, clientNum, money,
    insert into se_recharge_history (id, cardId, clientId, money,
      amount, gift, afterRecharge, 
      paymentId, price, remarks, 
      `operator`, operateDt)
    values (#{id,jdbcType=BIGINT}, #{cardnum,jdbcType=VARCHAR}, #{clientnum,jdbcType=VARCHAR}, #{money,jdbcType=FLOAT},
    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})
@@ -51,11 +51,11 @@
    <!--@mbg.generated-->
    insert into se_recharge_history
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="cardnum != null">
        cardNum,
      <if test="cardid != null">
        cardId,
      </if>
      <if test="clientnum != null">
        clientNum,
      <if test="clientid != null">
        clientId,
      </if>
      <if test="money != null">
        money,
@@ -86,11 +86,11 @@
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="cardnum != null">
        #{cardnum,jdbcType=VARCHAR},
      <if test="cardid != null">
        #{cardid,jdbcType=BIGINT},
      </if>
      <if test="clientnum != null">
        #{clientnum,jdbcType=VARCHAR},
      <if test="clientid != null">
        #{clientid,jdbcType=BIGINT},
      </if>
      <if test="money != null">
        #{money,jdbcType=FLOAT},
@@ -125,11 +125,11 @@
    <!--@mbg.generated-->
    update se_recharge_history
    <set>
      <if test="cardnum != null">
        cardNum = #{cardnum,jdbcType=VARCHAR},
      <if test="cardid != null">
        cardId = #{cardid,jdbcType=BIGINT},
      </if>
      <if test="clientnum != null">
        clientNum = #{clientnum,jdbcType=VARCHAR},
      <if test="clientid != null">
        clientId = #{clientid,jdbcType=BIGINT},
      </if>
      <if test="money != null">
        money = #{money,jdbcType=FLOAT},
@@ -164,8 +164,8 @@
  <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSe.SeRechargeHistory">
    <!--@mbg.generated-->
    update se_recharge_history
    set cardNum = #{cardnum,jdbcType=VARCHAR},
      clientNum = #{clientnum,jdbcType=VARCHAR},
    set cardId = #{cardid,jdbcType=BIGINT},
      clientId = #{clientid,jdbcType=BIGINT},
      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="cardNum" jdbcType="VARCHAR" property="cardnum" />
    <result column="clientNum" jdbcType="VARCHAR" property="clientnum" />
    <result column="cardId" jdbcType="BIGINT" property="cardid" />
    <result column="clientId" jdbcType="BIGINT" property="clientid" />
    <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, cardNum, clientNum, money, amount, gift, afterRecharge, paymentId, price, remarks,
    id, cardId, clientId, money, amount, gift, afterRecharge, paymentId, price, remarks,
    `operator`, operateDt
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
@@ -35,29 +35,27 @@
    where id = #{id,jdbcType=BIGINT}
  </delete>
<!--  <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, cardNum, clientNum, money,
    insert into se_recharge (id, cardId, clientId, money,
      amount, gift, afterRecharge, 
      paymentId, price, remarks, 
      `operator`, operateDt)
    values (#{id,jdbcType=BIGINT} ,#{cardnum,jdbcType=VARCHAR}, #{clientnum,jdbcType=VARCHAR}, #{money,jdbcType=FLOAT},
    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>
  <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="cardnum != null">
        cardNum,
      <if test="cardid != null">
        cardId,
      </if>
      <if test="clientnum != null">
        clientNum,
      <if test="clientid != null">
        clientId,
      </if>
      <if test="money != null">
        money,
@@ -88,11 +86,11 @@
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="cardnum != null">
        #{cardnum,jdbcType=VARCHAR},
      <if test="cardid != null">
        #{cardid,jdbcType=BIGINT},
      </if>
      <if test="clientnum != null">
        #{clientnum,jdbcType=VARCHAR},
      <if test="clientid != null">
        #{clientid,jdbcType=BIGINT},
      </if>
      <if test="money != null">
        #{money,jdbcType=FLOAT},
@@ -127,11 +125,11 @@
    <!--@mbg.generated-->
    update se_recharge
    <set>
      <if test="cardnum != null">
        cardNum = #{cardnum,jdbcType=VARCHAR},
      <if test="cardid != null">
        cardId = #{cardid,jdbcType=BIGINT},
      </if>
      <if test="clientnum != null">
        clientNum = #{clientnum,jdbcType=VARCHAR},
      <if test="clientid != null">
        clientId = #{clientid,jdbcType=BIGINT},
      </if>
      <if test="money != null">
        money = #{money,jdbcType=FLOAT},
@@ -166,8 +164,8 @@
  <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSe.SeRecharge">
    <!--@mbg.generated-->
    update se_recharge
    set cardNum = #{cardnum,jdbcType=VARCHAR},
      clientNum = #{clientnum,jdbcType=VARCHAR},
    set cardId = #{cardid,jdbcType=BIGINT},
      clientId = #{clientid,jdbcType=BIGINT},
      money = #{money,jdbcType=FLOAT},
      amount = #{amount,jdbcType=FLOAT},
      gift = #{gift,jdbcType=FLOAT},
@@ -181,8 +179,13 @@
  </update>
  <!--根据水卡编号删除充值记录-->
  <delete id="deleteByCardNum" parameterType="java.lang.String">
    DELETE FROM    se_recharge WHERE cardNum = #{cardNum}
<!--  <delete id="deleteByCardNum" parameterType="java.lang.String">-->
<!--    DELETE FROM    se_recharge WHERE cardNum = #{cardNum}-->
<!--  </delete>-->
  <!--根据水卡ID删除充值记录-->
  <delete id="deleteByCardId" parameterType="java.lang.Long">
    DELETE FROM    se_recharge WHERE cardId = #{cardId}
  </delete>
  <!--根据指定的条件获取充值记录-->
@@ -190,16 +193,16 @@
    select
        COUNT(*) AS recordCount
    FROM se_recharge_history rec
        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
    INNER JOIN se_client_card card ON rec.cardId = card.id
    INNER JOIN se_client cli ON rec.clientId = cli.id
    , (SELECT @i:=0) AS itable
    <where>
      <if test = "clientName != null and clientName !=''">
        AND cli.name like CONCAT('%',#{clientName},'%')
      </if>
      <if test = "clientNum != null and clientNum > 0">
        AND rec.clientNum like CONCAT('%',#{clientNum},'%')
        AND cli.clientNum like CONCAT('%',#{clientNum},'%')
      </if>
      <if test = "cardNum != null and cardNum !=''">
@@ -221,7 +224,7 @@
    SELECT
        (@i:=@i+1) AS id,
        cli.name AS clientName,
        cli.num AS clientNum,
        cli.clientNum,
        card.cardNum,
        rec.amount,
        rec.afterRecharge,
@@ -230,8 +233,8 @@
        (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.cardNum = card.cardNum
        INNER JOIN ba_client cli ON rec.clientNum = cli.num
        INNER JOIN se_client_card card ON rec.cardId = card.id
        INNER JOIN se_client cli ON rec.clientId = cli.id
        , (SELECT @i:=0) AS itable
    <where>
      <if test = "clientName != null and clientName !=''">
@@ -239,7 +242,7 @@
      </if>
      <if test = "clientNum != null and clientNum > 0">
        AND rec.clientNum like CONCAT('%',#{clientNum},'%')
        AND cli.clientNum like CONCAT('%',#{clientNum},'%')
      </if>
      <if test = "cardNum != null and cardNum !=''">
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/activeCard/ActiveCardCtrl.java
@@ -7,7 +7,6 @@
import com.dy.common.webUtil.ResultCodeMsg;
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;
@@ -58,9 +57,10 @@
                            schema = @Schema(implementation = VoActiveCard.class))}
            )
    })
    @GetMapping(path = "/getActiveCards", consumes = MediaType.APPLICATION_JSON_VALUE)
    //@GetMapping(path = "/getActiveCards", consumes = MediaType.APPLICATION_JSON_VALUE)
    @GetMapping(path = "/getActiveCards")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoActiveCard>>> getActiveCards(@RequestBody @Parameter(description = "查询form表单json数据", required = true) QueryVo vo){
    public BaseResponse<QueryResultVo<List<VoActiveCard>>> getActiveCards(QueryVo vo){
        try {
            QueryResultVo<List<VoActiveCard>> res = activeCardSv.getActiveCards(vo);
            return BaseResponseUtils.buildSuccess(res);
@@ -95,16 +95,18 @@
         * townId       镇级区划代码
         * villageId    村级区划代码
         */
        VoAreaCode voAreaCode = activeCardSv.getAreaCodeByNum(po.getClientNum());
        if(voAreaCode == null) {
            return BaseResponseUtils.buildFail(SellResultCode.AREA_CODE_MISTAKE.getMessage());
        }
        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;
        //VoAreaCode voAreaCode = activeCardSv.getAreaCodeByNum(po.getClientNum());
        //if(voAreaCode == null) {
        //    return BaseResponseUtils.buildFail(SellResultCode.AREA_CODE_MISTAKE.getMessage());
        //}
        //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;
        String areaCode = String.valueOf(activeCardSv.getAreaCodeByNum(po.getClientNum()));
        /**
         * 根据行政区划串(areaCode)在水卡表中针对水卡编号(cardNum)进行模糊查询
@@ -138,6 +140,8 @@
         */
        String cardAddr = po.getCardAddr();
        String clientNum = po.getClientNum();
        //Long clientId = po.getClientId();
        Integer cardCost = po.getCardCost();
        Float amount = po.getAmount();
        Long paymentId = po.getPaymentId();
@@ -146,12 +150,18 @@
        Date createTime = new Date();
        /**
         * 根据农户编号获取农户ID
         */
        Long clientId = activeCardSv.getClientIdByNum(clientNum);
        /**
         * 添加农户卡记录
         */
        SeClientCard seClientCard = new SeClientCard();
        seClientCard.setCardaddr(cardAddr);
        seClientCard.setCardnum(cardNum);
        seClientCard.setClientnum(clientNum);
        //seClientCard.setClientnum(clientNum);
        seClientCard.setClientid(clientId);
        seClientCard.setMoney(0.0);
        seClientCard.setState(CardStateENUM.NORMAL.getCode());
        seClientCard.setCreatedt(createTime);
@@ -166,8 +176,11 @@
         * 添加开卡记录
         */
        SeActiveCard activeCard = new SeActiveCard();
        activeCard.setCardnum(cardNum);
        activeCard.setClientnum(clientNum);
        //activeCard.setCardnum(cardNum);
        //activeCard.setClientnum(clientNum);
        activeCard.setCardid(cardId);
        activeCard.setClientid(clientId);
        activeCard.setCardcost(cardCost);
        activeCard.setPaymentid(paymentId);
        activeCard.setOperatetype(OperateTypeENUM.ACTIVE.getCode());
@@ -184,6 +197,7 @@
         */
        po.setCardNum(cardNum);
        if(amount != null && amount > 0) {
            po.setClientId(clientId);
            DtoRecharge dtoRecharge = RechargeDtoMapper.INSTANCT.po2vo(po);
            dtoRecharge.setMoney(0f);
            dtoRecharge.setGift(0f);
@@ -217,7 +231,8 @@
        /**
         * cardId           水卡编号(非传入参数,由cardNum反查,更新水卡表用)
         * cardNum          水卡编号
         * clientNum        农户编号(非传入参数,由cardNum反查,添加补卡使用)
         //* clientNum        农户编号(非传入参数,由cardNum反查,添加补卡使用)
         * clientId         农户ID(非传入参数,由cardNum反查,添加补卡使用)
         * cardCost         卡片费用
         * reissueAmount    补卡金额,补卡时使用
         * paymentId        支付方式编号
@@ -227,7 +242,8 @@
         */
        Long cardId = 0L;
        String cardNum = po.getCardNum();
        String clientNum = "";
        //String clientNum = "";
        Long clientId = 0L;
        Integer cardCost = po.getCardCost();
        Double reissueAmount = po.getReissueAmount();
        Long paymentId = po.getPaymentId();
@@ -243,7 +259,8 @@
            return BaseResponseUtils.buildFail(SellResultCode.CARD_NUMBER_ERROR.getMessage());
        }
        cardId = Long.parseLong(map.get("cardId").toString());
        clientNum = map.get("clientNum").toString();
        //clientNum = map.get("clientNum").toString();
        clientId = Long.parseLong(map.get("clientId").toString());
        /**
         * 修改农户卡信息:
@@ -263,8 +280,10 @@
         * 添加补卡记录
         */
        SeActiveCard activeCard = new SeActiveCard();
        activeCard.setCardnum(cardNum);
        activeCard.setClientnum(clientNum);
        //activeCard.setCardnum(cardNum);
        //activeCard.setClientnum(clientNum);
        activeCard.setCardid(cardId);
        activeCard.setClientid(clientId);
        activeCard.setCardcost(cardCost);
        activeCard.setPaymentid(paymentId);
        activeCard.setReissueamount(reissueAmount);
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/activeCard/ActiveCardSv.java
@@ -1,18 +1,16 @@
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.daoSe.SeClientMapper;
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;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.Map;
@@ -33,22 +31,39 @@
    @Autowired
    private SeClientCardMapper seClientCardMapper;
    //@Autowired
    //private BaClientMapper baClientMapper;
    @Autowired
    private BaClientMapper baClientMapper;
    private SeClientMapper seClientMapper;
    public QueryResultVo<List<VoActiveCard>> getActiveCards(QueryVo queryVo) {
        //完善查询开卡记录的起止时间
        DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd");
        LocalDateTime activeTimeStart = queryVo.activeTimeStart;
        LocalDateTime activeTimeStop = queryVo.activeTimeStop;
        //LocalDateTime activeTimeStart = queryVo.activeTimeStart;
        //LocalDateTime activeTimeStop = queryVo.activeTimeStop;
        //if(activeTimeStart != null) {
        //    activeTimeStart = LocalDateTime.parse(df.format(activeTimeStart) + " 00:00:00", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
        //    queryVo.setActiveTimeStart(activeTimeStart);
        //}
        //if(activeTimeStop != null) {
        //    activeTimeStop = LocalDateTime.parse(df.format(activeTimeStop) + " 23:59:59", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
        //    queryVo.setActiveTimeStop(activeTimeStop);
        //}
        String activeTimeStart = queryVo.activeTimeStart;
        String activeTimeStop = queryVo.activeTimeStop;
        if(activeTimeStart != null) {
            activeTimeStart = LocalDateTime.parse(df.format(activeTimeStart) + " 00:00:00", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
            activeTimeStart = activeTimeStart + " 00:00:00";
            queryVo.setActiveTimeStart(activeTimeStart);
        }
        if(activeTimeStop != null) {
            activeTimeStop = LocalDateTime.parse(df.format(activeTimeStop) + " 23:59:59", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
            activeTimeStop = activeTimeStop + " 23:59:59";
            queryVo.setActiveTimeStop(activeTimeStop);
        }
@@ -74,8 +89,17 @@
     * @param clientNum 农户编号
     * @return 5级行政区划代码
     */
    public VoAreaCode getAreaCodeByNum(String clientNum) {
        return baClientMapper.getAreaCodeByNum(clientNum);
    public Long getAreaCodeByNum(String clientNum) {
        return seClientMapper.getAreaCodeByNum(clientNum);
    }
    /**
     * 根据农户编号获取农户ID
     * @param clientNum
     * @return
     */
    public Long getClientIdByNum(String clientNum) {
        return seClientMapper.getClientIdByNum(clientNum);
    }
    /**
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/activeCard/DtoActiveCard.java
@@ -21,26 +21,23 @@
    public static final long serialVersionUID = 20231191728001L;
    /**
     * 水卡地址
     * 水卡地址,仅保存,无业务
     */
    @Schema(description = "水卡地址", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotBlank(message = "水卡地址不能为空")
    private String cardAddr;
    /**
     * 农户编号
     * 开卡时使用
     * 农户编号,开卡使用
     */
    @Schema(description = "农户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private String clientNum;
    /**
     * 农户ID(主键)
     * 废弃,改用clientNum
     * 农户ID(主键),不是开卡接口传入,由农户编号获得,保存开卡记录和充值记录都需要
     */
    //@Schema(description = "农户ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    //@Positive(message = "农户ID必须为大于0的整数")
    //private Long clientId;
    @Schema(description = "农户ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Long clientId;
    /**
     * 水卡编号
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/activeCard/QueryVo.java
@@ -4,8 +4,6 @@
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.time.LocalDateTime;
/**
 * @author ZhuBaoMin
 * @date 2023/12/5 20:00
@@ -35,9 +33,15 @@
    @Schema(description = "卡片状态")
    private Byte state;
    //@Schema(description = "开卡时间_开始")
    //public LocalDateTime activeTimeStart;
    //
    //@Schema(description = "开卡时间_结束")
    //public LocalDateTime activeTimeStop;
    @Schema(description = "开卡时间_开始")
    public LocalDateTime activeTimeStart;
    public String activeTimeStart;
    @Schema(description = "开卡时间_结束")
    public LocalDateTime activeTimeStop;
    public String activeTimeStop;
}
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/activeCard/RechargeDtoMapper.java
@@ -16,10 +16,10 @@
public interface RechargeDtoMapper {
    RechargeDtoMapper INSTANCT = Mappers.getMapper(RechargeDtoMapper.class);
    //@Mapping(target = "cardAddr", source = "cardAddr")
    //@Mapping(target = "clientId", source = "clientId")
    //@Mapping(target = "cardId", source = "cardId")
    @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")
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/recharge/DtoRecharge.java
@@ -23,19 +23,20 @@
    public static final long serialVersionUID = 20231191728001L;
    /**
     * 水卡地址
     * 水卡编号
     */
    @Schema(description = "水卡地址", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotBlank
    @Schema(description = "水卡编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotBlank(message = "水卡编号不能为空")
    //private String cardAddr;
    private String cardNum;
    //private Long cardId;
    /**
     * 农户编号
     * 农户ID,不是充值接口传入,由开卡对象传入,保存充值记录需要
     */
    @Schema(description = "农户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    //private Long clientId;
    private String clientNum;
    @Schema(description = "农户ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    //private String clientNum;
    private Long clientId;
    /**
     * 卡片余额
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/recharge/RechargeCtrl.java
@@ -101,6 +101,8 @@
        Long cardId = 0L;
        String cardNum = po.getCardNum();
        String clientNum = "";
        //Long clientId = po.getClientId();
        Long clientId = 0L;
        Float money = po.getMoney();
        Float amount = po.getAmount();
        Float gift = po.getGift();
@@ -120,6 +122,7 @@
        }
        cardId = Long.parseLong(map.get("cardId").toString());
        clientNum = map.get("clientNum").toString();
        clientId = Long.parseLong(map.get("clientId").toString());
        /**
         * 修改农户卡信息:
@@ -138,13 +141,16 @@
        /**
         * 删除充值表该卡的充值记录
         */
        Integer rec_deleteRecharge = Optional.ofNullable(rechargeSv.deleteByCardNum(cardNum)).orElse(0);
        Integer rec_deleteRecharge = Optional.ofNullable(rechargeSv.deleteByCardId(cardId)).orElse(0);
        /**
         * 添加充值记录
         */
        SeRecharge seRecharge = new SeRecharge();
        seRecharge.setCardnum(cardNum);
        seRecharge.setClientnum(clientNum);
        //seRecharge.setCardnum(cardNum);
        //seRecharge.setClientnum(clientNum);
        seRecharge.setCardid(cardId);
        seRecharge.setClientid(clientId);
        seRecharge.setMoney(money);
        seRecharge.setAmount(amount);
        seRecharge.setGift(gift);
@@ -163,8 +169,10 @@
         * 添加补卡历史记录
         */
        SeRechargeHistory seRechargeHistory = new SeRechargeHistory();
        seRechargeHistory.setCardnum(cardNum);
        seRechargeHistory.setClientnum(clientNum);
        //seRechargeHistory.setCardnum(cardNum);
        //seRechargeHistory.setClientnum(clientNum);
        seRechargeHistory.setCardid(cardId);
        seRechargeHistory.setClientid(clientId);
        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
@@ -82,15 +82,15 @@
    /**
     * 根据水卡编号删除充值记录
     * @param cardNum
     * @param cardId
     * @return
     */
    //public Integer deleteByCardId(Long cardId) {
    //    return seRechargeMapper.deleteByCardId(cardId);
    //}
    public Integer deleteByCardNum(String cardNum) {
        return seRechargeMapper.deleteByCardNum(cardNum);
    public Integer deleteByCardId(Long cardId) {
        return seRechargeMapper.deleteByCardId(cardId);
    }
    //public Integer deleteByCardNum(String cardNum) {
    //    return seRechargeMapper.deleteByCardNum(cardNum);
    //}
    /**
     * 添加充值历史表