fix: 任务类型未配置接单部门时默认返回所有接单部门的设计师
This commit is contained in:
parent
6e3f8101c8
commit
c3bdf4e2f6
@ -1524,8 +1524,26 @@ public class UserService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (allowedDeptIds == null || allowedDeptIds.trim().isEmpty()) {
|
if (allowedDeptIds == null || allowedDeptIds.trim().isEmpty()) {
|
||||||
log.warn("任务类型{}及其父级都没有配置接单部门", taskTypeId);
|
log.info("任务类型{}及其父级都没有配置接单部门,默认返回所有接单部门的设计师", taskTypeId);
|
||||||
return new ArrayList<>();
|
// 获取所有接单部门
|
||||||
|
List<Department> receivingDepts = departmentMapper.selectList(
|
||||||
|
new LambdaQueryWrapper<Department>()
|
||||||
|
.eq(Department::getDeptType, "receiving")
|
||||||
|
.eq(Department::getStatus, 1)
|
||||||
|
.eq(Department::getDeleted, 0)
|
||||||
|
);
|
||||||
|
if (receivingDepts.isEmpty()) {
|
||||||
|
log.warn("没有找到任何接单部门");
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
// 收集所有接单部门的ID
|
||||||
|
StringBuilder deptIdBuilder = new StringBuilder();
|
||||||
|
for (int i = 0; i < receivingDepts.size(); i++) {
|
||||||
|
if (i > 0) deptIdBuilder.append(",");
|
||||||
|
deptIdBuilder.append(receivingDepts.get(i).getId());
|
||||||
|
}
|
||||||
|
allowedDeptIds = deptIdBuilder.toString();
|
||||||
|
log.info("使用所有接单部门: {}", allowedDeptIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
log.info("找到接单部门配置: taskTypeId={}, allowedDeptIds={}", currentTypeId, allowedDeptIds);
|
log.info("找到接单部门配置: taskTypeId={}, allowedDeptIds={}", currentTypeId, allowedDeptIds);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user