|
|
@@ -1039,7 +1039,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
List<ReleaseProductByBatch> releaseProductByBatchList =
|
|
|
releaseProductByBatchDao.findByRelbatchid(batch);
|
|
|
if (!CollectionUtils.isEmpty(releaseProductByBatchList)) {
|
|
|
- List<com.uas.ps.entity.Product> products = convertProduct(releaseProductByBatchList);
|
|
|
+ List<com.uas.ps.entity.Product> products = convertProduct(releaseProductByBatchList,false);
|
|
|
// TODO 什么接口
|
|
|
String result = restTemplate.postForEntity("http://192.168.253.12:24000/product/update", products, String.class).getBody();
|
|
|
List<Long> productIds = JSON.parseArray(result, Long.class);
|
|
|
@@ -1049,11 +1049,13 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
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);
|
|
|
}
|
|
|
@@ -1112,7 +1114,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
}
|
|
|
|
|
|
|
|
|
- private List<com.uas.ps.entity.Product> convertProduct (List<ReleaseProductByBatch> releaseProductByBatchList ) {
|
|
|
+ private List<com.uas.ps.entity.Product> convertProduct (List<ReleaseProductByBatch> releaseProductByBatchList, boolean isAPerson ) {
|
|
|
if (CollectionUtils.isEmpty(releaseProductByBatchList)) {
|
|
|
return null;
|
|
|
}
|
|
|
@@ -1128,7 +1130,13 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
product.setCmpUuid(releaseProductByBatch.getComponentUuId());
|
|
|
product.setKind(releaseProductByBatch.getKindName());
|
|
|
product.setKindId(releaseProductByBatch.getKindUuid());
|
|
|
- product.setStandard(releaseProductByBatch.getReleaseCode().shortValue());
|
|
|
+ product.setStandard(releaseProductByBatch.getComponentUuId() == null ? (short)0 : (short)1);
|
|
|
+ product.setCmpUuid(releaseProductByBatch.getComponentUuId());
|
|
|
+ if (isAPerson) {
|
|
|
+ product.setSpec(releaseProductByBatch.getPackaging());
|
|
|
+ }
|
|
|
+ String batchCode = "PNUM" + createNumberService.getTimeNumber("trade$product_import_num", 8);
|
|
|
+ product.setCode(batchCode);
|
|
|
products.add(product);
|
|
|
}
|
|
|
return products;
|
|
|
@@ -1139,7 +1147,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
List<ReleaseProductByBatch> releaseProductByBatchList =
|
|
|
releaseProductByBatchDao.findByRelbatchid(batch);
|
|
|
if (!CollectionUtils.isEmpty(releaseProductByBatchList)) {
|
|
|
- List<com.uas.ps.entity.Product> products = convertProduct(releaseProductByBatchList);
|
|
|
+ List<com.uas.ps.entity.Product> products = convertProduct(releaseProductByBatchList,true);
|
|
|
// TODO 什么接口
|
|
|
String result = restTemplate.postForEntity("http://192.168.253.12:24000/product/update", products, String.class).getBody();
|
|
|
List<Long> productIds = JSON.parseArray(result, Long.class);
|
|
|
@@ -1153,11 +1161,13 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
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);
|
|
|
}
|