From 0e549b5ff4a60d5016d66e2ffe0e1c7ed9655462 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Tue, 28 Mar 2023 10:46:33 +0800
Subject: [PATCH] 后台修改

---
 src/main/java/cc/mrbird/febs/mall/service/impl/MallMemberWithdrawServiceImpl.java |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/src/main/java/cc/mrbird/febs/mall/service/impl/MallMemberWithdrawServiceImpl.java b/src/main/java/cc/mrbird/febs/mall/service/impl/MallMemberWithdrawServiceImpl.java
index 0053096..c3b1d89 100644
--- a/src/main/java/cc/mrbird/febs/mall/service/impl/MallMemberWithdrawServiceImpl.java
+++ b/src/main/java/cc/mrbird/febs/mall/service/impl/MallMemberWithdrawServiceImpl.java
@@ -60,6 +60,14 @@
         if (dic != null) {
             cashOutSettingVo = JSONObject.parseObject(dic.getValue(), CashOutSettingVo.class);
         }
+        BigDecimal minCashOut = cashOutSettingVo.getMinCashOut();
+        if(withdrawalDto.getAmount().compareTo(minCashOut) < 0){
+            throw new FebsException("提现金额最小为"+minCashOut);
+        }
+
+        if (withdrawalDto.getAmount().compareTo(BigDecimal.ZERO) <= 0) {
+            throw new FebsException("请输入正确的提现金额");
+        }
 
         if (withdrawalDto.getAmount().compareTo(BigDecimal.ZERO) <= 0) {
             throw new FebsException("请输入正确的提现金额");
@@ -79,13 +87,14 @@
         withdraw.setAmount(withdrawalDto.getAmount());
         withdraw.setStatus(1);
         withdraw.setAmountFee(serviceFee);
+        withdraw.setRemark(withdrawalDto.getBankNo());
 //        withdraw.setWtihdrawTypeId(mallMemberBank.getId());
         this.baseMapper.insert(withdraw);
         //生成提现流水记录
         Long subsidyAmountFlowId = mallMoneyFlowService.addMoneyFlow(
                 memberId,
                 orderNo,
-                withdrawalDto.getAmount(),
+                withdrawalDto.getAmount().negate(),
                 MallMoneyFlowTypeEnum.WITHDRAW.getCode(),
                 MallMoneyFlow.STATUS_ING,
                 MallMoneyFlow.IS_RETURN_Y,

--
Gitblit v1.9.1