|
|
@@ -180,7 +180,7 @@ public class PurchaseProductServiceImpl implements PurchaseProductService {
|
|
|
Integer assignNumber = 0;
|
|
|
// 去重后的数据
|
|
|
List<ReleaseProductByBatch> uniqueBatchList = releaseProductByBatchDao.findByRelbatchidAndReleaseCodeNot(userUU, batch, failCode);
|
|
|
- System.out.println("处理后数据大小: " + uniqueBatchList.size());
|
|
|
+ LOGGER.info("处理后数据大小: " + uniqueBatchList.size());
|
|
|
if (!CollectionUtils.isEmpty(uniqueBatchList)) {
|
|
|
assignNumber = assignBatch(uniqueBatchList);
|
|
|
}
|
|
|
@@ -340,7 +340,7 @@ public class PurchaseProductServiceImpl implements PurchaseProductService {
|
|
|
*/
|
|
|
private Integer assignBatch(List<ReleaseProductByBatch> uniqueBatchList) {
|
|
|
Set<Long> idSet = getProductIdSet(uniqueBatchList);
|
|
|
- System.out.println("获取的物料id数量: " + idSet.size());
|
|
|
+ LOGGER.info("获取的物料id数量: " + idSet.size());
|
|
|
if (CollectionUtils.isNotEmpty(idSet)) {
|
|
|
HashMap<String, Object> params = new HashMap<>(5);
|
|
|
ModelMap data = new ModelMap();
|
|
|
@@ -370,11 +370,11 @@ public class PurchaseProductServiceImpl implements PurchaseProductService {
|
|
|
List<String> productCodeList = new ArrayList<>();
|
|
|
Set<Long> idSet = new HashSet<>();
|
|
|
List<ReleaseProductByBatch> batchList = new ArrayList<>();
|
|
|
- String importNum = createNumberService.getTimeNumber("products", 8, uniqueBatchList.size());
|
|
|
+ String importNum = createNumberService.getTimeNumber("trade$product_import_num", 8, uniqueBatchList.size());
|
|
|
if (StringUtils.isEmpty(importNum)) {
|
|
|
throw new IllegalOperatorException("生成批次号失败");
|
|
|
}
|
|
|
- String time = importNum.substring(IntegerConstant.NO_SHORT, (IntegerConstant.TIME_LENGTH));
|
|
|
+ String time = importNum.substring(IntegerConstant.NO_SHORT, IntegerConstant.TIME_LENGTH);
|
|
|
final Integer[] num = {Integer.valueOf(importNum.substring(IntegerConstant.TIME_LENGTH))};
|
|
|
uniqueBatchList.forEach(batch -> {
|
|
|
if (null != batch.getProductid()) {
|
|
|
@@ -388,10 +388,11 @@ public class PurchaseProductServiceImpl implements PurchaseProductService {
|
|
|
batchList.add(batch);
|
|
|
}
|
|
|
});
|
|
|
+ LOGGER.info("新增物料数: " + batchList.size());
|
|
|
// 新增到物料库
|
|
|
productService.saveByJdbcTemplate(batchList);
|
|
|
List<com.uas.platform.b2c.prod.commodity.model.Product> productList = productService.findProductIdAndProdnumsByProdNums(productCodeList);
|
|
|
- System.out.println("根据编号查询物料: " + productList.size());
|
|
|
+ LOGGER.info("根据编号查询物料: " + productList.size());
|
|
|
List<ProductPrivate> privateList = new ArrayList<>();
|
|
|
productList.forEach(product -> {
|
|
|
ProductPrivate productPrivate = new ProductPrivate(product.getId());
|