Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV
| | |
| | | - **工具集**: Hutool 5.8.22 |
| | | - **日志框架**: Log4j2 2.20.0 |
| | | |
| | | ## ID生成器使用说明 |
| | | |
| | | 系统使用自定义的IDLongGenerator来生成唯一的Long型ID,确保在分布式环境下的ID唯一性。 |
| | | |
| | | ### IDLongGenerator特性 |
| | | |
| | | - **格式**: `年月日时分秒` + `3位自增序列` + `2位系统后缀` |
| | | - **长度**: 19位数字(如:20231218104504069**00**) |
| | | - **并发性**: 支持同一秒内生成1000个不同ID |
| | | - **分布式**: 通过后缀区分不同子系统,避免ID冲突 |
| | | |
| | | ### 使用方式 |
| | | |
| | | ```java |
| | | // 依赖注入 |
| | | @Autowired |
| | | private IDLongGenerator idLongGenerator; |
| | | |
| | | // 生成ID |
| | | Long id = idLongGenerator.generate(); |
| | | ``` |
| | | |
| | | ### 应用场景 |
| | | |
| | | - **管理卡创建**: createManagementCard方法中使用IDLongGenerator生成管理卡ID |
| | | - **实体主键**: 所有业务实体的主键ID生成 |
| | | - **订单号**: 业务流水号生成 |
| | | - **日志记录**: 操作记录的唯一标识 |
| | | |
| | | ### 配置说明 |
| | | |
| | | 系统启动时会自动设置ID后缀,不同的服务模块使用不同的后缀来避免ID冲突: |
| | | |
| | | ```xml |
| | | <!-- web.xml或Spring配置 --> |
| | | <context-param> |
| | | <param-name>idSuffix</param-name> |
| | | <param-value>01</param-value> <!-- 不同服务使用不同后缀 --> |
| | | </context-param> |
| | | ``` |
| | | |
| | | ## 开发环境搭建 |
| | | |
| | | ### 前置条件 |
| | |
| | | /** |
| | | * 依据水卡地址获取水卡编号(12月19日废弃) |
| | | * 2024-06-30取消废弃,恢复使用 |
| | | * |
| | | * @param cardAddr |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据水卡编号获取水卡表主键(12月19日添加后废弃) |
| | | * |
| | | * @param cardNum 16位水卡编号 |
| | | * @return 水卡表主键 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据行政区划串模块查询水卡编号 |
| | | * |
| | | * @param areaCode |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据水卡编号获取水卡表主键及农户编号 |
| | | * |
| | | * @param cardNum |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据水卡编号获取水卡对应的农户id和姓名 |
| | | * |
| | | * @param cardAddr |
| | | * @param cardNum |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 得到水卡对象 |
| | | * |
| | | * @param cardAddr |
| | | * @param cardNum |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 根据农户主键获取水卡列表(物理卡+虚拟卡) |
| | | * |
| | | * @param clientId |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据水卡编号获取操作记录列表 |
| | | * |
| | | * @param cardNum 水卡编号 |
| | | * @return 水卡操作记录列表 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据水卡编号获取余额 |
| | | * |
| | | * @param cardNum 水卡编号 |
| | | * @return 余额 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据水卡编号获取充值总额 |
| | | * |
| | | * @param cardNum |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据水卡编号获取卡片状态 |
| | | * |
| | | * @param cardNum |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据指定条件获取水卡列表记录数,应用程序使用 |
| | | * |
| | | * @param params |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据指定条件获取水卡列表,应用程序使用 |
| | | * |
| | | * @param params |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取已挂失,未补卡的记录数量,应用程序使用 |
| | | * |
| | | * @return |
| | | */ |
| | | Long getUnreplacedRecordCount(); |
| | | |
| | | /** |
| | | * 获取已挂失,未补卡的记录,应用程序使用 |
| | | * |
| | | * @return |
| | | */ |
| | | List<VoCards> getUnreplaced(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据指定水卡编号获取挂失记录数量(补卡、解锁使用) |
| | | * |
| | | * @param cardNum |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据指定水卡编号获取已补卡数量(补卡、解锁使用) |
| | | * |
| | | * @param cardNum 水卡编号 |
| | | * @return 符合条件记录数,最多一条 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据农户姓名和手机号获取水卡列表记录数,应用程序使用 |
| | | * |
| | | * @param params |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据农户姓名和手机号获取水卡列表,应用程序使用 |
| | | * |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoCards2> getCardsByClientNameAndPhone(Map<?, ?> params); |
| | | |
| | | |
| | | /** |
| | | * 根据农户ID查询正常状态的水卡列表,小程序使用 |
| | | * |
| | | * @param clientId |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 更新实体卡剩余金额 |
| | | * |
| | | * @param id |
| | | * @param money |
| | | */ |
| | |
| | | |
| | | /** |
| | | *当前余额总量(物理卡) |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据水卡地址获取水卡数量,用来判断该卡是否允许开卡,无效卡片排除在外 |
| | | * |
| | | * @param cardAddr |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据水卡地址获取指定状态的水卡数量,用来判断该卡是否允许开卡 |
| | | * |
| | | * @param cardAddr |
| | | * @return |
| | | */ |
| | | Long getCountByCardAddrAndState(String cardAddr); |
| | | |
| | | |
| | | /** |
| | | * 获取指定时间段水卡使用情况记录数量 |
| | | * |
| | | * @param params |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取指定时间段水卡使用情况:充值合计、消费合计、余额 |
| | | * |
| | | * @param params |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取指定时间段内水卡充值总计 |
| | | * |
| | | * @param timeStart |
| | | * @param timeStop |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 获取指定时间段内水卡消费总计 |
| | | * |
| | | * @param timeStart |
| | | * @param timeStop |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 依据水卡地址将最后一条无效状态的指定操作记录改为有效 |
| | | * |
| | | * @param cardAddr |
| | | * @param operateType |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 充值机用根据订单号将水卡改为有效 |
| | | * |
| | | * @param orderNumber |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据水卡ID获取原水卡ID,补卡通知中使用 |
| | | * |
| | | * @param cardId |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 充值机用根据补卡的订单号将挂失水卡余额置零 |
| | | * |
| | | * @param orderNumber |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 充值机用获取农户水卡信息 |
| | | * |
| | | * @param cardAddr |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取已挂失水卡列表记录数量 |
| | | * |
| | | * @param params |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取已挂失水卡列表 |
| | | * |
| | | * @param params |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据水卡编号获取卡信息 |
| | | * |
| | | * @param cardNum |
| | | * @return |
| | | */ |
| | | VoCardByClientNum getCardByCardNum(@Param("cardNum") String cardNum); |
| | | |
| | | /** |
| | | * 检查卡地址是否已存在(管理卡表 + 农户水卡表) |
| | | * |
| | | * @param cardAddr 卡地址 |
| | | * @return 存在的记录数量 |
| | | */ |
| | | Long checkCardAddrExists(@Param("cardAddr") String cardAddr); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoSe.SePaymentMethod; |
| | | import com.dy.pipIrrGlobal.voSe.VoPaymentMethod; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * @return 未删除付款方式 |
| | | */ |
| | | List<SePaymentMethod> getPaymentMethods(); |
| | | |
| | | /** |
| | | * 充值机用获取支付方式 |
| | | * @return |
| | | */ |
| | | List<VoPaymentMethod> getPayMethods(); |
| | | } |
| | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.dy.common.po.BaseEntity; |
| | |
| | | */ |
| | | private String remarks; |
| | | |
| | | /** |
| | | * 注销时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @TableField("cancel_time") |
| | | private Date cancelTime; |
| | | |
| | | /** |
| | | * 卡片状态;1-正常,2-已注销,3-已挂失,4-未写卡 |
| | | */ |
| | | @NotNull(message = "卡片状态不能为空") |
| | | private Byte state; |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.voSe; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.fasterxml.jackson.annotation.JsonPropertyOrder; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2025-06-25 10:58 |
| | | * @LastEditTime 2025-06-25 10:58 |
| | | * @Description 充值机用付款方式视图对象 |
| | | */ |
| | | |
| | | @Data |
| | | @JsonPropertyOrder({"startupMode", "planStartTime", "duration"}) |
| | | public class VoPaymentMethod { |
| | | public static final long serialVersionUID = 202506251100001L; |
| | | |
| | | /** |
| | | * 支付方式ID |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 支付方式名称 |
| | | */ |
| | | private String name; |
| | | } |
| | |
| | | ORDER BY card.createDt DESC |
| | | LIMIT 1 |
| | | </select> |
| | | |
| | | <!--检查卡地址是否已存在(管理卡表 + 农户水卡表)--> |
| | | <select id="checkCardAddrExists" resultType="java.lang.Long"> |
| | | SELECT COUNT(*) AS totalCount FROM ( |
| | | -- 检查管理卡表中正常(1)和挂失(3)状态的记录,排除已注销(2)和未写卡(4) |
| | | SELECT card_addr FROM se_management_card |
| | | WHERE card_addr = #{cardAddr} |
| | | AND state IN (1, 3) |
| | | |
| | | UNION ALL |
| | | |
| | | -- 检查农户水卡表中正常(1)和挂失(3)状态的记录 |
| | | SELECT cardAddr FROM se_client_card |
| | | WHERE cardAddr = #{cardAddr} |
| | | AND state IN (1, 3) |
| | | ) AS combined_result |
| | | </select> |
| | | </mapper> |
| | |
| | | <result column="domain" jdbcType="VARCHAR" property="domain" /> |
| | | <result column="open_clost_time" jdbcType="INTEGER" property="openClostTime" /> |
| | | <result column="remarks" jdbcType="VARCHAR" property="remarks" /> |
| | | <result column="cancel_time" jdbcType="TIMESTAMP" property="cancelTime" /> |
| | | <result column="state" jdbcType="TINYINT" property="state" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, protocol, card_addr, security_code, card_type, create_time, order_no, district_code, |
| | | project_no, ip, `domain`, open_clost_time, remarks |
| | | project_no, ip, `domain`, open_clost_time, remarks, cancel_time, state |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | |
| | | security_code, card_type, create_time, |
| | | order_no, district_code, project_no, |
| | | ip, `domain`, open_clost_time, |
| | | remarks) |
| | | remarks, cancel_time, state) |
| | | values (#{id,jdbcType=BIGINT}, #{protocol,jdbcType=VARCHAR}, #{cardAddr,jdbcType=VARCHAR}, |
| | | #{securityCode,jdbcType=VARCHAR}, #{cardType,jdbcType=TINYINT}, #{createTime,jdbcType=TIMESTAMP}, |
| | | #{orderNo,jdbcType=VARCHAR}, #{districtCode,jdbcType=VARCHAR}, #{projectNo,jdbcType=INTEGER}, |
| | | #{ip,jdbcType=VARCHAR}, #{domain,jdbcType=VARCHAR}, #{openClostTime,jdbcType=INTEGER}, |
| | | #{remarks,jdbcType=VARCHAR}) |
| | | #{remarks,jdbcType=VARCHAR}, #{cancelTime,jdbcType=TIMESTAMP}, #{state,jdbcType=TINYINT}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeManagementCard"> |
| | | <!--@mbg.generated--> |
| | |
| | | <if test="remarks != null"> |
| | | remarks, |
| | | </if> |
| | | <if test="cancelTime != null"> |
| | | cancel_time, |
| | | </if> |
| | | <if test="state != null"> |
| | | state, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | |
| | | </if> |
| | | <if test="remarks != null"> |
| | | #{remarks,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="cancelTime != null"> |
| | | #{cancelTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="state != null"> |
| | | #{state,jdbcType=TINYINT}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | |
| | | <if test="remarks != null"> |
| | | remarks = #{remarks,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="cancelTime != null"> |
| | | cancel_time = #{cancelTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="state != null"> |
| | | state = #{state,jdbcType=TINYINT}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | |
| | | ip = #{ip,jdbcType=VARCHAR}, |
| | | `domain` = #{domain,jdbcType=VARCHAR}, |
| | | open_clost_time = #{openClostTime,jdbcType=INTEGER}, |
| | | remarks = #{remarks,jdbcType=VARCHAR} |
| | | remarks = #{remarks,jdbcType=VARCHAR}, |
| | | cancel_time = #{cancelTime,jdbcType=TIMESTAMP}, |
| | | state = #{state,jdbcType=TINYINT} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
| | |
| | | <select id="getPaymentMethods" resultType="com.dy.pipIrrGlobal.pojoSe.SePaymentMethod"> |
| | | SELECT * FROM se_payment_method WHERE deleted = 0 |
| | | </select> |
| | | |
| | | <!--充值机用获取支付方式--> |
| | | <select id="getPayMethods" resultType="com.dy.pipIrrGlobal.voSe.VoPaymentMethod"> |
| | | SELECT |
| | | id, |
| | | name |
| | | FROM se_payment_method |
| | | WHERE deleted = 0 |
| | | </select> |
| | | </mapper> |
| | |
| | | */ |
| | | @PostMapping(path = "termActiveCard", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @SsoAop() |
| | | public BaseResponse<VoTermActiveCard> termActiveCard(@RequestBody @Valid ActiveCard po, BindingResult bindingResult) { |
| | | public BaseResponse<VoTermActiveCard> termActiveCard(@RequestBody @Valid ActiveCard po, |
| | | BindingResult bindingResult) { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | return BaseResponseUtils |
| | | .buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | Map map_result = cardSv.activeOrReissueTermCard(po); |
| | |
| | | @SsoAop() |
| | | public BaseResponse<VoTermCommon> termRecharge(@RequestBody @Valid DtoRecharge po, BindingResult bindingResult) { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | return BaseResponseUtils |
| | | .buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | Map map_result = cardSv.addRecharge(po, null); |
| | |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> termReportLoss(@RequestBody @Valid DtoLoss po, BindingResult bindingResult) { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | return BaseResponseUtils |
| | | .buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | Map map_result = cardSv.reportLoss(po); |
| | |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> termUnlock(@RequestBody @Valid DtoUnlock po, BindingResult bindingResult) { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | return BaseResponseUtils |
| | | .buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | Map map_result = cardSv.unlock(po); |
| | |
| | | @SsoAop() |
| | | public BaseResponse<VoTermCommon> termReissue(@RequestBody @Valid DtoReissue po, BindingResult bindingResult) { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | return BaseResponseUtils |
| | | .buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | Map map_result = cardSv.reissue(po); |
| | |
| | | @SsoAop() |
| | | public BaseResponse<VoTermCommon> termCancel(@RequestBody @Valid DtoCancel po, BindingResult bindingResult) { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | return BaseResponseUtils |
| | | .buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | Map map_result = cardSv.cancel(po); |
| | |
| | | |
| | | /** |
| | | * 补扣 |
| | | * |
| | | * @param po |
| | | * @param bindingResult |
| | | * @return |
| | | */ |
| | | @PostMapping(path = "termRepay", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @SsoAop() |
| | | public BaseResponse<VoRepaySupplement> termRepay(@RequestBody @Valid DtoRepaySupplement po, BindingResult bindingResult) { |
| | | public BaseResponse<VoRepaySupplement> termRepay(@RequestBody @Valid DtoRepaySupplement po, |
| | | BindingResult bindingResult) { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | return BaseResponseUtils |
| | | .buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | if(po.getRepayMorny() == null || po.getRepayMorny() <= 0) { |
| | |
| | | |
| | | /** |
| | | * 返还 |
| | | * |
| | | * @param po |
| | | * @param bindingResult |
| | | * @return |
| | | */ |
| | | @PostMapping(path = "supplement", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @SsoAop() |
| | | public BaseResponse<VoRepaySupplement> supplement(@RequestBody @Valid DtoRepaySupplement po, BindingResult bindingResult) { |
| | | public BaseResponse<VoRepaySupplement> supplement(@RequestBody @Valid DtoRepaySupplement po, |
| | | BindingResult bindingResult) { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | return BaseResponseUtils |
| | | .buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | if(po.getSupplementMoney() == null || po.getSupplementMoney() <= 0) { |
| | |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> termCallBack(@RequestBody @Valid DtoCallBack po, BindingResult bindingResult) { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | return BaseResponseUtils |
| | | .buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | Map map_result = cardSv.callBack(po); |
| | |
| | | |
| | | /** |
| | | * 读取卡信息 |
| | | * |
| | | * @param cardAddr |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据指定条件获取水卡列表,终端应用程序使用 |
| | | * |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | @Operation(summary = "获得一页水卡记录", description = "返回一页水卡数据") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "返回一页水卡数据(BaseResponse.content:QueryResultVo[{}])", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = VoCards.class))} |
| | | ) |
| | | @ApiResponse(responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, description = "返回一页水卡数据(BaseResponse.content:QueryResultVo[{}])", content = { |
| | | @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, schema = @Schema(implementation = VoCards.class)) }) |
| | | }) |
| | | @GetMapping(path = "getcards") |
| | | @SsoAop() |
| | |
| | | |
| | | /** |
| | | * 获取已挂失的水卡列表,终端应用程序使用 |
| | | * |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | @Operation(summary = "获得一页已挂失水卡记录", description = "返回一页已挂失水卡数据") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "返回一页已挂失水卡数据(BaseResponse.content:QueryResultVo[{}])", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = VoCards.class))} |
| | | ) |
| | | @ApiResponse(responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, description = "返回一页已挂失水卡数据(BaseResponse.content:QueryResultVo[{}])", content = { |
| | | @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, schema = @Schema(implementation = VoCards.class)) }) |
| | | }) |
| | | @GetMapping(path = "getlostcards") |
| | | @SsoAop() |
| | |
| | | |
| | | /** |
| | | * 根据水卡编号获取卡信息 |
| | | * |
| | | * @param cardNum 水卡编号 |
| | | * @return |
| | | */ |
| | | @Operation(summary = "根据水卡编号获取卡信息", description = "根据水卡编号获取对应的卡信息") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "返回卡信息(BaseResponse.content:VoCardByClientNum)", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = VoCardByClientNum.class))} |
| | | ) |
| | | @ApiResponse(responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, description = "返回卡信息(BaseResponse.content:VoCardByClientNum)", content = { |
| | | @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, schema = @Schema(implementation = VoCardByClientNum.class)) }) |
| | | }) |
| | | @GetMapping(path = "getcardbycardnum") |
| | | @SsoAop() |
| | |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 创建管理卡 |
| | | * |
| | | * @param dto 创建管理卡参数 |
| | | * @param bindingResult 参数验证结果 |
| | | * @return 创建结果 |
| | | */ |
| | | @Operation(summary = "创建管理卡", description = "创建充值机用管理卡") |
| | | @ApiResponses(value = { |
| | | @ApiResponse(responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, description = "创建成功,返回订单号", content = { |
| | | @Content(mediaType = MediaType.APPLICATION_JSON_VALUE) }) |
| | | }) |
| | | @PostMapping(path = "createManagementCard", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @SsoAop() |
| | | public BaseResponse<String> createManagementCard(@RequestBody @Valid CreateManagementCardDto dto, |
| | | BindingResult bindingResult) { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils |
| | | .buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | // 验证卡片类型是否在允许范围内 |
| | | if (dto.getCardType() < 2 || dto.getCardType() > 10) { |
| | | return BaseResponseUtils.buildErrorMsg("卡片类型必须在2-10之间"); |
| | | } |
| | | |
| | | // 检查卡片地址是否已存在 |
| | | if (cardSv.isCardAddrExists(dto.getCardAddr())) { |
| | | return BaseResponseUtils.buildErrorMsg("该卡片地址已存在,请使用其他地址"); |
| | | } |
| | | |
| | | Map<String, Object> result = cardSv.createManagementCard(dto); |
| | | if ((Boolean) result.get("success")) { |
| | | return BaseResponseUtils.buildSuccess((String) result.get("content")); |
| | | } else { |
| | | return BaseResponseUtils.buildErrorMsg(result.get("msg").toString()); |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.dy.pipIrrGlobal.daoSe.*; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeCardOperate; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeClientCard; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeManagementCard; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeRechargeHistory; |
| | | import com.dy.pipIrrGlobal.voSe.*; |
| | | import com.dy.pipIrrTerminal.card.dto.*; |
| | |
| | | import com.dy.pipIrrTerminal.card.qo.QoLostCards; |
| | | import com.dy.pipIrrTerminal.card.enums.CardStateENUM; |
| | | import com.dy.pipIrrTerminal.card.enums.LastOperateENUM; |
| | | import com.dy.pipIrrTerminal.card.enums.ManagementCardStateENUM; |
| | | import com.dy.pipIrrTerminal.card.enums.OperateTypeENUM; |
| | | import com.dy.pipIrrTerminal.card.enums.RechargeTypeENUM; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import com.dy.common.util.IDLongGenerator; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | |
| | | @Autowired |
| | | private SeManagerCardMapper seManagerCardMapper; |
| | | |
| | | @Autowired |
| | | private SeManagementCardMapper seManagementCardMapper; |
| | | |
| | | @Autowired |
| | | private IDLongGenerator idLongGenerator; |
| | | |
| | | @Value("${project.projectNo}") |
| | | private Integer projectNo; |
| | | |
| | | /** |
| | | * 根据水卡地址判断该卡是否可以开卡 |
| | | * |
| | | * @param cardAddr |
| | | * @return true:可以开卡 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据水卡编号判断该卡是否可以充值 |
| | | * |
| | | * @param po |
| | | * @return true:可以充值 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据水卡编号判断该卡是否可以挂失 |
| | | * |
| | | * @param po |
| | | * @return true:可以报失 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据水卡编号判断该卡是否可以解锁 |
| | | * |
| | | * @param po |
| | | * @return |
| | | */ |
| | |
| | | map.put("content", card); |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 根据水卡编号判断该卡是否可以补卡 |
| | | * |
| | | * @param po |
| | | * @return true:可以补卡 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据水卡编号判断该卡是否可以注销 |
| | | * |
| | | * @param po |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据水卡编号判断该卡是否可以补扣 |
| | | * |
| | | * @param po |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据水卡编号判断该卡是否可以返还 |
| | | * |
| | | * @param po |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据农户编号获取5级行政区划串areaCode,补卡过程中开新卡使用 |
| | | * |
| | | * @param clientId |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 开卡附加充值 |
| | | * |
| | | * @param po |
| | | * @param cardNum |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 激活或补卡 |
| | | * |
| | | * @param po |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 充值 |
| | | * |
| | | * @param po |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 补卡 |
| | | * |
| | | * @param po |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 挂失 |
| | | * |
| | | * @param po |
| | | * @return |
| | | */ |
| | |
| | | seClientCard.setLossdtdt(new Date()); |
| | | seClientCard.setState(CardStateENUM.LOSS.getCode()); |
| | | seClientCard.setLastoper(LastOperateENUM.LOSS.getCode()); |
| | | Integer rec_updateClientCard = Optional.ofNullable(seClientCardMapper.updateByPrimaryKeySelective(seClientCard)).orElse(0); |
| | | Integer rec_updateClientCard = Optional.ofNullable(seClientCardMapper.updateByPrimaryKeySelective(seClientCard)) |
| | | .orElse(0); |
| | | if (rec_updateClientCard == 0) { |
| | | map.put("msg", "挂失失败-农户卡修改异常"); |
| | | return map; |
| | |
| | | |
| | | /** |
| | | * 解锁 |
| | | * |
| | | * @param po |
| | | * @return |
| | | */ |
| | |
| | | seClientCard.setMoney(po.getMoney()); |
| | | seClientCard.setState(CardStateENUM.NORMAL.getCode()); |
| | | seClientCard.setLastoper(LastOperateENUM.UNLOCK.getCode()); |
| | | Integer rec_updateClientCard = Optional.ofNullable(seClientCardMapper.updateByPrimaryKeySelective(seClientCard)).orElse(0); |
| | | Integer rec_updateClientCard = Optional.ofNullable(seClientCardMapper.updateByPrimaryKeySelective(seClientCard)) |
| | | .orElse(0); |
| | | if (rec_updateClientCard == 0) { |
| | | map.put("msg", "解锁失败-农户卡修改异常"); |
| | | return map; |
| | |
| | | |
| | | /** |
| | | * 销卡 |
| | | * |
| | | * @param po |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 补扣 |
| | | * |
| | | * @param po |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 返还 |
| | | * |
| | | * @param po |
| | | * @return |
| | | */ |
| | |
| | | seCardOperate.setClientId(clientId); |
| | | seCardOperate.setMoney(po.getBalance()); |
| | | seCardOperate.setRefundAmount(po.getSupplementMoney()); |
| | | seCardOperate.setOperateType(OperateTypeENUM.WRITE_BACK.getCode()); |
| | | seCardOperate.setOperateType(OperateTypeENUM.SUPPLEMENT.getCode()); |
| | | seCardOperate.setRemarks(po.getRemarks()); |
| | | seCardOperate.setOperator(po.getOperator()); |
| | | seCardOperate.setOperateDt(operateTime); |
| | |
| | | |
| | | /** |
| | | * 操作回调 |
| | | * |
| | | * @param po |
| | | * @return |
| | | */ |
| | |
| | | Integer operateType = po.getOperateType(); |
| | | String orderNumber = po.getOrderNumber(); |
| | | |
| | | // 先检查是否为管理卡 |
| | | if (operateType.equals(OperateTypeENUM.MANAGEMENT_CARD_WRITE.getCode().intValue())) { |
| | | // 管理类型卡写卡逻辑 |
| | | return handleManagementCardWrite(cardAddr, orderNumber); |
| | | } |
| | | |
| | | // 处理农户卡逻辑 |
| | | Long cardId = seClientCardMapper.getCardIdByAddr(cardAddr); |
| | | if (cardId == null || cardId.equals(0)) { |
| | | map.put("msg", "您指定的水卡不存在"); |
| | | return map; |
| | | } |
| | | |
| | | if(operateType == 1) { |
| | | if (operateType.equals(OperateTypeENUM.ACTIVE.getCode().intValue())) { |
| | | /** |
| | | * 开卡操作执行通知 |
| | | * 1.依据订单号将无效状态的操作记录改为有效 |
| | |
| | | turnRechargeHistoryValidByOrderNumber(orderNumber); |
| | | updateCard(cardId, orderNumber+"p"); |
| | | } |
| | | } else if (operateType == 2) { |
| | | } else if (operateType.equals(OperateTypeENUM.RECHARGE.getCode().intValue())) { |
| | | /** |
| | | * 充值操作执行通知 |
| | | * 1. 操作记录改为有效 |
| | |
| | | turnOperateValidByOrderNumber(orderNumber + "p"); |
| | | turnRechargeHistoryValidByOrderNumber(orderNumber); |
| | | updateCard(cardId, orderNumber+"p"); |
| | | }else if (operateType == 3) { |
| | | } else if (operateType.equals(OperateTypeENUM.CANCEL.getCode().intValue())) { |
| | | /** |
| | | * 销卡操作执行通知 |
| | | * 1. 操作记录改为有效 |
| | |
| | | return map; |
| | | } |
| | | |
| | | } else if (operateType == 4) { |
| | | } else if (operateType.equals(OperateTypeENUM.REISSUE.getCode().intValue())) { |
| | | /** |
| | | * 补卡操作执行通知 |
| | | * 1. 新水卡记录改为有效 |
| | |
| | | map.put("msg", "补卡回调失败"); |
| | | return map; |
| | | } |
| | | } else if (operateType == 5) { |
| | | } else if (operateType.equals(OperateTypeENUM.REFUND.getCode().intValue())) { |
| | | /** |
| | | * 补扣操作执行通知 |
| | | * 1. 操作记录改为有效 |
| | |
| | | map.put("msg", "补扣回调失败"); |
| | | return map; |
| | | } |
| | | } else if (operateType == 6) { |
| | | } else if (operateType.equals(OperateTypeENUM.SUPPLEMENT.getCode().intValue())) { |
| | | /** |
| | | * 返还操作执行通知 |
| | | * 1. 操作记录改为有效 |
| | |
| | | |
| | | map.put("success", true); |
| | | map.put("msg", "操作成功"); |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 处理管理类型卡写卡回调 |
| | | * |
| | | * @param cardAddr 卡地址 |
| | | * @param orderNumber 订单号 |
| | | * @return 处理结果 |
| | | */ |
| | | private Map<String, Object> handleManagementCardWrite(String cardAddr, String orderNumber) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("success", false); |
| | | map.put("content", null); |
| | | |
| | | try { |
| | | // 根据卡地址和订单号查找管理卡 |
| | | SeManagementCard managementCard = seManagementCardMapper.selectOne( |
| | | com.baomidou.mybatisplus.core.toolkit.Wrappers.<SeManagementCard>lambdaQuery() |
| | | .eq(SeManagementCard::getCardAddr, cardAddr) |
| | | .eq(SeManagementCard::getOrderNo, orderNumber)); |
| | | |
| | | if (managementCard == null) { |
| | | map.put("msg", "未找到对应的管理卡记录"); |
| | | return map; |
| | | } |
| | | |
| | | // 更新管理卡状态为正常 |
| | | managementCard.setState(ManagementCardStateENUM.NORMAL.getCode()); |
| | | |
| | | int updateResult = seManagementCardMapper.updateByPrimaryKeySelective(managementCard); |
| | | if (updateResult > 0) { |
| | | map.put("success", true); |
| | | map.put("msg", "管理卡写卡完成,状态已更新为正常"); |
| | | } else { |
| | | map.put("msg", "管理卡状态更新失败"); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("处理管理卡写卡回调异常", e); |
| | | map.put("msg", "处理管理卡写卡回调时发生异常:" + e.getMessage()); |
| | | } |
| | | |
| | | return map; |
| | | } |
| | | |
| | |
| | | |
| | | /** |
| | | * 如果补卡时退还了金额,清空挂失卡余额 |
| | | * |
| | | * @param orderNumber |
| | | */ |
| | | public Integer emptyCardBalance(String orderNumber) { |
| | |
| | | |
| | | /** |
| | | * 修改注销水卡表的记录及余额(0) |
| | | * |
| | | * @param orderNumber |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 修改补扣水卡表记录及余额 |
| | | * |
| | | * @param cardId |
| | | * @param orderNumber |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 修改返还水卡表记录及余额 |
| | | * |
| | | * @param cardId |
| | | * @param orderNumber |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 判断指定水卡是否为挂失状态且无补卡记录 |
| | | * |
| | | * @param cardNum |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 读取水卡信息 |
| | | * |
| | | * @param cardAddr |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据指定条件获取水卡列表 |
| | | * |
| | | * @param vo 查询条件 |
| | | * @return 水卡列表 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取已挂失的水卡列表 |
| | | * |
| | | * @param vo 查询条件 |
| | | * @return 已挂失的水卡列表 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据水卡编号获取卡信息 |
| | | * |
| | | * @param cardNum 水卡编号 |
| | | * @return 卡信息 |
| | | */ |
| | | public VoCardByClientNum getCardByCardNum(String cardNum) { |
| | | return seClientCardMapper.getCardByCardNum(cardNum); |
| | | } |
| | | |
| | | /** |
| | | * 创建管理卡 |
| | | * |
| | | * @param dto 创建管理卡DTO |
| | | * @return 创建结果 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Map<String, Object> createManagementCard(CreateManagementCardDto dto) { |
| | | Map<String, Object> result = new HashMap<>(); |
| | | result.put("success", false); |
| | | |
| | | try { |
| | | // 检查卡地址是否已存在 |
| | | if (isCardAddrExists(dto.getCardAddr())) { |
| | | result.put("msg", "创建失败-此卡地址已存在"); |
| | | return result; |
| | | } |
| | | |
| | | // 参考termActiveCard逻辑:生成订单号 |
| | | String orderNo = generateOrderNo(); |
| | | |
| | | // 使用IDLongGenerator生成唯一ID |
| | | Long id = idLongGenerator.generate(); |
| | | Date createTime = new Date(); |
| | | |
| | | // 构建管理卡对象 |
| | | SeManagementCard managementCard = SeManagementCard.builder() |
| | | .id(id) |
| | | .protocol(dto.getProtocol()) |
| | | .cardAddr(dto.getCardAddr()) |
| | | .securityCode(dto.getSecurityCode()) |
| | | .cardType(dto.getCardType()) |
| | | .createTime(createTime) |
| | | .orderNo(orderNo) |
| | | .districtCode(dto.getDistrictCode()) |
| | | .projectNo(dto.getProjectNo() != null ? dto.getProjectNo() : this.projectNo) |
| | | .ip(dto.getIp()) |
| | | .domain(dto.getDomain()) |
| | | .openClostTime(dto.getOpenClostTime()) |
| | | .remarks(dto.getRemarks()) |
| | | .state(ManagementCardStateENUM.UNWRITTEN.getCode()) // 默认状态为未写卡 |
| | | .build(); |
| | | |
| | | // 插入数据库 |
| | | int insertResult = seManagementCardMapper.insertSelective(managementCard); |
| | | |
| | | if (insertResult > 0) { |
| | | result.put("success", true); |
| | | result.put("content", orderNo); // 返回订单号 |
| | | result.put("msg", "请求成功"); |
| | | } else { |
| | | result.put("msg", "管理卡创建失败-数据库插入异常"); |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | | log.error("创建管理卡异常: {}", e.getMessage(), e); |
| | | result.put("msg", "管理卡创建失败: " + e.getMessage()); |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 检查卡片地址是否已存在 |
| | | * |
| | | * @param cardAddr 卡片地址 |
| | | * @return true-已存在,false-不存在 |
| | | */ |
| | | public boolean isCardAddrExists(String cardAddr) { |
| | | // 使用一次查询检查两个表中是否存在该卡地址 |
| | | // 1. 管理卡表:所有记录都检查 |
| | | // 2. 农户水卡表:只检查正常(1)和挂失(3)状态的记录 |
| | | Long totalCount = seClientCardMapper.checkCardAddrExists(cardAddr); |
| | | return totalCount != null && totalCount > 0; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrTerminal.card.dto; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import jakarta.validation.constraints.NotBlank; |
| | | import jakarta.validation.constraints.NotNull; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2025-01-20 |
| | | * @Description 创建管理卡DTO |
| | | */ |
| | | @Data |
| | | @Schema(name = "创建管理卡DTO") |
| | | public class CreateManagementCardDto { |
| | | |
| | | /** |
| | | * 通讯协议 |
| | | */ |
| | | @NotBlank(message = "通讯协议不能为空") |
| | | @Schema(description = "通讯协议", example = "RS485") |
| | | private String protocol; |
| | | |
| | | /** |
| | | * 卡片地址 |
| | | */ |
| | | @NotBlank(message = "卡片地址不能为空") |
| | | @Schema(description = "卡片地址", example = "001") |
| | | private String cardAddr; |
| | | |
| | | /** |
| | | * 识别码 |
| | | */ |
| | | @NotBlank(message = "识别码不能为空") |
| | | @Schema(description = "识别码", example = "A0B1C289") |
| | | private String securityCode; |
| | | |
| | | /** |
| | | * 卡片类型 |
| | | * 2-设置区域表号卡,3-取数卡,4-检查卡,5-测试卡,6-清零卡,7-IP设置卡,8-域名设置卡,9-GPS卡,10-时间配置卡 |
| | | */ |
| | | @NotNull(message = "卡片类型不能为空") |
| | | @Schema(description = "卡片类型", example = "2", allowableValues = { "2", "3", "4", "5", "6", "7", "8", "9", "10" }) |
| | | private Byte cardType; |
| | | |
| | | /** |
| | | * 5级行政区划编码 |
| | | */ |
| | | @Schema(description = "5级行政区划编码", example = "110101") |
| | | private String districtCode; |
| | | |
| | | /** |
| | | * 项目编码 |
| | | */ |
| | | @Schema(description = "项目编码", example = "1001") |
| | | private Integer projectNo; |
| | | |
| | | /** |
| | | * IP地址 |
| | | */ |
| | | @Schema(description = "IP地址", example = "192.168.1.100") |
| | | private String ip; |
| | | |
| | | /** |
| | | * 域名 |
| | | */ |
| | | @Schema(description = "域名", example = "example.com") |
| | | private String domain; |
| | | |
| | | /** |
| | | * 开关阀时间 |
| | | */ |
| | | @Schema(description = "开关阀时间(秒)", example = "30") |
| | | private Integer openClostTime; |
| | | |
| | | /** |
| | | * 备注信息 |
| | | */ |
| | | @Schema(description = "备注信息", example = "管理卡备注") |
| | | private String remarks; |
| | | } |
| | |
| | | private String orderNumber; |
| | | |
| | | /** |
| | | * 操作类型:1-开卡,2-充值,3-销卡,4-补卡,5-补扣 |
| | | * 操作类型:1-开卡,2-充值,3-销卡,4-补卡,5-补扣,6-返还,7-管理类型卡写卡 |
| | | */ |
| | | @NotNull(message = "操作类型不能为空") |
| | | private Integer operateType; |
New file |
| | |
| | | package com.dy.pipIrrTerminal.card.enums; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2025-01-20 |
| | | * @LastEditTime 2025-01-20 |
| | | * @Description 管理卡状态枚举 |
| | | */ |
| | | |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum ManagementCardStateENUM { |
| | | NORMAL((byte) 1, "正常"), |
| | | CANCELLED((byte) 2, "已注销"), |
| | | LOSS((byte) 3, "已挂失"), |
| | | UNWRITTEN((byte) 4, "未写卡"); |
| | | |
| | | private final Byte code; |
| | | private final String message; |
| | | } |
| | |
| | | * @author ZhuBaoMin |
| | | * @date 2025-05-08 11:45 |
| | | * @LastEditTime 2025-05-08 11:45 |
| | | * @Description |
| | | * @Description 操作类型枚举 |
| | | */ |
| | | |
| | | @Getter |
| | |
| | | CANCEL((byte)3, "销卡"), |
| | | REISSUE((byte)4, "补卡"), |
| | | REFUND((byte)5, "补扣"), |
| | | LOSS((byte)6, "挂失"), |
| | | REVERSAL((byte)7, "冲正"), |
| | | UNLOCK((byte)8, "解锁"), |
| | | CONSUME((byte)9, "消费"), |
| | | WRITE_BACK((byte)10, "反写"); |
| | | SUPPLEMENT((byte) 6, "返还"), |
| | | MANAGEMENT_CARD_WRITE((byte) 7, "管理类型卡写卡"), |
| | | // 保留其他系统使用的枚举值 |
| | | LOSS((byte) 8, "挂失"), |
| | | UNLOCK((byte) 9, "解锁"), |
| | | REVERSAL((byte) 10, "冲正"), |
| | | CONSUME((byte) 11, "消费"), |
| | | WRITE_BACK((byte) 12, "反写"); |
| | | |
| | | private final Byte code; |
| | | private final String message; |
New file |
| | |
| | | package com.dy.pipIrrTerminal.paymentmethod; |
| | | |
| | | import com.dy.common.aop.SsoAop; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.pojoSe.SePaymentMethod; |
| | | import com.dy.pipIrrGlobal.voSe.VoPaymentMethod; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2025-06-25 11:08 |
| | | * @LastEditTime 2025-06-25 11:08 |
| | | * @Description |
| | | */ |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping(path="paymentmethod") |
| | | @RequiredArgsConstructor |
| | | public class PaymentMethodCtrl { |
| | | private final PaymentMethodSv paymentMethodSv; |
| | | |
| | | /** |
| | | * 充值机用获取支付方式 |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "/get") |
| | | @SsoAop() |
| | | public BaseResponse<List<VoPaymentMethod>> getPaymentMethods(){ |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(paymentMethodSv.getPayMethods()); |
| | | } catch (Exception e) { |
| | | log.error("获取支付方式记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrTerminal.paymentmethod; |
| | | |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.daoSe.SePaymentMethodMapper; |
| | | import com.dy.pipIrrGlobal.pojoSe.SePaymentMethod; |
| | | import com.dy.pipIrrGlobal.voSe.VoPaymentMethod; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2025-06-25 11:09 |
| | | * @LastEditTime 2025-06-25 11:09 |
| | | * @Description |
| | | */ |
| | | |
| | | @Slf4j |
| | | @Service |
| | | public class PaymentMethodSv { |
| | | @Autowired |
| | | private SePaymentMethodMapper sePaymentMethodMapper; |
| | | |
| | | /** |
| | | * 充值机用获取支付方式 |
| | | * @return |
| | | */ |
| | | public List<VoPaymentMethod> getPayMethods() { |
| | | return sePaymentMethodMapper.getPayMethods(); |
| | | } |
| | | } |