ソースを参照

添加充值记录

dos 2 ヶ月 前
コミット
2fd4a73966

+ 12 - 0
game-business/src/main/java/com/game/business/controller/AppChargeChannelController.java

@@ -53,6 +53,18 @@ public class AppChargeChannelController extends BaseController
         return getDataTable(list);
     }
 
+    /**
+     * 查询所有充值渠道列表
+     */
+    @PreAuthorize("@ss.hasPermi('business:channel:list')")
+    @GetMapping("/channelList")
+    @ApiOperation(value = "查询充值渠道列表", notes = "获取充值渠道列表")
+    public R<List<AppChargeChannel>> channelList(AppChargeChannel appChargeChannel)
+    {
+        List<AppChargeChannel> list = appChargeChannelService.selectAppChargeChannelList(appChargeChannel);
+        return R.ok(list);
+    }
+
     /**
      * 查询充值渠道列表
      */

+ 4 - 4
game-business/src/main/java/com/game/business/domain/AppUsersCharge.java

@@ -36,15 +36,15 @@ private static final long serialVersionUID=1L;
 
     /** 添加时间 */
     @ApiModelProperty(value = "添加时间")
-    @JsonFormat(pattern = "yyyy-MM-dd")
-    @Excel(name = "添加时间" , width = 30, dateFormat = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "添加时间" , width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
     @TableField(value = "addtime")
     private Date addtime;
 
     /** 更新时间 */
     @ApiModelProperty(value = "更新时间")
-    @JsonFormat(pattern = "yyyy-MM-dd")
-    @Excel(name = "添加时间" , width = 30, dateFormat = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "添加时间" , width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
     @TableField(value = "update_time")
     private Date updateTime;
 

+ 3 - 2
game-business/src/main/resources/mapper/business/AppUsersChargeMapper.xml

@@ -53,8 +53,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="coin != null "> and coin = #{coin}</if>
             <if test="coinType != null "> and coin_type = #{coinType}</if>
             <if test="coinGive != null "> and coin_give = #{coinGive}</if>
-            <if test="platform_service_rate != null "> and platform_service = #{platformService}</if>
-            <if test="platform_service != null "> and platform_service_rate = #{platformServiceRate}</if>
+            <if test="platformServiceRate != null "> and platform_service = #{platformService}</if>
+            <if test="platformService != null "> and platform_service_rate = #{platformServiceRate}</if>
             <if test="isAgent != null "> and is_agent = #{isAgent}</if>
             <if test="isDelete != null "> and is_delete = #{isDelete}</if>
             <if test="isWater != null "> and is_water = #{isWater}</if>
@@ -76,6 +76,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="uid != null "> and uid = #{uid}</if>
             <if test="channelId != null "> and channel_id = #{channelId}</if>
         </where>
+        order by addtime desc
     </select>
     
     <select id="selectAppUsersChargeById" parameterType="Long" resultMap="AppUsersChargeResult">

+ 53 - 0
game-ui/src/api/business/charge.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询充值记录列表
+export function listCharge(query) {
+  return request({
+    url: '/business/charge/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询充值渠道列表
+export function channelList(query) {
+  return request({
+    url: '/business/channel/channelList',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询充值记录详细
+export function getCharge(id) {
+  return request({
+    url: '/business/charge/' + id,
+    method: 'get'
+  })
+}
+
+// 新增充值记录
+export function addCharge(data) {
+  return request({
+    url: '/business/charge',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改充值记录
+export function updateCharge(data) {
+  return request({
+    url: '/business/charge',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除充值记录
+export function delCharge(id) {
+  return request({
+    url: '/business/charge/' + id,
+    method: 'delete'
+  })
+}

+ 483 - 0
game-ui/src/views/business/charge/index.vue

@@ -0,0 +1,483 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="120px">
+      <el-form-item label="UID" prop="uid">
+        <el-input
+          v-model="queryParams.uid"
+          placeholder="请输入用户ID"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <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="status">
+        <el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
+          <el-option
+            v-for="dict in dict.type.app_users_charge_status"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="四方平台订单号" prop="tradeNo">
+        <el-input
+          v-model="queryParams.tradeNo"
+          placeholder="请输入四方平台订单号"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="充值渠道" prop="channelId">
+        <el-select v-model="queryParams.channelId" 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>
+        <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:charge: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:charge: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:charge: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:charge:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="chargeList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="" align="center" prop="id" />
+      <el-table-column label="UID" align="center" prop="uid" />
+      <el-table-column label="充值类型" align="center" prop="type">
+        <template slot-scope="scope">
+          {{scope.row.type==4?"手工充值":"在线充值"}}
+        </template>
+      </el-table-column>
+      <el-table-column label="充值渠道" align="center" prop="channelId">
+        <template slot-scope="scope">
+          <span>{{ getTypeName(scope.row.channelId) }}</span>
+        </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} {h}:{i}:{s}')}}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="充值金额" align="center" prop="coin" />
+      <el-table-column label="货币类型" align="center" prop="coinType">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.app_user_coin_type" :value="scope.row.coinType"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="赠送金额" align="center" prop="coinGive"></el-table-column>
+      <el-table-column label="备注" align="center" prop="remarks" />
+      <el-table-column label="状态" align="center" prop="status">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.app_users_charge_status" :value="scope.row.status"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="平台服务费" align="center" prop="platformService" width="100"/>
+
+      <el-table-column label="订单号" align="center" prop="orderno" width="180"/>
+      <el-table-column label="四方方平台订单号" align="center" prop="tradeNo" width="180"/>
+      <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:charge:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['business:charge: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="addtime">
+          <el-date-picker clearable
+            v-model="form.addtime"
+            type="date"
+            value-format="yyyy-MM-dd"
+            placeholder="请选择添加时间">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="当前剩余金币" prop="afterCoin">
+          <el-input v-model="form.afterCoin" 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="ambient">
+          <el-input v-model="form.ambient" placeholder="请输入支付环境" />
+        </el-form-item>
+        <el-form-item label="货币数" prop="coin">
+          <el-input v-model="form.coin" placeholder="请输入货币数" />
+        </el-form-item>
+        <el-form-item label="赠送金额" prop="coinGive">
+          <el-input v-model="form.coinGive" placeholder="请输入赠送金额" />
+        </el-form-item>
+        <el-form-item label="1是会员" prop="isAgent">
+          <el-input v-model="form.isAgent" placeholder="请输入1是会员" />
+        </el-form-item>
+        <el-form-item label="是否被删除" prop="isDelete">
+          <el-input v-model="form.isDelete" placeholder="请输入是否被删除" />
+        </el-form-item>
+        <el-form-item label="是否水军充值 0否 1是" prop="isWater">
+          <el-input v-model="form.isWater" placeholder="请输入是否水军充值 0否 1是" />
+        </el-form-item>
+        <el-form-item label="金额" prop="money">
+          <el-input v-model="form.money" placeholder="请输入金额" />
+        </el-form-item>
+        <el-form-item label="操作管理员用户的账号" prop="optUser">
+          <el-input v-model="form.optUser" placeholder="请输入操作管理员用户的账号" />
+        </el-form-item>
+        <el-form-item label="商家订单号" prop="orderno">
+          <el-input v-model="form.orderno" placeholder="请输入商家订单号" />
+        </el-form-item>
+        <el-form-item label="上级用户id" prop="pid">
+          <el-input v-model="form.pid" placeholder="请输入上级用户id" />
+        </el-form-item>
+        <el-form-item label="所属区域家族id" prop="pidLevel1">
+          <el-input v-model="form.pidLevel1" placeholder="请输入所属区域家族id" />
+        </el-form-item>
+        <el-form-item label="所属家族id" prop="pidLevel2">
+          <el-input v-model="form.pidLevel2" placeholder="请输入所属家族id" />
+        </el-form-item>
+        <el-form-item label="所属经纪人id" prop="pidLevel3">
+          <el-input v-model="form.pidLevel3" placeholder="请输入所属经纪人id" />
+        </el-form-item>
+        <el-form-item label="直属上级id" prop="pidLevel4">
+          <el-input v-model="form.pidLevel4" placeholder="请输入直属上级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="ruleId">
+          <el-input v-model="form.ruleId" placeholder="请输入充值规则ID" />
+        </el-form-item>
+        <el-form-item label="状态 0:充值中 1:充值成功 2:充值失败" prop="status">
+          <el-select v-model="form.status" placeholder="请选择状态 0:充值中 1:充值成功 2:充值失败">
+            <el-option
+              v-for="dict in dict.type.app_users_charge_status"
+              :key="dict.value"
+              :label="dict.label"
+              :value="parseInt(dict.value)"
+            ></el-option>
+          </el-select>
+        </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="三方平台订单号" prop="tradeNo">
+          <el-input v-model="form.tradeNo" placeholder="请输入三方平台订单号" />
+        </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="平台服务费" prop="platformService">
+          <el-input v-model="form.platformService" placeholder="请输入平台服务费" />
+        </el-form-item>
+        <el-form-item label="平台服务费率" prop="platformServiceRate">
+          <el-input v-model="form.platformServiceRate" placeholder="请输入平台服务费率" />
+        </el-form-item>
+        <el-form-item label="充值渠道id" prop="channelId">
+          <el-input v-model="form.channelId" placeholder="请输入充值渠道id" />
+        </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 { listCharge, getCharge, delCharge, addCharge, updateCharge,channelList } from "@/api/business/charge";
+
+export default {
+  name: "Charge",
+  dicts: ['app_users_charge_status','app_user_coin_type'],
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 充值记录表格数据
+      chargeList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      typeList:[],
+      typeMap:{},
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        addtime: null,
+        afterCoin: null,
+        agentId: null,
+        ambient: null,
+        coin: null,
+        coinType: null,
+        coinGive: null,
+        isAgent: null,
+        isDelete: null,
+        isWater: null,
+        money: null,
+        optType: null,
+        optUser: null,
+        orderno: null,
+        pid: null,
+        pidLevel1: null,
+        pidLevel2: null,
+        pidLevel3: null,
+        pidLevel4: null,
+        remarks: null,
+        ruleId: null,
+        status: null,
+        touid: null,
+        tradeNo: null,
+        type: null,
+        uid: null,
+        platformService: null,
+        platformServiceRate: null,
+        channelId: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    var that = this;
+    channelList().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.getList();
+
+    })
+  },
+  methods: {
+    getTypeName(id) {
+      if(id == null || id == undefined){
+        return "-";
+      }
+      if(undefined == this.typeMap[id.toString()] || null == this.typeMap[id.toString()]){
+        return "-";
+      }
+      return this.typeMap[id.toString()];
+    },
+    /** 查询充值记录列表 */
+    getList() {
+      this.loading = true;
+      listCharge(this.queryParams).then(response => {
+        this.chargeList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        addtime: null,
+        updateTime: null,
+        afterCoin: null,
+        agentId: null,
+        ambient: null,
+        coin: null,
+        coinType: null,
+        coinGive: null,
+        isAgent: null,
+        isDelete: null,
+        isWater: null,
+        money: null,
+        optType: null,
+        optUser: null,
+        orderno: null,
+        pid: null,
+        pidLevel1: null,
+        pidLevel2: null,
+        pidLevel3: null,
+        pidLevel4: null,
+        remarks: null,
+        ruleId: null,
+        status: null,
+        touid: null,
+        tradeNo: null,
+        type: null,
+        uid: null,
+        platformService: null,
+        platformServiceRate: null,
+        channelId: 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
+      getCharge(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) {
+            updateCharge(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addCharge(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 delCharge(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('business/charge/export', {
+        ...this.queryParams
+      }, `charge_${new Date().getTime()}.xlsx`)
+    }
+  }
+};
+</script>

+ 1 - 0
game-ui/src/views/business/order/index.vue

@@ -567,6 +567,7 @@ export default {
             spinner: 'el-icon-loading',
             background: 'rgba(0, 0, 0, 0.7)'
           });
+          setTimeout(function (){loading.close();},1000);
           send(this.wlForm).then(response => {
             this.$modal.msgSuccess("发货成功");
             this.wlOpen = false;

+ 32 - 1
game-ui/src/views/business/user/index.vue

@@ -1392,10 +1392,18 @@ export default {
     submitResetPwdForm() {
       this.$refs["resetPwdForm"].validate(valid => {
         if (valid) {
+          const loading = this.$loading({
+            lock: true,
+            text: '加载中',
+            spinner: 'el-icon-loading',
+            background: 'rgba(0, 0, 0, 0.7)'
+          });
+          setTimeout(function (){loading.close();},1000);
           resetUser(this.resetPwdForm).then(response => {
             this.$modal.msgSuccess("修改成功");
             this.resetPwdopen = false;
             this.getList();
+            loading.close();
           });
         }
       });
@@ -1405,10 +1413,18 @@ export default {
       var that =this;
       this.$refs["withdrawForm"].validate(valid => {
         if (valid) {
+          const loading = this.$loading({
+            lock: true,
+            text: '加载中',
+            spinner: 'el-icon-loading',
+            background: 'rgba(0, 0, 0, 0.7)'
+          });
+          setTimeout(function (){loading.close();},1000);
           withdraw(this.resetWithdrawForm).then(response => {
             this.$modal.msgSuccess("补足流水成功");
             this.resetWithdrawopen = false;
             this.getList();
+            loading.close();
           });
         }
       });
@@ -1429,10 +1445,18 @@ export default {
             this.$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);
           userCharge(this.chargeForm).then(response => {
             this.$modal.msgSuccess("修改成功");
             this.chargeopen = false;
             this.getList();
+            loading.close();
           });
         }
       });
@@ -1441,6 +1465,13 @@ export default {
     submitLiveForm() {
       var that =this;
       this.liveLive["title"] = this.closeMsg;
+      const loading = this.$loading({
+        lock: true,
+        text: '加载中',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      setTimeout(function (){loading.close();},1000);
       openLive(this.liveLive).then(response => {
         that.liveOpen = false;
         setTimeout(function (){
@@ -1459,7 +1490,7 @@ export default {
         }else{
           that.$modal.msgSuccess(this.liveLive.islive==1?"关播":"虚拟开播"+"成功");
         }
-
+        loading.close();
       });
     },
     /** 删除按钮操作 */