|
@@ -193,8 +193,8 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
builder.put("goodsDesc", "商品描述");
|
|
|
builder.put("isOnSale", "上架");
|
|
|
builder.put("isHot", "热销");
|
|
|
- builder.put("englishName", "商品英文名称");
|
|
|
- builder.put("plu", "PLU");
|
|
|
+ //builder.put("englishName", "商品英文名称");
|
|
|
+// builder.put("plu", "PLU");
|
|
|
|
|
|
|
|
|
R r = ValidatorUtil.isEmpty(builder.build(), valideDate);
|
|
@@ -206,13 +206,13 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
builder.put("sku", "SKU");
|
|
|
builder.put("goodsRate", "商品税率");
|
|
|
// builder.put("retailPrice", "零售价");
|
|
|
- builder.put("brand", "产品品牌");
|
|
|
+// builder.put("brand", "产品品牌");
|
|
|
builder.put("unitCode", "计量单位代码");
|
|
|
- builder.put("cusGoodsCode", "海关商品编码");
|
|
|
- builder.put("ciqProdModel", "国检规格型号");
|
|
|
+ //builder.put("cusGoodsCode", "海关商品编码");
|
|
|
+// builder.put("ciqProdModel", "国检规格型号");
|
|
|
builder.put("oriCntCode", "原产国代码");
|
|
|
- builder.put("cusDeclEle", "海关申报要素");
|
|
|
- builder.put("cusRecCode", "海关备案编号");
|
|
|
+// builder.put("cusDeclEle", "海关申报要素");
|
|
|
+ //builder.put("cusRecCode", "海关备案编号");
|
|
|
}
|
|
|
r = ValidatorUtil.isEmpty(builder.build(), valideDate);
|
|
|
if (Integer.valueOf(r.get("code").toString()) != 0) {
|
|
@@ -234,10 +234,10 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
throw new RRException(r.get("msg").toString());
|
|
|
}
|
|
|
// 商品轮播图
|
|
|
- List<GoodsGalleryEntity> galleryEntityList = goods.getGoodsImgList();
|
|
|
- if (galleryEntityList == null || galleryEntityList.size() <= 0) {
|
|
|
- throw new RRException("至少添加一张商品轮播图!");
|
|
|
- }
|
|
|
+// List<GoodsGalleryEntity> galleryEntityList = goods.getGoodsImgList();
|
|
|
+// if (galleryEntityList == null || galleryEntityList.size() <= 0) {
|
|
|
+// throw new RRException("至少添加一张商品轮播图!");
|
|
|
+// }
|
|
|
// List<GoodsEntity> prodbarGoodsList = goodsDao.queryObjectByProdBarcode(goods.getProdBarcode(),goods.getMerchSn(),null);
|
|
|
// if(prodbarGoodsList != null && prodbarGoodsList.size() > 0){
|
|
|
// throw new RRException("不能有重复的产品条码信息!");
|
|
@@ -274,14 +274,14 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
Long id = goods.getId();
|
|
|
|
|
|
// 添加商品轮播图
|
|
|
- for (int i=0;i<galleryEntityList.size();i++) {
|
|
|
- GoodsGalleryEntity galleryEntity =galleryEntityList.get(i);
|
|
|
- galleryEntity.setMerchSn(goods.getMerchSn());
|
|
|
- galleryEntity.setGoodsId(id);
|
|
|
- galleryEntity.setSortOrder((i+1));
|
|
|
- galleryEntity.setFileType("0");//图片
|
|
|
- goodsGalleryDao.save(galleryEntity);
|
|
|
- }
|
|
|
+// for (int i=0;i<galleryEntityList.size();i++) {
|
|
|
+// GoodsGalleryEntity galleryEntity =galleryEntityList.get(i);
|
|
|
+// galleryEntity.setMerchSn(goods.getMerchSn());
|
|
|
+// galleryEntity.setGoodsId(id);
|
|
|
+// galleryEntity.setSortOrder((i+1));
|
|
|
+// galleryEntity.setFileType("0");//图片
|
|
|
+// goodsGalleryDao.save(galleryEntity);
|
|
|
+// }
|
|
|
if(org.apache.commons.lang.StringUtils.isNotEmpty(goods.getVideoUrl())){
|
|
|
GoodsGalleryEntity galleryEntity = new GoodsGalleryEntity();
|
|
|
galleryEntity.setMerchSn(goods.getMerchSn());
|
|
@@ -380,13 +380,13 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
builder.put("sku", "SKU");
|
|
|
builder.put("goodsRate", "商品税率");
|
|
|
// builder.put("retailPrice", "零售价");
|
|
|
- builder.put("brand", "产品品牌");
|
|
|
+// builder.put("brand", "产品品牌");
|
|
|
builder.put("unitCode", "计量单位代码");
|
|
|
- builder.put("cusGoodsCode", "海关商品编码");
|
|
|
- builder.put("ciqProdModel", "国检规格型号");
|
|
|
+ //builder.put("cusGoodsCode", "海关商品编码");
|
|
|
+ //builder.put("ciqProdModel", "国检规格型号");
|
|
|
builder.put("oriCntCode", "原产国代码");
|
|
|
- builder.put("cusRecCode", "海关备案编号");
|
|
|
- builder.put("cusDeclEle", "海关申报要素");
|
|
|
+ //builder.put("cusRecCode", "海关备案编号");
|
|
|
+ //builder.put("cusDeclEle", "海关申报要素");
|
|
|
}
|
|
|
r = ValidatorUtil.isEmpty(builder.build(), valideDate);
|
|
|
if (Integer.valueOf(r.get("code").toString()) != 0) {
|
|
@@ -776,32 +776,23 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
SysUserEntity user = ShiroUtils.getUserEntity();
|
|
|
String merchSn = user.getMerchSn();
|
|
|
boolean isFail = false;
|
|
|
- List<String> failSameSkuList = new ArrayList<>(), failHotGoodsSnList = new ArrayList<>(),
|
|
|
-// failSuppGoodsSnList = new ArrayList<>(),
|
|
|
- failUnitGoodsSnList = new ArrayList<>(), failNationGoodsSnList = new ArrayList<>(),
|
|
|
-// failProdbarGoodsSnList = new ArrayList<>(),
|
|
|
- failTypeGoodsSnList = new ArrayList<>(), failMerchGoodsSnList = new ArrayList<>(),
|
|
|
-// failCateL2GoodsSnList = new ArrayList<>(),
|
|
|
-// failCateGoodsSnList = new ArrayList<>(),
|
|
|
-// failBrandGoodsSnList = new ArrayList<>(),
|
|
|
-// failFreightGoodsSnList = new ArrayList<>(),
|
|
|
+ List<String> failSameSkuList = new ArrayList<>(),
|
|
|
+ failUnitGoodsSnList = new ArrayList<>(),
|
|
|
+ failNationGoodsSnList = new ArrayList<>(),
|
|
|
+ failTypeGoodsSnList = new ArrayList<>(),
|
|
|
+ failMerchGoodsSnList = new ArrayList<>(),
|
|
|
+
|
|
|
failMerchUserGoodsSnList = new ArrayList<>();
|
|
|
List<String> failGoodsSnList = new ArrayList<>();
|
|
|
List<String> failGoodsTypeList = new ArrayList<>();
|
|
|
-// List<String> failFreightList = new ArrayList<>();
|
|
|
-
|
|
|
|
|
|
// 定义需要批量插入的list
|
|
|
- List<ProductEntity> insertProductList = new LinkedList<>();
|
|
|
- List<GoodsSpecificationEntity> insertSpecificationList = new LinkedList<>();
|
|
|
List<MngChangeEntity> insertMngChangeList = new LinkedList<>();
|
|
|
List<GoodsEntity> insertGoodsList = new LinkedList<>();
|
|
|
- List<SupplierEntity> insertSupplierList = new LinkedList<>();
|
|
|
|
|
|
// 定义需要批量修改的list
|
|
|
List<ProductEntity> updateProductList = new LinkedList<>();
|
|
|
List<GoodsSpecificationEntity> updateSpecificationList = new LinkedList<>();
|
|
|
- List<GoodsEntity> updateGoodsList = new LinkedList<>();
|
|
|
|
|
|
if (goodsEntityList != null && goodsEntityList.size() > 0) {
|
|
|
for (int i = 0; i < goodsEntityList.size(); i++) {
|
|
@@ -811,11 +802,8 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
ImmutableBiMap.Builder builder = new ImmutableBiMap.Builder();
|
|
|
builder.put("goodsSn", "商品编码");
|
|
|
builder.put("thirdPartyMerchCode", "第三方商户代码");
|
|
|
-// builder.put("categoryName", "商品分类");
|
|
|
builder.put("goodsBizType", "货品业务类型");
|
|
|
builder.put("name", "商品名称");
|
|
|
-// builder.put("brandName", "商品品牌名称");
|
|
|
-// builder.put("defaultFreight", "运费");
|
|
|
builder.put("isOnSaleStr", "上架");
|
|
|
builder.put("goodsUnit", "商品单位");
|
|
|
builder.put("isHotStr", "热销");
|
|
@@ -832,13 +820,13 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
// 海关信息,普通货物可不添加
|
|
|
builder.put("goodsRate", "商品税率");
|
|
|
builder.put("sku", "SKU");
|
|
|
- builder.put("brand", "产品品牌");
|
|
|
+// builder.put("brand", "产品品牌");
|
|
|
builder.put("unitName", "计量单位");
|
|
|
builder.put("oriCntName", "原产国");
|
|
|
- builder.put("cusGoodsCode", "海关商品编码");
|
|
|
- builder.put("ciqProdModel", "国检规格型号");
|
|
|
- builder.put("cusDeclEle", "海关申报要素");
|
|
|
- builder.put("cusRecCode", "海关备案编号");
|
|
|
+ //builder.put("cusGoodsCode", "海关商品编码");
|
|
|
+ //builder.put("ciqProdModel", "国检规格型号");
|
|
|
+ //builder.put("cusDeclEle", "海关申报要素");
|
|
|
+ //builder.put("cusRecCode", "海关备案编号");
|
|
|
}
|
|
|
r = ValidatorUtil.isEmpty(builder.build(), valideDate);
|
|
|
if (Integer.valueOf(r.get("code").toString()) != 0) {
|
|
@@ -878,7 +866,6 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
map.put("goodsBizType", goodsDto.getGoodsBizType());
|
|
|
List<GoodsEntity> list = querySame(map);
|
|
|
if (list != null && list.size() != 0) {
|
|
|
-// isFail = true;
|
|
|
if(goodsDto.getSku()!=null) {
|
|
|
failSameSkuList.add(goodsDto.getSku());
|
|
|
}
|
|
@@ -886,23 +873,11 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
failGoodsTypeList.add(goodsDto.getGoodsBizType());
|
|
|
}
|
|
|
goodsEntity.setProdBarcode(goodsDto.getProdBarcode());
|
|
|
- //热销商品校验
|
|
|
- if (Dict.orderBizType.item_02.getItem().equals(goodsDto.getGoodsBizType())
|
|
|
- || Dict.orderBizType.item_10.getItem().equals(goodsDto.getGoodsBizType())) {
|
|
|
- if(goodsDto.getIsHotStr().equalsIgnoreCase("1")){
|
|
|
- isFail = true;
|
|
|
- failHotGoodsSnList.add(goodsDto.getGoodsSn());
|
|
|
- }
|
|
|
- }
|
|
|
if(thirdMerchantBizEntity != null) {
|
|
|
SupplierEntity supplierEntity = supplierDao.queryObjectByName(goodsDto.getSupplierName(), thirdMerchantBizEntity.getMerchSn(),thirdMerchantBizEntity.getThirdPartyMerchCode());
|
|
|
if (supplierEntity == null) {
|
|
|
//导入没有查到供货商,执行新增
|
|
|
MerchEntity merchEntity = merchDao.findByMerchSn(thirdMerchantBizEntity.getMerchSn());
|
|
|
-// if(null == merchEntity || !StringUtils.isNotEmpty(goodsDto.getSupplierFlag())){
|
|
|
-// isFail = true;
|
|
|
-// failSuppGoodsSnList.add(goodsDto.getGoodsSn());
|
|
|
-// }
|
|
|
|
|
|
supplierEntity = new SupplierEntity();
|
|
|
supplierEntity.setLevelMerchSn(merchEntity.getMerchSn());
|
|
@@ -913,10 +888,8 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
supplierEntity.setIsShow("0");
|
|
|
|
|
|
// TODO 这里改成批量插入 SupplierEntity
|
|
|
-// insertSupplierList.add(supplierEntity);
|
|
|
//新增商品供货信息
|
|
|
supplierDao.save(supplierEntity);
|
|
|
-// supplierEntity = supplierDao.queryObjectByName(goodsDto.getSupplierName(), thirdMerchantBizEntity.getMerchSn(),thirdMerchantBizEntity.getThirdPartyMerchCode());
|
|
|
goodsEntity.setSupplierId(supplierEntity.getId());
|
|
|
} else {
|
|
|
goodsEntity.setSupplierId(supplierEntity.getId());
|
|
@@ -928,12 +901,9 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
*/
|
|
|
// 获取品牌唯一简码
|
|
|
checkBrand(goodsDto, goodsEntity);
|
|
|
-
|
|
|
-
|
|
|
// 获取二级分类id
|
|
|
checkCategory(goodsDto, goodsEntity);
|
|
|
|
|
|
-
|
|
|
if (!Dict.orderBizType.item_11.getItem().equals(goodsDto.getGoodsBizType())) {
|
|
|
SysCusUnitCodeEntity sysCusUnitCodeEntity = sysCusUnitCodeDao.queryObjectByName(goodsDto.getUnitName());
|
|
|
if (sysCusUnitCodeEntity == null) {
|
|
@@ -962,8 +932,6 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
|
|
|
goodsEntity.setIsOnSale(Integer.parseInt(goodsDto.getIsOnSaleStr()));
|
|
|
goodsEntity.setIsHot(Integer.parseInt(goodsDto.getIsHotStr()));
|
|
|
-// goodsEntity.setRetailPrice(BigDecimal.valueOf(Integer.valueOf(goodsDto.getRetailPrice())));
|
|
|
-// goodsEntity.setMarketPrice(BigDecimal.valueOf(Integer.valueOf(goodsDto.getMarketPrice())));
|
|
|
goodsEntity.setGoodsSn(goodsDto.getGoodsSn());
|
|
|
goodsEntity.setSku(goodsDto.getSku());
|
|
|
goodsEntity.setName(goodsDto.getName());
|
|
@@ -982,12 +950,17 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
goodsEntity.setUpdateTime(new Date());
|
|
|
goodsEntity.setModTime(new Date());
|
|
|
goodsEntity.setGoodsNumber(Integer.parseInt(goodsDto.getGoodsNumber()));
|
|
|
- goodsEntity.setPlu(goodsDto.getPlu());
|
|
|
- goodsEntity.setMychemId(goodsDto.getMychemId());
|
|
|
+ //新加字段1208
|
|
|
+ goodsEntity.setWarehouseSn(goodsDto.getWarehouseSn());
|
|
|
+ goodsEntity.setConsignorSn(goodsDto.getConsignorSn());
|
|
|
+ goodsEntity.setWarehousSysGoodId(goodsDto.getWarehousSysGoodId());
|
|
|
+ goodsEntity.setConsignorSn(goodsDto.getConsignorSn());
|
|
|
+ goodsEntity.setInventoryType(goodsDto.getInventoryType());
|
|
|
+ goodsEntity.setDefectiveProductsGrade(goodsDto.getDefectiveProductsGrade());
|
|
|
+
|
|
|
|
|
|
if(!isFail){
|
|
|
GoodsEntity goods = goodsDao.queryObjectBySn(goodsDto.getGoodsSn());
|
|
|
-
|
|
|
MngChangeEntity mngChangeEntity = new MngChangeEntity();
|
|
|
mngChangeEntity.setThirdPartyMerchCode(goodsEntity.getThirdPartyMerchCode());
|
|
|
mngChangeEntity.setChangeReason("更新商户商品总库存");
|
|
@@ -998,6 +971,7 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
mngChangeEntity.setIsValid(0);
|
|
|
mngChangeEntity.setMerchSn(goodsEntity.getMerchSn());
|
|
|
|
|
|
+ //新增、修改商品表
|
|
|
if(goods!=null) {// 修改商品
|
|
|
mngChangeEntity.setOriginalNum(goods.getGoodsNumber());//原库存数
|
|
|
mngChangeEntity.setValidNum(goods.getGoodsNumber() + Integer.parseInt(goodsDto.getGoodsNumber()));//可用数
|
|
@@ -1009,7 +983,6 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
goodsEntity.setGoodsNumber(goods.getGoodsNumber()+Integer.parseInt(goodsDto.getGoodsNumber()));
|
|
|
|
|
|
// TODO 这里改成批量修改 GoodsEntity
|
|
|
-// updateGoodsList.add(goodsEntity);
|
|
|
goodsDao.update(goodsEntity);
|
|
|
}else{
|
|
|
mngChangeEntity.setOriginalNum(0);//原库存数
|
|
@@ -1022,23 +995,8 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
insertGoodsList.add(goodsEntity);
|
|
|
mngChangeEntity.setGoodsId(goodsEntity.getId().intValue());
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
// TODO 这里改成批量插入 MngChangeEntity
|
|
|
-
|
|
|
-// mngChangeDao.save(mngChangeEntity);
|
|
|
insertMngChangeList.add(mngChangeEntity);
|
|
|
-// // 保税商品修改各个门店商品价格
|
|
|
-// if (!Dict.orderBizType.item_11.getItem().equals(goodsDto.getGoodsBizType())) {
|
|
|
-// List<ProductStoreRelaEntity> productStoreRelaEntityList = productStoreRelaDao.queryByGoodsId(goodsDto.getId());
|
|
|
-// if (productStoreRelaEntityList != null && productStoreRelaEntityList.size() > 0) {
|
|
|
-// for (ProductStoreRelaEntity productStoreRela : productStoreRelaEntityList) {
|
|
|
-// productStoreRela.setMarketPrice(goodsEntity.getMarketPrice());
|
|
|
-// productStoreRela.setRetailPrice(goodsEntity.getRetailPrice());
|
|
|
-// productStoreRelaDao.update(productStoreRela);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
// 修改产品
|
|
|
ProductEntity product = productDao.queryObjectByGoodsIdAndStoreId(String.valueOf(goodsEntity.getId()), "");
|
|
|
|
|
@@ -1055,15 +1013,14 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
|
|
|
// TODO 这里改成批量插入 GoodsSpecificationEntity
|
|
|
goodsSpecificationDao.save(goodsSpecification);
|
|
|
-// insertSpecificationList.add(goodsSpecification);
|
|
|
- }else {
|
|
|
- goodsSpecification.setValue(goodsDto.getCiqProdModel());
|
|
|
- goodsSpecification.setId(specificationEntity.getId());
|
|
|
-
|
|
|
- // TODO 这里改成批量更新 GoodsSpecificationEntity
|
|
|
-// goodsSpecificationDao.update(goodsSpecification);
|
|
|
- updateSpecificationList.add(goodsSpecification);
|
|
|
}
|
|
|
+ // {
|
|
|
+// goodsSpecification.setValue(goodsDto.getCiqProdModel());
|
|
|
+ goodsSpecification.setId(specificationEntity.getId());
|
|
|
+//
|
|
|
+// // TODO 这里改成批量更新 GoodsSpecificationEntity
|
|
|
+// updateSpecificationList.add(goodsSpecification);
|
|
|
+// }
|
|
|
if(product == null){
|
|
|
product = new ProductEntity();
|
|
|
product.setGoodsSn(goodsDto.getGoodsSn());
|
|
@@ -1072,38 +1029,18 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
product.setGoodsNumber(goodsEntity.getGoodsNumber());
|
|
|
product.setGoodsSpecificationNameValue(goodsSpecification.getValue());
|
|
|
product.setGoodsSpecificationIds(goodsSpecification.getId().toString());
|
|
|
-
|
|
|
// TODO 这里改成批量插入 ProductEntity
|
|
|
-// insertProductList.add(product);
|
|
|
productDao.save(product);
|
|
|
}else{
|
|
|
product.setGoodsSpecificationIds(goodsSpecification.getId().toString());
|
|
|
product.setGoodsSpecificationNameValue(goodsSpecification.getValue());
|
|
|
-
|
|
|
// TODO 这里改成批量更新 ProductEntity
|
|
|
updateProductList.add(product);
|
|
|
-// productDao.update(product);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // 批量插入数据
|
|
|
-// if(insertProductList != null && insertProductList.size() > 0) {
|
|
|
-// // 长度限制,如果大于50,就分多次插入
|
|
|
-// if(insertProductList.size() > 50){
|
|
|
-// List<List<ProductEntity>> partition = Lists.partition(insertProductList, 50);
|
|
|
-// for (List<ProductEntity> productEntities : partition) {
|
|
|
-// productDao.saveBatch(productEntities);
|
|
|
-// }
|
|
|
-// }else{
|
|
|
-// productDao.saveBatch(insertProductList);;
|
|
|
-//
|
|
|
-// }
|
|
|
-// }
|
|
|
-// if(insertSpecificationList != null && insertSpecificationList.size() > 0) {
|
|
|
-// goodsSpecificationDao.saveBatch(insertSpecificationList);
|
|
|
-// }
|
|
|
if(insertMngChangeList != null && insertMngChangeList.size() > 0 ){
|
|
|
if(insertMngChangeList.size() > 50){
|
|
|
List<List<MngChangeEntity>> partition = Lists.partition(insertMngChangeList, 50);
|
|
@@ -1115,21 +1052,8 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
|
|
|
}
|
|
|
}
|
|
|
-// if(insertGoodsList != null && insertGoodsList.size() > 0 ){
|
|
|
-// goodsDao.saveBatch(insertGoodsList);
|
|
|
-// }
|
|
|
-// if(insertSupplierList != null && insertSupplierList.size() > 0 ){
|
|
|
-// if(insertSupplierList.size() > 50){
|
|
|
-// List<List<SupplierEntity>> partition = Lists.partition(insertSupplierList, 50);
|
|
|
-// for (List<SupplierEntity> supplierEntities : partition) {
|
|
|
-// supplierDao.saveBatch(supplierEntities);
|
|
|
-// }
|
|
|
-// }else{
|
|
|
-// supplierDao.saveBatch(insertSupplierList);
|
|
|
-//
|
|
|
-// }
|
|
|
-// }
|
|
|
- // 批量更新数据
|
|
|
+
|
|
|
+ // 批量更新数据mall_product
|
|
|
if(updateProductList != null && updateProductList.size() > 0 ){
|
|
|
|
|
|
if(updateProductList.size() > 50){
|
|
@@ -1141,27 +1065,18 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
productDao.updateBatch(updateProductList);
|
|
|
}
|
|
|
}
|
|
|
+ // 批量更新数据mall_goods_specification 商品对应规格表值表
|
|
|
if(updateSpecificationList != null && updateSpecificationList.size() > 0 ){
|
|
|
if(updateSpecificationList.size() > 50){
|
|
|
List<List<GoodsSpecificationEntity>> partition = Lists.partition(updateSpecificationList, 50);
|
|
|
for (List<GoodsSpecificationEntity> goodsSpecificationEntities : partition) {
|
|
|
goodsSpecificationDao.updateBatch(goodsSpecificationEntities);
|
|
|
}
|
|
|
- }else{
|
|
|
- goodsSpecificationDao.updateBatch(updateSpecificationList);
|
|
|
}
|
|
|
- }
|
|
|
-// if(updateGoodsList != null && updateGoodsList.size() > 0 ){
|
|
|
-// if(updateGoodsList.size() > 50){
|
|
|
-// List<List<GoodsEntity>> partition = Lists.partition(updateGoodsList, 50);
|
|
|
-// for (List<GoodsEntity> goodsEntities : partition) {
|
|
|
-// goodsDao.updateBatch(goodsEntities);
|
|
|
-// }
|
|
|
-// }else{
|
|
|
-// goodsDao.updateBatch(updateGoodsList);
|
|
|
+// else{
|
|
|
+// goodsSpecificationDao.updateBatch(updateSpecificationList);
|
|
|
// }
|
|
|
-// }
|
|
|
-
|
|
|
+ }
|
|
|
|
|
|
|
|
|
ExportExceptionDataEntity exportExceptionDataEntity = new ExportExceptionDataEntity();
|
|
@@ -1192,11 +1107,11 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
goodsUtils.save(exportExceptionDataEntity);
|
|
|
throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
|
|
|
}
|
|
|
- if(failHotGoodsSnList != null && failHotGoodsSnList.size() > 0){
|
|
|
- exportExceptionDataEntity.setExportExceptionData("请检查业务类型为【保税补货或保税展示】的商品,商品编码【"+failHotGoodsSnList+"】的商品不能设置为热销!");
|
|
|
- goodsUtils.save(exportExceptionDataEntity);
|
|
|
- throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
|
|
|
- }
|
|
|
+// if(failHotGoodsSnList != null && failHotGoodsSnList.size() > 0){
|
|
|
+// exportExceptionDataEntity.setExportExceptionData("请检查业务类型为【保税补货或保税展示】的商品,商品编码【"+failHotGoodsSnList+"】的商品不能设置为热销!");
|
|
|
+// goodsUtils.save(exportExceptionDataEntity);
|
|
|
+// throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
|
|
|
+// }
|
|
|
|
|
|
if(failUnitGoodsSnList != null && failUnitGoodsSnList.size() > 0){
|
|
|
exportExceptionDataEntity.setExportExceptionData("计算单位信息请在商城配置》计算单位中维护,不存在的商品编码【" + failUnitGoodsSnList + "】");
|
|
@@ -1209,39 +1124,8 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- // 将插入的商品和更新的商品放到一个list中
|
|
|
- List<GoodsEntity> goodsEntities = new LinkedList<>();
|
|
|
- goodsEntities.addAll(insertGoodsList);
|
|
|
- goodsEntities.addAll(updateGoodsList);
|
|
|
-
|
|
|
- List<KtoEccsEntity> ktoEccsEntities = new LinkedList<>();
|
|
|
- if(goodsEntities.size() > 0){
|
|
|
- for (GoodsEntity goodsEntity : goodsEntities) {
|
|
|
- KtoEccsEntity ktoEccsEntity = new KtoEccsEntity();
|
|
|
- ktoEccsEntity.setRequestData(JSON.toJSONString(goodsEntity));
|
|
|
- ktoEccsEntity.setRequestType("01");
|
|
|
- ktoEccsEntity.setSendStatus("00");
|
|
|
- ktoEccsEntity.setCreaterSn(user.getUserId()+"");
|
|
|
- ktoEccsEntity.setCreateTime(new Date());
|
|
|
-
|
|
|
- ktoEccsEntities.add(ktoEccsEntity);
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- if(ktoEccsEntities.size() > 0){
|
|
|
- if(ktoEccsEntities.size() > 50){
|
|
|
- List<List<KtoEccsEntity>> partition = Lists.partition(ktoEccsEntities, 50);
|
|
|
- for (List<KtoEccsEntity> ktoEccs : partition) {
|
|
|
- ktoEccsService.saveBatch(ktoEccs);
|
|
|
- }
|
|
|
- }else{
|
|
|
- ktoEccsService.saveBatch(ktoEccsEntities);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
}else{
|
|
|
- throw new RRException("导入数据为空,或者检查商品编码数据是否为空");
|
|
|
+ throw new RRException("导入数据为出错,请检查数据是否按要求填写");
|
|
|
}
|
|
|
return 1;
|
|
|
}
|
|
@@ -1449,13 +1333,13 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
// 海关信息,普通货物可不添加
|
|
|
builder.put("goodsRate", "商品税率");
|
|
|
builder.put("sku", "SKU");
|
|
|
- builder.put("brand", "产品品牌");
|
|
|
+// builder.put("brand", "产品品牌");
|
|
|
builder.put("unitName", "计量单位");
|
|
|
builder.put("oriCntName", "原产国");
|
|
|
builder.put("cusGoodsCode", "海关商品编码");
|
|
|
- builder.put("ciqProdModel", "国检规格型号");
|
|
|
- builder.put("cusDeclEle", "海关申报要素");
|
|
|
- builder.put("cusRecCode", "海关备案编号");
|
|
|
+ //builder.put("ciqProdModel", "国检规格型号");
|
|
|
+// builder.put("cusDeclEle", "海关申报要素");
|
|
|
+ //builder.put("cusRecCode", "海关备案编号");
|
|
|
}
|
|
|
r = ValidatorUtil.isEmpty(builder.build(), valideDate);
|
|
|
if (Integer.valueOf(r.get("code").toString()) != 0) {
|