|
@@ -1,6 +1,7 @@
|
|
|
package cn.com.ctop.oa.modules.controller;
|
|
|
|
|
|
import cn.com.ctop.common.module.annotation.AutoLog;
|
|
|
+import cn.com.ctop.common.module.utils.Check;
|
|
|
import cn.com.ctop.common.module.utils.ExportExcelUtils;
|
|
|
import cn.com.ctop.common.module.utils.HttpUtils;
|
|
|
import cn.com.ctop.oa.modules.entity.WechatAttendance;
|
|
@@ -270,11 +271,14 @@ public class WechatNoListController {
|
|
|
public void getExcelReport(HttpServletResponse response) {
|
|
|
Map<String, Object> paramsMap = new HashMap<>();
|
|
|
List<WechatAttendance> excelData = wechatNoListService.queryAttendanceData(paramsMap);
|
|
|
- if (excelData.isEmpty()) {
|
|
|
+ List<WechatAttendance> overtimeData = wechatNoListService.queryOverTimeData(paramsMap);
|
|
|
+ if (excelData.isEmpty()||overtimeData.isEmpty()) {
|
|
|
return;
|
|
|
}
|
|
|
- String[] titles = {"姓名", "部门", "考勤日期", "考勤类型", "考勤状态", "考勤时间", "审核状态", "状态时长"};
|
|
|
+ String[] titles = {"姓名", "部门", "考勤日期", "考勤类型", "考勤状态", "考勤时间", "审核状态", "状态时长","审批状态"};
|
|
|
+ String[] overtimeTitles = {"姓名", "部门", "加班日期", "加班时长"};
|
|
|
List<List<Object>> excelList = new ArrayList<>();
|
|
|
+ List<List<Object>> overtimeExcelList = new ArrayList<>();
|
|
|
excelData.forEach(data -> {
|
|
|
List<Object> temp = new ArrayList<>();
|
|
|
temp.add(data.getUserName());
|
|
@@ -285,14 +289,28 @@ public class WechatNoListController {
|
|
|
temp.add(data.getCheckinTime());
|
|
|
temp.add(data.getType());
|
|
|
temp.add(data.getStateDuration());
|
|
|
+ if(!Check.isNull(data.getStatus())){
|
|
|
+ temp.add("1".equals(data.getStatus())?"审批中":"已通过");
|
|
|
+ }else{
|
|
|
+ temp.add("");
|
|
|
+ }
|
|
|
excelList.add(temp);
|
|
|
});
|
|
|
+ overtimeData.forEach(data -> {
|
|
|
+ List<Object> temp = new ArrayList<>();
|
|
|
+ temp.add(data.getUserName());
|
|
|
+ temp.add(data.getDepartName());
|
|
|
+ temp.add(data.getCheckinDate());
|
|
|
+ temp.add(data.getOvertime());
|
|
|
+ overtimeExcelList.add(temp);
|
|
|
+ });
|
|
|
try {
|
|
|
OutputStream os = response.getOutputStream();
|
|
|
ExportExcelUtils eeu = new ExportExcelUtils();
|
|
|
XSSFWorkbook workbook = new XSSFWorkbook();
|
|
|
- eeu.exportExcelForAttendance(workbook, 0, "考勤", titles, excelList);
|
|
|
- HttpUtils.setResponseHeader(response, "考勤异常记录.xlsx");
|
|
|
+ eeu.exportExcelForAttendance(workbook, 0, "异常考勤", titles, excelList);
|
|
|
+ eeu.exportExcel(workbook, 1, "加班考勤", overtimeTitles, overtimeExcelList);
|
|
|
+ HttpUtils.setResponseHeader(response, "考勤记录.xlsx");
|
|
|
workbook.write(os);
|
|
|
os.flush();
|
|
|
os.close();
|