2023-12-23 朱宝民 开卡、补卡、充值重构,开卡/补卡记录查询改为参数传递
| | |
| | | |
| | | /** |
| | | * @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 |
| | | */ |
| | | |
| | |
| | | |
| | | /** |
| | | * @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 |
| | | */ |
| | | |
| | |
| | | * @return |
| | | */ |
| | | Map getCardIdAndClientNum(@Param("cardNum") String cardNum); |
| | | |
| | | } |
| | |
| | | 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; |
| | |
| | | * @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); |
| | |
| | | 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 |
| | |
| | | |
| | | /** |
| | | * @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 |
| | | */ |
| | | |
| | |
| | | |
| | | /** |
| | | * @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 |
| | | */ |
| | | |
| | |
| | | |
| | | int updateByPrimaryKey(SeRecharge record); |
| | | |
| | | /** |
| | | * 根据指定的条件获取充值记录 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Long getRecordCount(Map<?, ?> params); |
| | | |
| | | /** |
| | |
| | | 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); |
| | | |
| | | } |
| | |
| | | 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; |
| | | |
| | |
| | | /** |
| | | * 水卡编号 |
| | | */ |
| | | @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; |
| | | |
| | | /** |
| | | * 卡片费用 |
| | |
| | | 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; |
| | | |
| | | /** |
| | | * 余额 |
| | |
| | | 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.*; |
| | |
| | | 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; |
| | | |
| | | /** |
| | | * 卡片余额 |
| | |
| | | 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.*; |
| | |
| | | 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; |
| | | |
| | | /** |
| | | * 卡片余额 |
| | |
| | | <!--@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" /> |
| | |
| | | </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--> |
| | |
| | | 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, |
| | |
| | | </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}, |
| | |
| | | <!--@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}, |
| | |
| | | <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}, |
| | |
| | | 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} |
| | |
| | | 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, |
| | |
| | | (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"> |
| | |
| | | <!--@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" /> |
| | |
| | | </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"> |
| | |
| | | |
| | | <!--根据水卡编号获取水卡表主键及农户编号--> |
| | | <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 |
| | |
| | | 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 |
| | |
| | | <if test="cardnum != null"> |
| | | cardNum, |
| | | </if> |
| | | <if test="clientnum != null"> |
| | | clientNum, |
| | | <if test="clientid != null"> |
| | | clientId, |
| | | </if> |
| | | <if test="money != null"> |
| | | money, |
| | |
| | | #{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}, |
| | |
| | | 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}, |
| | |
| | | <!--@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}, |
| | |
| | | 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> |
| | |
| | | <!--@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" /> |
| | |
| | | </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"> |
| | |
| | | |
| | | <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}) |
| | |
| | | <!--@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, |
| | |
| | | </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}, |
| | |
| | | <!--@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}, |
| | |
| | | <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}, |
| | |
| | | <!--@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" /> |
| | |
| | | </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"> |
| | |
| | | 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, |
| | |
| | | </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}, |
| | |
| | | <!--@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}, |
| | |
| | | <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}, |
| | |
| | | </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> |
| | | |
| | | <!--根据指定的条件获取充值记录--> |
| | |
| | | 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 !=''"> |
| | |
| | | SELECT |
| | | (@i:=@i+1) AS id, |
| | | cli.name AS clientName, |
| | | cli.num AS clientNum, |
| | | cli.clientNum, |
| | | card.cardNum, |
| | | rec.amount, |
| | | rec.afterRecharge, |
| | |
| | | (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 !=''"> |
| | |
| | | </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 !=''"> |
| | |
| | | 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; |
| | |
| | | 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); |
| | |
| | | * 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)进行模糊查询 |
| | |
| | | */ |
| | | String cardAddr = po.getCardAddr(); |
| | | String clientNum = po.getClientNum(); |
| | | //Long clientId = po.getClientId(); |
| | | |
| | | Integer cardCost = po.getCardCost(); |
| | | Float amount = po.getAmount(); |
| | | Long paymentId = po.getPaymentId(); |
| | |
| | | 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); |
| | |
| | | * 添加开卡记录 |
| | | */ |
| | | 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()); |
| | |
| | | */ |
| | | po.setCardNum(cardNum); |
| | | if(amount != null && amount > 0) { |
| | | po.setClientId(clientId); |
| | | DtoRecharge dtoRecharge = RechargeDtoMapper.INSTANCT.po2vo(po); |
| | | dtoRecharge.setMoney(0f); |
| | | dtoRecharge.setGift(0f); |
| | |
| | | /** |
| | | * cardId 水卡编号(非传入参数,由cardNum反查,更新水卡表用) |
| | | * cardNum 水卡编号 |
| | | * clientNum 农户编号(非传入参数,由cardNum反查,添加补卡使用) |
| | | //* clientNum 农户编号(非传入参数,由cardNum反查,添加补卡使用) |
| | | * clientId 农户ID(非传入参数,由cardNum反查,添加补卡使用) |
| | | * cardCost 卡片费用 |
| | | * reissueAmount 补卡金额,补卡时使用 |
| | | * paymentId 支付方式编号 |
| | |
| | | */ |
| | | 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(); |
| | |
| | | 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()); |
| | | |
| | | /** |
| | | * 修改农户卡信息: |
| | |
| | | * 添加补卡记录 |
| | | */ |
| | | 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); |
| | |
| | | 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; |
| | |
| | | @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); |
| | | } |
| | | |
| | |
| | | * @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); |
| | | } |
| | | |
| | | /** |
| | |
| | | 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; |
| | | |
| | | /** |
| | | * 水卡编号 |
| | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023/12/5 20:00 |
| | |
| | | @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; |
| | | } |
| | |
| | | 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") |
| | |
| | | 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; |
| | | |
| | | /** |
| | | * 卡片余额 |
| | |
| | | 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(); |
| | |
| | | } |
| | | cardId = Long.parseLong(map.get("cardId").toString()); |
| | | clientNum = map.get("clientNum").toString(); |
| | | clientId = Long.parseLong(map.get("clientId").toString()); |
| | | |
| | | /** |
| | | * 修改农户卡信息: |
| | |
| | | /** |
| | | * 删除充值表该卡的充值记录 |
| | | */ |
| | | 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); |
| | |
| | | * 添加补卡历史记录 |
| | | */ |
| | | 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); |
| | |
| | | |
| | | /** |
| | | * 根据水卡编号删除充值记录 |
| | | * @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); |
| | | //} |
| | | |
| | | /** |
| | | * 添加充值历史表 |