扣点问题

This commit is contained in:
kuang.yife 2023-02-13 00:08:46 +08:00
parent 3bbde9b5a3
commit 94f62d3fe2
1 changed files with 16 additions and 16 deletions

View File

@ -286,23 +286,23 @@ public class GoodsController extends BaseController {
goodsStandards.stream().forEach(goodsStandard -> {
if (StringUtils.isEmpty(goodsStandard.getGoodsUnit())) {
goodsStandard.setGoodsUnit(result.getGoodsUnit());
BigDecimal finalPrice = BigDecimal.ZERO;
// 获取规格的扣点
DeptGoodsCategory deptGoodsCategory = deptGoodsCategoryService.get(goodsStandard.getDeptGoodsCategoryId());
if(deptGoodsCategory.getOneRate() != null){
finalPrice = finalPrice.add(BigDecimal.valueOf(Double.parseDouble(deptGoodsCategory.getOneRate())).multiply(goodsStandard.getGoodsPrice()));
}
if(deptGoodsCategory.getTwoRate() != null){
finalPrice = finalPrice.add(BigDecimal.valueOf(Double.parseDouble(deptGoodsCategory.getTwoRate())).multiply(goodsStandard.getGoodsPrice()));
}
if(deptGoodsCategory.getThreeRate() != null){
finalPrice = finalPrice.add(BigDecimal.valueOf(Double.parseDouble(deptGoodsCategory.getThreeRate())).multiply(goodsStandard.getGoodsPrice()));
}
if(goodsStandard.getExtMoney() != null){
finalPrice = finalPrice.add(goodsStandard.getExtMoney());
}
goodsStandard.setFinalPrice(finalPrice);
}
BigDecimal finalPrice = BigDecimal.ZERO;
// 获取规格的扣点
DeptGoodsCategory deptGoodsCategory = deptGoodsCategoryService.get(goodsStandard.getDeptGoodsCategoryId());
if(deptGoodsCategory.getOneRate() != null){
finalPrice = finalPrice.add(BigDecimal.valueOf(Double.parseDouble(deptGoodsCategory.getOneRate())).multiply(goodsStandard.getGoodsPrice()));
}
if(deptGoodsCategory.getTwoRate() != null){
finalPrice = finalPrice.add(BigDecimal.valueOf(Double.parseDouble(deptGoodsCategory.getTwoRate())).multiply(goodsStandard.getGoodsPrice()));
}
if(deptGoodsCategory.getThreeRate() != null){
finalPrice = finalPrice.add(BigDecimal.valueOf(Double.parseDouble(deptGoodsCategory.getThreeRate())).multiply(goodsStandard.getGoodsPrice()));
}
if(goodsStandard.getExtMoney() != null){
finalPrice = finalPrice.add(goodsStandard.getExtMoney());
}
goodsStandard.setFinalPrice(finalPrice);
});
result.setGoodsStandardList(goodsStandards);