|
|
@@ -75,7 +75,6 @@ import java.util.regex.Matcher;
|
|
|
import java.util.regex.Pattern;
|
|
|
|
|
|
import static com.uas.platform.b2c.core.utils.NumberUtil.fractionNumCeil;
|
|
|
-import static com.uas.platform.b2c.external.erp.commodity.util.ModelConverter.dateFormat;
|
|
|
|
|
|
@Service
|
|
|
public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchService {
|
|
|
@@ -342,11 +341,8 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
}
|
|
|
}
|
|
|
if (!isAPerson && !isPcb) {
|
|
|
- logger.info(String.format("%s 批次上架测试代码", dateFormat.format(new Date())));
|
|
|
- System.err.println("批次上架测试代码");
|
|
|
String publish = publishByBatch(batch, isPcb);
|
|
|
modelMap.put("publish", publish);
|
|
|
- System.err.println("批次上架测试代码");
|
|
|
}
|
|
|
modelMap.put("total", total);
|
|
|
modelMap.put("success", success);
|
|
|
@@ -1714,7 +1710,6 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
@Transactional
|
|
|
@Override
|
|
|
public String publishByBatch(String batch, boolean isPcb) {
|
|
|
- System.err.println("测试信息的0" + "---------------------");
|
|
|
if (StringUtils.isEmpty(batch)) {
|
|
|
return "0";
|
|
|
}
|
|
|
@@ -1723,7 +1718,6 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
if (CollectionUtils.isEmpty(releaseProductByBatchList)) {
|
|
|
return String.valueOf(IntegerConstant.NO_SHORT);
|
|
|
}
|
|
|
- System.err.println("测试信息的1-1" + "---------------------");
|
|
|
Map<String, Object> map = convertProduct(releaseProductByBatchList, false, isPcb);
|
|
|
if (map == null || map.size() == 0) {
|
|
|
return "0";
|
|
|
@@ -1733,15 +1727,12 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
savePcbInfo(idSet, map);
|
|
|
}
|
|
|
Integer num = releaseToGoods(releaseProductByBatchList);
|
|
|
- System.err.println("测试信息的1" + "---------------------");
|
|
|
String updateReleaseSql = "/*#mycat:db_type=master*/ update trade$releasebybatch set rel_releasecode = 101,rel_releasestatus = '已发布' where (rel_releasecode = 112 OR rel_releasecode = 113) and rel_batchid = '%s';";
|
|
|
final String updateRelease = String.format(updateReleaseSql, new Object[]{batch});
|
|
|
jdbcTemplate.execute(updateRelease);
|
|
|
- System.err.println("测试信息的2" + "---------------------");
|
|
|
ArrayList<Long> list = new ArrayList<>();
|
|
|
list.addAll((Set<Long>)map.get("prIds"));
|
|
|
afterPublishToGoodsDo(list, (Set<Long>)map.get("reIds"), batch);
|
|
|
- System.err.println("测试信息的3" + "---------------------");
|
|
|
return StringUtilB2C.getStr(num);
|
|
|
}
|
|
|
|
|
|
@@ -1840,7 +1831,6 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
}
|
|
|
|
|
|
private Map<String, Object> convertProduct (List<ReleaseProductByBatch> releaseProductByBatchList, boolean isAPerson , boolean isPcb) {
|
|
|
- System.err.println("测试信息的convertProduct1" + "---------------------");
|
|
|
if (CollectionUtils.isEmpty(releaseProductByBatchList)) {
|
|
|
return null;
|
|
|
}
|
|
|
@@ -1910,13 +1900,10 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- System.err.println("测试信息的convertProduct 2" + "---------------------");
|
|
|
List<ReleaseProductByBatch> reList = new ArrayList<>();
|
|
|
if (productsfromRelease.size() != 0) {
|
|
|
- System.err.println("需要插入的新的物料的信息" + productsfromRelease.size());
|
|
|
productService.saveByJdbcTemplate(productsfromRelease);
|
|
|
List<Product> productes = productService.findProductIdAndProdnumsByProdNums(proNums);
|
|
|
- System.err.println("获取到的新插入的信息" + productes.size());
|
|
|
for (Product producte : productes) {
|
|
|
ProductPrivate productPrivate = new ProductPrivate();
|
|
|
productPrivate.setB2cEnabled(IntegerConstant.YES_SHORT);
|
|
|
@@ -1934,15 +1921,12 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- System.err.println("测试信息的convertProduct 3" + "---------------------");
|
|
|
if (CollectionUtils.isNotEmpty(reList)) {
|
|
|
udpatePridAndRrodnum(reList);
|
|
|
}
|
|
|
- System.err.println("测试信息的convertProduct 4" + "---------------------");
|
|
|
if (CollectionUtils.isNotEmpty(productPrivates)) {
|
|
|
commonDao.save(productPrivates, ProductPrivate.class);
|
|
|
}
|
|
|
- System.err.println("测试信息的convertProduct 5" + "---------------------");
|
|
|
if (reIds.size() > 0) {
|
|
|
map.put("reIds", reIds);
|
|
|
}
|