| | |
| | | } |
| | | |
| | | BigDecimal score = ObjectUtil.isEmpty(addOrderDto.getScore()) ? BigDecimal.ZERO : addOrderDto.getScore(); |
| | | |
| | | MallMemberWallet mallMemberWallet = mallMemberWalletMapper.selectWalletByMemberId(memberId); |
| | | BigDecimal prizeScore = mallMemberWallet.getPrizeScore(); |
| | | if(prizeScore.compareTo(score) < 0){ |
| | | throw new FebsException("积分不足"); |
| | | } |
| | | if(hasTc){ |
| | | //系统设置的个人贡献点最大值 |
| | | DataDictionaryCustom starGetDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | |
| | | if(ObjectUtil.isNotEmpty(starGetDic)){ |
| | | String starGetStr = StrUtil.isEmpty(starGetDic.getValue()) ? "0" : starGetDic.getValue(); |
| | | BigDecimal starGet = new BigDecimal(starGetStr); |
| | | |
| | | MallMemberWallet mallMemberWallet = mallMemberWalletMapper.selectWalletByMemberId(memberId); |
| | | BigDecimal star = new BigDecimal(mallMemberWallet.getStar()); |
| | | if(starGet.compareTo(BigDecimal.ZERO) != 0 && starGet.compareTo(star) <= 0){ |
| | | throw new FebsException("无法购买套餐"); |
| | | } |
| | | BigDecimal prizeScore = mallMemberWallet.getPrizeScore(); |
| | | if(prizeScore.compareTo(score) < 0){ |
| | | throw new FebsException("积分不足"); |
| | | } |
| | | } |
| | | } |