同步
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>cn.lili</groupId>
|
||||
<artifactId>lili-shop-parent</artifactId>
|
||||
<version>1.0.1</version>
|
||||
<version>4.2.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>framework</artifactId>
|
||||
|
||||
@@ -235,19 +235,19 @@ public class Goods extends BaseEntity {
|
||||
if (sku.get("sn") == null) {
|
||||
throw new ServiceException(ResultCode.GOODS_SKU_SN_ERROR);
|
||||
}
|
||||
if (StringUtil.isEmpty(sku.get("price").toString()) || Convert.toDouble( sku.get("price").toString()) <= 0) {
|
||||
if (StringUtil.isEmpty(sku.get("price").toString()) || Convert.toDouble(sku.get("price")) <= 0) {
|
||||
throw new ServiceException(ResultCode.GOODS_SKU_PRICE_ERROR);
|
||||
}
|
||||
if (StringUtil.isEmpty(sku.get("cost").toString()) || Convert.toDouble( sku.get("cost").toString()) <= 0) {
|
||||
if (StringUtil.isEmpty(sku.get("cost").toString()) || Convert.toDouble(sku.get("cost")) <= 0) {
|
||||
throw new ServiceException(ResultCode.GOODS_SKU_COST_ERROR);
|
||||
}
|
||||
//虚拟商品没有重量字段
|
||||
if(sku.containsKey("weight")) {
|
||||
if (sku.containsKey("weight")) {
|
||||
if (StringUtil.isEmpty(sku.get("weight").toString()) || Convert.toDouble(sku.get("weight").toString()) < 0) {
|
||||
throw new ServiceException(ResultCode.GOODS_SKU_WEIGHT_ERROR);
|
||||
}
|
||||
}
|
||||
if (StringUtil.isEmpty(sku.get("quantity").toString()) || Convert.toInt( sku.get("quantity").toString()) < 0) {
|
||||
if (StringUtil.isEmpty(sku.get("quantity").toString()) || Convert.toInt(sku.get("quantity").toString()) < 0) {
|
||||
throw new ServiceException(ResultCode.GOODS_SKU_QUANTITY_ERROR);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user