|
@@ -6402,10 +6402,18 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
|
|
|
//导出报告
|
|
|
@Override
|
|
|
- public HttpRespMsg exportReport(@RequestParam String startDate, @RequestParam String endDate,Integer exportType, Integer projectId,Integer stateKey,String departmentIds, HttpServletRequest request) {
|
|
|
+ public HttpRespMsg exportReport(@RequestParam String startDate, @RequestParam String endDate,Integer exportType, Integer projectId,Integer stateKey,String departmentIds,String plate, HttpServletRequest request) {
|
|
|
HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
|
DateFormat timeDf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
try {
|
|
|
+ String field="";
|
|
|
+ String fieldValue="";
|
|
|
+ if (!StringUtils.isEmpty(plate)){
|
|
|
+ String[] strings = plate.split("-");
|
|
|
+ field=strings[0];
|
|
|
+ fieldValue=strings[1];
|
|
|
+
|
|
|
+ }
|
|
|
String userId = request.getHeader("Token");
|
|
|
User user = userMapper.selectById(userId);
|
|
|
Integer hideTimeCount= sysRoleFunctionService.selectHideTimeCount(user.getRoleId());
|
|
@@ -6570,7 +6578,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
//检查是否是部门负责人
|
|
|
List<Integer> allVisibleDeptIdList = getAllVisibleDeptIdList(user, null);
|
|
|
if (allVisibleDeptIdList.size() > 0) {
|
|
|
- allReportByDate = reportMapper.getDeptMembReportByDate(startDate, null, allVisibleDeptIdList, endDate, projectId,stateKey,branchDepartment, user.getId());
|
|
|
+ allReportByDate = reportMapper.getDeptMembReportByDate(startDate, null, allVisibleDeptIdList, endDate, projectId,stateKey,branchDepartment, user.getId(),field,fieldValue);
|
|
|
}
|
|
|
|
|
|
List<HashMap<String, Object>> reportsFromProjects = null;
|
|
@@ -6586,16 +6594,16 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
}
|
|
|
if (cnt > 0 || auditorPids != null) {
|
|
|
if (exportType == 0 && timeType.getShowFillauditTime() == 1) {
|
|
|
- reportsFromProjects = reportMapper.getProjectMembReportByDateWithReportLog(startDate, null, user.getId(), endDate, projectId,stateKey,branchDepartment, auditorPids);
|
|
|
+ reportsFromProjects = reportMapper.getProjectMembReportByDateWithReportLog(startDate, null, user.getId(), endDate, projectId,stateKey,branchDepartment, auditorPids,field,fieldValue);
|
|
|
} else{
|
|
|
- reportsFromProjects = reportMapper.getProjectMembReportByDate(startDate, null, user.getId(), endDate, projectId,stateKey,branchDepartment, auditorPids);
|
|
|
+ reportsFromProjects = reportMapper.getProjectMembReportByDate(startDate, null, user.getId(), endDate, projectId,stateKey,branchDepartment, auditorPids,field,fieldValue);
|
|
|
}
|
|
|
} else {
|
|
|
//普通员工只能看自己的
|
|
|
if (exportType == 0 && timeType.getShowFillauditTime() == 1) {
|
|
|
- reportsFromProjects = reportMapper.getAllReportByDateWithReportLog(startDate, null, user.getId(), endDate, projectId,stateKey,branchDepartment);
|
|
|
+ reportsFromProjects = reportMapper.getAllReportByDateWithReportLog(startDate, null, user.getId(), endDate, projectId,stateKey,branchDepartment,field,fieldValue);
|
|
|
} else {
|
|
|
- reportsFromProjects = reportMapper.getAllReportByDate(startDate, null, user.getId(), endDate, projectId,stateKey,branchDepartment);
|
|
|
+ reportsFromProjects = reportMapper.getAllReportByDate(startDate, null, user.getId(), endDate, projectId,stateKey,branchDepartment,field,fieldValue);
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -6615,9 +6623,9 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
else {
|
|
|
//看公司所有人的
|
|
|
if (exportType == 0 && timeType.getShowFillauditTime() == 1) {
|
|
|
- allReportByDate = reportMapper.getAllReportByDateWithReportLog(startDate, user.getCompanyId(), null, endDate, projectId,stateKey,branchDepartment);
|
|
|
+ allReportByDate = reportMapper.getAllReportByDateWithReportLog(startDate, user.getCompanyId(), null, endDate, projectId,stateKey,branchDepartment,field,fieldValue);
|
|
|
} else {
|
|
|
- allReportByDate = reportMapper.getAllReportByDate(startDate, user.getCompanyId(), null, endDate, projectId,stateKey,branchDepartment);
|
|
|
+ allReportByDate = reportMapper.getAllReportByDate(startDate, user.getCompanyId(), null, endDate, projectId,stateKey,branchDepartment,field,fieldValue);
|
|
|
}
|
|
|
}
|
|
|
//获取企业微信考勤数据
|
|
@@ -7818,7 +7826,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
return msg;
|
|
|
}
|
|
|
if(token.equals(thirdPartyInterface.getToken())){
|
|
|
- List<HashMap<String, Object>> allReportByDate = reportMapper.getAllReportByDate(startDate,thirdPartyInterface.getCompanyId(), null, endDate, null, 1, null);
|
|
|
+ List<HashMap<String, Object>> allReportByDate = reportMapper.getAllReportByDate(startDate,thirdPartyInterface.getCompanyId(), null, endDate, null, 1, null,null,null);
|
|
|
final CountDownLatch latch=new CountDownLatch(allReportByDate.size());
|
|
|
for (HashMap<String, Object> map : allReportByDate) {
|
|
|
java.sql.Date sqlCreateDate= (java.sql.Date) map.get("createDate");
|
|
@@ -8950,6 +8958,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
userId = targetUserId;
|
|
|
}
|
|
|
User user = userMapper.selectById(userId);
|
|
|
+ Integer hideTimeCount= sysRoleFunctionService.selectHideTimeCount(user.getRoleId());
|
|
|
Company company = companyMapper.selectById(user.getCompanyId());
|
|
|
//根据targetDate获取本周的日期
|
|
|
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
@@ -9106,9 +9115,21 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
|
|
|
//放入当天对应的日报
|
|
|
List<Report> dateReportList = reportList.stream().filter(r -> r.getCreateDate().isEqual(itemDate)).collect(Collectors.toList());
|
|
|
- item.put("reportList", dateReportList);
|
|
|
- double sum = dateReportList.stream().mapToDouble(Report::getWorkingTime).sum();
|
|
|
- item.put("filledTime", sum);
|
|
|
+ if(hideTimeCount>0){
|
|
|
+ for (Report report : dateReportList) {
|
|
|
+ if (report.getWorkingTime()!=null){
|
|
|
+ report.setWorkingTime(null);
|
|
|
+ report.setEndTime("");
|
|
|
+ report.setStartTime("");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ item.put("reportList", dateReportList);
|
|
|
+ item.put("filledTime", "*");
|
|
|
+ }else {
|
|
|
+ item.put("reportList", dateReportList);
|
|
|
+ double sum = dateReportList.stream().mapToDouble(Report::getWorkingTime).sum();
|
|
|
+ item.put("filledTime", sum);
|
|
|
+ }
|
|
|
dateList.add(item);
|
|
|
}
|
|
|
reportMap.put("dateList", dateList);
|