|
|
@@ -13,6 +13,7 @@ import com.uas.platform.b2c.prod.store.dao.StoreInDao;
|
|
|
import com.uas.platform.b2c.prod.store.model.StoreIn;
|
|
|
import com.uas.platform.core.logging.BufferedLoggerManager;
|
|
|
import org.apache.log4j.Logger;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
@@ -49,15 +50,17 @@ public class ProdServiceImpl implements ProdService {
|
|
|
List<Product> productExists = productDao.getProductByEnUUAndProdNum(enuu, prod.getPr_code());
|
|
|
Product product = ModelConverter.convert(prod);
|
|
|
if (!CollectionUtils.isEmpty(productExists)) {
|
|
|
- product.setId(productExists.get(0).getId());
|
|
|
- product.setCmpUuId(null);// 将已存在的变更过物料uuid置为null,以便后续进行重新匹配
|
|
|
+ Product existProduct = productExists.get(0);
|
|
|
+ BeanUtils.copyProperties(product, productExists.get(0), "id");
|
|
|
+ existProduct.setCmpUuId(null);// 将已存在的变更过物料uuid置为null,以便后续进行重新匹配
|
|
|
+ products.add(existProduct);
|
|
|
+ } else {
|
|
|
+ products.add(product);
|
|
|
}
|
|
|
- products.add(product);
|
|
|
}
|
|
|
productDao.save(products);// 保存上传的物料
|
|
|
|
|
|
- logger.log("物料资料", "上传物料资料,数量:" + prods.size());
|
|
|
- loggerOut.info("--------------" + SystemSession.getUser().getEnterprise().getEnName() + " 上传物料资料,数量:" + prods.size() + "---------------");
|
|
|
+ logger.log("物料资料", SystemSession.getUser().getEnterprise().getEnName() + "上传物料资料,数量:" + prods.size());
|
|
|
return "success";
|
|
|
}
|
|
|
|