| | |
| | | package cn.iocoder.yudao.module.hrm.controller.admin.attendance; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; |
| | | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| | | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| | |
| | | if (CollUtil.isNotEmpty(data)) { |
| | | fillUserInfo(data, pageResult.getList()); |
| | | } |
| | | ExcelUtils.write(response, "考勤统计汇总.xls", "数据", HrmAttendanceSummaryRespVO.class, data); |
| | | // 文件名带上筛选条件,避免导出多个月份数据时被误认为「重复」 |
| | | String fileName = "考勤统计汇总"; |
| | | if (StrUtil.isNotBlank(pageReqVO.getYearMonth())) { |
| | | fileName = fileName + "_" + pageReqVO.getYearMonth(); |
| | | } else if (pageReqVO.getStartDate() != null) { |
| | | fileName = fileName + "_" + pageReqVO.getStartDate() |
| | | + "_" + (pageReqVO.getEndDate() != null ? pageReqVO.getEndDate() : "至今"); |
| | | } |
| | | ExcelUtils.write(response, fileName + ".xls", "数据", HrmAttendanceSummaryRespVO.class, data); |
| | | } |
| | | |
| | | } |