| | |
| | | //根据商品原价获取商品补贴金额 |
| | | DataDictionaryCustom subsidyPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.SUBSIDY_PERCENT.getType() |
| | | , DataDictionaryEnum.SUBSIDY_PERCENT.getCode()); |
| | | BigDecimal subsidyPercent = new BigDecimal(subsidyPercentDic.getValue()).multiply(new BigDecimal(0.01)).setScale(BigDecimal.ROUND_DOWN,2); |
| | | BigDecimal subsidyAmount = subsidyPercent.multiply(new BigDecimal(originalPrice)).setScale(BigDecimal.ROUND_DOWN, 2); |
| | | BigDecimal subsidyPercent = new BigDecimal(subsidyPercentDic.getValue()).multiply(new BigDecimal(0.01)).setScale(2,BigDecimal.ROUND_DOWN); |
| | | BigDecimal subsidyAmount = subsidyPercent.multiply(new BigDecimal(originalPrice)).setScale(2, BigDecimal.ROUND_DOWN); |
| | | mallGoods.setSubsidyAmount(subsidyAmount); |
| | | if (mallGoods.getHasCarriage() == 2) { |
| | | mallGoods.setCarriage(BigDecimal.ZERO); |
| | | } |
| | | // if (mallGoods.getHasCarriage() == 2) { |
| | | // mallGoods.setCarriage(BigDecimal.ZERO); |
| | | // } |
| | | mallGoodsMapper.insert(mallGoods); |
| | | |
| | | String thumbs = addMallGoodsDto.getThumbs(); |
| | |
| | | } |
| | | |
| | | BeanUtil.copyProperties(mallGoodsUpdateDto, mallGoods); |
| | | if (mallGoods.getHasCarriage() == 2) { |
| | | mallGoods.setCarriage(BigDecimal.ZERO); |
| | | } |
| | | // if (mallGoods.getHasCarriage() == 2) { |
| | | // mallGoods.setCarriage(BigDecimal.ZERO); |
| | | // } |
| | | //根据商品原价获取商品星级 |
| | | String originalPrice = mallGoods.getOriginalPrice(); |
| | | String starRating = StarRatingEnum.NORMAL.belongStarRating(originalPrice); |
| | |
| | | //根据商品原价获取商品补贴金额 |
| | | DataDictionaryCustom subsidyPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.SUBSIDY_PERCENT.getType() |
| | | , DataDictionaryEnum.SUBSIDY_PERCENT.getCode()); |
| | | BigDecimal subsidyPercent = new BigDecimal(subsidyPercentDic.getValue()).multiply(new BigDecimal(0.01)).setScale(BigDecimal.ROUND_DOWN,2); |
| | | BigDecimal subsidyAmount = subsidyPercent.multiply(new BigDecimal(originalPrice)).setScale(BigDecimal.ROUND_DOWN, 2); |
| | | BigDecimal subsidyPercent = new BigDecimal(subsidyPercentDic.getValue()).multiply(new BigDecimal(0.01)).setScale(2,BigDecimal.ROUND_DOWN); |
| | | BigDecimal subsidyAmount = subsidyPercent.multiply(new BigDecimal(originalPrice)).setScale(2, BigDecimal.ROUND_DOWN); |
| | | mallGoods.setSubsidyAmount(subsidyAmount); |
| | | |
| | | mallGoodsMapper.updateById(mallGoods); |
| | |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | |
| | | //根据商品原价获取商品补贴金额 |
| | | BigDecimal subsidyPercent = new BigDecimal("5").multiply(new BigDecimal(0.01)).setScale(2,BigDecimal.ROUND_DOWN); |
| | | BigDecimal subsidyAmount = subsidyPercent.multiply(new BigDecimal("1")).setScale(2,BigDecimal.ROUND_DOWN); |
| | | System.out.println(subsidyAmount); |
| | | } |
| | | |
| | | |
| | | } |