From cadeca36ff86f74371c77a05dc8422abc1e48855 Mon Sep 17 00:00:00 2001
From: KKSU <15274802129@163.com>
Date: Thu, 19 Dec 2024 16:28:40 +0800
Subject: [PATCH] feat(table): 添加合计行功能 - 在 mallMemberList.html 中添加了 totalRow 属性,用于显示碳币和碳积分的合计 - 在 moneyFlowList.html 中移除了 description 字段的 totalRow属性 - 在 sellVipList.html 中将 amount 和 amountFee 字段的 totalRow 属性改为 true
---
src/main/java/cc/mrbird/febs/mall/service/impl/MallMemberWithdrawServiceImpl.java | 12 ++++++++----
1 files changed, 8 insertions(+), 4 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 1e94690..a35d424 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
@@ -22,6 +22,7 @@
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
@@ -42,6 +43,7 @@
private final DataDictionaryCustomMapper dataDictionaryCustomMapper;
@Override
+ @Transactional(rollbackFor = Exception.class)
public void withdrawal(WithdrawalDto withdrawalDto) {
Long memberId = LoginUserUtil.getLoginUser().getId();
MallMember mallMember = mallMemberService.getById(memberId);
@@ -59,9 +61,8 @@
if (dic != null) {
cashOutSettingVo = JSONObject.parseObject(dic.getValue(), CashOutSettingVo.class);
}
- DataDictionaryCustom withdrawalCnt = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.MEMBER_WITHDRAWAL_CNT.getType(), DataDictionaryEnum.MEMBER_WITHDRAWAL_CNT.getCode());
if (withdrawalDto.getAmount().compareTo(cashOutSettingVo.getMinCashOut()) < 0) {
- throw new FebsException("最小提现金额为"+withdrawalCnt.getValue()+"元");
+ throw new FebsException("最小提现金额为"+cashOutSettingVo.getMinCashOut()+"元");
}
String openId = mallMember.getOpenId();
@@ -79,13 +80,16 @@
}
walletService.reduce(withdrawalDto.getAmount(), memberId, "balance");
- String withdrawalNo = "TX_"+MallUtils.getOrderNum();
+// String withdrawalNo = "TX_"+MallUtils.getOrderNum();
MallMemberWithdraw withdraw = new MallMemberWithdraw();
- withdraw.setWithdrawNo(withdrawalNo);
+// withdraw.setWithdrawNo(withdrawalNo);
withdraw.setMemberId(memberId);
withdraw.setAmount(withdrawalDto.getAmount());
withdraw.setStatus(1);
this.baseMapper.insert(withdraw);
+ String withdrawalNo = "TX_"+withdraw.getId().toString();
+ withdraw.setWithdrawNo(withdrawalNo);
+ this.baseMapper.updateById(withdraw);
mallMemberService.addMoneyFlow(memberId, withdrawalDto.getAmount().negate(), MoneyFlowTypeEnum.WITHDRAWAL.getValue(), withdrawalNo, null, null, null, 1, FlowTypeEnum.BALANCE.getValue());
}
--
Gitblit v1.9.1