lsw před 11 měsíci
rodič
revize
23b7e6164f

+ 19 - 20
admin-ui/src/views/work/pay/cash_out.vue

@@ -5,9 +5,10 @@
         <el-input v-model="queryParams.nums" placeholder="请输入充值编号" @keyup.enter.native="handleQuery" clearable />
       </el-form-item>
       <el-form-item label="提现状态" prop="state">
-        <el-select v-model="queryParams.state" placeholder="充值状态" clearable style="width: 117px">
-          <el-option value="0" label="待支付"></el-option>
-          <el-option value="1" label="充值成功"></el-option>
+        <el-select v-model="queryParams.state" placeholder="提现状态" clearable style="width: 117px">
+          <el-option value="0" label="待确认"></el-option>
+          <el-option value="1" label="提现成功"></el-option>
+          <el-option value="2" label="提现驳回"></el-option>
         </el-select>
       </el-form-item>
       <el-form-item label="提现日期">
@@ -18,9 +19,16 @@
         <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
-    <el-table :data="response.rows" border @selection-change="selects" height="calc(100vh - 235px)">
-      <el-table-column label="提现编号" align="left" prop="nums" />
-      <el-table-column label="提现金额" align="center" prop="money" width="150" />
+    <el-table :data="response.rows" border height="calc(100vh - 235px)">
+      <el-table-column type="index" label="序号" align="center" width="80" />
+      <el-table-column label="提现编号" align="center" prop="nums" />
+      <el-table-column label="提现方式" align="center" width="160">
+        <template slot-scope="scope">
+          <span class="icon" v-if="scope.row.way == 0">&#xe66b; 提现到银行卡</span>
+          <span class="icon" v-else>&#xe620; 提现到微信</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="提现金额" align="center" prop="money" width="160" />
       <el-table-column label="提现状态" align="center" width="110">
         <template slot-scope="scope">
           <el-tag type="info" v-if="scope.row.state == 0">待确认</el-tag>
@@ -36,6 +44,7 @@
       <el-table-column label="提现时间" align="center" prop="createTime" width="200" />
       <el-table-column label="操作" align="center" width="200">
         <template slot-scope="scope">
+          <el-button size="mini" type="text" icon="el-icon-view" @click="op('detail', scope.row)" v-hasPermi="['work:pay:list']">详情</el-button>
           <el-button size="mini" type="text" icon="el-icon-edit" @click="op('edit', scope.row)" v-hasPermi="['work:pay:audit']" v-if="scope.row.state == 0">确认</el-button>
         </template>
       </el-table-column>
