mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-07-02 04:57:57 +08:00
打印日志
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package com.jsowell.pile.service.impl;
|
package com.jsowell.pile.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSON;
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
@@ -213,7 +214,7 @@ public class MemberBasicInfoServiceImpl implements IMemberBasicInfoService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String targetMerchantId = dto.getTargetMerchantId(); // 目标运营商id
|
String targetMerchantId = dto.getTargetMerchantId(); // 目标运营商id
|
||||||
log.info("修改用户余额-memberId:{}, updatePrincipalBalance:{}, targetMerchantId:{}", memberId, updatePrincipalBalance, targetMerchantId);
|
log.info("修改用户余额-param:{}", JSON.toJSONString(dto));
|
||||||
|
|
||||||
// 来自后管的充值,校验权限
|
// 来自后管的充值,校验权限
|
||||||
if (StringUtils.equals(dto.getFromWeb(), Constants.ONE)) {
|
if (StringUtils.equals(dto.getFromWeb(), Constants.ONE)) {
|
||||||
@@ -227,8 +228,9 @@ public class MemberBasicInfoServiceImpl implements IMemberBasicInfoService {
|
|||||||
|
|
||||||
// 查询用户余额
|
// 查询用户余额
|
||||||
MemberWalletInfo walletInfo = memberWalletInfoService.selectByMemberId(memberId, targetMerchantId);
|
MemberWalletInfo walletInfo = memberWalletInfoService.selectByMemberId(memberId, targetMerchantId);
|
||||||
|
log.info("修改用户余额-根据会员id:{}, 目标运营商id:{}, 查询结果:{}", memberId, targetMerchantId, JSON.toJSONString(walletInfo));
|
||||||
if (walletInfo == null) {
|
if (walletInfo == null) {
|
||||||
log.warn("修改用户余额-根据会员id:{}, 目标运营商id:{}, 查询会员信息为空, 新建会员钱包", memberId, targetMerchantId);
|
log.info("修改用户余额-根据会员id:{}, 目标运营商id:{}, 查询会员信息为空, 新建会员钱包", memberId, targetMerchantId);
|
||||||
// 如果查询到钱包为空,就新建一个该运营商的钱包
|
// 如果查询到钱包为空,就新建一个该运营商的钱包
|
||||||
walletInfo = MemberWalletInfo.builder()
|
walletInfo = MemberWalletInfo.builder()
|
||||||
.walletCode(generateWalletCode())
|
.walletCode(generateWalletCode())
|
||||||
@@ -262,7 +264,7 @@ public class MemberBasicInfoServiceImpl implements IMemberBasicInfoService {
|
|||||||
: walletInfo.getPrincipalBalance();
|
: walletInfo.getPrincipalBalance();
|
||||||
newPrincipalBalance = oldPrincipalBalance.add(updatePrincipalBalance);
|
newPrincipalBalance = oldPrincipalBalance.add(updatePrincipalBalance);
|
||||||
if (newPrincipalBalance.compareTo(BigDecimal.ZERO) < 0) {
|
if (newPrincipalBalance.compareTo(BigDecimal.ZERO) < 0) {
|
||||||
log.warn("修改用户余额-变更后本金余额不能为负数");
|
log.info("修改用户余额-变更后本金余额不能为负数");
|
||||||
throw new BusinessException("", "变更后本金余额不能为负数");
|
throw new BusinessException("", "变更后本金余额不能为负数");
|
||||||
}
|
}
|
||||||
// 记流水
|
// 记流水
|
||||||
@@ -293,7 +295,7 @@ public class MemberBasicInfoServiceImpl implements IMemberBasicInfoService {
|
|||||||
newGiftBalance = oldGiftBalance.add(updateGiftBalance);
|
newGiftBalance = oldGiftBalance.add(updateGiftBalance);
|
||||||
// 余额不能为负数
|
// 余额不能为负数
|
||||||
if (newGiftBalance.compareTo(BigDecimal.ZERO) < 0) {
|
if (newGiftBalance.compareTo(BigDecimal.ZERO) < 0) {
|
||||||
log.warn("修改用户余额-变更后赠送余额不能为负数");
|
log.info("修改用户余额-变更后赠送余额不能为负数");
|
||||||
throw new BusinessException("", "变更后赠送余额不能为负数");
|
throw new BusinessException("", "变更后赠送余额不能为负数");
|
||||||
}
|
}
|
||||||
// 记流水
|
// 记流水
|
||||||
@@ -315,17 +317,19 @@ public class MemberBasicInfoServiceImpl implements IMemberBasicInfoService {
|
|||||||
// 修改数据库
|
// 修改数据库
|
||||||
int i = 0;
|
int i = 0;
|
||||||
if (newPrincipalBalance != null || newGiftBalance != null) {
|
if (newPrincipalBalance != null || newGiftBalance != null) {
|
||||||
log.info("修改用户余额-memberId:{}, walletCode:{}, newPrincipalBalance:{}, newGiftBalance:{}, version:{}"
|
// log.info("修改用户余额-memberId:{}, walletCode:{}, newPrincipalBalance:{}, newGiftBalance:{}, version:{}"
|
||||||
, memberId, walletCode, newPrincipalBalance, newGiftBalance, walletInfo.getVersion());
|
// , memberId, walletCode, newPrincipalBalance, newGiftBalance, walletInfo.getVersion());
|
||||||
i = memberBasicInfoMapper.updateMemberBalance(memberId, walletCode, newPrincipalBalance, newGiftBalance, walletInfo.getVersion());
|
i = memberBasicInfoMapper.updateMemberBalance(memberId, walletCode, newPrincipalBalance, newGiftBalance, walletInfo.getVersion());
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
log.warn("修改用户余额-修改余额失败, memberId:{}", memberId);
|
log.info("修改用户余额-修改余额失败, memberId:{}", memberId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 插入 member_wallet_log 表
|
// 插入 member_wallet_log 表
|
||||||
if (CollectionUtils.isNotEmpty(logList)) {
|
if (CollectionUtils.isNotEmpty(logList)) {
|
||||||
memberWalletLogMapper.batchInsert(logList);
|
memberWalletLogMapper.batchInsert(logList);
|
||||||
}
|
}
|
||||||
|
log.info("修改用户余额-end memberId:{}, walletCode:{}, newPrincipalBalance:{}, newGiftBalance:{}, version:{}"
|
||||||
|
, memberId, walletCode, newPrincipalBalance, newGiftBalance, walletInfo.getVersion());
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user