| | |
| | | private final DataDictionaryCustomMapper dataDictionaryCustomMapper; |
| | | private final MallMoneyFlowMapper mallMoneyFlowMapper; |
| | | private final MallAchieveRecordMapper mallAchieveRecordMapper; |
| | | private final RedisUtils redisUtils; |
| | | private final MallMemberWalletMapper mallMemberWalletMapper; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | log.info("#####==店补/董事==end==######"); |
| | | } |
| | | |
| | | private final RedisUtils redisUtils; |
| | | |
| | | @Override |
| | | public void scorePool() { |
| | | log.info("#####==积分池==start==######"); |
| | |
| | | return; |
| | | } |
| | | for(MallMember mallMember : mallMembers){ |
| | | walletService.add(income, mallMember.getId(), "score"); |
| | | moneyFlowService.addMoneyFlow(mallMember.getId(), income, MoneyFlowTypeEnum.SCORE_POOL.getValue(), null, FlowTypeEnum.SCORE.getValue()); |
| | | /* |
| | | 平分成佣金,一比一减少赠送积分 |
| | | 如果没有赠送积分,则平分0 |
| | | */ |
| | | BigDecimal outCome = BigDecimal.ZERO; |
| | | MallMemberWallet mallMemberWallet = mallMemberWalletMapper.selectWalletByMemberId(mallMember.getId()); |
| | | if(mallMemberWallet.getScore().compareTo(income) < 0){ |
| | | outCome = new BigDecimal(mallMemberWallet.getScore().intValue()); |
| | | }else{ |
| | | outCome = income; |
| | | } |
| | | walletService.add(outCome, mallMember.getId(), "commission"); |
| | | walletService.reduce(outCome, mallMember.getId(), "score"); |
| | | moneyFlowService.addMoneyFlow(mallMember.getId(), outCome, MoneyFlowTypeEnum.SCORE_POOL.getValue(), null, FlowTypeEnum.COMMISSION.getValue()); |
| | | moneyFlowService.addMoneyFlow(mallMember.getId(), outCome.negate(), MoneyFlowTypeEnum.SCORE_POOL.getValue(), null, FlowTypeEnum.SCORE.getValue()); |
| | | } |
| | | } |
| | | log.info("#####==积分池==end==######"); |