规格中佣金金额
This commit is contained in:
parent
8704918f1d
commit
4a676c7cf8
|
|
@ -19,6 +19,7 @@ import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
@ -202,6 +203,22 @@ public class GoodsController extends BaseController {
|
||||||
goodsStandards.stream().forEach(goodsStandard -> {
|
goodsStandards.stream().forEach(goodsStandard -> {
|
||||||
if (StringUtils.isEmpty(goodsStandard.getGoodsUnit())) {
|
if (StringUtils.isEmpty(goodsStandard.getGoodsUnit())) {
|
||||||
goodsStandard.setGoodsUnit(result.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);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
result.setGoodsStandardList(goodsStandards);
|
result.setGoodsStandardList(goodsStandards);
|
||||||
|
|
|
||||||
|
|
@ -41,4 +41,6 @@ public class GoodsStandard extends BaseEntity {
|
||||||
|
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
|
private BigDecimal finalPrice;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue