|
@@ -165,7 +165,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
//分页获取项目列表
|
|
|
@Override
|
|
|
public HttpRespMsg getProjectPage(Integer pageIndex, Integer pageSize, String keyword, Integer searchField,
|
|
|
- Integer status, Integer category, Integer projectId, HttpServletRequest request) {
|
|
|
+ Integer status, Integer category, Integer projectId,Integer projectMainId, HttpServletRequest request) {
|
|
|
HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
|
try {
|
|
|
//通过公司id获取该公司所有的项目列表
|
|
@@ -203,6 +203,9 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
if (category != null) {
|
|
|
queryWrapper.eq("category", category);
|
|
|
}
|
|
|
+ if (projectMainId != null) {
|
|
|
+ queryWrapper.eq("project_main_id", projectMainId);
|
|
|
+ }
|
|
|
if (projectId != null) {
|
|
|
queryWrapper.eq("id", projectId);
|
|
|
}
|
|
@@ -1984,7 +1987,21 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
|
String token = request.getHeader("TOKEN");
|
|
|
User user = userMapper.selectById(token);
|
|
|
- List<Map<String, Object>> list = projectMapper.getOvertimeDetail(userId, user.getCompanyId(), startDate, endDate, projectId,departmentId);
|
|
|
+ List<SysRichFunction> functionAllList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "全公司加班情况");
|
|
|
+ List<SysRichFunction> functionDeptList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "负责部门加班情况");
|
|
|
+ List<Integer> deptIds=null;
|
|
|
+ List<Department> departmentList = departmentMapper.selectList(new QueryWrapper<Department>().eq("manager_id", user.getId()).eq("company_id",user.getCompanyId()));
|
|
|
+ //判断查看权限
|
|
|
+ if(functionAllList.size()==0){
|
|
|
+ if(functionDeptList.size()>0){
|
|
|
+ deptIds = departmentList.stream().map(dp -> dp.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
|
+ deptIds.add(user.getDepartmentId());
|
|
|
+ }else {
|
|
|
+ deptIds=new ArrayList<>();
|
|
|
+ deptIds.add(-1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<Map<String, Object>> list = projectMapper.getOvertimeDetail(userId, user.getCompanyId(), startDate, endDate, projectId,departmentId,deptIds);
|
|
|
boolean hasViewSalary = sysFunctionService.hasPriviledge(user.getRoleId(), "查看加班成本");
|
|
|
if (!hasViewSalary) {
|
|
|
//去掉权限
|
|
@@ -2005,7 +2022,21 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
String token = request.getHeader("TOKEN");
|
|
|
User user = userMapper.selectById(token);
|
|
|
TimeType timeType = timeTypeMapper.selectById(user.getCompanyId());
|
|
|
- List<Map<String, Object>> list = projectMapper.getOvertimeDetail(userId, user.getCompanyId(), startDate, endDate, projectId,null);
|
|
|
+ List<SysRichFunction> functionAllList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "全公司加班情况");
|
|
|
+ List<SysRichFunction> functionDeptList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "负责部门加班情况");
|
|
|
+ List<Integer> deptIds=null;
|
|
|
+ List<Department> departmentList = departmentMapper.selectList(new QueryWrapper<Department>().eq("manager_id", user.getId()).eq("company_id",user.getCompanyId()));
|
|
|
+ //判断查看权限
|
|
|
+ if(functionAllList.size()==0){
|
|
|
+ if(functionDeptList.size()>0){
|
|
|
+ deptIds = departmentList.stream().map(dp -> dp.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
|
+ deptIds.add(user.getDepartmentId());
|
|
|
+ }else {
|
|
|
+ deptIds=new ArrayList<>();
|
|
|
+ deptIds.add(-1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<Map<String, Object>> list = projectMapper.getOvertimeDetail(userId, user.getCompanyId(), startDate, endDate, projectId,null,deptIds);
|
|
|
boolean hasViewSalary = sysFunctionService.hasPriviledge(user.getRoleId(), "查看加班成本");
|
|
|
BigDecimal totalMoneyCost = BigDecimal.valueOf(0);
|
|
|
List<String> headList = new ArrayList<String>();
|
|
@@ -2593,7 +2624,21 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
|
String token = request.getHeader("TOKEN");
|
|
|
User user = userMapper.selectById(token);
|
|
|
- List<Map<String, Object>> list = projectMapper.getOvertimeDetail(userId, user.getCompanyId(), startDate, endDate, projectId,null);
|
|
|
+ List<SysRichFunction> functionAllList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "全公司加班情况");
|
|
|
+ List<SysRichFunction> functionDeptList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "负责部门加班情况");
|
|
|
+ List<Integer> deptIds=null;
|
|
|
+ List<Department> departmentList = departmentMapper.selectList(new QueryWrapper<Department>().eq("manager_id", user.getId()).eq("company_id",user.getCompanyId()));
|
|
|
+ //判断查看权限
|
|
|
+ if(functionAllList.size()==0){
|
|
|
+ if(functionDeptList.size()>0){
|
|
|
+ deptIds = departmentList.stream().map(dp -> dp.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
|
+ deptIds.add(user.getDepartmentId());
|
|
|
+ }else {
|
|
|
+ deptIds=new ArrayList<>();
|
|
|
+ deptIds.add(-1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<Map<String, Object>> list = projectMapper.getOvertimeDetail(userId, user.getCompanyId(), startDate, endDate, projectId,null,deptIds);
|
|
|
boolean hasViewSalary = sysFunctionService.hasPriviledge(user.getRoleId(), "查看加班成本");
|
|
|
if (!hasViewSalary) {
|
|
|
//去掉权限
|
|
@@ -3230,8 +3275,22 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
|
String token = request.getHeader("TOKEN");
|
|
|
User user = userMapper.selectById(token);
|
|
|
- List<Map<String, Object>> list = projectMapper.getUserWorkingTimeList(userId, user.getCompanyId(), startDate, endDate, projectId,start,size,departmentId);
|
|
|
- long total=projectMapper.findCountWithUser(userId, user.getCompanyId(), startDate, endDate, projectId,null,null);
|
|
|
+ List<SysRichFunction> functionAllList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "全公司工时分配");
|
|
|
+ List<SysRichFunction> functionDeptList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "负责部门工时分配");
|
|
|
+ List<Integer> deptIds=null;
|
|
|
+ List<Department> departmentList = departmentMapper.selectList(new QueryWrapper<Department>().eq("manager_id", user.getId()).eq("company_id",user.getCompanyId()));
|
|
|
+ //判断查看权限
|
|
|
+ if(functionAllList.size()==0){
|
|
|
+ if(functionDeptList.size()>0){
|
|
|
+ deptIds = departmentList.stream().map(dp -> dp.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
|
+ deptIds.add(user.getDepartmentId());
|
|
|
+ }else {
|
|
|
+ deptIds=new ArrayList<>();
|
|
|
+ deptIds.add(-1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<Map<String, Object>> list = projectMapper.getUserWorkingTimeList(userId, user.getCompanyId(), startDate, endDate, projectId,start,size,departmentId,deptIds);
|
|
|
+ long total=projectMapper.findCountWithUser(userId, user.getCompanyId(), startDate, endDate, projectId,null,null,departmentId,deptIds);
|
|
|
list.forEach(li->{
|
|
|
double isPublic = (double) li.get("isPublic");
|
|
|
double workingTime = (double) li.get("workingTime");
|
|
@@ -3252,7 +3311,21 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
|
String token = request.getHeader("TOKEN");
|
|
|
User user = userMapper.selectById(token);
|
|
|
- List<Map<String, Object>> list = projectMapper.getUserWorkingTimeList(userId, user.getCompanyId(), startDate, endDate, projectId,null,null,null);
|
|
|
+ List<SysRichFunction> functionAllList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "全公司工时分配");
|
|
|
+ List<SysRichFunction> functionDeptList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "负责部门工时分配");
|
|
|
+ List<Integer> deptIds=null;
|
|
|
+ List<Department> departmentList = departmentMapper.selectList(new QueryWrapper<Department>().eq("manager_id", user.getId()).eq("company_id",user.getCompanyId()));
|
|
|
+ //判断查看权限
|
|
|
+ if(functionAllList.size()==0){
|
|
|
+ if(functionDeptList.size()>0){
|
|
|
+ deptIds = departmentList.stream().map(dp -> dp.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
|
+ deptIds.add(user.getDepartmentId());
|
|
|
+ }else {
|
|
|
+ deptIds=new ArrayList<>();
|
|
|
+ deptIds.add(-1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<Map<String, Object>> list = projectMapper.getUserWorkingTimeList(userId, user.getCompanyId(), startDate, endDate, projectId,null,null,null,deptIds);
|
|
|
String[] string={"人员","普通项目工时","公共项目工时","总工时","公共项目工时占比"};
|
|
|
List<List<String>> dataList=new ArrayList<>();
|
|
|
dataList.add(Arrays.asList(string));
|
|
@@ -3291,21 +3364,37 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
days-=1;
|
|
|
}
|
|
|
}
|
|
|
- Integer companyId= userMapper.selectById(request.getHeader("token")).getCompanyId();
|
|
|
- TimeType timeType = timeTypeMapper.selectById(companyId);
|
|
|
+ User targetUser= userMapper.selectById(request.getHeader("token"));
|
|
|
+ TimeType timeType = timeTypeMapper.selectById(targetUser.getCompanyId());
|
|
|
Integer timeliness = timeType.getTimeliness();
|
|
|
- List<Map<String,Object>> reportList=reportMapper.getUserReportTimelinessRate(companyId,startDate,endDate);
|
|
|
- System.out.println(reportList);
|
|
|
+ List<SysRichFunction> functionAllList = sysFunctionMapper.getRoleFunctions(targetUser.getRoleId(), "全公司工时分配");
|
|
|
+ List<SysRichFunction> functionDeptList = sysFunctionMapper.getRoleFunctions(targetUser.getRoleId(), "负责部门工时分配");
|
|
|
+ List<Integer> deptIds=null;
|
|
|
+ List<Department> userDepartmentList = departmentMapper.selectList(new QueryWrapper<Department>().eq("manager_id", targetUser.getId()).eq("company_id",targetUser.getCompanyId()));
|
|
|
+ //判断查看权限
|
|
|
+ if(functionAllList.size()==0){
|
|
|
+ if(functionDeptList.size()>0){
|
|
|
+ deptIds = userDepartmentList.stream().map(dp -> dp.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
|
+ deptIds.add(targetUser.getDepartmentId());
|
|
|
+ }else {
|
|
|
+ deptIds=new ArrayList<>();
|
|
|
+ deptIds.add(-1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<Map<String,Object>> reportList=reportMapper.getUserReportTimelinessRate(targetUser.getCompanyId(),startDate,endDate);
|
|
|
QueryWrapper<User> queryWrapper=new QueryWrapper();
|
|
|
- queryWrapper.eq("company_id",companyId);
|
|
|
+ queryWrapper.eq("company_id",targetUser.getCompanyId());
|
|
|
if(departmentId!=null){
|
|
|
queryWrapper.eq("department_id",departmentId);
|
|
|
}
|
|
|
if(userId!=null){
|
|
|
queryWrapper.eq("id",userId);
|
|
|
}
|
|
|
+ if(deptIds!=null){
|
|
|
+ queryWrapper.in("department_id",deptIds);
|
|
|
+ }
|
|
|
queryWrapper.eq("is_active",1).orderByAsc("department_id");
|
|
|
- List<Department> departmentList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", companyId));
|
|
|
+ List<Department> departmentList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", targetUser.getCompanyId()));
|
|
|
List<User> userList;
|
|
|
long total=0;
|
|
|
if(pageIndex!=null&&pageSize!=null){
|
|
@@ -3391,7 +3480,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public HttpRespMsg getWaitingReviewList(HttpServletRequest request, Integer stateKey, String userId,Integer pageIndex,Integer pageSize,String startDate,String endDate) {
|
|
|
+ public HttpRespMsg getWaitingReviewList(HttpServletRequest request, Integer stateKey, String userId,Integer pageIndex,Integer pageSize,String startDate,String endDate,Integer departmentId) {
|
|
|
HttpRespMsg msg=new HttpRespMsg();
|
|
|
User user = userMapper.selectById(request.getHeader("token"));
|
|
|
Integer size;
|
|
@@ -3403,8 +3492,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
size=null;
|
|
|
start=null;
|
|
|
}
|
|
|
- List<Map<String,Object>> list=projectMapper.getWaitingReviewList(user.getCompanyId(),userId,start,size,startDate,endDate);
|
|
|
- long total=projectMapper.findCount(user.getCompanyId(),userId,null,null,startDate,endDate);
|
|
|
+ List<Map<String,Object>> list=projectMapper.getWaitingReviewList(user.getCompanyId(),userId,start,size,startDate,endDate,departmentId);
|
|
|
+ long total=projectMapper.findCount(user.getCompanyId(),userId,null,null,startDate,endDate,departmentId);
|
|
|
HashMap map=new HashMap();
|
|
|
map.put("total",total);
|
|
|
map.put("result",list);
|
|
@@ -3414,7 +3503,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
|
|
|
@Override
|
|
|
public HttpRespMsg exportWaitingReviewList(HttpServletRequest request, Integer stateKey, String userId,String startDate,String endDate) {
|
|
|
- HttpRespMsg msg = getWaitingReviewList(request, stateKey, userId, null, null,startDate,endDate);
|
|
|
+ HttpRespMsg msg = getWaitingReviewList(request, stateKey, userId, null, null,startDate,endDate,null);
|
|
|
HashMap resultmap= (HashMap) msg.data;
|
|
|
List<Map<String,Object>> list= (List<Map<String, Object>>) resultmap.get("result");
|
|
|
List<List<String>> dataList=new ArrayList<>();
|