|
@@ -6990,4 +6990,61 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+ //分页查询员工月度工时表
|
|
|
+ @Override
|
|
|
+ public HttpRespMsg getEmpMonthHours(Integer pageIndex, Integer pageSize, LocalDate Month,Integer department,String userId, HttpServletRequest request) {
|
|
|
+ HttpRespMsg httpRespMsg =new HttpRespMsg();
|
|
|
+// User targetUser = userMapper.selectById(request.getHeader("token"));
|
|
|
+// List<SysRichFunction> functionAllList = sysFunctionMapper.getRoleFunctions(targetUser.getRoleId(), "全部人员月度工时表");
|
|
|
+// List<SysRichFunction> functionDeptList = sysFunctionMapper.getRoleFunctions(targetUser.getRoleId(), "负责部门月度工时表");
|
|
|
+// List<Integer> deptIds=null;
|
|
|
+// List<Department> allDepartmentList=departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id",targetUser.getCompanyId()));
|
|
|
+// List<Department> userDepartmentList = departmentMapper.selectList(new QueryWrapper<Department>().eq("manager_id", targetUser.getId()).eq("company_id",targetUser.getCompanyId()));
|
|
|
+// 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){
|
|
|
+// 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);
|
|
|
+// for (Integer integer : collect) {
|
|
|
+// List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
|
|
|
+// deptIds.addAll(branchDepartment);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// long total;
|
|
|
+// List<Map<String,Object>> resultList;
|
|
|
+// List<Integer> branchDepartment =null;
|
|
|
+// if(departmentId!=null){
|
|
|
+// branchDepartment = getBranchDepartment(departmentId, allDepartmentList);
|
|
|
+// }
|
|
|
+// if(pageIndex!=null&&pageSize!=null){
|
|
|
+// Integer size=pageSize;
|
|
|
+// Integer start=(pageIndex-1)*size;
|
|
|
+// resultList=projectMapper.getUserWorkingTimeStatic(targetUser.getCompanyId(),startDate,endDate,start,size,userId,branchDepartment,deptIds);
|
|
|
+// total=projectMapper.findCountWithUserWorkingTime(targetUser.getCompanyId(),startDate,endDate,start,size,userId,branchDepartment,deptIds);
|
|
|
+// }else{
|
|
|
+// resultList=projectMapper.getUserWorkingTimeStatic(targetUser.getCompanyId(),startDate,endDate,null,null,userId,branchDepartment,deptIds);
|
|
|
+// total=projectMapper.findCountWithUserWorkingTime(targetUser.getCompanyId(),startDate,endDate,null,null,userId,branchDepartment,deptIds);
|
|
|
+// }
|
|
|
+// for (Map<String, Object> map : resultList) {
|
|
|
+// BigDecimal phBigDecimal =new BigDecimal(String.valueOf(map.get("planHours")==null?0:map.get("planHours")));
|
|
|
+// BigDecimal wtBigDecimal =new BigDecimal(String.valueOf(map.get("workingTime")==null?0:map.get("workingTime")));
|
|
|
+// if(phBigDecimal.compareTo(BigDecimal.ZERO)==0||wtBigDecimal.compareTo(BigDecimal.ZERO)==0){
|
|
|
+// map.put("proportion",dft.format(0));
|
|
|
+// }else{
|
|
|
+// BigDecimal divide = wtBigDecimal.divide(phBigDecimal, 2, BigDecimal.ROUND_HALF_UP);
|
|
|
+// map.put("proportion",dft.format(divide));
|
|
|
+// }
|
|
|
+// }
|
|
|
+// Map<String,Object> map=new HashMap<>();
|
|
|
+// map.put("result",resultList);
|
|
|
+// map.put("total",total);
|
|
|
+// httpRespMsg.data=map;
|
|
|
+ return httpRespMsg;
|
|
|
+ }
|
|
|
+
|
|
|
}
|