dos 1 ماه پیش
والد
کامیت
ede21d6681

+ 2 - 1
game-business/src/main/java/com/game/business/controller/AppAgentController.java

@@ -330,6 +330,7 @@ public class AppAgentController extends BaseController {
         }
         List<AppUserAgent> list = appUserAgentService.selectSuperList(userId);
         appUserDetailVo.setSuperUserList(list);
+        appUserDetailVo.setDownUserList(appUserAgentService.selectAllAgentList(userId,null,null,null));
         AppUserAgent appUserAgent = null;
         if(null != list && list.size() > 0){
             List<AppUserAgent> curList = list.stream().filter(e->e.getUserId().equals(userId)).collect(Collectors.toList());
@@ -374,7 +375,7 @@ public class AppAgentController extends BaseController {
             });
         }
         appUserDetailVo.setBusinessOrders(businessOrders);*/
-
+        appUserDetailVo.setUserId(userId);
         return R.ok(appUserDetailVo,MessageUtils.message("11022"));
     }
 

+ 57 - 0
game-business/src/main/java/com/game/business/controller/AppGameCommissionController.java

@@ -3,6 +3,8 @@ package com.game.business.controller;
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
 
+import com.game.business.domain.AppUserAgent;
+import com.game.business.service.IAppUserAgentService;
 import com.game.common.core.domain.R;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -39,6 +41,9 @@ public class AppGameCommissionController extends BaseController
     @Autowired
     private IAppGameCommissionService appGameCommissionService;
 
+    @Autowired
+    private IAppUserAgentService appUserAgentService;
+
     /**
      * 查询游戏佣金配置列表
      */
@@ -112,4 +117,56 @@ public class AppGameCommissionController extends BaseController
     {
         return R.ok(appGameCommissionService.deleteAppGameCommissionByIds(ids));
     }
+
+    @PreAuthorize("@ss.hasPermi('business:user:updateSetting')")
+    @Log(title = "更新用户游戏佣金待遇", businessType = BusinessType.UPDATE)
+    @PostMapping(value = "/updateSetting")
+    @ApiOperation(value = "更新用户游戏佣金待遇", notes = "更新用户游戏佣金待遇")
+    public R<String> updateSetting(@RequestBody AppGameCommission appGameCommission){
+        AppGameCommission gameCommission = appGameCommissionService.selectAppGameCommissionById(appGameCommission.getId());
+        AppUserAgent appUserAgent = appUserAgentService.selectInfo(appGameCommission.getUserId());
+        if(null == appUserAgent){
+            return R.fail("修改失败,用户代理信息不存在");
+        }
+        if(appUserAgent.getPid().doubleValue() == 0){
+            return R.fail("顶级账号禁止修改");
+        }
+        //查询上级
+        AppGameCommission superQuery = new AppGameCommission();
+        superQuery.setUserId(appUserAgent.getPid());
+        superQuery.setGameId(appGameCommission.getGameId());
+        List<AppGameCommission> superGameCommissions = appGameCommissionService.selectAppGameCommissionList(superQuery);
+        if(null != superGameCommissions && superGameCommissions.size()>0){
+            AppGameCommission superGameCommission = superGameCommissions.get(0);
+            if(superGameCommission.getGameRate() < appGameCommission.getGameRate()){
+                return R.fail("修改失败,超过最大可修改值:" + superGameCommission.getGameRate());
+            }
+        }
+        //查询下级
+        AppGameCommission downQuery = new AppGameCommission();
+        downQuery.setPid(appGameCommission.getUserId());
+        downQuery.setGameId(appGameCommission.getGameId());
+        List<AppGameCommission> downGameCommissions = appGameCommissionService.selectAppGameCommissionList(downQuery);
+        if(null != downGameCommissions && downGameCommissions.size() > 0){
+            double rate = downGameCommissions.stream().mapToDouble(e->e.getGameRate()).max().getAsDouble();
+            if(appGameCommission.getGameRate() < rate){
+                return R.fail("修改失败,超过最小可修改值:" + rate);
+            }
+        }
+        AppGameCommission updateCommission = new AppGameCommission();
+        if(null != gameCommission){
+            updateCommission.setId(appGameCommission.getId());
+            updateCommission.setGameId(appGameCommission.getGameId());
+            updateCommission.setGameRate(appGameCommission.getGameRate());
+            appGameCommissionService.updateAppGameCommission(updateCommission);
+        }else{
+            updateCommission.setGameId(appGameCommission.getGameId());
+            updateCommission.setGameRate(appGameCommission.getGameRate());
+            updateCommission.setGameName(appGameCommission.getGameName());
+            updateCommission.setUserId(appGameCommission.getUserId());
+            updateCommission.setPid(appUserAgent.getPid());
+            appGameCommissionService.insertAppGameCommission(updateCommission);
+        }
+        return R.ok("修改成功");
+    }
 }

