Compare commits

..

No commits in common. "d6b28a350e6d316f0f3c52bd080922c05491d746" and "e562c9a558222050b362670781b727dfd3e55595" have entirely different histories.

1 changed files with 0 additions and 9 deletions

View File

@ -46,20 +46,11 @@ public class GoodsService {
*/
public Goods createGoods(Goods goods) {
if (goods.getPricingModel().equals(GoodsPricingModelEnum.Bonus.getPricingModel()) && goods.getMakeUp() == null){
throw new MessageException("售价为进价加成时,加成率不能为空");
}
if (goods.getPricingModel().equals(GoodsPricingModelEnum.Fixed.getPricingModel()) && goods.getUnitPrice() == null){
throw new MessageException("售价为固定售价时,售价不能为空");
}
if (goods.getPricingModel().equals(GoodsPricingModelEnum.Bonus.getPricingModel())) {
//进价加成 更新固定售价
goods.setUnitPrice(goods.getPurchaseUnitPrice()
.multiply(new BigDecimal(goods.getMakeUp() + 100)).divide(new BigDecimal(100), 6, RoundingMode.HALF_DOWN));
}
if (goods.getTrdnFlag()==null||!goods.getTrdnFlag()){
goods.setDisassemblyPrice(null);
}