fix: fall back to allowed queue departments

This commit is contained in:
Your Name 2026-03-13 09:56:36 +08:00
parent b2287e0fbe
commit 6bac5b8e89

View File

@ -305,11 +305,7 @@ public class TaskItemService {
.orderByAsc(com.designhub.entity.TaskUnlockStatus::getDeptId)
.orderByAsc(com.designhub.entity.TaskUnlockStatus::getId);
List<com.designhub.entity.TaskUnlockStatus> unlockStatuses = taskUnlockService.getUnlockStatusMapper().selectList(wrapper);
if (unlockStatuses == null || unlockStatuses.isEmpty()) {
return null;
}
if (viewerDeptId != null) {
if (unlockStatuses != null && !unlockStatuses.isEmpty() && viewerDeptId != null) {
Long matchedDeptId = null;
int bestDistance = Integer.MAX_VALUE;
for (com.designhub.entity.TaskUnlockStatus unlockStatus : unlockStatuses) {
@ -350,7 +346,7 @@ public class TaskItemService {
return allowedDeptIds.get(0);
}
return unlockStatuses.get(0).getDeptId();
return unlockStatuses == null || unlockStatuses.isEmpty() ? null : unlockStatuses.get(0).getDeptId();
}
private List<Long> resolveAllowedQueueDeptIds(TaskItem item) {