|
@@ -97,21 +97,27 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
builder.put("retailPrice", "零售价格");
|
|
|
builder.put("isHot", "热销");
|
|
|
|
|
|
- if (!Dict.orderBizType.item_11.getItem().equals(goods.getGoodsBizType())) {
|
|
|
- // 海关信息,普通货物可不添加
|
|
|
- builder.put("sku", "SKU");
|
|
|
- builder.put("prodBarcode", "产品编码");
|
|
|
- builder.put("brand", "产品品牌");
|
|
|
- builder.put("unitCode", "计量单位代码");
|
|
|
- builder.put("cusGoodsCode", "海关商品编码");
|
|
|
- builder.put("ciqProdModel", "国检规格型号");
|
|
|
- builder.put("oriCntCode", "原产国代码");
|
|
|
- builder.put("cusDeclEle", "海关申报要素");
|
|
|
- builder.put("cusRecCode", "海关备案编号");
|
|
|
- }
|
|
|
R r = ValidatorUtil.isEmpty(builder.build(), valideDate);
|
|
|
if (Integer.valueOf(r.get("code").toString()) != 0) {
|
|
|
throw new RRException(r.get("msg").toString());
|
|
|
+ } else {
|
|
|
+ if (!Dict.orderBizType.item_11.getItem().equals(goods.getGoodsBizType())) {
|
|
|
+ // 海关信息,普通货物可不添加
|
|
|
+ builder.put("sku", "SKU");
|
|
|
+ builder.put("retailPrice", "零售价");
|
|
|
+ builder.put("prodBarcode", "产品编码");
|
|
|
+ builder.put("brand", "产品品牌");
|
|
|
+ builder.put("unitCode", "计量单位代码");
|
|
|
+ builder.put("cusGoodsCode", "海关商品编码");
|
|
|
+ builder.put("ciqProdModel", "国检规格型号");
|
|
|
+ builder.put("oriCntCode", "原产国代码");
|
|
|
+ builder.put("cusDeclEle", "海关申报要素");
|
|
|
+ builder.put("cusRecCode", "海关备案编号");
|
|
|
+ }
|
|
|
+ r = ValidatorUtil.isEmpty(builder.build(), valideDate);
|
|
|
+ if (Integer.valueOf(r.get("code").toString()) != 0) {
|
|
|
+ throw new RRException(r.get("msg").toString());
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// 商品轮播图
|
|
@@ -132,6 +138,10 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
}
|
|
|
|
|
|
// 添加商品
|
|
|
+ if (Dict.orderBizType.item_02.getItem().equals(goods.getGoodsBizType())
|
|
|
+ || Dict.orderBizType.item_10.getItem().equals(goods.getGoodsBizType())) {
|
|
|
+ goods.setIsHot(0);
|
|
|
+ }
|
|
|
goods.setAttributeCategory(categoryDao.queryObject(goods.getCategoryId()).getParentId());
|
|
|
goods.setAddTime(new Date());
|
|
|
goods.setIsDelete(0);
|
|
@@ -209,22 +219,28 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
builder.put("goodsRate", "商品税率");
|
|
|
builder.put("isHot", "热销");
|
|
|
|
|
|
- if (!Dict.orderBizType.item_11.getItem().equals(goods.getGoodsBizType())) {
|
|
|
- // 海关信息,普通货物可不添加
|
|
|
- builder.put("sku", "SKU");
|
|
|
- builder.put("retailPrice", "零售价");
|
|
|
- builder.put("prodBarcode", "产品编码");
|
|
|
- builder.put("brand", "产品品牌");
|
|
|
- builder.put("unitCode", "计量单位代码");
|
|
|
- builder.put("cusGoodsCode", "海关商品编码");
|
|
|
- builder.put("ciqProdModel", "国检规格型号");
|
|
|
- builder.put("oriCntCode", "原产国代码");
|
|
|
- builder.put("cusDeclEle", "海关申报要素");
|
|
|
- builder.put("cusRecCode", "海关备案编号");
|
|
|
- }
|
|
|
+
|
|
|
R r = ValidatorUtil.isEmpty(builder.build(), valideDate);
|
|
|
if (Integer.valueOf(r.get("code").toString()) != 0) {
|
|
|
throw new RRException(r.get("msg").toString());
|
|
|
+ } else {
|
|
|
+ if (!Dict.orderBizType.item_11.getItem().equals(goods.getGoodsBizType())) {
|
|
|
+ // 海关信息,普通货物可不添加
|
|
|
+ builder.put("sku", "SKU");
|
|
|
+ builder.put("retailPrice", "零售价");
|
|
|
+ builder.put("prodBarcode", "产品编码");
|
|
|
+ builder.put("brand", "产品品牌");
|
|
|
+ builder.put("unitCode", "计量单位代码");
|
|
|
+ builder.put("cusGoodsCode", "海关商品编码");
|
|
|
+ builder.put("ciqProdModel", "国检规格型号");
|
|
|
+ builder.put("oriCntCode", "原产国代码");
|
|
|
+ builder.put("cusDeclEle", "海关申报要素");
|
|
|
+ builder.put("cusRecCode", "海关备案编号");
|
|
|
+ }
|
|
|
+ r = ValidatorUtil.isEmpty(builder.build(), valideDate);
|
|
|
+ if (Integer.valueOf(r.get("code").toString()) != 0) {
|
|
|
+ throw new RRException(r.get("msg").toString());
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// 商品轮播图
|
|
@@ -246,6 +262,10 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
}
|
|
|
|
|
|
// 修改商品
|
|
|
+ if (Dict.orderBizType.item_02.getItem().equals(goods.getGoodsBizType())
|
|
|
+ || Dict.orderBizType.item_10.getItem().equals(goods.getGoodsBizType())) {
|
|
|
+ goods.setIsHot(0);
|
|
|
+ }
|
|
|
goods.setAttributeCategory(categoryDao.queryObject(goods.getCategoryId()).getParentId());
|
|
|
goods.setIsDelete(0);
|
|
|
goods.setIsNew(0);
|