fix:审批时间缺失导致无法审批的原因

This commit is contained in:
lulz1 2024-07-03 14:27:13 +08:00
parent b1add5a293
commit 453a951122
1 changed files with 2 additions and 1 deletions

View File

@ -58,7 +58,8 @@ public abstract class ApprovalProcess {
ApprovalRecord approvalRecord = ApprovalRecord.of(routeOrder, this);
List<Leg> legs = routeOrder.getLegItems()
.stream()
.filter(legItem -> legItem.getLastEvent().getEventType().equals(LEG_APPROVAL_STATUS_PREPARE))
.filter(leg -> leg.getLastEvent() != null &&
leg.getLastEvent().getEventType().equals(LEG_APPROVAL_STATUS_PREPARE))
.toList();
if (legs.isEmpty()) {
throw new CommandException("不存在需要审批的行程");