|
|
@@ -243,44 +243,36 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
releaseProductByBatch.setErrmsg(releaseProductByBatch.getErrmsg().substring(1));
|
|
|
releaseProductByBatch.setReleaseCode(ReleaseStatus.lack_info.value());
|
|
|
releaseProductByBatch.setReleaseStatus(ReleaseStatus.lack_info.getPhrase());
|
|
|
- } else {
|
|
|
- // 导入成功的需要判断自定义标签是否重复
|
|
|
- if (!CollectionUtils.isEmpty(releaseProductByBatchs) && releaseProductByBatch.getTag() != null) {
|
|
|
- if (validateTagInfo(releaseProductByBatch, releaseProductByBatchs)) {
|
|
|
- releaseProductByBatch.setTag(null);
|
|
|
- }
|
|
|
- }
|
|
|
- validateRepeatInExcel(releaseProductByBatchs, releaseProductByBatch, isImport);
|
|
|
}
|
|
|
- // 简单验证数据,防止空行保存的情况
|
|
|
- if (blankNum != 3) {
|
|
|
+ // 简单验证数据,防止空行保存的情况(品牌、类目、型号、库存量)
|
|
|
+ if (blankNum != 4) {
|
|
|
total++;
|
|
|
releaseProductByBatchs.add(releaseProductByBatch);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
Long userUU = SystemSession.getUser().getUserUU();
|
|
|
Long enUU = SystemSession.getUser().getEnterprise().getUu();
|
|
|
List<ReleaseProductByBatch> addList = new ArrayList<>(releaseProductByBatchs.size());
|
|
|
addList.addAll(releaseProductByBatchs);
|
|
|
- resetRepeatData(addList, isImport, isAPerson);
|
|
|
+ commonDao.save(addList, ReleaseProductByBatch.class);
|
|
|
+ releaseProductByBatchDao.callReleaseExistValidProcedure(batch, isAPerson, enUU);
|
|
|
if (isAPerson) {
|
|
|
for (ReleaseProductByBatch releaseProductByBatch : addList) {
|
|
|
- List<Product> productList = productDao.findByEnUUAndPcmpcodeAndPbrandenAndB2cEnabled(enUU,releaseProductByBatch.getB2cCode(),
|
|
|
- releaseProductByBatch.getB2cBranden(),IntegerConstant.YES_SHORT);
|
|
|
- if (!CollectionUtils.isEmpty(productList)) {
|
|
|
- List<ProductPerson> productPersonList = productPersonDao.findByProductId(productList.get(0).getId());
|
|
|
- if (!CollectionUtils.isEmpty(productPersonList)) {
|
|
|
+ Long productid = releaseProductByBatch.getProductid();
|
|
|
+ if (productid != null) {
|
|
|
+ List<ProductPerson> productPersonList = productPersonDao.findByProductId(productid);
|
|
|
+ if (!CollectionUtils.isEmpty(productPersonList)) {
|
|
|
releaseProductByBatch.setErrmsg(ErrorInfoConstant.REPEAT_INFO.getInfo());
|
|
|
releaseProductByBatch.setReleaseCode(ReleaseStatus.had_exists.value());
|
|
|
releaseProductByBatch.setReleaseStatus(ReleaseStatus.had_exists.getPhrase());
|
|
|
total --;
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- commonDao.save(addList, ReleaseProductByBatch.class);
|
|
|
|
|
|
if (isPcb) {
|
|
|
releaseProductByBatchDao.callValidProcedurePcb(enUU, batch);
|
|
|
@@ -1721,7 +1713,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
}
|
|
|
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_V2(@enuu, @enName, @batch, @out); select @out";
|
|
|
+ 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>() {
|
|
|
|