From 570331321148b922a28a672e2533520edf57efab Mon Sep 17 00:00:00 2001 From: weicw1996 Date: Thu, 22 Oct 2026 13:47:32 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E6=9C=AB=E4=BD=8D=E6=89=93?= =?UTF-8?q?=E5=8D=A1=E5=9B=9E=E5=8D=95=E9=9C=80=E7=A1=AE=E8=AE=A4=E6=97=B6?= =?UTF-8?q?=E8=BF=9B=E5=85=A5=E5=BE=85=E5=9B=9E=E5=8D=95=E7=A1=AE=E8=AE=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/DriverWaybillServiceImpl.java | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/DriverWaybillServiceImpl.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/DriverWaybillServiceImpl.java index ae825828..9590a442 100644 --- a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/DriverWaybillServiceImpl.java +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/DriverWaybillServiceImpl.java @@ -520,19 +520,32 @@ public class DriverWaybillServiceImpl implements IDriverWaybillService { nodePunchMapper.insert(punch); advanceCurrentProcessNode(waybill, nodeCfg); - // 末位打卡节点是到货/卸货/签收、且回单无需确认完成时,本次打卡一并把运单置为完成; + // 末位打卡节点是到货/卸货/签收、且运单本身允许完成时,本次打卡就是运单的去向决定点: + // 回单无需确认 → 一并完成;回单需业务员确认 → 停在待回单确认等业务员确认。 // isLastDriverPunchNode 与 returnNeedsNoConfirmation 传的就是上面那份 processJson,未再调 resolveProcessJson 取过程配置。 String nodeKey = WaybillProcessSupport.nodeKey(nodeCfg); String nodeName = WaybillProcessSupport.nodeName(nodeCfg); + String waybillBusinessStatus = waybill.getBusinessStatus(); boolean completed = false; if (WaybillProcessSupport.isLastDriverPunchNode(processJson, nodeKey) && WaybillProcessSupport.isDeliveryNode(nodeKey, nodeName) - && WaybillProcessSupport.returnNeedsNoConfirmation(processJson) && canAutoCompleteWaybill(waybill)) { - completed = waybillService.completeWithoutDeptCheck(waybill.getId()); + if (WaybillProcessSupport.returnNeedsNoConfirmation(processJson)) { + completed = waybillService.completeWithoutDeptCheck(waybill.getId()); + if (completed) { + waybillBusinessStatus = STATUS_COMPLETED; + } + } else if (WaybillProcessSupport.STATUS_RUNNING.equals(waybill.getBusinessStatus())) { + // 只有进行中能进入:canAutoCompleteWaybill 的状态口径含待执行/待调度等,不能替代这一条; + // 待回单确认在 isPunchEnded 里算已结束,不能从结束态重进。 + waybill.setBusinessStatus(WaybillProcessSupport.STATUS_PENDING_RETURN_CONFIRM); + waybillService.updateById(waybill); + waybillBusinessStatus = WaybillProcessSupport.STATUS_PENDING_RETURN_CONFIRM; + } } DriverNodePunchVO vo = toNodePunchVO(punch); vo.setWaybillCompleted(completed); + vo.setWaybillBusinessStatus(waybillBusinessStatus); return vo; }