demand: TMS系统 - 运输管理 - 优化漏组批次订单定时/实时扫描策略,精确漏组批次订单推荐范围
committer: heyu
This commit is contained in:
parent
6826a06797
commit
11dc5915f8
@ -5134,7 +5134,7 @@ public class EmisBaseService {
|
|||||||
|
|
||||||
// 检查第一级是否至少有一个节点匹配
|
// 检查第一级是否至少有一个节点匹配
|
||||||
boolean hasFirstLevelMatch = false;
|
boolean hasFirstLevelMatch = false;
|
||||||
// 收集所有第一级节点的子节点(第二级)
|
// 收集第一级节点的子节点(第二级)
|
||||||
Set<EmisTransPlanRule> secondLevelRules = new HashSet<>();
|
Set<EmisTransPlanRule> secondLevelRules = new HashSet<>();
|
||||||
|
|
||||||
for (EmisTransPlanRule firstLevelRule : firstLevelRules) {
|
for (EmisTransPlanRule firstLevelRule : firstLevelRules) {
|
||||||
@ -5148,18 +5148,26 @@ public class EmisBaseService {
|
|||||||
&& !batch.getEtd().before(firstLevelRule.getStartDate())) {
|
&& !batch.getEtd().before(firstLevelRule.getStartDate())) {
|
||||||
firstLevelMatch = true;
|
firstLevelMatch = true;
|
||||||
list.add(firstLevelRule);
|
list.add(firstLevelRule);
|
||||||
// 收集当前第一级节点的所有子节点到第二级集合中
|
|
||||||
if (!CollectionUtil.isEmpty(firstLevelRule.getChildren())) {
|
|
||||||
secondLevelRules.addAll(firstLevelRule.getChildren());
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (firstLevelMatch) {
|
if (firstLevelMatch) {
|
||||||
hasFirstLevelMatch = true;
|
hasFirstLevelMatch = true;
|
||||||
|
// 如果当前节点匹配,则只收集该节点的子节点
|
||||||
|
if (!CollectionUtil.isEmpty(firstLevelRule.getChildren())) {
|
||||||
|
secondLevelRules.addAll(firstLevelRule.getChildren());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果第一级都不满足,则收集所有第一级节点的子节点
|
||||||
|
if (!hasFirstLevelMatch) {
|
||||||
|
for (EmisTransPlanRule firstLevelRule : firstLevelRules) {
|
||||||
|
if (!CollectionUtil.isEmpty(firstLevelRule.getChildren())) {
|
||||||
|
secondLevelRules.addAll(firstLevelRule.getChildren());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 如果第二级为空,说明已经到底了,返回当前节点匹配且第一级至少有一个匹配的结果
|
// 如果第二级为空,说明已经到底了,返回当前节点匹配且第一级至少有一个匹配的结果
|
||||||
@ -5183,18 +5191,26 @@ public class EmisBaseService {
|
|||||||
&& !batch.getEtd().before(secondLevelRule.getStartDate())) {
|
&& !batch.getEtd().before(secondLevelRule.getStartDate())) {
|
||||||
secondLevelMatch = true;
|
secondLevelMatch = true;
|
||||||
list.add(secondLevelRule);
|
list.add(secondLevelRule);
|
||||||
// 收集当前第二级节点的所有子节点到第三级集合中
|
|
||||||
if (!CollectionUtil.isEmpty(secondLevelRule.getChildren())) {
|
|
||||||
thirdLevelRules.addAll(secondLevelRule.getChildren());
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (secondLevelMatch) {
|
if (secondLevelMatch) {
|
||||||
hasSecondLevelMatch = true;
|
hasSecondLevelMatch = true;
|
||||||
|
// 如果当前节点匹配,则只收集该节点的子节点
|
||||||
|
if (!CollectionUtil.isEmpty(secondLevelRule.getChildren())) {
|
||||||
|
thirdLevelRules.addAll(secondLevelRule.getChildren());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果第二级都不满足,则收集所有第二级节点的子节点
|
||||||
|
if (!hasSecondLevelMatch) {
|
||||||
|
for (EmisTransPlanRule secondLevelRule : secondLevelRules) {
|
||||||
|
if (!CollectionUtil.isEmpty(secondLevelRule.getChildren())) {
|
||||||
|
thirdLevelRules.addAll(secondLevelRule.getChildren());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 递归处理下一级,并收集结果
|
// 递归处理下一级,并收集结果
|
||||||
@ -5236,14 +5252,19 @@ public class EmisBaseService {
|
|||||||
|
|
||||||
if (currentLevelMatch) {
|
if (currentLevelMatch) {
|
||||||
hasCurrentLevelMatch = true;
|
hasCurrentLevelMatch = true;
|
||||||
if (CollectionUtil.isEmpty(currentLevelRule.getChildren())) {
|
// 如果当前节点匹配,则只收集该节点的子节点
|
||||||
return true;
|
if (!CollectionUtil.isEmpty(currentLevelRule.getChildren())) {
|
||||||
|
nextLevelRules.addAll(currentLevelRule.getChildren());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 收集当前级节点的所有子节点到下一级集合中
|
// 如果当前级都不满足,则收集所有当前级节点的子节点
|
||||||
if (!CollectionUtil.isEmpty(currentLevelRule.getChildren())) {
|
if (!hasCurrentLevelMatch) {
|
||||||
nextLevelRules.addAll(currentLevelRule.getChildren());
|
for (EmisTransPlanRule currentLevelRule : currentLevelRules) {
|
||||||
|
if (!CollectionUtil.isEmpty(currentLevelRule.getChildren())) {
|
||||||
|
nextLevelRules.addAll(currentLevelRule.getChildren());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user