|
|
@@ -2346,19 +2346,30 @@ public class ProductServiceImpl implements ProductService {
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * 根据临时表的数据,更新物料的信息(包装数,包装方式、成本单价)
|
|
|
+ * 根据临时表的数据,更新物料的信息(包装数,包装方式、成本单价,库存)
|
|
|
*
|
|
|
* @param reList 临时表的id
|
|
|
* @param ignoreImport 1表示忽略导入,0代表覆盖导入
|
|
|
*/
|
|
|
@Override
|
|
|
- public void updateProductsByReleaseProductByBatch(Set<Long> reList, Integer ignoreImport) {
|
|
|
+ public void updateProductsByReleaseProductByBatch(Set<ReleaseProductByBatch> reList, Integer ignoreImport) {
|
|
|
if (CollectionUtils.isNotEmpty(reList)) {
|
|
|
//忽略导入
|
|
|
- if (ignoreImport == IntegerConstant.YES_SHORT) {
|
|
|
- jdbcTemplate.execute("update products ");
|
|
|
- } else {
|
|
|
- //覆盖导入
|
|
|
+ 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 {
|
|
|
+ //覆盖导入
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|