|
@@ -29,6 +29,7 @@ import org.apache.poi.hssf.usermodel.HSSFRow;
|
|
import org.apache.poi.hssf.usermodel.HSSFSheet;
|
|
import org.apache.poi.hssf.usermodel.HSSFSheet;
|
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
|
|
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
|
|
|
|
+import org.apache.poi.ss.formula.functions.T;
|
|
import org.apache.poi.ss.usermodel.*;
|
|
import org.apache.poi.ss.usermodel.*;
|
|
import org.apache.poi.ss.util.CellRangeAddress;
|
|
import org.apache.poi.ss.util.CellRangeAddress;
|
|
import org.apache.poi.xssf.streaming.SXSSFCell;
|
|
import org.apache.poi.xssf.streaming.SXSSFCell;
|
|
@@ -6822,6 +6823,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
headList.add(MessageUtils.message("entry.projectType"));
|
|
headList.add(MessageUtils.message("entry.projectType"));
|
|
headList.add(MessageUtils.message("entry.publicProject"));
|
|
headList.add(MessageUtils.message("entry.publicProject"));
|
|
headList.add(MessageUtils.message("entry.projectName"));
|
|
headList.add(MessageUtils.message("entry.projectName"));
|
|
|
|
+ headList.add(MessageUtils.message("entry.projectStage"));
|
|
headList.add(MessageUtils.message("excel.charge"));
|
|
headList.add(MessageUtils.message("excel.charge"));
|
|
headList.add(MessageUtils.message("entry.Participants"));
|
|
headList.add(MessageUtils.message("entry.Participants"));
|
|
headList.add(MessageUtils.message("entry.startData"));
|
|
headList.add(MessageUtils.message("entry.startData"));
|
|
@@ -6922,6 +6924,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
//rowData.add(("1".equals(projectVO.getIsPublic())?"是":"否"));
|
|
//rowData.add(("1".equals(projectVO.getIsPublic())?"是":"否"));
|
|
rowData.add(("1".equals(projectVO.getIsPublic())?MessageUtils.message("excel.yes"):MessageUtils.message("excel.no")));
|
|
rowData.add(("1".equals(projectVO.getIsPublic())?MessageUtils.message("excel.yes"):MessageUtils.message("excel.no")));
|
|
rowData.add(projectVO.getProjectName());
|
|
rowData.add(projectVO.getProjectName());
|
|
|
|
+ rowData.add(projectVO.getCurrentStageName());
|
|
if((wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1)||(dingding!=null&&dingding.getContactNeedTranslate()==1)){
|
|
if((wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1)||(dingding!=null&&dingding.getContactNeedTranslate()==1)){
|
|
if(projectVO.getInchargerId()!=null){
|
|
if(projectVO.getInchargerId()!=null){
|
|
User us = userList.stream().filter(ul -> ul.getId().equals(projectVO.getInchargerId())).findFirst().get();
|
|
User us = userList.stream().filter(ul -> ul.getId().equals(projectVO.getInchargerId())).findFirst().get();
|
|
@@ -14278,4 +14281,66 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
httpRespMsg.data ="/upload/"+fileName;
|
|
httpRespMsg.data ="/upload/"+fileName;
|
|
return httpRespMsg;
|
|
return httpRespMsg;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public HttpRespMsg batchSetProjectTaskExecutor(String projectIds, String userIds) {
|
|
|
|
+ HttpRespMsg msg=new HttpRespMsg();
|
|
|
|
+ Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
|
|
|
|
+ List<User> userList = userMapper.selectList(new LambdaQueryWrapper<User>().eq(User::getCompanyId, companyId));
|
|
|
|
+ if(!StringUtils.isEmpty(projectIds)){
|
|
|
|
+ String[] split = projectIds.split(",");
|
|
|
|
+ List<Integer> projectIdList = Arrays.asList(split).stream().map(i -> Integer.valueOf(i)).collect(Collectors.toList());
|
|
|
|
+ List<Task> taskList = taskService.list(new LambdaQueryWrapper<Task>().in(Task::getProjectId, projectIdList).eq(Task::getTaskStatus,0));
|
|
|
|
+ List<TaskExecutor> taskExecutorList=new ArrayList<>();
|
|
|
|
+ List<Task> tasks=new ArrayList<>();
|
|
|
|
+ for (Integer projectId : projectIdList) {
|
|
|
|
+ List<Task> targetTaskList = taskList.stream().filter(t -> t.getProjectId().equals(projectId)).collect(Collectors.toList());
|
|
|
|
+ if(!StringUtils.isEmpty(userIds)){
|
|
|
|
+ String[] split1 = userIds.split(",");
|
|
|
|
+ targetTaskList.forEach(t->{
|
|
|
|
+ //获取到原有的执行人
|
|
|
|
+ StringBuilder executorId =new StringBuilder( t.getExecutorId()==null?"":t.getExecutorId());
|
|
|
|
+ StringBuilder executorName = new StringBuilder( t.getExecutorName()==null?"":t.getExecutorName());
|
|
|
|
+ StringBuilder executorColor = new StringBuilder( t.getExecutorColor()==null?"":t.getExecutorColor());
|
|
|
|
+ for (String userId : split1) {
|
|
|
|
+ List<String> list = Arrays.asList(executorId.toString().split(","));
|
|
|
|
+ if(list.contains(userId)){
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ Optional<User> first = userList.stream().filter(u -> u.getId().equals(userId)).findFirst();
|
|
|
|
+ if(first.isPresent()){
|
|
|
|
+ TaskExecutor taskExecutor=new TaskExecutor();
|
|
|
|
+ taskExecutor.setExecutorColor(first.get().getColor());
|
|
|
|
+ taskExecutor.setExecutorId(first.get().getId());
|
|
|
|
+ taskExecutor.setExecutorName(first.get().getName());
|
|
|
|
+ taskExecutor.setProjectId(projectId);
|
|
|
|
+ taskExecutor.setTaskId(t.getId());
|
|
|
|
+ if(executorId.length()>0){
|
|
|
|
+ executorId.append(",").append(taskExecutor.getExecutorId());
|
|
|
|
+ executorName.append(",").append(taskExecutor.getExecutorName());
|
|
|
|
+ executorColor.append(",").append(taskExecutor.getExecutorColor());
|
|
|
|
+ }else {
|
|
|
|
+ executorId.append(taskExecutor.getExecutorId());
|
|
|
|
+ executorName.append(taskExecutor.getExecutorName());
|
|
|
|
+ executorColor.append(taskExecutor.getExecutorColor());
|
|
|
|
+ }
|
|
|
|
+ taskExecutorList.add(taskExecutor);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ t.setExecutorId(executorId.toString());
|
|
|
|
+ t.setExecutorName(executorName.toString());
|
|
|
|
+ t.setExecutorColor(executorColor.toString());
|
|
|
|
+ tasks.add(t);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(tasks.size()>0){
|
|
|
|
+ taskService.saveOrUpdateBatch(tasks);
|
|
|
|
+ }
|
|
|
|
+ if(taskExecutorList.size()>0){
|
|
|
|
+ taskExecutorService.saveBatch(taskExecutorList);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return msg;
|
|
|
|
+ }
|
|
}
|
|
}
|