|
@@ -770,8 +770,9 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
List<SysRichFunction> functionCostList = sysFunctionMapper.getRoleFunctions(targetUser.getRoleId(), "查看成本统计");
|
|
|
//判断查看权限
|
|
|
if(functionAllList.size()==0){
|
|
|
+ deptIds=new ArrayList<>();
|
|
|
+ deptIds.add(-1);
|
|
|
if(functionDpartList.size()>0){
|
|
|
- deptIds=new ArrayList<>();
|
|
|
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());
|
|
@@ -781,9 +782,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
deptIds.addAll(branchDepartment);
|
|
|
}
|
|
|
}
|
|
|
- }else {
|
|
|
- deptIds=new ArrayList<>();
|
|
|
- deptIds.add(-1);
|
|
|
}
|
|
|
}
|
|
|
TimeType timeType = timeTypeMapper.selectById(companyId);
|
|
@@ -917,6 +915,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
//判断查看权限
|
|
|
if(functionAllList.size()==0){
|
|
|
deptIds=new ArrayList<>();
|
|
|
+ deptIds.add(-1);
|
|
|
if(functionDpartList.size()>0){
|
|
|
if(functionTimeList.size()>0||functionCostList.size()>0){
|
|
|
List<Integer> collect = departmentList.stream().map(dp -> dp.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
@@ -924,8 +923,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
collect.addAll(otherCollect);
|
|
|
deptIds.addAll(otherCollect);
|
|
|
}
|
|
|
- }else {
|
|
|
- deptIds.add(-1);
|
|
|
}
|
|
|
}
|
|
|
List<Map<String, Object>> list = projectMapper.getTimeCost(companyId, startDate, endDate, projectId, userId,deptIds);
|
|
@@ -2285,6 +2282,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
if(functionAllList.size()==0){
|
|
|
if(functionDeptList.size()>0){
|
|
|
deptIds=new ArrayList<>();
|
|
|
+ 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());
|
|
|
collect.addAll(otherCollect);
|
|
@@ -2292,9 +2290,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
|
|
|
deptIds.addAll(branchDepartment);
|
|
|
}
|
|
|
- }else {
|
|
|
- deptIds=new ArrayList<>();
|
|
|
- deptIds.add(-1);
|
|
|
}
|
|
|
}
|
|
|
List<Map<String, Object>> list = projectMapper.getOvertimeDetail(userId, user.getCompanyId(), startDate, endDate, projectId,departmentId,deptIds);
|
|
@@ -2328,6 +2323,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
if(functionAllList.size()==0){
|
|
|
if(functionDeptList.size()>0){
|
|
|
deptIds=new ArrayList<>();
|
|
|
+ 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());
|
|
|
collect.addAll(otherCollect);
|
|
@@ -2335,9 +2331,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
|
|
|
deptIds.addAll(branchDepartment);
|
|
|
}
|
|
|
- }else {
|
|
|
- deptIds=new ArrayList<>();
|
|
|
- deptIds.add(-1);
|
|
|
}
|
|
|
}
|
|
|
List<Map<String, Object>> list = projectMapper.getOvertimeDetail(userId, user.getCompanyId(), startDate, endDate, projectId,null,deptIds);
|
|
@@ -3016,7 +3009,32 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
|
String token = request.getHeader("TOKEN");
|
|
|
User user = userMapper.selectById(token);
|
|
|
- msg.data = projectMapper.getDegreeCost(startDate, endDate, projectId, user.getCompanyId());
|
|
|
+ //当前用户管理部门
|
|
|
+ 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()));
|
|
|
+ List<SysRichFunction> functionAllList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "查看全公司");
|
|
|
+ List<SysRichFunction> functionDpartList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "查看负责部门");
|
|
|
+ List<SysRichFunction> functionTimeList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "查看工时统计");
|
|
|
+ List<SysRichFunction> functionCostList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "查看成本统计");
|
|
|
+ //判断查看权限
|
|
|
+ if(functionAllList.size()==0){
|
|
|
+ deptIds=new ArrayList<>();
|
|
|
+ deptIds.add(-1);
|
|
|
+ if(functionDpartList.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());
|
|
|
+ collect.addAll(otherCollect);
|
|
|
+ for (Integer integer : collect) {
|
|
|
+ List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
|
|
|
+ deptIds.addAll(branchDepartment);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ msg.data = projectMapper.getDegreeCost(startDate, endDate, projectId, user.getCompanyId(),deptIds);
|
|
|
return msg;
|
|
|
}
|
|
|
|
|
@@ -3329,8 +3347,9 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
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){
|
|
|
- deptIds=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());
|
|
|
collect.addAll(otherCollect);
|
|
@@ -3339,9 +3358,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
deptIds.addAll(branchDepartment);
|
|
|
}
|
|
|
|
|
|
- }else {
|
|
|
- deptIds=new ArrayList<>();
|
|
|
- deptIds.add(-1);
|
|
|
}
|
|
|
}
|
|
|
List<Map<String, Object>> list = projectMapper.getOvertimeDetail(userId, user.getCompanyId(), startDate, endDate, projectId,null,deptIds);
|
|
@@ -3730,8 +3746,9 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
List<SysRichFunction> functionCostList = sysFunctionMapper.getRoleFunctions(targetUser.getRoleId(), "查看成本统计");
|
|
|
//判断查看权限
|
|
|
if(functionAllList.size()==0){
|
|
|
+ deptIds=new ArrayList<>();
|
|
|
+ deptIds.add(-1);
|
|
|
if(functionDpartList.size()>0){
|
|
|
- deptIds=new ArrayList<>();
|
|
|
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());
|
|
@@ -3741,9 +3758,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
deptIds.addAll(branchDepartment);
|
|
|
}
|
|
|
}
|
|
|
- }else {
|
|
|
- deptIds=new ArrayList<>();
|
|
|
- deptIds.add(-1);
|
|
|
}
|
|
|
}
|
|
|
TimeType timeType = timeTypeMapper.selectById(companyId);
|
|
@@ -3877,6 +3891,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
//判断查看权限
|
|
|
if(functionAllList.size()==0){
|
|
|
deptIds=new ArrayList<>();
|
|
|
+ deptIds.add(-1);
|
|
|
if(functionDpartList.size()>0){
|
|
|
if(functionTimeList.size()>0||functionCostList.size()>0){
|
|
|
List<Integer> collect = departmentList.stream().map(dp -> dp.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
@@ -3884,8 +3899,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
collect.addAll(otherCollect);
|
|
|
deptIds.addAll(collect);
|
|
|
}
|
|
|
- }else {
|
|
|
- deptIds.add(-1);
|
|
|
}
|
|
|
}
|
|
|
List<Map<String, Object>> list = projectMapper.getTimeCostByCategory(companyId, startDate, endDate, projectCategoryId, userId,deptIds);
|
|
@@ -4023,8 +4036,9 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
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){
|
|
|
- deptIds=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());
|
|
|
collect.addAll(otherCollect);
|
|
@@ -4032,9 +4046,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
|
|
|
deptIds.addAll(branchDepartment);
|
|
|
}
|
|
|
- }else {
|
|
|
- deptIds=new ArrayList<>();
|
|
|
- deptIds.add(-1);
|
|
|
}
|
|
|
}
|
|
|
List<Map<String, Object>> list = projectMapper.getUserWorkingTimeList(userId, user.getCompanyId(), startDate, endDate, projectId,start,size,departmentId,deptIds);
|
|
@@ -4067,8 +4078,9 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
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){
|
|
|
- deptIds=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());
|
|
|
collect.addAll(otherCollect);
|
|
@@ -4076,9 +4088,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
|
|
|
deptIds.addAll(branchDepartment);
|
|
|
}
|
|
|
- }else {
|
|
|
- deptIds=new ArrayList<>();
|
|
|
- deptIds.add(-1);
|
|
|
}
|
|
|
}
|
|
|
List<Map<String, Object>> list = projectMapper.getUserWorkingTimeList(userId, user.getCompanyId(), startDate, endDate, projectId,null,null,null,deptIds);
|
|
@@ -4124,8 +4133,9 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
List<DepartmentOtherManager> departmentOtherManagerList = departmentOtherManagerMapper.selectList(new QueryWrapper<DepartmentOtherManager>().eq("other_manager_id", targetUser.getId()));
|
|
|
//判断查看权限
|
|
|
if(functionAllList.size()==0){
|
|
|
+ deptIds=new ArrayList<>();
|
|
|
+ deptIds.add(-1);
|
|
|
if(functionDeptList.size()>0){
|
|
|
- deptIds=new ArrayList<>();
|
|
|
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());
|
|
|
collect.addAll(otherCollect);
|
|
@@ -4133,10 +4143,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
|
|
|
deptIds.addAll(branchDepartment);
|
|
|
}
|
|
|
-
|
|
|
- }else {
|
|
|
- deptIds=new ArrayList<>();
|
|
|
- deptIds.add(-1);
|
|
|
}
|
|
|
}
|
|
|
List<Map<String,Object>> reportList=reportMapper.getUserReportTimelinessRate(targetUser.getCompanyId(),startDate,endDate);
|
|
@@ -4364,8 +4370,9 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
List<DepartmentOtherManager> departmentOtherManagerList = departmentOtherManagerMapper.selectList(new QueryWrapper<DepartmentOtherManager>().eq("other_manager_id", targetUser.getId()));
|
|
|
//判断查看权限
|
|
|
if(functionAllList.size()==0){
|
|
|
+ deptIds=new ArrayList<>();
|
|
|
+ deptIds.add(-1);
|
|
|
if(functionDeptList.size()>0){
|
|
|
- deptIds=new ArrayList<>();
|
|
|
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());
|
|
|
collect.addAll(otherCollect);
|
|
@@ -4373,9 +4380,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
|
|
|
deptIds.addAll(branchDepartment);
|
|
|
}
|
|
|
- }else {
|
|
|
- deptIds=new ArrayList<>();
|
|
|
- deptIds.add(-1);
|
|
|
}
|
|
|
}
|
|
|
long total;
|