2023-12-11 朱宝民 IC卡14个接口完成,全部改为长主键
| | |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023/12/6 15:41 |
| | | * @LastEditTime 2023/12/6 15:41 |
| | | * @date 2023/12/11 9:17 |
| | | * @LastEditTime 2023/12/11 9:17 |
| | | * @Description |
| | | */ |
| | | public interface SeReversalMapper { |
| | |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023/12/6 14:40 |
| | | * @LastEditTime 2023/12/6 14:40 |
| | | * @date 2023/12/11 9:11 |
| | | * @LastEditTime 2023/12/11 9:11 |
| | | * @Description |
| | | */ |
| | | public interface SeUnlockMapper { |
| | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.dy.common.po.BaseEntity; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import jakarta.validation.constraints.Positive; |
| | | import lombok.*; |
| | |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023/12/6 15:41 |
| | | * @LastEditTime 2023/12/6 15:41 |
| | | * @date 2023/12/11 9:17 |
| | | * @LastEditTime 2023/12/11 9:17 |
| | | * @Description |
| | | */ |
| | | |
| | |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "水卡冲正实体") |
| | | public class SeReversal { |
| | | public class SeReversal implements BaseEntity { |
| | | public static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | * 主键 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | @Schema(description = "实体id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | |
| | | private Long id; |
| | | |
| | | /** |
| | | * 水卡编号 |
| | | */ |
| | | * 水卡编号 |
| | | */ |
| | | @Schema(description = "水卡编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Positive(message = "水卡编号必须为大于0的整数") |
| | | private Long cardid; |
| | | |
| | | /** |
| | | * 卡片余额 |
| | | */ |
| | | * 农户编号 |
| | | */ |
| | | @Schema(description = "农户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Length(message = "农户编号不小于{min}", min = 1) |
| | | private Long clientid; |
| | | |
| | | /** |
| | | * 卡片余额 |
| | | */ |
| | | @Schema(description = "卡片余额", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @Length(message = "卡片余额不小于{min}字", min = 1) |
| | | private Double cardbalance; |
| | | private Float cardbalance; |
| | | |
| | | /** |
| | | * 系统余额 |
| | | */ |
| | | * 系统余额 |
| | | */ |
| | | @Schema(description = "系统余额", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @Length(message = "系统余额不小于{min}字", min = 1) |
| | | private Double systembalance; |
| | | private Float systembalance; |
| | | |
| | | /** |
| | | * 备注信息 |
| | | */ |
| | | * 备注信息 |
| | | */ |
| | | @Schema(description = "备注", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Length(message = "备注长度小于{max}字", min = 1, max = 200) |
| | | private String remarks; |
| | | |
| | | /** |
| | | * 操作人编号 |
| | | */ |
| | | * 操作人编号 |
| | | */ |
| | | @Schema(description = "操作人编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Positive(message = "操作人编号必须为大于0的整数") |
| | | private Long operator; |
| | | |
| | | /** |
| | | * 操作时间 |
| | | */ |
| | | * 操作时间 |
| | | */ |
| | | @Schema(description = "操作时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Date operatedt; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.dy.common.po.BaseEntity; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import jakarta.validation.constraints.Positive; |
| | | import lombok.*; |
| | |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023/12/6 14:40 |
| | | * @LastEditTime 2023/12/6 14:40 |
| | | * @date 2023/12/11 9:11 |
| | | * @LastEditTime 2023/12/11 9:11 |
| | | * @Description |
| | | */ |
| | | |
| | |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "水卡解锁实体") |
| | | public class SeUnlock { |
| | | public class SeUnlock implements BaseEntity { |
| | | public static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | * 主键 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | @Schema(description = "实体id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | |
| | | private Long id; |
| | | |
| | | /** |
| | | * 水卡编号 |
| | | */ |
| | | * 水卡编号 |
| | | */ |
| | | @Schema(description = "水卡编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Positive(message = "水卡编号必须为大于0的整数") |
| | | private Long cardid; |
| | | |
| | | /** |
| | | * 剩余金额 |
| | | */ |
| | | @Schema(description = "剩余金额", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @Length(message = "剩余金额不小于{min}字", min = 1) |
| | | private Double money; |
| | | * 农户编号 |
| | | */ |
| | | @Schema(description = "农户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Length(message = "农户编号不小于{min}", min = 1) |
| | | private Long clientid; |
| | | |
| | | /** |
| | | * 备注信息 |
| | | */ |
| | | * 剩余金额 |
| | | */ |
| | | @Schema(description = "剩余金额", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @Length(message = "剩余金额不小于{min}字", min = 1) |
| | | private Float money; |
| | | |
| | | /** |
| | | * 备注信息 |
| | | */ |
| | | @Schema(description = "备注", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Length(message = "备注长度小于{max}字", min = 1, max = 200) |
| | | private String remarks; |
| | | |
| | | /** |
| | | * 操作人编号 |
| | | */ |
| | | * 操作人编号 |
| | | */ |
| | | @Schema(description = "操作人编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Positive(message = "操作人编号必须为大于0的整数") |
| | | private Long operator; |
| | | |
| | | /** |
| | | * 操作时间 |
| | | */ |
| | | * 操作时间 |
| | | */ |
| | | @Schema(description = "操作时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Date operatedt; |
| | | } |
| | |
| | | delete from se_active_card |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeActiveCard" useGeneratedKeys="true"> |
| | | |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSe.SeActiveCard"> |
| | | <!--@mbg.generated--> |
| | | insert into se_active_card (cardId, clientId, cardCost, |
| | | paymentId, reissueAmount, operateType, |
| | | remarks, `operator`, operateDt |
| | | ) |
| | | values (#{cardid,jdbcType=BIGINT}, #{clientid,jdbcType=BIGINT}, #{cardcost,jdbcType=INTEGER}, |
| | | #{paymentid,jdbcType=BIGINT}, #{reissueamount,jdbcType=DOUBLE}, #{operatetype,jdbcType=TINYINT}, |
| | | #{remarks,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT}, #{operatedt,jdbcType=TIMESTAMP} |
| | | ) |
| | | insert 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="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeActiveCard" useGeneratedKeys="true">--> |
| | | <!-- <!–@mbg.generated–>--> |
| | | <!-- insert into se_active_card (cardId, clientId, cardCost, --> |
| | | <!-- paymentId, reissueAmount, operateType, --> |
| | | <!-- remarks, `operator`, operateDt--> |
| | | <!-- )--> |
| | | <!-- values (#{cardid,jdbcType=BIGINT}, #{clientid,jdbcType=BIGINT}, #{cardcost,jdbcType=INTEGER}, --> |
| | | <!-- #{paymentid,jdbcType=BIGINT}, #{reissueamount,jdbcType=DOUBLE}, #{operatetype,jdbcType=TINYINT}, --> |
| | | <!-- #{remarks,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT}, #{operatedt,jdbcType=TIMESTAMP}--> |
| | | <!-- )--> |
| | | <!-- </insert>--> |
| | | |
| | | <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeActiveCard" useGeneratedKeys="true"> |
| | | <!--@mbg.generated--> |
| | | insert into se_active_card |
| | |
| | | SELECT id AS cardId FROM se_client_card WHERE cardAddr = #{cardAddr} |
| | | </select> |
| | | |
| | | <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClientCard" useGeneratedKeys="true"> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClientCard"> |
| | | <!--@mbg.generated--> |
| | | insert into se_client_card (cardAddr, clientId, money, |
| | | `state`, createDt, replaceDt, |
| | | rechargeDt, lossDtDt, cancelDt, |
| | | unlockDt, reversalDt, consumeDt, |
| | | lastOper, remarks) |
| | | values (#{cardaddr,jdbcType=VARCHAR}, #{clientid,jdbcType=BIGINT}, #{money,jdbcType=FLOAT}, |
| | | #{state,jdbcType=TINYINT}, #{createdt,jdbcType=TIMESTAMP}, #{replacedt,jdbcType=TIMESTAMP}, |
| | | #{rechargedt,jdbcType=TIMESTAMP}, #{lossdtdt,jdbcType=TIMESTAMP}, #{canceldt,jdbcType=TIMESTAMP}, |
| | | #{unlockdt,jdbcType=TIMESTAMP}, #{reversaldt,jdbcType=TIMESTAMP}, #{consumedt,jdbcType=TIMESTAMP}, |
| | | #{lastoper,jdbcType=TINYINT}, #{remarks,jdbcType=VARCHAR}) |
| | | insert into se_client_card (id, cardAddr, clientId, money, `state`, createDt, replaceDt, rechargeDt, lossDtDt, cancelDt, unlockDt, reversalDt, consumeDt, lastOper, remarks) |
| | | values (#{id,jdbcType=BIGINT}, |
| | | #{cardaddr,jdbcType=VARCHAR}, |
| | | #{clientid,jdbcType=BIGINT}, |
| | | #{money,jdbcType=FLOAT}, |
| | | #{state,jdbcType=TINYINT}, |
| | | #{createdt,jdbcType=TIMESTAMP}, |
| | | #{replacedt,jdbcType=TIMESTAMP}, |
| | | #{rechargedt,jdbcType=TIMESTAMP}, |
| | | #{lossdtdt,jdbcType=TIMESTAMP}, |
| | | #{canceldt,jdbcType=TIMESTAMP}, |
| | | #{unlockdt,jdbcType=TIMESTAMP}, |
| | | #{reversaldt,jdbcType=TIMESTAMP}, |
| | | #{consumedt,jdbcType=TIMESTAMP}, |
| | | #{lastoper,jdbcType=TINYINT}, |
| | | #{remarks,jdbcType=VARCHAR}) |
| | | </insert> |
| | | |
| | | <!-- <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClientCard" useGeneratedKeys="true">--> |
| | | <!-- <!–@mbg.generated–>--> |
| | | <!-- insert into se_client_card (cardAddr, clientId, money, --> |
| | | <!-- `state`, createDt, replaceDt, --> |
| | | <!-- rechargeDt, lossDtDt, cancelDt, --> |
| | | <!-- unlockDt, reversalDt, consumeDt, --> |
| | | <!-- lastOper, remarks)--> |
| | | <!-- values (#{cardaddr,jdbcType=VARCHAR}, #{clientid,jdbcType=BIGINT}, #{money,jdbcType=FLOAT}, --> |
| | | <!-- #{state,jdbcType=TINYINT}, #{createdt,jdbcType=TIMESTAMP}, #{replacedt,jdbcType=TIMESTAMP}, --> |
| | | <!-- #{rechargedt,jdbcType=TIMESTAMP}, #{lossdtdt,jdbcType=TIMESTAMP}, #{canceldt,jdbcType=TIMESTAMP}, --> |
| | | <!-- #{unlockdt,jdbcType=TIMESTAMP}, #{reversaldt,jdbcType=TIMESTAMP}, #{consumedt,jdbcType=TIMESTAMP}, --> |
| | | <!-- #{lastoper,jdbcType=TINYINT}, #{remarks,jdbcType=VARCHAR})--> |
| | | <!-- </insert>--> |
| | | |
| | | <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClientCard" useGeneratedKeys="true"> |
| | | <!--@mbg.generated--> |
| | | insert into se_client_card |
| | |
| | | delete from se_recharge_history |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | |
| | | |
| | | <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeRechargeHistory" useGeneratedKeys="true"> |
| | | <!--@mbg.generated--> |
| | | insert into se_recharge_history (cardId, clientId, money, |
| | | amount, gift, afterRecharge, |
| | | paymentId, price, remarks, |
| | | `operator`, operateDt) |
| | | values (#{cardid,jdbcType=BIGINT}, #{clientid,jdbcType=BIGINT}, #{money,jdbcType=FLOAT}, |
| | | #{amount,jdbcType=FLOAT}, #{gift,jdbcType=FLOAT}, #{afterrecharge,jdbcType=FLOAT}, |
| | | #{paymentid,jdbcType=BIGINT}, #{price,jdbcType=FLOAT}, #{remarks,jdbcType=VARCHAR}, |
| | | #{operator,jdbcType=BIGINT}, #{operatedt,jdbcType=TIMESTAMP}) |
| | | insert into se_recharge_history (id, cardId, clientId, money, amount, gift, afterRecharge, paymentId, price, remarks, `operator`, operateDt) |
| | | values (#{id,jdbcType=BIGINT}, |
| | | #{cardid,jdbcType=BIGINT}, |
| | | #{clientid,jdbcType=BIGINT}, |
| | | #{money,jdbcType=FLOAT}, |
| | | #{amount,jdbcType=FLOAT}, |
| | | #{gift,jdbcType=FLOAT}, |
| | | #{afterrecharge,jdbcType=FLOAT}, |
| | | #{paymentid,jdbcType=BIGINT}, |
| | | #{price,jdbcType=FLOAT}, |
| | | #{remarks,jdbcType=VARCHAR}, |
| | | #{operator,jdbcType=BIGINT}, |
| | | #{operatedt,jdbcType=TIMESTAMP}) |
| | | </insert> |
| | | |
| | | <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeRechargeHistory" useGeneratedKeys="true"> |
| | | <!--@mbg.generated--> |
| | | insert into se_recharge_history |
| | |
| | | delete from se_recharge |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeRecharge" useGeneratedKeys="true"> |
| | | |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSe.SeRecharge"> |
| | | <!--@mbg.generated--> |
| | | insert into se_recharge (cardId, clientId, money, |
| | | amount, gift, afterRecharge, |
| | | paymentId, price, remarks, |
| | | `operator`, operateDt) |
| | | values (#{cardid,jdbcType=BIGINT}, #{clientid,jdbcType=BIGINT}, #{money,jdbcType=FLOAT}, |
| | | #{amount,jdbcType=FLOAT}, #{gift,jdbcType=FLOAT}, #{afterrecharge,jdbcType=FLOAT}, |
| | | #{paymentid,jdbcType=BIGINT}, #{price,jdbcType=FLOAT}, #{remarks,jdbcType=VARCHAR}, |
| | | #{operator,jdbcType=BIGINT}, #{operatedt,jdbcType=TIMESTAMP}) |
| | | insert into se_recharge (id, cardId, clientId, money, amount, gift, afterRecharge, paymentId, price, remarks, `operator`, operateDt) |
| | | values (#{id,jdbcType=BIGINT}, |
| | | #{cardid,jdbcType=BIGINT}, |
| | | #{clientid,jdbcType=BIGINT}, |
| | | #{money,jdbcType=FLOAT}, |
| | | #{amount,jdbcType=FLOAT}, |
| | | #{gift,jdbcType=FLOAT}, |
| | | #{afterrecharge,jdbcType=FLOAT}, |
| | | #{paymentid,jdbcType=BIGINT}, |
| | | #{price,jdbcType=FLOAT}, |
| | | #{remarks,jdbcType=VARCHAR}, |
| | | #{operator,jdbcType=BIGINT}, |
| | | #{operatedt,jdbcType=TIMESTAMP}) |
| | | </insert> |
| | | |
| | | <!-- <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeRecharge" useGeneratedKeys="true">--> |
| | | <!-- <!–@mbg.generated–>--> |
| | | <!-- insert into se_recharge (cardId, clientId, money, --> |
| | | <!-- amount, gift, afterRecharge, --> |
| | | <!-- paymentId, price, remarks, --> |
| | | <!-- `operator`, operateDt)--> |
| | | <!-- values (#{cardid,jdbcType=BIGINT}, #{clientid,jdbcType=BIGINT}, #{money,jdbcType=FLOAT}, --> |
| | | <!-- #{amount,jdbcType=FLOAT}, #{gift,jdbcType=FLOAT}, #{afterrecharge,jdbcType=FLOAT}, --> |
| | | <!-- #{paymentid,jdbcType=BIGINT}, #{price,jdbcType=FLOAT}, #{remarks,jdbcType=VARCHAR}, --> |
| | | <!-- #{operator,jdbcType=BIGINT}, #{operatedt,jdbcType=TIMESTAMP})--> |
| | | <!-- </insert>--> |
| | | |
| | | <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeRecharge" useGeneratedKeys="true"> |
| | | <!--@mbg.generated--> |
| | | insert into se_recharge |
| | |
| | | <!--@Table se_reversal--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="cardId" jdbcType="BIGINT" property="cardid" /> |
| | | <result column="clientId" jdbcType="BIGINT" property="clientid" /> |
| | | <result column="cardBalance" jdbcType="FLOAT" property="cardbalance" /> |
| | | <result column="systemBalance" jdbcType="FLOAT" property="systembalance" /> |
| | | <result column="remarks" jdbcType="VARCHAR" property="remarks" /> |
| | |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, cardId, cardBalance, systemBalance, remarks, `operator`, operateDt |
| | | id, cardId, clientId, cardBalance, systemBalance, remarks, `operator`, operateDt |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | |
| | | delete from se_reversal |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeReversal" useGeneratedKeys="true"> |
| | | |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSe.SeReversal"> |
| | | <!--@mbg.generated--> |
| | | insert into se_reversal (cardId, cardBalance, systemBalance, |
| | | remarks, `operator`, operateDt |
| | | ) |
| | | values (#{cardid,jdbcType=BIGINT}, #{cardbalance,jdbcType=FLOAT}, #{systembalance,jdbcType=FLOAT}, |
| | | #{remarks,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT}, #{operatedt,jdbcType=TIMESTAMP} |
| | | ) |
| | | insert into se_reversal (id, cardId, clientId, cardBalance, systemBalance, remarks, `operator`, operateDt) |
| | | values (#{id,jdbcType=BIGINT}, |
| | | #{cardid,jdbcType=BIGINT}, |
| | | #{clientid,jdbcType=BIGINT}, |
| | | #{cardbalance,jdbcType=FLOAT}, |
| | | #{systembalance,jdbcType=FLOAT}, |
| | | #{remarks,jdbcType=VARCHAR}, |
| | | #{operator,jdbcType=BIGINT}, |
| | | #{operatedt,jdbcType=TIMESTAMP}) |
| | | </insert> |
| | | |
| | | <!-- <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeReversal" useGeneratedKeys="true">--> |
| | | <!-- <!–@mbg.generated–>--> |
| | | <!-- insert into se_reversal (cardId, clientId, cardBalance, --> |
| | | <!-- systemBalance, remarks, `operator`, --> |
| | | <!-- operateDt)--> |
| | | <!-- values (#{cardid,jdbcType=BIGINT}, #{clientid,jdbcType=BIGINT}, #{cardbalance,jdbcType=FLOAT}, --> |
| | | <!-- #{systembalance,jdbcType=FLOAT}, #{remarks,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT}, --> |
| | | <!-- #{operatedt,jdbcType=TIMESTAMP})--> |
| | | <!-- </insert>--> |
| | | |
| | | <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeReversal" useGeneratedKeys="true"> |
| | | <!--@mbg.generated--> |
| | | insert into se_reversal |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="cardid != null"> |
| | | cardId, |
| | | </if> |
| | | <if test="clientid != null"> |
| | | clientId, |
| | | </if> |
| | | <if test="cardbalance != null"> |
| | | cardBalance, |
| | |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="cardid != null"> |
| | | #{cardid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="clientid != null"> |
| | | #{clientid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="cardbalance != null"> |
| | | #{cardbalance,jdbcType=FLOAT}, |
| | |
| | | <if test="cardid != null"> |
| | | cardId = #{cardid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="clientid != null"> |
| | | clientId = #{clientid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="cardbalance != null"> |
| | | cardBalance = #{cardbalance,jdbcType=FLOAT}, |
| | | </if> |
| | |
| | | <!--@mbg.generated--> |
| | | update se_reversal |
| | | set cardId = #{cardid,jdbcType=BIGINT}, |
| | | clientId = #{clientid,jdbcType=BIGINT}, |
| | | cardBalance = #{cardbalance,jdbcType=FLOAT}, |
| | | systemBalance = #{systembalance,jdbcType=FLOAT}, |
| | | remarks = #{remarks,jdbcType=VARCHAR}, |
| | |
| | | <!--根据指定的条件获取冲正记录数--> |
| | | <select id="getRecordCount" parameterType="java.util.Map" resultType="java.lang.Long"> |
| | | SELECT |
| | | COUNT(*) AS recordCount |
| | | COUNT(*) AS recordCount |
| | | FROM se_client_card card |
| | | INNER JOIN se_reversal rev ON rev.cardId = card.id |
| | | INNER JOIN ba_client cli ON card.clientId = cli.id |
| | |
| | | <!--根据指定的条件获取冲正记录--> |
| | | <select id="getReversals" resultType="com.dy.pipIrrGlobal.voSe.VoReversal"> |
| | | SELECT |
| | | (@i:=@i+1) AS id, |
| | | cli.`name` AS clientName, |
| | | cli.id AS clientId, |
| | | card.cardAddr, |
| | | rev.cardBalance, |
| | | (SELECT `name` FROM ba_user WHERE id = rev.operator) AS operator, |
| | | rev.operateDt |
| | | FROM se_client_card card |
| | | INNER JOIN se_reversal rev ON rev.cardId = card.id |
| | | INNER JOIN ba_client cli ON card.clientId = cli.id |
| | | , (SELECT @i:=0) AS itable |
| | | (@i:=@i+1) AS id, |
| | | cli.`name` AS clientName, |
| | | cli.id AS clientId, |
| | | card.cardAddr, |
| | | rev.cardBalance, |
| | | (SELECT `name` FROM ba_user WHERE id = rev.operator) AS operator, |
| | | rev.operateDt |
| | | FROM se_reversal rev |
| | | INNER JOIN se_client_card card ON rev.cardId = card.id |
| | | INNER JOIN ba_client cli ON rev.clientId = cli.id |
| | | , (SELECT @i:=0) AS itable |
| | | <where> |
| | | <if test = "clientName != null and clientName !=''"> |
| | | AND cli.name like CONCAT('%',#{clientName},'%') |
| | |
| | | </if> |
| | | |
| | | <if test = "reversalTimeStart != null and reversalTimeStop != null"> |
| | | AND card.unlockDt BETWEEN #{reversalTimeStart} AND #{reversalTimeStop} |
| | | AND rev.operateDt BETWEEN #{reversalTimeStart} AND #{reversalTimeStop} |
| | | </if> |
| | | </where> |
| | | |
| | |
| | | <!--@Table se_unlock--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="cardId" jdbcType="BIGINT" property="cardid" /> |
| | | <result column="clientId" jdbcType="BIGINT" property="clientid" /> |
| | | <result column="money" jdbcType="FLOAT" property="money" /> |
| | | <result column="remarks" jdbcType="VARCHAR" property="remarks" /> |
| | | <result column="operator" jdbcType="BIGINT" property="operator" /> |
| | |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, cardId, money, remarks, `operator`, operateDt |
| | | id, cardId, clientId, money, remarks, `operator`, operateDt |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | |
| | | delete from se_unlock |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeUnlock" useGeneratedKeys="true"> |
| | | |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSe.SeUnlock"> |
| | | <!--@mbg.generated--> |
| | | insert into se_unlock (cardId, money, remarks, |
| | | `operator`, operateDt) |
| | | values (#{cardid,jdbcType=BIGINT}, #{money,jdbcType=FLOAT}, #{remarks,jdbcType=VARCHAR}, |
| | | #{operator,jdbcType=BIGINT}, #{operatedt,jdbcType=TIMESTAMP}) |
| | | insert into se_unlock (id, cardId, clientId, money, remarks, `operator`, operateDt) |
| | | values (#{id,jdbcType=BIGINT}, |
| | | #{cardid,jdbcType=BIGINT}, |
| | | #{clientid,jdbcType=BIGINT}, |
| | | #{money,jdbcType=FLOAT}, |
| | | #{remarks,jdbcType=VARCHAR}, |
| | | #{operator,jdbcType=BIGINT}, |
| | | #{operatedt,jdbcType=TIMESTAMP}) |
| | | </insert> |
| | | |
| | | <!-- <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeUnlock" useGeneratedKeys="true">--> |
| | | <!-- <!–@mbg.generated–>--> |
| | | <!-- insert into se_unlock (cardId, clientId, money, --> |
| | | <!-- remarks, `operator`, operateDt--> |
| | | <!-- )--> |
| | | <!-- values (#{cardid,jdbcType=BIGINT}, #{clientid,jdbcType=BIGINT}, #{money,jdbcType=FLOAT}, --> |
| | | <!-- #{remarks,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT}, #{operatedt,jdbcType=TIMESTAMP}--> |
| | | <!-- )--> |
| | | <!-- </insert>--> |
| | | <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeUnlock" useGeneratedKeys="true"> |
| | | <!--@mbg.generated--> |
| | | insert into se_unlock |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="cardid != null"> |
| | | cardId, |
| | | </if> |
| | | <if test="clientid != null"> |
| | | clientId, |
| | | </if> |
| | | <if test="money != null"> |
| | | money, |
| | |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="cardid != null"> |
| | | #{cardid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="clientid != null"> |
| | | #{clientid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="money != null"> |
| | | #{money,jdbcType=FLOAT}, |
| | |
| | | <if test="cardid != null"> |
| | | cardId = #{cardid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="clientid != null"> |
| | | clientId = #{clientid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="money != null"> |
| | | money = #{money,jdbcType=FLOAT}, |
| | | </if> |
| | |
| | | <!--@mbg.generated--> |
| | | update se_unlock |
| | | set cardId = #{cardid,jdbcType=BIGINT}, |
| | | clientId = #{clientid,jdbcType=BIGINT}, |
| | | money = #{money,jdbcType=FLOAT}, |
| | | remarks = #{remarks,jdbcType=VARCHAR}, |
| | | `operator` = #{operator,jdbcType=BIGINT}, |
| | |
| | | <select id="getRecordCount" parameterType="java.util.Map" resultType="java.lang.Long"> |
| | | SELECT |
| | | COUNT(*) AS recordCount |
| | | FROM se_client_card card |
| | | INNER JOIN se_unlock unl ON unl.cardId = card.id |
| | | INNER JOIN ba_client cli ON card.clientId = cli.id |
| | | FROM se_unlock unl |
| | | INNER JOIN se_client_card card ON unl.cardId = card.id |
| | | INNER JOIN ba_client cli ON unl.clientId = cli.id |
| | | , (SELECT @i:=0) AS itable |
| | | <where> |
| | | <if test = "clientName != null and clientName !=''"> |
| | |
| | | </if> |
| | | |
| | | <if test = "unlocklTimeStart != null and unlockTimeStop != null"> |
| | | AND card.unlockDt BETWEEN #{unlocklTimeStart} AND #{unlockTimeStop} |
| | | AND unl.operateDt BETWEEN #{unlocklTimeStart} AND #{unlockTimeStop} |
| | | </if> |
| | | </where> |
| | | </select> |
| | |
| | | <!--根据指定的条件获取解锁记录--> |
| | | <select id="getUnlocks" resultType="com.dy.pipIrrGlobal.voSe.VoUnlock"> |
| | | SELECT |
| | | (@i:=@i+1) AS id, |
| | | cli.`name` AS clientName, |
| | | cli.id AS clientId, |
| | | card.cardAddr, |
| | | unl.money, |
| | | (SELECT `name` FROM ba_user WHERE id = unl.operator) AS operator, |
| | | unl.operateDt |
| | | FROM se_client_card card |
| | | INNER JOIN se_unlock unl ON unl.cardId = card.id |
| | | INNER JOIN ba_client cli ON card.clientId = cli.id |
| | | (@i:=@i+1) AS id, |
| | | cli.`name` AS clientName, |
| | | cli.id AS clientId, |
| | | card.cardAddr, |
| | | unl.money, |
| | | (SELECT `name` FROM ba_user WHERE id = unl.operator) AS operator, |
| | | unl.operateDt |
| | | FROM se_unlock unl |
| | | INNER JOIN se_client_card card ON unl.cardId = card.id |
| | | INNER JOIN ba_client cli ON unl.clientId = cli.id |
| | | , (SELECT @i:=0) AS itable |
| | | <where> |
| | | <if test = "clientName != null and clientName !=''"> |
| | |
| | | </if> |
| | | |
| | | <if test = "unlocklTimeStart != null and unlockTimeStop != null"> |
| | | AND card.unlockDt BETWEEN #{unlocklTimeStart} AND #{unlockTimeStop} |
| | | AND unl.operateDt BETWEEN #{unlocklTimeStart} AND #{unlockTimeStop} |
| | | </if> |
| | | </where> |
| | | |
New file |
| | |
| | | package com.dy.pipIrrSell.reversal; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import jakarta.validation.constraints.Min; |
| | | import jakarta.validation.constraints.NotBlank; |
| | | import jakarta.validation.constraints.Positive; |
| | | import lombok.*; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023/12/11 9:36 |
| | | * @LastEditTime 2023/12/11 9:36 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "冲正传入对象") |
| | | public class DtoReversal { |
| | | public static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 水卡地址 |
| | | */ |
| | | @Schema(description = "水卡地址", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotBlank |
| | | private String cardAddr; |
| | | |
| | | /** |
| | | * 农户编号 |
| | | */ |
| | | @Schema(description = "农户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Long clientId; |
| | | |
| | | /** |
| | | * 卡片余额 |
| | | */ |
| | | @Schema(description = "卡片余额", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Min(value = 0, message="卡片余额不能小于0") |
| | | private Float cardBalance; |
| | | |
| | | /** |
| | | * 系统余额 |
| | | */ |
| | | @Schema(description = "系统余额", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Min(value = 0, message="系统余额不能小于0") |
| | | private Float systemBalance; |
| | | |
| | | /** |
| | | * 备注信息 |
| | | */ |
| | | @Schema(description = "备注", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private String remarks; |
| | | |
| | | /** |
| | | * 操作人编号 |
| | | */ |
| | | @Schema(description = "操作人编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Positive(message = "操作人编号必须为大于0的整数") |
| | | private Long operator; |
| | | } |
| | |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.common.webUtil.ResultCodeMsg; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeClientCard; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeReversal; |
| | | import com.dy.pipIrrGlobal.voSe.VoReversal; |
| | | import com.dy.pipIrrSell.clientCard.ClientCardSv; |
| | | import com.dy.pipIrrSell.clientCard.LastOperateENUM; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.media.Content; |
| | |
| | | import io.swagger.v3.oas.annotations.responses.ApiResponse; |
| | | import io.swagger.v3.oas.annotations.responses.ApiResponses; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.validation.Valid; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.Optional; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | |
| | | @RequiredArgsConstructor |
| | | public class ReversalCtrl { |
| | | private final ReversalSv reversalSv; |
| | | private final ClientCardSv clientCardSv; |
| | | |
| | | @Operation(summary = "获得一页冲正记录", description = "返回一页冲正数据") |
| | | @ApiResponses(value = { |
| | |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | @Operation(summary = "添加冲正记录", description = "添加冲正记录") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "操作结果:true:成功,false:失败(BaseResponse.content)", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = Boolean.class))} |
| | | ) |
| | | }) |
| | | @PostMapping(path = "add", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @SsoAop("-1")//@SsoAop(power = "-1") |
| | | public BaseResponse<Boolean> add(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid DtoReversal po, @Parameter(hidden = true) BindingResult bindingResult){ |
| | | DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | /** |
| | | * cardId 水卡编号(非传入参数,由cardAddr反查) |
| | | * cardAddr 水卡地址 |
| | | * clientId 农户编号 |
| | | * cardBalance 卡片余额 |
| | | * systemBalance 系统余额 |
| | | * remarks 备注 |
| | | * operator 操作人编号 |
| | | * reversalTime 冲正 |
| | | */ |
| | | Long cardId = 0L; |
| | | String cardAddr = po.getCardAddr(); |
| | | Long clientId = po.getClientId(); |
| | | Float cardBalance = po.getCardBalance(); |
| | | Float systemBalance = po.getSystemBalance(); |
| | | String remarks = po.getRemarks(); |
| | | Long operator = po.getOperator(); |
| | | Date reversalTime = new Date(); |
| | | |
| | | /** |
| | | * 依据水卡地址获取水卡编号(主键) |
| | | */ |
| | | cardId = Optional.ofNullable(clientCardSv.getCardIdByAddr(cardAddr)).orElse(0L); |
| | | if(cardId == 0) { |
| | | return BaseResponseUtils.buildFail("卡号错误,该卡不存在"); |
| | | } |
| | | |
| | | /** |
| | | * 修改农户卡信息: |
| | | * 挂失时间 |
| | | * 最后操作类型-4 |
| | | */ |
| | | SeClientCard seClientCard = new SeClientCard(); |
| | | seClientCard.setId(cardId); |
| | | seClientCard.setReversaldt(reversalTime); |
| | | seClientCard.setLastoper(LastOperateENUM.REVERSAL.getCode()); |
| | | Integer rec_updateClientCard = Optional.ofNullable(clientCardSv.UpdateClientCard(seClientCard)).orElse(0); |
| | | if(rec_updateClientCard == 0) { |
| | | return BaseResponseUtils.buildFail("冲正失败-农户卡冲正异常"); |
| | | } |
| | | |
| | | /** |
| | | * 添加解锁记录 |
| | | */ |
| | | SeReversal reversal = new SeReversal(); |
| | | reversal.setCardid(cardId); |
| | | reversal.setClientid(clientId); |
| | | reversal.setCardbalance(cardBalance); |
| | | reversal.setSystembalance(systemBalance); |
| | | reversal.setRemarks(remarks); |
| | | reversal.setOperator(operator); |
| | | reversal.setOperatedt(reversalTime); |
| | | Long rec = Optional.ofNullable(reversalSv.add(reversal)).orElse(0L); |
| | | if(rec == 0) { |
| | | return BaseResponseUtils.buildFail("解锁失败-解锁记录写入异常"); |
| | | } |
| | | |
| | | return BaseResponseUtils.buildSuccess(true) ; |
| | | } |
| | | } |
| | |
| | | |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.daoSe.SeReversalMapper; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeReversal; |
| | | import com.dy.pipIrrGlobal.voSe.VoReversal; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.dubbo.common.utils.PojoUtils; |
| | |
| | | rsVo.obj = seReversalMapper.getReversals(params); |
| | | return rsVo ; |
| | | } |
| | | |
| | | /** |
| | | * 添加冲正记录 |
| | | * @param po |
| | | * @return |
| | | */ |
| | | public Long add(SeReversal po) { |
| | | seReversalMapper.insert(po); |
| | | return po.getId(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrSell.unlock; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import jakarta.validation.constraints.Min; |
| | | import jakarta.validation.constraints.NotBlank; |
| | | import jakarta.validation.constraints.Positive; |
| | | import lombok.*; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023/12/11 9:34 |
| | | * @LastEditTime 2023/12/11 9:34 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "解锁传入对象") |
| | | public class DtoUnlock { |
| | | public static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 水卡地址 |
| | | */ |
| | | @Schema(description = "水卡地址", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotBlank |
| | | private String cardAddr; |
| | | |
| | | /** |
| | | * 农户编号 |
| | | */ |
| | | @Schema(description = "农户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Long clientId; |
| | | |
| | | /** |
| | | * 余额 |
| | | */ |
| | | @Schema(description = "余额", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Min(value = 0, message="余额不能小于0") |
| | | private Float money; |
| | | |
| | | /** |
| | | * 备注信息 |
| | | */ |
| | | @Schema(description = "备注", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private String remarks; |
| | | |
| | | /** |
| | | * 操作人编号 |
| | | */ |
| | | @Schema(description = "操作人编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Positive(message = "操作人编号必须为大于0的整数") |
| | | private Long operator; |
| | | } |
| | |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.common.webUtil.ResultCodeMsg; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeClientCard; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeUnlock; |
| | | import com.dy.pipIrrGlobal.voSe.VoUnlock; |
| | | import com.dy.pipIrrSell.clientCard.ClientCardSv; |
| | | import com.dy.pipIrrSell.clientCard.LastOperateENUM; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.media.Content; |
| | |
| | | import io.swagger.v3.oas.annotations.responses.ApiResponse; |
| | | import io.swagger.v3.oas.annotations.responses.ApiResponses; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.validation.Valid; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.Optional; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | |
| | | @RequiredArgsConstructor |
| | | public class UnlockCtrl { |
| | | private final UnlockSv unlockSv; |
| | | private final ClientCardSv clientCardSv; |
| | | |
| | | @Operation(summary = "获得一页解锁记录", description = "返回一页解锁数据") |
| | | @ApiResponses(value = { |
| | |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | @Operation(summary = "添加解锁记录", description = "添加解锁记录") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "操作结果:true:成功,false:失败(BaseResponse.content)", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = Boolean.class))} |
| | | ) |
| | | }) |
| | | @PostMapping(path = "add", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @SsoAop("-1")//@SsoAop(power = "-1") |
| | | public BaseResponse<Boolean> add(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid DtoUnlock po, @Parameter(hidden = true) BindingResult bindingResult){ |
| | | DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | /** |
| | | * cardId 水卡编号(非传入参数,由cardAddr反查) |
| | | * cardAddr 水卡地址 |
| | | * clientId 农户编号 |
| | | * money 余额 |
| | | * remarks 备注 |
| | | * operator 操作人编号 |
| | | * unlockTime 解锁时间 |
| | | */ |
| | | Long cardId = 0L; |
| | | String cardAddr = po.getCardAddr(); |
| | | Long clientId = po.getClientId(); |
| | | Float money = po.getMoney(); |
| | | String remarks = po.getRemarks(); |
| | | Long operator = po.getOperator(); |
| | | Date unlockTime = new Date(); |
| | | |
| | | /** |
| | | * 依据水卡地址获取水卡编号(主键) |
| | | */ |
| | | cardId = Optional.ofNullable(clientCardSv.getCardIdByAddr(cardAddr)).orElse(0L); |
| | | if(cardId == 0) { |
| | | return BaseResponseUtils.buildFail("卡号错误,该卡不存在"); |
| | | } |
| | | |
| | | /** |
| | | * 修改农户卡信息: |
| | | * 挂失时间 |
| | | * 最后操作类型-4 |
| | | */ |
| | | SeClientCard seClientCard = new SeClientCard(); |
| | | seClientCard.setId(cardId); |
| | | seClientCard.setUnlockdt(unlockTime); |
| | | seClientCard.setLastoper(LastOperateENUM.UNLOCK.getCode()); |
| | | Integer rec_updateClientCard = Optional.ofNullable(clientCardSv.UpdateClientCard(seClientCard)).orElse(0); |
| | | if(rec_updateClientCard == 0) { |
| | | return BaseResponseUtils.buildFail("解锁失败-农户卡解锁异常"); |
| | | } |
| | | |
| | | /** |
| | | * 添加解锁记录 |
| | | */ |
| | | SeUnlock seUnlock = new SeUnlock(); |
| | | seUnlock.setCardid(cardId); |
| | | seUnlock.setClientid(clientId); |
| | | seUnlock.setMoney(money); |
| | | seUnlock.setRemarks(remarks); |
| | | seUnlock.setOperator(operator); |
| | | seUnlock.setOperatedt(unlockTime); |
| | | Long rec = Optional.ofNullable(unlockSv.add(seUnlock)).orElse(0L); |
| | | if(rec == 0) { |
| | | return BaseResponseUtils.buildFail("解锁失败-解锁记录写入异常"); |
| | | } |
| | | |
| | | return BaseResponseUtils.buildSuccess(true) ; |
| | | } |
| | | } |
| | |
| | | |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.daoSe.SeUnlockMapper; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeUnlock; |
| | | import com.dy.pipIrrGlobal.voSe.VoUnlock; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.dubbo.common.utils.PojoUtils; |
| | |
| | | rsVo.obj = seUnlockMapper.getUnlocks(params); |
| | | return rsVo ; |
| | | } |
| | | |
| | | /** |
| | | * 添加解锁记录 |
| | | * @param po |
| | | * @return |
| | | */ |
| | | public Long add(SeUnlock po) { |
| | | seUnlockMapper.insert(po); |
| | | return po.getId(); |
| | | } |
| | | } |