@@ -53,7 +62,6 @@ export default {
   name: 'Pay',
   data() {
     return {
-      ids: [],
       showSearch: true,
       response: {},
       queryParams: {
@@ -84,22 +92,13 @@ export default {
       this.resetForm('queryForm');
       this.handleQuery();
     },
-    selects(rows) {
-      this.ids = rows.map((item) => item.id);
-    },
     op(tag, row) {
+      if (tag == 'detail') {
+        this.iframe({ obj: edit, param: { id: row.id, detail: true }, title: '提现详情', width: '35%', height: '60%' });
+      }
       if (tag == 'edit') {
-        const id = row.id || this.ids[0];
-        this.iframe({ obj: edit, param: { id: id }, title: '提现确认', width: '40%', height: '60%' });
+        this.iframe({ obj: edit, param: { id: row.id }, title: '提现确认', width: '35%', height: '60%' });
       }
-    },
-    del(row) {
-      this.$confirm('是否确认删除选中数据?', '警告', { type: 'warning' }).then(() => {
-        this.get({ url: '/work/pay/remove/' + (row.id || this.ids) }).then((response) => {
-          this.$modal.msgSuccess('删除成功');
-          this.getList();
-        });
-      });
     }
   }
 };

+ 61 - 0
admin-ui/src/views/work/pay/detail.vue

@@ -0,0 +1,61 @@
+<template>
+  <div class="cmain">
+    <div class="bos">
+      <el-form ref="user" disabled :model="user" label-width="120px">
+        <el-form-item label="用户姓名">
+          <span class="pon" @click="info()">{{ user.name }}</span>
+        </el-form-item>
+        <el-form-item label="充值方式">
+          <el-input value="微信充值" />
+        </el-form-item>
+      </el-form>
+      <el-form ref="form" disabled :model="form" :rules="rules" label-width="120px">
+        <el-form-item label="充值金额" prop="money">
+          <el-input type="number" v-model="form.money">
+            <template slot="append">元</template>
+          </el-input>
+        </el-form-item>
+        <el-form-item label="充值状态">
+          <el-input :value="form.state == 0 ? '未支付' : '充值成功'" />
+        </el-form-item>
+      </el-form>
+    </div>
+  </div>
+</template>
+
+<script>
+import info from '@/views/work/user/edit';
+export default {
+  data() {
+    return {
+      user: {},
+      form: {},
+      rules: {}
+    };
+  },
+  props: {
+    param: {
+      type: Object,
+      default: () => {
+        return {};
+      }
+    },
+    layerid: {
+      type: String
+    }
+  },
+  mounted() {
+    if (this.param.id) {
+      this.ajax({ url: '/work/pay/detail/' + this.param.id }).then((response) => {
+        this.form = response.data.pay;
+        this.user = response.data.user;
+      });
+    }
+  },
+  methods: {
+    info() {
+      this.iframe({ obj: info, param: { id: this.user.id, detail: true }, title: '用户详情', width: '55%', height: '65%' });
+    }
+  }
+};
+</script>

+ 12 - 7
admin-ui/src/views/work/pay/edit.vue

@@ -8,12 +8,17 @@
         <el-form-item label="手机号">
           <el-input v-model="user.phone" />
         </el-form-item>
-        <el-form-item label="开户行">
-          <el-input v-model="user.bankName" />
-        </el-form-item>
-        <el-form-item label="银行卡号">
-          <el-input v-model="user.bankAccount" />
+        <el-form-item label="提现方式">
+          <el-input :value="form.way == 0 ? '提现到银行卡' : '提现到微信'" />
         </el-form-item>
+        <div v-if="form.way == 0">
+          <el-form-item label="开户行">
+            <el-input v-model="user.bankName" />
+          </el-form-item>
+          <el-form-item label="银行卡号">
+            <el-input v-model="user.bankAccount" />
+          </el-form-item>
+        </div>
       </el-form>
       <el-form ref="form" disabled :model="form" :rules="rules" label-width="120px">
         <el-form-item label="提现金额" prop="money">
@@ -26,8 +31,8 @@
           <span>操作时间:{{ form.updateTime }}</span>
         </div>
       </el-form>
-      <el-alert title="充值成功" type="success" show-icon class="cg" v-if="form.state === 1"></el-alert>
-      <el-alert title="充值失败" :description="form.msg" type="error" show-icon class="cg" v-if="form.state === 2" :closable="false"></el-alert>
+      <el-alert title="提现成功" type="success" show-icon class="cg" v-if="form.state === 1"></el-alert>
+      <el-alert title="提现失败,已退款到用户余额" :description="form.msg" type="error" show-icon class="cg" v-if="form.state === 2" :closable="false"></el-alert>
     </div>
     <div class="mfooter" v-if="!param.detail">
       <el-button type="primary" @click="submitForm(1)">确认转账</el-button>

+ 21 - 8
admin-ui/src/views/work/pay/index.vue

@@ -6,7 +6,7 @@
       </el-form-item>
       <el-form-item label="充值状态" prop="state">
         <el-select v-model="queryParams.state" placeholder="充值状态" clearable style="width: 117px">
-          <el-option value="0" label="支付"></el-option>
+          <el-option value="0" label="支付"></el-option>
           <el-option value="1" label="充值成功"></el-option>
         </el-select>
       </el-form-item>
@@ -18,16 +18,27 @@
         <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
-    <el-table :data="response.rows" border @selection-change="selects" height="calc(100vh - 235px)">
-      <el-table-column label="充值编号" align="left" prop="nums" />
+    <el-table :data="response.rows" border height="calc(100vh - 235px)">
+      <el-table-column type="index" label="序号" align="center" width="80" />
+      <el-table-column label="充值编号" align="center" prop="nums" />
       <el-table-column label="充值金额" align="center" prop="money" width="160" />
-      <el-table-column label="状态" align="center" prop="state" width="160">
+      <el-table-column label="充值方式" align="center" width="160">
         <template slot-scope="scope">
-          <el-tag type="danger" v-if="scope.row.state == 0">待支付</el-tag>
+          <span class="icon">&#xe620; 微信充值</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="充值状态" align="center" prop="state" width="160">
+        <template slot-scope="scope">
+          <el-tag type="danger" v-if="scope.row.state == 0">未支付</el-tag>
           <el-tag type="success" v-if="scope.row.state == 1">充值成功</el-tag>
         </template>
       </el-table-column>
       <el-table-column label="充值时间" align="center" prop="createTime" width="200" />
+      <el-table-column label="操作" align="center" width="200">
+        <template slot-scope="scope">
+          <el-button size="mini" type="text" icon="el-icon-view" @click="op('detail', scope.row)" v-hasPermi="['work:pay:list']">详情</el-button>
+        </template>
+      </el-table-column>
       <template slot="empty">
         <el-empty></el-empty>
       </template>
@@ -37,11 +48,11 @@
 </template>
 
 <script>
+import detail from './detail.vue';
 export default {
   name: 'Pay',
   data() {
     return {
-      ids: [],
       showSearch: true,
       response: {},
       dateRange: [],
@@ -78,8 +89,10 @@ export default {
       this.dateRange = [];
       this.handleQuery();
     },
-    selects(rows) {
-      this.ids = rows.map((item) => item.id);
+    op(tag, row) {
+      if (tag == 'detail') {
+        this.iframe({ obj: detail, param: { id: row.id, detail: true }, title: '充值详情', width: '35%', height: '45%' });
+      }
     }
   }
 };

+ 9 - 0
admin-ui/src/views/work/user/edit.vue

@@ -44,6 +44,15 @@
       <div class="bos">
         <div class="lab">
           <div class="bsg"></div>
+          <div class="tit">资金信息</div>
+        </div>
+        <el-form-item label="账户余额" prop="money">
+          <el-input v-model="form.money" disabled><template slot="append">元</template></el-input>
+        </el-form-item>
+      </div>
+      <div class="bos">
+        <div class="lab">
+          <div class="bsg"></div>
           <div class="tit">身份信息</div>
         </div>
         <el-row>

+ 1 - 1
app/App.vue

@@ -30,7 +30,7 @@ button::after {
 /**挂载iconfont字体图标*/
 @font-face {
 	font-family: 'iconfont';
-	src: url('https://at.alicdn.com/t/c/font_4507607_pxwh7aaz39p.ttf?t=1719983804018') format('truetype');
+	src: url('https://at.alicdn.com/t/c/font_4507607_ca54qvoqn18.ttf?t=1720194340639') format('truetype');
 	/* src: url('~@/static/font/iconfont.ttf') format('truetype'); */
 }
 .icon {

+ 2 - 2
app/common/http.js

@@ -1,6 +1,6 @@
 //const ip = 'http://127.0.0.1:9191';
-const ip = 'https://chenglantimes.com/prod-api';
-//const ip = 'http://192.168.1.10:9191';
+//const ip = 'https://chenglantimes.com/prod-api';
+const ip = 'http://192.168.0.102:9191';
 /**
  * 封装的http请求
  */

+ 2 - 1
app/pages.json

@@ -242,7 +242,8 @@
 		{
 			"path": "pages/user/money/index",
 			"style": {
-				"navigationBarTitleText": "资金管理"
+				"navigationBarTitleText": "资金管理",
+				"enablePullDownRefresh": true
 			}
 		},
 		{

+ 8 - 7
app/pages/user/money/cash_out.vue

@@ -15,17 +15,18 @@
 			<view class="form_group">
 				<view class="lable re">提现方式</view>
 				<view class="item">
-					<view class="lit">
-						<text class="icon tb" style="color: #4caf50">&#xe620;</text>
-						<view class="title">提现到微信</view>
-					</view>
-					<view class="lit">
+					<view class="lit" @click="item.way = 0">
 						<text class="icon tb" style="color: #ff9800">&#xe635;</text>
 						<view class="title">
 							<text>提现到银行卡</text>
 							<text class="desc" v-if="!bankName">(未填)</text>
 						</view>
-						<text class="icon check">&#xe612;</text>
+						<text class="icon check" v-if="item.way == 0">&#xe612;</text>
+					</view>
+					<view class="lit" @click="item.way = 1">
+						<text class="icon tb" style="color: #4caf50">&#xe620;</text>
+						<view class="title">提现到微信</view>
+						<text class="icon check" v-if="item.way == 1">&#xe612;</text>
 					</view>
 				</view>
 			</view>
@@ -40,7 +41,7 @@ export default {
 		return {
 			money: 0,
 			bankName: '',
-			item: {}
+			item: { way: 0 }
 		};
 	},
 	onShow() {

+ 13 - 1
app/pages/user/money/index.vue

@@ -1,5 +1,9 @@
 <template>
 	<view class="main">
+		<view class="tips">
+			<text class="icon">&#xe694;</text>
+			<text>账户余额保障中</text>
+		</view>
 		<view class="mcard">
 			<view class="money">{{ item.money }}</view>
 			<view class="desc">账户余额(元)</view>
@@ -122,6 +126,7 @@ export default {
 	onPullDownRefresh() {
 		setTimeout(() => {
 			this.refresh();
+			this.getInfo();
 			uni.stopPullDownRefresh();
 		}, 1000);
 	},
@@ -136,6 +141,13 @@ export default {
 </script>
 
 <style lang="scss">
+.main {
+	padding-top: 5px;
+}
+.tips {
+	border-radius: 5px;
+	margin-bottom: 8px;
+}
 .list {
 	background-color: white;
 	border-radius: 8px;
@@ -164,7 +176,7 @@ export default {
 		}
 		.price {
 			float: right;
-			margin-top: -45px;
+			margin-top: -48px;
 		}
 	}
 }

+ 2 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/work/api/Api_PayController.java

@@ -4,7 +4,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.web.work.api.config.BaseController;
 import com.ruoyi.web.work.domain.Pay;
-import com.ruoyi.web.work.domain.dto.PayDto;
+import com.ruoyi.web.work.domain.dto.PayCashOutDto;
 import com.ruoyi.web.work.service.IPayService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
@@ -33,7 +33,7 @@ public class Api_PayController extends BaseController {
         return getDataTable(list);
     }
     @PostMapping("/cashOut")
-    public AjaxResult cashOut(@Validated @RequestBody PayDto dto) throws ServerException {
+    public AjaxResult cashOut(@Validated @RequestBody PayCashOutDto dto) throws ServerException {
         return payService.cashOut(dto);
     }
     @GetMapping(value = "/detail/{id}")

+ 6 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/domain/Pay.java

@@ -46,6 +46,9 @@ public class Pay extends BaseData {
     @ApiModelProperty(value = "类型:0=充值,1=支出,2=提现,3=收入,4=退库")
     private Integer type;
 
+    @ApiModelProperty(value = "提现方式:0=提现到银行卡,1=提现到微信")
+    private Integer way;
+
     @ApiModelProperty(value = "原因")
     private String msg;
 
@@ -58,6 +61,9 @@ public class Pay extends BaseData {
     private Date createTime;
 
     @TableField(fill = FieldFill.UPDATE)
+    private String updateBy;
+
+    @TableField(fill = FieldFill.UPDATE)
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date updateTime;
 }

+ 20 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/domain/dto/PayCashOutDto.java

@@ -0,0 +1,20 @@
+package com.ruoyi.web.work.domain.dto;
+
+import lombok.Data;
+
+import javax.validation.constraints.*;
+import java.math.BigDecimal;
+
+@Data
+public class PayCashOutDto {
+
+    @NotNull(message = "提现金额不能为空")
+    @Digits(integer = 10, fraction = 2, message = "提现金额只能包含最多两位小数")
+    @DecimalMin(value = "0.01", message = "提现金额必须大于0")
+    private BigDecimal money;
+
+    @NotNull(message = "提现方式不能为空")
+    @Min(value = 0, message = "参数错误")
+    @Max(value = 1, message = "参数错误")
+    private Integer way;
+}

+ 2 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/IPayService.java

@@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.web.work.domain.Pay;
 import com.ruoyi.web.work.domain.dto.PayAuditDto;
-import com.ruoyi.web.work.domain.dto.PayDto;
+import com.ruoyi.web.work.domain.dto.PayCashOutDto;
 
 import java.rmi.ServerException;
 import java.util.List;
@@ -24,7 +24,7 @@ public interface IPayService extends IService<Pay> {
      * @param dto
      * @return
      */
-    AjaxResult cashOut(PayDto dto) throws ServerException;
+    AjaxResult cashOut(PayCashOutDto dto) throws ServerException;
 
     /**
      * 余额提现确认

+ 9 - 8
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/PayServiceImpl.java

@@ -5,12 +5,13 @@ import cn.hutool.json.JSONObject;
 import cn.hutool.json.JSONUtil;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.web.work.api.util.AppUtil;
 import com.ruoyi.web.work.domain.Pay;
 import com.ruoyi.web.work.domain.User;
 import com.ruoyi.web.work.domain.dto.PayAuditDto;
-import com.ruoyi.web.work.domain.dto.PayDto;
+import com.ruoyi.web.work.domain.dto.PayCashOutDto;
 import com.ruoyi.web.work.mapper.PayMapper;
 import com.ruoyi.web.work.service.IPayService;
 import com.ruoyi.web.work.service.IUserService;
@@ -20,7 +21,6 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.rmi.ServerException;
-import java.util.Date;
 import java.util.List;
 
 /**
@@ -49,12 +49,12 @@ public class PayServiceImpl extends ServiceImpl<PayMapper, Pay> implements IPayS
     }
 
     @Override
-    public AjaxResult cashOut(PayDto dto) throws ServerException {
+    public AjaxResult cashOut(PayCashOutDto dto) throws ServerException {
         User user = userService.getById(AppUtil.getUser().getId());
         if (dto.getMoney().compareTo(user.getMoney()) > 0) {
             return AjaxResult.error("提现金额超过账户余额");
         }
-        if (StringUtils.isEmpty(user.getBankName()) || StringUtils.isEmpty(user.getBankAccount())) {
+        if (dto.getWay() == 0 && StringUtils.isEmpty(user.getBankAccount())) {
             return AjaxResult.error("银行卡信息未完善,无法提现");
         }
         //保存提现记录
@@ -63,6 +63,7 @@ public class PayServiceImpl extends ServiceImpl<PayMapper, Pay> implements IPayS
         pay.setMoney(dto.getMoney());
         pay.setState(0);
         pay.setType(2);
+        pay.setWay(dto.getWay());
         pay.setTitle("余额提现");
         pay.setVersion(System.currentTimeMillis());
         pay.setNums(StringUtils.generateNumber());
@@ -116,9 +117,9 @@ public class PayServiceImpl extends ServiceImpl<PayMapper, Pay> implements IPayS
             body.set("touser", user.getOpenId());
             body.set("template_id", "PtdKbqfzmpvGsJPx_YekDX4-cljbhOXcvoUB3XJaVLg");
             body.set("page", "pages/user/money/index");
-            content.set("amount3", new JSONObject().set("value", pay.getMoney()));//提现金额
+            content.set("amount3", new JSONObject().set("value", pay.getMoney() + "元"));//提现金额
             content.set("character_string4", new JSONObject().set("value", pay.getNums()));//交易单号
-            content.set("time2", new JSONObject().set("value", new Date())); //提现时间
+            content.set("time2", new JSONObject().set("value", DateUtils.getTime())); //提现时间
         }
         //提现失败通知
         if (pay.getState() == 2) {
@@ -126,10 +127,10 @@ public class PayServiceImpl extends ServiceImpl<PayMapper, Pay> implements IPayS
             body.set("touser", user.getOpenId());
             body.set("template_id", "NIqSQq0j765o9Iz9gMiSelnuxMgPIPeCnk3lvEnWJlo");
             body.set("page", "pages/user/money/index");
-            content.set("amount3", new JSONObject().set("value", pay.getMoney()));//提现金额
+            content.set("amount3", new JSONObject().set("value", pay.getMoney() + "元"));//提现金额
             content.set("character_string4", new JSONObject().set("value", pay.getNums()));//交易单号
             content.set("thing5", new JSONObject().set("value", pay.getMsg())); //失败原因
-            content.set("time2", new JSONObject().set("value", new Date())); //提现时间
+            content.set("time2", new JSONObject().set("value", DateUtils.getTime())); //提现时间
         }
         body.set("data", content);
         String result = HttpUtil.post("https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token=" + jsonObject.getStr("access_token"), body.toString());