项目详情
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;
|
private String deptNames;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -574,7 +574,7 @@ public class BusProjectServiceImpl extends ServiceImpl<BusProjectMapper, BusProj
|
|||||||
// if (!remove) {
|
// if (!remove) {
|
||||||
// throw new ServiceException("删除项目部门失败", HttpStatus.ERROR);
|
// throw new ServiceException("删除项目部门失败", HttpStatus.ERROR);
|
||||||
// }
|
// }
|
||||||
if (req.getDeptIds() !=null) {
|
if (req.getDeptIds() != null) {
|
||||||
BusProjectDept projectDept = new BusProjectDept();
|
BusProjectDept projectDept = new BusProjectDept();
|
||||||
projectDept.setDeptId(req.getDeptIds());
|
projectDept.setDeptId(req.getDeptIds());
|
||||||
projectDept.setProjectId(project.getId());
|
projectDept.setProjectId(project.getId());
|
||||||
@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user