|
@@ -4943,6 +4943,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public HttpRespMsg batchAddMembToGroup(String membIdArray, String groupIds) {
|
|
public HttpRespMsg batchAddMembToGroup(String membIdArray, String groupIds) {
|
|
|
|
+ User user = userMapper.selectById(request.getHeader("token"));
|
|
List<String> membArray = JSONArray.parseArray(membIdArray, String.class);
|
|
List<String> membArray = JSONArray.parseArray(membIdArray, String.class);
|
|
List<Integer> groupArray = JSONArray.parseArray(groupIds, Integer.class);
|
|
List<Integer> groupArray = JSONArray.parseArray(groupIds, Integer.class);
|
|
List<GroupParticipator> gpList = groupParticipatorMapper.selectList(new QueryWrapper<GroupParticipator>().in("group_id", groupArray));
|
|
List<GroupParticipator> gpList = groupParticipatorMapper.selectList(new QueryWrapper<GroupParticipator>().in("group_id", groupArray));
|
|
@@ -4965,6 +4966,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
List<Integer> collect = addToGpList.stream().map(GroupParticipator::getGroupId).collect(Collectors.toList());
|
|
List<Integer> collect = addToGpList.stream().map(GroupParticipator::getGroupId).collect(Collectors.toList());
|
|
List<TaskGroup> taskGroups = taskGroupMapper.selectList(new QueryWrapper<TaskGroup>().in("id", collect));
|
|
List<TaskGroup> taskGroups = taskGroupMapper.selectList(new QueryWrapper<TaskGroup>().in("id", collect));
|
|
List<Integer> projectIds = taskGroups.stream().map(TaskGroup::getProjectId).collect(Collectors.toList());
|
|
List<Integer> projectIds = taskGroups.stream().map(TaskGroup::getProjectId).collect(Collectors.toList());
|
|
|
|
+ List<Project> projectList = projectMapper.selectList(new QueryWrapper<Project>().in("id", projectIds));
|
|
List<Participation> participationList = participationMapper.selectList(new QueryWrapper<Participation>().in("project_id", projectIds));
|
|
List<Participation> participationList = participationMapper.selectList(new QueryWrapper<Participation>().in("project_id", projectIds));
|
|
List<Participation> addPartiToProject = new ArrayList<>();
|
|
List<Participation> addPartiToProject = new ArrayList<>();
|
|
for (Integer proId : projectIds) {
|
|
for (Integer proId : projectIds) {
|
|
@@ -4976,6 +4978,17 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
addPartiToProject.add(p);
|
|
addPartiToProject.add(p);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ Optional<Project> first = projectList.stream().filter(pl -> pl.getId().equals(proId)).findFirst();
|
|
|
|
+ if(first.isPresent()){
|
|
|
|
+ OperationRecord operationRecord=new OperationRecord();
|
|
|
|
+ operationRecord.setModuleName("项目管理")
|
|
|
|
+ .setContent("批量添加分组参与人")
|
|
|
|
+ .setCompanyId(first.get().getCompanyId())
|
|
|
|
+ .setOperationTime(LocalDateTime.now())
|
|
|
|
+ .setProjectName(first.get().getProjectName())
|
|
|
|
+ .setOperatorName(user.getName());
|
|
|
|
+ operationRecordService.save(operationRecord);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
if (addPartiToProject.size() > 0) {
|
|
if (addPartiToProject.size() > 0) {
|
|
participationService.saveBatch(addPartiToProject);
|
|
participationService.saveBatch(addPartiToProject);
|
|
@@ -5725,10 +5738,10 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
@Override
|
|
@Override
|
|
public HttpRespMsg batchSetParticipation(HttpServletRequest request,String projectIdArray,String userIds) {
|
|
public HttpRespMsg batchSetParticipation(HttpServletRequest request,String projectIdArray,String userIds) {
|
|
HttpRespMsg msg=new HttpRespMsg();
|
|
HttpRespMsg msg=new HttpRespMsg();
|
|
- Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
|
|
|
|
|
|
+ User user = userMapper.selectById(request.getHeader("token"));
|
|
List<Integer> array = JSONArray.parseArray(projectIdArray, Integer.class);
|
|
List<Integer> array = JSONArray.parseArray(projectIdArray, Integer.class);
|
|
List<String> userIdList = JSONArray.parseArray(userIds, String.class);
|
|
List<String> userIdList = JSONArray.parseArray(userIds, String.class);
|
|
- List<Project> projectList = projectMapper.selectList(new QueryWrapper<Project>().eq("company_id", companyId).in("id",array));
|
|
|
|
|
|
+ List<Project> projectList = projectMapper.selectList(new QueryWrapper<Project>().eq("company_id", user.getCompanyId()).in("id",array));
|
|
List<Participation> list=new ArrayList<>();
|
|
List<Participation> list=new ArrayList<>();
|
|
for (Project project : projectList) {
|
|
for (Project project : projectList) {
|
|
List<Participation> participationList = participationMapper.selectList(new QueryWrapper<Participation>().eq("project_id", project.getId()));
|
|
List<Participation> participationList = participationMapper.selectList(new QueryWrapper<Participation>().eq("project_id", project.getId()));
|
|
@@ -5742,6 +5755,14 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
participation.setUserId(s);
|
|
participation.setUserId(s);
|
|
list.add(participation);
|
|
list.add(participation);
|
|
}
|
|
}
|
|
|
|
+ OperationRecord operationRecord=new OperationRecord();
|
|
|
|
+ operationRecord.setModuleName("项目管理")
|
|
|
|
+ .setOperatorName(user.getName())
|
|
|
|
+ .setProjectName(project.getProjectName())
|
|
|
|
+ .setCompanyId(user.getCompanyId())
|
|
|
|
+ .setOperationTime(LocalDateTime.now())
|
|
|
|
+ .setContent("批量添加项目参与人");
|
|
|
|
+ operationRecordService.save(operationRecord);
|
|
}
|
|
}
|
|
participationService.saveBatch(list);
|
|
participationService.saveBatch(list);
|
|
return msg;
|
|
return msg;
|
|
@@ -6632,6 +6653,14 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
participation.setUserId(inchargerId);
|
|
participation.setUserId(inchargerId);
|
|
participationMapper.insert(participation);
|
|
participationMapper.insert(participation);
|
|
}
|
|
}
|
|
|
|
+ OperationRecord operationRecord=new OperationRecord();
|
|
|
|
+ operationRecord.setOperatorName(user.getName());
|
|
|
|
+ operationRecord.setProjectName(project.getProjectName());
|
|
|
|
+ operationRecord.setCompanyId(project.getCompanyId());
|
|
|
|
+ operationRecord.setOperationTime(LocalDateTime.now());
|
|
|
|
+ operationRecord.setContent("批量操作:[设置项目负责人为:"+inchargerId+"]");
|
|
|
|
+ operationRecord.setModuleName("项目管理");
|
|
|
|
+ operationRecordService.save(operationRecord);
|
|
}
|
|
}
|
|
return httpRespMsg;
|
|
return httpRespMsg;
|
|
}
|
|
}
|
|
@@ -6709,7 +6738,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
String token = String.valueOf(header.get("token"));
|
|
String token = String.valueOf(header.get("token"));
|
|
String changeType = String.valueOf(header.get("changeType"));
|
|
String changeType = String.valueOf(header.get("changeType"));
|
|
List<Project> projectList = JSON.parseArray(String.valueOf(jsonObject.get("projectArrays")), Project.class);
|
|
List<Project> projectList = JSON.parseArray(String.valueOf(jsonObject.get("projectArrays")), Project.class);
|
|
- List<ProjectSeparate> projectSeparateList = JSON.parseArray(String.valueOf(jsonObject.get("projectSeparateArrays")), ProjectSeparate.class);
|
|
|
|
HttpRespMsg msg=new HttpRespMsg();
|
|
HttpRespMsg msg=new HttpRespMsg();
|
|
List<ThirdPartyInterface> thirdPartyInterfaceList = thirdPartyInterfaceService.list(new QueryWrapper<ThirdPartyInterface>().eq("token", token));
|
|
List<ThirdPartyInterface> thirdPartyInterfaceList = thirdPartyInterfaceService.list(new QueryWrapper<ThirdPartyInterface>().eq("token", token));
|
|
if(thirdPartyInterfaceList.size()==0){
|
|
if(thirdPartyInterfaceList.size()==0){
|
|
@@ -6744,11 +6772,15 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
}
|
|
}
|
|
for (Project project : inertProjectList) {
|
|
for (Project project : inertProjectList) {
|
|
List<TaskGroup> taskGroupList = project.getTaskGroupList();
|
|
List<TaskGroup> taskGroupList = project.getTaskGroupList();
|
|
- if(taskGroupList==null){
|
|
|
|
- continue;
|
|
|
|
|
|
+ if(taskGroupList!=null){
|
|
|
|
+ taskGroupList.forEach(tl->tl.setProjectId(project.getId()));
|
|
|
|
+ taskGroupService.saveBatch(taskGroupList);
|
|
|
|
+ }
|
|
|
|
+ ProjectSeparate projectSeparate = project.getProjectSeparate();
|
|
|
|
+ if(projectSeparate!=null){
|
|
|
|
+ projectSeparate.setId(project.getId());
|
|
|
|
+ projectSeparateService.save(projectSeparate);
|
|
}
|
|
}
|
|
- taskGroupList.forEach(tl->tl.setProjectId(project.getId()));
|
|
|
|
- taskGroupService.saveBatch(taskGroupList);
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}else if(changeType.equals("update_project")){
|
|
}else if(changeType.equals("update_project")){
|
|
@@ -6768,21 +6800,27 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
List<Integer> idList = changeProjectList.stream().map(Project::getId).collect(Collectors.toList());
|
|
List<Integer> idList = changeProjectList.stream().map(Project::getId).collect(Collectors.toList());
|
|
idList.add(-1);
|
|
idList.add(-1);
|
|
List<TaskGroup> groupList = taskGroupMapper.selectList(new QueryWrapper<TaskGroup>().in("project_id", idList));
|
|
List<TaskGroup> groupList = taskGroupMapper.selectList(new QueryWrapper<TaskGroup>().in("project_id", idList));
|
|
|
|
+ List<ProjectSeparate> projectSeparateList = projectSeparateMapper.selectList(new QueryWrapper<ProjectSeparate>().in("project_id", idList));
|
|
for (Project project : changeProjectList) {
|
|
for (Project project : changeProjectList) {
|
|
List<TaskGroup> taskGroupList = project.getTaskGroupList();
|
|
List<TaskGroup> taskGroupList = project.getTaskGroupList();
|
|
- if(taskGroupList==null){
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
- for (TaskGroup taskGroup : taskGroupList) {
|
|
|
|
- taskGroup.setProjectId(project.getId());
|
|
|
|
- if(groupList!=null){
|
|
|
|
- Optional<TaskGroup> first = groupList.stream().filter(gl -> gl.getTaskGroupCode() != null && gl.getTaskGroupCode().equals(taskGroup.getTaskGroupCode())).findFirst();
|
|
|
|
- if(first.isPresent()){
|
|
|
|
- taskGroup.setId(first.get().getId());
|
|
|
|
|
|
+ if(taskGroupList!=null){
|
|
|
|
+ for (TaskGroup taskGroup : taskGroupList) {
|
|
|
|
+ taskGroup.setProjectId(project.getId());
|
|
|
|
+ if(groupList!=null){
|
|
|
|
+ Optional<TaskGroup> first = groupList.stream().filter(gl -> gl.getTaskGroupCode() != null && gl.getTaskGroupCode().equals(taskGroup.getTaskGroupCode())).findFirst();
|
|
|
|
+ if(first.isPresent()){
|
|
|
|
+ taskGroup.setId(first.get().getId());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ taskGroupService.saveOrUpdateBatch(taskGroupList);
|
|
|
|
+ }
|
|
|
|
+ ProjectSeparate projectSeparate = project.getProjectSeparate();
|
|
|
|
+ Optional<ProjectSeparate> first = projectSeparateList.stream().filter(pl -> pl.getId().equals(project.getId())).findFirst();
|
|
|
|
+ if(first.isPresent()) {
|
|
|
|
+ projectSeparate.setId(first.get().getId());
|
|
}
|
|
}
|
|
- taskGroupService.saveOrUpdateBatch(taskGroupList);
|
|
|
|
|
|
+ projectSeparateService.saveOrUpdate(projectSeparate);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}else if(changeType.equals("delete_project")){
|
|
}else if(changeType.equals("delete_project")){
|
|
@@ -6792,13 +6830,14 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
project.setId(first.get().getId());
|
|
project.setId(first.get().getId());
|
|
deleteProjectList.add(project);
|
|
deleteProjectList.add(project);
|
|
}else continue;
|
|
}else continue;
|
|
- List<Integer> idList = deleteProjectList.stream().map(Project::getId).collect(Collectors.toList());
|
|
|
|
- if(deleteProjectList.size()>0&&removeByIds(idList)){
|
|
|
|
- //message+="成功删除"+idList.size()+"条项目数据";
|
|
|
|
- message+=MessageUtils.message("project.deleteDate",idList.size());
|
|
|
|
- }
|
|
|
|
- taskGroupMapper.delete(new QueryWrapper<TaskGroup>().in("project_id",idList));
|
|
|
|
}
|
|
}
|
|
|
|
+ List<Integer> idList = deleteProjectList.stream().map(Project::getId).collect(Collectors.toList());
|
|
|
|
+ if(deleteProjectList.size()>0&&removeByIds(idList)){
|
|
|
|
+ //message+="成功删除"+idList.size()+"条项目数据";
|
|
|
|
+ message+=MessageUtils.message("project.deleteDate",idList.size());
|
|
|
|
+ }
|
|
|
|
+ taskGroupMapper.delete(new QueryWrapper<TaskGroup>().in("project_id",idList));
|
|
|
|
+ projectSeparateMapper.delete(new QueryWrapper<ProjectSeparate>().in("id",idList));
|
|
}
|
|
}
|
|
msg.data=message;
|
|
msg.data=message;
|
|
return msg;
|
|
return msg;
|