|
@@ -182,6 +182,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
Row headerRow = sheet.getRow(0);
|
|
Row headerRow = sheet.getRow(0);
|
|
|
int total = 0;
|
|
int total = 0;
|
|
|
int blankNum = 0;
|
|
int blankNum = 0;
|
|
|
|
|
+ long l = System.currentTimeMillis();
|
|
|
if (headerRow != null) {
|
|
if (headerRow != null) {
|
|
|
// 验证模板是否为商城模板
|
|
// 验证模板是否为商城模板
|
|
|
validateTemplate(headerRow, colNum, currency, isAPerson, isPcb);
|
|
validateTemplate(headerRow, colNum, currency, isAPerson, isPcb);
|
|
@@ -221,15 +222,37 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ System.out.println("获取订单信息缺失");
|
|
|
|
|
+ long l1 = System.currentTimeMillis();
|
|
|
|
|
+ System.err.println("l1--------------l testyuj" + (l1 - l));
|
|
|
Long userUU = SystemSession.getUser().getUserUU();
|
|
Long userUU = SystemSession.getUser().getUserUU();
|
|
|
Long enUU = SystemSession.getUser().getEnterprise().getUu();
|
|
Long enUU = SystemSession.getUser().getEnterprise().getUu();
|
|
|
- List<ReleaseProductByBatch> addList = new ArrayList<>(releaseProductByBatchs.size());
|
|
|
|
|
- addList.addAll(releaseProductByBatchs);
|
|
|
|
|
- commonDao.save(addList, ReleaseProductByBatch.class);
|
|
|
|
|
|
|
+ if (!isAPerson) {
|
|
|
|
|
+ //1:比较品牌、型号、自定义标签是否重复,2:比较六要素是否重复
|
|
|
|
|
+ for(int i = releaseProductByBatchs.size() - 1; i > -1; i--) {
|
|
|
|
|
+ ReleaseProductByBatch releaseProductByBatch = releaseProductByBatchs.get(i);
|
|
|
|
|
+ for(int j = i - 1; j > 0; j--) {
|
|
|
|
|
+ ReleaseProductByBatch byBatch = releaseProductByBatchs.get(j);
|
|
|
|
|
+ if(releaseProductByBatch.compareSameProductTagInfo(byBatch)) {
|
|
|
|
|
+ releaseProductByBatch.setTag("");
|
|
|
|
|
+ releaseProductByBatch.setTagstr("");
|
|
|
|
|
+ if (releaseProductByBatch.compareSameProductSixEle(byBatch)) {
|
|
|
|
|
+ releaseProductByBatch.addErrmsg(ErrorInfoConstant.REPEAT_IN_EXCEL.getInfo());
|
|
|
|
|
+ releaseProductByBatch.setReleaseStatus(ReleaseStatus.had_exists.getPhrase());
|
|
|
|
|
+ releaseProductByBatch.setReleaseCode(ReleaseStatus.had_exists.value());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ commonDao.save(releaseProductByBatchs, ReleaseProductByBatch.class);
|
|
|
|
|
+ long l2 = System.currentTimeMillis();
|
|
|
|
|
+ System.err.println("l2--------------l1 testyuj" + (l2 - l1));
|
|
|
releaseProductByBatchDao.callReleaseExistValidProcedure(batch, isAPerson, enUU);
|
|
releaseProductByBatchDao.callReleaseExistValidProcedure(batch, isAPerson, enUU);
|
|
|
|
|
+ long l3 = System.currentTimeMillis();
|
|
|
|
|
+ System.err.println("l3--------------l2 testyuj" + (l3 - l2));
|
|
|
if (isAPerson) {
|
|
if (isAPerson) {
|
|
|
- for (ReleaseProductByBatch releaseProductByBatch : addList) {
|
|
|
|
|
|
|
+ for (ReleaseProductByBatch releaseProductByBatch : releaseProductByBatchs) {
|
|
|
Long productid = releaseProductByBatch.getProductid();
|
|
Long productid = releaseProductByBatch.getProductid();
|
|
|
if (productid != null) {
|
|
if (productid != null) {
|
|
|
List<ProductPerson> productPersonList = productPersonDao.findByProductId(productid);
|
|
List<ProductPerson> productPersonList = productPersonDao.findByProductId(productid);
|
|
@@ -242,16 +265,79 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ Long l4 = 0l;
|
|
|
|
|
+ String strCount = "";
|
|
|
if (isPcb) {
|
|
if (isPcb) {
|
|
|
- releaseProductByBatchDao.callValidProcedurePcb(enUU, batch);
|
|
|
|
|
|
|
+ strCount = releaseProductByBatchDao.callValidProcedurePcb(enUU, batch);
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+ // final Object[] obj = new Object[]{enUU, batch};
|
|
|
|
|
+// final Object[] obj = new Object[]{enUU, batch};
|
|
|
|
|
+// String sql = "/*#mycat:db_type=master*/ set @enuu = %s; set @batch = '%s'; call PRODUCT_RELEASE_VALID_V4(@enuu, @batch, @rest); select @rest";
|
|
|
|
|
+
|
|
|
|
|
+// String sql = "/*#mycat:db_type=master*/ set @enuu = %s; set @enName = '%s'; set @batch = '%s'; call RELEASE_TO_GOODS_V3(@enuu, @enName, @batch, @out); select @out";
|
|
|
|
|
+// final String updateSql = String.format(sql, obj);
|
|
|
|
|
+// String num = jdbcTemplate.execute(new StatementCallback<String>() {
|
|
|
|
|
+//
|
|
|
|
|
+// @Override
|
|
|
|
|
+// public String doInStatement(Statement stmt) throws SQLException, DataAccessException {
|
|
|
|
|
+// stmt.executeQuery(updateSql);
|
|
|
|
|
+// ResultSet rs = stmt.getResultSet();
|
|
|
|
|
+// if (null != rs) {
|
|
|
|
|
+// rs.next();
|
|
|
|
|
+// return rs.getString(1);
|
|
|
|
|
+// }
|
|
|
|
|
+// return "0-0-0";
|
|
|
|
|
+// }
|
|
|
|
|
+// });
|
|
|
|
|
+// final Long uu = enUU;
|
|
|
|
|
+// final String ba = batch;
|
|
|
|
|
+// jdbcTemplate.execute(
|
|
|
|
|
+// new CallableStatementCreator() {
|
|
|
|
|
+// @Override
|
|
|
|
|
+// public CallableStatement createCallableStatement(Connection con) throws SQLException {
|
|
|
|
|
+// String storedProc = "{call PRODUCT_RELEASE_VALID_V4(?, ?)}";// 调用的sql
|
|
|
|
|
+// CallableStatement cs = con.prepareCall(storedProc);
|
|
|
|
|
+// cs.setLong(1, uu);// 设置输入参数的值
|
|
|
|
|
+// cs.setString(2, ba);// 设置输入参数的值
|
|
|
|
|
+// cs.registerOutParameter(3, Types.VARCHAR);// 注册输出参数的类型
|
|
|
|
|
+// return cs;
|
|
|
|
|
+// }
|
|
|
|
|
+// }, new CallableStatementCallback() {
|
|
|
|
|
+// @Override
|
|
|
|
|
+// public Object doInCallableStatement(CallableStatement cs) throws SQLException, DataAccessException {
|
|
|
|
|
+// boolean exist = cs.execute();
|
|
|
|
|
+// ResultSet resultSet = cs.getResultSet();
|
|
|
|
|
+// if (exist) {
|
|
|
|
|
+// while (resultSet.next()) {
|
|
|
|
|
+//// System.out.println(resultSet.getString(1));
|
|
|
|
|
+// return resultSet.getString(1);
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
+// return "";
|
|
|
|
|
+// }
|
|
|
|
|
+// });
|
|
|
releaseProductByBatchDao.callValidProcedure(enUU, batch);
|
|
releaseProductByBatchDao.callValidProcedure(enUU, batch);
|
|
|
- }
|
|
|
|
|
|
|
+ l4 = System.currentTimeMillis();
|
|
|
|
|
+ System.err.println("l4--------------l3 testyuj" + (l4 - l3));
|
|
|
|
|
+ }
|
|
|
|
|
+ Integer filter = 0, failure = 0, success = 0;
|
|
|
|
|
+// if (!StringUtilB2C.isEmpty(strCount)) {
|
|
|
|
|
+// String[] split = strCount.split(SplitChar.HYPHEN);
|
|
|
|
|
+// filter = Integer.valueOf(split[0]);
|
|
|
|
|
+// failure = Integer.valueOf(split[1]);
|
|
|
|
|
+// success = Integer.valueOf(split[2]);
|
|
|
|
|
+// }
|
|
|
|
|
|
|
|
- Integer filter = releaseProductByBatchDao.getCountOfImportFail(userUU, batch, failCode);
|
|
|
|
|
- Integer failure = releaseProductByBatchDao.getCountPublisherUuAndBatchAndReleaseCode(userUU, batch, ReleaseStatus.failure.value());
|
|
|
|
|
- Integer success = releaseProductByBatchDao.getCountPublisherUuAndBatchAndReleaseCode(userUU, batch, ReleaseStatus.success.value());
|
|
|
|
|
|
|
+ filter = releaseProductByBatchDao.getCountOfImportFail(userUU, batch, failCode);
|
|
|
|
|
+ long l5 = System.currentTimeMillis();
|
|
|
|
|
+ System.out.print("l5-l4---------testyuj" + (l5-l4));
|
|
|
|
|
+ failure = releaseProductByBatchDao.getCountPublisherUuAndBatchAndReleaseCode(userUU, batch, ReleaseStatus.failure.value());
|
|
|
|
|
+ long l6 = System.currentTimeMillis();
|
|
|
|
|
+ System.out.print("l6-l5---------testyuj" + (l6-l5));
|
|
|
|
|
+ success = releaseProductByBatchDao.getCountPublisherUuAndBatchAndReleaseCode(userUU, batch, ReleaseStatus.success.value());
|
|
|
|
|
+ long l7 = System.currentTimeMillis();
|
|
|
|
|
+ System.out.print("l7-l6---------testyuj" + (l7-l6));
|
|
|
|
|
+ modelMap.put("total", total);
|
|
|
modelMap.put("total", total);
|
|
modelMap.put("total", total);
|
|
|
modelMap.put("success", success);
|
|
modelMap.put("success", success);
|
|
|
modelMap.put("failure", failure);
|
|
modelMap.put("failure", failure);
|