fix(sales): 过滤无需同步的公司和单据

- 在 SoSaleReturnPluginInitializerToC 类中添加了过滤逻辑,排除不需要同步的公司和单据- 具体改动:
  - 在 test(SoHeaderSearchResponse.SoHeader) 方法中增加了对特定场景下关闭日期为空的单据进行过滤的逻辑
  - 在 test(StockinOrderSearchResponse.StockinOrder) 方法中增加了对入库日期为空的单据进行过滤的逻辑
  - 优化了错误信息提示,使用 storeCode.trim() 替代 storeCode
This commit is contained in:
liuy 2024-12-26 17:24:11 +08:00
parent 227562af02
commit 394c7efd7b
2 changed files with 12 additions and 3 deletions

View File

@ -313,6 +313,9 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
if (ProfilesActiveConstant.FILTER_COMPANY.contains(header.getCompanyCode().trim())) { if (ProfilesActiveConstant.FILTER_COMPANY.contains(header.getCompanyCode().trim())) {
return true; return true;
} }
if (sceneType.equals("tran") && (header.getClosedAt() == null || "".equals(header.getClosedAt().trim()))) {
return true;
}
} }
return false; return false;
} }
@ -386,9 +389,14 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
public boolean test(StockinOrderSearchResponse.StockinOrder headerDetailsDto) { public boolean test(StockinOrderSearchResponse.StockinOrder headerDetailsDto) {
StockinOrderSearchResponse.StockinOrder.StockinH header = headerDetailsDto.getHeader(); StockinOrderSearchResponse.StockinOrder.StockinH header = headerDetailsDto.getHeader();
if (header != null && header.getCompanyCode() != null) { if (header != null && header.getCompanyCode() != null) {
//过滤掉不需要的公司
if (ProfilesActiveConstant.FILTER_COMPANY.contains(header.getCompanyCode().trim())) { if (ProfilesActiveConstant.FILTER_COMPANY.contains(header.getCompanyCode().trim())) {
return true; return true;
} }
//过滤掉入库日期为空的单据
if (header.getClosedAt() == null || "".equals(header.getClosedAt().trim())) {
return true;
}
} }
return false; return false;
} }
@ -1447,7 +1455,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
// String storeCode2 = header.getStoreCode(); // String storeCode2 = header.getStoreCode();
// Assert.notNull(storeCode2, "O店铺编码不能为空"); // Assert.notNull(storeCode2, "O店铺编码不能为空");
BdDefdocEntity bdDefdocEntity1 = cacheTocMapVoV2.getStringBdDefdocEntityMap1().get(storeCode.trim()); BdDefdocEntity bdDefdocEntity1 = cacheTocMapVoV2.getStringBdDefdocEntityMap1().get(storeCode.trim());
Assert.notNull(bdDefdocEntity1, "根据O店铺编码({})无法匹配到U8C店铺档案", storeCode); Assert.notNull(bdDefdocEntity1, "根据O店铺编码({})无法匹配到U8C店铺档案", storeCode.trim());
//字段拷贝 //字段拷贝
for (int j = 0; j < details.size(); j++) { for (int j = 0; j < details.size(); j++) {

View File

@ -44,9 +44,10 @@ public class SoSaleReturnPluginInitializerToCTest {
// List<StartAndEndVo> startAndEndVos = soSaleReturnPluginInitializerToC.calculateCalculateEntireDayPeriod(null); // List<StartAndEndVo> startAndEndVos = soSaleReturnPluginInitializerToC.calculateCalculateEntireDayPeriod(null);
// soSaleReturnPluginInitializerToC.startImplementStockByTime(startAndEndVos.get(0).getStart_time(), startAndEndVos.get(0).getEnd_time()); // soSaleReturnPluginInitializerToC.startImplementStockByTime(startAndEndVos.get(0).getStart_time(), startAndEndVos.get(0).getEnd_time());
try { try {
soSaleReturnPluginInitializerToC.startImplementByTradeTime("2024-12-23 23:05:34", "2024-12-23 23:05:34", "2"); // soSaleReturnPluginInitializerToC.startImplementByTradeTime("2024-12-23 23:05:34", "2024-12-23 23:05:34", "2");
soSaleReturnPluginInitializerToC.startImplementByCode("LETS-RE2024122500002233", "tran");
// soSaleReturnPluginInitializerToC.startImplementStockByTime("2024-12-24 16:02:17", "2024-12-24 16:02:17", "0"); // soSaleReturnPluginInitializerToC.startImplementStockByTime("2024-12-24 16:02:17", "2024-12-24 16:02:17", "0");