feat(sales): 过滤没有交易成功的明细行
- 在 SoSaleOutPluginInitializerToB 和 SoSaleOutPluginInitializerToC 类中添加 filterSuccessfulTrade 方法 -该方法用于过滤掉没有交易成功时间的明细行数据 - 在处理 "tran" 场景时调用该方法,以确保只处理交易成功的数据
This commit is contained in:
parent
7154008bae
commit
9ef45793f7
|
@ -416,6 +416,8 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
|
||||||
if (sceneType.equals("stock")) {
|
if (sceneType.equals("stock")) {
|
||||||
getSetStock(headerDetailsDtoList);
|
getSetStock(headerDetailsDtoList);
|
||||||
} else if (sceneType.equals("tran")) {
|
} else if (sceneType.equals("tran")) {
|
||||||
|
//过滤掉没有交易成功的明细行
|
||||||
|
filterSuccessfulTrade(headerDetailsDtoList);
|
||||||
getSetStockTran(headerDetailsDtoList);
|
getSetStockTran(headerDetailsDtoList);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -2922,4 +2924,22 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
|
||||||
logger.error("{} 插件:{},打印拉取到的单据号出错", type, getPluginName(), e);
|
logger.error("{} 插件:{},打印拉取到的单据号出错", type, getPluginName(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 过滤掉没有交易成功时间的明细行数据
|
||||||
|
*
|
||||||
|
* @author liuyang
|
||||||
|
*/
|
||||||
|
private void filterSuccessfulTrade(List<HeaderDetailsDto> headerDetailsDtoList) {
|
||||||
|
if (headerDetailsDtoList != null && headerDetailsDtoList.size() > 0) {
|
||||||
|
for (int i = 0; i < headerDetailsDtoList.size(); i++) {
|
||||||
|
HeaderDetailsDto headerDetailsDto = headerDetailsDtoList.get(i);
|
||||||
|
List<DetailsDto> details = headerDetailsDto.getDetails();
|
||||||
|
if (details != null && details.size() > 0) {
|
||||||
|
List<DetailsDto> filteredDetails = details.stream().filter(detail -> detail.getTradeSuccessAt() != null && !detail.getTradeSuccessAt().isEmpty()).collect(Collectors.toList());
|
||||||
|
headerDetailsDto.setDetails(filteredDetails);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -404,6 +404,8 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
||||||
if (sceneType.equals("stock")) {
|
if (sceneType.equals("stock")) {
|
||||||
getSetStock(headerDetailsDtoList, "2");
|
getSetStock(headerDetailsDtoList, "2");
|
||||||
} else if (sceneType.equals("tran")) {
|
} else if (sceneType.equals("tran")) {
|
||||||
|
//过滤掉没有交易成功的明细行
|
||||||
|
filterSuccessfulTrade(headerDetailsDtoList);
|
||||||
getSetTran(headerDetailsDtoList, "2");
|
getSetTran(headerDetailsDtoList, "2");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -4104,4 +4106,22 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
||||||
}
|
}
|
||||||
return headerDetailsDtoList;
|
return headerDetailsDtoList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 过滤掉没有交易成功时间的明细行数据
|
||||||
|
*
|
||||||
|
* @author liuyang
|
||||||
|
*/
|
||||||
|
private void filterSuccessfulTrade(List<HeaderDetailsDto> headerDetailsDtoList) {
|
||||||
|
if (headerDetailsDtoList != null && headerDetailsDtoList.size() > 0) {
|
||||||
|
for (int i = 0; i < headerDetailsDtoList.size(); i++) {
|
||||||
|
HeaderDetailsDto headerDetailsDto = headerDetailsDtoList.get(i);
|
||||||
|
List<DetailsDto> details = headerDetailsDto.getDetails();
|
||||||
|
if (details != null && details.size() > 0) {
|
||||||
|
List<DetailsDto> filteredDetails = details.stream().filter(detail -> detail.getTradeSuccessAt() != null && !detail.getTradeSuccessAt().isEmpty()).collect(Collectors.toList());
|
||||||
|
headerDetailsDto.setDetails(filteredDetails);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -89,13 +89,13 @@ public class SoSaleOutPluginInitializerToBTest {
|
||||||
|
|
||||||
// soSaleOutPluginInitializerToB.startImplementByStockTime("2024-10-31 14:48:41", "2024-10-31 14:48:41");
|
// soSaleOutPluginInitializerToB.startImplementByStockTime("2024-10-31 14:48:41", "2024-10-31 14:48:41");
|
||||||
|
|
||||||
// soSaleOutPluginInitializerToB.startImplementByCode("LETS-SH2024110700026623", "tran");
|
soSaleOutPluginInitializerToB.startImplementByCode("LETS-SH2025010200030571", "tran");
|
||||||
|
|
||||||
|
|
||||||
// soSaleOutPluginInitializerToB.startImplementByStockTime("2024-11-08 19:18:02", "2024-11-08 19:18:02");
|
// soSaleOutPluginInitializerToB.startImplementByStockTime("2024-11-08 19:18:02", "2024-11-08 19:18:02");
|
||||||
|
|
||||||
|
|
||||||
soSaleOutPluginInitializerToB.startImplementByTranTime("2025-01-04 19:21:25", "2025-01-04 19:21:25");
|
// soSaleOutPluginInitializerToB.startImplementByTranTime("2025-01-04 19:21:25", "2025-01-04 19:21:25");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue