项目详情

This commit is contained in:
lcj
2025-12-12 11:26:35 +08:00
parent 509683386f
commit 03b3c8141a
2 changed files with 9 additions and 10 deletions

View File

@ -230,7 +230,7 @@ public class BusProjectVo implements Serializable {
/** /**
* 所属部门列表 * 所属部门列表
*/ */
private List<Long> deptIds; private Long deptIds;
/** /**
* 部门列表 * 部门列表
@ -240,7 +240,7 @@ public class BusProjectVo implements Serializable {
/** /**
* 部门名称列表 * 部门名称列表
*/ */
@Translation(type = TransConstant.DEPT_ID_TO_NAME, mapper = "deptStr") @Translation(type = TransConstant.DEPT_ID_TO_NAME, mapper = "deptIds")
private String deptNames; private String deptNames;
/** /**

View File

@ -713,14 +713,13 @@ public class BusProjectServiceImpl extends ServiceImpl<BusProjectMapper, BusProj
projectVo.setChildren(subProjectVoList); projectVo.setChildren(subProjectVoList);
} }
// 关联所属部门 // 关联所属部门
List<BusProjectDept> deptList = projectDeptService.lambdaQuery() BusProjectDept dept = projectDeptService.lambdaQuery()
.eq(BusProjectDept::getProjectId, project.getId()) .eq(BusProjectDept::getProjectId, project.getId())
.list(); .last("limit 1")
List<Long> deptIds = deptList.stream().map(BusProjectDept::getDeptId).toList(); .one();
projectVo.setDeptIds(deptIds); if (dept != null) {
if (CollUtil.isNotEmpty(deptIds)) { projectVo.setDeptIds(dept.getDeptId());
String deptStr = deptIds.stream().map(String::valueOf).collect(Collectors.joining(",")); projectVo.setDeptStr(dept.toString());
projectVo.setDeptStr(deptStr);
} }
return projectVo; return projectVo;
} }