|
@@ -4226,7 +4226,6 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
int rowNum = 1;
|
|
|
List<HashMap<String, Object>> allReportByDate = null;
|
|
|
|
|
|
- System.out.println("开始查询"+LocalDateTime.now().toString());
|
|
|
List<SysRichFunction> functionList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "查看全公司工时");
|
|
|
//获取部门的所有子部门
|
|
|
List<Department> departments = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id",companyId));
|
|
@@ -4285,13 +4284,11 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
allReportByDate = reportMapper.getAllReportByDate(startDate, user.getCompanyId(), null, endDate, projectId,stateKey,branchDepartment);
|
|
|
}
|
|
|
}
|
|
|
- System.out.println("进度1"+LocalDateTime.now().toString());
|
|
|
//获取企业微信考勤数据
|
|
|
List<UserCorpwxTime> userCorpwxTimeList = new ArrayList<>();
|
|
|
if(timeType.getSyncCorpwxTime()==1) {
|
|
|
userCorpwxTimeList = userCorpwxTimeMapper.selectList(new QueryWrapper<UserCorpwxTime>().eq("company_id", user.getCompanyId()).between("create_date", startDate, endDate));
|
|
|
}
|
|
|
- System.out.println("进度2"+LocalDateTime.now().toString());
|
|
|
if (timeType.getMultiWorktime() == 1) {
|
|
|
java.text.DecimalFormat df = new java.text.DecimalFormat("#0.00");
|
|
|
//重新处理一下数据,把工作时间和工作事项移出来
|
|
@@ -4367,7 +4364,6 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
}
|
|
|
}
|
|
|
List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId));
|
|
|
- System.out.println("进度3"+LocalDateTime.now().toString());
|
|
|
long t1 = System.currentTimeMillis();
|
|
|
DateTimeFormatter dft = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
for (Map<String, Object> map : allReportByDate) {
|
|
@@ -4511,89 +4507,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
sb.append(msg);
|
|
|
}
|
|
|
}
|
|
|
- //审核流程显示;//stream性能较差,换成for循环
|
|
|
-// for (int m=0; m <logDetails.size(); m++) {
|
|
|
-// ReportLogDetail audit = logDetails.get(m);
|
|
|
-// //仅处理当前日报的审核流程
|
|
|
-// if (audit.getReportId().intValue() == ((Integer)map.get("id")).intValue()) {
|
|
|
-// LocalDateTime operateDate = audit.getOperateDate();
|
|
|
-// if (company.getIsInternational() == 1) {
|
|
|
-// operateDate = operateDate.plusSeconds(offsetSeconds);
|
|
|
-// }
|
|
|
-// String time = dtf.format(operateDate);
|
|
|
-// String msg= "";
|
|
|
-// if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
-// Optional<User> first = userList.stream().filter(ul -> ul.getId().equals(audit.getOperatorId())).findFirst();
|
|
|
-// if(first.isPresent()){
|
|
|
-// if(audit.getMsg().contains("提交了")){
|
|
|
-// int i = audit.getMsg().indexOf("提");
|
|
|
-// String substring = audit.getMsg().substring(0, i);
|
|
|
-// msg = time+" " + audit.getMsg().replaceAll(substring,"\\$userName="+first.get().getCorpwxUserid()+"\\$");
|
|
|
-// }else if(audit.getMsg().contains("审核通过了")){
|
|
|
-// int i = audit.getMsg().indexOf("审");
|
|
|
-// String substring = audit.getMsg().substring(0, i);
|
|
|
-// msg = time+" " + audit.getMsg().replaceAll(substring,"\\$userName="+first.get().getCorpwxUserid()+"\\$");
|
|
|
-// }else if(audit.getMsg().contains("驳回了")) {
|
|
|
-// int i = audit.getMsg().indexOf("驳");
|
|
|
-// String substring = audit.getMsg().substring(0, i);
|
|
|
-// msg = time+" " + audit.getMsg().replaceAll(substring,"\\$userName="+first.get().getCorpwxUserid()+"\\$");
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }else {
|
|
|
-// msg = time+" " + audit.getMsg();
|
|
|
-// }
|
|
|
-// if (!isFirst) {
|
|
|
-// sb.append("->");
|
|
|
-// } else {
|
|
|
-// isFirst = false;
|
|
|
-// }
|
|
|
-// sb.append(msg);
|
|
|
-// //去掉这条记录,减少下次循环的次数
|
|
|
-// logDetails.remove(m);
|
|
|
-// m--;//因为删除了一条记录,所以要减少一次循环
|
|
|
-// }
|
|
|
-// }
|
|
|
item.add(sb.toString());
|
|
|
-// List<ReportLogDetail> detailList = logDetails.parallelStream().filter(log -> log.getReportId().equals((Integer) map.get("id"))).collect(Collectors.toList());
|
|
|
-// if (detailList.size() > 0) {
|
|
|
-// for (ReportLogDetail audit:detailList) {
|
|
|
-// LocalDateTime operateDate = audit.getOperateDate();
|
|
|
-// if (company.getIsInternational() == 1) {
|
|
|
-// operateDate = operateDate.plusSeconds(offsetSeconds);
|
|
|
-// }
|
|
|
-// String time = dtf.format(operateDate);
|
|
|
-// String msg= "";
|
|
|
-// if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
-// Optional<User> first = userList.stream().filter(ul -> ul.getId().equals(audit.getOperatorId())).findFirst();
|
|
|
-// if(first.isPresent()){
|
|
|
-// if(audit.getMsg().contains("提交了")){
|
|
|
-// int i = audit.getMsg().indexOf("提");
|
|
|
-// String substring = audit.getMsg().substring(0, i);
|
|
|
-// msg = time+" " + audit.getMsg().replaceAll(substring,"\\$userName="+first.get().getCorpwxUserid()+"\\$");
|
|
|
-// }else if(audit.getMsg().contains("审核通过了")){
|
|
|
-// int i = audit.getMsg().indexOf("审");
|
|
|
-// String substring = audit.getMsg().substring(0, i);
|
|
|
-// msg = time+" " + audit.getMsg().replaceAll(substring,"\\$userName="+first.get().getCorpwxUserid()+"\\$");
|
|
|
-// }else if(audit.getMsg().contains("驳回了")) {
|
|
|
-// int i = audit.getMsg().indexOf("驳");
|
|
|
-// String substring = audit.getMsg().substring(0, i);
|
|
|
-// msg = time+" " + audit.getMsg().replaceAll(substring,"\\$userName="+first.get().getCorpwxUserid()+"\\$");
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }else {
|
|
|
-// msg = time+" " + audit.getMsg();
|
|
|
-// }
|
|
|
-// if (!isFirst) {
|
|
|
-// sb.append("->");
|
|
|
-// } else {
|
|
|
-// isFirst = false;
|
|
|
-// }
|
|
|
-// sb.append(msg);
|
|
|
-// }
|
|
|
-// item.add(sb.toString());
|
|
|
-// } else {
|
|
|
-// item.add("");
|
|
|
-// }
|
|
|
}
|
|
|
item.add((String) map.get("content"));
|
|
|
if(stateKey==1){
|
|
@@ -4682,14 +4596,9 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
dataList.add(item);
|
|
|
rowNum++;
|
|
|
}
|
|
|
- System.out.println("进度4"+LocalDateTime.now().toString());
|
|
|
- long t2 = System.currentTimeMillis();
|
|
|
- System.out.println("计算耗时:"+(t2-t1)+", 共"+rowNum+"条数据");
|
|
|
//生成Excel文件
|
|
|
- //String fileUrlSuffix = (startDate==null?"":(startDate+"至"+endDate))+"工作日报" + System.currentTimeMillis() + ".xls";
|
|
|
String fileUrlSuffix = (startDate==null?"":(startDate+MessageUtils.message("leave.to")+endDate))+MessageUtils.message("excel.workReport") + System.currentTimeMillis();
|
|
|
httpRespMsg = excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileUrlSuffix,dataList,path);
|
|
|
- System.out.println("进度5, 导出结束"+LocalDateTime.now().toString());
|
|
|
} catch (NullPointerException e) {
|
|
|
//httpRespMsg.setError("验证失败或缺少数据");
|
|
|
httpRespMsg.setError(MessageUtils.message("access.verErrorOrDataLack"));
|
|
@@ -4725,34 +4634,6 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
userIds.add(userId);
|
|
|
}
|
|
|
List<User> userList = userMapper.selectList(new QueryWrapper<User>().in("id", userIds));
|
|
|
-
|
|
|
-// for (User subsUser : userList) {
|
|
|
-// BigDecimal tempCost = new BigDecimal(0);
|
|
|
-// if (subsUser.getCostApplyDate() != null) {
|
|
|
-// //检查有效期
|
|
|
-// if (subsUser.getCostApplyDate().compareTo(dtf.format(now)) > 0) {
|
|
|
-// //取上一个历史成本
|
|
|
-// List<UserSalary> list = userSalaryService.list(new QueryWrapper<UserSalary>().eq("user_id", subsUser.getId()).orderByDesc("indate").last("limit 2"));
|
|
|
-// if (list.size() > 1) {
|
|
|
-// tempCost = list.get(1).getCost();
|
|
|
-// } else {
|
|
|
-// //没有记录,又没有达到预设的起效时间,则默认为0
|
|
|
-// tempCost = new BigDecimal(0);
|
|
|
-// }
|
|
|
-// } else {
|
|
|
-// tempCost = subsUser.getCost();
|
|
|
-// }
|
|
|
-// } else {
|
|
|
-// tempCost = subsUser.getCost();
|
|
|
-// }
|
|
|
-//
|
|
|
-// if (tempCost == null) {
|
|
|
-// tempCost = new BigDecimal(0);
|
|
|
-// }
|
|
|
-// //设置好时薪
|
|
|
-// subsUser.setCost(tempCost);
|
|
|
-// }
|
|
|
-
|
|
|
for (Report report : reportList) {
|
|
|
//获取一下信息
|
|
|
if (report.getWorkingTime() <= 0.0) {
|