|
@@ -96,6 +96,7 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
public int save(GoodsEntity goods) {
|
|
|
Map<String, Object> valideDate = MapBeanUtil.fromObject(goods);
|
|
|
ImmutableBiMap.Builder builder = new ImmutableBiMap.Builder();
|
|
|
+ builder.put("merchSn", "商户");
|
|
|
builder.put("attributeCategory", "商品分类");
|
|
|
builder.put("categoryId", "商品二级分类");
|
|
|
builder.put("goodsSn", "商品编码");
|
|
@@ -178,6 +179,7 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
// 添加商品轮播图
|
|
|
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");//图片
|
|
@@ -185,6 +187,7 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
}
|
|
|
if(org.apache.commons.lang.StringUtils.isNotEmpty(goods.getVideoUrl())){
|
|
|
GoodsGalleryEntity galleryEntity = new GoodsGalleryEntity();
|
|
|
+ galleryEntity.setMerchSn(goods.getMerchSn());
|
|
|
galleryEntity.setGoodsId(id);
|
|
|
galleryEntity.setSortOrder(0);
|
|
|
galleryEntity.setFileType("1");//视频
|
|
@@ -198,6 +201,7 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
if (item.getIsDelete() == 0) {
|
|
|
if (item.getId() == null && item.getAttributeId() != null && StringUtils.isNotEmpty(item.getValue())) {
|
|
|
item.setGoodsId(id);
|
|
|
+ item.setMerchSn(goods.getMerchSn());
|
|
|
goodsAttributeDao.save(item);
|
|
|
} else if (item.getId() == null && item.getAttributeId() != null && StringUtils.isNullOrEmpty(item.getValue())) {
|
|
|
throw new RRException("商品属性【" + attributeDao.queryObject(item.getAttributeId()).getName() + "】值不能为空!");
|
|
@@ -233,6 +237,7 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
public int update(GoodsEntity goods) {
|
|
|
Map<String, Object> valideDate = MapBeanUtil.fromObject(goods);
|
|
|
ImmutableBiMap.Builder builder = new ImmutableBiMap.Builder();
|
|
|
+ builder.put("merchSn", "商户");
|
|
|
builder.put("attributeCategory", "商品分类");
|
|
|
builder.put("categoryId", "商品二级分类");
|
|
|
builder.put("goodsSn", "商品编码");
|
|
@@ -325,6 +330,7 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
goodsGalleryDao.deleteByGoodsId(goods.getId());
|
|
|
for (int i=0;i<galleryEntityList.size();i++) {
|
|
|
GoodsGalleryEntity galleryEntity =galleryEntityList.get(i);
|
|
|
+ galleryEntity.setMerchSn(goods.getMerchSn());
|
|
|
galleryEntity.setGoodsId(goods.getId());
|
|
|
galleryEntity.setSortOrder((i+1));
|
|
|
galleryEntity.setFileType("0");//图片
|
|
@@ -332,6 +338,7 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
}
|
|
|
if(org.apache.commons.lang.StringUtils.isNotEmpty(goods.getVideoUrl())){
|
|
|
GoodsGalleryEntity galleryEntity = new GoodsGalleryEntity();
|
|
|
+ galleryEntity.setMerchSn(goods.getMerchSn());
|
|
|
galleryEntity.setGoodsId(goods.getId());
|
|
|
galleryEntity.setSortOrder(0);
|
|
|
galleryEntity.setFileType("1");//视频
|
|
@@ -346,9 +353,11 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
for (GoodsAttributeEntity item : attributeEntityList) {
|
|
|
if (item.getIsDelete() == 0) {
|
|
|
if (item.getId() != null) {
|
|
|
- goodsAttributeDao.update(item);
|
|
|
+ item.setMerchSn(goods.getMerchSn());
|
|
|
+ goodsAttributeDao.update(item);
|
|
|
} else if (item.getId() == null && item.getAttributeId() != null && StringUtils.isNotEmpty(item.getValue())) {
|
|
|
item.setGoodsId(goods.getId());
|
|
|
+ item.setMerchSn(goods.getMerchSn());
|
|
|
goodsAttributeDao.save(item);
|
|
|
} else if (item.getId() == null && item.getAttributeId() != null && StringUtils.isNullOrEmpty(item.getValue())) {
|
|
|
throw new RRException("商品属性【" + attributeDao.queryObject(item.getAttributeId()).getName() + "】值不能为空!");
|