| | |
| | | } |
| | | |
| | | if (isReduce) { |
| | | iApiMallMemberWalletService.reduce(mallSystemPayDto.getAddBalance().negate(), mallSystemPayDto.getId(), filedType); |
| | | int i = iApiMallMemberWalletService.reduce(mallSystemPayDto.getAddBalance().negate(), mallSystemPayDto.getId(), filedType); |
| | | |
| | | if (i == 2) { |
| | | throw new FebsException("剩余数量不足"); |
| | | } |
| | | } else { |
| | | iApiMallMemberWalletService.add(mallSystemPayDto.getAddBalance(), mallSystemPayDto.getId(), filedType); |
| | | } |
| | |
| | | // wallet.setCommission(commission); |
| | | // mallMemberWalletMapper.updateAmountWithVersion(wallet); |
| | | |
| | | // 消耗积分 |
| | | BigDecimal useScore = new BigDecimal(actScoreCnt); |
| | | mallMemberWalletService.reduce(useScore, wallet.getMemberId(), "prizeScore"); |
| | | mallMemberWalletService.add(commission, wallet.getMemberId(), "commission"); |
| | | mallMoneyFlowService.addMoneyFlow(wallet.getMemberId(), useScore.negate(), MoneyFlowTypeEnum.PRIZE.getValue(), null, FlowTypeEnum.PRIZE_SCORE.getValue()); |
| | | mallMoneyFlowService.addMoneyFlow(wallet.getMemberId(), commission, MoneyFlowTypeEnum.PRIZE.getValue(), null, FlowTypeEnum.COMMISSION.getValue()); |
| | | |
| | | if (apiMallAwardDetailsVo.getAwardType() == 1) { |
| | | mallMemberWalletService.add(new BigDecimal(apiMallAwardDetailsVo.getAwardValue()), wallet.getMemberId(), "prizeScore"); |
| | | mallMoneyFlowService.addMoneyFlow(wallet.getMemberId(), commission, MoneyFlowTypeEnum.PRIZE.getValue(), null, FlowTypeEnum.PRIZE_SCORE.getValue()); |
| | | } else if (apiMallAwardDetailsVo.getAwardType() == 2) { |
| | | mallMemberWalletService.add(new BigDecimal(apiMallAwardDetailsVo.getAwardValue()), wallet.getMemberId(), "commission"); |
| | | mallMoneyFlowService.addMoneyFlow(wallet.getMemberId(), commission, MoneyFlowTypeEnum.PRIZE.getValue(), null, FlowTypeEnum.COMMISSION.getValue()); |
| | | } |
| | | return apiMallAwardDetailsVo; |
| | | } |
| | | |
| | |
| | | BigDecimal balance = (BigDecimal) declaredField.get(wallet); |
| | | |
| | | if (amount.compareTo(balance) > 0) { |
| | | if (map == null) { |
| | | return 2; |
| | | } |
| | | |
| | | // 判断 赠送积分,如果剩下赠送积分不等于0且小于amount, 则扣除所有赠送积分 |
| | | if ("score".equals(field)) { |
| | | if (balance.compareTo(BigDecimal.ZERO) == 0) { |