Commit 815b54d3 authored by wangjiancheng's avatar wangjiancheng

fix:项目管理修改

parent 61546bca
......@@ -130,12 +130,15 @@ public class ProjectManageServiceImpl implements IProjectManageService {
int result= projectManageMapper.insertProjectManage(projectManage);
if (result > 0){
if (!StringUtils.isEmpty(projectManage.getProjectMemberIds())){
System.out.println(projectManage.getProjectMemberIds());
// 新增项目成员
projectManage.getProjectMemberIds().forEach(memberId -> {
ProjectMember projectMember = new ProjectMember();
projectMember.setProjectId(projectManage.getId());
projectMember.setUserId(memberId);
projectMemberService.insertProjectMember(projectMember);
if (memberId != null){
ProjectMember projectMember = new ProjectMember();
projectMember.setProjectId(projectManage.getId());
projectMember.setUserId(memberId);
projectMemberService.insertProjectMember(projectMember);
}
});
//projectMemberService.batchInsertProjectMembers(projectManage.getId(), projectManage.getProjectMemberIds());
}
......@@ -167,14 +170,17 @@ public class ProjectManageServiceImpl implements IProjectManageService {
@Override
public int updateProjectManage(ProjectManage projectManage) {
if (!StringUtils.isEmpty(projectManage.getProjectMemberIds())){
projectMemberMapper.deleteProjectMemberByProjectId(projectManage.getId());
// 项目成员
projectManage.getProjectMemberIds().forEach(memberId -> {
// 同一项目下成员是否重复
projectMemberMapper.deleteProjectMember(projectManage.getId(),memberId);
ProjectMember projectMember = new ProjectMember();
projectMember.setProjectId(projectManage.getId());
projectMember.setUserId(memberId);
projectMemberService.insertProjectMember(projectMember);
if (memberId != null){
// 同一项目下成员是否重复
//projectMemberMapper.deleteProjectMember(projectManage.getId(),memberId);
ProjectMember projectMember = new ProjectMember();
projectMember.setProjectId(projectManage.getId());
projectMember.setUserId(memberId);
projectMemberService.insertProjectMember(projectMember);
}
});
}else {
......
......@@ -42,7 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select pm.id,pm.project_number,pm.project_name,pm.project_type,pm.start_date,
pm.end_date,pm.project_cost,pm.project_describe,pm.project_status,pm.create_date,pm.update_date,
su1.nick_name as departmentLeaderName,su2.nick_name as projectManagerName,
group_concat(su.nick_name separator ',') as projectMemberNames
group_concat(su.nick_name separator '') as projectMemberNames
from project_manage pm
left join sys_user su1 on su1.user_id = pm.department_leader_id
left join sys_user su2 on su2.user_id = pm.project_manager_id
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment