gogs il y a 1 mois
Parent
commit
6a91a5b7ff

+ 2 - 0
game-admin/src/main/resources/i18n/messages.properties

@@ -1277,6 +1277,8 @@
 11574=\u5546\u54C1
 11575=\u4EE3\u7406\u5206\u7EA2
 11576=\u9080\u8BF7\u5956\u52B1
+11577=\u6E38\u620F\u6D88\u8D39,\u8865\u5145\u6D41\u6C34
+11578=\u63D0\u73B0\u5BA1\u6838\u56DE\u9000
 
 not.null=* \u5FC5\u987B\u586B\u5199
 user.jcaptcha.error=\u9A8C\u8BC1\u7801\u9519\u8BEF

+ 2 - 0
game-admin/src/main/resources/i18n/messages_ar.properties

@@ -1275,6 +1275,8 @@
 11574=\u0633\u0644\u0639\u0629
 11575=\u0623\u0631\u0628\u0627\u062D \u0627\u0644\u0648\u0643\u0627\u0644\u0629
 11576=\u9080\u8BF7\u5956\u52B1
+11577=\u6E38\u620F\u6D88\u8D39,\u8865\u5145\u6D41\u6C34
+11578=\u63D0\u73B0\u5BA1\u6838\u56DE\u9000
 # 11568 =
 # 11569 =
 # 11570 =

+ 2 - 0
game-admin/src/main/resources/i18n/messages_en.properties

@@ -1275,6 +1275,8 @@
 11574=commodity
 11575=Agency dividend
 11576=\u9080\u8BF7\u5956\u52B1
+11577=\u6E38\u620F\u6D88\u8D39,\u8865\u5145\u6D41\u6C34
+11578=\u63D0\u73B0\u5BA1\u6838\u56DE\u9000
 #11568=
 #11569=
 #11570=

+ 2 - 0
game-admin/src/main/resources/i18n/messages_tr.properties

@@ -1276,6 +1276,8 @@
 11574=emtia
 11575=Ajans temett\u00FC
 11576=\u9080\u8BF7\u5956\u52B1
+11577=\u6E38\u620F\u6D88\u8D39,\u8865\u5145\u6D41\u6C34
+11578=\u63D0\u73B0\u5BA1\u6838\u56DE\u9000
 #11568=
 #11569=
 #11570=

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

@@ -12,8 +12,11 @@ import com.game.business.domain.AppUsersCharge;
 import com.game.business.domain.FinTranRecord;
 import com.game.business.dto.RestPwdDto;
 import com.game.business.dto.UserChargeDto;
+import com.game.business.dto.UserWithdrawDto;
 import com.game.business.service.IAppChargeChannelService;
 import com.game.business.service.IAppUsersChargeService;
+import com.game.business.service.IFinTranRecordService;
+import com.game.business.task.AppUserCountTask;
 import com.game.business.util.Md5Utils;
 import com.game.common.constant.AppSceneType;
 import com.game.common.constant.finance.FinTranAddedInfo;
@@ -75,6 +78,12 @@ public class AppUserController extends BaseController
     @Autowired
     private IAppChargeChannelService appChargeChannelService;
 
+    @Autowired
+    private IFinTranRecordService finTranRecordService;
+
+    @Autowired
+    private AppUserCountTask appUserCountTask;
+
     /**
      * 查询app用户列表
      */
@@ -245,6 +254,38 @@ public class AppUserController extends BaseController
         return R.ok("充值成功");
     }
 
+    /**
+     * 补足提现流水
+     */
+    @PreAuthorize("@ss.hasPermi('business:user:charge')")
+    @Log(title = "app用户", businessType = BusinessType.UPDATE)
+    @PostMapping("/withdraw")
+    @ApiOperation(value = "补足提现流水", notes = "补足提现流水")
+    public R<String> withdraw(HttpServletResponse response,@RequestBody @Validated UserWithdrawDto withdrawDto)
+    {
+        AppUser appUser = appUserService.selectAppUserByUserid(withdrawDto.getUserId());
+        if(null == appUser){
+            return R.fail("补足流水失败,用户不存在");
+        }
+        try{
+            //流水 余额
+            FinTranAddedInfo addedInfo = FinTranAddedInfo.createTranInfo(appUser.getUserid(), 0, 0, AppSceneType.Scene_None, "");
+            FinTranRecord tran = null;
+            tran = FinTranRecord.initFinTranRecordSomeParams(addedInfo, FinTranType3.CHARGE_IN_Back, FinTranType1.U_Income_Coin_Balance, appUser);
+            tran.setDiamondCoinChange(withdrawDto.getAmount());
+            tran.setAfterDiamondCoin(appUser.getDiamondCoin());
+            tran.setCurrencyType(TranCurrencyType.Balance.getType());
+            tran.setTranGroupId(IdUtil.getSnowflakeNextId());
+            tran.setRemarks("补充提现流水");
+            finTranRecordService.insertFinTranRecord(tran);
+            appUserCountTask.calculationWithdraw(tran.getUid());
+        } catch (Exception e) {
+            log.info("{}补足流水失败:{}",withdrawDto.getUserId(),e.getMessage());
+            return  R.fail("补足流水失败");
+        }
+        return R.ok("补足流水成功");
+    }
+
     /**
      * 导出app用户列表
      */

