项目详情
This commit is contained in:
@ -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;
|
||||
|
||||
/**
|
||||
|
||||
@ -574,7 +574,7 @@ public class BusProjectServiceImpl extends ServiceImpl<BusProjectMapper, BusProj
|
||||
// if (!remove) {
|
||||
// throw new ServiceException("删除项目部门失败", HttpStatus.ERROR);
|
||||
// }
|
||||
if (req.getDeptIds() !=null) {
|
||||
if (req.getDeptIds() != null) {
|
||||
BusProjectDept projectDept = new BusProjectDept();
|
||||
projectDept.setDeptId(req.getDeptIds());
|
||||
projectDept.setProjectId(project.getId());
|
||||
@ -713,14 +713,13 @@ public class BusProjectServiceImpl extends ServiceImpl<BusProjectMapper, BusProj
|
||||
projectVo.setChildren(subProjectVoList);
|
||||
}
|
||||
// 关联所属部门
|
||||
List<BusProjectDept> deptList = projectDeptService.lambdaQuery()
|
||||
BusProjectDept dept = projectDeptService.lambdaQuery()
|
||||
.eq(BusProjectDept::getProjectId, project.getId())
|
||||
.list();
|
||||
List<Long> deptIds = deptList.stream().map(BusProjectDept::getDeptId).toList();
|
||||
projectVo.setDeptIds(deptIds);
|
||||
if (CollUtil.isNotEmpty(deptIds)) {
|
||||
String deptStr = deptIds.stream().map(String::valueOf).collect(Collectors.joining(","));
|
||||
projectVo.setDeptStr(deptStr);
|
||||
.last("limit 1")
|
||||
.one();
|
||||
if (dept != null) {
|
||||
projectVo.setDeptIds(dept.getDeptId());
|
||||
projectVo.setDeptStr(dept.toString());
|
||||
}
|
||||
return projectVo;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user