|
@@ -9,6 +9,7 @@ import com.kmall.admin.dto.GoodsDto;
|
|
|
import com.kmall.admin.dto.GoodsPanoramaDto;
|
|
|
import com.kmall.admin.entity.*;
|
|
|
import com.kmall.admin.service.GoodsService;
|
|
|
+import com.kmall.admin.utils.GoodsUtils;
|
|
|
import com.kmall.admin.utils.ShiroUtils;
|
|
|
import com.kmall.api.entity.exportpdf.PDFGoodsDto;
|
|
|
import com.kmall.common.constant.Dict;
|
|
@@ -66,6 +67,8 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
private MerchUserDao merchUserDao;
|
|
|
@Autowired
|
|
|
private StoreMngChangeDao storeMngChangeDao;
|
|
|
+ @Autowired
|
|
|
+ private GoodsUtils goodsUtils;
|
|
|
|
|
|
@Override
|
|
|
public GoodsEntity queryObject(Integer id) {
|
|
@@ -949,43 +952,44 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
}else{
|
|
|
exportExceptionDataEntity.setExportDataType(Dict.exportDataType.item_2.getItem());
|
|
|
}
|
|
|
+
|
|
|
if(failMerchUserGoodsSnList != null && failMerchUserGoodsSnList.size() > 0){
|
|
|
exportExceptionDataEntity.setExportExceptionData("不能操作除了登录用户以外商户的商品,当前商户编号为【"+merchSn+"】,请检查商品编码【"+failMerchUserGoodsSnList+"】的商品信息");
|
|
|
- exportExceptionDataDao.save(exportExceptionDataEntity);
|
|
|
- return 0;
|
|
|
+ goodsUtils.save(exportExceptionDataEntity);
|
|
|
+ throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
|
|
|
}
|
|
|
if(failMerchGoodsSnList != null && failMerchGoodsSnList.size() > 0){
|
|
|
exportExceptionDataEntity.setExportExceptionData("第三方商户代码不存在,请在商城配置》第三方商户管理中维护,请检查商品编码【"+failMerchGoodsSnList+"】的商品信息,请先维护再继续操作!");
|
|
|
- exportExceptionDataDao.save(exportExceptionDataEntity);
|
|
|
- return 0;
|
|
|
+ goodsUtils.save(exportExceptionDataEntity);
|
|
|
+ throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
|
|
|
}
|
|
|
if(failGoodsSnList != null && failGoodsSnList.size() > 0){
|
|
|
if(failSameSkuList.size()>0) {
|
|
|
exportExceptionDataEntity.setExportExceptionData("不能有重复的商品编码、sku信息!请检查商品编码【" + failGoodsSnList + "】,业务类型【" +
|
|
|
failGoodsTypeList + "】,SKU【" + failSameSkuList + "】的商品信息");
|
|
|
- exportExceptionDataDao.save(exportExceptionDataEntity);
|
|
|
- return 0;
|
|
|
+ goodsUtils.save(exportExceptionDataEntity);
|
|
|
+ throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
|
|
|
}else{
|
|
|
exportExceptionDataEntity.setExportExceptionData("不能有重复的商品编码、sku信息!请检查商品编码【" + failGoodsSnList + "】,业务类型【" +
|
|
|
failGoodsTypeList + "】的商品信息");
|
|
|
- exportExceptionDataDao.save(exportExceptionDataEntity);
|
|
|
- return 0;
|
|
|
+ goodsUtils.save(exportExceptionDataEntity);
|
|
|
+ throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
|
|
|
}
|
|
|
}
|
|
|
if(failTypeGoodsSnList != null && failTypeGoodsSnList.size() > 0){
|
|
|
exportExceptionDataEntity.setExportExceptionData("货品业务类型只能是【00保税备货、02保税补货、10保税展示】!请检查商品编码【"+failTypeGoodsSnList+"】的商品信息");
|
|
|
- exportExceptionDataDao.save(exportExceptionDataEntity);
|
|
|
- return 0;
|
|
|
+ goodsUtils.save(exportExceptionDataEntity);
|
|
|
+ throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
|
|
|
}
|
|
|
if(failProdbarGoodsSnList != null && failProdbarGoodsSnList.size() > 0){
|
|
|
exportExceptionDataEntity.setExportExceptionData("不能有重复的产品条码信息!请检查商品编码【"+failProdbarGoodsSnList+"】的商品产品条码信息");
|
|
|
- exportExceptionDataDao.save(exportExceptionDataEntity);
|
|
|
- return 0;
|
|
|
+ goodsUtils.save(exportExceptionDataEntity);
|
|
|
+ throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
|
|
|
}
|
|
|
if(failHotGoodsSnList != null && failHotGoodsSnList.size() > 0){
|
|
|
exportExceptionDataEntity.setExportExceptionData("请检查业务类型为【保税补货或保税展示】的商品,商品编码【"+failHotGoodsSnList+"】的商品不能设置为热销!");
|
|
|
- exportExceptionDataDao.save(exportExceptionDataEntity);
|
|
|
- return 0;
|
|
|
+ goodsUtils.save(exportExceptionDataEntity);
|
|
|
+ throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
|
|
|
}
|
|
|
// if(failCateGoodsSnList != null && failCateGoodsSnList.size() > 0){
|
|
|
// exportExceptionDataEntity.setExportExceptionData("分类信息请在商城配置》商品分类中维护,商品分类与商户信息对应,请检查该商品商户信息下的分类是否维护,不存在的商品编码【"+failCateGoodsSnList+"】");
|
|
@@ -1009,18 +1013,18 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
// }
|
|
|
if(failSuppGoodsSnList != null && failSuppGoodsSnList.size() > 0){
|
|
|
exportExceptionDataEntity.setExportExceptionData("供应商信息请在商城配置》商品供应商中维护,供应商与商户信息对应,请检查该商品商户信息下的供应商是否维护,不存在的商品编码【" + failSuppGoodsSnList + "】");
|
|
|
- exportExceptionDataDao.save(exportExceptionDataEntity);
|
|
|
- return 0;
|
|
|
+ goodsUtils.save(exportExceptionDataEntity);
|
|
|
+ throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
|
|
|
}
|
|
|
if(failUnitGoodsSnList != null && failUnitGoodsSnList.size() > 0){
|
|
|
exportExceptionDataEntity.setExportExceptionData("计算单位信息请在商城配置》计算单位中维护,不存在的商品编码【" + failUnitGoodsSnList + "】");
|
|
|
- exportExceptionDataDao.save(exportExceptionDataEntity);
|
|
|
- return 0;
|
|
|
+ goodsUtils.save(exportExceptionDataEntity);
|
|
|
+ throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
|
|
|
}
|
|
|
if(failNationGoodsSnList != null && failNationGoodsSnList.size() > 0){
|
|
|
exportExceptionDataEntity.setExportExceptionData("原产国信息请在商城配置》原产国中维护,不存在的商品编码【" + failNationGoodsSnList + "】");
|
|
|
- exportExceptionDataDao.save(exportExceptionDataEntity);
|
|
|
- return 0;
|
|
|
+ goodsUtils.save(exportExceptionDataEntity);
|
|
|
+ throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
|
|
|
}
|
|
|
}else{
|
|
|
throw new RRException("导入数据为空,或者检查商品编码数据是否为空");
|