|
@@ -1,15 +1,27 @@
|
|
|
package com.citu.module.menduner.system.controller.app.recruit.analysis;
|
|
|
|
|
|
+import cn.hutool.core.collection.CollUtil;
|
|
|
+import com.citu.framework.apilog.core.annotation.ApiAccessLog;
|
|
|
import com.citu.framework.common.pojo.CommonResult;
|
|
|
+import com.citu.framework.common.pojo.PageParam;
|
|
|
import com.citu.framework.common.pojo.PageResult;
|
|
|
+import com.citu.framework.common.util.object.BeanUtils;
|
|
|
+import com.citu.framework.excel.core.util.ExcelUtils;
|
|
|
+import com.citu.framework.excel.core.util.ExcelWriteDTO;
|
|
|
import com.citu.framework.security.core.annotations.PreAuthenticated;
|
|
|
import com.citu.module.menduner.common.util.LoginUserContext;
|
|
|
-import com.citu.module.menduner.system.controller.base.analysis.RecruitAnalysisReqVO;
|
|
|
import com.citu.module.menduner.system.controller.base.CommonRespVO;
|
|
|
+import com.citu.module.menduner.system.controller.base.analysis.RecruitAnalysisReqVO;
|
|
|
import com.citu.module.menduner.system.controller.base.analysis.RecruitInterviewInviteAnalysisRespVO;
|
|
|
import com.citu.module.menduner.system.controller.base.analysis.RecruitJobAnalysisRespVO;
|
|
|
import com.citu.module.menduner.system.controller.base.analysis.RecruitJobCvRelAnalysisRespVO;
|
|
|
-import com.citu.module.menduner.system.dal.mysql.interview.InterviewInviteMapper;
|
|
|
+import com.citu.module.menduner.system.controller.base.analysis.excel.RecruitInterviewInviteAnalysisExcelRespVO;
|
|
|
+import com.citu.module.menduner.system.controller.base.analysis.excel.RecruitJobAnalysisExcelRespVO;
|
|
|
+import com.citu.module.menduner.system.controller.base.analysis.excel.RecruitJobCvRelAnalysisExcelRespVO;
|
|
|
+import com.citu.module.menduner.system.controller.base.hunt.HuntRespVO;
|
|
|
+import com.citu.module.menduner.system.convert.InterviewInviteConvert;
|
|
|
+import com.citu.module.menduner.system.convert.JobAdvertisedConvert;
|
|
|
+import com.citu.module.menduner.system.convert.JobCvRelConvert;
|
|
|
import com.citu.module.menduner.system.service.interview.InterviewInviteService;
|
|
|
import com.citu.module.menduner.system.service.job.JobAdvertisedService;
|
|
|
import com.citu.module.menduner.system.service.job.JobCvRelService;
|
|
@@ -22,11 +34,15 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
import javax.validation.Valid;
|
|
|
+import java.io.IOException;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.Collections;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
+import static com.citu.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
|
|
import static com.citu.framework.common.pojo.CommonResult.success;
|
|
|
|
|
|
@Tag(name = "招聘端 - 统计分析")
|
|
@@ -74,7 +90,7 @@ public class AppRecruitAnalysisController {
|
|
|
}
|
|
|
|
|
|
@GetMapping("/get/job/cv/new/page")
|
|
|
- @Operation(summary = "获取新投递简历统计分析明细")
|
|
|
+ @Operation(summary = "获取新投递简历明细")
|
|
|
@PreAuthenticated
|
|
|
public CommonResult<PageResult<RecruitJobCvRelAnalysisRespVO>> getNewCvRel(
|
|
|
@Valid RecruitAnalysisReqVO reqVO) {
|
|
@@ -83,7 +99,7 @@ public class AppRecruitAnalysisController {
|
|
|
}
|
|
|
|
|
|
@GetMapping("/get/job/cv/look/page")
|
|
|
- @Operation(summary = "获取已查看简历统计分析明细")
|
|
|
+ @Operation(summary = "获取已查看简历明细")
|
|
|
@PreAuthenticated
|
|
|
public CommonResult<PageResult<RecruitJobCvRelAnalysisRespVO>> getLookCvRel(
|
|
|
@Valid RecruitAnalysisReqVO reqVO) {
|
|
@@ -92,7 +108,7 @@ public class AppRecruitAnalysisController {
|
|
|
}
|
|
|
|
|
|
@GetMapping("/get/interview/wait/page")
|
|
|
- @Operation(summary = "获取待面试统计分析明细")
|
|
|
+ @Operation(summary = "获取待面试明细")
|
|
|
@PreAuthenticated
|
|
|
public CommonResult<PageResult<RecruitInterviewInviteAnalysisRespVO>> getWaitInterview(
|
|
|
@Valid RecruitAnalysisReqVO reqVO) {
|
|
@@ -101,7 +117,7 @@ public class AppRecruitAnalysisController {
|
|
|
}
|
|
|
|
|
|
@GetMapping("/get/interview/complete/page")
|
|
|
- @Operation(summary = "获取完成面试统计分析明细")
|
|
|
+ @Operation(summary = "获取完成面试明细")
|
|
|
@PreAuthenticated
|
|
|
public CommonResult<PageResult<RecruitInterviewInviteAnalysisRespVO>> getCompleteInterview(
|
|
|
@Valid RecruitAnalysisReqVO reqVO) {
|
|
@@ -110,7 +126,7 @@ public class AppRecruitAnalysisController {
|
|
|
}
|
|
|
|
|
|
@GetMapping("/get/job/browse/num/page")
|
|
|
- @Operation(summary = "获取发布职位浏览量统计分析明细")
|
|
|
+ @Operation(summary = "获取发布职位浏览量明细")
|
|
|
@PreAuthenticated
|
|
|
public CommonResult<PageResult<RecruitJobAnalysisRespVO>> getBrowseNum(
|
|
|
@Valid RecruitAnalysisReqVO reqVO) {
|
|
@@ -127,7 +143,7 @@ public class AppRecruitAnalysisController {
|
|
|
}
|
|
|
|
|
|
@GetMapping("/get/job/num/page")
|
|
|
- @Operation(summary = "获取发布职位统计分析明细")
|
|
|
+ @Operation(summary = "获取发布职位明细")
|
|
|
@PreAuthenticated
|
|
|
public CommonResult<PageResult<RecruitJobAnalysisRespVO>> getJobNum(
|
|
|
@Valid RecruitAnalysisReqVO reqVO) {
|
|
@@ -135,6 +151,60 @@ public class AppRecruitAnalysisController {
|
|
|
return success(jobAdvertisedService.getJobNum(reqVO));
|
|
|
}
|
|
|
|
|
|
+ @GetMapping("/export")
|
|
|
+ @Operation(summary = "导出统计分析 Excel")
|
|
|
+ @ApiAccessLog(operateType = EXPORT)
|
|
|
+ public void export(@Valid RecruitAnalysisReqVO reqVO,
|
|
|
+ HttpServletResponse response) throws IOException {
|
|
|
+ setCommonCondition(reqVO);
|
|
|
+ reqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
|
+ List<ExcelWriteDTO> writeDTOList = new ArrayList<>();
|
|
|
+ packExcelData(writeDTOList,
|
|
|
+ RecruitJobCvRelAnalysisExcelRespVO.class,
|
|
|
+ JobCvRelConvert.INSTANCE.convertList(jobCvcRelService.getNewCvRel(reqVO).getList()),
|
|
|
+ "新投递简历明细");
|
|
|
+
|
|
|
+ packExcelData(writeDTOList,
|
|
|
+ RecruitJobCvRelAnalysisExcelRespVO.class,
|
|
|
+ JobCvRelConvert.INSTANCE.convertList(jobCvcRelService.getLookCvRel(reqVO).getList()),
|
|
|
+ "已查看简历明细");
|
|
|
+
|
|
|
+ packExcelData(writeDTOList,
|
|
|
+ RecruitInterviewInviteAnalysisExcelRespVO.class,
|
|
|
+ InterviewInviteConvert.INSTANCE.convertList(interviewInviteService.getWaitInterview(reqVO).getList()),
|
|
|
+ "已邀面试明细");
|
|
|
+
|
|
|
+ packExcelData(writeDTOList,
|
|
|
+ RecruitInterviewInviteAnalysisExcelRespVO.class,
|
|
|
+ InterviewInviteConvert.INSTANCE.convertList(interviewInviteService.getCompleteInterview(reqVO).getList()),
|
|
|
+ "完成面试明细");
|
|
|
+
|
|
|
+ packExcelData(writeDTOList,
|
|
|
+ RecruitJobAnalysisExcelRespVO.class,
|
|
|
+ JobAdvertisedConvert.INSTANCE.convertList6(jobAdvertisedService.getBrowseNum(reqVO).getList()),
|
|
|
+ "职位浏览量明细");
|
|
|
+
|
|
|
+ packExcelData(writeDTOList,
|
|
|
+ RecruitJobAnalysisExcelRespVO.class,
|
|
|
+ JobAdvertisedConvert.INSTANCE.convertList6(jobAdvertisedService.getJobNum(reqVO).getList()),
|
|
|
+ "已发布职位明细");
|
|
|
+
|
|
|
+ // 导出 Excel
|
|
|
+ ExcelUtils.write(response, "统计分析明细.xls",writeDTOList);
|
|
|
+ }
|
|
|
+
|
|
|
+ public void packExcelData
|
|
|
+ (List<ExcelWriteDTO> writeDTOList, Class head, List data, String sheetName) {
|
|
|
+ if (CollUtil.isEmpty(data)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ ExcelWriteDTO writeDTO = new ExcelWriteDTO();
|
|
|
+ writeDTO.setHead(head);
|
|
|
+ writeDTO.setData(data);
|
|
|
+ writeDTO.setSheetName(sheetName);
|
|
|
+ writeDTOList.add(writeDTO);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
private void setCommonCondition(RecruitAnalysisReqVO reqVO) {
|
|
|
reqVO.setEnterpriseId(LoginUserContext.getEnterpriseId());
|