|
@@ -10234,11 +10234,14 @@ 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,String deptIds) {
|
|
HttpRespMsg msg=new HttpRespMsg();
|
|
HttpRespMsg msg=new HttpRespMsg();
|
|
User user = userMapper.selectById(request.getHeader("token"));
|
|
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<Integer> deptArray = JSONArray.parseArray(deptIds, Integer.class);
|
|
|
|
+ List<ProjectDeptRelate> toAddList = new ArrayList<>();
|
|
|
|
+
|
|
List<Project> projectList = projectMapper.selectList(new QueryWrapper<Project>().eq("company_id", user.getCompanyId()).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) {
|
|
@@ -10261,6 +10264,18 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
.setOperationTime(LocalDateTime.now())
|
|
.setOperationTime(LocalDateTime.now())
|
|
.setContent("批量添加项目参与人");
|
|
.setContent("批量添加项目参与人");
|
|
operationRecordService.save(operationRecord);
|
|
operationRecordService.save(operationRecord);
|
|
|
|
+ if(CollectionUtils.isNotEmpty(deptArray)){
|
|
|
|
+ for (Integer deptId : deptArray) {
|
|
|
|
+ ProjectDeptRelate tmpRelate = new ProjectDeptRelate();
|
|
|
|
+ tmpRelate.setProjectId(project.getId());
|
|
|
|
+ tmpRelate.setDepartmentId(deptId);
|
|
|
|
+ toAddList.add(tmpRelate);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ if(CollectionUtils.isNotEmpty(toAddList)){
|
|
|
|
+ projectDeptRelateMapper.insertBatchList(toAddList);
|
|
}
|
|
}
|
|
participationService.saveBatch(list);
|
|
participationService.saveBatch(list);
|
|
return msg;
|
|
return msg;
|