Răsfoiți Sursa

修改提现规则

dos 4 luni în urmă
părinte
comite
5c88432833

+ 22 - 1
game-business/src/main/java/com/game/business/controller/AppUsersCashrecordController.java

@@ -158,7 +158,28 @@ public class AppUsersCashrecordController extends BaseController
         if(1 == appUsersCashrecord.getStatus().intValue() && null != appUsersCashrecord.getCashChannelId() && appUsersCashrecord.getCashChannelId() > 0
          && appUsersCashrecord.getCallOther() == 0){
             //审核通过
-            AppChargeChannel appChargeChannel = appChargeChannelService.selectAppChargeChannelById(appUsersCashrecord.getCashChannelId());
+            String key = "";
+            switch (appUsersCashrecord.getType().intValue()){
+                case 1: //支付宝
+                    key = "alipay";
+                    break;
+                case 2: //微信
+                    key = "weixin";
+                    break;
+                case 3: //银行卡
+                    key = "bank";
+                    break;
+                case 4:
+                    key = "okpay";
+                    break;
+                case 5:
+                    key = "cbpay";
+                    break;
+            }
+            if(StringUtils.isBlank(key)){
+                return R.fail("审核失败,用户提现账号渠道异常");
+            }
+            AppChargeChannel appChargeChannel = appChargeChannelService.selectByKey(key);
             if(null != appChargeChannel && StringUtils.isNotBlank(appChargeChannel.getChannelKey())){
                 String extra = "";
                 if(Arrays.asList("8092","8095").contains(appChargeChannel.getChannelKey())){

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

@@ -37,6 +37,12 @@ private static final long serialVersionUID=1L;
     @TableField(value = "name")
     private String name;
 
+    /** key */
+    @ApiModelProperty(value = "用于判断类型")
+    @Excel(name = "用于判断类型")
+    @TableField(value = "c_key")
+    private String cKey;
+
     /** 渠道key */
     @ApiModelProperty(value = "渠道key")
     @Excel(name = "渠道key")

+ 8 - 0
game-business/src/main/java/com/game/business/service/IAppChargeChannelService.java

@@ -58,4 +58,12 @@ public interface IAppChargeChannelService extends IService<AppChargeChannel> {
      * @return 结果
      */
     public int deleteAppChargeChannelById(Long id);
+
+    /**
+     * 删除充值渠道信息
+     *
+     * @param key key
+     * @return 结果
+     */
+    public AppChargeChannel selectByKey(String key);
 }

+ 13 - 0
game-business/src/main/java/com/game/business/service/impl/AppChargeChannelServiceImpl.java

@@ -1,5 +1,6 @@
 package com.game.business.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import java.util.List;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -92,4 +93,16 @@ public class AppChargeChannelServiceImpl extends ServiceImpl<AppChargeChannelMap
     public int deleteAppChargeChannelById(Long id) {
         return appChargeChannelMapper.deleteAppChargeChannelById(id);
     }
+
+    @Override
+    @DataSource(DataSourceType.SLAVE)
+    public AppChargeChannel selectByKey(String key) {
+        LambdaQueryWrapper<AppChargeChannel> queryWrapper = new LambdaQueryWrapper<AppChargeChannel>();
+        queryWrapper.eq(AppChargeChannel::getCKey,key);
+        List<AppChargeChannel> list = appChargeChannelMapper.selectList(queryWrapper);
+        if(null != list && list.size()>0){
+            return list.get(0);
+        }
+        return null;
+    }
 }

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

@@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <resultMap type="com.game.business.domain.AppChargeChannel" id="AppChargeChannelResult">
         <result property="id"    column="id"    />
         <result property="name"    column="name"    />
+        <result property="cKey"    column="c_key"    />
         <result property="channelKey"    column="channel_key"    />
         <result property="rate"    column="rate"    />
         <result property="withdrawRate"    column="withdraw_rate"    />
@@ -27,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectAppChargeChannelVo">
-        select id, name, channel_key,channel_no, rate,withdraw_rate,is_show, logo_url, company, app_id, app_secret, third_url, status, cert_path, ali_public_cert, ali_apply_cert, ali_ca_cert, merchant_no, api_secret, orderno from app_charge_channel
+        select id, name,c_key, channel_key,channel_no, rate,withdraw_rate,is_show, logo_url, company, app_id, app_secret, third_url, status, cert_path, ali_public_cert, ali_apply_cert, ali_ca_cert, merchant_no, api_secret, orderno from app_charge_channel
     </sql>
 
     <select id="selectAppChargeChannelList" parameterType="com.game.business.domain.AppChargeChannel" resultMap="AppChargeChannelResult">
@@ -35,6 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <where>  
             <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
             <if test="channelKey != null  and channelKey != ''"> and channel_key = #{channelKey}</if>
+            <if test="cKey != null  and cKey != ''"> and c_key = #{cKey}</if>
             <if test="channelNo != null  and channelNo != ''"> and channel_no = #{channelNo}</if>
             <if test="rate != null "> and rate = #{rate}</if>
             <if test="withdrawRate != null "> and withdraw_rate = #{withdrawRate}</if>
@@ -67,6 +69,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="id != null">id,</if>
             <if test="name != null">name,</if>
             <if test="channelKey != null">channel_key,</if>
+            <if test="cKey != null and cKey != ''">c_key,</if>
             <if test="channelNo != null">channel_no,</if>
             <if test="rate != null">rate,</if>
             <if test="withdrawRate != null">withdraw_rate,</if>
@@ -88,6 +91,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
             <if test="name != null">#{name},</if>
+            <if test="cKey != null">#{cKey},</if>
             <if test="channelKey != null">#{channelKey},</if>
             <if test="channelNo != null">#{channelNo},</if>
             <if test="rate != null">#{rate},</if>
@@ -113,6 +117,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         update app_charge_channel
         <trim prefix="SET" suffixOverrides=",">
             <if test="name != null">name = #{name},</if>
+            <if test="cKey != null">c_key = #{cKey},</if>
             <if test="channelKey != null">channel_key = #{channelKey},</if>
             <if test="channelNo != null">channel_no = #{channelNo},</if>
             <if test="rate != null">rate = #{rate},</if>