Просмотр исходного кода

Merge remote-tracking branch 'origin/feature-material-wangcz' into feature-material-wangcz

shenjj 7 лет назад
Родитель
Сommit
470f7d9871

+ 9 - 4
src/main/java/com/uas/platform/b2c/prod/commodity/controller/ReleaseProductByBatchController.java

@@ -153,7 +153,8 @@ public class ReleaseProductByBatchController {
     @RequestMapping(value = "/batchRelease", method = RequestMethod.POST)
     public String batchRelease(String batch) {
         logger.log("批量上架模块", "批量发布指定批次:" + batch + "的上架内容");
-        String byBatch = releaseProductByBatchService.publishByBatch(batch, false);
+        // 第三个参数是默认忽略导入
+        String byBatch = releaseProductByBatchService.publishByBatch(batch, false, 1);
         return byBatch;
     }
 
@@ -166,7 +167,8 @@ public class ReleaseProductByBatchController {
     @RequestMapping(value = "/batchRelease/pcb", method = RequestMethod.POST)
     public String batchPCBRelease(String batch) {
         logger.log("批量上架模块", "批量发布指定批次:" + batch + "的上架内容");
-        return releaseProductByBatchService.publishByBatch(batch, true);
+        // 第三个参数是默认忽略导入
+        return releaseProductByBatchService.publishByBatch(batch, true, 1);
     }
 
     /**
@@ -214,10 +216,13 @@ public class ReleaseProductByBatchController {
      *
      * @param uploadItem the upload item 上传的文件
      * @param selfSale   the self sale 自营还是寄售
+     * @param currency 是覆盖导入,还是忽略导入
+     * @param isPerson 是导入产品,还是导入产品及上架
+     * @param ignoreImport 1是忽略导入,0是覆盖导入
      * @return model map
      */
     @RequestMapping(value = "/release/excel", method = RequestMethod.POST)
-    public ModelMap releaseByExcel(FileUpload uploadItem, @RequestParam("selfSale") Boolean selfSale, String currency, Integer isPerson, Integer repeatImport) {
+    public ModelMap releaseByExcel(FileUpload uploadItem, @RequestParam("selfSale") Boolean selfSale, String currency, Integer isPerson, Integer ignoreImport) {
         ModelMap map = new ModelMap();
         String fileName = uploadItem.getFile().getOriginalFilename();
         String suffix = fileName.substring(fileName.lastIndexOf(".") + 1);
@@ -232,7 +237,7 @@ public class ReleaseProductByBatchController {
             } else {
                 throw new IllegalOperatorException("文件格式不正确!请上传.xls或.xlsx格式的文件");
             }
-            map = releaseProductByBatchService.releaseByWorkbook(workbook, selfSale, currency, isPerson, repeatImport, false);
+            map = releaseProductByBatchService.releaseByWorkbook(workbook, selfSale, currency, isPerson, ignoreImport, false);
         } catch (IOException e) {
             e.printStackTrace();
         }

+ 2 - 1
src/main/java/com/uas/platform/b2c/prod/commodity/model/Product.java

@@ -80,7 +80,8 @@ public class Product {
 	private Double stock;
 
 	/**
-	 * ERP空闲库存
+	 * 两种意思
+	 * 1、ERP空闲库存或者2、商城库存总数
 	 */
 	@Column(name = "pr_reserve")
 	private Double erpReserve;

+ 52 - 54
src/main/java/com/uas/platform/b2c/prod/commodity/model/ReleaseProductByBatch.java

@@ -78,13 +78,13 @@ public class ReleaseProductByBatch implements Serializable {
 
 	// 当前的申请的这一批的单号
 	@Column(name = "rel_batchid")
-	private String relbatchid;
+	private String relbatchid = "";
 
 	/**
 	 * 批次号,批量修改使用
 	 */
 	@Column(name = "rel_batchcode")
-	private String batchCode;
+	private String batchCode = "";
 
 	/**
 	 * 上下架状态,批量修改使用
@@ -99,31 +99,31 @@ public class ReleaseProductByBatch implements Serializable {
 	 * 寄售-自营
 	 */
 	@Column(name = "rel_sale_method")
-	private String saleMethod;
+	private String saleMethod = "";
 
 	/**
 	 * 产品中文品牌
 	 */
 	@Column(name = "rel_brandcn")
-	private String brandNameCn;
+	private String brandNameCn = "";
 
 	/**
 	 * 产品英文品牌
 	 */
 	@Column(name = "rel_branden")
-	private String brandNameEn;
+	private String brandNameEn = "";
 
 	/**
 	 * 商城品牌中文
 	 */
 	@Column(name = "rel_b2cbrandcn")
-	private String b2cBrandcn;
+	private String b2cBrandcn = "";
 
 	/**
 	 * 品牌品牌uuid
 	 */
 	@Column(name = "rel_b2cbranden")
-	private String b2cBranden;
+	private String b2cBranden = "";
 
 	/**
 	 * 品牌id
@@ -135,31 +135,31 @@ public class ReleaseProductByBatch implements Serializable {
 	 * 品牌品牌uuid
 	 */
 	@Column(name = "rel_b2cbranduuid")
-	private String branduuid;
+	private String branduuid = "";
 
 	/**
 	 * 产品型号
 	 */
 	@Column(name = "rel_code")
-	private String code;
+	private String code = "";
 
 	/**
 	 * 产品型号
 	 */
 	@Column(name = "rel_b2ccode")
-	private String b2cCode;
+	private String b2cCode = "";
 
 	/**
 	 * 产品UUId
 	 */
 	@Column(name = "rel_b2cuuid")
-	private String componentUuId;
+	private String componentUuId = "";
 
 	/**
 	 * 单位
 	 */
 	@Column(name = "rel_unit")
-	private String unit;
+	private String unit = "";
 
 	/**
 	 * 库存类型 :1311 现货,1312 呆滞库存(暂时不用)1313 废料
@@ -177,7 +177,7 @@ public class ReleaseProductByBatch implements Serializable {
 	 * 发布库存量的字符串
 	 */
 	@Column(name = "rel_publishreservestr")
-	private String reserveStr;
+	private String reserveStr = "";
 
 	/**
 	 * 最小起定量
@@ -189,13 +189,13 @@ public class ReleaseProductByBatch implements Serializable {
 	 * 最小起定量String 类型
 	 */
 	@Column(name = "rel_minbuyqtystr")
-	private String minBuyQtyStr;
+	private String minBuyQtyStr = "";
 
 	/**
 	 * 分段报价(JSON串) eg:[{"start":0,"end":1000,"price":2.3,"taxPrice":2.5},...]
 	 */
 	@Column(name = "rel_qtyprice", length = 4000)
-	private String qtyPrice;
+	private String qtyPrice = "";
 
 	/**
 	 * 分段报价(List)
@@ -207,13 +207,13 @@ public class ReleaseProductByBatch implements Serializable {
 	 * 产品生产日期
 	 */
 	@Column(name = "rel_manufacturedate")
-	private String productDate;
+	private String productDate = "";
 
 	/**
 	 * 成本单价字符串
 	 */
 	@Column(name = "rel_cost_price_str")
-	private String costPriceStr;
+	private String costPriceStr = "";
 
 	/**
 	 * 成本单价
@@ -237,7 +237,7 @@ public class ReleaseProductByBatch implements Serializable {
 	 * 产品最小包装量
 	 */
 	@Column(name = "rel_minpackagestr")
-	private String minPackageStr;
+	private String minPackageStr = "";
 
 	/**
 	 * 是否可拆卖
@@ -249,31 +249,31 @@ public class ReleaseProductByBatch implements Serializable {
 	 * 是否
 	 */
 	@Column(name = "rel_breakupstr")
-	private String breakUpStr;
+	private String breakUpStr = "";
 
 	/**
 	 * 包装:托盘、管装、卷带
 	 */
 	@Column(name = "rel_packaging")
-	private String packaging;
+	private String packaging = "";
 
 	/**
 	 * 封装
 	 */
 	@Column(name = "rel_encapsulation")
-	private String encapsulation;
+	private String encapsulation = "";
 
 	/**
 	 * 标签,用户填写
 	 */
 	@Column(name = "rel_tag_str")
-	private String tagstr;
+	private String tagstr = "";
 
 	/**
 	 * 标签,保存
 	 */
 	@Column(name = "rel_tag")
-	private String tag;
+	private String tag = "";
 
 	/**
 	 * 自己填写最长交期
@@ -291,37 +291,37 @@ public class ReleaseProductByBatch implements Serializable {
 	 * 自己填写最长交期 String
 	 */
 	@Column(name = "rel_selfmaxdeliverystr")
-	private String selfMaxDeliveryStr;
+	private String selfMaxDeliveryStr = "";
 
 	/**
 	 * 自己填写最短交期 String
 	 */
 	@Column(name = "rel_selfmindeliverystr")
-	private String selfMinDeliveryStr;
+	private String selfMinDeliveryStr = "";
 
 	/**
 	 * 尺寸(pcb)
 	 */
 	@Column(name = "rel_size")
-	private String sizePcb;
+	private String sizePcb = "";
 
 	/**
 	 * 颜色(pcb)
 	 */
 	@Column(name = "rel_color")
-	private String color;
+	private String color = "";
 
 	/**
 	 * 铜厚(pcb)
 	 */
 	@Column(name = "rel_thickcopper")
-	private String thickCopper;
+	private String thickCopper = "";
 
 	/**
 	 * 厚度(pcb)
 	 */
 	@Column(name = "rel_thick")
-	private String thick;
+	private String thick = "";
 
 //	/**
 //	 * 商城最长交期
@@ -363,13 +363,13 @@ public class ReleaseProductByBatch implements Serializable {
 	 * 备注
 	 */
 	@Column(name = "rel_remark")
-	private String remark;
+	private String remark = "";
 
 	/**
 	 * 发布人姓名
 	 */
 	@Column(name = "rel_publishername")
-	private String publisherName;
+	private String publisherName = "";
 
 	/**
 	 * 发布人UU
@@ -381,13 +381,13 @@ public class ReleaseProductByBatch implements Serializable {
 	 * 联系电话
 	 */
 	@Column(name = "rel_publishertel")
-	private String publisherTel;
+	private String publisherTel = "";
 
 	/**
 	 * 币别
 	 */
 	@Column(name = "rel_currency")
-	private String currency;
+	private String currency = "";
 
 	/**
 	 * 样品数
@@ -433,37 +433,37 @@ public class ReleaseProductByBatch implements Serializable {
 	 * 发货地区
 	 */
 	@Column(name = "rel_shiparea")
-	private String shipArea;
+	private String shipArea = "";
 
 	/**
 	 * 最小包单价(人民币)
 	 */
 	@Column(name = "rel_rmbprice")
-	private Double rmbMinPackPrice;
+	private Double rmbMinPackPrice = 0d;
 
 	/**
 	 * 最小包单价(美元)
 	 */
 	@Column(name = "rel_usdprice")
-	private Double usdMinPackPrice;
+	private Double usdMinPackPrice  = 0d;
 
 	/**
 	 * 最小包价格String 类型
 	 */
 	@Column(name = "rel_minpackpricestr")
-	private String minPackPriceStr;
+	private String minPackPriceStr  = "";
 
 	/**
 	 * 图片path,便于发布
 	 */
 	@Column(name = "rel_img")
-	private String img;
+	private String img = "";
 
 	/**
 	 * 类目名称,便于发布
 	 */
 	@Column(name = "rel_b2ckindname")
-	private String kindName;
+	private String kindName = "";
 
 	/**
 	 * 类目ID
@@ -475,37 +475,37 @@ public class ReleaseProductByBatch implements Serializable {
 	 * 第一个分段数量
 	 */
 	@Column(name = "rel_qty1str")
-	private String qty1Str;
+	private String qty1Str = "";
 
 	/**
 	 * 第二个分段数量
 	 */
 	@Column(name = "rel_qty2str")
-	private String qty2Str;
+	private String qty2Str = "";
 
 	/**
 	 * 第三个分段数量
 	 */
 	@Column(name = "rel_qty3str")
-	private String qty3Str;
+	private String qty3Str = "";
 
 	/**
 	 * 第一个分段的价格
 	 */
 	@Column(name = "rel_price1")
-	private String price1;
+	private String price1 = "";
 
 	/**
 	 * 第二个分段的价格
 	 */
 	@Column(name = "rel_price2")
-	private String price2;
+	private String price2 = "";
 
 	/**
 	 * 第三个分段的价格
 	 */
 	@Column(name = "rel_price3")
-	private String price3;
+	private String price3 = "";
 
 	/**
 	 * 错误的信息
@@ -517,25 +517,25 @@ public class ReleaseProductByBatch implements Serializable {
 	 * 本批次的最低人民币价格
 	 */
 	@Column(name = "rel_minpricermb")
-	private Double minPriceRMB;
+	private Double minPriceRMB = 0.0d;
 
 	/**
 	 * 本批次的最高人民币价格
 	 */
 	@Column(name = "rel_maxpricermb")
-	private Double maxPriceRMB;
+	private Double maxPriceRMB = 0.0d;
 
 	/**
 	 * 本批次的最低美元价格
 	 */
 	@Column(name = "rel_minpriceusd")
-	private Double minPriceUSD;
+	private Double minPriceUSD = 0.0d;
 
 	/**
 	 * 本批次的最高美元价格
 	 */
 	@Column(name = "rel_maxpriceusd")
-	private Double maxPriceUSD;
+	private Double maxPriceUSD = 0.0d;
 
 	/**
 	 * 店铺的id
@@ -553,7 +553,7 @@ public class ReleaseProductByBatch implements Serializable {
 	 * 规格信息
 	 */
 	@Column(name = "rel_spec")
-	private String spec;
+	private String spec = "";
 
 	/**
 	 * 物料id信息
@@ -571,7 +571,7 @@ public class ReleaseProductByBatch implements Serializable {
 	 * 规格书信息
 	 */
 	@Column(name = "rel_attach")
-	private String attach;
+	private String attach = "";
 
 	/***
 	 * 在售的数量
@@ -583,9 +583,7 @@ public class ReleaseProductByBatch implements Serializable {
 	 *  第几条
 	 */
 	@Column(name = "rel_num")
-	private Integer num;
-
-//	private Short repeat;
+	private Integer num = 1;
 
 	@Override
 	public boolean equals(Object o) {

+ 8 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/service/ProductService.java

@@ -11,6 +11,7 @@ import org.springframework.data.domain.Page;
 
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 /**
  * @author yuj
@@ -344,4 +345,11 @@ public interface ProductService {
      * @param list
      */
     void saveByJdbcTemplate(List<ReleaseProductByBatch> list);
+
+    /**
+     * 根据临时表的数据,更新物料的信息(包装数,包装方式、成本单价)
+     * @param reList 临时表的id
+     * @param ignoreImport 1表示忽略导入,0代表覆盖导入
+     */
+    void updateProductsByReleaseProductByBatch(Set<ReleaseProductByBatch> reList, Integer ignoreImport);
 }

+ 1 - 1
src/main/java/com/uas/platform/b2c/prod/commodity/service/ReleaseProductByBatchService.java

@@ -74,7 +74,7 @@ public interface ReleaseProductByBatchService {
      * @param isPcb 是否PCB模块
      * @return string
      */
-    public String publishByBatch(String batch, boolean isPcb);
+    public String publishByBatch(String batch, boolean isPcb, Integer ignoreImport);
 
     /**
      * 批量批量导入个人产品库

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

@@ -2310,7 +2310,7 @@ public class ProductServiceImpl implements ProductService {
     @Override
     public void saveByJdbcTemplate(List<ReleaseProductByBatch> list) {
         if (CollectionUtils.isNotEmpty(list)) {
-            jdbcTemplate.batchUpdate("insert into products(pr_code,pr_cmpimg,pr_enuu,pr_brand,pr_cmpcode,pr_cmpuuid,pr_kind,pr_kindid,pr_pcmpcode,pr_pbrand,pr_pbranden,pr_pbrandid,pr_pbranduuid,pr_standard,pr_create_time,pr_spec,pr_title,pr_issale) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",
+            jdbcTemplate.batchUpdate("insert into products(pr_code,pr_cmpimg,pr_enuu,pr_brand,pr_cmpcode,pr_cmpuuid,pr_kind,pr_kindid,pr_pcmpcode,pr_pbrand,pr_pbranden,pr_pbrandid,pr_pbranduuid,pr_standard,pr_create_time,pr_spec,pr_title,pr_issale, pr_price, pr_minpack, pr_packaging) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",
                     list, list.size(), new ParameterizedPreparedStatementSetter<ReleaseProductByBatch>() {
 
                         @Override
@@ -2333,6 +2333,9 @@ public class ProductServiceImpl implements ProductService {
                             ps.setObject(16, t.getSpec());
                             ps.setObject(17, t.getKindName());
                             ps.setObject(18, ((short) 1));
+                            ps.setObject(19, t.getCostPrice());
+                            ps.setObject(20, t.getMinPackage());
+                            ps.setObject(21, t.getPackaging());
                         }
                     });
         } else {
@@ -2340,5 +2343,35 @@ public class ProductServiceImpl implements ProductService {
         }
 
     }
+
+
+    /**
+     * 根据临时表的数据,更新物料的信息(包装数,包装方式、成本单价,库存)
+     *
+     * @param reList       临时表的id
+     * @param ignoreImport 1表示忽略导入,0代表覆盖导入
+     */
+    @Override
+    public void updateProductsByReleaseProductByBatch(Set<ReleaseProductByBatch> reList, Integer ignoreImport) {
+        if (CollectionUtils.isNotEmpty(reList)) {
+            //忽略导入
+            Set<Long> prIds = new HashSet<>();
+            for (ReleaseProductByBatch productByBatch : reList) {
+                if (productByBatch.getProductid() != null) {
+                    prIds.add(productByBatch.getProductid());
+                }
+            }
+            if (CollectionUtils.isNotEmpty(prIds)) {
+                List<Product> products = productDao.findAll(prIds);
+                if (ignoreImport == IntegerConstant.YES_SHORT) {
+                    for (Product product : products) {
+
+                    }
+                } else {
+                    //覆盖导入
+                }
+            }
+        }
+    }
 }
 

+ 41 - 17
src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ReleaseProductByBatchServiceImpl.java

@@ -179,22 +179,21 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 
 	/**
 	 * 导入excel发布商品(大量)
-	 * 
+	 * @param selfSale 自营还是寄售 (true 自营,false 寄售)
+	 * @param currency  当前选中的币别  (RMB/USD)
+	 * @param isPerson 是否是个人上传产品
+	 * @param ignoreImport 1是忽略导入,0是覆盖导入
 	 * @author hejq
 	 */
 	@Override
-	public ModelMap releaseByWorkbook(Workbook workbook, Boolean selfSale, String currency, Integer isPerson, Integer repeatImport, boolean isPcb) {
+	public ModelMap releaseByWorkbook(Workbook workbook, Boolean selfSale, String currency, Integer isPerson, Integer ignoreImport, boolean isPcb) {
 		long l = System.currentTimeMillis();
 		// 是否上传个人物料
 		boolean isAPerson = false;
-		boolean isImport = false;
 		if (null != isPerson && isPerson.intValue() == IntegerConstant.YES_SHORT.intValue()) {
 			isAPerson = true;
 			selfSale = false;
 		}
-		if (null != repeatImport && IntegerConstant.YES_SHORT.equals(repeatImport)) {
-			isImport = true;
-		}
 		ModelMap modelMap = new ModelMap();
 		// 获取第一个工作表
 		Sheet sheet = workbook.getSheetAt(0);
@@ -337,7 +336,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
             }
 		}
 		if (!isAPerson && !isPcb) {
-			String publish = publishByBatch(batch, isPcb);
+			String publish = publishByBatch(batch, isPcb, ignoreImport);
 			modelMap.put("publish", publish);
 		}
 		modelMap.put("total", total);
@@ -1723,7 +1722,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 
 	@Transactional
 	@Override
-	public String publishByBatch(String batch, boolean isPcb) {
+	public String publishByBatch(String batch, boolean isPcb, Integer ignoreImport) {
         if (StringUtils.isEmpty(batch)) {
             return "0";
         }
@@ -1732,7 +1731,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 		if (CollectionUtils.isEmpty(releaseProductByBatchList)) {
 			return String.valueOf(IntegerConstant.NO_SHORT);
 		}
-		Map<String, Object> map = convertProduct(releaseProductByBatchList, false, isPcb);
+		Map<String, Object> map = convertProduct(releaseProductByBatchList, false, isPcb, ignoreImport);
 		if (map == null || map.size() == 0) {
 			return "0";
 		}
@@ -1740,7 +1739,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 		if (isPcb) {
 			savePcbInfo(idSet, map);
 		}
-		Integer num = releaseToGoods(releaseProductByBatchList);
+		Integer num = releaseToGoods(releaseProductByBatchList, ignoreImport);
 		String updateReleaseSql = "/*#mycat:db_type=master*/ update trade$releasebybatch set rel_releasecode = 101,rel_releasestatus = '已发布' where (rel_releasecode = 112 OR rel_releasecode = 113) and rel_batchid = '%s';";
 		final String updateRelease = String.format(updateReleaseSql, new Object[]{batch});
 		jdbcTemplate.execute(updateRelease);
@@ -1753,10 +1752,11 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 
 	/**
 	 * 临时表保存到goods信息
-	 * @param list
+	 * @param list 需要保存的信息
+     * @param ignoreImport (1是忽略导入、2是覆盖导入)
 	 * @return
 	 */
-	public Integer releaseToGoods(List<ReleaseProductByBatch> list) {
+	public Integer releaseToGoods(List<ReleaseProductByBatch> list, Integer ignoreImport) {
 		if (CollectionUtils.isNotEmpty(list)) {
 			List<Goods> goodses = new ArrayList<>();
 			Goods goods = null;
@@ -1844,7 +1844,15 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 		}
 	}
 
-	private  Map<String, Object> convertProduct (List<ReleaseProductByBatch> releaseProductByBatchList, boolean isAPerson , boolean isPcb) {
+    /**
+     * 导入信息转成products
+     * @param releaseProductByBatchList 本次上架的信息
+     * @param isAPerson 是否是个人上传产品
+     * @param isPcb  true 是pcb上传, false 不是pcb上传
+     * @param ignoreImport 1 是忽略导入,0 是覆盖导入
+     * @return Map<String, Object>
+     */
+	private  Map<String, Object> convertProduct (List<ReleaseProductByBatch> releaseProductByBatchList, boolean isAPerson , boolean isPcb, Integer ignoreImport) {
 		if (CollectionUtils.isEmpty(releaseProductByBatchList)) {
 			return null;
 		}
@@ -1853,6 +1861,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 		List<ProductPrivate> productPrivates = new ArrayList<>();
 		Set<Long> prIds = new HashSet<>();
 		Set<Long> reIds = new HashSet<>();
+		Set<ReleaseProductByBatch> updateProducts = new HashSet<>();
 		Map<String, List<PCBPropertyValue>> propertyMap = new HashedMap();
 
 		Long sizeProId = null;
@@ -1883,11 +1892,20 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
                     proNums.add(prodNum);
                     productsfromRelease.add(releaseProductByBatch);
 				} else {
-					//对于已经存在于物料库的信息,如果规格信息已存在,则做更新,如果是
+					//对于已经存在于物料库的信息,如果规格信息已存在,则做更新
 					prIds.add(releaseProductByBatch.getProductid());
-					if (!StringUtilB2C.isEmpty(releaseProductByBatch.getSpec())) {
+                    if (org.apache.commons.lang.StringUtils.isNotEmpty(releaseProductByBatch.getSpec()) || (releaseProductByBatch.getMinPackage() != null) || org.apache.commons.lang.StringUtils.isNotEmpty(releaseProductByBatch.getPackaging()) || (releaseProductByBatch.getCostPrice() != null)) {
 						reIds.add(releaseProductByBatch.getId());
-					}
+						updateProducts.add(releaseProductByBatch);
+					} else {
+                        if (org.apache.commons.lang.StringUtils.isNotEmpty(releaseProductByBatch.getKindName())) {
+                            //如果是非标,则可以填充,或者覆盖
+                            if (org.apache.commons.lang.StringUtils.isNotEmpty(releaseProductByBatch.getComponentUuId())) {
+                                reIds.add(releaseProductByBatch.getId());
+								updateProducts.add(releaseProductByBatch);
+                            }
+                        }
+                    }
 				}
 
 				if (isPcb) {
@@ -1935,12 +1953,18 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 				}
 			}
 		}
+		//新生成的物料 要更新到临时表中
 		if (CollectionUtils.isNotEmpty(reList)) {
             udpatePridAndRrodnum(reList);
 		}
+		//保存新生成的物料私有字段
 		if (CollectionUtils.isNotEmpty(productPrivates)) {
             commonDao.save(productPrivates, ProductPrivate.class);
 		}
+		//将本次临时表中的数据更新到物料表中
+        if (CollectionUtils.isNotEmpty(reIds)) {
+            productService.updateProductsByReleaseProductByBatch(reIds, ignoreImport);
+        }
 		if (reIds.size() > 0) {
 			map.put("reIds", reIds);
 		}
@@ -1954,7 +1978,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
         List<ReleaseProductByBatch> releaseProductByBatchList =
                 releaseProductByBatchDao.findByRelbatchid(batch);
         if (!CollectionUtils.isEmpty(releaseProductByBatchList)) {
-			Map<String, Object> map = convertProduct(releaseProductByBatchList,false, false);
+			Map<String, Object> map = convertProduct(releaseProductByBatchList, false, false, IntegerConstant.NO_SHORT);
 			if (map == null || map.size() == 0) {
 				return "fail";
 			}