Explorar o código

调整修改物料的接口

yujia %!s(int64=7) %!d(string=hai) anos
pai
achega
570ac853f7

+ 1 - 0
src/main/java/com/uas/platform/b2c/external/erp/prod/service/impl/ProdServiceImpl.java

@@ -117,6 +117,7 @@ public class ProdServiceImpl implements ProdService {
             if (null == productPrivate) {
                 productPrivate = new ProductPrivate();
                 productPrivate.setPrId(prod.getPr_id());
+                productPrivate.setBatchCount(IntegerConstant.NO_SHORT);
             }
             productPrivate.setB2cEnabled(IntegerConstant.YES_SHORT);
             // 统计现在有多少在售信息

+ 15 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/model/V_ProductPrivate.java

@@ -290,6 +290,12 @@ public class V_ProductPrivate implements Serializable {
     @Column(name = "pr_erpdown")
     private String erpDown;
 
+    /**
+     * 规格书
+     */
+    @Column(name = "pr_attach")
+    private String attach;
+
     @Transient
     private ProductAttachSubmit productAttachSubmit;
 
@@ -638,4 +644,13 @@ public class V_ProductPrivate implements Serializable {
         this.productAttachSubmit = productAttachSubmit;
         return this;
     }
+
+    public String getAttach() {
+        return attach;
+    }
+
+    public V_ProductPrivate setAttach(String attach) {
+        this.attach = attach;
+        return this;
+    }
 }

+ 4 - 3
src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/GoodsServiceImpl.java

@@ -1353,6 +1353,7 @@ public class GoodsServiceImpl implements GoodsService {
      * @TODO 各种检查
      * @MustBeDoneBefore 2016年4月25日11:54:00
      */
+    @Transactional
     @Override
     public ResultMap updateGoods(Goods goods) {
         Goods resultGoods = null;
@@ -1376,7 +1377,7 @@ public class GoodsServiceImpl implements GoodsService {
         }
         ResultMap resultMap = compareGoodsIfModifyProductInfo(goods, nowGoods);
         if (resultMap.getCode() == CodeType.OK.code()) {
-            em.refresh(nowGoods);
+            nowGoods = goodsDao.findByBatchCode(nowGoods.getBatchCode());
         } else if (resultMap.getCode() != CodeType.OK.code()) {
             return resultMap;
         }
@@ -1415,7 +1416,7 @@ public class GoodsServiceImpl implements GoodsService {
                 Product product = new Product();
                 product.setPbranden(goodsFromFore.getBrandNameEn());
                 product.setPcmpcode(goodsFromFore.getCode());
-                product.setId(goodsFromFore.getId());
+                product.setId(goodsFromFore.getProductid());
                 product.setKind(goodsFromFore.getKindNameCn());
                 product.setSpec(goodsFromFore.getSpec());
                 ResultMap resultMap = productService.updateProduct(FlexJsonUtils.toJson(product), null);
@@ -1863,7 +1864,7 @@ public class GoodsServiceImpl implements GoodsService {
 			uuids.add(nowGoods.getBatchCode());
 			recommendProductService.deleteProductsWhenSellerUpdateReserve(storeuuid, uuids);
 		} else {
-            recommendProductService.updateRecommendProductInfo(nowGoods);
+            // recommendProductService.updateRecommendProductInfo(nowGoods);
         }
 		return nowGoods;
 	}

+ 6 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ProductServiceImpl.java

@@ -1976,6 +1976,7 @@ public class ProductServiceImpl implements ProductService {
                         } else {
                             //直接保存
                             Product product1 = productDao.save(persistProduct);
+                            goodsService.updateGoodsByProduct(product1);
                             return ResultMap.success(product1);
                         }
                     }
@@ -2101,6 +2102,7 @@ public class ProductServiceImpl implements ProductService {
         product.setCmpCode(component.getCode());
         product.setCmpImg(component.getImg());
         product.setCmpUuId(component.getUuid());
+        product.setStandard(IntegerConstant.YES_SHORT);
         if (!StringUtils.isEmpty(component.getAttach())) {
             List<ProductPrivate> privates = productPrivateDao.findByPrId(product.getId());
             if (CollectionUtils.isNotEmpty(privates)) {
@@ -2111,6 +2113,8 @@ public class ProductServiceImpl implements ProductService {
                 ProductPrivate productPrivate = new ProductPrivate();
                 productPrivate.setAttach(component.getAttach());
                 productPrivate.setPrId(product.getId());
+                productPrivate.setB2cEnabled(IntegerConstant.YES_SHORT);
+                productPrivate.setBatchCount(IntegerConstant.NO_SHORT);
                 productPrivateDao.save(productPrivate);
             }
         }
@@ -2146,6 +2150,8 @@ public class ProductServiceImpl implements ProductService {
                             ProductPrivate productPrivate = new ProductPrivate();
                             productPrivate.setAttach(component.getAttach());
                             productPrivate.setPrId(product.getId());
+                            productPrivate.setB2cEnabled(IntegerConstant.YES_SHORT);
+                            productPrivate.setBatchCount(IntegerConstant.NO_SHORT);
                             productPrivatelist.add(productPrivate);
                         }
                     }