|
@@ -82,6 +82,21 @@ public class ProductSkuServiceImpl implements ProductSkuService {
|
|
|
if (CollUtil.isEmpty(skus)) {
|
|
|
throw exception(SKU_NOT_EXISTS);
|
|
|
}
|
|
|
+
|
|
|
+ // 校验结算价是否大于成本价
|
|
|
+ for (ProductSkuSaveReqVO sku : skus) {
|
|
|
+ // 如果是高精度商品
|
|
|
+ if(sku.getSettlementPrice().equals(0)){
|
|
|
+ if(sku.getHighPrecisionSettlementPrice().compareTo(sku.getHighPrecisionPrice()) > 0){
|
|
|
+ throw exception(HIGH_PRECISION_PRICE_NOT_ENOUGH);
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ if(sku.getSettlementPrice() > sku.getCostPrice()){
|
|
|
+ throw exception(HIGH_PRECISION_PRICE_NOT_ENOUGH);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// 单规格,赋予单规格默认属性
|
|
|
if (ObjectUtil.equal(specType, false)) {
|
|
|
ProductSkuSaveReqVO skuVO = skus.get(0);
|