| | |
| | | if(ObjectUtil.isEmpty(mallGoods)){ |
| | | throw new FebsException("商品已更新,请重新下单"); |
| | | } |
| | | /** |
| | | * 贡献点判断 |
| | | |
| | | /* |
| | | 获取单个商品的折扣积分数量 |
| | | = 现价 * 数量 * 折扣现金比例 |
| | | */ |
| | | if (mallGoods.getIsNormal() == 2) { |
| | | hasTc = true; |
| | | } |
| | | /* |
| | | 获取单个商品的折扣积分数量 |
| | | = 现价 * 数量 * 折扣现金比例 |
| | | */ |
| | | BigDecimal scorePercent = new BigDecimal(mallGoods.getScorePercent()).multiply(new BigDecimal(0.01)); |
| | | BigDecimal amount = sku.getPresentPrice().multiply(BigDecimal.valueOf(item.getCnt())).multiply(scorePercent); |
| | | total = total.add(amount); |
| | |
| | | if(prizeScore.compareTo(score) < 0){ |
| | | throw new FebsException("积分不足"); |
| | | } |
| | | if(hasTc){ |
| | | //系统设置的个人贡献点最大值 |
| | | DataDictionaryCustom starGetDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.STAR_GET.getType(), |
| | | DataDictionaryEnum.STAR_GET.getCode()); |
| | | if(ObjectUtil.isNotEmpty(starGetDic)){ |
| | | String starGetStr = StrUtil.isEmpty(starGetDic.getValue()) ? "0" : starGetDic.getValue(); |
| | | BigDecimal starGet = new BigDecimal(starGetStr); |
| | | BigDecimal star = new BigDecimal(mallMemberWallet.getStar()); |
| | | if(starGet.compareTo(BigDecimal.ZERO) != 0 && starGet.compareTo(star) <= 0){ |
| | | throw new FebsException("无法购买套餐"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 使用积分折扣现金 |
| | | */ |