|
|
@@ -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;
|
|
|
@@ -1043,11 +1044,23 @@ 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();
|
|
|
productIds = JSON.parseArray(result, Long.class);
|
|
|
+ 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);
|
|
|
+ productPrivates.add(productPrivate);
|
|
|
+ }
|
|
|
+ productPrivateList = productPrivateDao.save(productPrivates);
|
|
|
}
|
|
|
Enterprise enterprise = SystemSession.getUser().getEnterprise();
|
|
|
final Object[] obj = new Object[]{enterprise.getUu(), enterprise.getEnName(), batch};
|
|
|
@@ -1066,22 +1079,14 @@ 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);
|
|
|
+ for (ProductPrivate productPrivate : productPrivateList) {
|
|
|
// 统计现在有多少在售信息
|
|
|
- int batchCount = goodsDao.findCountByProductid(prId);
|
|
|
+ int batchCount = goodsDao.findCountByProductid(productPrivate.getPrId());
|
|
|
productPrivate.setBatchCount(batchCount);
|
|
|
- productPrivates.add(productPrivate);
|
|
|
}
|
|
|
- productPrivateDao.save(productPrivates);
|
|
|
+ productPrivateDao.save(productPrivateList);
|
|
|
}
|
|
|
|
|
|
// Enterprise enterprise = SystemSession.getUser().getEnterprise();
|
|
|
@@ -1125,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());
|