Browse Source

修改渠道

dos 2 months ago
parent
commit
4182f2fae6

+ 14 - 2
game-business/src/main/java/com/game/business/controller/AppChargeChannelController.java

@@ -65,11 +65,11 @@ public class AppChargeChannelController extends BaseController
         if(null == list){
             list = new ArrayList<>();
         }
-        AppChargeChannel chargeChannel = new AppChargeChannel();
+        /*AppChargeChannel chargeChannel = new AppChargeChannel();
         chargeChannel.setId(-1L);
         chargeChannel.setName("其他");
         chargeChannel.setRate(0.00);
-        list.add(chargeChannel);
+        list.add(chargeChannel);*/
         return R.ok(list);
     }
 
@@ -107,6 +107,12 @@ public class AppChargeChannelController extends BaseController
     @PostMapping
     public R add(@RequestBody AppChargeChannel appChargeChannel)
     {
+        if(null != appChargeChannel.getRate()){
+            appChargeChannel.setRate(appChargeChannel.getRate()/100);
+        }
+        if(null != appChargeChannel.getWithdrawRate()){
+            appChargeChannel.setWithdrawRate(appChargeChannel.getWithdrawRate()/100);
+        }
         return R.ok(appChargeChannelService.insertAppChargeChannel(appChargeChannel));
     }
 
@@ -119,6 +125,12 @@ public class AppChargeChannelController extends BaseController
     @PutMapping
     public R edit(@RequestBody AppChargeChannel appChargeChannel)
     {
+        if(null != appChargeChannel.getRate()){
+            appChargeChannel.setRate(appChargeChannel.getRate()/100);
+        }
+        if(null != appChargeChannel.getWithdrawRate()){
+            appChargeChannel.setWithdrawRate(appChargeChannel.getWithdrawRate()/100);
+        }
         return R.ok(appChargeChannelService.updateAppChargeChannel(appChargeChannel));
     }
 

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

@@ -178,7 +178,16 @@
 <!--      <el-table-column label="${comment}" align="center" prop="id" />-->
       <el-table-column label="名称" align="center" prop="name" />
 <!--      <el-table-column label="渠道key" align="center" prop="channelKey" />-->
-      <el-table-column label="渠道费率" align="center" prop="rate" />
+      <el-table-column label="充值手续费" align="center" prop="rate">
+        <template slot-scope="scope">
+          {{scope.row.rate * 100 + "%"}}
+        </template>
+      </el-table-column>
+      <el-table-column label="提现手续费" align="center" prop="withdrawRate">
+        <template slot-scope="scope">
+          {{scope.row.withdrawRate * 100 + "%"}}
+        </template>
+      </el-table-column>
 <!--      <el-table-column label="logo" align="center" prop="logoUrl" />
       <el-table-column label="付款公司名" align="center" prop="company" />
       <el-table-column label="支付id" align="center" prop="appId" />
@@ -226,14 +235,14 @@
         <el-form-item label="名称" prop="name">
           <el-input v-model="form.name" placeholder="请输入名称" />
         </el-form-item>
-<!--        <el-form-item label="渠道key" prop="channelKey">
+        <el-form-item label="渠道key" prop="channelKey">
           <el-input v-model="form.channelKey" placeholder="请输入渠道key" />
-        </el-form-item>-->
-        <el-form-item label="渠道费率" prop="rate">
-          <el-input v-model="form.rate" placeholder="请输入渠道费率" />
         </el-form-item>
-        <el-form-item label="提现渠道费率" prop="withdrawRate">
-          <el-input v-model="form.withdrawRate" placeholder="请输入提现渠道费率" />
+        <el-form-item label="充值手续费(%)" prop="rate">
+          <el-input v-model="form.rate" placeholder="请输入充值手续费" />
+        </el-form-item>
+        <el-form-item label="提现手续费(%)" prop="withdrawRate">
+          <el-input v-model="form.withdrawRate" placeholder="请输入提现手续费" />
         </el-form-item>
 <!--        <el-form-item label="logo" prop="logoUrl">
           <el-input v-model="form.logoUrl" placeholder="请输入logo" />