|
|
@@ -185,9 +185,6 @@ public class ProductServiceImpl implements ProductService {
|
|
|
@Autowired
|
|
|
private UASBatchPutOnPropertyService uasBatchPutOnPropertyService;
|
|
|
|
|
|
- @Autowired
|
|
|
- private ProductPersonDao productPersonDao;
|
|
|
-
|
|
|
private ConcurrentHashMap<String, Field> sortFields = new ConcurrentHashMap<String, Field>();
|
|
|
|
|
|
@Override
|
|
|
@@ -1359,7 +1356,7 @@ public class ProductServiceImpl implements ProductService {
|
|
|
if (property == null) {
|
|
|
return new ResultMap(CodeType.NOT_COMPLETE_INFO.code(), "请先设置上架参数", null);
|
|
|
}
|
|
|
- String sql = "select pr_id from products where pr_batchcount = 0 and pr_sourceapp = 'ERP' and pr_reserve <> 0 and pr_reserve is not null and pr_b2cenabled = 1 and pr_enuu = (:enuu) and pr_id not in (select DISTINCT go_productid from trade$goods where go_productid is not null);";
|
|
|
+ String sql = "select p.pr_id from products p left join product$private pp on pp.pr_id = p.pr_id where pp.pr_batchcount = 0 and p.pr_sourceapp = 'ERP' and p.pr_reserve <> 0 and p.pr_reserve is not null and pp.pr_b2cenabled = 1 and p.pr_enuu = (:enuu) and p.pr_id not in (select DISTINCT go_productid from trade$goods where go_productid is not null);";
|
|
|
Map<String, Long> map = new HashMap<>();
|
|
|
map.put("enuu", uu);
|
|
|
List<Long> longList = namedParameterJdbcTemplate.queryForList(sql, map, Long.class);
|
|
|
@@ -1380,16 +1377,15 @@ public class ProductServiceImpl implements ProductService {
|
|
|
goodsList.addAll(goodses);
|
|
|
List<Goods> result = new ArrayList<Goods>();
|
|
|
goodsService.publishERPProductByBatch(goodsList, uuids, result);
|
|
|
- List<Product> list = new ArrayList<>();
|
|
|
+ List<Long> prids = new ArrayList<>();
|
|
|
for (Goods goods : result) {
|
|
|
- for (Product product : sourceAppNotPutOn) {
|
|
|
- if (product.getId().longValue() == goods.getProductid().longValue()) {
|
|
|
- product.setBatchCount(com.uas.platform.b2c.prod.commodity.constant.IntegerConstant.YES_INT);
|
|
|
- list.add(product);
|
|
|
- }
|
|
|
- }
|
|
|
+ prids.add(goods.getProductid());
|
|
|
+ }
|
|
|
+ List<ProductPrivate> productPrivates = productPrivateDao.findByPrIds(prids);
|
|
|
+ for (ProductPrivate productPrivate : productPrivates) {
|
|
|
+ productPrivate.setBatchCount(IntegerConstant.YES_SHORT);
|
|
|
}
|
|
|
- productDao.save(list);
|
|
|
+ productPrivateDao.save(productPrivates);
|
|
|
for (String uuid : uuids) {
|
|
|
goodsService.updateComponentTradeInfos(uuid);
|
|
|
}
|