|
|
@@ -2063,15 +2063,17 @@ public class ProductServiceImpl implements ProductService {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
List<Product> productList = productDao.findByCmpUuId(component.getUuid());
|
|
|
- List<Product> list = new ArrayList<>();
|
|
|
+ Set<Product> set = new HashSet<>();
|
|
|
List<Long> ids = new ArrayList<>();
|
|
|
for (Product product : productList) {
|
|
|
if (!StringUtils.isEmpty(component.getAttach())) {
|
|
|
+ product.setAttachment(component.getAttach());
|
|
|
+ set.add(product);
|
|
|
ids.add(product.getId());
|
|
|
}
|
|
|
- if (StringUtils.isEmpty(product.getSpec()) && !StringUtils.isEmpty(component.getSpec())) {
|
|
|
+ if ((StringUtils.isEmpty(product.getSpec()) && !StringUtils.isEmpty(component.getSpec()))) {
|
|
|
product.setSpec(component.getSpec());
|
|
|
- list.add(product);
|
|
|
+ set.add(product);
|
|
|
}
|
|
|
}
|
|
|
if (CollectionUtils.isNotEmpty(ids)) {
|
|
|
@@ -2098,8 +2100,8 @@ public class ProductServiceImpl implements ProductService {
|
|
|
productPrivateDao.save(productPrivatelist);
|
|
|
}
|
|
|
}
|
|
|
- if (CollectionUtils.isNotEmpty(list)) {
|
|
|
- productDao.save(list);
|
|
|
+ if (CollectionUtils.isNotEmpty(set)) {
|
|
|
+ productDao.save(set);
|
|
|
}
|
|
|
goodsService.updateGoodsByComponent(component);
|
|
|
}
|
|
|
@@ -2220,7 +2222,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, pr_price, pr_minpack, pr_packaging, pr_reserve) 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, pr_reserve,pr_attachment) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",
|
|
|
list, list.size(), new ParameterizedPreparedStatementSetter<ReleaseProductByBatch>() {
|
|
|
|
|
|
@Override
|
|
|
@@ -2247,6 +2249,7 @@ public class ProductServiceImpl implements ProductService {
|
|
|
ps.setObject(20, t.getMinPackage());
|
|
|
ps.setObject(21, t.getPackaging());
|
|
|
ps.setObject(22, t.getReserve());
|
|
|
+ ps.setObject(23, t.getAttach());
|
|
|
}
|
|
|
});
|
|
|
} else {
|