|
|
@@ -1695,10 +1695,8 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
|
|
|
@Override
|
|
|
public String publishByBatch(String batch, boolean isPcb) {
|
|
|
- long l = System.currentTimeMillis();
|
|
|
List<ReleaseProductByBatch> releaseProductByBatchList =
|
|
|
releaseProductByBatchDao.findByRelbatchid(batch);
|
|
|
- long l1 = System.currentTimeMillis();
|
|
|
if (CollectionUtils.isEmpty(releaseProductByBatchList)) {
|
|
|
return String.valueOf(IntegerConstant.NO_SHORT);
|
|
|
}
|
|
|
@@ -1706,13 +1704,10 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
if (map == null || map.size() == 0) {
|
|
|
return "fail";
|
|
|
}
|
|
|
- long l2 = System.currentTimeMillis();
|
|
|
- System.err.println("l2 -------------------l1 " + (l2 - l1));
|
|
|
Set<Long> idSet = (Set<Long>) map.get("prIds");
|
|
|
if (isPcb) {
|
|
|
savePcbInfo(idSet, map);
|
|
|
}
|
|
|
- long l8 = System.currentTimeMillis();
|
|
|
Enterprise enterprise = SystemSession.getUser().getEnterprise();
|
|
|
final Object[] obj = new Object[]{enterprise.getUu(), enterprise.getEnName(), batch};
|
|
|
String sql = "/*#mycat:db_type=master*/ set @enuu = %s; set @enName = '%s'; set @batch = '%s'; call RELEASE_TO_GOODS_V4(@enuu, @enName, @batch, @out); select @out";
|
|
|
@@ -1730,8 +1725,6 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
return "0";
|
|
|
}
|
|
|
});
|
|
|
- long l9 = System.currentTimeMillis();
|
|
|
- System.err.println("l9 -------------------l8 " + (l9 - l8));
|
|
|
ArrayList<Long> list = new ArrayList<>();
|
|
|
list.addAll((Set<Long>)map.get("prIds"));
|
|
|
afterPublishToGoodsDo(list, (Set<Long>)map.get("reIds"), batch);
|
|
|
@@ -1804,7 +1797,6 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
thickCopperProId = propertyDao.findIdByLabelCn(THICKCOPPER);
|
|
|
thickProId = propertyDao.findIdByLabelCn(THICK);
|
|
|
}
|
|
|
- long l = System.currentTimeMillis();
|
|
|
String importNum = createNumberService.getTimeNumber("trade$product_import_num", 8, releaseProductByBatchList.size());
|
|
|
if (StringUtils.isEmpty(importNum)) {
|
|
|
throw new IllegalOperatorException("生成批次号失败");
|
|
|
@@ -1812,8 +1804,6 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
String time = importNum.substring(IntegerConstant.NO_SHORT, (IntegerConstant.TIME_LENGTH));
|
|
|
Integer num = Integer.valueOf(importNum.substring(IntegerConstant.TIME_LENGTH));
|
|
|
String prodNum = null;
|
|
|
- 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()) ||
|
|
|
@@ -1856,13 +1846,10 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- long l2 = System.currentTimeMillis();
|
|
|
- System.err.println("打印l2 ----------- l1" + (l2 - l1));
|
|
|
List<ReleaseProductByBatch> reList = new ArrayList<>();
|
|
|
if (productsfromRelease.size() != 0) {
|
|
|
productService.saveByJdbcTemplate(productsfromRelease);
|
|
|
List<Product> productes = productService.findProductIdAndProdnumsByProdNums(proNums);
|
|
|
- System.err.println("新增物料之后,获取物料的个数=" + productes.size() + "新增物料的个数 =" + productsfromRelease.size());
|
|
|
for (Product producte : productes) {
|
|
|
ProductPrivate productPrivate = new ProductPrivate();
|
|
|
productPrivate.setB2cEnabled(IntegerConstant.YES_SHORT);
|
|
|
@@ -1881,18 +1868,12 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- long l3 = System.currentTimeMillis();
|
|
|
- System.err.println("打印l3 ----------- l2" + (l3 - l2));
|
|
|
if (CollectionUtils.isNotEmpty(reList)) {
|
|
|
udpatePridAndRrodnum(reList);
|
|
|
}
|
|
|
- long l4 = System.currentTimeMillis();
|
|
|
- System.err.println("打印l4 ----------- l3" + (l4 - l3));
|
|
|
if (CollectionUtils.isNotEmpty(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);
|
|
|
}
|