+ 42 - 0
game-business/src/main/java/com/game/business/controller/AppUserAgentController.java

@@ -548,4 +548,46 @@ public class AppUserAgentController extends BaseController
         appGameCommissionVO.setGameRate(sortGameCommissions.get(0).getGameRate());
         setGameCommissionMinRate(appGameCommissionVO, userId);
     }
+
+    @PostMapping(value = "/updateSetting")
+    @ApiOperation(value = "更新代理成员设置", notes = "更新代理成员设置")
+    @PreAuthorize("@ss.hasPermi('business:user:updateSetting')")
+    @Log(title = "用户代理设置-更新直播、分红待遇", businessType = BusinessType.UPDATE)
+    public R<String> updateSetting(@RequestBody AppUserAgent appUserAgent){
+        AppUserAgent userAgent = appUserAgentService.selectInfo(appUserAgent.getUserId());
+        if(null == userAgent){
+            return R.fail("修改失败,代理信息不存在");
+        }
+        if(userAgent.getPid().doubleValue() == 0){
+            return R.fail("顶级账号禁止修改");
+        }
+        //查询上级
+        AppUserAgent superAgent = appUserAgentService.selectInfo(userAgent.getPid());
+        if(superAgent.getDividendGuaranteeRate().doubleValue() < appUserAgent.getDividendGuaranteeRate().doubleValue()){
+            return R.fail("修改失败,保底分红超过最大可修改值:" + superAgent.getDividendGuaranteeRate());
+        }
+        if(superAgent.getLiveRate().doubleValue() < appUserAgent.getLiveRate().doubleValue()){
+            return R.fail("修改失败,直播分成超过最大可修改值:" + superAgent.getLiveRate());
+        }
+        //查询下级
+        AppUserAgent queryAgent = new AppUserAgent();
+        queryAgent.setPid(userAgent.getUserId());
+        List<AppUserAgent> downAgents = appUserAgentService.selectAppUserAgentList(queryAgent);
+        if(null != downAgents && downAgents.size() > 0){
+            double dividendGuaranteeRate = downAgents.stream().mapToDouble(e->e.getDividendGuaranteeRate()).max().getAsDouble();
+            if(appUserAgent.getDividendGuaranteeRate() < dividendGuaranteeRate){
+                return R.fail("修改失败,保底分红超过最小可修改值:" + dividendGuaranteeRate);
+            }
+            double liveRate = downAgents.stream().mapToDouble(e->e.getLiveRate()).max().getAsDouble();
+            if(appUserAgent.getLiveRate() < liveRate){
+                return R.fail("修改失败,直播分成超过最小可修改值:" + liveRate);
+            }
+        }
+        AppUserAgent updateAgent = new AppUserAgent();
+        updateAgent.setId(userAgent.getId());
+        updateAgent.setDividendGuaranteeRate(appUserAgent.getDividendGuaranteeRate());
+        updateAgent.setLiveRate(appUserAgent.getLiveRate());
+        appUserAgentService.updateAppUserAgent(updateAgent);
+        return R.ok("修改成功");
+    }
 }

+ 4 - 0
game-business/src/main/java/com/game/business/vo/AppUserDetailVo.java

@@ -13,8 +13,12 @@ public class AppUserDetailVo implements Serializable {
     @ApiModelProperty(value = "上级用户列表")
     private List<AppUserAgent> superUserList;
 
+    @ApiModelProperty(value = "下级级用户列表")
+    private List<AppUserAgent> downUserList;
+
     private Double dividendGuaranteeRate;
     private Double liveRate;
+    private Long userId;
     List<AppGameCommission> gameCommissionList;
     List<AppUser> ipUserList;
     List<AppUsersCashAccount> usersCashAccounts;

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

@@ -53,6 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="apiSecret != null  and apiSecret != ''"> and api_secret = #{apiSecret}</if>
             <if test="orderno != null "> and orderno = #{orderno}</if>
         </where>
+        order by orderno asc
     </select>
     
     <select id="selectAppChargeChannelById" parameterType="Long" resultMap="AppChargeChannelResult">

+ 44 - 0
game-ui/src/api/business/tran_record.js

@@ -0,0 +1,44 @@
+import request from '@/utils/request'
+
+// 查询用户收支明细列表
+export function listTran_record(query) {
+  return request({
+    url: '/business/tran_record/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询用户收支明细详细
+export function getTran_record(id) {
+  return request({
+    url: '/business/tran_record/' + id,
+    method: 'get'
+  })
+}
+
+// 新增用户收支明细
+export function addTran_record(data) {
+  return request({
+    url: '/business/tran_record',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改用户收支明细
+export function updateTran_record(data) {
+  return request({
+    url: '/business/tran_record',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除用户收支明细
+export function delTran_record(id) {
+  return request({
+    url: '/business/tran_record/' + id,
+    method: 'delete'
+  })
+}

+ 18 - 0
game-ui/src/api/business/user.js

@@ -75,6 +75,24 @@ export function updateUser(data) {
   })
 }
 
+// 修改app用户代理设置
+export function updateUserAgent(data) {
+  return request({
+    url: '/business/agent/updateSetting',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改app用户游戏返佣设置
+export function updateGameCommissionAgent(data) {
+  return request({
+    url: '/business/commission/updateSetting',
+    method: 'post',
+    data: data
+  })
+}
+
 // 删除app用户
 export function delUser(userid) {
   return request({

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

@@ -177,7 +177,8 @@
       <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="渠道key" align="center" prop="channelKey" />-->
+      <el-table-column label="渠道key" align="center" prop="channelKey" />
+      <el-table-column label="渠道编码" align="center" prop="channelNo" />
       <el-table-column label="充值手续费" align="center" prop="rate">
         <template slot-scope="scope">
           {{(scope.row.rate * 100).toFixed(2) + "%"}}
@@ -243,6 +244,9 @@
         <el-form-item label="渠道key" prop="channelKey">
           <el-input v-model="form.channelKey" placeholder="请输入渠道key" />
         </el-form-item>
+        <el-form-item label="渠道编码" 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="请输入充值手续费" />
         </el-form-item>
@@ -336,6 +340,7 @@ export default {
         pageSize: 10,
         name: null,
         channelKey: null,
+        channelNo: null,
         rate: null,
         logoUrl: null,
         company: null,
@@ -382,6 +387,7 @@ export default {
         id: null,
         name: null,
         channelKey: null,
+        channelNo: null,
         rate: null,
         withdrawRate: null,
         logoUrl: null,

+ 585 - 0
game-ui/src/views/business/tran_record/index.vue

@@ -0,0 +1,585 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="160px">
+<!--      <el-form-item label="直属上级代理" prop="agentId">
+        <el-input
+          v-model="queryParams.agentId"
+          placeholder="请输入直属上级代理"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>-->
+      <el-form-item label="货币类型" prop="currencyType">
+        <el-select v-model="queryParams.currencyType" placeholder="请选择货币类型" clearable>
+          <el-option
+            v-for="dict in dict.type.currency_type"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="来源UID" prop="fromUid">
+        <el-input
+          v-model="queryParams.fromUid"
+          placeholder="请输入"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="兑换的商品的ID" prop="goodsId">
+        <el-input
+          v-model="queryParams.goodsId"
+          placeholder="请输入"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label=" 第三表记录id" prop="orderId">
+        <el-input
+          v-model="queryParams.orderId"
+          placeholder="请输入 第三表记录id"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="备注" prop="remarks">
+        <el-input
+          v-model="queryParams.remarks"
+          placeholder="请输入备注"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+  <!--      <el-form-item label="受益UID" prop="toUid">
+          <el-input
+            v-model="queryParams.toUid"
+            placeholder="请输入"
+            clearable
+            @keyup.enter.native="handleQuery"
+          />
+        </el-form-item>-->
+      <el-form-item label="交易组ID" prop="tranGroupId">
+        <el-input
+          v-model="queryParams.tranGroupId"
+          placeholder="请输入交易组ID"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="1级交易类型" prop="tranType1">
+        <el-select v-model="queryParams.tranType1" placeholder="请选择" clearable>
+          <el-option
+            v-for="dict in dict.type.fin_tran1"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label=" 2级交易类型" prop="tranType2">
+        <el-select v-model="queryParams.tranType2" placeholder="请选择" clearable>
+          <el-option
+            v-for="dict in dict.type.fin_tran2"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label=" 3级交易类型" prop="tranType3">
+        <el-select v-model="queryParams.tranType3" placeholder="请选择" clearable>
+          <el-option
+            v-for="dict in dict.type.fin_tran3"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="UID" prop="uid">
+        <el-input
+          v-model="queryParams.uid"
+          placeholder="请输入"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+<!--      <el-form-item label="是否已满足提现(用于充值记录)" prop="withdrawFlag">
+        <el-select v-model="queryParams.withdrawFlag" placeholder="请选择是否已满足提现" clearable>
+          <el-option
+            v-for="dict in dict.type.app_is_cash"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
+      </el-form-item>-->
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['business:tran_record:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['business:tran_record:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['business:tran_record:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['business:tran_record:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="tran_recordList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="ID" align="center" prop="id" />
+      <el-table-column label="UID" align="center" prop="uid" />
+      <el-table-column label="来源UID" align="center" prop="fromUid" />
+      <el-table-column label="货币类型" align="center" prop="currencyType">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.currency_type" :value="scope.row.currencyType"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="交易金额" align="center" prop="coinChange" width="100">
+        <template slot-scope="scope">
+          {{scope.row.currencyType==2?scope.row.coinChange:scope.row.diamondCoinChange}}
+        </template>
+      </el-table-column>
+      <el-table-column label="交易后剩余金额" align="center" prop="coinChange" width="100">
+        <template slot-scope="scope">
+          {{scope.row.currencyType==2?scope.row.afterCoin:scope.row.afterDiamondCoin}}
+        </template>
+      </el-table-column>
+      <el-table-column label="1级交易类型" align="center" prop="tranType1" width="100">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.fin_tran1" :value="scope.row.tranType1"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="2级交易类型" align="center" prop="tranType2" width="100">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.fin_tran2" :value="scope.row.tranType2"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="3级交易类型" align="center" prop="tranType3" width="130">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.fin_tran3" :value="scope.row.tranType3"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="备注" align="center" prop="remarks" width="200"/>
+      <el-table-column label="此记录关联的购买的商品的ID" align="center" prop="goodsId" width="130"/>
+      <el-table-column label="第三表记录id" align="center" prop="orderId" width="130"/>
+      <el-table-column label="交易组ID" align="center" prop="tranGroupId" width="130"/>
+      <el-table-column label="是否已满足提现(用于充值判断)" align="center" prop="withdrawFlag" width="130">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.app_is_cash" :value="scope.row.withdrawFlag"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['business:tran_record:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['business:tran_record:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改用户收支明细对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="当前剩余金币" prop="afterCoin">
+          <el-input v-model="form.afterCoin" placeholder="请输入当前剩余金币" />
+        </el-form-item>
+        <el-form-item label="当前剩余人民币" prop="afterMoney">
+          <el-input v-model="form.afterMoney" placeholder="请输入当前剩余人民币" />
+        </el-form-item>
+        <el-form-item label="当前剩余映票" prop="afterTicket">
+          <el-input v-model="form.afterTicket" placeholder="请输入当前剩余映票" />
+        </el-form-item>
+        <el-form-item label="当前剩余余额" prop="afterDiamondCoin">
+          <el-input v-model="form.afterDiamondCoin" placeholder="请输入当前剩余余额" />
+        </el-form-item>
+        <el-form-item label="直属上级代理" prop="agentId">
+          <el-input v-model="form.agentId" placeholder="请输入直属上级代理" />
+        </el-form-item>
+        <el-form-item label="交易金币" prop="coinChange">
+          <el-input v-model="form.coinChange" placeholder="请输入交易金币" />
+        </el-form-item>
+        <el-form-item label="变动后的余额" prop="diamondCoinChange">
+          <el-input v-model="form.diamondCoinChange" placeholder="请输入变动后的余额" />
+        </el-form-item>
+        <el-form-item label=" 佣金关系人" prop="commissionRelatedUid">
+          <el-input v-model="form.commissionRelatedUid" placeholder="请输入 佣金关系人" />
+        </el-form-item>
+        <el-form-item label="消费金额,基于此字段分佣" prop="consumptionCoin">
+          <el-input v-model="form.consumptionCoin" placeholder="请输入消费金额,基于此字段分佣" />
+        </el-form-item>
+        <el-form-item label="消费人民币,基于此字段分佣" prop="consumptionMoney">
+          <el-input v-model="form.consumptionMoney" placeholder="请输入消费人民币,基于此字段分佣" />
+        </el-form-item>
+        <el-form-item label="货币类型 1:人民币 2:金币 3:映票 4:余额" prop="currencyType">
+          <el-select v-model="form.currencyType" placeholder="请选择货币类型 1:人民币 2:金币 3:映票 4:余额">
+            <el-option
+              v-for="dict in dict.type.currency_type"
+              :key="dict.value"
+              :label="dict.label"
+              :value="parseInt(dict.value)"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label=" 送礼人ID" prop="fromUid">
+          <el-input v-model="form.fromUid" placeholder="请输入 送礼人ID" />
+        </el-form-item>
+        <el-form-item label="此记录关联的购买的商品的ID" prop="goodsId">
+          <el-input v-model="form.goodsId" placeholder="请输入此记录关联的购买的商品的ID" />
+        </el-form-item>
+        <el-form-item label="家族ID" prop="guildId">
+          <el-input v-model="form.guildId" placeholder="请输入家族ID" />
+        </el-form-item>
+        <el-form-item label="上级经纪人ID,对应AdminUser表" prop="managerCoId">
+          <el-input v-model="form.managerCoId" placeholder="请输入上级经纪人ID,对应AdminUser表" />
+        </el-form-item>
+        <el-form-item label="上级经纪人ID,对应AdminUser表" prop="managerId">
+          <el-input v-model="form.managerId" placeholder="请输入上级经纪人ID,对应AdminUser表" />
+        </el-form-item>
+        <el-form-item label="人民币变动" prop="moneyChange">
+          <el-input v-model="form.moneyChange" placeholder="请输入人民币变动" />
+        </el-form-item>
+        <el-form-item label=" 第三表记录id" prop="orderId">
+          <el-input v-model="form.orderId" placeholder="请输入 第三表记录id" />
+        </el-form-item>
+        <el-form-item label="收益比例" prop="perc">
+          <el-input v-model="form.perc" placeholder="请输入收益比例" />
+        </el-form-item>
+        <el-form-item label=" (礼物、守护、坐骑、靓号、短视频、动态、svpi、贵族、游戏)数量" prop="proCount">
+          <el-input v-model="form.proCount" placeholder="请输入 (礼物、守护、坐骑、靓号、短视频、动态、svpi、贵族、游戏)数量" />
+        </el-form-item>
+        <el-form-item label=" (礼物、守护、坐骑、靓号、短视频、动态、svpi、贵族、游戏、充值)ID" prop="proId">
+          <el-input v-model="form.proId" placeholder="请输入 (礼物、守护、坐骑、靓号、短视频、动态、svpi、贵族、游戏、充值)ID" />
+        </el-form-item>
+        <el-form-item label="备注" prop="remarks">
+          <el-input v-model="form.remarks" placeholder="请输入备注" />
+        </el-form-item>
+        <el-form-item label=" 场景id" prop="sceneId1">
+          <el-input v-model="form.sceneId1" placeholder="请输入 场景id" />
+        </el-form-item>
+        <el-form-item label=" 某次直播时间段内的一个标识" prop="sceneId2">
+          <el-input v-model="form.sceneId2" placeholder="请输入 某次直播时间段内的一个标识" />
+        </el-form-item>
+        <el-form-item label="映票变动" prop="ticketChange">
+          <el-input v-model="form.ticketChange" placeholder="请输入映票变动" />
+        </el-form-item>
+        <el-form-item label=" 受益的人ID" prop="toUid">
+          <el-input v-model="form.toUid" placeholder="请输入 受益的人ID" />
+        </el-form-item>
+        <el-form-item label="交易组ID,ID相同说明是一次交易产生的" prop="tranGroupId">
+          <el-input v-model="form.tranGroupId" placeholder="请输入交易组ID,ID相同说明是一次交易产生的" />
+        </el-form-item>
+        <el-form-item label=" 1级交易类型" prop="tranType1">
+          <el-select v-model="form.tranType1" placeholder="请选择 1级交易类型">
+            <el-option
+              v-for="dict in dict.type.fin_tran1"
+              :key="dict.value"
+              :label="dict.label"
+              :value="parseInt(dict.value)"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label=" 2级交易类型 FinTranType2" prop="tranType2">
+          <el-select v-model="form.tranType2" placeholder="请选择 2级交易类型 FinTranType2">
+            <el-option
+              v-for="dict in dict.type.fin_tran2"
+              :key="dict.value"
+              :label="dict.label"
+              :value="parseInt(dict.value)"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label=" 3级交易类型 FinTranType3" prop="tranType3">
+          <el-select v-model="form.tranType3" placeholder="请选择 3级交易类型 FinTranType3">
+            <el-option
+              v-for="dict in dict.type.fin_tran3"
+              :key="dict.value"
+              :label="dict.label"
+              :value="parseInt(dict.value)"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label=" 用户ID" prop="uid">
+          <el-input v-model="form.uid" placeholder="请输入 用户ID" />
+        </el-form-item>
+        <el-form-item label="是否已满足提现 0:未满足  1:已满足" prop="withdrawFlag">
+          <el-select v-model="form.withdrawFlag" placeholder="请选择是否已满足提现 0:未满足  1:已满足">
+            <el-option
+              v-for="dict in dict.type.app_is_cash"
+              :key="dict.value"
+              :label="dict.label"
+              :value="parseInt(dict.value)"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listTran_record, getTran_record, delTran_record, addTran_record, updateTran_record } from "@/api/business/tran_record";
+
+export default {
+  name: "Tran_record",
+  dicts: ['currency_type', 'fin_tran2', 'fin_tran3', 'app_is_cash', 'fin_tran1'],
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 用户收支明细表格数据
+      tran_recordList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        afterCoin: null,
+        afterMoney: null,
+        afterTicket: null,
+        afterDiamondCoin: null,
+        agentId: null,
+        coinChange: null,
+        diamondCoinChange: null,
+        commissionRelatedUid: null,
+        consumptionCoin: null,
+        consumptionMoney: null,
+        currencyType: null,
+        fromUid: null,
+        goodsId: null,
+        guildId: null,
+        managerCoId: null,
+        managerId: null,
+        moneyChange: null,
+        orderId: null,
+        perc: null,
+        proCount: null,
+        proId: null,
+        remarks: null,
+        sceneId1: null,
+        sceneId2: null,
+        sceneType: null,
+        ticketChange: null,
+        toUid: null,
+        tranGroupId: null,
+        tranType1: null,
+        tranType2: null,
+        tranType3: null,
+        uid: null,
+        withdrawFlag: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询用户收支明细列表 */
+    getList() {
+      this.loading = true;
+      listTran_record(this.queryParams).then(response => {
+        this.tran_recordList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        afterCoin: null,
+        afterMoney: null,
+        afterTicket: null,
+        afterDiamondCoin: null,
+        agentId: null,
+        coinChange: null,
+        diamondCoinChange: null,
+        commissionRelatedUid: null,
+        consumptionCoin: null,
+        consumptionMoney: null,
+        createTime: null,
+        currencyType: null,
+        fromUid: null,
+        goodsId: null,
+        guildId: null,
+        managerCoId: null,
+        managerId: null,
+        moneyChange: null,
+        orderId: null,
+        perc: null,
+        proCount: null,
+        proId: null,
+        remarks: null,
+        sceneId1: null,
+        sceneId2: null,
+        sceneType: null,
+        ticketChange: null,
+        toUid: null,
+        tranGroupId: null,
+        tranType1: null,
+        tranType2: null,
+        tranType3: null,
+        uid: null,
+        withdrawFlag: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加用户收支明细";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getTran_record(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改用户收支明细";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateTran_record(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addTran_record(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal.confirm('是否确认删除用户收支明细编号为"' + ids + '"的数据项?').then(function() {
+        return delTran_record(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('business/tran_record/export', {
+        ...this.queryParams
+      }, `tran_record_${new Date().getTime()}.xlsx`)
+    }
+  }
+};
+</script>

+ 121 - 8
game-ui/src/views/business/user/index.vue

@@ -537,18 +537,45 @@
                 </el-table-column>
               </el-table>
             </el-tab-pane>
+            <el-tab-pane label="下级代理人列表" name="nine">
+              <el-table
+                :data="downUserList"
+                stripe
+                style="width: 100%">
+                <el-table-column
+                  prop="userId"
+                  label="UID">
+                </el-table-column>
+                <el-table-column
+                  prop="pid"
+                  label="上级UID">
+                </el-table-column>
+              </el-table>
+            </el-tab-pane>
             <el-tab-pane label="用户待遇" name="second">
               <el-form-item label="">
                 <span>
-                  直播分红:{{undefined!=userInfo.infoDetail?userInfo.infoDetail.liveRate+"%":"-"}}
+                  直播分红:<el-input
+                  v-model="appAgentForm.liveRate"
+                  placeholder="请输入直播分红 "
+                  style="width: 150px"
+                />
+                </span><span style="padding-left: 10px">%</span>
+                <span style="margin-left: 1rem;">
+                  保底分红:<el-input
+                  v-model="appAgentForm.dividendGuaranteeRate"
+                  placeholder="请输入分红比例 "
+                  style="width: 150px"
+                />
                 </span>
+                <span style="padding-left: 10px">%</span>
                 <span style="margin-left: 1rem;">
-                  保底分红:{{undefined!=userInfo.infoDetail?userInfo.infoDetail.dividendGuaranteeRate+"%":"-"}}
+                  <el-button type="primary" @click="submitAgentForm">修 改</el-button>
                 </span>
                 <el-table
                   :data="undefined!=userInfo.infoDetail?userInfo.infoDetail.gameCommissionList:[]"
                   stripe
-                  style="width: 100%">
+                  style="width: 100%;margin-top: 10px">
                   <el-table-column
                     prop="gameName"
                     label="游戏">
@@ -557,7 +584,21 @@
                     prop="gameRate"
                     label="返佣">
                     <template slot-scope="scope">
-                      {{scope.row.gameRate + "%"}}
+                      <el-input
+                        v-model="scope.row.gameRate"
+                        placeholder="请输入游戏返佣比例 "
+                        style="width: 150px"
+                      />
+                    </template>
+                  </el-table-column>
+                  <el-table-column fixed="right" label="操作" align="center" width="200" class-name="small-padding fixed-width">
+                    <template slot-scope="scope">
+                      <el-button
+                        size="mini"
+                        type="text"
+                        icon="el-icon-edit"
+                        @click="submitGameCommissionForm(scope.row)"
+                      >修 改</el-button>
                     </template>
                   </el-table-column>
                 </el-table>
@@ -600,6 +641,11 @@
                   prop="uid"
                   label="UID">
                 </el-table-column>
+                <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
                   prop="account"
                   label="账号">
@@ -759,7 +805,7 @@
 </template>
 
 <script>
-import { listUser, getUser, delUser, addUser, updateUser,resetUser,userCharge,channelList,withdraw,openLive,userDetail,liveCommission,getGift  } from "@/api/business/user";
+import { listUser, getUser, delUser, addUser, updateUser,resetUser,userCharge,channelList,withdraw,openLive,userDetail,liveCommission,getGift,updateUserAgent,updateGameCommissionAgent  } from "@/api/business/user";
 import { listAccount} from "@/api/business/account";
 import { listOrder } from "@/api/business/order";
 import { listBetting} from "@/api/business/betting";
@@ -768,7 +814,7 @@ import {allList} from "@/api/business/lottery";
 
 export default {
   name: "User",
-  dicts: ['is_anchor_auth', 'app_user_role', 'app_user_status', 'app_user_online_status','app_user_coin_type','app_charge_rate','app_goods_order_status','app_betting_is_live','app_game_betting_type','app_game_betting_winning'],
+  dicts: ['is_anchor_auth', 'app_user_role', 'app_user_status', 'app_user_online_status','app_user_coin_type','app_charge_rate','app_goods_order_status','app_betting_is_live','app_game_betting_type','app_game_betting_winning','app_user_cash_account'],
   data() {
     return {
       activeName:"first",
@@ -824,11 +870,25 @@ export default {
       userInfo:{},
       closeMsg:null,
       superUserList:[],
+      downUserList:[],
       typeMap:{},
       typeList:[],
       gameItemMap:{},
       gameItemList:[],
       gameItemShowList:[],
+      appAgentForm:{
+        liveRate:null,
+        dividendGuaranteeRate:null,
+        userId:null
+      },
+      appGameCommissionForm:{
+        id:null,
+        gameId:null,
+        userId:null,
+        pid:null,
+        gameRate:null,
+        gameName:null
+      },
       queryIpParams: {
         pageNum: 1,
         pageSize: 10,
@@ -1017,7 +1077,7 @@ export default {
     getAccountList() {
       this.accountLoading = true;
       this.queryAccountParams.uid = this.userInfo.userid;
-      listAccount(this.queryIpParams).then(response => {
+      listAccount(this.queryAccountParams).then(response => {
         this.accountList = response.rows;
         this.accountTotal = response.total;
         this.accountLoading = false;
@@ -1493,6 +1553,55 @@ export default {
         loading.close();
       });
     },
+    /** 代理待遇提交按钮 */
+    submitAgentForm() {
+      var that =this;
+      if(!that.appAgentForm.liveRate){
+        that.$modal.msgError("直播分红不能为空!");
+        return;
+      }
+      if(!that.appAgentForm.dividendGuaranteeRate){
+        that.$modal.msgError("保底分红不能为空!");
+        return;
+      }
+      const loading = this.$loading({
+        lock: true,
+        text: '加载中',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      setTimeout(function (){loading.close();},1000);
+      updateUserAgent(this.appAgentForm).then(response => {
+        that.$modal.msgSuccess("修改成功");
+        that.getList();
+        loading.close();
+      });
+    },
+    /** 代理游戏待遇提交按钮 */
+    submitGameCommissionForm(row) {
+      var that =this;
+      that.appGameCommissionForm = row;
+      if(!that.appGameCommissionForm.gameRate){
+        that.$modal.msgError("游戏返佣比例不能为空!");
+        return;
+      }
+      if(!that.appGameCommissionForm.gameRate){
+        that.$modal.msgError("游戏返佣不能为空!");
+        return;
+      }
+      const loading = this.$loading({
+        lock: true,
+        text: '加载中',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      setTimeout(function (){loading.close();},1000);
+      updateGameCommissionAgent(this.appGameCommissionForm).then(response => {
+        that.getList();
+        that.$modal.msgSuccess("修改成功");
+        loading.close();
+      });
+    },
     /** 删除按钮操作 */
     handleDelete(row) {
       const userids = row.userid || this.ids;
@@ -1562,8 +1671,12 @@ export default {
       that.userInfo["infoDetail"] = {};
       userDetail({"userId":row.userid}).then(response => {
           that.superUserList = response.data.superUserList;
-          this.userInfo["infoDetail"] = response.data;
+          that.downUserList = response.data.downUserList;
+          that.userInfo["infoDetail"] = response.data;
           that.superOpen = true;
+          that.appAgentForm["dividendGuaranteeRate"] = undefined!=that.userInfo.infoDetail?that.userInfo.infoDetail.dividendGuaranteeRate:0.00;
+          that.appAgentForm["liveRate"] = undefined!=that.userInfo.infoDetail?that.userInfo.infoDetail.liveRate:0.00;
+          that.appAgentForm["userId"] = that.userInfo.infoDetail.userId;
       });
     },
     handleClick(tab, event) {