展示区域包括小程序时 初始库存不可为0
This commit is contained in:
@@ -157,7 +157,7 @@ public class TbProduct implements Serializable {
|
|||||||
private Integer isOnSale = 0;
|
private Integer isOnSale = 0;
|
||||||
|
|
||||||
@Column(name = "`is_show`")
|
@Column(name = "`is_show`")
|
||||||
@ApiModelProperty(value = "是否展示0-不展示 1.小程序2.收银端 9.全展示")
|
@ApiModelProperty(value = "是否展示0-下架 1上架---废弃")
|
||||||
private Integer isShow = 0;
|
private Integer isShow = 0;
|
||||||
|
|
||||||
@Column(name = "`type_enum`")
|
@Column(name = "`type_enum`")
|
||||||
|
|||||||
@@ -231,6 +231,13 @@ public class TbProductServiceImpl implements TbProductService {
|
|||||||
if (resources.getCategoryId() == null){
|
if (resources.getCategoryId() == null){
|
||||||
throw new BadRequestException("必填内容未填写");
|
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.setImages(resources.getImages().toString());
|
||||||
product.setCategoryId(String.valueOf(resources.getCategoryId()));
|
product.setCategoryId(String.valueOf(resources.getCategoryId()));
|
||||||
product.setIsDel(0);
|
product.setIsDel(0);
|
||||||
|
|||||||
Reference in New Issue
Block a user