|
|
@@ -1042,28 +1042,13 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
|
|
|
List<ReleaseProductByBatch> releaseProductByBatchList =
|
|
|
releaseProductByBatchDao.findByRelbatchid(batch);
|
|
|
+ List<Long> productIds = null;
|
|
|
if (!CollectionUtils.isEmpty(releaseProductByBatchList)) {
|
|
|
List<com.uas.ps.entity.Product> products = convertProduct(releaseProductByBatchList,false);
|
|
|
// TODO 什么接口
|
|
|
String result = restTemplate.postForEntity(productServiceIp + "/product/update", products, String.class).getBody();
|
|
|
- List<Long> productIds = JSON.parseArray(result, Long.class);
|
|
|
- // 默认为b2c Enable开启
|
|
|
- List<ProductPrivate> productPrivates = new ArrayList<>();
|
|
|
- for (Long prId : productIds) {
|
|
|
- ProductPrivate productPrivate = productPrivateDao.findByPrId(prId);
|
|
|
- if (null == productPrivate) {
|
|
|
- productPrivate = new ProductPrivate();
|
|
|
- productPrivate.setPrId(prId);
|
|
|
- }
|
|
|
- productPrivate.setB2cEnabled(IntegerConstant.YES_SHORT);
|
|
|
- // 统计现在有多少在售信息
|
|
|
- int batchCount = goodsDao.findCountByProductid(prId);
|
|
|
- productPrivate.setBatchCount(batchCount);
|
|
|
- productPrivates.add(productPrivate);
|
|
|
- }
|
|
|
- productPrivateDao.save(productPrivates);
|
|
|
+ productIds = JSON.parseArray(result, Long.class);
|
|
|
}
|
|
|
-
|
|
|
Enterprise enterprise = SystemSession.getUser().getEnterprise();
|
|
|
final Object[] obj = new Object[]{enterprise.getUu(), enterprise.getEnName(), batch};
|
|
|
String sql = "/*#mycat:db_type=master*/ set @enuu = %s; set @enName = '%s'; set @batch = '%s'; call RELEASE_TO_GOODS_V2(@enuu, @enName, @batch, @out); select @out";
|
|
|
@@ -1081,7 +1066,23 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
return "0";
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
+ if (null != productIds) {
|
|
|
+ // 默认为b2c Enable开启
|
|
|
+ List<ProductPrivate> productPrivates = new ArrayList<>();
|
|
|
+ for (Long prId : productIds) {
|
|
|
+ ProductPrivate productPrivate = productPrivateDao.findByPrId(prId);
|
|
|
+ if (null == productPrivate) {
|
|
|
+ productPrivate = new ProductPrivate();
|
|
|
+ productPrivate.setPrId(prId);
|
|
|
+ }
|
|
|
+ productPrivate.setB2cEnabled(IntegerConstant.YES_SHORT);
|
|
|
+ // 统计现在有多少在售信息
|
|
|
+ int batchCount = goodsDao.findCountByProductid(prId);
|
|
|
+ productPrivate.setBatchCount(batchCount);
|
|
|
+ productPrivates.add(productPrivate);
|
|
|
+ }
|
|
|
+ productPrivateDao.save(productPrivates);
|
|
|
+ }
|
|
|
|
|
|
// Enterprise enterprise = SystemSession.getUser().getEnterprise();
|
|
|
// final Object[] obj = new Object[]{enterprise.getUu(), enterprise.getEnName(), batch};
|