Browse Source

feat: 买家批量导入生成物料编号方法更新,增加相关日志

hejq 7 years ago
parent
commit
48635e2cf2

+ 0 - 3
src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ProductServiceImpl.java

@@ -2247,10 +2247,7 @@ public class ProductServiceImpl implements ProductService {
                             ps.setObject(23, t.getAttach());
                         }
                     });
-        } else {
-
         }
-
     }
 
     /**

+ 6 - 5
src/main/java/com/uas/platform/b2c/trade/order/service/impl/PurchaseProductServiceImpl.java

@@ -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());