+ 55 - 3
game-business/src/main/java/com/game/business/controller/AppUsersCashrecordController.java

@@ -2,6 +2,19 @@ package com.game.business.controller;
 
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
+
+import cn.hutool.core.util.IdUtil;
+import com.baomidou.dynamic.datasource.annotation.DSTransactional;
+import com.game.business.domain.AppUser;
+import com.game.business.domain.FinTranRecord;
+import com.game.business.service.IAppUserService;
+import com.game.business.task.AppUserCountTask;
+import com.game.common.constant.AppSceneType;
+import com.game.common.constant.finance.FinTranAddedInfo;
+import com.game.common.constant.finance.FinTranType1;
+import com.game.common.constant.finance.FinTranType3;
+import com.game.common.constant.finance.TranCurrencyType;
+import com.game.common.core.domain.R;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -39,6 +52,12 @@ public class AppUsersCashrecordController extends BaseController
     @Autowired
     private IAppUsersCashrecordService appUsersCashrecordService;
 
+    @Autowired
+    private IAppUserService appUserService;
+
+    @Autowired
+    private AppUserCountTask appUserCountTask;
+
     /**
      * 查询提现记录列表
      */
@@ -96,9 +115,42 @@ public class AppUsersCashrecordController extends BaseController
     @Log(title = "提现记录", businessType = BusinessType.UPDATE)
     @ApiOperation(value = "修改提现记录", notes = "修改提现记录")
     @PutMapping
