Browse Source

增加表字段

dos 2 months ago
parent
commit
8063e0313a

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

@@ -101,13 +101,13 @@ private static final long serialVersionUID=1L;
     @ApiModelProperty(value = "是否启用 0:启用 1:禁用")
     @Excel(name = "是否启用 0:启用 1:禁用")
     @TableField(value = "enable")
-    private Long enable;
+    private int enable;
 
     /** 每期投注次数 */
     @ApiModelProperty(value = "每期投注次数")
     @Excel(name = "每期投注次数")
     @TableField(value = "betting_count")
-    private Long bettingCount;
+    private int bettingCount;
 
     /** 排序 */
     @ApiModelProperty(value = "排序")

+ 1 - 1
game-business/src/main/java/com/game/business/domain/AppGameItem.java

@@ -60,7 +60,7 @@ private static final long serialVersionUID=1L;
     @ApiModelProperty(value = "每期投注金额")
     @Excel(name = "每期投注金额")
     @TableField(value = "betting_money")
-    private BigDecimal bettingMoney;
+    private Double bettingMoney;
 
     @ApiModelProperty(value = "开奖次数")
     @Excel(name = "开奖次数" , readConverterExp = "开奖次数")

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

@@ -41,11 +41,11 @@ private static final long serialVersionUID=1L;
     @ApiModelProperty(value = "投注金额")
     @Excel(name = "投注金额")
     @TableField(value = "betting_money")
-    private BigDecimal bettingMoney;
+    private Double bettingMoney;
 
     /** 删除状态 0:未删除(默认) 1:已删除 */
     @ApiModelProperty(value = "删除状态 0:未删除(默认) 1:已删除")
     @TableField(value = "del_flag")
-    private Long delFlag;
+    private Integer delFlag;
 
 }

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

@@ -0,0 +1,44 @@
+import request from '@/utils/request'
+
+// 查询游戏投注金额列表
+export function listMoney(query) {
+  return request({
+    url: '/business/money/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询游戏投注金额详细
+export function getMoney(id) {
+  return request({
+    url: '/business/money/' + id,
+    method: 'get'
+  })
+}
+
+// 新增游戏投注金额
+export function addMoney(data) {
+  return request({
+    url: '/business/money',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改游戏投注金额
+export function updateMoney(data) {
+  return request({
+    url: '/business/money',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除游戏投注金额
+export function delMoney(id) {
+  return request({
+    url: '/business/money/' + id,
+    method: 'delete'
+  })
+}

+ 263 - 0
game-ui/src/views/business/money/index.vue

@@ -0,0 +1,263 @@
+<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="游戏id" prop="appGame">
+        <el-input
+          v-model="queryParams.appGame"
+          placeholder="请输入游戏id"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="投注金额" prop="bettingMoney">
+        <el-input
+          v-model="queryParams.bettingMoney"
+          placeholder="请输入投注金额"
+          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:money: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:money: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:money: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:money:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="moneyList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="${comment}" align="center" prop="id" />
+      <el-table-column label="游戏id" align="center" prop="appGame" />
+      <el-table-column label="投注金额" align="center" prop="bettingMoney" />
+      <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:money:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['business:money: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="游戏id" prop="appGame">
+          <el-input v-model="form.appGame" placeholder="请输入游戏id" />
+        </el-form-item>
+        <el-form-item label="投注金额" prop="bettingMoney">
+          <el-input v-model="form.bettingMoney" placeholder="请输入投注金额" />
+        </el-form-item>
+        <el-form-item label="删除状态 0:未删除(默认) 1:已删除" prop="delFlag">
+          <el-input v-model="form.delFlag" placeholder="请输入删除状态 0:未删除(默认) 1:已删除" />
+        </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 { listMoney, getMoney, delMoney, addMoney, updateMoney } from "@/api/business/money";
+
+export default {
+  name: "Money",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 游戏投注金额表格数据
+      moneyList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        appGame: null,
+        bettingMoney: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询游戏投注金额列表 */
+    getList() {
+      this.loading = true;
+      listMoney(this.queryParams).then(response => {
+        this.moneyList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        appGame: null,
+        bettingMoney: null,
+        delFlag: 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
+      getMoney(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) {
+            updateMoney(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addMoney(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 delMoney(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('business/money/export', {
+        ...this.queryParams
+      }, `money_${new Date().getTime()}.xlsx`)
+    }
+  }
+};
+</script>