|
@@ -136,7 +136,7 @@ public class GoodsSellerModel {
|
|
|
* @param insertDTO 商品信息
|
|
|
*/
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public void saveGoods(Vendor vendor, GoodsPublishInsertDTO insertDTO) {
|
|
|
+ public Goods saveGoods(Vendor vendor, GoodsPublishInsertDTO insertDTO) {
|
|
|
List<GoodsPublishFrontParamDTO.ProductInfo> productList = insertDTO.getProductList();//货品列表
|
|
|
//-校验sku是否重复
|
|
|
this.checkSku(productList,insertDTO.getWebSite());
|
|
@@ -159,9 +159,6 @@ public class GoodsSellerModel {
|
|
|
//-保存商品图片表
|
|
|
this.insertGoodsPicture(insertDTO.getSpecInfoList(), insertDTO.getImageList(), goods, vendor);
|
|
|
|
|
|
- //三方产品创建/更新
|
|
|
- productModel.upsertProduct(goods, vendor);
|
|
|
-
|
|
|
//-保存新的商品附件表(goods_annex) insertDTO.getGoodsAnnexList()拿到前台的获取到的附件名称/附件路径的list
|
|
|
this.insertGoodsAnnex(insertDTO.getGoodsAnnexList(),goods,vendor);
|
|
|
|
|
@@ -173,6 +170,8 @@ public class GoodsSellerModel {
|
|
|
|
|
|
//-增加店铺商品数量(商品状态为上架时操作)
|
|
|
this.addStoreGoodsNum(vendor.getStoreId(), goods.getState());
|
|
|
+
|
|
|
+ return goods;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -607,7 +606,7 @@ public class GoodsSellerModel {
|
|
|
* @param goodsDb
|
|
|
*/
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public void editGoods(Vendor vendor, GoodsPublishInsertDTO insertDTO, Goods goodsDb) {
|
|
|
+ public Goods editGoods(Vendor vendor, GoodsPublishInsertDTO insertDTO, Goods goodsDb) {
|
|
|
List<GoodsPublishFrontParamDTO.ProductInfo> productList = insertDTO.getProductList();//前端传来的货品列表
|
|
|
List<GoodsPublishInsertDTO.ProductInsertInfo> addProductList = new ArrayList<>();//要新增的货品
|
|
|
List<GoodsPublishInsertDTO.ProductInsertInfo> updateProductList = new ArrayList<>();//要删除的货品
|
|
@@ -642,8 +641,6 @@ public class GoodsSellerModel {
|
|
|
this.updateGoodsAnnex(insertDTO.getGoodsAnnexList(),updateGoods,vendor);
|
|
|
// }
|
|
|
|
|
|
- productModel.upsertProduct(updateGoods, vendor);
|
|
|
-
|
|
|
//-保存商品绑定店铺内部分类表
|
|
|
this.updateGoodsBindStoreInnerLabels(insertDTO.getStoreInnerLabelList(), updateGoods.getGoodsId(), vendor);
|
|
|
|
|
@@ -657,6 +654,7 @@ public class GoodsSellerModel {
|
|
|
//原商品的状态为上架,删除商品缓存数据
|
|
|
objectRedisTemplate.opsForHash().delete(RedisConst.GOODS_DETAIL, String.valueOf(goodsDb.getGoodsId()));
|
|
|
}
|
|
|
+ return updateGoods;
|
|
|
}
|
|
|
|
|
|
/**
|