-    public AjaxResult edit(@RequestBody AppUsersCashrecord appUsersCashrecord)
-    {
-        return toAjax(appUsersCashrecordService.updateAppUsersCashrecord(appUsersCashrecord));
+    @DSTransactional
+    public R<String> edit(@RequestBody AppUsersCashrecord appUsersCashrecord) throws Exception {
+        AppUsersCashrecord cashrecord = appUsersCashrecordService.selectAppUsersCashrecordById(appUsersCashrecord.getId());
+        if(null == cashrecord){
+            return R.fail("审核失败,记录不存在");
+        }
+        if(cashrecord.getStatus().intValue() != 0){
+            return R.fail("审核失败,当前状态不可审核");
+        }
+        AppUser appUser = appUserService.selectAppUserByUserid(cashrecord.getUid());
+        if(null == appUser){
+            return R.fail("审核失败,用户不存在");
+        }
+        AppUsersCashrecord update = new AppUsersCashrecord();
+        update.setId(cashrecord.getId());
+        update.setStatus(appUsersCashrecord.getStatus());
+        update.setReason(appUsersCashrecord.getReason());
+        int rest = appUsersCashrecordService.updateAppUsersCashrecord(update);
+        if(rest < 1){
+            return R.fail("审核失败");
+        }
+        if(2 == appUsersCashrecord.getStatus().intValue()){
+
+            //审核驳回 回退用户金额
+            //流水 余额
+            FinTranAddedInfo addedInfo = FinTranAddedInfo.createTranInfo(appUser.getUserid(), 0, 0, AppSceneType.Scene_None, "");
+            FinTranRecord tran = FinTranRecord.initFinTranRecordSomeParams(addedInfo, FinTranType3.CASH_DIAMOND_INCOME_BACK, FinTranType1.U_Income_Coin_Balance, appUser);
+            tran.setDiamondCoinChange(cashrecord.getVotes().doubleValue());
+            tran.setAfterDiamondCoin(appUser.getDiamondCoin());
+            tran.setCurrencyType(TranCurrencyType.Balance.getType());
+            tran.setTranGroupId(IdUtil.getSnowflakeNextId());
+            tran.setRemarks("提现审核失败:回退金额");
+            appUserService.updateUserAmount(tran);
+            appUserCountTask.updateWithdrawAble(appUser.getUserid());
+        }
+        return R.ok("审核成功");
     }
 
     /**

+ 19 - 0
game-business/src/main/java/com/game/business/dto/UserWithdrawDto.java

@@ -0,0 +1,19 @@
+package com.game.business.dto;
+
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+
+@ApiModel("充值")
+@Data
+public class UserWithdrawDto implements Serializable {
+
+    @NotNull(message = "金额")
+    private Double amount;
+
+    @NotNull(message = "UID不能为空")
+    private Long userId;
+
+}

+ 5 - 0
game-business/src/main/java/com/game/business/service/impl/AppUserServiceImpl.java

@@ -15,6 +15,7 @@ import com.game.business.domain.FinTranRecord;
 import com.game.business.service.IFinTranRecordService;
 import com.game.business.vo.ApiUserInfoVo;
 import com.game.common.annotation.DataSource;
+import com.game.common.constant.finance.FinTranType3;
 import com.game.common.core.redis.RedisCache;
 import com.game.common.enums.DataSourceType;
 import com.game.common.utils.DateUtils;
@@ -195,6 +196,10 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper, AppUser> impl
                         updateAppUser.setDiamondCoinTotal(finTranRecord.getDiamondCoinChange());
                         updateAppUser.setDiamondCoinCash(MoneyUtils.consumeCash(appUser.getDiamondCoin(),appUser.getDiamondCoinCash(),finTranRecord.getDiamondCoinChange()));
                     }
+                    if(finTranRecord.getTranType3().intValue() == FinTranType3.CASH_DIAMOND_INCOME_BACK.getType()){
+                        //回退已提现金额
+                        updateAppUser.setWithdraw(finTranRecord.getDiamondCoinChange() * -1);
+                    }
                     res = appUserMapper.updateUserMoney(updateAppUser);
                     if(res > 0) {
                         //清除用户缓存

+ 3 - 2
game-business/src/main/java/com/game/business/task/AppUserCountTask.java

@@ -592,7 +592,8 @@ public class AppUserCountTask {
 
     private void dealTran(List<FinTranRecord> userChargeList,Date beginDate,Date endDate,Long userId,Double money){
         //查询用户这段时间流水记录
-        List<FinTranRecord> curTranList = finTranRecordService.selectUserTran(null,String.valueOf(FinTranType3.CONSUM_GAME_ANCHOR_ZHUANPAN.getType()),userId,beginDate,endDate,0);
+        String type3s = FinTranType3.CONSUM_GAME_ANCHOR_ZHUANPAN.getType() + "," + FinTranType3.CONSUM_GAME_ANCHOR_WITHDRAW.getType();
+        List<FinTranRecord> curTranList = finTranRecordService.selectUserTran(null,type3s,userId,beginDate,endDate,0);
         if(null != curTranList && curTranList.size() > 0){
             //筛选投注流水
             double bettingAmount = curTranList.stream().filter(e->
@@ -656,7 +657,7 @@ public class AppUserCountTask {
                 }
                 //查询用户这段时间流水记录
                 List<FinTranRecord> curTranList = finTranRecordService.selectUserTran(null, null, uid, null, endDate, null);
-                withdrawAble += curTranList.stream().mapToDouble(FinTranRecord::getDiamondCoinChange).sum();
+                withdrawAble += curTranList.stream().filter(e->FinTranType3.CONSUM_GAME_ANCHOR_WITHDRAW.getType()!=e.getTranType3().intValue()).mapToDouble(FinTranRecord::getDiamondCoinChange).sum();
                 AppUser updateUser = new AppUser();
                 updateUser.setUserid(uid);
                 updateUser.setWithdrawAble(withdrawAble);

+ 6 - 5
game-business/src/main/resources/mapper/business/AppUserMapper.xml

@@ -822,9 +822,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="diamondCoinCash != null">diamond_coin_cash = #{diamondCoinCash},</if>
             <if test="diamondCoinTotal != null">diamond_coin_total = #{diamondCoinTotal},</if>
             <if test="diamondCoinCashTotal != null">diamond_coin_cash_total = #{diamondCoinCashTotal},</if>
-            <if test="agentFlag != null and agentFlag != ''">agent_flag = #{agentFlag}</if>
-            <if test="withdrawAble != null">withdraw_able = #{withdrawAble}</if>
-            <if test="withdraw != null">withdraw = #{withdraw}</if>
+            <if test="agentFlag != null and agentFlag != ''">agent_flag = #{agentFlag},</if>
+            <if test="withdrawAble != null">withdraw_able = #{withdrawAble},</if>
+            <if test="withdraw != null">withdraw = #{withdraw},</if>
         </trim>
         where userid = #{userid}
     </update>
@@ -848,12 +848,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         update app_user
         <trim prefix="SET" suffixOverrides=",">
             <if test="coin != null">
-                coin = coin + #{coin}
+                coin = coin + #{coin},
             </if>
             <if test="coinCash != null">coin_cash = coin_cash + #{coinCash},</if>
             <if test="diamondCoin != null">diamond_coin = diamond_coin + #{diamondCoin},</if>
             <if test="diamondCoinCash != null">diamond_coin_cash = diamond_coin_cash + #{diamondCoinCash},</if>
-            <if test="diamondCoinTotal != null">diamond_coin_total = diamond_coin_total + #{diamondCoinTotal}</if>
+            <if test="diamondCoinTotal != null">diamond_coin_total = diamond_coin_total + #{diamondCoinTotal},</if>
+            <if test="withdraw != null">withdraw = withdraw + #{withdraw},</if>
         </trim>
         where userid = #{userid}
     </update>

+ 10 - 0
game-common/src/main/java/com/game/common/constant/finance/FinTranType3.java

@@ -207,6 +207,11 @@ public enum FinTranType3 {
      */
     CONSUM_GAME_ANCHOR_ZHUANPAN(FinTranType2.CONSUM_GAME, 20001, "11222",0),
 
+    /**
+     * 游戏 - 游戏消费 (后台补充流水,用于满足提现条件)
+     */
+    CONSUM_GAME_ANCHOR_WITHDRAW(FinTranType2.CONSUM_GAME, 20002, "11577",0),
+
     /**
      * 红包 - 发红包
      */
@@ -323,6 +328,11 @@ public enum FinTranType3 {
      */
     CASH_DIAMOND_INCOME(FinTranType2.CASH, 6006, "11572",0),
 
+    /**
+     * 余额提现 - 审核回退
+     */
+    CASH_DIAMOND_INCOME_BACK(FinTranType2.CASH, 6007, "11578",0),
+
     /**
      * 寻觅 - 寻觅下单
      */

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

@@ -0,0 +1,44 @@
+import request from '@/utils/request'
+
+// 查询提现记录列表
+export function listCashrecord(query) {
+  return request({
+    url: '/business/cashrecord/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询提现记录详细
+export function getCashrecord(id) {
+  return request({
+    url: '/business/cashrecord/' + id,
+    method: 'get'
+  })
+}
+
+// 新增提现记录
+export function addCashrecord(data) {
+  return request({
+    url: '/business/cashrecord',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改提现记录
+export function updateCashrecord(data) {
+  return request({
+    url: '/business/cashrecord',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除提现记录
+export function delCashrecord(id) {
+  return request({
+    url: '/business/cashrecord/' + id,
+    method: 'delete'
+  })
+}

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

@@ -76,3 +76,12 @@ export function userCharge(data) {
     data: data
   })
 }
+
+// 补足提现流水
+export function withdraw(data) {
+  return request({
+    url: '/business/user/withdraw',
+    method: 'post',
+    data: data
+  })
+}

+ 368 - 0
game-ui/src/views/business/cashrecord/index.vue

@@ -0,0 +1,368 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="订单号" prop="orderno">
+        <el-input
+          v-model="queryParams.orderno"
+          placeholder="请输入订单号"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="账号类型" prop="type">
+        <el-select v-model="queryParams.type" placeholder="请选择账号类型" clearable>
+          <el-option
+            v-for="dict in dict.type.app_user_cash_account"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="用户ID" prop="uid">
+        <el-input
+          v-model="queryParams.uid"
+          placeholder="请输入用户ID"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </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:cashrecord:add']"
+        >新增</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:cashrecord: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:cashrecord:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="cashrecordList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column fixed label="id" align="center" prop="id" />
+      <el-table-column fixed label="UID" align="center" prop="uid" />
+      <el-table-column fixed label="订单号" align="center" prop="orderno" />
+      <el-table-column label="货币单位类型" align="center" prop="unitType">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.app_user_cash_unit" :value="scope.row.unitType"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="提现数量" align="center" prop="votes" />
+      <el-table-column label="提现金额" align="center" prop="money" />
+      <el-table-column label="实际到账金额" align="center" prop="actualMoney" />
+      <el-table-column label="提现前金额" align="center" prop="beforeAmount" />
+      <el-table-column label="提现后剩余余额" align="center" prop="afterAmount" />
+      <el-table-column label="服务费" align="center" prop="service" />
+      <el-table-column label="状态" align="center" prop="status">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.app_user_cash_status" :value="scope.row.status"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="申请时间" align="center" prop="addtime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.addtime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="提现类型" align="center" prop="cashType">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.app_cash_type" :value="scope.row.cashType"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="转出备注" align="center" prop="cashOutRemark" />
+      <el-table-column label="审核人" align="center" prop="auditby" />
+      <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="银行名称" align="center" prop="accountBank" />
+      <el-table-column label="账号" align="center" prop="account" />
+      <el-table-column label="姓名" align="center" prop="name" />
+      <el-table-column label="审核备注" align="center" prop="reason" />
+      <el-table-column label="备注" align="center" prop="remarks" />
+      <el-table-column fixed="right" 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:cashrecord:edit']"
+            v-if="scope.row.status == 0"
+          >审核</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['business:cashrecord: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="70%" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="id" prop="cashOutRemark">
+          <el-input v-model="form.id" type="textarea" placeholder="请输入内容" disabled/>
+        </el-form-item>
+        <el-form-item label="用户ID" prop="uid">
+          <el-input disabled v-model="form.uid" placeholder="请输入用户ID" />
+        </el-form-item>
+        <el-form-item label="订单号" prop="orderno">
+          <el-input disabled v-model="form.orderno" placeholder="请输入订单号" />
+        </el-form-item>
+        <el-form-item label="提现数量" prop="votes">
+          <el-input disabled v-model="form.votes" placeholder="请输入提现数量(所有类型cash_type都有值)" />
+        </el-form-item>
+        <el-form-item label="提现金额" prop="money">
+          <el-input disabled v-model="form.money" placeholder="请输入提现金额" />
+        </el-form-item>
+        <el-form-item label="服务费" prop="service">
+          <el-input disabled v-model="form.service" placeholder="请输入服务费" />
+        </el-form-item>
+        <el-form-item label="转出备注" prop="cashOutRemark">
+          <el-input disabled v-model="form.cashOutRemark" type="textarea" placeholder="请输入内容" />
+        </el-form-item>
+        <el-form-item label="账号类型" prop="type">
+          <el-select disabled 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="姓名" prop="name">
+          <el-input disabled v-model="form.name" placeholder="请输入姓名" />
+        </el-form-item>
+        <el-form-item label="状态" prop="status">
+          <el-select v-model="form.status" placeholder="请选择状态 0:审核中 1:审核通过 2:审核拒绝">
+            <el-option
+              v-for="dict in dict.type.app_user_cash_status"
+              :key="dict.value"
+              :label="dict.label"
+              :value="parseInt(dict.value)"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="审核备注" prop="reason">
+          <el-input v-model="form.reason" placeholder="请输入审核备注" />
+        </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 { listCashrecord, getCashrecord, delCashrecord, addCashrecord, updateCashrecord } from "@/api/business/cashrecord";
+
+export default {
+  name: "Cashrecord",
+  dicts: ['app_user_cash_unit', 'app_user_cash_status', 'app_cash_type', 'app_user_cash_account'],
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 提现记录表格数据
+      cashrecordList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        cashType: null,
+        orderno: null,
+        type: null,
+        uid: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询提现记录列表 */
+    getList() {
+      this.loading = true;
+      listCashrecord(this.queryParams).then(response => {
+        this.cashrecordList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        account: null,
+        accountBank: null,
+        actualMoney: null,
+        addtime: null,
+        afterAmount: null,
+        auditby: null,
+        beforeAmount: null,
+        cashOutBizNo: null,
+        cashOutOrderId: null,
+        cashOutPayOrderId: null,
+        cashOutRemark: null,
+        cashOutStatus: null,
+        cashType: null,
+        guildId: null,
+        money: null,
+        name: null,
+        orderno: null,
+        platformService: null,
+        reason: null,
+        remarks: null,
+        service: null,
+        status: null,
+        statusName: null,
+        tradeNo: null,
+        type: null,
+        uid: null,
+        unitType: null,
+        uptime: null,
+        votes: 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
+      getCashrecord(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) {
+            updateCashrecord(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addCashrecord(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 delCashrecord(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('business/cashrecord/export', {
+        ...this.queryParams
+      }, `cashrecord_${new Date().getTime()}.xlsx`)
+    }
+  }
+};
+</script>

+ 68 - 3
game-ui/src/views/business/user/index.vue

@@ -188,6 +188,12 @@
             icon="el-icon-bank-card"
             @click="handleCharge(scope.row)"
           >充值</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleWithdraw(scope.row)"
+          >补足提现流水</el-button>
           <el-button
             size="mini"
             type="text"
@@ -440,11 +446,28 @@
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
+
+    <!-- 补足流水对话框 -->
+    <el-dialog :title="title" :visible.sync="resetWithdrawopen" width="700px" append-to-body>
+      <el-form ref="withdrawForm" :model="resetWithdrawForm" :rules="withdrawRules" :validate-on-rule-change=false label-width="150px">
+        <el-form-item label="用户id" prop="userId">
+          <el-input v-model="resetWithdrawForm.userId" disabled />
+        </el-form-item>
+        <el-form-item label="金额" prop="amount">
+          <el-input type="text" v-model="resetWithdrawForm.amount" placeholder="请输入金额" />
+        </el-form-item>
+
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitWithdrawForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
 <script>
-import { listUser, getUser, delUser, addUser, updateUser,resetUser,userCharge,channelList } from "@/api/business/user";
+import { listUser, getUser, delUser, addUser, updateUser,resetUser,userCharge,channelList,withdraw } from "@/api/business/user";
 
 export default {
   name: "User",
@@ -472,6 +495,8 @@ export default {
       // 是否显示弹出层
       resetPwdopen: false,
       // 是否显示弹出层
+      resetWithdrawopen: false,
+      // 是否显示弹出层
       chargeopen: false,
       channelList:[],
       isReadOnly:true,
@@ -512,7 +537,9 @@ export default {
       form: {},
       //重置密码
       resetPwdForm:{},
-      //重置密码
+      //补足流水
+      resetWithdrawForm:{},
+      //充值
       chargeForm:{},
       // 表单校验
       rules: {
@@ -536,6 +563,11 @@ export default {
           { required: true, message: "请选择是否扣除手续费", trigger: "blur" }
         ]
       },
+      withdrawRules: {
+        amount: [
+          { required: true, message: "金额不能为空", trigger: "blur" }
+        ]
+      },
       scrollLeft: 0
     };
   },
@@ -569,9 +601,11 @@ export default {
       this.open = false;
       this.resetPwdopen = false;
       this.chargeopen = false;
+      this.resetWithdrawopen = false;
       this.reset();
       this.resetPwd();
       this.resetCharge();
+      this.resetWithdraw();
     },
     // 表单重置
     reset() {
@@ -744,6 +778,13 @@ export default {
       };
       this.resetForm("restPwdForm");
     },// 表单重置
+    resetWithdraw() {
+      this.resetWithdrawForm = {
+        userId: null,
+        amount: null
+      };
+      this.resetForm("restWithdraoForm");
+    },// 表单重置
     resetCharge() {
       this.chargeForm = {
         userId: null,
@@ -798,7 +839,18 @@ export default {
       this.resetPwdopen = true;
       this.title = "重置密码";
     },
-    /** 重置密码按钮操作 */
+    /** 补足流水按钮操作 */
+    handleWithdraw(row) {
+      this.resetWithdraw();
+      const userid = row.userid;
+      this.resetWithdrawForm = {
+        userId:userid,
+        password:""
+      };
+      this.resetWithdrawopen = true;
+      this.title = "补足提现流水";
+    },
+    /** 充值按钮操作 */
     handleCharge(row) {
       var that = this;
       that.channelList = [];
@@ -873,6 +925,19 @@ export default {
         }
       });
     },
+    /** 补足流水提交按钮 */
+    submitWithdrawForm() {
+      var that =this;
+      this.$refs["withdrawForm"].validate(valid => {
+        if (valid) {
+          withdraw(this.resetWithdrawForm).then(response => {
+            this.$modal.msgSuccess("补足流水成功");
+            this.resetWithdrawopen = false;
+            this.getList();
+          });
+        }
+      });
+    },
     /** 充值提交按钮 */
     submitChargeForm() {
       var that =this;