Merge pull request 'demand: 定时扫描漏组批次自测bug修改' (#51) from develop into master

Reviewed-on: http://git.xdadan.loc/tanex/emis-service/pulls/51
This commit is contained in:
heyu 2025-06-11 17:23:25 +08:00
commit 0c687733ce

View File

@ -508,7 +508,7 @@ public class EmisTmsSiteBatchMissServiceImpl extends EmisBaseService implements
}
private boolean checkRule(EmisTransPlanRule rule, List<EmisTmsSiteBatch> waybillBatches,
List<EmisTransPlanRule> list) {
List<EmisTransPlanRule> list) {
// 检查当前节点是否匹配
boolean currentMatch = false;
for (EmisTmsSiteBatch batch : waybillBatches) {
@ -523,20 +523,22 @@ public class EmisTmsSiteBatchMissServiceImpl extends EmisBaseService implements
}
}
// 如果是叶子节点,直接返回当前节点是否匹配
// 如果是叶子节点,返回当前节点的匹配结果
if (CollectionUtil.isEmpty(rule.getChildren())) {
return currentMatch;
}
// 检查所有子节点,只要有一条路径匹配就返回true
// 检查所有子节点,记录所有匹配的节点
boolean allChildrenMatch = true;
for (EmisTransPlanRule childRule : rule.getChildren()) {
if (checkRule(childRule, waybillBatches, list)) {
return true;
boolean childMatch = checkRule(childRule, waybillBatches, list);
if (!childMatch) {
allChildrenMatch = false;
}
}
// 如果当前节点不匹配,或者所有子节点都不匹配,返回false
return false;
// 返回当前节点和所有子节点的匹配结果
return currentMatch && allChildrenMatch;
}
private void setMissRecords(List<EmisTmsSiteBatchMiss> missRecords, EmisTransPlanRule rule,