| | |
| | | |
| | | if (ObjectUtil.isNotEmpty(mallMoneyFlow)) { |
| | | log.debug("检查支付金额payMoney={},mallMoneyFlow.getPayMoney()={}", payMoney, mallMoneyFlow.getAmount()); |
| | | //合伙人申请的充值,要更新会员状态为FIRST_LEVEL |
| | | if(2 == type){ |
| | | mallMemberService.updateMemberAgent(memberId); |
| | | } |
| | |
| | | DataDictionaryCustom giveAmountDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.GIVE_AMOUNT.getType(), |
| | | DataDictionaryEnum.GIVE_AMOUNT.getCode()); |
| | | if(ObjectUtil.isNotEmpty(giveStateDic) |
| | | && "1".equals(giveStateDic.getValue()) |
| | | && ObjectUtil.isNotEmpty(giveAmountDic)){ |
| | | |
| | | DataDictionaryCustom chargeAmountDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.CHARGE_AMOUNT.getType(), |
| | | DataDictionaryEnum.CHARGE_AMOUNT.getCode()); |
| | | /** |
| | | * 普通充值 |
| | | * 开启了充值赠送 |
| | | * 系统设置的赠送金额和充值金额不为空 |
| | | * 充值金额大于等于系统设置的充值金额 |
| | | */ |
| | | if(1 == type |
| | | && ObjectUtil.isNotEmpty(giveStateDic) |
| | | && "1".equals(giveStateDic.getValue()) |
| | | && ObjectUtil.isNotEmpty(giveAmountDic) |
| | | && ObjectUtil.isNotEmpty(chargeAmountDic)){ |
| | | BigDecimal giveAmount = ObjectUtil.isEmpty(giveAmountDic.getValue()) ? |
| | | BigDecimal.ZERO : |
| | | new BigDecimal(giveAmountDic.getValue()).abs().setScale(2,BigDecimal.ROUND_DOWN); |
| | | BigDecimal chargeAmount = ObjectUtil.isEmpty(chargeAmountDic.getValue()) ? |
| | | BigDecimal.ZERO : |
| | | new BigDecimal(chargeAmountDic.getValue()).abs().setScale(2,BigDecimal.ROUND_DOWN); |
| | | if(payMoney.compareTo(chargeAmount) >= 0){ |
| | | mallMoneyFlowService.addMoneyFlow( |
| | | memberId, |
| | | giveAmount, |
| | | MoneyFlowTypeEnum.RECHARGE_SEND.getValue(), |
| | | rechargeNo+"ZS", |
| | | FlowTypeEnum.BALANCE.getValue(), |
| | | "充值赠送金额", |
| | | 2); |
| | | |
| | | mallMoneyFlowService.addMoneyFlow( |
| | | memberId, |
| | | giveAmount, |
| | | MoneyFlowTypeEnum.RECHARGE_SEND.getValue(), |
| | | rechargeNo+"ZS", |
| | | FlowTypeEnum.BALANCE.getValue(), |
| | | "充值赠送金额", |
| | | 2); |
| | | |
| | | memberWalletService.addBalance(giveAmount,memberId); |
| | | memberWalletService.addBalance(giveAmount,memberId); |
| | | } |
| | | } |
| | | |
| | | RechargeWalletMessageSendDto rechargeWalletMessageSendDto = new RechargeWalletMessageSendDto(); |