Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV
| | |
| | | import com.dy.pipIrrGlobal.voSe.*; |
| | | import com.dy.pipIrrGlobal.voSt.VoClientOpenCardCount; |
| | | import com.dy.pipIrrGlobal.voSt.VoClientRechargeTotal; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | |
| | | * @LastEditTime 2025-05-08 17:15 |
| | | * @Description |
| | | */ |
| | | @Mapper |
| | | public interface SeCardOperateMapper { |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | |
| | | */ |
| | | Integer turnOperateValidByCardId(@Param("cardId") Long cardId, @Param("operateType") Integer operateType); |
| | | |
| | | /** |
| | | * 充值机用根据订单号将操作记录改为有效 |
| | | * @param orderNumber |
| | | * @return |
| | | */ |
| | | Integer turnOperateValidByOrderNumber(String orderNumber); |
| | | |
| | | /** |
| | | * 充值机用获取充值操作后新的余额及充值时间 |
| | | * @param orderNumber |
| | | * @return |
| | | */ |
| | | //Float getBalanceAfterRecharge(String orderNumber); |
| | | VoAfterRecharge getBalanceAfterRecharge(String orderNumber); |
| | | |
| | | /** |
| | | * 充值机用根据水卡ID获取同步充值记录数量 |
| | | * @param cardId |
| | | * @return |
| | | */ |
| | | Integer getPlusRechargeCount(Long cardId); |
| | | |
| | | |
| | | /** |
| | | * 根据水卡ID、操作类型获取获取最后一条记录,判断开卡是否同步充值使用 |
| | |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023/12/22 16:04 |
| | | * @LastEditTime 2023/12/22 16:04 |
| | | * @date 2025-06-06 10:21 |
| | | * @LastEditTime 2025-06-06 10:21 |
| | | * @Description |
| | | */ |
| | | |
| | |
| | | Integer turnCardValidByAddr(@Param("cardAddr")String cardAddr, @Param("operateType")Integer operateType); |
| | | |
| | | /** |
| | | * 充值机用根据订单号将水卡改为有效 |
| | | * @param orderNumber |
| | | * @return |
| | | */ |
| | | Integer turnCardValidByOrderNumber(@Param("orderNumber")String orderNumber); |
| | | |
| | | /** |
| | | * 根据水卡ID获取原水卡ID,补卡通知中使用 |
| | | * @param cardId |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023/12/23 8:47 |
| | | * @LastEditTime 2023/12/23 8:47 |
| | | * @date 2025-06-06 10:34 |
| | | * @LastEditTime 2025-06-06 10:34 |
| | | * @Description |
| | | */ |
| | | |
| | |
| | | */ |
| | | Integer turnRechargeHistoryValidByCardId(@Param("cardId") Long cardId); |
| | | |
| | | |
| | | /////////////////////////////// |
| | | //统计相关 |
| | | /** |
| | | * 充值机用根据订单号将充值历史记录改为有效 |
| | | * @param orderNumber |
| | | * @return |
| | | */ |
| | | Integer turnRechargeHistoryValidByOrderNumber(@Param("orderNumber") String orderNumber); |
| | | |
| | | /** |
| | | * 以农户和IC卡为单位统计一日的充值 |
| | |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023/12/7 9:06 |
| | | * @LastEditTime 2023/12/18 10:14 |
| | | * @Description 添加水卡编号(cardnum)字段 |
| | | * @date 2025-06-06 10:21 |
| | | * @LastEditTime 2025-06-06 10:21 |
| | | * @Description |
| | | */ |
| | | |
| | | /** |
| | |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "农户水卡实体") |
| | | public class SeClientCard implements BaseEntity { |
| | | public static final long serialVersionUID = 202401151518004L; |
| | | |
| | |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | @Schema(description = "实体id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Long id; |
| | | |
| | | @NotBlank(message = "通讯协议不能为空") |
| | |
| | | /** |
| | | * 水卡地址 |
| | | */ |
| | | @Schema(description = "水卡地址", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotBlank(message = "水卡地址不能为空") |
| | | private String cardaddr; |
| | | |
| | | /** |
| | | * 水卡编号 |
| | | */ |
| | | @Schema(description = "水卡编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotBlank(message = "水卡编号不能为空") |
| | | private String cardnum; |
| | | |
| | | /** |
| | | * 农户ID |
| | | */ |
| | | @Schema(description = "农户ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotBlank(message = "农户ID不能为空") |
| | | private Long clientid; |
| | | |
| | | /** |
| | | * 余额 |
| | | */ |
| | | @Schema(description = "余额", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Float money; |
| | | |
| | | /** |
| | | * 卡片状态;1-正常,2-已注销,3-已挂失 |
| | | */ |
| | | @Schema(description = "卡片状态", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Positive(message = "卡片状态必须为1或2或3") |
| | | @Size(min = 1, max = 3) |
| | | private Byte state; |
| | |
| | | /** |
| | | * 原挂失卡ID |
| | | */ |
| | | @Schema(description = "卡片状态", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Positive(message = "原挂失卡ID必须为正数") |
| | | private Long originalCardId; |
| | | |
| | | /** |
| | | * 开卡时间 |
| | | */ |
| | | @Schema(description = "开卡时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Date createdt; |
| | | |
| | | /** |
| | | * 补卡时间 |
| | | */ |
| | | @Schema(description = "补卡时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Date replacedt; |
| | | |
| | | /** |
| | | * 充值时间 |
| | | */ |
| | | @Schema(description = "充值时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Date rechargedt; |
| | | |
| | | /** |
| | | * 挂失时间 |
| | | */ |
| | | @Schema(description = "挂失时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Date lossdtdt; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 解锁时间 |
| | | */ |
| | | @Schema(description = "解锁时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Date unlockdt; |
| | | |
| | | /** |
| | | * 冲正时间 |
| | | */ |
| | | @Schema(description = "冲正时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Date reversaldt; |
| | | |
| | | /** |
| | | * 补扣时间 |
| | | */ |
| | | @Schema(description = "补扣时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Date refunddt; |
| | | |
| | | /** |
| | | * 消费时间 |
| | | */ |
| | | @Schema(description = "消费时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Date consumedt; |
| | | |
| | | /** |
| | | * 最后操作类型;1-开卡,2-补卡,3-充值,4-挂失,5-注销,6-解锁,7-冲正,8-消费 |
| | | */ |
| | | @Schema(description = "最后操作类型", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Positive(message = "卡片状态必须为1到8的正整数") |
| | | @Size(min = 1, max = 8) |
| | | private Byte lastoper; |
| | |
| | | /** |
| | | * 备注信息 |
| | | */ |
| | | @Schema(description = "备注", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Length(message = "备注长度小于{max}字", min = 1, max = 200) |
| | | private String remarks; |
| | | |
| | | /** |
| | | * 订单号 |
| | | */ |
| | | private String orderNo; |
| | | } |
| | |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023/12/7 20:33 |
| | | * @LastEditTime 2023/12/7 20:33 |
| | | * @date 2025-06-06 10:34 |
| | | * @LastEditTime 2025-06-06 10:34 |
| | | * @Description |
| | | */ |
| | | |
| | |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "水卡充值历史实体") |
| | | public class SeRechargeHistory implements BaseEntity { |
| | | public static final long serialVersionUID = 202401151519002L; |
| | | |
| | |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | @Schema(description = "实体id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 水卡ID |
| | | */ |
| | | @Schema(description = "水卡ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | //@NotBlank(message = "水卡ID不能为空") |
| | | //private String cardnum; |
| | | @NotNull(message = "水卡ID不能为空") |
| | | private Long cardid; |
| | | |
| | | /** |
| | | * 农户ID |
| | | */ |
| | | @Schema(description = "农户ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | //@NotBlank(message = "农户ID不能为空") |
| | | //private String clientnum; |
| | | @NotNull(message = "农户ID不能为空") |
| | | private Long clientid; |
| | | |
| | | /** |
| | | * 卡片余额 |
| | | */ |
| | | @Schema(description = "卡片余额", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotNull(message = "卡片余额不能为空") |
| | | @Length(message = "卡片余额不小于{min}", min = 0) |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | |
| | | /** |
| | | * 充值金额 |
| | | */ |
| | | @Schema(description = "充值金额", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotNull(message = "充值金额不能为空") |
| | | @Length(message = "充值金额不小于{min}", min = 0) |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | |
| | | /** |
| | | * 赠送金额 |
| | | */ |
| | | @Schema(description = "赠送金额", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Length(message = "赠送金额不小于{min}", min = 0) |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Float gift; |
| | |
| | | /** |
| | | * 充值后余额 |
| | | */ |
| | | @Schema(description = "充值后余额", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Length(message = "充值后余额不小于{min}", min = 0) |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Float afterrecharge; |
| | |
| | | /** |
| | | * 付款方式编号 |
| | | */ |
| | | @Schema(description = "付款方式编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Length(message = "付款方式编号不大于{max},不小于{min}", min = 1, max = 4) |
| | | private Long paymentid; |
| | | |
| | | /** |
| | | * 水价 |
| | | */ |
| | | @Schema(description = "水价", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Length(message = "水价不小于{min}", min = 0) |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Float price; |
| | |
| | | /** |
| | | * 备注信息 |
| | | */ |
| | | @Schema(description = "备注", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Length(message = "备注长度小于{max}字", min = 1, max = 200) |
| | | private String remarks; |
| | | |
| | | /** |
| | | * 操作人ID |
| | | */ |
| | | @Schema(description = "操作人ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Positive(message = "操作人ID必须为大于0的整数") |
| | | private Long operator; |
| | | |
| | | /** |
| | | * 操作时间 |
| | | */ |
| | | @Schema(description = "操作时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Date operatedt; |
| | | |
| | | /** |
| | |
| | | @Length(message = "操作有效性不大于{max},不小于{min}", min = 1, max = 2) |
| | | private Byte operateValid; |
| | | |
| | | /** |
| | | * 订单号 |
| | | */ |
| | | private String orderNo; |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.voSe; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonPropertyOrder; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2025-06-06 16:02 |
| | | * @LastEditTime 2025-06-06 16:02 |
| | | * @Description 充值机用充值后信息 |
| | | */ |
| | | |
| | | @Data |
| | | @JsonPropertyOrder({"balanceAfterRecharge", "operateTime"}) |
| | | public class VoAfterRecharge { |
| | | private static final long serialVersionUID = 202506061605001L; |
| | | |
| | | private float balanceAfterRecharge; |
| | | |
| | | private Date operateTime; |
| | | } |
| | |
| | | ); |
| | | </update> |
| | | |
| | | <!--充值机用根据订单号将操作记录改为有效--> |
| | | <update id="turnOperateValidByOrderNumber"> |
| | | UPDATE se_card_operate |
| | | SET operate_valid = 2 |
| | | WHERE operate_valid = 1 AND order_no = #{orderNumber} |
| | | </update> |
| | | |
| | | <!--充值机用获取充值操作后新的余额及充值时间--> |
| | | <select id="getBalanceAfterRecharge" resultType="com.dy.pipIrrGlobal.voSe.VoAfterRecharge"> |
| | | SELECT |
| | | (money + trade_amount + gift) AS balanceAfterRecharge, |
| | | operate_dt AS operateTime |
| | | FROM se_card_operate |
| | | WHERE order_no = #{orderNumber} |
| | | </select> |
| | | |
| | | <!--充值机用根据水卡ID获取同步充值记录数量--> |
| | | <select id="getPlusRechargeCount" resultType="java.lang.Integer"> |
| | | SELECT COUNT(*) |
| | | FROM se_card_operate |
| | | WHERE operate_type = 2 AND order_no = CONCAT((SELECT order_no FROM se_card_operate WHERE operate_type = 1 AND card_id = #{cardId}),'p') |
| | | </select> |
| | | |
| | | <!--根据操作类型、水卡ID获取获取最后一条记录--> |
| | | <select id="getCardOperate" resultType="com.dy.pipIrrGlobal.pojoSe.SeCardOperate"> |
| | | SELECT * FROM se_card_operate |
| | |
| | | <result column="consumeDt" jdbcType="TIMESTAMP" property="consumedt"/> |
| | | <result column="lastOper" jdbcType="TINYINT" property="lastoper"/> |
| | | <result column="remarks" jdbcType="VARCHAR" property="remarks"/> |
| | | <result column="order_no" jdbcType="VARCHAR" property="orderNo" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, |
| | | protocol, |
| | | cardAddr, |
| | | cardNum, |
| | | clientId, |
| | | money, |
| | | `state`, |
| | | original_card_id, |
| | | createDt, |
| | | replaceDt, |
| | | rechargeDt, |
| | | lossDtDt, |
| | | cancelDt, |
| | | unlockDt, |
| | | reversalDt, |
| | | refundDt, |
| | | consumeDt, |
| | | lastOper, |
| | | remarks |
| | | id, protocol, cardAddr, cardNum, clientId, money, `state`, original_card_id, createDt, |
| | | replaceDt, rechargeDt, lossDtDt, cancelDt, unlockDt, reversalDt, refundDt, consumeDt, |
| | | lastOper, remarks, order_no |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete |
| | | from se_client_card |
| | | delete from se_client_card |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | |
| | | <!--依据水卡地址获取水卡编号(12月19日废弃)--> |
| | | <!--2024-06-30取消废弃,恢复使用--> |
| | | <select id="getCardIdByAddr" resultType="java.lang.Long"> |
| | | SELECT id AS cardId |
| | | FROM se_client_card |
| | | WHERE cardAddr = #{cardAddr} |
| | | ORDER BY id DESC |
| | | LIMIT 1 |
| | | </select> |
| | | |
| | | <!--根据水卡编号获取水卡表主键(12月19日添加后废弃)--> |
| | | <select id="getCardIdByNum" resultType="java.lang.Long"> |
| | | SELECT id AS cardId |
| | | FROM se_client_card |
| | | WHERE cardNum = #{cardNum} |
| | | </select> |
| | | |
| | | <!--根据水卡编号获取水卡表主键及农户编号--> |
| | | <select id="getCardIdAndClientNum" resultType="java.util.Map"> |
| | | <!-- SELECT id AS cardId, clientNum FROM se_client_card WHERE cardNum = #{cardNum}--> |
| | | SELECT card.id AS cardId, |
| | | cli.clientNum, |
| | | cli.id AS clientId, |
| | | protocol |
| | | FROM se_client_card card |
| | | INNER JOIN se_client cli ON card.clientId = cli.id |
| | | WHERE card.cardNum = #{cardNum} |
| | | </select> |
| | | |
| | | <!-- 根据水卡编号获取水卡对应的农户id和姓名 --> |
| | | <select id="getClientIdAndNameByCardAddrAndCardNo" resultType="java.util.Map"> |
| | | SELECT cli.id AS clientId, |
| | | cli.name AS clientName, |
| | | cli.address AS clientAddress |
| | | FROM se_client_card card |
| | | INNER JOIN se_client cli ON card.clientId = cli.id |
| | | WHERE card.cardAddr = #{cardAddr} |
| | | and card.cardNum = #{cardNum} |
| | | </select> |
| | | |
| | | |
| | | <!-- 根据水卡编号获取水卡 --> |
| | | <select id="getCardsByAddrAndNum" resultType="com.dy.pipIrrGlobal.voSe.VoCardInfo1"> |
| | | SELECT id, |
| | | money |
| | | FROM se_client_card |
| | | WHERE cardAddr = #{cardAddr} |
| | | and cardNum = #{cardNum} |
| | | </select> |
| | | |
| | | <!--根据行政区划串模糊查询水卡编号--> |
| | | <select id="getCardNumOfMax" resultType="java.lang.String"> |
| | | SELECT cardNum |
| | | FROM se_client_card |
| | | WHERE cardNum LIKE CONCAT(#{areaCode}, '%') |
| | | ORDER BY cardNum desc |
| | | LIMIT 0,1 |
| | | </select> |
| | | |
| | | <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClientCard"> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClientCard"> |
| | | <!--@mbg.generated--> |
| | | insert into se_client_card (id, protocol, cardAddr, cardNum, clientId, |
| | | money, `state`, original_card_id, createDt, |
| | | insert into se_client_card (id, protocol, cardAddr, |
| | | cardNum, clientId, money, |
| | | `state`, original_card_id, createDt, |
| | | replaceDt, rechargeDt, lossDtDt, |
| | | cancelDt, unlockDt, reversalDt, refundDt, |
| | | consumeDt, lastOper, remarks) |
| | | cancelDt, unlockDt, reversalDt, |
| | | refundDt, consumeDt, lastOper, |
| | | remarks, order_no) |
| | | values (#{id,jdbcType=BIGINT}, #{protocol,jdbcType=VARCHAR}, #{cardaddr,jdbcType=VARCHAR}, |
| | | #{cardnum,jdbcType=BIGINT}, #{clientid,jdbcType=BIGINT}, |
| | | #{money,jdbcType=FLOAT}, #{state,jdbcType=TINYINT}, #{originalCardId,jdbcType=BIGINT}, |
| | | #{createdt,jdbcType=TIMESTAMP}, |
| | | #{cardnum,jdbcType=BIGINT}, #{clientid,jdbcType=BIGINT}, #{money,jdbcType=FLOAT}, |
| | | #{state,jdbcType=TINYINT}, #{originalCardId,jdbcType=BIGINT}, #{createdt,jdbcType=TIMESTAMP}, |
| | | #{replacedt,jdbcType=TIMESTAMP}, #{rechargedt,jdbcType=TIMESTAMP}, #{lossdtdt,jdbcType=TIMESTAMP}, |
| | | #{canceldt,jdbcType=TIMESTAMP}, #{unlockdt,jdbcType=TIMESTAMP}, #{reversaldt,jdbcType=TIMESTAMP}, |
| | | #{refunddt,jdbcType=TIMESTAMP}, #{consumedt,jdbcType=TIMESTAMP}, #{lastoper,jdbcType=TINYINT}, |
| | | #{remarks,jdbcType=VARCHAR}) |
| | | #{remarks,jdbcType=VARCHAR}, #{orderNo,jdbcType=VARCHAR}) |
| | | </insert> |
| | | <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClientCard" |
| | | useGeneratedKeys="true"> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClientCard"> |
| | | <!--@mbg.generated--> |
| | | insert into se_client_card |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | <if test="remarks != null"> |
| | | remarks, |
| | | </if> |
| | | <if test="orderNo != null"> |
| | | order_no, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | |
| | | <if test="remarks != null"> |
| | | #{remarks,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="orderNo != null"> |
| | | #{orderNo,jdbcType=VARCHAR}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClientCard"> |
| | |
| | | `state` = #{state,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="originalCardId != null"> |
| | | `original_card_id` = #{originalCardId,jdbcType=BIGINT}, |
| | | original_card_id = #{originalCardId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="createdt != null"> |
| | | createDt = #{createdt,jdbcType=TIMESTAMP}, |
| | |
| | | <if test="remarks != null"> |
| | | remarks = #{remarks,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="orderNo != null"> |
| | | order_no = #{orderNo,jdbcType=VARCHAR}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | |
| | | refundDt = #{refunddt,jdbcType=TIMESTAMP}, |
| | | consumeDt = #{consumedt,jdbcType=TIMESTAMP}, |
| | | lastOper = #{lastoper,jdbcType=TINYINT}, |
| | | remarks = #{remarks,jdbcType=VARCHAR} |
| | | remarks = #{remarks,jdbcType=VARCHAR}, |
| | | order_no = #{orderNo,jdbcType=VARCHAR} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <!--依据水卡地址获取水卡编号(12月19日废弃)--> |
| | | <!--2024-06-30取消废弃,恢复使用--> |
| | | <select id="getCardIdByAddr" resultType="java.lang.Long"> |
| | | SELECT id AS cardId |
| | | FROM se_client_card |
| | | WHERE cardAddr = #{cardAddr} |
| | | ORDER BY id DESC |
| | | LIMIT 1 |
| | | </select> |
| | | |
| | | <!--根据水卡编号获取水卡表主键(12月19日添加后废弃)--> |
| | | <select id="getCardIdByNum" resultType="java.lang.Long"> |
| | | SELECT id AS cardId |
| | | FROM se_client_card |
| | | WHERE cardNum = #{cardNum} |
| | | </select> |
| | | |
| | | <!--根据水卡编号获取水卡表主键及农户编号--> |
| | | <select id="getCardIdAndClientNum" resultType="java.util.Map"> |
| | | <!-- SELECT id AS cardId, clientNum FROM se_client_card WHERE cardNum = #{cardNum}--> |
| | | SELECT card.id AS cardId, |
| | | cli.clientNum, |
| | | cli.id AS clientId, |
| | | protocol |
| | | FROM se_client_card card |
| | | INNER JOIN se_client cli ON card.clientId = cli.id |
| | | WHERE card.cardNum = #{cardNum} |
| | | </select> |
| | | |
| | | <!-- 根据水卡编号获取水卡对应的农户id和姓名 --> |
| | | <select id="getClientIdAndNameByCardAddrAndCardNo" resultType="java.util.Map"> |
| | | SELECT cli.id AS clientId, |
| | | cli.name AS clientName, |
| | | cli.address AS clientAddress |
| | | FROM se_client_card card |
| | | INNER JOIN se_client cli ON card.clientId = cli.id |
| | | WHERE card.cardAddr = #{cardAddr} |
| | | and card.cardNum = #{cardNum} |
| | | </select> |
| | | |
| | | |
| | | <!-- 根据水卡编号获取水卡 --> |
| | | <select id="getCardsByAddrAndNum" resultType="com.dy.pipIrrGlobal.voSe.VoCardInfo1"> |
| | | SELECT id, |
| | | money |
| | | FROM se_client_card |
| | | WHERE cardAddr = #{cardAddr} |
| | | and cardNum = #{cardNum} |
| | | </select> |
| | | |
| | | <!--根据行政区划串模糊查询水卡编号--> |
| | | <select id="getCardNumOfMax" resultType="java.lang.String"> |
| | | SELECT cardNum |
| | | FROM se_client_card |
| | | WHERE cardNum LIKE CONCAT(#{areaCode}, '%') |
| | | ORDER BY cardNum desc |
| | | LIMIT 0,1 |
| | | </select> |
| | | |
| | | <update id="updateMoney"> |
| | | update se_client_card |
| | | set money = #{money,jdbcType=FLOAT} |
| | |
| | | ); |
| | | </update> |
| | | |
| | | <!--充值机用根据订单号将水卡改为有效--> |
| | | <update id="turnCardValidByOrderNumber"> |
| | | UPDATE se_client_card |
| | | SET state = 1 |
| | | WHERE state = 4 AND order_no = #{orderNumber} |
| | | </update> |
| | | |
| | | <!--根据水卡ID获取原水卡ID,补卡通知中使用--> |
| | | <select id="getOriginalCardIdByCardId" resultType="java.lang.Long"> |
| | | SELECT original_card_id AS originalCardId FROM se_client_card WHERE id = #{cardId}; |
| | |
| | | <result column="remarks" jdbcType="VARCHAR" property="remarks" /> |
| | | <result column="operator" jdbcType="BIGINT" property="operator" /> |
| | | <result column="operateDt" jdbcType="TIMESTAMP" property="operatedt" /> |
| | | <result column="operate_valid" jdbcType="TINYINT" property="operateValid" /> |
| | | <result column="order_no" jdbcType="VARCHAR" property="orderNo" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, cardId, clientId, money, amount, gift, afterRecharge, paymentId, price, remarks, |
| | | `operator`, operateDt |
| | | `operator`, operateDt, operate_valid, order_no |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | |
| | | delete from se_recharge_history |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | |
| | | <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeRechargeHistory"> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSe.SeRechargeHistory"> |
| | | <!--@mbg.generated--> |
| | | insert into se_recharge_history (id, cardId, clientId, money, |
| | | amount, gift, afterRecharge, |
| | | insert into se_recharge_history (id, cardId, clientId, |
| | | money, amount, gift, afterRecharge, |
| | | paymentId, price, remarks, |
| | | `operator`, operateDt) |
| | | values (#{id,jdbcType=BIGINT}, #{cardid,jdbcType=BIGINT}, #{clientid,jdbcType=BIGINT}, #{money,jdbcType=FLOAT}, |
| | | #{amount,jdbcType=FLOAT}, #{gift,jdbcType=FLOAT}, #{afterrecharge,jdbcType=FLOAT}, |
| | | `operator`, operateDt, operate_valid, |
| | | order_no) |
| | | 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}) |
| | | #{operator,jdbcType=BIGINT}, #{operatedt,jdbcType=TIMESTAMP}, #{operateValid,jdbcType=TINYINT}, |
| | | #{orderNo,jdbcType=VARCHAR}) |
| | | </insert> |
| | | |
| | | <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeRechargeHistory" useGeneratedKeys="true"> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeRechargeHistory"> |
| | | <!--@mbg.generated--> |
| | | insert into se_recharge_history |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="cardid != null"> |
| | | cardId, |
| | | </if> |
| | |
| | | <if test="operatedt != null"> |
| | | operateDt, |
| | | </if> |
| | | <if test="operateValid != null"> |
| | | operate_valid, |
| | | </if> |
| | | <if test="orderNo != null"> |
| | | order_no, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="cardid != null"> |
| | | #{cardid,jdbcType=BIGINT}, |
| | | </if> |
| | |
| | | </if> |
| | | <if test="operatedt != null"> |
| | | #{operatedt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="operateValid != null"> |
| | | #{operateValid,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="orderNo != null"> |
| | | #{orderNo,jdbcType=VARCHAR}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | |
| | | <if test="operatedt != null"> |
| | | operateDt = #{operatedt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="operateValid != null"> |
| | | operate_valid = #{operateValid,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="orderNo != null"> |
| | | order_no = #{orderNo,jdbcType=VARCHAR}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | |
| | | price = #{price,jdbcType=FLOAT}, |
| | | remarks = #{remarks,jdbcType=VARCHAR}, |
| | | `operator` = #{operator,jdbcType=BIGINT}, |
| | | operateDt = #{operatedt,jdbcType=TIMESTAMP} |
| | | operateDt = #{operatedt,jdbcType=TIMESTAMP}, |
| | | operate_valid = #{operateValid,jdbcType=TINYINT}, |
| | | order_no = #{orderNo,jdbcType=VARCHAR} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | |
| | | ); |
| | | </update> |
| | | |
| | | <!--充值机用根据订单号将充值历史记录改为有效--> |
| | | <update id="turnRechargeHistoryValidByOrderNumber"> |
| | | UPDATE se_recharge_history |
| | | SET operate_valid = 2 |
| | | WHERE operate_valid = 1 AND order_no = #{orderNumber} |
| | | </update> |
| | | |
| | | |
| | | <!-- /////////////////////////////////// --> |
| | | <!-- 统计相关 --> |
| | |
| | | import com.dy.common.util.NumUtil; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeClientCard; |
| | | import com.dy.pipIrrRemote.common.dto.DtoBase; |
| | | import com.dy.pipIrrRemote.monitor.common.ComCtrl; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | |
| | | package com.dy.pipIrrRemote.monitor.p202404V201.cd15; |
| | | |
| | | import com.dy.pipIrrGlobal.daoPr.PrControllerMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SeClientCardMapper; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeClientCard; |
| | | import com.dy.pipIrrRemote.monitor.common.ComSv; |
| | |
| | | |
| | | import com.dy.pipIrrGlobal.daoPr.PrIntakeVcMapper; |
| | | import com.dy.pipIrrGlobal.daoPr.PrWaterPriceMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SeClientCardMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SeVirtualCardMapper; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeClientCard; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeVirtualCard; |
| | | import com.dy.pipIrrGlobal.voSe.VoVirtualCard; |
| | | import com.dy.pipIrrRemote.monitor.common.ComSv; |
| | |
| | | import com.dy.pipIrrGlobal.command.ComSupport; |
| | | import com.dy.pipIrrGlobal.command.dto.Param; |
| | | import com.dy.pipIrrGlobal.daoSe.SeVirtualCardMapper; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeClientCard; |
| | | import com.dy.pipIrrGlobal.voRm.VoUnclosedParam; |
| | | import com.dy.pipIrrGlobal.voRm.VoUnclosedValve; |
| | | import com.dy.pipIrrGlobal.voSe.VoVirtualCard; |
| | |
| | | import com.dy.pipIrrGlobal.daoBa.BaSettingsMapper; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeActiveCard; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeClientCard; |
| | | import com.dy.pipIrrGlobal.util.Constant; |
| | | import com.dy.pipIrrGlobal.voSe.VoActiveCard; |
| | | import com.dy.pipIrrSell.cardOperate.enums.OperateTypeENUM; |
| | | import com.dy.pipIrrSell.clientCard.CardStateENUM; |
| | |
| | | import com.dy.pipIrrGlobal.voSe.VoRecharge; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.dubbo.common.utils.PojoUtils; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.daoSe.SeCardOperateMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SeClientCardMapper; |
| | | import com.dy.pipIrrGlobal.voSt.VoCardUsage; |
| | | import com.dy.pipIrrGlobal.voSt.VoICCard; |
| | | import com.dy.pipIrrStatistics.card.IcCardqo.CommonQO; |
| | |
| | | package com.dy.pipIrrStatistics.statistics; |
| | | |
| | | import com.dy.pipIrrGlobal.daoSe.SeRechargeHistoryMapper; |
| | | import com.dy.pipIrrGlobal.daoSt.StRechargeClientDayMapper; |
| | | import com.dy.pipIrrGlobal.daoSt.StRechargeClientMonthMapper; |
| | | import com.dy.pipIrrGlobal.daoSt.StRechargeClientYearMapper; |
| | |
| | | package com.dy.pipIrrStatistics.statistics; |
| | | |
| | | import com.dy.pipIrrGlobal.daoSe.SeRechargeHistoryMapper; |
| | | import com.dy.pipIrrGlobal.daoSt.StRechargeIcDayMapper; |
| | | import com.dy.pipIrrGlobal.daoSt.StRechargeIcMonthMapper; |
| | | import com.dy.pipIrrGlobal.daoSt.StRechargeIcYearMapper; |
| | |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.pipIrrGlobal.voSe.VoTermActiveCard; |
| | | import com.dy.pipIrrGlobal.voSe.VoTermRecharge; |
| | | import com.dy.pipIrrTerminal.card.dto.ActiveCard; |
| | | import com.dy.pipIrrTerminal.card.dto.DtoLoss; |
| | | import com.dy.pipIrrTerminal.card.dto.DtoRecharge; |
| | | import com.dy.pipIrrTerminal.card.dto.DtoReissue; |
| | | import com.dy.pipIrrTerminal.card.dto.*; |
| | | import jakarta.validation.Valid; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | Map map_result = cardSv.addRecharge(po); |
| | | Map map_result = cardSv.addRecharge(po, null); |
| | | if(map_result.get("success").equals(false)) { |
| | | return BaseResponseUtils.buildErrorMsg(map_result.get("msg").toString()); |
| | | } |
| | |
| | | return BaseResponseUtils.buildSuccess(map_result.get("content")) ; |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 操作执行回调 |
| | | * @param po |
| | | * @param bindingResult |
| | | * @return |
| | | */ |
| | | @PostMapping(path = "termCallBack", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> termCallBack(@RequestBody @Valid DtoCallBack po, BindingResult bindingResult) { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | Map map_result = cardSv.callBack(po); |
| | | if(map_result.get("success").equals(false)) { |
| | | return BaseResponseUtils.buildErrorMsg(map_result.get("msg").toString()); |
| | | } |
| | | return BaseResponseUtils.buildSuccess(map_result.get("content")) ; |
| | | } |
| | | } |
| | |
| | | import com.dy.pipIrrGlobal.pojoSe.SeCardOperate; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeClientCard; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeRechargeHistory; |
| | | import com.dy.pipIrrGlobal.voSe.VoAfterRecharge; |
| | | import com.dy.pipIrrGlobal.voSe.VoTermActiveCard; |
| | | import com.dy.pipIrrGlobal.voSe.VoTermRecharge; |
| | | import com.dy.pipIrrTerminal.card.dto.*; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.time.Duration; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | |
| | | seClientCard.setClientid(po.getClientId()); |
| | | seClientCard.setMoney(po.getAmount()); |
| | | seClientCard.setState(CardStateENUM.INVALID.getCode()); |
| | | seClientCard.setOrderNo(orderNo); |
| | | if (po.getOriginalCardId() != null) { |
| | | // 补卡 |
| | | seClientCard.setOriginalCardId(po.getOriginalCardId()); |
| | |
| | | * @return |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Map plusRecharge(ActiveCard po, Long cardNum) { |
| | | public Map plusRecharge(ActiveCard po, Long cardNum, String orderNo) { |
| | | Map map = new HashMap<>(); |
| | | map.put("success", false); |
| | | map.put("content", null); |
| | |
| | | dtoRecharge.setMoney(0f); |
| | | dtoRecharge.setGift(0f); |
| | | dtoRecharge.setPrice(0f); |
| | | Map map_plusRecharge = addRecharge(dtoRecharge); |
| | | Map map_plusRecharge = addRecharge(dtoRecharge, orderNo); |
| | | if (!map_plusRecharge.get("success").equals(true)) { |
| | | map.put("msg", "开卡失败-充值异常"); |
| | | return map; |
| | |
| | | } |
| | | |
| | | if (amount != null && amount > 0 && originalCardId == null) { |
| | | Map map_plusRecharge = plusRecharge(po, cardNum); |
| | | Map map_plusRecharge = plusRecharge(po, cardNum, orderNo); |
| | | if(map_plusRecharge.get("success").equals(false)) { |
| | | map.put("msg", map_plusRecharge.get("msg").toString()); |
| | | return map; |
| | |
| | | * @return |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Map addRecharge(DtoRecharge po) { |
| | | public Map addRecharge(DtoRecharge po, String orderNo) { |
| | | Map map = new HashMap<>(); |
| | | map.put("success", false); |
| | | map.put("content", null); |
| | |
| | | } |
| | | Long cardId = Long.parseLong(map_cardAndClient.get("cardId").toString()); |
| | | Long clientId = Long.parseLong(map_cardAndClient.get("clientId").toString()); |
| | | String orderNo = generateOrderNo(); |
| | | if(orderNo == null || orderNo.length() <= 0) { |
| | | orderNo = generateOrderNo(); |
| | | } |
| | | |
| | | /** |
| | | * 添加水卡充值操作记录 |
| | |
| | | seCardOperate.setRemarks(po.getRemarks()); |
| | | seCardOperate.setOperator(po.getOperator()); |
| | | seCardOperate.setOperateDt(new Date()); |
| | | seCardOperate.setOrderNo(orderNo); |
| | | seCardOperate.setOrderNo(orderNo + "p"); |
| | | seCardOperate.setOperateValid((byte) 1); |
| | | seCardOperateMapper.insert(seCardOperate); |
| | | Long rec = Optional.ofNullable(seCardOperate.getId()).orElse(0L); |
| | |
| | | seRechargeHistory.setOperator(po.getOperator()); |
| | | seRechargeHistory.setOperatedt(new Date()); |
| | | seRechargeHistory.setOperateValid((byte) 1); |
| | | seRechargeHistory.setOrderNo(orderNo); |
| | | seRechargeHistoryMapper.insert(seRechargeHistory); |
| | | Long rec_seRechargeHistory = Optional.ofNullable(seRechargeHistory.getId()).orElse(0L); |
| | | if (rec_seRechargeHistory == 0) { |
| | |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 操作回调 |
| | | * @param po |
| | | * @return |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Map callBack(DtoCallBack po) { |
| | | Map map = new HashMap<>(); |
| | |
| | | if(operateType == 1) { |
| | | /** |
| | | * 开卡操作执行通知 |
| | | * 1.依据水卡地址、订单号将无效状态的操作记录改为有效 |
| | | * 1.依据订单号将无效状态的操作记录改为有效 |
| | | * 2.依据水卡ID将无效状态的水卡记录改为有效 |
| | | * 3.如果开卡同步充值 |
| | | * 修改充值操作记录为有效 |
| | | * 修改充值历史记录为有效 |
| | | * 修改水卡表的操作信息 |
| | | */ |
| | | |
| | | Integer rec_ope = turnOperateValidByOrderNumber(orderNumber); |
| | | Integer rec_card = turnCardValidByOrderNumber(orderNumber); |
| | | if (rec_ope == 0 || rec_card == 0) { |
| | | map.put("msg", "不存在未生效的水卡"); |
| | | return map; |
| | | } |
| | | |
| | | |
| | | if(isMergeRecharge(cardId)) { |
| | | turnOperateValidByOrderNumber(orderNumber + "p"); |
| | | turnRechargeHistoryValidByOrderNumber(orderNumber); |
| | | updateCard(cardId, orderNumber+"p"); |
| | | } |
| | | } |
| | | |
| | | map.put("success", true); |
| | | map.put("msg", "操作成功"); |
| | | return map; |
| | | } |
| | | |
| | | // 根据订单号将操作记录改为有效 |
| | | public Integer turnOperateValidByOrderNumber(String orderNumber) { |
| | | return seCardOperateMapper.turnOperateValidByOrderNumber(orderNumber); |
| | | } |
| | | |
| | | // 根据订单号将水卡改为有效 |
| | | public Integer turnCardValidByOrderNumber(String orderNumber) { |
| | | return seClientCardMapper.turnCardValidByOrderNumber(orderNumber); |
| | | } |
| | | |
| | | // 根据订单号将充值历史改为有效 |
| | | public Integer turnRechargeHistoryValidByOrderNumber(String orderNumber) { |
| | | return seRechargeHistoryMapper.turnRechargeHistoryValidByOrderNumber(orderNumber); |
| | | } |
| | | |
| | | // 根据cardId判断是否是合并充值 |
| | | public Boolean isMergeRecharge(Long cardId) { |
| | | Integer plusRechargeCount = seCardOperateMapper.getPlusRechargeCount(cardId); |
| | | if (plusRechargeCount == 0) { |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | // 修改水卡信息 |
| | | public Boolean updateCard(Long cardId, String orderNumber) { |
| | | VoAfterRecharge voAfterRecharge = seCardOperateMapper.getBalanceAfterRecharge(orderNumber); |
| | | |
| | | SeClientCard clientCard = new SeClientCard(); |
| | | clientCard.setId(cardId); |
| | | clientCard.setMoney(voAfterRecharge.getBalanceAfterRecharge()); |
| | | clientCard.setRechargedt(voAfterRecharge.getOperateTime()); |
| | | clientCard.setLastoper(LastOperateENUM.RECHARGE.getCode()); |
| | | Integer rec_updateClientCard = seClientCardMapper.updateByPrimaryKeySelective(clientCard); |
| | | if (rec_updateClientCard == null || rec_updateClientCard == 0) { |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | } |
| | |
| | | package com.dy.pipIrrWechat.client; |
| | | |
| | | import com.dy.pipIrrGlobal.daoSe.SeClientCardMapper; |
| | | import com.dy.pipIrrGlobal.voWe.VoCards3; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import com.dy.common.mw.protocol.p206V202404.downVos.ComCd93_A3Vo; |
| | | import com.dy.common.util.IDLongGenerator; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.command.ComSupport; |
| | | import com.dy.pipIrrGlobal.command.dto.Param; |
| | |
| | | import com.dy.pipIrrGlobal.daoRm.RmCommandHistoryMapper; |
| | | import com.dy.pipIrrGlobal.daoRm.RmIrrigateProfileMapper; |
| | | import com.dy.pipIrrGlobal.daoRm.RmOpenCloseValveLastMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SeClientCardMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SeVirtualCardMapper; |
| | | import com.dy.pipIrrGlobal.pojoIr.IrIntakeOperate; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmCommandHistory; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeClientCard; |
| | | import com.dy.pipIrrGlobal.voRm.VoIrrigaterProfile; |
| | | import com.dy.pipIrrGlobal.voRm.VoRtuAndVc; |
| | | import com.dy.pipIrrGlobal.voRm.VoUnclosedValve; |
| | |
| | | import com.dy.pipIrrWechat.command.dto.AutomaticClose; |
| | | import com.dy.pipIrrWechat.command.dto.ValveClose; |
| | | import com.dy.pipIrrWechat.command.dto.ValveOpen; |
| | | import com.dy.pipIrrWechat.irrigatePlan.IrrigatePlanSv; |
| | | import com.dy.pipIrrWechat.irrigation.IrrigationSv; |
| | | import com.dy.pipIrrWechat.result.WechatResultCode; |
| | | import lombok.RequiredArgsConstructor; |
| | |
| | | import com.dy.common.mw.protocol.p206V202404.CodeV202404; |
| | | import com.dy.common.mw.protocol.p206V202404.ProtocolConstantV206V202404; |
| | | import com.dy.common.mw.protocol.p206V202404.downVos.ComCd15Vo; |
| | | import com.dy.common.mw.protocol.p206V202404.downVos.ComCd92_A2Vo; |
| | | import com.dy.common.mw.protocol.p206V202404.downVos.ComCd93_A3Vo; |
| | | import com.dy.common.util.IDLongGenerator; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | |
| | | import com.dy.pipIrrGlobal.command.ComSupport; |
| | | import com.dy.pipIrrGlobal.command.dto.Param; |
| | | import com.dy.pipIrrGlobal.daoSe.SeVirtualCardMapper; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeClientCard; |
| | | import com.dy.pipIrrGlobal.voRm.VoIrrigaterProfile; |
| | | import com.dy.pipIrrGlobal.voRm.VoUnclosedValve; |
| | | import com.dy.pipIrrGlobal.voSe.VoVirtualCard; |