|
|
@@ -1054,7 +1054,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
private int convertValueToProduct(Row row, ReleaseProductByBatch aProduct, int rowNum, boolean isAPerson, boolean isPcb) {
|
|
|
// 统计为空的个数
|
|
|
int result = 0;
|
|
|
-
|
|
|
+ aProduct.setNum(rowNum - 2);
|
|
|
Object brandValue = readWorkBookCell(row.getCell(UploadConstant.BRAND_ENGLISH), Cell.CELL_TYPE_STRING,
|
|
|
rowNum, UploadConstant.BRAND_ENGLISH);
|
|
|
if (StringUtils.isEmpty(brandValue)) {
|
|
|
@@ -1813,14 +1813,18 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
thickCopperProId = propertyDao.findIdByLabelCn(THICKCOPPER);
|
|
|
thickProId = propertyDao.findIdByLabelCn(THICK);
|
|
|
}
|
|
|
- String importNum = createNumberService.getTimeNumber("trade$product_import_num", 8, releaseProductByBatchList.size());
|
|
|
+ long l = System.currentTimeMillis();
|
|
|
+ String importNum = createNumberService.getTimeNumber("trade$product_import_num", 8, releaseProductByBatchList.size());
|
|
|
if (StringUtils.isEmpty(importNum)) {
|
|
|
throw new IllegalOperatorException("生成批次号失败");
|
|
|
}
|
|
|
String time = importNum.substring(IntegerConstant.NO_SHORT, (IntegerConstant.TIME_LENGTH));
|
|
|
Integer num = Integer.valueOf(importNum.substring(IntegerConstant.TIME_LENGTH));
|
|
|
String prodNum = null;
|
|
|
- for (ReleaseProductByBatch releaseProductByBatch : releaseProductByBatchList) {
|
|
|
+ long l1 = System.currentTimeMillis();
|
|
|
+ System.err.println("打印l1-----------l" + (l1 - l));
|
|
|
+ List<String> proNums = new ArrayList<>();
|
|
|
+ for (ReleaseProductByBatch releaseProductByBatch : releaseProductByBatchList) {
|
|
|
if (releaseProductByBatch.getReleaseCode().equals(ReleaseStatus.failure.value()) ||
|
|
|
releaseProductByBatch.getReleaseCode().equals(ReleaseStatus.success.value())) {
|
|
|
if (releaseProductByBatch.getProductid() == null) {
|
|
|
@@ -1829,6 +1833,8 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
// releaseProductByBatch.getCode(); 在公有库生成
|
|
|
prodNum = "PNUM" + time + CreateNumberServiceImpl.formatIntToStr(++num, 8);
|
|
|
product.setProdNum(prodNum);
|
|
|
+ releaseProductByBatch.setProductNum(prodNum);
|
|
|
+ proNums.add(prodNum);
|
|
|
products.add(product);
|
|
|
} else {
|
|
|
//对于已经存在于物料库的信息,如果规格信息已存在,则做更新,如果是
|
|
|
@@ -1863,8 +1869,12 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
|
|
|
}
|
|
|
}
|
|
|
+ long l2 = System.currentTimeMillis();
|
|
|
+ System.err.println("打印l2 ----------- l1" + (l2 - l1));
|
|
|
+ List<ReleaseProductByBatch> reList = new ArrayList<>();
|
|
|
if (products.size() != 0) {
|
|
|
- List<Product> productes = productDao.save(products);
|
|
|
+ List<Product> productes = productDao.save(products);
|
|
|
+ //List<Product> productes = productService.findProductsByProdNums(proNums);
|
|
|
for (Product producte : productes) {
|
|
|
ProductPrivate productPrivate = new ProductPrivate();
|
|
|
productPrivate.setB2cEnabled(IntegerConstant.YES_SHORT);
|
|
|
@@ -1873,11 +1883,28 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
productPrivates.add(productPrivate);
|
|
|
|
|
|
prIds.add(producte.getId());
|
|
|
+
|
|
|
+ for (ReleaseProductByBatch releaseProductByBatch : releaseProductByBatchList) {
|
|
|
+ if (StringUtilB2C.equals(releaseProductByBatch.getProductNum(), producte.getProdNum())) {
|
|
|
+ releaseProductByBatch.setProductid(producte.getId());
|
|
|
+ reList.add(releaseProductByBatch);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ long l3 = System.currentTimeMillis();
|
|
|
+ System.err.println("打印l3 ----------- l2" + (l3 - l2));
|
|
|
+ if (CollectionUtils.isNotEmpty(reList)) {
|
|
|
+ releaseProductByBatchDao.save(reList);
|
|
|
+ }
|
|
|
+ long l4 = System.currentTimeMillis();
|
|
|
+ System.err.println("打印l4 ----------- l3" + (l4 - l3));
|
|
|
if (CollectionUtils.isNotEmpty(productPrivates)) {
|
|
|
- productPrivateService.saveProductPrivate(productPrivates);
|
|
|
+ commonDao.save(productPrivates, ProductPrivate.class);
|
|
|
}
|
|
|
+ long l5 = System.currentTimeMillis();
|
|
|
+ System.err.println("打印l5 ----------- l4" + (l5 - l4));
|
|
|
if (reIds.size() > 0) {
|
|
|
map.put("reIds", reIds);
|
|
|
}
|