|
@@ -12647,12 +12647,36 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
size=pageSize;
|
|
size=pageSize;
|
|
start=(pageIndex-1)*size;
|
|
start=(pageIndex-1)*size;
|
|
}
|
|
}
|
|
|
|
+ //需要统计的部门
|
|
|
|
+ List<Integer> targetDeptIds=new ArrayList<>();
|
|
|
|
+ targetDeptIds.add(7458);
|
|
|
|
+ targetDeptIds.add(7459);
|
|
|
|
+ targetDeptIds.add(7460);
|
|
|
|
+ //需要统计的分组名称
|
|
|
|
+ List<String> targetGroupNameList=new ArrayList<>();
|
|
|
|
+ targetGroupNameList.add("生产部电气");
|
|
|
|
+ targetGroupNameList.add("生产部车间");
|
|
|
|
+ targetGroupNameList.add("工程部现场安装施工");
|
|
|
|
+ targetGroupNameList.add("工程部配合调试");
|
|
|
|
+ targetGroupNameList.add("研发部工艺设计");
|
|
|
|
+ targetGroupNameList.add("研发部结构设计");
|
|
|
|
+ targetGroupNameList.add("研发部BIM设计");
|
|
|
|
+ targetGroupNameList.add("研发部电气设计");
|
|
|
|
+ targetGroupNameList.add("研发部工艺调试验收");
|
|
|
|
+ targetGroupNameList.add("研发部电气调试验收");
|
|
|
|
+ List<TaskGroup> taskGroupList = taskGroupMapper.selectList(new LambdaQueryWrapper<TaskGroup>().in(TaskGroup::getName, targetGroupNameList).inSql(TaskGroup::getProjectId, "select id from project where company_id=" + companyId));
|
|
|
|
+ List<Integer> projectIds = taskGroupList.stream().map(TaskGroup::getProjectId).distinct().collect(Collectors.toList());
|
|
|
|
+ if(pageIndex==null&&pageSize==null){
|
|
|
|
+ pageIndex=-1;
|
|
|
|
+ pageSize=-1;
|
|
|
|
+ }
|
|
|
|
+ IPage<Project> projectIPage = projectMapper.selectPage(new Page<>(pageIndex, pageSize), new LambdaQueryWrapper<Project>().in(Project::getId, projectIds).eq(Project::getCompanyId, companyId));
|
|
|
|
+ List<Project> projectList = projectIPage.getRecords();
|
|
//是否具有查看全部数据的权限
|
|
//是否具有查看全部数据的权限
|
|
if(!viewAll){
|
|
if(!viewAll){
|
|
if(!incharger){
|
|
if(!incharger){
|
|
//只能查看本人的数据
|
|
//只能查看本人的数据
|
|
- resultList=projectMapper.groupExpendProcessList(user.getId(),companyId,startDate,endDate,null,start,size);
|
|
|
|
- total=projectMapper.groupExpendProcessListCount(user.getId(),companyId,startDate,endDate,null);
|
|
|
|
|
|
+ resultList=projectMapper.groupExpendProcessList(user.getId(),companyId,startDate,endDate,null);
|
|
}else {
|
|
}else {
|
|
List<Department> departmentList = departmentMapper.selectList(new LambdaQueryWrapper<Department>().select(Department::getDepartmentId).eq(Department::getManagerId, user.getId()));
|
|
List<Department> departmentList = departmentMapper.selectList(new LambdaQueryWrapper<Department>().select(Department::getDepartmentId).eq(Department::getManagerId, user.getId()));
|
|
List<DepartmentOtherManager> departmentOtherManagerList = departmentOtherManagerMapper.selectList(new QueryWrapper<DepartmentOtherManager>().eq("other_manager_id", user.getId()));
|
|
List<DepartmentOtherManager> departmentOtherManagerList = departmentOtherManagerMapper.selectList(new QueryWrapper<DepartmentOtherManager>().eq("other_manager_id", user.getId()));
|
|
@@ -12666,16 +12690,153 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
List<Integer> branchDepartment = getBranchDepartment(integer, allDeptList);
|
|
List<Integer> branchDepartment = getBranchDepartment(integer, allDeptList);
|
|
deptIds.addAll(branchDepartment);
|
|
deptIds.addAll(branchDepartment);
|
|
}
|
|
}
|
|
- resultList=projectMapper.groupExpendProcessList(null,companyId,startDate,endDate,deptIds,start,size);
|
|
|
|
- total=projectMapper.groupExpendProcessListCount(null,companyId,startDate,endDate,deptIds);
|
|
|
|
|
|
+ resultList=projectMapper.groupExpendProcessList(null,companyId,startDate,endDate,deptIds);
|
|
}
|
|
}
|
|
}else {
|
|
}else {
|
|
- resultList=projectMapper.groupExpendProcessList(null,companyId,startDate,endDate,null,start,size);
|
|
|
|
- total=projectMapper.groupExpendProcessListCount(null,companyId,startDate,endDate,null);
|
|
|
|
|
|
+ resultList=projectMapper.groupExpendProcessList(null,companyId,startDate,endDate,null);
|
|
|
|
+ }
|
|
|
|
+ List<Department> departmentList = departmentMapper.selectList(new LambdaQueryWrapper<Department>().eq(Department::getCompanyId, companyId));
|
|
|
|
+ List<Map<String,Object>> itemList=new ArrayList<>();
|
|
|
|
+ for (Project project : projectList) {
|
|
|
|
+ for (Integer deptId : targetDeptIds) {
|
|
|
|
+ List<String> groupNames;
|
|
|
|
+ Optional<Department> department = departmentList.stream().filter(d -> d.getDepartmentId().equals(deptId)).findFirst();
|
|
|
|
+ Integer corpwxDeptid = department.get().getCorpwxDeptid();
|
|
|
|
+ String departmentName = department.get().getDepartmentName();
|
|
|
|
+ switch (deptId){
|
|
|
|
+ case 7459:
|
|
|
|
+ groupNames=new ArrayList<>();
|
|
|
|
+ groupNames.add("生产部电气");
|
|
|
|
+ groupNames.add("生产部车间");
|
|
|
|
+ for (String groupName : groupNames) {
|
|
|
|
+ Optional<TaskGroup> taskGroup = taskGroupList.stream().filter(f -> f.getName().equals(groupName) && f.getProjectId().equals(project.getId())).findFirst();
|
|
|
|
+ Map<String,Object> item=new HashMap<>();
|
|
|
|
+ item.put("projectId",project.getId());
|
|
|
|
+ item.put("projectName",project.getProjectName());
|
|
|
|
+ item.put("groupName",groupName);
|
|
|
|
+ item.put("corpwxDeptId",corpwxDeptid);
|
|
|
|
+ item.put("department_name",departmentName);
|
|
|
|
+ if(!taskGroup.isPresent()){
|
|
|
|
+ item.put("planHour",0);
|
|
|
|
+ item.put("realHour",0);
|
|
|
|
+ item.put("realCost",0);
|
|
|
|
+ item.put("overHour",0);
|
|
|
|
+ item.put("normalHour",0);
|
|
|
|
+ item.put("process","0%");
|
|
|
|
+ }else {
|
|
|
|
+ Optional<Map<String, Object>> first = resultList.stream().filter(r -> Integer.valueOf(String.valueOf(r.get("projectId"))).equals(project.getId())
|
|
|
|
+ && Integer.valueOf(String.valueOf(r.get("groupId"))).equals(taskGroup.get().getId()) && Integer.valueOf(String.valueOf(r.get("deptId"))).equals(7458)).findFirst();
|
|
|
|
+ if(first.isPresent()){
|
|
|
|
+ item.put("planHour",first.get().get("planHour"));
|
|
|
|
+ item.put("realHour",first.get().get("realHour"));
|
|
|
|
+ item.put("realCost",first.get().get("realCost"));
|
|
|
|
+ item.put("overHour",first.get().get("overHour"));
|
|
|
|
+ item.put("normalHour",first.get().get("normalHour"));
|
|
|
|
+ item.put("process",first.get().get("process"));
|
|
|
|
+ }else {
|
|
|
|
+ item.put("planHour",0);
|
|
|
|
+ item.put("realHour",0);
|
|
|
|
+ item.put("realCost",0);
|
|
|
|
+ item.put("overHour",0);
|
|
|
|
+ item.put("normalHour",0);
|
|
|
|
+ item.put("process","0%");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ itemList.add(item);
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ case 7460:
|
|
|
|
+ groupNames=new ArrayList<>();
|
|
|
|
+ groupNames.add("工程部现场安装施工");
|
|
|
|
+ groupNames.add("工程部配合调试");
|
|
|
|
+ for (String groupName : groupNames) {
|
|
|
|
+ Optional<TaskGroup> taskGroup = taskGroupList.stream().filter(f -> f.getName().equals(groupName) && f.getProjectId().equals(project.getId())).findFirst();
|
|
|
|
+ Map<String,Object> item=new HashMap<>();
|
|
|
|
+ item.put("projectId",project.getId());
|
|
|
|
+ item.put("projectName",project.getProjectName());
|
|
|
|
+ item.put("groupName",groupName);
|
|
|
|
+ item.put("corpwxDeptId",corpwxDeptid);
|
|
|
|
+ item.put("department_name",departmentName);
|
|
|
|
+ if(!taskGroup.isPresent()){
|
|
|
|
+ item.put("planHour",0);
|
|
|
|
+ item.put("realHour",0);
|
|
|
|
+ item.put("realCost",0);
|
|
|
|
+ item.put("overHour",0);
|
|
|
|
+ item.put("normalHour",0);
|
|
|
|
+ item.put("process","0%");
|
|
|
|
+ }else {
|
|
|
|
+ Optional<Map<String, Object>> first = resultList.stream().filter(r -> Integer.valueOf(String.valueOf(r.get("projectId"))).equals(project.getId())
|
|
|
|
+ && Integer.valueOf(String.valueOf(r.get("groupId"))).equals(taskGroup.get().getId()) && Integer.valueOf(String.valueOf(r.get("deptId"))).equals(7458)).findFirst();
|
|
|
|
+ if(first.isPresent()){
|
|
|
|
+ item.put("planHour",first.get().get("planHour"));
|
|
|
|
+ item.put("realHour",first.get().get("realHour"));
|
|
|
|
+ item.put("realCost",first.get().get("realCost"));
|
|
|
|
+ item.put("overHour",first.get().get("overHour"));
|
|
|
|
+ item.put("normalHour",first.get().get("normalHour"));
|
|
|
|
+ item.put("process",first.get().get("process"));
|
|
|
|
+ }else {
|
|
|
|
+ item.put("planHour",0);
|
|
|
|
+ item.put("realHour",0);
|
|
|
|
+ item.put("realCost",0);
|
|
|
|
+ item.put("overHour",0);
|
|
|
|
+ item.put("normalHour",0);
|
|
|
|
+ item.put("process","0%");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ itemList.add(item);
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ case 7458:
|
|
|
|
+ groupNames=new ArrayList<>();
|
|
|
|
+ groupNames.add("研发部工艺设计");
|
|
|
|
+ groupNames.add("研发部结构设计");
|
|
|
|
+ groupNames.add("研发部BIM设计");
|
|
|
|
+ groupNames.add("研发部电气设计");
|
|
|
|
+ groupNames.add("研发部工艺调试验收");
|
|
|
|
+ groupNames.add("研发部电气调试验收");
|
|
|
|
+ for (String groupName : groupNames) {
|
|
|
|
+ Optional<TaskGroup> taskGroup = taskGroupList.stream().filter(f -> f.getName().equals(groupName) && f.getProjectId().equals(project.getId())).findFirst();
|
|
|
|
+ Map<String,Object> item=new HashMap<>();
|
|
|
|
+ item.put("projectId",project.getId());
|
|
|
|
+ item.put("projectName",project.getProjectName());
|
|
|
|
+ item.put("groupName",groupName);
|
|
|
|
+ item.put("corpwxDeptId",corpwxDeptid);
|
|
|
|
+ item.put("department_name",departmentName);
|
|
|
|
+ if(!taskGroup.isPresent()){
|
|
|
|
+ item.put("planHour",0);
|
|
|
|
+ item.put("realHour",0);
|
|
|
|
+ item.put("realCost",0);
|
|
|
|
+ item.put("overHour",0);
|
|
|
|
+ item.put("normalHour",0);
|
|
|
|
+ item.put("process","0%");
|
|
|
|
+ }else {
|
|
|
|
+ Optional<Map<String, Object>> first = resultList.stream().filter(r -> Integer.valueOf(String.valueOf(r.get("projectId"))).equals(project.getId())
|
|
|
|
+ && Integer.valueOf(String.valueOf(r.get("groupId"))).equals(taskGroup.get().getId()) && Integer.valueOf(String.valueOf(r.get("deptId"))).equals(7458)).findFirst();
|
|
|
|
+ if(first.isPresent()){
|
|
|
|
+ item.put("planHour",first.get().get("planHour"));
|
|
|
|
+ item.put("realHour",first.get().get("realHour"));
|
|
|
|
+ item.put("realCost",first.get().get("realCost"));
|
|
|
|
+ item.put("overHour",first.get().get("overHour"));
|
|
|
|
+ item.put("normalHour",first.get().get("normalHour"));
|
|
|
|
+ item.put("process",first.get().get("process"));
|
|
|
|
+ }else {
|
|
|
|
+ item.put("planHour",0);
|
|
|
|
+ item.put("realHour",0);
|
|
|
|
+ item.put("realCost",0);
|
|
|
|
+ item.put("overHour",0);
|
|
|
|
+ item.put("normalHour",0);
|
|
|
|
+ item.put("process","0%");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ itemList.add(item);
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
Map<String,Object> resultMap=new HashMap<>();
|
|
Map<String,Object> resultMap=new HashMap<>();
|
|
- resultMap.put("record",resultList);
|
|
|
|
- resultMap.put("total",total);
|
|
|
|
|
|
+ resultMap.put("record",itemList);
|
|
|
|
+ resultMap.put("total",projectIPage.getTotal());
|
|
msg.setData(resultMap);
|
|
msg.setData(resultMap);
|
|
return msg;
|
|
return msg;
|
|
}
|
|
}
|
|
@@ -12828,7 +12989,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
}
|
|
}
|
|
deptNum+=maps1.size();
|
|
deptNum+=maps1.size();
|
|
}
|
|
}
|
|
- projectNum+=maps.size()+1;
|
|
|
|
|
|
+ projectNum+=maps.size();
|
|
}
|
|
}
|
|
for (Map<String, Object> map : mapList) {
|
|
for (Map<String, Object> map : mapList) {
|
|
list.add(String.valueOf(map.get("projectName")));
|
|
list.add(String.valueOf(map.get("projectName")));
|