| | |
| | | String levelNormal = MemberLevelEnum.NORMAL.getType(); |
| | | BigDecimal cashPercentNormal = BigDecimal.ZERO; |
| | | BigDecimal scorePercentNormal = BigDecimal.ZERO; |
| | | |
| | | DataDictionaryCustom poolScorePriceDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | PerkEnum.POOL_SCORE_PRICE.getType(), |
| | | PerkEnum.POOL_SCORE_PRICE.getCode()); |
| | | BigDecimal poolScorePrice = new BigDecimal(poolScorePriceDic.getValue() == null ? "1" : poolScorePriceDic.getValue()); |
| | | for(MallMember teamPerkMember : mallMemberTeamPerk){ |
| | | String level = teamPerkMember.getLevel(); |
| | | //比较两个级别的大小,level大于levelNormal返回1 |
| | |
| | | scorePercent = scorePercent.subtract(scorePercentNormal); |
| | | |
| | | BigDecimal cashAmount = amountTC.multiply(cashPercent).setScale(2, BigDecimal.ROUND_DOWN); |
| | | |
| | | //如果是积分,除以当前价格,得到数量。 |
| | | BigDecimal scoreCnt = amountTC.multiply(scorePercent).setScale(2, BigDecimal.ROUND_DOWN); |
| | | scoreCnt = scoreCnt.divide(poolScorePrice, 2 ,BigDecimal.ROUND_DOWN); |
| | | if(cashAmount.compareTo(BigDecimal.ZERO) > 0){ |
| | | addWalletInfoAndMoneyFlow(cashAmount, |
| | | teamPerkMemberId, |
| | |
| | | BigDecimal perkEnumDicPercent = new BigDecimal(perkEnumDic.getValue() == null ? "0" : perkEnumDic.getValue()); |
| | | //获得数量 |
| | | BigDecimal perkEnumDicPercentPerk = perkEnumDicPercent.multiply(AppContants.PERCENTAGE).multiply(amountTC).setScale(2, BigDecimal.ROUND_DOWN); |
| | | //如果是积分,除以当前价格,得到数量。 |
| | | if(walletField.equals("score")){ |
| | | DataDictionaryCustom poolScorePriceDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | PerkEnum.POOL_SCORE_PRICE.getType(), |
| | | PerkEnum.POOL_SCORE_PRICE.getCode()); |
| | | BigDecimal poolScorePrice = new BigDecimal(poolScorePriceDic.getValue() == null ? "1" : poolScorePriceDic.getValue()); |
| | | perkEnumDicPercentPerk = perkEnumDicPercentPerk.divide(poolScorePrice, 2 ,BigDecimal.ROUND_DOWN); |
| | | } |
| | | if(perkEnumDicPercentPerk.compareTo(BigDecimal.ZERO) > 0){ |
| | | addWalletInfoAndMoneyFlow(perkEnumDicPercentPerk,memberId,walletField,type,flowType,orderNo); |
| | | } |