|
@@ -705,28 +705,28 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
operationRecord.setContent(MessageUtils.message("Template.creatProject"));
|
|
operationRecord.setContent(MessageUtils.message("Template.creatProject"));
|
|
operationRecord.setCompanyId(user.getCompanyId());
|
|
operationRecord.setCompanyId(user.getCompanyId());
|
|
operationRecordService.save(operationRecord);
|
|
operationRecordService.save(operationRecord);
|
|
- //随着存在随着项目创建而创建的文件中心模板:暂时注释掉,等设计好了再打开
|
|
|
|
-// List<ProjectDocumentTemplate> templateList = projectDocumentTemplateMapper.selectList(new QueryWrapper<ProjectDocumentTemplate>().eq("company_id", companyId).eq("cre_with_pro", 1));
|
|
|
|
-// List<Integer> collect = templateList.stream().map(ProjectDocumentTemplate::getId).distinct().collect(Collectors.toList());
|
|
|
|
-// collect.add(-1);
|
|
|
|
-// List<ProDocumentTemDetail> proDocumentTemDetailList = proDocumentTemDetailMapper.selectList(new QueryWrapper<ProDocumentTemDetail>().in("template_id", collect));
|
|
|
|
-// List<ProDocumentTemDetail> details = proDocumentTemDetailList.stream().filter(p -> p.getParentId() == null).collect(Collectors.toList());
|
|
|
|
-// List<ProjectDocument> list=new ArrayList<>();
|
|
|
|
-// details.forEach(dl->{
|
|
|
|
-// ProjectDocument projectDocument=new ProjectDocument();
|
|
|
|
-// projectDocument.setDocumentName(dl.getName());
|
|
|
|
-// projectDocument.setLabel(dl.getName());
|
|
|
|
-// projectDocument.setIsFolder(1);
|
|
|
|
-// projectDocument.setIndate(LocalDateTime.now());
|
|
|
|
-// projectDocument.setProjectId(project.getId());
|
|
|
|
-// projectDocument.setIsDeleted(0);
|
|
|
|
-// projectDocument.setCreatorId(project.getCreatorId());
|
|
|
|
-// projectDocument.setCreatorName(user.getName());
|
|
|
|
-// projectDocument.setProDocumentTemDetailId(dl.getId());
|
|
|
|
-// list.add(projectDocument);
|
|
|
|
-// });
|
|
|
|
-// projectDocumentService.saveBatch(list);
|
|
|
|
-// getParentFolders(list,proDocumentTemDetailList,project,user);
|
|
|
|
|
|
+ //随着存在随着项目创建而创建的文件中心模板
|
|
|
|
+ List<ProjectDocumentTemplate> templateList = projectDocumentTemplateMapper.selectList(new QueryWrapper<ProjectDocumentTemplate>().eq("company_id", companyId).eq("cre_with_pro", 1));
|
|
|
|
+ List<Integer> collect = templateList.stream().map(ProjectDocumentTemplate::getId).distinct().collect(Collectors.toList());
|
|
|
|
+ collect.add(-1);
|
|
|
|
+ List<ProDocumentTemDetail> proDocumentTemDetailList = proDocumentTemDetailMapper.selectList(new QueryWrapper<ProDocumentTemDetail>().in("template_id", collect));
|
|
|
|
+ List<ProDocumentTemDetail> details = proDocumentTemDetailList.stream().filter(p -> p.getParentId() == null).collect(Collectors.toList());
|
|
|
|
+ List<ProjectDocument> list=new ArrayList<>();
|
|
|
|
+ details.forEach(dl->{
|
|
|
|
+ ProjectDocument projectDocument=new ProjectDocument();
|
|
|
|
+ projectDocument.setDocumentName(dl.getName());
|
|
|
|
+ projectDocument.setLabel(dl.getName());
|
|
|
|
+ projectDocument.setIsFolder(1);
|
|
|
|
+ projectDocument.setIndate(LocalDateTime.now());
|
|
|
|
+ projectDocument.setProjectId(project.getId());
|
|
|
|
+ projectDocument.setIsDeleted(0);
|
|
|
|
+ projectDocument.setCreatorId(project.getCreatorId());
|
|
|
|
+ projectDocument.setCreatorName(user.getName());
|
|
|
|
+ projectDocument.setProDocumentTemDetailId(dl.getId());
|
|
|
|
+ list.add(projectDocument);
|
|
|
|
+ });
|
|
|
|
+ projectDocumentService.saveBatch(list);
|
|
|
|
+ getParentFolders(list,proDocumentTemDetailList,project,user);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
@@ -1505,47 +1505,57 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
}else{
|
|
}else{
|
|
List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId));
|
|
List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId));
|
|
List<Object> projectNames = list.stream().map(mp -> mp.get("project")).collect(Collectors.toList());
|
|
List<Object> projectNames = list.stream().map(mp -> mp.get("project")).collect(Collectors.toList());
|
|
|
|
+ List<Object> projectCodes = list.stream().map(mp -> mp.get("projectCode")).collect(Collectors.toList());
|
|
List<Object> projectIds = list.stream().map(mp -> mp.get("id")).collect(Collectors.toList());
|
|
List<Object> projectIds = list.stream().map(mp -> mp.get("id")).collect(Collectors.toList());
|
|
- List<String> headList = new ArrayList<String>();
|
|
|
|
|
|
+ List<String> headListOne = new ArrayList<String>();
|
|
//headList.add("人员");
|
|
//headList.add("人员");
|
|
- headList.add(MessageUtils.message("entry.personnel"));
|
|
|
|
|
|
+ headListOne.add("");
|
|
|
|
+ headListOne.add("项目编号");
|
|
|
|
+ projectCodes.forEach(pn->{
|
|
|
|
+ headListOne.add(String.valueOf(pn));
|
|
|
|
+ });
|
|
|
|
+ List<String> headListTwo = new ArrayList<String>();
|
|
|
|
+ //headList.add("人员");
|
|
|
|
+ headListTwo.add(MessageUtils.message("entry.personnel"));
|
|
|
|
+ headListTwo.add("部门");
|
|
projectNames.forEach(pn->{
|
|
projectNames.forEach(pn->{
|
|
if ("hours".equals(exportContent) && functionTimeList.size()>0){
|
|
if ("hours".equals(exportContent) && functionTimeList.size()>0){
|
|
//headList.add(String.valueOf(pn)+"/工时");
|
|
//headList.add(String.valueOf(pn)+"/工时");
|
|
- headList.add(String.valueOf(pn)+"/"+MessageUtils.message("entry.workHours"));
|
|
|
|
|
|
+ headListTwo.add(String.valueOf(pn)+"/"+MessageUtils.message("entry.workHours"));
|
|
}else if ("cost".equals(exportContent) && functionCostList.size()>0){
|
|
}else if ("cost".equals(exportContent) && functionCostList.size()>0){
|
|
//headList.add(String.valueOf(pn)+"/成本");
|
|
//headList.add(String.valueOf(pn)+"/成本");
|
|
- headList.add(String.valueOf(pn)+"/"+MessageUtils.message("entry.cost"));
|
|
|
|
|
|
+ headListTwo.add(String.valueOf(pn)+"/"+MessageUtils.message("entry.cost"));
|
|
}else {
|
|
}else {
|
|
if(functionTimeList.size()>0){
|
|
if(functionTimeList.size()>0){
|
|
//headList.add(String.valueOf(pn)+"/工时");
|
|
//headList.add(String.valueOf(pn)+"/工时");
|
|
- headList.add(String.valueOf(pn)+"/"+MessageUtils.message("entry.workHours"));
|
|
|
|
|
|
+ headListTwo.add(String.valueOf(pn)+"/"+MessageUtils.message("entry.workHours"));
|
|
}
|
|
}
|
|
if (functionCostList.size()>0){
|
|
if (functionCostList.size()>0){
|
|
//headList.add(String.valueOf(pn)+"/成本");
|
|
//headList.add(String.valueOf(pn)+"/成本");
|
|
- headList.add(String.valueOf(pn)+"/"+MessageUtils.message("entry.cost"));
|
|
|
|
|
|
+ headListTwo.add(String.valueOf(pn)+"/"+MessageUtils.message("entry.cost"));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
if ("hours".equals(exportContent) && functionTimeList.size()>0){
|
|
if ("hours".equals(exportContent) && functionTimeList.size()>0){
|
|
//headList.add("合计/工时");
|
|
//headList.add("合计/工时");
|
|
- headList.add(MessageUtils.message("entry.total")+"/"+MessageUtils.message("entry.workHours"));
|
|
|
|
|
|
+ headListTwo.add(MessageUtils.message("entry.total")+"/"+MessageUtils.message("entry.workHours"));
|
|
}else if ("cost".equals(exportContent) && functionCostList.size()>0){
|
|
}else if ("cost".equals(exportContent) && functionCostList.size()>0){
|
|
//headList.add("合计/成本");
|
|
//headList.add("合计/成本");
|
|
- headList.add(MessageUtils.message("entry.total")+"/"+MessageUtils.message("entry.cost"));
|
|
|
|
|
|
+ headListTwo.add(MessageUtils.message("entry.total")+"/"+MessageUtils.message("entry.cost"));
|
|
}else {
|
|
}else {
|
|
if(functionTimeList.size()>0){
|
|
if(functionTimeList.size()>0){
|
|
//headList.add("合计/工时");
|
|
//headList.add("合计/工时");
|
|
- headList.add(MessageUtils.message("entry.total")+"/"+MessageUtils.message("entry.workHours"));
|
|
|
|
|
|
+ headListTwo.add(MessageUtils.message("entry.total")+"/"+MessageUtils.message("entry.workHours"));
|
|
}
|
|
}
|
|
if(functionCostList.size()>0){
|
|
if(functionCostList.size()>0){
|
|
//headList.add("合计/成本");
|
|
//headList.add("合计/成本");
|
|
- headList.add(MessageUtils.message("entry.total")+"/"+MessageUtils.message("entry.cost"));
|
|
|
|
|
|
+ headListTwo.add(MessageUtils.message("entry.total")+"/"+MessageUtils.message("entry.cost"));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
allList=new ArrayList<>();
|
|
allList=new ArrayList<>();
|
|
- allList.add(headList);
|
|
|
|
|
|
+ allList.add(headListOne);
|
|
|
|
+ allList.add(headListTwo);
|
|
//统计当前所有项目所有人的时间成本投入
|
|
//统计当前所有项目所有人的时间成本投入
|
|
List<Map<String, Object>> membList = projectMapper.getProjectCostGroupByProject(companyId,startDate, endDate, projectId,userIdList,deptIds);
|
|
List<Map<String, Object>> membList = projectMapper.getProjectCostGroupByProject(companyId,startDate, endDate, projectId,userIdList,deptIds);
|
|
for (User user : userList) {
|
|
for (User user : userList) {
|
|
@@ -1553,10 +1563,21 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
double costTime = 0;
|
|
double costTime = 0;
|
|
List<Map<String, Object>> mapList = membList.stream().filter(mb -> mb.get("creatorId").equals(user.getId())).collect(Collectors.toList());
|
|
List<Map<String, Object>> mapList = membList.stream().filter(mb -> mb.get("creatorId").equals(user.getId())).collect(Collectors.toList());
|
|
List<String> membRowData=new ArrayList<>();
|
|
List<String> membRowData=new ArrayList<>();
|
|
|
|
+ Optional<Department> first = allDepartmentList.stream().filter(dl -> dl.getDepartmentId().equals(user.getDepartmentId())).findFirst();
|
|
if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
membRowData.add((String)("$userName="+user.getCorpwxUserid()+"$"));
|
|
membRowData.add((String)("$userName="+user.getCorpwxUserid()+"$"));
|
|
|
|
+ if(first.isPresent()){
|
|
|
|
+ membRowData.add((String)("$departmentName="+first.get().getCorpwxDeptid()+"$"));
|
|
|
|
+ }else {
|
|
|
|
+ membRowData.add("");
|
|
|
|
+ }
|
|
}else {
|
|
}else {
|
|
membRowData.add(user.getName());
|
|
membRowData.add(user.getName());
|
|
|
|
+ if(first.isPresent()){
|
|
|
|
+ membRowData.add(first.get().getDepartmentName());
|
|
|
|
+ }else {
|
|
|
|
+ membRowData.add("");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
for(Object i:projectIds){
|
|
for(Object i:projectIds){
|
|
List<Map<String, Object>> resultList = mapList.stream().filter(mp -> mp.get("projectId").equals(i)).collect(Collectors.toList());
|
|
List<Map<String, Object>> resultList = mapList.stream().filter(mp -> mp.get("projectId").equals(i)).collect(Collectors.toList());
|
|
@@ -8551,6 +8572,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
taskGroupMapper.delete(new QueryWrapper<TaskGroup>().in("project_id",idList));
|
|
taskGroupMapper.delete(new QueryWrapper<TaskGroup>().in("project_id",idList));
|
|
projectSeparateMapper.delete(new QueryWrapper<ProjectSeparate>().in("id",idList));
|
|
projectSeparateMapper.delete(new QueryWrapper<ProjectSeparate>().in("id",idList));
|
|
}
|
|
}
|
|
|
|
+ sb.append("]");
|
|
operationRecord.setContent(sb.toString());
|
|
operationRecord.setContent(sb.toString());
|
|
operationRecordService.save(operationRecord);
|
|
operationRecordService.save(operationRecord);
|
|
msg.data=message;
|
|
msg.data=message;
|