展示区域包括小程序时 初始库存不可为0
This commit is contained in:
@@ -231,6 +231,13 @@ public class TbProductServiceImpl implements TbProductService {
|
||||
if (resources.getCategoryId() == null){
|
||||
throw new BadRequestException("必填内容未填写");
|
||||
}
|
||||
if (resources.getIsShowMall()==1){
|
||||
for (TbProductSku sku : resources.getSkuList()) {
|
||||
if(sku.getStockNumber()<=0){
|
||||
throw new BadRequestException("上架区域包括小程序时,库存数量必须大于0。");
|
||||
}
|
||||
}
|
||||
}
|
||||
product.setImages(resources.getImages().toString());
|
||||
product.setCategoryId(String.valueOf(resources.getCategoryId()));
|
||||
product.setIsDel(0);
|
||||
|
||||
Reference in New Issue
Block a user