dos 6 giorni fa
parent
commit
9d72ae6499

+ 15 - 5
game-business/src/main/java/com/game/business/controller/AppUsersCashrecordController.java

@@ -158,7 +158,10 @@ public class AppUsersCashrecordController extends BaseController
         if(1 == appUsersCashrecord.getStatus().intValue()
          && appUsersCashrecord.getCallOther() == 0){
             //审核通过
-            String key = "";
+            if(null == appUsersCashrecord.getCashChannelId()){
+                return R.fail("请选择提现渠道");
+            }
+            /*String key = "";
             switch (cashrecord.getType().intValue()){
                 case 1: //支付宝
                     key = "alipay";
@@ -178,9 +181,16 @@ public class AppUsersCashrecordController extends BaseController
             }
             if(StringUtils.isBlank(key)){
                 return R.fail("审核失败,用户提现账号渠道异常");
+            }*/
+            AppChargeChannel appChargeChannel = appChargeChannelService.selectAppChargeChannelById(appUsersCashrecord.getCashChannelId());
+            if(null == appChargeChannel){
+                return R.fail("审核失败,提现渠道不存在");
+            }
+            if(StringUtils.isBlank(appChargeChannel.getChannelKey())){
+                return R.fail("审核失败,提现渠道未配置四方产品id");
             }
-            AppChargeChannel appChargeChannel = appChargeChannelService.selectByKey(key);
-            if(null != appChargeChannel && StringUtils.isNotBlank(appChargeChannel.getChannelKey())){
+            update.setCashChannelId(appChargeChannel.getId());
+//            if(StringUtils.isNotBlank(appChargeChannel.getChannelKey())){
                 String extra = "";
                 if(Arrays.asList("8092","8095").contains(appChargeChannel.getChannelKey())){
                     //钱包提现
@@ -217,9 +227,9 @@ public class AppUsersCashrecordController extends BaseController
                     appUsersCashrecordService.updateAppUsersCashrecord(cashRecord);
                     throw new ServiceException("发起提现失败: " + map.get("msg"));
                 }
-            }else{
+            /*}else{
                 return R.fail("审核失败,未找到对应渠道,请驳回或者人工审核");
-            }
+            }*/
         }
         if(2 == appUsersCashrecord.getStatus().intValue()){
 

+ 8 - 2
game-business/src/main/java/com/game/business/domain/AppChargeChannel.java

@@ -43,14 +43,20 @@ private static final long serialVersionUID=1L;
     @TableField(value = "c_key")
     private String cKey;
 
+    /** 渠道类型 1:支付宝  2:微信  3:银行卡  4:okpay 5:cbpay */
+    @ApiModelProperty(value = "渠道类型 1:支付宝  2:微信  3:银行卡  4:okpay 5:cbpay")
+    @Excel(name = "渠道类型 1:支付宝  2:微信  3:银行卡  4:okpay 5:cbpay")
+    @TableField(value = "type")
+    private Integer type;
+
     /** 渠道key */
-    @ApiModelProperty(value = "渠道key")
+    @ApiModelProperty(value = "提现渠道产品id")
     @Excel(name = "渠道key")
     @TableField(value = "channel_key")
     private String channelKey;
 
     /** 渠道key */
-    @ApiModelProperty(value = "渠道编码")
+    @ApiModelProperty(value = "充值渠道编码")
     @Excel(name = "渠道编码")
     @TableField(value = "channel_no")
     private String channelNo;

+ 3 - 0
game-business/src/main/java/com/game/business/domain/AppUsersCashrecord.java

@@ -232,4 +232,7 @@ private static final long serialVersionUID=1L;
     @TableField(exist = false)
     private int callOther = 0;
 
+    @TableField(exist = false)
+    private Integer accountType;
+
 }

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

@@ -8,6 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="id"    column="id"    />
         <result property="name"    column="name"    />
         <result property="cKey"    column="c_key"    />
+        <result property="type"    column="type"    />
         <result property="channelKey"    column="channel_key"    />
         <result property="rate"    column="rate"    />
         <result property="withdrawRate"    column="withdraw_rate"    />
@@ -28,7 +29,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectAppChargeChannelVo">
-        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
+        select id, name,c_key,type, 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">
@@ -37,6 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <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="type != null"> and type = #{type}</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>
@@ -70,6 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="name != null">name,</if>
             <if test="channelKey != null">channel_key,</if>
             <if test="cKey != null and cKey != ''">c_key,</if>
+            <if test="type != null">type,</if>
             <if test="channelNo != null">channel_no,</if>
             <if test="rate != null">rate,</if>
             <if test="withdrawRate != null">withdraw_rate,</if>
@@ -92,6 +95,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="id != null">#{id},</if>
             <if test="name != null">#{name},</if>
             <if test="cKey != null">#{cKey},</if>
+            <if test="type != null">#{type},</if>
             <if test="channelKey != null">#{channelKey},</if>
             <if test="channelNo != null">#{channelNo},</if>
             <if test="rate != null">#{rate},</if>
@@ -118,6 +122,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix="SET" suffixOverrides=",">
             <if test="name != null">name = #{name},</if>
             <if test="cKey != null">c_key = #{cKey},</if>
+            <if test="type != null">type = #{type},</if>
             <if test="channelKey != null">channel_key = #{channelKey},</if>
             <if test="channelNo != null">channel_no = #{channelNo},</if>
             <if test="rate != null">rate = #{rate},</if>

+ 35 - 35
game-business/src/main/resources/mapper/business/AppUsersCashrecordMapper.xml

@@ -40,52 +40,52 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectAppUsersCashrecordVo">
-        select id, account, account_bank, actual_money, addtime, after_amount, auditby, before_amount, cash_out_biz_no, cash_out_order_id, cash_out_pay_order_id, cash_out_remark, cash_out_status, cash_type, cash_channel_id, cash_account_id, guild_id, money, name, orderno, platform_service, reason, remarks, service, status, status_name, trade_no, type, uid, unit_type, uptime, votes from app_users_cashrecord
+        select a.*,b.type as accountType from app_users_cashrecord as a left join app_users_cash_account as b on a.cash_account_id = b.id
     </sql>
 
     <select id="selectAppUsersCashrecordList" parameterType="com.game.business.domain.AppUsersCashrecord" resultMap="AppUsersCashrecordResult">
         <include refid="selectAppUsersCashrecordVo"/>
         <where>  
-            <if test="account != null  and account != ''"> and account = #{account}</if>
-            <if test="accountBank != null  and accountBank != ''"> and account_bank = #{accountBank}</if>
-            <if test="actualMoney != null "> and actual_money = #{actualMoney}</if>
-            <if test="addtime != null "> and addtime = #{addtime}</if>
-            <if test="afterAmount != null "> and after_amount = #{afterAmount}</if>
-            <if test="auditby != null  and auditby != ''"> and auditby = #{auditby}</if>
-            <if test="beforeAmount != null "> and before_amount = #{beforeAmount}</if>
-            <if test="cashOutBizNo != null  and cashOutBizNo != ''"> and cash_out_biz_no = #{cashOutBizNo}</if>
-            <if test="cashOutOrderId != null  and cashOutOrderId != ''"> and cash_out_order_id = #{cashOutOrderId}</if>
-            <if test="cashOutPayOrderId != null  and cashOutPayOrderId != ''"> and cash_out_pay_order_id = #{cashOutPayOrderId}</if>
-            <if test="cashOutRemark != null  and cashOutRemark != ''"> and cash_out_remark = #{cashOutRemark}</if>
-            <if test="cashOutStatus != null "> and cash_out_status = #{cashOutStatus}</if>
-            <if test="cashType != null "> and cash_type = #{cashType}</if>
-            <if test="cashChannelId != null "> and cash_channel_id = #{cashChannelId}</if>
-            <if test="cashAccountId != null "> and cash_account_id = #{cashAccountId}</if>
-            <if test="guildId != null "> and guild_id = #{guildId}</if>
-            <if test="money != null "> and money = #{money}</if>
-            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
-            <if test="orderno != null  and orderno != ''"> and orderno = #{orderno}</if>
-            <if test="platformService != null "> and platform_service = #{platformService}</if>
-            <if test="reason != null  and reason != ''"> and reason = #{reason}</if>
-            <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
-            <if test="service != null "> and service = #{service}</if>
-            <if test="status != null "> and status = #{status}</if>
-            <if test="statusName != null  and statusName != ''"> and status_name like concat('%', #{statusName}, '%')</if>
-            <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="unitType != null "> and unit_type = #{unitType}</if>
-            <if test="uptime != null "> and uptime = #{uptime}</if>
-            <if test="votes != null "> and votes = #{votes}</if>
-            <if test="beginTime != null  and beginTime != ''"> and addtime &gt; CONCAT(#{beginTime},' 00:00:00')</if>
-            <if test="endTime != null  and endTime != ''"> and addtime &lt; CONCAT(#{endTime},' 23:59:59')</if>
+            <if test="account != null  and account != ''"> and a.account = #{account}</if>
+            <if test="accountBank != null  and accountBank != ''"> and a.account_bank = #{accountBank}</if>
+            <if test="actualMoney != null "> and a.actual_money = #{actualMoney}</if>
+            <if test="addtime != null "> and a.addtime = #{addtime}</if>
+            <if test="afterAmount != null "> and a.after_amount = #{afterAmount}</if>
+            <if test="auditby != null  and auditby != ''"> and a.auditby = #{auditby}</if>
+            <if test="beforeAmount != null "> and a.before_amount = #{beforeAmount}</if>
+            <if test="cashOutBizNo != null  and cashOutBizNo != ''"> and a.cash_out_biz_no = #{cashOutBizNo}</if>
+            <if test="cashOutOrderId != null  and cashOutOrderId != ''"> and a.cash_out_order_id = #{cashOutOrderId}</if>
+            <if test="cashOutPayOrderId != null  and cashOutPayOrderId != ''"> and a.cash_out_pay_order_id = #{cashOutPayOrderId}</if>
+            <if test="cashOutRemark != null  and cashOutRemark != ''"> and a.cash_out_remark = #{cashOutRemark}</if>
+            <if test="cashOutStatus != null "> and a.cash_out_status = #{cashOutStatus}</if>
+            <if test="cashType != null "> and a.cash_type = #{cashType}</if>
+            <if test="cashChannelId != null "> and a.cash_channel_id = #{cashChannelId}</if>
+            <if test="cashAccountId != null "> and a.cash_account_id = #{cashAccountId}</if>
+            <if test="guildId != null "> and a.guild_id = #{guildId}</if>
+            <if test="money != null "> and a.money = #{money}</if>
+            <if test="name != null  and name != ''"> and a.name like concat('%', #{name}, '%')</if>
+            <if test="orderno != null  and orderno != ''"> and a.orderno = #{orderno}</if>
+            <if test="platformService != null "> and a.platform_service = #{platformService}</if>
+            <if test="reason != null  and reason != ''"> and a.reason = #{reason}</if>
+            <if test="remarks != null  and remarks != ''"> and a.remarks = #{remarks}</if>
+            <if test="service != null "> and a.service = #{service}</if>
+            <if test="status != null "> and a.status = #{status}</if>
+            <if test="statusName != null  and statusName != ''"> and a.status_name like concat('%', #{statusName}, '%')</if>
+            <if test="tradeNo != null  and tradeNo != ''"> and a.trade_no = #{tradeNo}</if>
+            <if test="type != null "> and a.type = #{type}</if>
+            <if test="uid != null "> and a.uid = #{uid}</if>
+            <if test="unitType != null "> and a.unit_type = #{unitType}</if>
+            <if test="uptime != null "> and a.uptime = #{uptime}</if>
+            <if test="votes != null "> and a.votes = #{votes}</if>
+            <if test="beginTime != null  and beginTime != ''"> and a.addtime &gt; CONCAT(#{beginTime},' 00:00:00')</if>
+            <if test="endTime != null  and endTime != ''"> and a.addtime &lt; CONCAT(#{endTime},' 23:59:59')</if>
         </where>
         order by addtime desc
     </select>
     
     <select id="selectAppUsersCashrecordById" parameterType="Long" resultMap="AppUsersCashrecordResult">
         <include refid="selectAppUsersCashrecordVo"/>
-        where id = #{id}
+        where a.id = #{id}
     </select>
         
     <insert id="insertAppUsersCashrecord" parameterType="com.game.business.domain.AppUsersCashrecord">

+ 40 - 2
game-ui/src/views/business/cashrecord/index.vue

@@ -202,6 +202,16 @@
         <el-form-item label="姓名" prop="name">
           <el-input disabled v-model="form.name" placeholder="请输入姓名" />
         </el-form-item>
+        <el-form-item label="提现渠道" prop="accountType" v-if="form.callOther == 0">
+          <el-select v-model="form.cashChannelId" placeholder="请选择提现渠道">
+            <el-option
+              v-for="item in typeList"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            ></el-option>
+          </el-select>
+        </el-form-item>
         <el-form-item label="状态" prop="status">
           <el-select v-model="form.status" placeholder="请选择状态 0:审核中 1:审核通过 2:审核拒绝">
             <el-option
@@ -226,6 +236,7 @@
 
 <script>
 import { listCashrecord, getCashrecord, delCashrecord, addCashrecord, updateCashrecord } from "@/api/business/cashrecord";
+import {channelList } from "@/api/business/charge";
 
 export default {
   name: "Cashrecord",
@@ -253,6 +264,8 @@ export default {
       daterange:[],
       reshBtn:"开启自动刷新",
       reshTimer:null,
+      typeList:[],
+      typeMap:{},
       // 查询参数
       queryParams: {
         pageNum: 1,
@@ -344,7 +357,8 @@ export default {
         unitType: null,
         uptime: null,
         votes: null,
-        callOther:0
+        callOther:0,
+        accountType:null
       };
       this.resetForm("form");
     },
@@ -378,12 +392,36 @@ export default {
       if(!calOther){
         calOther = 0;
       }
+      let that = this;
       this.reset();
       const id = row.id || this.ids
       getCashrecord(id).then(response => {
         this.form = response.data;
+        this.form["cashChannelId"] = null;
         this.form["callOther"] = calOther;
-        this.open = true;
+        if(calOther == 0){
+          if(!this.form.accountType){
+            this.open = true;
+          }else{
+            channelList({type:this.form.accountType}).then(response => {
+              if(response.data){
+                for(var i in response.data){
+                  var item = response.data[i];
+                  that.typeMap[item.id.toString()] = item.name;
+                  that.typeList.push({
+                    value:item.id,
+                    label:item.name
+                  })
+                }
+              }
+              this.open = true;
+            })
+          }
+
+        }else{
+          this.open = true;
+        }
+
         this.title = calOther==0?"审核":"人工审核";
       });
     },

+ 25 - 7
game-ui/src/views/business/channel/index.vue

@@ -177,8 +177,13 @@
       <el-table-column type="selection" width="55" align="center" />
 <!--      <el-table-column label="${comment}" align="center" prop="id" />-->
       <el-table-column label="名称" align="center" prop="name" />
-      <el-table-column label="提现渠道" align="center" prop="channelKey" />
-      <el-table-column label="充值渠道" align="center" prop="channelNo" />
+      <el-table-column label="渠道类型" align="center" prop="type">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.app_user_cash_account" :value="scope.row.type"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="提现渠道(四方产品id)" align="center" prop="channelKey" />
+      <el-table-column label="充值渠道(四方产品id)" align="center" prop="channelNo" />
       <el-table-column label="充值手续费" align="center" prop="rate">
         <template slot-scope="scope">
           {{(scope.row.rate * 100).toFixed(2) + "%"}}
@@ -241,11 +246,21 @@
         <el-form-item label="名称" prop="name">
           <el-input v-model="form.name" placeholder="请输入名称" />
         </el-form-item>
-        <el-form-item label="提现渠道" prop="channelKey">
-          <el-input v-model="form.channelKey" placeholder="请输入渠道key" disabled/>
+        <el-form-item label="渠道类型" prop="type">
+          <el-select v-model="form.type" placeholder="请选择类型">
+            <el-option
+              v-for="dict in dict.type.app_user_cash_account"
+              :key="dict.value"
+              :label="dict.label"
+              :value="parseInt(dict.value)"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="提现渠道(四方产品id)" prop="channelKey">
+          <el-input v-model="form.channelKey" placeholder="请输入"/>
         </el-form-item>
-        <el-form-item label="充值渠道" prop="channelNo">
-          <el-input v-model="form.channelNo" placeholder="请输入渠道编码" />
+        <el-form-item label="充值渠道(四方产品id)" prop="channelNo">
+          <el-input v-model="form.channelNo" placeholder="请输入" />
         </el-form-item>
         <el-form-item label="充值手续费(%)" prop="rate">
           <el-input v-model="form.rate" placeholder="请输入充值手续费" />
@@ -313,7 +328,7 @@ import { listChannel, getChannel, delChannel, addChannel, updateChannel } from "
 
 export default {
   name: "Channel",
-  dicts: ['app_channel_status'],
+  dicts: ['app_channel_status','app_user_cash_account'],
   data() {
     return {
       // 遮罩层
@@ -360,6 +375,9 @@ export default {
       form: {},
       // 表单校验
       rules: {
+        type: [
+          { required: true, message: "请选择渠道类型", trigger: "change" }
+        ]
       }
     };
   },

+ 20 - 3
game-ui/src/views/index.vue

@@ -94,10 +94,10 @@
                 </thead>
                 <tbody>
                 <tr>
-                  <td class="el-table__cell is-leaf" rowspan="5"><div class="cell">充值总额</div></td>
+                  <td class="el-table__cell is-leaf" rowspan="6"><div class="cell">充值总额</div></td>
                   <td class="el-table__cell is-leaf"><div class="cell">支付宝:{{getVal(getCharge('8085'),0)}}</div></td>
-                  <td class="el-table__cell is-leaf" rowspan="5"><div class="cell">充值:{{getVal(getCharge('4'),1)}}</div></td>
-                  <td class="el-table__cell is-leaf" rowspan="5"><div class="cell">总额:{{getTotal()}}</div></td>
+                  <td class="el-table__cell is-leaf" rowspan="6"><div class="cell">充值:{{getVal(getCharge('4'),1)}}</div></td>
+                  <td class="el-table__cell is-leaf" rowspan="6"><div class="cell">总额:{{getTotal()}}</div></td>
                 </tr>
                 <tr>
                   <td class="el-table__cell is-leaf"><div class="cell" >微信:{{getVal(getCharge('8086'),0)}}</div></td>
@@ -113,6 +113,10 @@
                 </tr>
                 <tr>
                   <td class="el-table__cell is-leaf"><div class="cell" >银行卡:{{getVal(getCharge('8087'),0)}}</div></td>
+<!--                  <td class="el-table__cell is-leaf"><div class="cell" >微信</div></td>-->
+                </tr>
+                <tr>
+                  <td class="el-table__cell is-leaf"><div class="cell" >其他:{{getVal(getOtherCharge('8085,8086,8084,8088,8087'),0)}}</div></td>
 <!--                  <td class="el-table__cell is-leaf"><div class="cell" >微信</div></td>-->
                 </tr>
                 <tr>
@@ -283,6 +287,19 @@ export default {
       }
       return res;
     },
+    getOtherCharge(types){
+      let arr = types.split(",");
+      let dataMap = this.dataMap;
+      let res = {};
+      for(var i in dataMap["rechargeByDateSum"]){
+        var item = dataMap["rechargeByDateSum"][i];
+        if(!arr.includes(item["type"])){
+          res = item;
+          break;
+        }
+      }
+      return res;
+    },
     getVal(val,type){
       //type 3 统计线上+线下
       let diamondCoin = 0.00;