|
@@ -14322,21 +14322,11 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public HttpRespMsg getReportListForExport(String startDate, String endDate, Integer exportType, Integer projectId, Integer stateKey, Integer departmentId,
|
|
|
|
|
- String plate, Integer pageIndex, Integer pageSize, String targetUserId, HttpServletRequest request) {
|
|
|
|
|
|
|
+ public HttpRespMsg getReportListForExport(String startDate, String endDate, Integer projectId, Integer state, Integer departmentId, Integer pageIndex, Integer pageSize, String targetUserId, HttpServletRequest request) {
|
|
|
HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
|
try {
|
|
try {
|
|
|
- String field = "";
|
|
|
|
|
- String fieldValue = "";
|
|
|
|
|
- if (!StringUtils.isEmpty(plate)) {
|
|
|
|
|
- String[] strings = plate.split("-");
|
|
|
|
|
- field = strings[0];
|
|
|
|
|
- fieldValue = strings[1];
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
String userId = request.getHeader("Token");
|
|
String userId = request.getHeader("Token");
|
|
|
User user = userMapper.selectById(userId);
|
|
User user = userMapper.selectById(userId);
|
|
|
- TimeType timeType = timeTypeMapper.selectOne(new QueryWrapper<TimeType>().eq("company_id", user.getCompanyId()));
|
|
|
|
|
Company company = companyMapper.selectById(user.getCompanyId());
|
|
Company company = companyMapper.selectById(user.getCompanyId());
|
|
|
Integer companyId = company.getId();
|
|
Integer companyId = company.getId();
|
|
|
List<User> allUserList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId));
|
|
List<User> allUserList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId));
|
|
@@ -14348,44 +14338,24 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
branchDepartment = departmentService.getDeptIncludeSubDeptIds(departmentId, departments);
|
|
branchDepartment = departmentService.getDeptIncludeSubDeptIds(departmentId, departments);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- List<HashMap<String, Object>> allReportByDate = null;
|
|
|
|
|
- List<SysRichFunction> functionList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "查看全公司工时");
|
|
|
|
|
-
|
|
|
|
|
- if (functionList.size() == 0) {
|
|
|
|
|
- // 检查是否是部门负责人
|
|
|
|
|
- List<Integer> allVisibleDeptIdList = getAllVisibleDeptIdList(user, null);
|
|
|
|
|
- if (allVisibleDeptIdList.size() > 0) {
|
|
|
|
|
- allReportByDate = reportMapper.getDeptMembReportByDate(startDate, null, allVisibleDeptIdList, endDate, projectId, stateKey, branchDepartment, user.getId(), field, fieldValue);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 检查是否是项目负责人
|
|
|
|
|
- int cnt = projectMapper.selectCount(new QueryWrapper<Project>().eq("incharger_id", user.getId()));
|
|
|
|
|
- List<Integer> auditorPids = null;
|
|
|
|
|
- if (timeType.getReportAuditType() == 5 && timeType.getReportCc() == 1) {
|
|
|
|
|
- // 启用了抄送人
|
|
|
|
|
- List<ProjectAuditor> projectAuditors = projectAuditorMapper.selectList(new QueryWrapper<ProjectAuditor>().eq("auditor_id", user.getId()));
|
|
|
|
|
- if (projectAuditors.size() > 0) {
|
|
|
|
|
- auditorPids = projectAuditors.stream().map(ProjectAuditor::getProjectId).collect(Collectors.toList());
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (cnt > 0 || auditorPids != null) {
|
|
|
|
|
- List<HashMap<String, Object>> reportsFromProjects = reportMapper.getProjectMembReportByDate(startDate, null, user.getId(), endDate, projectId, stateKey, branchDepartment, auditorPids, field, fieldValue);
|
|
|
|
|
- if (allReportByDate == null) {
|
|
|
|
|
- allReportByDate = reportsFromProjects;
|
|
|
|
|
- } else {
|
|
|
|
|
- allReportByDate.addAll(reportsFromProjects);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (allReportByDate == null) {
|
|
|
|
|
- allReportByDate = new ArrayList<>();
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- // 有查看全公司工时权限
|
|
|
|
|
- allReportByDate = reportMapper.getAllReportByDate(startDate, companyId, targetUserId, endDate, projectId, stateKey, branchDepartment, field, fieldValue);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+// List<SysRichFunction> functionList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "查看全公司工时");
|
|
|
|
|
+
|
|
|
|
|
+// if (functionList.size() == 0) {
|
|
|
|
|
+// // 检查是否是部门负责人
|
|
|
|
|
+// List<Integer> allVisibleDeptIdList = getAllVisibleDeptIdList(user, null);
|
|
|
|
|
+// if (allVisibleDeptIdList.size() > 0) {
|
|
|
|
|
+// allReportByDate = reportMapper.getDeptMembReportByDate(startDate, null, allVisibleDeptIdList, endDate, projectId, stateKey, branchDepartment, user.getId(), field, fieldValue);
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+// if (allReportByDate == null) {
|
|
|
|
|
+// allReportByDate = new ArrayList<>();
|
|
|
|
|
+// }
|
|
|
|
|
+// } else {
|
|
|
|
|
+// }
|
|
|
|
|
+ // 有查看全公司工时权限
|
|
|
|
|
+ List<HashMap<String, Object>> allReportByDate = reportMapper.getAllReportByDateForExport(startDate, companyId, targetUserId, endDate, projectId, state, branchDepartment);
|
|
|
|
|
+
|
|
|
// 分页处理
|
|
// 分页处理
|
|
|
int total = allReportByDate.size();
|
|
int total = allReportByDate.size();
|
|
|
int startIndex = (pageIndex - 1) * pageSize;
|
|
int startIndex = (pageIndex - 1) * pageSize;
|
|
@@ -14432,11 +14402,11 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public HttpRespMsg exportReportListForExport(String startDate, String endDate, Integer exportType, Integer projectId, Integer stateKey, Integer departmentId, String plate, String targetUserId, HttpServletRequest request) {
|
|
|
|
|
|
|
+ public HttpRespMsg exportReportListForExport(String startDate, String endDate, Integer projectId, Integer state, Integer departmentId, String targetUserId, HttpServletRequest request) {
|
|
|
HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
|
try {
|
|
try {
|
|
|
// 调用getReportListForExport获取全部数据(不分页)
|
|
// 调用getReportListForExport获取全部数据(不分页)
|
|
|
- HttpRespMsg queryResult = getReportListForExport(startDate, endDate, exportType, projectId, stateKey, departmentId, plate, 1, Integer.MAX_VALUE, targetUserId, request);
|
|
|
|
|
|
|
+ HttpRespMsg queryResult = getReportListForExport(startDate, endDate, projectId, state, departmentId, 1, Integer.MAX_VALUE, targetUserId, request);
|
|
|
|
|
|
|
|
if (queryResult.code != null && !queryResult.code.equals("ok")) {
|
|
if (queryResult.code != null && !queryResult.code.equals("ok")) {
|
|
|
return queryResult; // 返回错误信息
|
|
return queryResult; // 返回错误信息
|
|
@@ -14460,6 +14430,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
titles.add("工号");
|
|
titles.add("工号");
|
|
|
titles.add("所属部门");
|
|
titles.add("所属部门");
|
|
|
titles.add("工作日期");
|
|
titles.add("工作日期");
|
|
|
|
|
+ titles.add("填报时间");
|
|
|
titles.add("项目编号");
|
|
titles.add("项目编号");
|
|
|
titles.add("项目名称");
|
|
titles.add("项目名称");
|
|
|
titles.add("项目分类");
|
|
titles.add("项目分类");
|
|
@@ -14509,7 +14480,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
createDate = (String) map.get("createDate");
|
|
createDate = (String) map.get("createDate");
|
|
|
}
|
|
}
|
|
|
item.add(createDate);
|
|
item.add(createDate);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ item.add((String)map.get("createTime"));
|
|
|
// 项目编号
|
|
// 项目编号
|
|
|
item.add(map.get("projectCode") != null ? (String) map.get("projectCode") : "");
|
|
item.add(map.get("projectCode") != null ? (String) map.get("projectCode") : "");
|
|
|
|
|
|
|
@@ -14546,10 +14518,10 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
item.add(map.get("content") != null ? (String) map.get("content") : "");
|
|
item.add(map.get("content") != null ? (String) map.get("content") : "");
|
|
|
|
|
|
|
|
// 审核状态
|
|
// 审核状态
|
|
|
- Integer state = (Integer) map.get("state");
|
|
|
|
|
|
|
+ Integer stateValue = (Integer) map.get("state");
|
|
|
String auditStatus = "";
|
|
String auditStatus = "";
|
|
|
- if (state != null) {
|
|
|
|
|
- switch (state) {
|
|
|
|
|
|
|
+ if (stateValue != null) {
|
|
|
|
|
+ switch (stateValue) {
|
|
|
case 0:
|
|
case 0:
|
|
|
auditStatus = "待审核";
|
|
auditStatus = "待审核";
|
|
|
break;
|
|
break;
|
|
@@ -14559,9 +14531,6 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
case 2:
|
|
case 2:
|
|
|
auditStatus = "已驳回";
|
|
auditStatus = "已驳回";
|
|
|
break;
|
|
break;
|
|
|
- case 3:
|
|
|
|
|
- auditStatus = "待提交";
|
|
|
|
|
- break;
|
|
|
|
|
default:
|
|
default:
|
|
|
auditStatus = "-";
|
|
auditStatus = "-";
|
|
|
}
|
|
}
|
|
@@ -14593,7 +14562,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public HttpRespMsg getReportGroupByDay(String startDate, String endDate, String userId, Integer departmentId, Integer projectId, HttpServletRequest request) {
|
|
|
|
|
|
|
+ public HttpRespMsg getReportGroupByDay(String startDate, String endDate, String userId, Integer departmentId, Integer projectId, Integer state, HttpServletRequest request) {
|
|
|
HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
|
try {
|
|
try {
|
|
|
String token = request.getHeader("Token");
|
|
String token = request.getHeader("Token");
|
|
@@ -14601,7 +14570,6 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
Integer companyId = user.getCompanyId();
|
|
Integer companyId = user.getCompanyId();
|
|
|
TimeType timeType = timeTypeMapper.selectById(companyId);
|
|
TimeType timeType = timeTypeMapper.selectById(companyId);
|
|
|
WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
|
|
WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
|
|
|
- boolean needCorpWxTranslate = (wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1);
|
|
|
|
|
// 权限检查:获取可见部门列表
|
|
// 权限检查:获取可见部门列表
|
|
|
List<Integer> visibleDeptIds = null;
|
|
List<Integer> visibleDeptIds = null;
|
|
|
List<SysRichFunction> functionList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "查看全公司工时");
|
|
List<SysRichFunction> functionList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "查看全公司工时");
|
|
@@ -14652,11 +14620,11 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
|
|
|
|
|
// 查询按人按天汇总的数据
|
|
// 查询按人按天汇总的数据
|
|
|
List<Map<String, Object>> groupedReportList = reportMapper.getReportGroupByDay(
|
|
List<Map<String, Object>> groupedReportList = reportMapper.getReportGroupByDay(
|
|
|
- companyId, startDate, endDate, userId, departmentId, projectId, visibleDeptIds, pageStart, pageSize);
|
|
|
|
|
|
|
+ companyId, startDate, endDate, userId, departmentId, projectId, state, visibleDeptIds, pageStart, pageSize);
|
|
|
|
|
|
|
|
// 获取总数
|
|
// 获取总数
|
|
|
Integer totalCount = reportMapper.getReportGroupByDayCount(
|
|
Integer totalCount = reportMapper.getReportGroupByDayCount(
|
|
|
- companyId, startDate, endDate, userId, departmentId, projectId, visibleDeptIds);
|
|
|
|
|
|
|
+ companyId, startDate, endDate, userId, departmentId, projectId, state, visibleDeptIds);
|
|
|
|
|
|
|
|
// 获取考勤数据
|
|
// 获取考勤数据
|
|
|
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
@@ -14821,7 +14789,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public HttpRespMsg exportReportGroupByDay(String startDate, String endDate, String userId, Integer departmentId, Integer projectId, HttpServletRequest request) {
|
|
|
|
|
|
|
+ public HttpRespMsg exportReportGroupByDay(String startDate, String endDate, String userId, Integer departmentId, Integer projectId, Integer state, HttpServletRequest request) {
|
|
|
HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
|
try {
|
|
try {
|
|
|
String token = request.getHeader("Token");
|
|
String token = request.getHeader("Token");
|
|
@@ -14875,7 +14843,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
}
|
|
}
|
|
|
// 查询按人按天汇总的数据
|
|
// 查询按人按天汇总的数据
|
|
|
List<Map<String, Object>> groupedReportList = reportMapper.getReportGroupByDay(
|
|
List<Map<String, Object>> groupedReportList = reportMapper.getReportGroupByDay(
|
|
|
- companyId, startDate, endDate, userId, departmentId, projectId, visibleDeptIds, null, null);
|
|
|
|
|
|
|
+ companyId, startDate, endDate, userId, departmentId, projectId, state, visibleDeptIds, null, null);
|
|
|
|
|
|
|
|
// 获取考勤数据
|
|
// 获取考勤数据
|
|
|
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|