♻️ 上报门禁的节点编码比较忽略首尾空白,移除失去调用点的判据方法
This commit is contained in:
+2
-2
@@ -180,14 +180,14 @@ public class ExceptionDisposalServiceImpl
|
||||
* <p>
|
||||
* 未了结的判据与打卡门禁同一份:已完成、已撤销之外的状态都算,
|
||||
* 「处理中」同样占位——它只是有人跟进过,问题可能仍在。
|
||||
* 节点编码忽略大小写:历史数据里的写法不一定与过程配置的 key 完全一致。
|
||||
* 节点编码忽略大小写与首尾空白:历史数据里的写法不一定与过程配置的 key 完全一致。
|
||||
*/
|
||||
private boolean hasUnresolvedNodeException(Long waybillId, String nodeCode) {
|
||||
Long count = baseMapper.selectCount(Wrappers.<ExceptionDisposal>lambdaQuery()
|
||||
.eq(ExceptionDisposal::getWaybillId, waybillId)
|
||||
.eq(ExceptionDisposal::getIsDeleted, 0)
|
||||
.notIn(ExceptionDisposal::getDisposalStatus, WaybillProcessSupport.SETTLED_DISPOSAL_STATUSES)
|
||||
.apply("LOWER(node_code) = {0}", nodeCode.toLowerCase(Locale.ROOT)));
|
||||
.apply("LOWER(TRIM(node_code)) = {0}", nodeCode.trim().toLowerCase(Locale.ROOT)));
|
||||
return count != null && count > 0;
|
||||
}
|
||||
|
||||
|
||||
-10
@@ -382,16 +382,6 @@ public final class WaybillProcessSupport {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
|
||||
/**
|
||||
* 异常处置是否已了结(已完成 / 已撤销)。
|
||||
* <p>
|
||||
* 只有终态解除打卡门禁:「处理中」只表示有人跟进过,问题可能仍未解决,不放行。
|
||||
*/
|
||||
public static boolean isSettledDisposal(String disposalStatus) {
|
||||
String status = stringVal(disposalStatus);
|
||||
return DISPOSAL_COMPLETED.equalsIgnoreCase(status) || DISPOSAL_REVOKED.equalsIgnoreCase(status);
|
||||
}
|
||||
|
||||
/**
|
||||
* 两个节点编码是否指同一个节点:两侧去空白、忽略大小写。
|
||||
* <p>
|
||||
|
||||
+1
-1
@@ -177,7 +177,7 @@ class ExceptionDisposalReportGateTest {
|
||||
ServiceException exception = submitExpectRejected("load");
|
||||
|
||||
assertEquals("该节点已有未处理异常,处理完成后才能再次上报", exception.getMessage());
|
||||
assertTrue(capturedUnresolvedQuery().getTargetSql().contains("LOWER(node_code) ="),
|
||||
assertTrue(capturedUnresolvedQuery().getTargetSql().contains("LOWER(TRIM(node_code)) ="),
|
||||
"忽略大小写要落在 SQL 上:" + capturedUnresolvedQuery().getTargetSql());
|
||||
assertTrue(capturedUnresolvedParams().contains("load"),
|
||||
"参数取节点 key 的小写形式:" + capturedUnresolvedParams());
|
||||
|
||||
Reference in New Issue
Block a user