|
@@ -155,10 +155,10 @@ public class ProductStoreRelaServiceImpl implements ProductStoreRelaService {
|
|
|
if(!StringUtils.isNotEmpty(goodsEntity.getPrimaryPicUrl())){
|
|
|
throw new RRException("该商品主图不能为空!请先在商品管理》所有商品中维护商品编号为【"+goodsEntity.getGoodsSn()+"】的商品主图信息,再来操作门店商品数据");
|
|
|
}
|
|
|
- List<GoodsGalleryEntity> galleryEntityList = goodsGalleryDao.queryObjectByGoodId(goodsEntity.getId());
|
|
|
- if (galleryEntityList == null || galleryEntityList.size() <= 0) {
|
|
|
- throw new RRException("该商品轮播图不能为空!请先在商品管理》所有商品中维护商品编号为【"+goodsEntity.getGoodsSn()+"】的商品详情轮播图信息,再来操作门店商品数据");
|
|
|
- }
|
|
|
+// List<GoodsGalleryEntity> galleryEntityList = goodsGalleryDao.queryObjectByGoodId(goodsEntity.getId());
|
|
|
+// if (galleryEntityList == null || galleryEntityList.size() <= 0) {
|
|
|
+// throw new RRException("该商品轮播图不能为空!请先在商品管理》所有商品中维护商品编号为【"+goodsEntity.getGoodsSn()+"】的商品详情轮播图信息,再来操作门店商品数据");
|
|
|
+// }
|
|
|
}
|
|
|
if (productStoreRela.getStoreId() != null) {
|
|
|
StoreEntity store = storeDao.queryObject(productStoreRela.getStoreId().intValue());
|
|
@@ -850,19 +850,20 @@ public class ProductStoreRelaServiceImpl implements ProductStoreRelaService {
|
|
|
}else{
|
|
|
throw new RRException("商品[" + storeGoodsDto.getGoodsSn() + "]未录入系统");
|
|
|
}
|
|
|
- CategoryEntity categoryEntity = categoryDao.queryObjectByName(storeGoodsDto.getAttributeCategory(), store.getMerchSn());
|
|
|
- if (categoryEntity != null) {
|
|
|
- storeRelaEntity.setAttributeCategory(categoryEntity.getId());
|
|
|
- }else{
|
|
|
- throw new RRException("商品[" + storeGoodsDto.getGoodsSn() + "]的二级类别输入有误");
|
|
|
- }
|
|
|
- CategoryEntity parentCategoryEntity = categoryDao.queryObjectByName(storeGoodsDto.getCategoryName(), store.getMerchSn());
|
|
|
- if (parentCategoryEntity != null && categoryEntity.getParentId().intValue()==parentCategoryEntity.getId().intValue()) {
|
|
|
+ CategoryEntity parentCategoryEntity = categoryDao.queryObjectByName(storeGoodsDto.getCategoryName(), store.getMerchSn(),0);
|
|
|
+ if (parentCategoryEntity != null) {
|
|
|
storeRelaEntity.setCategoryId(parentCategoryEntity.getId());
|
|
|
+ CategoryEntity categoryEntity = categoryDao.queryObjectByName(storeGoodsDto.getAttributeCategory(), store.getMerchSn(),parentCategoryEntity.getId());
|
|
|
+ if (categoryEntity != null) {
|
|
|
+ storeRelaEntity.setAttributeCategory(categoryEntity.getId());
|
|
|
+ }else{
|
|
|
+ throw new RRException("商品[" + storeGoodsDto.getGoodsSn() + "]的二级类别输入有误");
|
|
|
+ }
|
|
|
}else{
|
|
|
throw new RRException("商品[" + storeGoodsDto.getGoodsSn() + "]的一级类别输入有误");
|
|
|
}
|
|
|
- BrandEntity brandEntity = brandDao.queryObjectByName(storeGoodsDto.getBrandName(), store.getMerchSn());
|
|
|
+
|
|
|
+ BrandEntity brandEntity = brandDao.queryObjectByName(storeGoodsDto.getBrandName(), store.getMerchSn(),storeRelaEntity.getAttributeCategory());
|
|
|
if (brandEntity != null) {
|
|
|
storeRelaEntity.setBrandId(brandEntity.getId());
|
|
|
}else{
|