diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/MemberBasicInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/MemberBasicInfoServiceImpl.java index a3a58c351..8f099aa51 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/MemberBasicInfoServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/MemberBasicInfoServiceImpl.java @@ -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); } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderBasicInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderBasicInfoServiceImpl.java index e66daa536..8afae4b79 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderBasicInfoServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderBasicInfoServiceImpl.java @@ -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();