Browse Source

充值增加渠道id

dos 2 months ago
parent
commit
6705a48376

+ 6 - 0
game-business/src/main/java/com/game/business/controller/AppUserController.java

@@ -181,6 +181,10 @@ public class AppUserController extends BaseController
         tran.setRemarks(remark);
 
         try {
+            /*if(null != userChargeDto.getChannelId() && userChargeDto.getChannelId() > 0){
+                AppChargeChannel channel = appChargeChannelService.selectAppChargeChannelById(userChargeDto.getChannelId());
+                userChargeDto.setRate(channel.getRate());
+            }*/
             appUserService.updateUserAmount(tran);
             BigDecimal rate = BigDecimal.ZERO;
             if(null != userChargeDto.getRate() && userChargeDto.getRate() > 0 && userChargeDto.getAmount() > 0){
@@ -253,6 +257,8 @@ public class AppUserController extends BaseController
             appUsersCharge.setOptUser(String.valueOf(SecurityUtils.getUserId()));
             // 操作类型 1:充值金币 2:扣减金币
             appUsersCharge.setOptType(userChargeDto.getAmount()<0?2L:1L);
+            //渠道
+            appUsersCharge.setChannelId(userChargeDto.getChannelId());
             //赠送金额
             appUsersCharge.setCoinGive(BigDecimal.valueOf(give));
             appUsersCharge.setAddtime(new Date());

+ 6 - 0
game-business/src/main/java/com/game/business/domain/AppUsersCharge.java

@@ -206,6 +206,12 @@ private static final long serialVersionUID=1L;
     @TableField(value = "uid")
     private Long uid;
 
+    /** 用户ID */
+    @ApiModelProperty(value = "充值渠道id")
+    @Excel(name = "充值渠道id")
+    @TableField(value = "channel_id")
+    private Long channelId;
+
     @JsonIgnore
     @TableField(exist = false)
     private Double todaySum;

+ 6 - 1
game-business/src/main/resources/mapper/business/AppUsersChargeMapper.xml

@@ -35,10 +35,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="tradeNo"    column="trade_no"    />
         <result property="type"    column="type"    />
         <result property="uid"    column="uid"    />
+        <result property="channelId"    column="channel_id"    />
     </resultMap>
 
     <sql id="selectAppUsersChargeVo">
-        select id, addtime,update_time, after_coin, agent_id, ambient, coin, coin_type, coin_give,platform_service_rate,platform_service, is_agent, is_delete, is_water, money, opt_type, opt_user, orderno, pid, pid_level1, pid_level2, pid_level3, pid_level4, remarks, rule_id, status, touid, trade_no, type, uid from app_users_charge
+        select id, addtime,update_time, after_coin, agent_id, ambient, coin, coin_type, coin_give,platform_service_rate,platform_service, is_agent, is_delete, is_water, money, opt_type, opt_user, orderno, pid, pid_level1, pid_level2, pid_level3, pid_level4, remarks, rule_id, status, touid, trade_no, type, uid,channel_id from app_users_charge
     </sql>
 
     <select id="selectAppUsersChargeList" parameterType="com.game.business.domain.AppUsersCharge" resultMap="AppUsersChargeResult">
@@ -73,6 +74,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="tradeNo != null  and tradeNo != ''"> and trade_no = #{tradeNo}</if>
             <if test="type != null "> and type = #{type}</if>
             <if test="uid != null "> and uid = #{uid}</if>
+            <if test="channelId != null "> and channel_id = #{channelId}</if>
         </where>
     </select>
     
@@ -114,6 +116,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="tradeNo != null">trade_no,</if>
             <if test="type != null">type,</if>
             <if test="uid != null">uid,</if>
+            <if test="channelId != null">channel_id,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -146,6 +149,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="tradeNo != null">#{tradeNo},</if>
             <if test="type != null">#{type},</if>
             <if test="uid != null">#{uid},</if>
+            <if test="channelId != null">#{channelId},</if>
          </trim>
     </insert>
 
@@ -181,6 +185,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="tradeNo != null">trade_no = #{tradeNo},</if>
             <if test="type != null">type = #{type},</if>
             <if test="uid != null">uid = #{uid},</if>
+            <if test="channelId != null">channel_id = #{channelId},</if>
         </trim>
         where id = #{id}
     </update>