|
|
@@ -29,6 +29,7 @@ import com.uas.platform.b2c.prod.store.model.StoreIn;
|
|
|
import com.uas.platform.b2c.prod.store.model.StoreStatus;
|
|
|
import com.uas.platform.b2c.prod.store.service.StoreInService;
|
|
|
import com.uas.platform.b2c.trade.order.StringConstant.Currency;
|
|
|
+import com.uas.platform.b2c.trade.presale.model.Collection;
|
|
|
import com.uas.platform.core.exception.IllegalOperatorException;
|
|
|
import com.uas.platform.core.model.PageInfo;
|
|
|
import com.uas.platform.core.persistence.criteria.CriterionExpression;
|
|
|
@@ -1042,12 +1043,13 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
|
|
|
List<ReleaseProductByBatch> releaseProductByBatchList =
|
|
|
releaseProductByBatchDao.findByRelbatchid(batch);
|
|
|
+ List<Long> productIds = null;
|
|
|
+ List<ProductPrivate> productPrivateList = 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开启
|
|
|
+ productIds = JSON.parseArray(result, Long.class);
|
|
|
List<ProductPrivate> productPrivates = new ArrayList<>();
|
|
|
for (Long prId : productIds) {
|
|
|
ProductPrivate productPrivate = productPrivateDao.findByPrId(prId);
|
|
|
@@ -1056,14 +1058,10 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
productPrivate.setPrId(prId);
|
|
|
}
|
|
|
productPrivate.setB2cEnabled(IntegerConstant.YES_SHORT);
|
|
|
- // 统计现在有多少在售信息
|
|
|
- int batchCount = goodsDao.findCountByProductid(prId);
|
|
|
- productPrivate.setBatchCount(batchCount);
|
|
|
- productPrivates.add(productPrivate);
|
|
|
+ productPrivates.add(productPrivate);
|
|
|
}
|
|
|
- productPrivateDao.save(productPrivates);
|
|
|
+ productPrivateList = productPrivateDao.save(productPrivates);
|
|
|
}
|
|
|
-
|
|
|
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";
|
|
|
@@ -1082,6 +1080,14 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
}
|
|
|
});
|
|
|
|
|
|
+ if (null != productIds) {
|
|
|
+ for (ProductPrivate productPrivate : productPrivateList) {
|
|
|
+ // 统计现在有多少在售信息
|
|
|
+ int batchCount = goodsDao.findCountByProductid(productPrivate.getPrId());
|
|
|
+ productPrivate.setBatchCount(batchCount);
|
|
|
+ }
|
|
|
+ productPrivateDao.save(productPrivateList);
|
|
|
+ }
|
|
|
|
|
|
// Enterprise enterprise = SystemSession.getUser().getEnterprise();
|
|
|
// final Object[] obj = new Object[]{enterprise.getUu(), enterprise.getEnName(), batch};
|
|
|
@@ -1124,8 +1130,8 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
}
|
|
|
List<com.uas.ps.entity.Product> products = new ArrayList<>();
|
|
|
for (ReleaseProductByBatch releaseProductByBatch : releaseProductByBatchList) {
|
|
|
- if (releaseProductByBatch.getReleaseCode().equals(ReleaseStatus.failure) ||
|
|
|
- releaseProductByBatch.getReleaseCode().equals(ReleaseStatus.success)) {
|
|
|
+ if (releaseProductByBatch.getReleaseCode().equals(ReleaseStatus.failure.value()) ||
|
|
|
+ releaseProductByBatch.getReleaseCode().equals(ReleaseStatus.success.value())) {
|
|
|
com.uas.ps.entity.Product product = new com.uas.ps.entity.Product();
|
|
|
// releaseProductByBatch.getCode(); 在公有库生成
|
|
|
product.setMinPack(releaseProductByBatch.getMinPackage());
|