|
@@ -3950,21 +3950,24 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
int rowNum = 1;
|
|
|
List<HashMap<String, Object>> allReportByDate = null;
|
|
|
List<SysRichFunction> functionList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "查看全公司工时");
|
|
|
+ //获取部门的所有子部门
|
|
|
+ List<Department> departments = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id",companyId));
|
|
|
+ List<Integer> branchDepartment = departmentService.getBranchDepartment(departmentId,departments);
|
|
|
if (functionList.size() == 0) {
|
|
|
//检查是否是部门负责人
|
|
|
List<Integer> allVisibleDeptIdList = getAllVisibleDeptIdList(user, null);
|
|
|
if (allVisibleDeptIdList.size() > 0) {
|
|
|
- allReportByDate = reportMapper.getDeptMembReportByDate(startDate, null, allVisibleDeptIdList, endDate, projectId,stateKey,departmentId);
|
|
|
+ allReportByDate = reportMapper.getDeptMembReportByDate(startDate, null, allVisibleDeptIdList, endDate, projectId,stateKey,branchDepartment);
|
|
|
}
|
|
|
|
|
|
List<HashMap<String, Object>> reportsFromProjects = null;
|
|
|
//检查是否是项目负责人
|
|
|
int cnt = projectMapper.selectCount(new QueryWrapper<Project>().eq("incharger_id", user.getId()));
|
|
|
if (cnt > 0) {
|
|
|
- reportsFromProjects = reportMapper.getProjectMembReportByDate(startDate, null, user.getId(), endDate, projectId,stateKey,departmentId);
|
|
|
+ reportsFromProjects = reportMapper.getProjectMembReportByDate(startDate, null, user.getId(), endDate, projectId,stateKey,branchDepartment);
|
|
|
} else {
|
|
|
//普通员工只能看自己的
|
|
|
- reportsFromProjects = reportMapper.getAllReportByDate(startDate, null, user.getId(), endDate, projectId,stateKey,departmentId);
|
|
|
+ reportsFromProjects = reportMapper.getAllReportByDate(startDate, null, user.getId(), endDate, projectId,stateKey,branchDepartment);
|
|
|
}
|
|
|
if (allReportByDate == null) {
|
|
|
allReportByDate = reportsFromProjects;
|
|
@@ -3984,7 +3987,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
// }
|
|
|
else {
|
|
|
//看公司所有人的
|
|
|
- allReportByDate = reportMapper.getAllReportByDate(startDate, user.getCompanyId(), null, endDate, projectId,stateKey,departmentId);
|
|
|
+ allReportByDate = reportMapper.getAllReportByDate(startDate, user.getCompanyId(), null, endDate, projectId,stateKey,branchDepartment);
|
|
|
}
|
|
|
//获取企业微信考勤数据
|
|
|
List<UserCorpwxTime> userCorpwxTimeList = userCorpwxTimeMapper.selectList(new QueryWrapper<UserCorpwxTime>().eq("company_id", user.getCompanyId()).between("create_date", startDate, endDate));
|
|
@@ -4082,12 +4085,19 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
}
|
|
|
row.createCell(3+i).setCellValue(value);
|
|
|
}
|
|
|
+ Department dept = null;
|
|
|
+ for (Department department : departments) {
|
|
|
+ if (department.getDepartmentId().toString().equals(map.get("departmentId").toString())){
|
|
|
+ dept = department;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
row.createCell(2).setCellValue("$userName="+(map.get("corpwxUserId")==null?"":map.get("corpwxUserId"))+"$");
|
|
|
- row.createCell(3+userCustomList.size()).setCellValue("$departmentName="+(map.get("corpwxDeptId")==null?"":map.get("corpwxDeptId"))+"$");
|
|
|
+ row.createCell(3+userCustomList.size()).setCellValue(departmentService.exportWxDepartment(dept,departments));
|
|
|
}else {
|
|
|
row.createCell(2).setCellValue((String) map.get("name"));
|
|
|
- row.createCell(3+userCustomList.size()).setCellValue((String) map.get("departmentName"));
|
|
|
+ row.createCell(3+userCustomList.size()).setCellValue(departmentService.getSupDepartment(dept,departments));
|
|
|
}
|
|
|
row.createCell(4+userCustomList.size()).setCellValue((String) map.get("projectCode"));
|
|
|
row.createCell(5+userCustomList.size()).setCellValue((String) map.get("project"));
|