|
@@ -248,8 +248,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
List<Department> departmentList = departmentMapper.selectList(new QueryWrapper<Department>().eq("manager_id", user.getId()).eq("company_id", companyId));
|
|
List<Department> departmentList = departmentMapper.selectList(new QueryWrapper<Department>().eq("manager_id", user.getId()).eq("company_id", companyId));
|
|
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()));
|
|
List<Integer> deptIds=new ArrayList<>();
|
|
List<Integer> deptIds=new ArrayList<>();
|
|
- List<Integer> theCollect = departmentList.stream().distinct().map(dm -> dm.getDepartmentId()).collect(Collectors.toList());
|
|
|
|
- List<Integer> otherCollect = departmentOtherManagerList.stream().distinct().map(dom -> dom.getDepartmentId()).collect(Collectors.toList());
|
|
|
|
|
|
+ List<Integer> theCollect = departmentList.stream().map(dm -> dm.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
|
|
+ List<Integer> otherCollect = departmentOtherManagerList.stream().map(dom -> dom.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
theCollect.addAll(otherCollect);
|
|
theCollect.addAll(otherCollect);
|
|
for (Integer integer : theCollect) {
|
|
for (Integer integer : theCollect) {
|
|
List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
|
|
List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
|
|
@@ -341,7 +341,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
List<ProjectMain> projectMainList = projectMainMapper.selectList(new QueryWrapper<ProjectMain>().eq("company_id", companyId));
|
|
List<ProjectMain> projectMainList = projectMainMapper.selectList(new QueryWrapper<ProjectMain>().eq("company_id", companyId));
|
|
List<ProjectLevel> projectLevelList = projectLevelMapper.selectList(new QueryWrapper<ProjectLevel>().eq("company_id", companyId));
|
|
List<ProjectLevel> projectLevelList = projectLevelMapper.selectList(new QueryWrapper<ProjectLevel>().eq("company_id", companyId));
|
|
TimeType timeType = timeTypeMapper.selectById(companyId);
|
|
TimeType timeType = timeTypeMapper.selectById(companyId);
|
|
- List<Integer> projectIds = projectList.stream().distinct().map(pl -> pl.getId()).collect(Collectors.toList());
|
|
|
|
|
|
+ List<Integer> projectIds = projectList.stream().map(pl -> pl.getId()).distinct().collect(Collectors.toList());
|
|
List<ProjectSeparate> projectSeparateList=new ArrayList<>();
|
|
List<ProjectSeparate> projectSeparateList=new ArrayList<>();
|
|
if(companyId==936){
|
|
if(companyId==936){
|
|
if (projectIds.size() > 0) {
|
|
if (projectIds.size() > 0) {
|
|
@@ -445,7 +445,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
}
|
|
}
|
|
list.add(projectVO);
|
|
list.add(projectVO);
|
|
}
|
|
}
|
|
- List<String> stringList = providerCategoryList.stream().distinct().map(ProviderCategory::getProviderCategoryName).collect(Collectors.toList());
|
|
|
|
|
|
+ List<String> stringList = providerCategoryList.stream().map(ProviderCategory::getProviderCategoryName).distinct().collect(Collectors.toList());
|
|
//stringList.add("未分类");
|
|
//stringList.add("未分类");
|
|
stringList.add(MessageUtils.message("excel.unclassified"));
|
|
stringList.add(MessageUtils.message("excel.unclassified"));
|
|
Long total = projectIPage.getTotal();
|
|
Long total = projectIPage.getTotal();
|
|
@@ -1059,8 +1059,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
|
|
|
//获取负责的部门的相关的项目,对于这些项目是有查看全部参与人的权限的
|
|
//获取负责的部门的相关的项目,对于这些项目是有查看全部参与人的权限的
|
|
List<Integer> allMyManagedDeptIds = new ArrayList<>();
|
|
List<Integer> allMyManagedDeptIds = new ArrayList<>();
|
|
- List<Integer> collect = departmentList.stream().distinct().map(dm -> dm.getDepartmentId()).collect(Collectors.toList());
|
|
|
|
- List<Integer> otherCollect = departmentOtherManagerList.stream().distinct().map(dom -> dom.getDepartmentId()).collect(Collectors.toList());
|
|
|
|
|
|
+ List<Integer> collect = departmentList.stream().map(dm -> dm.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
|
|
+ List<Integer> otherCollect = departmentOtherManagerList.stream().map(dom -> dom.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
collect.addAll(otherCollect);
|
|
collect.addAll(otherCollect);
|
|
for (Integer integer : collect) {
|
|
for (Integer integer : collect) {
|
|
List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
|
|
List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
|
|
@@ -1146,8 +1146,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
deptIds.add(-1);
|
|
deptIds.add(-1);
|
|
//获取负责的部门的相关的项目,对于这些项目是有查看全部参与人的权限的
|
|
//获取负责的部门的相关的项目,对于这些项目是有查看全部参与人的权限的
|
|
List<Integer> allMyManagedDeptIds = new ArrayList<>();
|
|
List<Integer> allMyManagedDeptIds = new ArrayList<>();
|
|
- List<Integer> collect = departmentList.stream().distinct().map(dm -> dm.getDepartmentId()).collect(Collectors.toList());
|
|
|
|
- List<Integer> otherCollect = departmentOtherManagerList.stream().distinct().map(dom -> dom.getDepartmentId()).collect(Collectors.toList());
|
|
|
|
|
|
+ List<Integer> collect = departmentList.stream().map(dm -> dm.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
|
|
+ List<Integer> otherCollect = departmentOtherManagerList.stream().map(dom -> dom.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
collect.addAll(otherCollect);
|
|
collect.addAll(otherCollect);
|
|
for (Integer integer : collect) {
|
|
for (Integer integer : collect) {
|
|
List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
|
|
List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
|
|
@@ -1649,7 +1649,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
deptIds.addAll(branchDepartment);
|
|
deptIds.addAll(branchDepartment);
|
|
}
|
|
}
|
|
List<Integer> collect = departmentList.stream().map(dp -> dp.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
List<Integer> collect = departmentList.stream().map(dp -> dp.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
- List<Integer> otherCollect = departmentOtherManagerList.stream().distinct().map(dom -> dom.getDepartmentId()).collect(Collectors.toList());
|
|
|
|
|
|
+ List<Integer> otherCollect = departmentOtherManagerList.stream().map(dom -> dom.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
collect.addAll(otherCollect);
|
|
collect.addAll(otherCollect);
|
|
for (Integer integer : collect) {
|
|
for (Integer integer : collect) {
|
|
List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
|
|
List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
|
|
@@ -2774,8 +2774,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
if(functionDeptList.size()>0){
|
|
if(functionDeptList.size()>0){
|
|
deptIds=new ArrayList<>();
|
|
deptIds=new ArrayList<>();
|
|
deptIds.add(-1);
|
|
deptIds.add(-1);
|
|
- List<Integer> collect = departmentList.stream().distinct().map(dm -> dm.getDepartmentId()).collect(Collectors.toList());
|
|
|
|
- List<Integer> otherCollect = departmentOtherManagerList.stream().distinct().map(dom -> dom.getDepartmentId()).collect(Collectors.toList());
|
|
|
|
|
|
+ List<Integer> collect = departmentList.stream().map(dm -> dm.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
|
|
+ List<Integer> otherCollect = departmentOtherManagerList.stream().map(dom -> dom.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
collect.addAll(otherCollect);
|
|
collect.addAll(otherCollect);
|
|
for (Integer integer : collect) {
|
|
for (Integer integer : collect) {
|
|
List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
|
|
List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
|
|
@@ -2836,8 +2836,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
if(functionDeptList.size()>0){
|
|
if(functionDeptList.size()>0){
|
|
deptIds=new ArrayList<>();
|
|
deptIds=new ArrayList<>();
|
|
deptIds.add(-1);
|
|
deptIds.add(-1);
|
|
- List<Integer> collect = departmentList.stream().distinct().map(dm -> dm.getDepartmentId()).collect(Collectors.toList());
|
|
|
|
- List<Integer> otherCollect = departmentOtherManagerList.stream().distinct().map(dom -> dom.getDepartmentId()).collect(Collectors.toList());
|
|
|
|
|
|
+ List<Integer> collect = departmentList.stream().map(dm -> dm.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
|
|
+ List<Integer> otherCollect = departmentOtherManagerList.stream().map(dom -> dom.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
collect.addAll(otherCollect);
|
|
collect.addAll(otherCollect);
|
|
for (Integer integer : collect) {
|
|
for (Integer integer : collect) {
|
|
List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
|
|
List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
|
|
@@ -4488,8 +4488,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
deptIds.add(-1);
|
|
deptIds.add(-1);
|
|
if(functionDpartList.size()>0){
|
|
if(functionDpartList.size()>0){
|
|
if(functionTimeList.size()>0||functionCostList.size()>0){
|
|
if(functionTimeList.size()>0||functionCostList.size()>0){
|
|
- List<Integer> collect = departmentList.stream().distinct().map(dm -> dm.getDepartmentId()).collect(Collectors.toList());
|
|
|
|
- List<Integer> otherCollect = departmentOtherManagerList.stream().distinct().map(dom -> dom.getDepartmentId()).collect(Collectors.toList());
|
|
|
|
|
|
+ List<Integer> collect = departmentList.stream().map(dm -> dm.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
|
|
+ List<Integer> otherCollect = departmentOtherManagerList.stream().map(dom -> dom.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
collect.addAll(otherCollect);
|
|
collect.addAll(otherCollect);
|
|
for (Integer integer : collect) {
|
|
for (Integer integer : collect) {
|
|
List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
|
|
List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
|
|
@@ -4647,7 +4647,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
DecimalFormat df = new DecimalFormat("##0.0#");
|
|
DecimalFormat df = new DecimalFormat("##0.0#");
|
|
df.setRoundingMode(RoundingMode.HALF_UP);
|
|
df.setRoundingMode(RoundingMode.HALF_UP);
|
|
//获取项目子表 数据
|
|
//获取项目子表 数据
|
|
- List<Integer> collect = projectVOList.stream().distinct().map(pv -> pv.getId()).collect(Collectors.toList());
|
|
|
|
|
|
+ List<Integer> collect = projectVOList.stream().map(pv -> pv.getId()).distinct().collect(Collectors.toList());
|
|
//防止空数据
|
|
//防止空数据
|
|
collect.add(-1);
|
|
collect.add(-1);
|
|
List<ProjectSeparate> projectSeparateList= projectSeparateMapper.selectList(new QueryWrapper<ProjectSeparate>().in("id", collect));
|
|
List<ProjectSeparate> projectSeparateList= projectSeparateMapper.selectList(new QueryWrapper<ProjectSeparate>().in("id", collect));
|
|
@@ -5108,8 +5108,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
deptIds=new ArrayList<>();
|
|
deptIds=new ArrayList<>();
|
|
deptIds.add(-1);
|
|
deptIds.add(-1);
|
|
if(functionDeptList.size()>0){
|
|
if(functionDeptList.size()>0){
|
|
- List<Integer> collect = departmentList.stream().distinct().map(dm -> dm.getDepartmentId()).collect(Collectors.toList());
|
|
|
|
- List<Integer> otherCollect = departmentOtherManagerList.stream().distinct().map(dom -> dom.getDepartmentId()).collect(Collectors.toList());
|
|
|
|
|
|
+ List<Integer> collect = departmentList.stream().map(dm -> dm.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
|
|
+ List<Integer> otherCollect = departmentOtherManagerList.stream().map(dom -> dom.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
collect.addAll(otherCollect);
|
|
collect.addAll(otherCollect);
|
|
for (Integer integer : collect) {
|
|
for (Integer integer : collect) {
|
|
List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
|
|
List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
|
|
@@ -5535,8 +5535,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
deptIds.add(-1);
|
|
deptIds.add(-1);
|
|
if(functionDpartList.size()>0){
|
|
if(functionDpartList.size()>0){
|
|
if(functionTimeList.size()>0||functionCostList.size()>0){
|
|
if(functionTimeList.size()>0||functionCostList.size()>0){
|
|
- List<Integer> collect = departmentList.stream().distinct().map(dm -> dm.getDepartmentId()).collect(Collectors.toList());
|
|
|
|
- List<Integer> otherCollect = departmentOtherManagerList.stream().distinct().map(dom -> dom.getDepartmentId()).collect(Collectors.toList());
|
|
|
|
|
|
+ List<Integer> collect = departmentList.stream().map(dm -> dm.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
|
|
+ List<Integer> otherCollect = departmentOtherManagerList.stream().map(dom -> dom.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
collect.addAll(otherCollect);
|
|
collect.addAll(otherCollect);
|
|
for (Integer integer : collect) {
|
|
for (Integer integer : collect) {
|
|
List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
|
|
List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
|
|
@@ -5606,7 +5606,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
if(functionDpartList.size()>0){
|
|
if(functionDpartList.size()>0){
|
|
if(functionTimeList.size()>0||functionCostList.size()>0){
|
|
if(functionTimeList.size()>0||functionCostList.size()>0){
|
|
List<Integer> collect = departmentList.stream().map(dp -> dp.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
List<Integer> collect = departmentList.stream().map(dp -> dp.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
- List<Integer> otherCollect = departmentOtherManagerList.stream().distinct().map(dom -> dom.getDepartmentId()).collect(Collectors.toList());
|
|
|
|
|
|
+ List<Integer> otherCollect = departmentOtherManagerList.stream().map(dom -> dom.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
collect.addAll(otherCollect);
|
|
collect.addAll(otherCollect);
|
|
for (Integer integer : collect) {
|
|
for (Integer integer : collect) {
|
|
List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
|
|
List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
|
|
@@ -5833,8 +5833,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
deptIds=new ArrayList<>();
|
|
deptIds=new ArrayList<>();
|
|
deptIds.add(-1);
|
|
deptIds.add(-1);
|
|
if(functionDeptList.size()>0){
|
|
if(functionDeptList.size()>0){
|
|
- List<Integer> collect = departmentList.stream().distinct().map(dm -> dm.getDepartmentId()).collect(Collectors.toList());
|
|
|
|
- List<Integer> otherCollect = departmentOtherManagerList.stream().distinct().map(dom -> dom.getDepartmentId()).collect(Collectors.toList());
|
|
|
|
|
|
+ List<Integer> collect = departmentList.stream().map(dm -> dm.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
|
|
+ List<Integer> otherCollect = departmentOtherManagerList.stream().map(dom -> dom.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
collect.addAll(otherCollect);
|
|
collect.addAll(otherCollect);
|
|
for (Integer integer : collect) {
|
|
for (Integer integer : collect) {
|
|
List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
|
|
List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
|
|
@@ -6034,6 +6034,27 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
HttpRespMsg userWorkingTimeList = getUserWorkingTimeList(userId,projectId,startDate, endDate, null,null,request,departmentId);
|
|
HttpRespMsg userWorkingTimeList = getUserWorkingTimeList(userId,projectId,startDate, endDate, null,null,request,departmentId);
|
|
HashMap result = (HashMap) userWorkingTimeList.data;
|
|
HashMap result = (HashMap) userWorkingTimeList.data;
|
|
List<Map<String, Object>> resultList = (List<Map<String, Object>>) result.get("result");
|
|
List<Map<String, Object>> resultList = (List<Map<String, Object>>) result.get("result");
|
|
|
|
+ List<SysRichFunction> functionAllList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "全公司工时分配");
|
|
|
|
+ List<SysRichFunction> functionDeptList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "负责部门工时分配");
|
|
|
|
+ List<Integer> deptIds=null;
|
|
|
|
+ List<Department> allDepartmentList=departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id",user.getCompanyId()));
|
|
|
|
+ List<Department> departmentList = departmentMapper.selectList(new QueryWrapper<Department>().eq("manager_id", user.getId()).eq("company_id",user.getCompanyId()));
|
|
|
|
+ List<DepartmentOtherManager> departmentOtherManagerList = departmentOtherManagerMapper.selectList(new QueryWrapper<DepartmentOtherManager>().eq("other_manager_id", user.getId()));
|
|
|
|
+ //判断查看权限
|
|
|
|
+ if(functionAllList.size()==0){
|
|
|
|
+ deptIds=new ArrayList<>();
|
|
|
|
+ deptIds.add(-1);
|
|
|
|
+ if(functionDeptList.size()>0){
|
|
|
|
+ List<Integer> collect = departmentList.stream().map(dm -> dm.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
|
|
+ List<Integer> otherCollect = departmentOtherManagerList.stream().map(dom -> dom.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
|
|
+ collect.addAll(otherCollect);
|
|
|
|
+ for (Integer integer : collect) {
|
|
|
|
+ List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
|
|
|
|
+ deptIds.addAll(branchDepartment);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ List<Map<String, Object>> list = projectMapper.getUserWorkingTimeList(userId, user.getCompanyId(), startDate, endDate, projectId,null,null,null,deptIds);
|
|
//String[] string={"人员","部门","工号","普通项目工时","公共项目工时","请假时长","总工时","公共项目工时占比"};
|
|
//String[] string={"人员","部门","工号","普通项目工时","公共项目工时","请假时长","总工时","公共项目工时占比"};
|
|
String[] string={MessageUtils.message("entry.personnel"),MessageUtils.message("excel.department"),MessageUtils.message("entry.No"),MessageUtils.message("entry.GenProHours"),MessageUtils.message("entry.PubProHours"),MessageUtils.message("leave.duration"),MessageUtils.message("entry.totalManHours"),MessageUtils.message("entry.PubProHoursProp")};
|
|
String[] string={MessageUtils.message("entry.personnel"),MessageUtils.message("excel.department"),MessageUtils.message("entry.No"),MessageUtils.message("entry.GenProHours"),MessageUtils.message("entry.PubProHours"),MessageUtils.message("leave.duration"),MessageUtils.message("entry.totalManHours"),MessageUtils.message("entry.PubProHoursProp")};
|
|
List<List<String>> dataList=new ArrayList<>();
|
|
List<List<String>> dataList=new ArrayList<>();
|
|
@@ -6100,8 +6121,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
deptIds=new ArrayList<>();
|
|
deptIds=new ArrayList<>();
|
|
deptIds.add(-1);
|
|
deptIds.add(-1);
|
|
if(functionDeptList.size()>0){
|
|
if(functionDeptList.size()>0){
|
|
- List<Integer> collect = userDepartmentList.stream().distinct().map(dm -> dm.getDepartmentId()).collect(Collectors.toList());
|
|
|
|
- List<Integer> otherCollect = departmentOtherManagerList.stream().distinct().map(dom -> dom.getDepartmentId()).collect(Collectors.toList());
|
|
|
|
|
|
+ List<Integer> collect = userDepartmentList.stream().map(dm -> dm.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
|
|
+ List<Integer> otherCollect = departmentOtherManagerList.stream().map(dom -> dom.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
collect.addAll(otherCollect);
|
|
collect.addAll(otherCollect);
|
|
for (Integer integer : collect) {
|
|
for (Integer integer : collect) {
|
|
List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
|
|
List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
|
|
@@ -6400,8 +6421,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
List<DepartmentOtherManager> otherManagers = departmentOtherManagerMapper.selectList(new QueryWrapper<DepartmentOtherManager>().eq("other_manager_id", user.getId()));
|
|
List<DepartmentOtherManager> otherManagers = departmentOtherManagerMapper.selectList(new QueryWrapper<DepartmentOtherManager>().eq("other_manager_id", user.getId()));
|
|
//获取全部子部门
|
|
//获取全部子部门
|
|
List<Department> allDeptList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", user.getCompanyId()));
|
|
List<Department> allDeptList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", user.getCompanyId()));
|
|
- List<Integer> collect = departmentList.stream().distinct().map(Department::getDepartmentId).collect(Collectors.toList());
|
|
|
|
- List<Integer> collect1 = otherManagers.stream().distinct().map(DepartmentOtherManager::getDepartmentId).collect(Collectors.toList());
|
|
|
|
|
|
+ List<Integer> collect = departmentList.stream().map(Department::getDepartmentId).distinct().collect(Collectors.toList());
|
|
|
|
+ List<Integer> collect1 = otherManagers.stream().map(DepartmentOtherManager::getDepartmentId).distinct().collect(Collectors.toList());
|
|
List<Integer> deptIds=new ArrayList<>();
|
|
List<Integer> deptIds=new ArrayList<>();
|
|
for (Integer dpId : collect) {
|
|
for (Integer dpId : collect) {
|
|
List<Integer> ids = departmentService.getDeptIncludeSubDeptIds(dpId, allDeptList);
|
|
List<Integer> ids = departmentService.getDeptIncludeSubDeptIds(dpId, allDeptList);
|
|
@@ -6535,8 +6556,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
deptIds=new ArrayList<>();
|
|
deptIds=new ArrayList<>();
|
|
deptIds.add(-1);
|
|
deptIds.add(-1);
|
|
if(functionDeptList.size()>0){
|
|
if(functionDeptList.size()>0){
|
|
- List<Integer> collect = userDepartmentList.stream().distinct().map(dm -> dm.getDepartmentId()).collect(Collectors.toList());
|
|
|
|
- List<Integer> otherCollect = departmentOtherManagerList.stream().distinct().map(dom -> dom.getDepartmentId()).collect(Collectors.toList());
|
|
|
|
|
|
+ List<Integer> collect = userDepartmentList.stream().map(dm -> dm.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
|
|
+ List<Integer> otherCollect = departmentOtherManagerList.stream().map(dom -> dom.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
collect.addAll(otherCollect);
|
|
collect.addAll(otherCollect);
|
|
for (Integer integer : collect) {
|
|
for (Integer integer : collect) {
|
|
List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
|
|
List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
|
|
@@ -6694,8 +6715,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
deptIds.add(-1);
|
|
deptIds.add(-1);
|
|
if(functionDpartList.size()>0){
|
|
if(functionDpartList.size()>0){
|
|
if(functionTimeList.size()>0||functionCostList.size()>0){
|
|
if(functionTimeList.size()>0||functionCostList.size()>0){
|
|
- List<Integer> collect = departmentList.stream().distinct().map(dm -> dm.getDepartmentId()).collect(Collectors.toList());
|
|
|
|
- List<Integer> otherCollect = departmentOtherManagerList.stream().distinct().map(dom -> dom.getDepartmentId()).collect(Collectors.toList());
|
|
|
|
|
|
+ List<Integer> collect = departmentList.stream().map(dm -> dm.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
|
|
+ List<Integer> otherCollect = departmentOtherManagerList.stream().map(dom -> dom.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
collect.addAll(otherCollect);
|
|
collect.addAll(otherCollect);
|
|
for (Integer integer : collect) {
|
|
for (Integer integer : collect) {
|
|
List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
|
|
List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
|
|
@@ -7009,13 +7030,13 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
queryWrapper.eq("company_id",user.getCompanyId()));
|
|
queryWrapper.eq("company_id",user.getCompanyId()));
|
|
}
|
|
}
|
|
List<Project> targetProjectList = projectIPage.getRecords();
|
|
List<Project> targetProjectList = projectIPage.getRecords();
|
|
- List<Integer> collect = targetProjectList.stream().distinct().map(Project::getId).collect(Collectors.toList());
|
|
|
|
|
|
+ List<Integer> collect = targetProjectList.stream().map(Project::getId).distinct().collect(Collectors.toList());
|
|
List<ProjectBasecost> projectBasecostList=new ArrayList<>();
|
|
List<ProjectBasecost> projectBasecostList=new ArrayList<>();
|
|
if(collect!=null&&collect.size()>0){
|
|
if(collect!=null&&collect.size()>0){
|
|
projectBasecostList = projectBasecostMapper.selectList(new QueryWrapper<ProjectBasecost>().in("project_id", collect));
|
|
projectBasecostList = projectBasecostMapper.selectList(new QueryWrapper<ProjectBasecost>().in("project_id", collect));
|
|
}
|
|
}
|
|
List<ProjectBasecostSetting> settingList = projectBasecostSettingMapper.selectList(new QueryWrapper<ProjectBasecostSetting>().eq("company_id", user.getCompanyId()));
|
|
List<ProjectBasecostSetting> settingList = projectBasecostSettingMapper.selectList(new QueryWrapper<ProjectBasecostSetting>().eq("company_id", user.getCompanyId()));
|
|
- List<String> titleList = settingList.stream().distinct().map(ProjectBasecostSetting::getName).collect(Collectors.toList());
|
|
|
|
|
|
+ List<String> titleList = settingList.stream().map(ProjectBasecostSetting::getName).distinct().collect(Collectors.toList());
|
|
for (Project project : targetProjectList) {
|
|
for (Project project : targetProjectList) {
|
|
List<ProjectBasecost> basecostList = projectBasecostList.stream().filter(pb -> pb.getProjectId().equals(project.getId())).collect(Collectors.toList());
|
|
List<ProjectBasecost> basecostList = projectBasecostList.stream().filter(pb -> pb.getProjectId().equals(project.getId())).collect(Collectors.toList());
|
|
if(basecostList!=null){
|
|
if(basecostList!=null){
|
|
@@ -7095,8 +7116,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
deptIds.add(-1);
|
|
deptIds.add(-1);
|
|
if(functionDpartList.size()>0){
|
|
if(functionDpartList.size()>0){
|
|
if(functionTimeList.size()>0||functionCostList.size()>0){
|
|
if(functionTimeList.size()>0||functionCostList.size()>0){
|
|
- List<Integer> collect = departmentList.stream().distinct().map(dm -> dm.getDepartmentId()).collect(Collectors.toList());
|
|
|
|
- List<Integer> otherCollect = departmentOtherManagerList.stream().distinct().map(dom -> dom.getDepartmentId()).collect(Collectors.toList());
|
|
|
|
|
|
+ List<Integer> collect = departmentList.stream().map(dm -> dm.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
|
|
+ List<Integer> otherCollect = departmentOtherManagerList.stream().map(dom -> dom.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
collect.addAll(otherCollect);
|
|
collect.addAll(otherCollect);
|
|
for (Integer integer : collect) {
|
|
for (Integer integer : collect) {
|
|
List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
|
|
List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
|
|
@@ -7804,8 +7825,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
deptIds=new ArrayList<>();
|
|
deptIds=new ArrayList<>();
|
|
deptIds.add(-1);
|
|
deptIds.add(-1);
|
|
if(functionDeptList.size()>0){
|
|
if(functionDeptList.size()>0){
|
|
- List<Integer> collect = userDepartmentList.stream().distinct().map(dm -> dm.getDepartmentId()).collect(Collectors.toList());
|
|
|
|
- List<Integer> otherCollect = departmentOtherManagerList.stream().distinct().map(dom -> dom.getDepartmentId()).collect(Collectors.toList());
|
|
|
|
|
|
+ List<Integer> collect = userDepartmentList.stream().map(dm -> dm.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
|
|
+ List<Integer> otherCollect = departmentOtherManagerList.stream().map(dom -> dom.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
collect.addAll(otherCollect);
|
|
collect.addAll(otherCollect);
|
|
//将该用户管理的所有部门以及部门的子部门id添加到deptIds集合中
|
|
//将该用户管理的所有部门以及部门的子部门id添加到deptIds集合中
|
|
for (Integer integer : collect) {
|
|
for (Integer integer : collect) {
|
|
@@ -7971,8 +7992,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
deptIds.add(-1);
|
|
deptIds.add(-1);
|
|
if(functionDeptList.size()>0){
|
|
if(functionDeptList.size()>0){
|
|
//获取管理的部门id
|
|
//获取管理的部门id
|
|
- List<Integer> collect = userDepartmentList.stream().distinct().map(dm -> dm.getDepartmentId()).collect(Collectors.toList());
|
|
|
|
- List<Integer> otherCollect = departmentOtherManagerList.stream().distinct().map(dom -> dom.getDepartmentId()).collect(Collectors.toList());
|
|
|
|
|
|
+ List<Integer> collect = userDepartmentList.stream().map(dm -> dm.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
|
|
+ List<Integer> otherCollect = departmentOtherManagerList.stream().map(dom -> dom.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
collect.addAll(otherCollect);
|
|
collect.addAll(otherCollect);
|
|
//将该用户管理的所有部门以及部门的子部门id添加到deptIds集合中
|
|
//将该用户管理的所有部门以及部门的子部门id添加到deptIds集合中
|
|
for (Integer integer : collect) {
|
|
for (Integer integer : collect) {
|
|
@@ -8635,6 +8656,114 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
|
|
|
return msg;
|
|
return msg;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public HttpRespMsg projectGroupAndCategoryWorkTime(HttpServletRequest request, String startDate, String endDate, Integer projectId,Integer pageIndex,Integer pageSize) {
|
|
|
|
+ HttpRespMsg msg = new HttpRespMsg();
|
|
|
|
+ Integer start = (pageIndex-1)*pageSize;
|
|
|
|
+ Integer size = pageSize*pageIndex;
|
|
|
|
+ User user = userMapper.selectById(request.getHeader("token"));
|
|
|
|
+ List<Project> projectList = projectMapper.selectList(new QueryWrapper<Project>().eq("company_id", user.getCompanyId()));
|
|
|
|
+ List<SysRichFunction> functionAllList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "全部分组阶段工时");
|
|
|
|
+ List<SysRichFunction> functionInchargeList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "负责项目分组阶段工时");
|
|
|
|
+ //判断查看权限
|
|
|
|
+ List<Integer> inchagerIds=null;
|
|
|
|
+ if(false){
|
|
|
|
+ inchagerIds=new ArrayList<>();
|
|
|
|
+ if(functionInchargeList.size()>0){
|
|
|
|
+ List<Project> list = projectList.stream().filter(pl -> (pl.getInchargerId()==null?0:pl.getInchargerId()).equals(user.getId())).collect(Collectors.toList());
|
|
|
|
+ if(list!=null){
|
|
|
|
+ List<Integer> collect = list.stream().map(li -> li.getId()).collect(Collectors.toList());
|
|
|
|
+ inchagerIds.addAll(collect);
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ inchagerIds.add(-1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ List<Map<String,Object>> projectGroupAndCategoryList=projectMapper.getProjectGroupAndCategoryList(startDate,endDate,projectId,user.getCompanyId(),start,size,inchagerIds);
|
|
|
|
+ long total=projectMapper.getProjectGroupAndCategoryCount(startDate,endDate,projectId,user.getCompanyId(),null,null,inchagerIds);
|
|
|
|
+ List<Integer> projectIds = projectGroupAndCategoryList.stream().map(pl ->Integer.valueOf(String.valueOf(pl.get("projectId")))).distinct().collect(Collectors.toList());
|
|
|
|
+ List<Stages> stagesList = stagesMapper.selectList(new QueryWrapper<Stages>().in("project_id", projectIds));
|
|
|
|
+ List<String> titleList=new ArrayList<>();
|
|
|
|
+ titleList.add("项目编号");
|
|
|
|
+ titleList.add("项目名称");
|
|
|
|
+ titleList.add("任务分组");
|
|
|
|
+ titleList.add("分组合计工时");
|
|
|
|
+ List<String> stagesNameList = stagesList.stream().map(sl -> sl.getStagesName()).distinct().collect(Collectors.toList());
|
|
|
|
+ stagesNameList.add("非阶段");
|
|
|
|
+ titleList.addAll(stagesNameList);
|
|
|
|
+ List<Map<String,Object>> projectGroupAndCategoryData=projectMapper.getProjectGroupAndCategoryData(startDate,endDate,projectId,user.getCompanyId(),start,size,projectIds);
|
|
|
|
+ for (Map<String, Object> item : projectGroupAndCategoryList) {
|
|
|
|
+ List<Map<String, Object>> list = projectGroupAndCategoryData.stream().filter(pl -> pl.get("groupId").equals(item.get("groupId")) && pl.get("projectId").equals(item.get("projectId"))).collect(Collectors.toList());
|
|
|
|
+ item.put("categoryList",list);
|
|
|
|
+ }
|
|
|
|
+ Map<String,Object> map=new HashMap<>();
|
|
|
|
+ map.put("data",projectGroupAndCategoryList);
|
|
|
|
+ map.put("total",total);
|
|
|
|
+ map.put("titleList",titleList);
|
|
|
|
+ msg.data=map;
|
|
|
|
+ return msg;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public HttpRespMsg exportProjectGroupAndCategoryWorkTime(HttpServletRequest request, String startDate, String endDate, Integer projectId) {
|
|
|
|
+ HttpRespMsg msg=new HttpRespMsg();
|
|
|
|
+ User user = userMapper.selectById(request.getHeader("token"));
|
|
|
|
+ List<Project> projectList = projectMapper.selectList(new QueryWrapper<Project>().eq("company_id", user.getCompanyId()));
|
|
|
|
+ List<SysRichFunction> functionAllList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "全部任务阶段工时");
|
|
|
|
+ List<SysRichFunction> functionInchargeList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "负责项目任务阶段工时");
|
|
|
|
+ //判断查看权限
|
|
|
|
+ List<Integer> inchagerIds=null;
|
|
|
|
+ if(false){
|
|
|
|
+ inchagerIds=new ArrayList<>();
|
|
|
|
+ if(functionInchargeList.size()>0){
|
|
|
|
+ List<Project> list = projectList.stream().filter(pl -> (pl.getInchargerId()==null?0:pl.getInchargerId()).equals(user.getId())).collect(Collectors.toList());
|
|
|
|
+ if(list!=null){
|
|
|
|
+ List<Integer> collect = list.stream().map(li -> li.getId()).collect(Collectors.toList());
|
|
|
|
+ inchagerIds.addAll(collect);
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ inchagerIds.add(-1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ List<Map<String,Object>> projectGroupAndCategoryList=projectMapper.getProjectGroupAndCategoryList(startDate,endDate,projectId,user.getCompanyId(),null,null,inchagerIds);
|
|
|
|
+ List<Integer> projectIds = projectGroupAndCategoryList.stream().map(pl ->Integer.valueOf(String.valueOf(pl.get("projectId")))).distinct().collect(Collectors.toList());
|
|
|
|
+ List<Stages> stagesList = stagesMapper.selectList(new QueryWrapper<Stages>().in("project_id", projectIds));
|
|
|
|
+ List<String> titleList=new ArrayList<>();
|
|
|
|
+ titleList.add("项目编号");
|
|
|
|
+ titleList.add("项目名称");
|
|
|
|
+ titleList.add("任务分组");
|
|
|
|
+ titleList.add("分组合计工时");
|
|
|
|
+ List<String> stagesNameList = stagesList.stream().map(sl -> sl.getStagesName()).distinct().collect(Collectors.toList());
|
|
|
|
+ stagesNameList.add("非阶段");
|
|
|
|
+ titleList.addAll(stagesNameList);
|
|
|
|
+ List<List<String>> dataList=new ArrayList<>();
|
|
|
|
+ dataList.add(titleList);
|
|
|
|
+ List<Map<String,Object>> projectGroupAndCategoryData=projectMapper.getProjectGroupAndCategoryData(startDate,endDate,projectId,user.getCompanyId(),null,null,projectIds);
|
|
|
|
+ for (Map<String, Object> item : projectGroupAndCategoryList) {
|
|
|
|
+ List<String> stringList=new ArrayList<>();
|
|
|
|
+ List<Map<String, Object>> list = projectGroupAndCategoryData.stream().filter(pl -> pl.get("groupId").equals(item.get("groupId")) && pl.get("projectId").equals(item.get("projectId"))).collect(Collectors.toList());
|
|
|
|
+ stringList.add(String.valueOf(item.get("projectCode")));
|
|
|
|
+ stringList.add(String.valueOf(item.get("projectName")));
|
|
|
|
+ stringList.add(String.valueOf(item.get("groupName")));
|
|
|
|
+ stringList.add(String.valueOf(item.get("workingTime"))+"h");
|
|
|
|
+ for (String s : stagesNameList) {
|
|
|
|
+ Optional<Map<String, Object>> stagesName = list.stream().filter(l -> l.get("stagesName").equals(s)).findFirst();
|
|
|
|
+ if(stagesName.isPresent()){
|
|
|
|
+ stringList.add(String.valueOf(stagesName.get().get("workingTime"))+"h");
|
|
|
|
+ }else {
|
|
|
|
+ stringList.add("0h");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ dataList.add(stringList);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ String fileName = "项目分组阶段工时表"+System.currentTimeMillis();
|
|
|
|
+ String resp = ExcelUtil.exportGeneralExcelByTitleAndList(fileName, dataList, path);
|
|
|
|
+ msg.data=resp;
|
|
|
|
+ return msg;
|
|
|
|
+ }
|
|
|
|
+
|
|
private List<GanttDataItem> getUserGanttDataItemList(GanttDataItem userGantt, List<GanttDataItem> itemList) {
|
|
private List<GanttDataItem> getUserGanttDataItemList(GanttDataItem userGantt, List<GanttDataItem> itemList) {
|
|
if(itemList==null){
|
|
if(itemList==null){
|
|
itemList=new ArrayList<>();
|
|
itemList=new ArrayList<>();
|