| | |
| | | |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.enumerates.*; |
| | | import cc.mrbird.febs.common.exception.FebsException; |
| | | import cc.mrbird.febs.common.properties.XcxProperties; |
| | | import cc.mrbird.febs.common.utils.RedisUtils; |
| | | import cc.mrbird.febs.common.utils.SpringContextHolder; |
| | |
| | | |
| | | |
| | | if (order != null && OrderStatusEnum.WAIT_PAY.getValue() == order.getStatus()) { |
| | | if(order.getPayMethod().equals("余额加微信")){ |
| | | MallMemberWallet mallMemberWalletThree = mallMemberWalletMapper.selectWalletByMemberId(order.getMemberId()); |
| | | BigDecimal balanceThree = mallMemberWalletThree.getBalance(); |
| | | |
| | | int reduceThree = memberWalletService.reduce(balanceThree, order.getMemberId(), "balance"); |
| | | if (reduceThree == 2) { |
| | | throw new FebsException("余额不足"); |
| | | } |
| | | mallMoneyFlowService.addMoneyFlow(order.getMemberId(), balanceThree.negate(), MoneyFlowTypeEnum.PAY.getValue(), |
| | | order.getOrderNo(), FlowTypeEnum.BALANCE.getValue(),"余额支付",2); |
| | | } |
| | | log.debug("检查支付金额payMoney={},order.getPayMoney()={}", payMoney, order.getAmount()); |
| | | order.setStatus(OrderStatusEnum.WAIT_SHIPPING.getValue()); |
| | | order.setPayResult("1"); |