卡启动充电

This commit is contained in:
2023-11-28 14:07:06 +08:00
parent 6d71a7e9c2
commit 8c272b245e
2 changed files with 11 additions and 7 deletions

View File

@@ -382,19 +382,23 @@ public class MemberBasicInfoServiceImpl implements IMemberBasicInfoService {
}
try {
BigDecimal totalAccountAmount = BigDecimal.ZERO;
// BigDecimal totalAccountAmount = BigDecimal.ZERO;
BigDecimal principalBalance = BigDecimal.ZERO;
BigDecimal giftBalance = BigDecimal.ZERO;
MemberWalletInfo memberWalletInfo = memberWalletInfoService.selectByMemberId(memberId, merchantId);
if (memberWalletInfo != null) {
totalAccountAmount = memberWalletInfo.getPrincipalBalance();
principalBalance = memberWalletInfo.getPrincipalBalance();
giftBalance = memberWalletInfo.getGiftBalance();
if (memberWalletInfo.getPrincipalBalance() != null) {
principalBalance = memberWalletInfo.getPrincipalBalance();
}
if (memberWalletInfo.getGiftBalance() != null) {
giftBalance = memberWalletInfo.getGiftBalance();
}
// totalAccountAmount = memberWalletInfo.getPrincipalBalance();
vo.setMerchantId(memberWalletInfo.getMerchantId());
}
vo.setTotalAccountAmount(totalAccountAmount);
vo.setPrincipalBalance(principalBalance);
vo.setGiftBalance(giftBalance);
vo.setTotalAccountAmount(vo.getPrincipalBalance().add(vo.getGiftBalance()));
} catch (Exception e) {
log.error("查询用户余额异常 memberId:{}, merchantId:{}", memberId, merchantId, e);
}

View File

@@ -31,7 +31,6 @@ import com.jsowell.common.enums.ykc.*;
import com.jsowell.common.exception.BusinessException;
import com.jsowell.common.util.DateUtils;
import com.jsowell.common.util.PageUtils;
import com.jsowell.common.util.SecurityUtils;
import com.jsowell.common.util.StringUtils;
import com.jsowell.common.util.bean.BeanUtils;
import com.jsowell.common.util.id.IdUtils;
@@ -2376,12 +2375,13 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
payMode = OrderPayModeEnum.PAYMENT_OF_WHITELIST.getValue();
} else {
// 通过memberId获取账户余额
MemberVO memberVO = memberBasicInfoService.queryMemberInfoByMemberId(dto.getMemberId());
MemberVO memberVO = memberBasicInfoService.queryMemberInfoByMemberId(dto.getMemberId(), pileBasicInfo.getMerchantId() + "");
if (memberVO == null) {
throw new BusinessException(ReturnCodeEnum.CODE_GET_MEMBER_ACCOUNT_AMOUNT_ERROR);
}
accountBalance = memberVO.getTotalAccountAmount();
if (accountBalance.compareTo(BigDecimal.ZERO) <= 0) {
logger.info("充电桩主动申请启动充电生成订单 余额不足", JSON.toJSONString(dto));
throw new BusinessException(ReturnCodeEnum.CODE_BALANCE_IS_INSUFFICIENT);
}
payMode = OrderPayModeEnum.PAYMENT_OF_BALANCE.getValue();