perf(sales): 优化销售订单处理批次大小并修复相关问题- 将销售订单处理的批次大小从 800调整为 200,以提高处理效率

- 修复了引用订单代码为空时可能导致的空指针异常
- 注释掉了日志记录优惠金额分摊结果的代码,以减少不必要的日志输出
- 更新了测试代码,使用新的订单代码进行测试
This commit is contained in:
liuy 2024-10-22 14:44:18 +08:00
parent 14ec5bfa68
commit 4b0a11ae18
4 changed files with 16 additions and 12 deletions

View File

@ -615,7 +615,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
}
//每50作为一个批次插入主表根据主键id判断是否重复如果重复的则不进行插入
List<List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDto>> ofssaleorderoutsearchList = SplitListByCountUtil.splitListByCount(headerDetailsDtoList1, 800);
List<List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDto>> ofssaleorderoutsearchList = SplitListByCountUtil.splitListByCount(headerDetailsDtoList1, 200);
for (int i = 0; i < ofssaleorderoutsearchList.size(); i++) {
List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDto> headerDtoList = ofssaleorderoutsearchList.get(i);
Thread thread = new Thread(new Runnable() {
@ -643,7 +643,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
}
//插入明细表
List<List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.DetailsDto>> detailsDtoList = SplitListByCountUtil.splitListByCount(headerDetailsDtoList2, 800);
List<List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.DetailsDto>> detailsDtoList = SplitListByCountUtil.splitListByCount(headerDetailsDtoList2, 200);
for (int i = 0; i < detailsDtoList.size(); i++) {
List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.DetailsDto> detailsDtos = detailsDtoList.get(i);
Thread thread = new Thread(new Runnable() {
@ -2493,9 +2493,11 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
// detailsDto.setHeaderDetailsDto(headerDetailsDto1);
// }
// }
com.hzya.frame.ttxofs.dto.ofssalesordersearch.HeaderDetailsDto headerDetailsDto1 = stringHeaderDetailsDtoMap.get(refOrderCode);
if (headerDetailsDto1 != null) {
detailsDto.setHeaderDetailsDto(headerDetailsDto1);
if (refOrderCode != null && !"".equals(refOrderCode)) {
com.hzya.frame.ttxofs.dto.ofssalesordersearch.HeaderDetailsDto headerDetailsDto1 = stringHeaderDetailsDtoMap.get(refOrderCode);
if (headerDetailsDto1 != null) {
detailsDto.setHeaderDetailsDto(headerDetailsDto1);
}
}
}
// String targetRefOrderCode = header.getRefOrderCode();

View File

@ -46,9 +46,9 @@ public class OfsOrderAfterSalesAmountAllocationUtil {
logger.error("batchTocSalesAmountAllocation方法抛出异常批量处理TOC售后订单分摊异常", e);
}
});
logger.info("=记录优惠金额分摊结果开始=");
printAmountOfMoneyNum(rerturnGoodsOrderSearchDataList);
logger.info("=记录优惠金额分摊结果完成=");
// logger.info("=记录优惠金额分摊结果开始=");
// printAmountOfMoneyNum(rerturnGoodsOrderSearchDataList);
// logger.info("=记录优惠金额分摊结果完成=");
}
/**

View File

@ -43,9 +43,9 @@ public class OfsOrderSaleAmountAllocationUtil {
logger.error("batchTocSalesAmountAllocation方法抛出异常批量处理TOC销售金额分摊异常", e);
}
});
logger.info("=记录优惠金额分摊结果开始=");
printAmountOfMoneyNum(headerDetailsDtoList);
logger.info("=记录优惠金额分摊结果完成=");
// logger.info("=记录优惠金额分摊结果开始=");
// printAmountOfMoneyNum(headerDetailsDtoList);
// logger.info("=记录优惠金额分摊结果完成=");
}
/**

View File

@ -79,8 +79,10 @@ public class SoSaleOutPluginInitializerToBTest {
// soSaleOutPluginInitializerToB.startImplementByCode("LETS-SH2024101700000270");
try {
soSaleOutPluginInitializerToB.startImplementByCode("LETS-SH2024101800025544", "stock");
// soSaleOutPluginInitializerToB.startImplementByCode("LETS-SH2024101800025544", "stock");
// soSaleOutPluginInitializerToB.startImplementByTranTime("2024-10-18 14:49:58", "2024-10-18 14:49:59");
String aaa = "LETS-SH2024101800024795";
soSaleOutPluginInitializerToB.startImplementByCode(aaa, "stock");
} catch (Exception e) {
e.printStackTrace();
}