✨ 全局入口上报异常不再要求指定节点

从小程序首页快捷格、打卡页底部按钮进入上报时不再要求选择节点,node_code / node_name 落空;
要指定环节只能从节点卡片进入(入口即已确定环节,节点名仍从过程配置回填、不信任请求体)。

未指明节点的异常无从定位阻断区间,按「阻断该运单全部未打卡节点」处理,含在途。
此前「异常必须归属节点」的校验与相应术语表述一并作废。
This commit is contained in:
2026-10-06 12:36:07 +08:00
parent c50a86d5c4
commit 4e5b6ce8f3
3 changed files with 13 additions and 14 deletions
@@ -138,18 +138,18 @@ public class ExceptionDisposalServiceImpl
throw new ServiceException("请关联运单后再上报");
}
// 异常必须归属到某个过程节点:没有节点的异常无从定位阻断区间,只能整单停摆。
// 节点名取自过程配置而非请求体:上报页传什么不影响入库,避免落进一个该节点并不叫的名字。
// 节点可以为空:全局入口(首页快捷格、打卡页底部按钮)上报的异常不指定环节,
// 它无从定位阻断区间,由门禁按「阻断该运单全部未打卡节点」处理。
// 节点非空时才要求它确属该运单;节点名取自过程配置而非请求体,避免落进一个该节点并不叫的名字。
String nodeCode = Func.toStr(request.getNodeCode(), "").trim();
if (Func.isBlank(nodeCode)) {
throw new ServiceException("请选择异常节点");
if (Func.isNotEmpty(nodeCode)) {
Map<String, Object> nodeCfg = driverWaybillService.findPunchNode(disposal.getWaybillId(), nodeCode);
if (nodeCfg == null) {
throw new ServiceException("异常节点不存在");
}
disposal.setNodeCode(WaybillProcessSupport.nodeKey(nodeCfg));
disposal.setNodeName(WaybillProcessSupport.nodeName(nodeCfg));
}
Map<String, Object> nodeCfg = driverWaybillService.findPunchNode(disposal.getWaybillId(), nodeCode);
if (nodeCfg == null) {
throw new ServiceException("异常节点不存在");
}
disposal.setNodeCode(WaybillProcessSupport.nodeKey(nodeCfg));
disposal.setNodeName(WaybillProcessSupport.nodeName(nodeCfg));
if (!save(disposal)) {
throw new ServiceException("异常上报失败");
@@ -469,9 +469,8 @@ public final class WaybillProcessSupport {
if (punchNodes.isEmpty() || fromNodeCode == null) {
return blocked;
}
// 空串代表「未指明节点」,阻断全部可打卡节点。
// 新上报已强制要求节点,此分支只为**存量数据**保留——去掉它,那些没有节点的
// 未了结异常会突然不再阻断任何节点,等于悄悄放开了打卡。
// 空串代表「未指明节点」——全局入口(首页快捷格、打卡页底部按钮)不指定环节,
// 这类异常无从定位区间,只能阻断全部可打卡节点。
if (Func.isEmpty(fromNodeCode)) {
for (Map<String, Object> node : punchNodes) {
blocked.add(nodeKey(node));
@@ -82,7 +82,7 @@ class WaybillProcessSupportTest {
}
@Test
@DisplayName("未指明节点的异常(存量数据)阻断全部打卡节点,含在途")
@DisplayName("未指明节点的异常(全局入口上报)阻断全部打卡节点,含在途")
void exceptionWithoutNodeBlocksEverything() {
Set<String> blocked = WaybillProcessSupport.blockedNodeKeys(TRANSPORT_JSON, Arrays.asList(""));