mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 03:25:12 +08:00
卡启动充电
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user