pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeRechargeProfileMapper.java
New file @@ -0,0 +1,36 @@ package com.dy.pipIrrGlobal.daoSe; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.dy.pipIrrGlobal.pojoSe.SeRechargeProfile; import com.dy.pipIrrGlobal.voSe.VoRechargeProfile; import org.apache.ibatis.annotations.Mapper; import java.util.List; /** * @author ZhuBaoMin * @date 2024-11-01 9:40 * @LastEditTime 2024-11-01 9:40 * @Description */ @Mapper public interface SeRechargeProfileMapper extends BaseMapper<SeRechargeProfile> { int deleteByPrimaryKey(Long id); int insert(SeRechargeProfile record); int insertSelective(SeRechargeProfile record); SeRechargeProfile selectByPrimaryKey(Long id); int updateByPrimaryKeySelective(SeRechargeProfile record); int updateByPrimaryKey(SeRechargeProfile record); /** * 获取虚拟卡常用充值金额配置 * @return */ List<VoRechargeProfile> gerRechargeProfiles(); } pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeRechargeProfile.java
New file @@ -0,0 +1,49 @@ package com.dy.pipIrrGlobal.pojoSe; /** * @author ZhuBaoMin * @date 2024-11-01 9:40 * @LastEditTime 2024-11-01 9:40 * @Description 虚拟卡常用充值金额配置实体类 */ import com.alibaba.fastjson2.annotation.JSONField; import com.alibaba.fastjson2.writer.ObjectWriterImplToString; 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 lombok.*; @TableName(value="se_recharge_profile", autoResultMap = true) @Data @Builder @ToString @NoArgsConstructor @AllArgsConstructor public class SeRechargeProfile implements BaseEntity { public static final long serialVersionUID = 202411010943001L; /** * 主键 */ @JSONField(serializeUsing= ObjectWriterImplToString.class) @TableId(type = IdType.INPUT) private Long id; /** * 充值金额 */ private Integer rechargeAmount; /** * 排序 */ private Integer sort; /** * 逻辑删除标识;未删除为0,已删除为删除时间 */ @JSONField(serializeUsing= ObjectWriterImplToString.class) private Long deleted; } pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoRechargeProfile.java
New file @@ -0,0 +1,31 @@ package com.dy.pipIrrGlobal.voSe; import com.alibaba.fastjson2.annotation.JSONField; import com.alibaba.fastjson2.writer.ObjectWriterImplToString; import com.dy.common.po.BaseEntity; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import lombok.Data; /** * @author ZhuBaoMin * @date 2024-11-01 9:46 * @LastEditTime 2024-11-01 9:46 * @Description 虚拟卡常用充值金额视图对象 */ @Data @JsonPropertyOrder({"profileId", "rechargeAmount", "sort"}) public class VoRechargeProfile implements BaseEntity { private static final long serialVersionUID = 202411010948001L; /** * 配置ID */ @JSONField(serializeUsing= ObjectWriterImplToString.class) private Long profileId; /** * 充值金额 */ private Integer rechargeAmount; } pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeRechargeProfileMapper.xml
New file @@ -0,0 +1,103 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.dy.pipIrrGlobal.daoSe.SeRechargeProfileMapper"> <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoSe.SeRechargeProfile"> <!--@mbg.generated--> <!--@Table se_recharge_profile--> <id column="id" jdbcType="BIGINT" property="id" /> <result column="recharge_amount" jdbcType="INTEGER" property="rechargeAmount" /> <result column="sort" jdbcType="INTEGER" property="sort" /> <result column="deleted" jdbcType="BIGINT" property="deleted" /> </resultMap> <sql id="Base_Column_List"> <!--@mbg.generated--> id, recharge_amount, sort, deleted </sql> <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> <!--@mbg.generated--> select <include refid="Base_Column_List" /> from se_recharge_profile where id = #{id,jdbcType=BIGINT} </select> <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> <!--@mbg.generated--> delete from se_recharge_profile where id = #{id,jdbcType=BIGINT} </delete> <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSe.SeRechargeProfile"> <!--@mbg.generated--> insert into se_recharge_profile (id, recharge_amount, sort, deleted) values (#{id,jdbcType=BIGINT}, #{rechargeAmount,jdbcType=INTEGER}, #{sort,jdbcType=INTEGER}, #{deleted,jdbcType=BIGINT}) </insert> <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeRechargeProfile"> <!--@mbg.generated--> insert into se_recharge_profile <trim prefix="(" suffix=")" suffixOverrides=","> <if test="id != null"> id, </if> <if test="rechargeAmount != null"> recharge_amount, </if> <if test="sort != null"> sort, </if> <if test="deleted != null"> deleted, </if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="id != null"> #{id,jdbcType=BIGINT}, </if> <if test="rechargeAmount != null"> #{rechargeAmount,jdbcType=INTEGER}, </if> <if test="sort != null"> #{sort,jdbcType=INTEGER}, </if> <if test="deleted != null"> #{deleted,jdbcType=BIGINT}, </if> </trim> </insert> <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeRechargeProfile"> <!--@mbg.generated--> update se_recharge_profile <set> <if test="rechargeAmount != null"> recharge_amount = #{rechargeAmount,jdbcType=INTEGER}, </if> <if test="sort != null"> sort = #{sort,jdbcType=INTEGER}, </if> <if test="deleted != null"> deleted = #{deleted,jdbcType=BIGINT}, </if> </set> where id = #{id,jdbcType=BIGINT} </update> <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSe.SeRechargeProfile"> <!--@mbg.generated--> update se_recharge_profile set recharge_amount = #{rechargeAmount,jdbcType=INTEGER}, sort = #{sort,jdbcType=INTEGER}, deleted = #{deleted,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT} </update> <!--获取虚拟卡常用充值金额配置--> <select id="gerRechargeProfiles" resultType="com.dy.pipIrrGlobal.voSe.VoRechargeProfile"> SELECT id AS profileId, recharge_amount AS rechargeAmount FROM se_recharge_profile ORDER BY sort </select> </mapper> pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/virtualCard/VirtualCardCtrl.java
@@ -5,6 +5,7 @@ import com.dy.common.webUtil.QueryResultVo; import com.dy.pipIrrGlobal.pojoSe.SeVcOperate; import com.dy.pipIrrGlobal.pojoSe.SeVirtualCard; import com.dy.pipIrrGlobal.voSe.VoRechargeProfile; import com.dy.pipIrrGlobal.voSe.VoVcRecharge; import com.dy.pipIrrGlobal.voSe.VoVirtualCard; import com.dy.pipIrrWechat.result.WechatResultCode; @@ -329,4 +330,18 @@ return BaseResponseUtils.buildException(e.getMessage()) ; } } /** * 获取虚拟卡常用充值金额配置 * @return */ @GetMapping(path = "/gerRechargeProfiles") public BaseResponse<List<VoRechargeProfile>> gerRechargeProfiles(){ try { return BaseResponseUtils.buildSuccess(virtualCardSv.gerRechargeProfiles()); } catch (Exception e) { log.error("获取虚拟卡常用充值金额配置异常", e); return BaseResponseUtils.buildException(e.getMessage()) ; } } } pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/virtualCard/VirtualCardSv.java
@@ -6,6 +6,7 @@ import com.dy.pipIrrGlobal.daoSe.*; import com.dy.pipIrrGlobal.pojoSe.*; import com.dy.pipIrrGlobal.voSe.VoOrders; import com.dy.pipIrrGlobal.voSe.VoRechargeProfile; import com.dy.pipIrrGlobal.voSe.VoVcRecharge; import com.dy.pipIrrGlobal.voSe.VoVirtualCard; import com.dy.pipIrrWechat.result.WechatResultCode; @@ -51,6 +52,9 @@ @Autowired private SeVcOperateMapper seVcOperateMapper; @Autowired private SeRechargeProfileMapper seRechargeProfileMapper; @Value("${vc.alarmValue}") private Integer alarmValue; @@ -386,4 +390,12 @@ seVcOperateMapper.insert(po); return po.getId(); } /** * 获取虚拟卡常用充值金额配置 * @return */ public List<VoRechargeProfile> gerRechargeProfiles() { return seRechargeProfileMapper.gerRechargeProfiles(); } }