|
@@ -1,5 +1,6 @@
|
|
|
package com.kmall.admin.service.impl;
|
|
|
|
|
|
+import com.alibaba.druid.support.json.JSONUtils;
|
|
|
import com.google.common.collect.ImmutableBiMap;
|
|
|
import com.google.common.collect.Maps;
|
|
|
import com.kmall.admin.dao.*;
|
|
@@ -13,6 +14,8 @@ import com.kmall.api.entity.exportpdf.PDFGoodsDto;
|
|
|
import com.kmall.common.constant.Dict;
|
|
|
import com.kmall.admin.fromcomm.entity.SysUserEntity;
|
|
|
import com.kmall.common.utils.*;
|
|
|
+import com.kmall.common.utils.print.ticket.item.Goods;
|
|
|
+import org.apache.poi.util.StringUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -949,40 +952,40 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
if(failMerchUserGoodsSnList != null && failMerchUserGoodsSnList.size() > 0){
|
|
|
exportExceptionDataEntity.setExportExceptionData("不能操作除了登录用户以外商户的商品,当前商户编号为【"+merchSn+"】,请检查商品编码【"+failMerchUserGoodsSnList+"】的商品信息");
|
|
|
exportExceptionDataDao.save(exportExceptionDataEntity);
|
|
|
- throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
|
|
|
+ return 0;
|
|
|
}
|
|
|
if(failMerchGoodsSnList != null && failMerchGoodsSnList.size() > 0){
|
|
|
exportExceptionDataEntity.setExportExceptionData("第三方商户代码不存在,请在商城配置》第三方商户管理中维护,请检查商品编码【"+failMerchGoodsSnList+"】的商品信息,请先维护再继续操作!");
|
|
|
exportExceptionDataDao.save(exportExceptionDataEntity);
|
|
|
- throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
|
|
|
+ return 0;
|
|
|
}
|
|
|
if(failGoodsSnList != null && failGoodsSnList.size() > 0){
|
|
|
if(failSameSkuList.size()>0) {
|
|
|
exportExceptionDataEntity.setExportExceptionData("不能有重复的商品编码、sku信息!请检查商品编码【" + failGoodsSnList + "】,业务类型【" +
|
|
|
failGoodsTypeList + "】,SKU【" + failSameSkuList + "】的商品信息");
|
|
|
exportExceptionDataDao.save(exportExceptionDataEntity);
|
|
|
- throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
|
|
|
+ return 0;
|
|
|
}else{
|
|
|
exportExceptionDataEntity.setExportExceptionData("不能有重复的商品编码、sku信息!请检查商品编码【" + failGoodsSnList + "】,业务类型【" +
|
|
|
failGoodsTypeList + "】的商品信息");
|
|
|
exportExceptionDataDao.save(exportExceptionDataEntity);
|
|
|
- throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
|
|
|
+ return 0;
|
|
|
}
|
|
|
}
|
|
|
if(failTypeGoodsSnList != null && failTypeGoodsSnList.size() > 0){
|
|
|
exportExceptionDataEntity.setExportExceptionData("货品业务类型只能是【00保税备货、02保税补货、10保税展示】!请检查商品编码【"+failTypeGoodsSnList+"】的商品信息");
|
|
|
exportExceptionDataDao.save(exportExceptionDataEntity);
|
|
|
- throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
|
|
|
+ return 0;
|
|
|
}
|
|
|
if(failProdbarGoodsSnList != null && failProdbarGoodsSnList.size() > 0){
|
|
|
exportExceptionDataEntity.setExportExceptionData("不能有重复的产品条码信息!请检查商品编码【"+failProdbarGoodsSnList+"】的商品产品条码信息");
|
|
|
exportExceptionDataDao.save(exportExceptionDataEntity);
|
|
|
- throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
|
|
|
+ return 0;
|
|
|
}
|
|
|
if(failHotGoodsSnList != null && failHotGoodsSnList.size() > 0){
|
|
|
exportExceptionDataEntity.setExportExceptionData("请检查业务类型为【保税补货或保税展示】的商品,商品编码【"+failHotGoodsSnList+"】的商品不能设置为热销!");
|
|
|
exportExceptionDataDao.save(exportExceptionDataEntity);
|
|
|
- throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
|
|
|
+ return 0;
|
|
|
}
|
|
|
// if(failCateGoodsSnList != null && failCateGoodsSnList.size() > 0){
|
|
|
// exportExceptionDataEntity.setExportExceptionData("分类信息请在商城配置》商品分类中维护,商品分类与商户信息对应,请检查该商品商户信息下的分类是否维护,不存在的商品编码【"+failCateGoodsSnList+"】");
|
|
@@ -1007,17 +1010,17 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
if(failSuppGoodsSnList != null && failSuppGoodsSnList.size() > 0){
|
|
|
exportExceptionDataEntity.setExportExceptionData("供应商信息请在商城配置》商品供应商中维护,供应商与商户信息对应,请检查该商品商户信息下的供应商是否维护,不存在的商品编码【" + failSuppGoodsSnList + "】");
|
|
|
exportExceptionDataDao.save(exportExceptionDataEntity);
|
|
|
- throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
|
|
|
+ return 0;
|
|
|
}
|
|
|
if(failUnitGoodsSnList != null && failUnitGoodsSnList.size() > 0){
|
|
|
exportExceptionDataEntity.setExportExceptionData("计算单位信息请在商城配置》计算单位中维护,不存在的商品编码【" + failUnitGoodsSnList + "】");
|
|
|
exportExceptionDataDao.save(exportExceptionDataEntity);
|
|
|
- throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
|
|
|
+ return 0;
|
|
|
}
|
|
|
if(failNationGoodsSnList != null && failNationGoodsSnList.size() > 0){
|
|
|
exportExceptionDataEntity.setExportExceptionData("原产国信息请在商城配置》原产国中维护,不存在的商品编码【" + failNationGoodsSnList + "】");
|
|
|
exportExceptionDataDao.save(exportExceptionDataEntity);
|
|
|
- throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
|
|
|
+ return 0;
|
|
|
}
|
|
|
}else{
|
|
|
throw new RRException("导入数据为空,或者检查商品编码数据是否为空");
|