|
@@ -9,10 +9,11 @@ import com.citu.module.menduner.system.controller.app.jobhunt.job.hire.AppHireJo
|
|
|
import com.citu.module.menduner.system.controller.app.jobhunt.job.hire.AppHireJobCvRelReqVO;
|
|
|
import com.citu.module.menduner.system.controller.app.jobhunt.job.hire.AppHireJobCvRelRespVO;
|
|
|
import com.citu.module.menduner.system.controller.app.jobhunt.job.vo.AppJobCvRelReqVO;
|
|
|
-import com.citu.module.menduner.system.controller.app.recruit.analysis.vo.AppRecruitAnalysisReqVO;
|
|
|
import com.citu.module.menduner.system.controller.app.recruit.person.hire.AppRecruitHireJobCvRelPageReqVO;
|
|
|
import com.citu.module.menduner.system.controller.app.recruit.person.hire.AppRecruitHireJobCvRelRespVO;
|
|
|
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.RecruitJobCvRelAnalysisRespVO;
|
|
|
import com.citu.module.menduner.system.controller.base.job.JobCvRelPageReqVO;
|
|
|
import com.citu.module.menduner.system.controller.base.job.JobCvRelSaveReqVO;
|
|
|
import com.citu.module.menduner.system.dal.dataobject.job.JobAdvertisedDO;
|
|
@@ -28,12 +29,17 @@ import org.springframework.validation.annotation.Validated;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.time.LocalDateTime;
|
|
|
-import java.util.*;
|
|
|
+import java.util.Comparator;
|
|
|
+import java.util.LinkedHashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
import static com.citu.framework.common.exception.util.ServiceExceptionUtil.exception;
|
|
|
import static com.citu.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
|
|
import static com.citu.module.menduner.system.enums.ErrorCodeConstants.*;
|
|
|
+import static com.citu.module.menduner.system.util.RecruitAnalysisUtils.generateDateTimeRange;
|
|
|
+import static com.citu.module.menduner.system.util.RecruitAnalysisUtils.packBarCount;
|
|
|
|
|
|
/**
|
|
|
* 招聘职位简历投递 Service 实现类
|
|
@@ -189,13 +195,13 @@ public class JobCvRelServiceImpl implements JobCvRelService {
|
|
|
|
|
|
@Override
|
|
|
public PageResult<AppRecruitHireJobCvRelRespVO> page(AppRecruitHireJobCvRelPageReqVO reqVO) {
|
|
|
- return jobCvRelMapper.page(reqVO,LoginUserContext.getEnterpriseId(),LoginUserContext.getUserId());
|
|
|
+ return jobCvRelMapper.page(reqVO, LoginUserContext.getEnterpriseId(), LoginUserContext.getUserId());
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<CommonRespVO> getJobCvSexCount(AppRecruitAnalysisReqVO reqVO) {
|
|
|
+ public List<CommonRespVO> getJobCvSexCount(RecruitAnalysisReqVO reqVO) {
|
|
|
LocalDateTime[] timeRange = generateDateTimeRange(reqVO);
|
|
|
- List<CommonRespVO> result = jobCvRelMapper.getJobCvSexCount(timeRange[0], timeRange[1]);
|
|
|
+ List<CommonRespVO> result = jobCvRelMapper.getJobCvSexCount(reqVO,timeRange[0], timeRange[1]);
|
|
|
for (PersonSexEnum value : PersonSexEnum.values()) {
|
|
|
CommonRespVO respVO = result.stream()
|
|
|
.filter(c -> c.getKey().equals(value.getType())).findFirst().orElse(null);
|
|
@@ -213,9 +219,9 @@ public class JobCvRelServiceImpl implements JobCvRelService {
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public Map<String, Object[]> getJobCvAgeCount(AppRecruitAnalysisReqVO reqVO) {
|
|
|
+ public Map<String, Object[]> getJobCvAgeCount(RecruitAnalysisReqVO reqVO) {
|
|
|
LocalDateTime[] timeRange = generateDateTimeRange(reqVO);
|
|
|
- List<CommonRespVO> result = jobCvRelMapper.getJobCvAgeCount(timeRange[0], timeRange[1]);
|
|
|
+ List<CommonRespVO> result = jobCvRelMapper.getJobCvAgeCount(reqVO,timeRange[0], timeRange[1]);
|
|
|
// 填充
|
|
|
String[] ageArr = new String[]{"18-22岁", "23-30岁", "31-39岁", "40-49岁", "50-59岁", "其他年龄段"};
|
|
|
for (String age : ageArr) {
|
|
@@ -237,9 +243,9 @@ public class JobCvRelServiceImpl implements JobCvRelService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Map<String, Object[]> getJobCvEduCount(AppRecruitAnalysisReqVO reqVO) {
|
|
|
+ public Map<String, Object[]> getJobCvEduCount(RecruitAnalysisReqVO reqVO) {
|
|
|
LocalDateTime[] timeRange = generateDateTimeRange(reqVO);
|
|
|
- List<CommonRespVO> result = jobCvRelMapper.getJobCvEduCount(timeRange[0], timeRange[1]);
|
|
|
+ List<CommonRespVO> result = jobCvRelMapper.getJobCvEduCount(reqVO,timeRange[0], timeRange[1]);
|
|
|
// 填充
|
|
|
for (EducationTypeEnum value : EducationTypeEnum.values()) {
|
|
|
CommonRespVO respVO = result.stream()
|
|
@@ -255,7 +261,7 @@ public class JobCvRelServiceImpl implements JobCvRelService {
|
|
|
}
|
|
|
// 对 result 的 key 进行排序
|
|
|
List<CommonRespVO> sortedResult = result.stream()
|
|
|
- .sorted(Comparator.comparing(s->
|
|
|
+ .sorted(Comparator.comparing(s ->
|
|
|
EducationTypeEnum.getEnumByName(s.getKey()).getType())
|
|
|
)
|
|
|
.collect(Collectors.toList());
|
|
@@ -263,9 +269,9 @@ public class JobCvRelServiceImpl implements JobCvRelService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Map<String, Object[]> getJobCvExpCount(AppRecruitAnalysisReqVO reqVO) {
|
|
|
+ public Map<String, Object[]> getJobCvExpCount(RecruitAnalysisReqVO reqVO) {
|
|
|
LocalDateTime[] timeRange = generateDateTimeRange(reqVO);
|
|
|
- List<CommonRespVO> result = jobCvRelMapper.getJobCvExpCount(timeRange[0], timeRange[1]);
|
|
|
+ List<CommonRespVO> result = jobCvRelMapper.getJobCvExpCount(reqVO,timeRange[0], timeRange[1]);
|
|
|
// 填充
|
|
|
for (ExpTypeEnum value : ExpTypeEnum.values()) {
|
|
|
CommonRespVO respVO = result.stream()
|
|
@@ -281,67 +287,24 @@ public class JobCvRelServiceImpl implements JobCvRelService {
|
|
|
}
|
|
|
// 对 result 的 key 进行排序
|
|
|
List<CommonRespVO> sortedResult = result.stream()
|
|
|
- .sorted(Comparator.comparing(s->
|
|
|
+ .sorted(Comparator.comparing(s ->
|
|
|
EducationTypeEnum.getEnumByName(s.getKey()).getType())
|
|
|
)
|
|
|
.collect(Collectors.toList());
|
|
|
return packBarCount(sortedResult);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- /**
|
|
|
- * 包装柱状图格式
|
|
|
- **/
|
|
|
- public Map<String, Object[]> packBarCount(List<CommonRespVO> result) {
|
|
|
- if (CollUtil.isEmpty(result)) {
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
- Map<String, Object[]> map = new LinkedHashMap<>();
|
|
|
- String[] keys = result.stream()
|
|
|
- .map(CommonRespVO::getKey)
|
|
|
- .toArray(String[]::new);
|
|
|
- map.put("x", keys);
|
|
|
-
|
|
|
- Object[] values = result.stream()
|
|
|
- .map(CommonRespVO::getValue)
|
|
|
- .toArray();
|
|
|
-
|
|
|
- map.put("y", values);
|
|
|
-
|
|
|
- return map;
|
|
|
+ @Override
|
|
|
+ public PageResult<RecruitJobCvRelAnalysisRespVO> getNewCvRel(RecruitAnalysisReqVO reqVO) {
|
|
|
+ LocalDateTime[] timeRange = generateDateTimeRange(reqVO);
|
|
|
+ return jobCvRelMapper.getAnalysisDetail(reqVO,timeRange[0], timeRange[1],JobCvRelStatusEnum.NEW.getStatus());
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 生成时间范围
|
|
|
- **/
|
|
|
- public LocalDateTime[] generateDateTimeRange(AppRecruitAnalysisReqVO reqVO) {
|
|
|
- if (AppRecruitAnalysisReqVO.TYPE_CUSTOM.equals(reqVO.getType())) {
|
|
|
- return reqVO.getTime();
|
|
|
- }
|
|
|
- LocalDateTime[] dateTimeRange = new LocalDateTime[2];
|
|
|
- LocalDateTime now = LocalDateTime.now();
|
|
|
- switch (reqVO.getType()) {
|
|
|
- case AppRecruitAnalysisReqVO.TYPE_RECENT_7_DAYS:
|
|
|
- // 最新7天内
|
|
|
- dateTimeRange[0] = now.minusDays(7);
|
|
|
- dateTimeRange[1] = now;
|
|
|
- break;
|
|
|
- case AppRecruitAnalysisReqVO.TYPE_LAST_MONTH:
|
|
|
- // 上个月
|
|
|
- dateTimeRange[0] = now.minusMonths(1).withDayOfMonth(1);
|
|
|
- dateTimeRange[1] = now.withDayOfMonth(1).minusNanos(1);
|
|
|
- break;
|
|
|
- case AppRecruitAnalysisReqVO.TYPE_LAST_QUARTER:
|
|
|
- // 上季度
|
|
|
- int currentMonth = now.getMonthValue();
|
|
|
- // 计算上一季度的起始月份
|
|
|
- int quarterStartMonth = ((currentMonth - 1) / 3) * 3 + 1;
|
|
|
- int lastQuarterStartMonth = quarterStartMonth - 3;
|
|
|
- dateTimeRange[0] = now.withMonth(lastQuarterStartMonth).withDayOfMonth(1);
|
|
|
- dateTimeRange[1] = now.withMonth(quarterStartMonth).withDayOfMonth(1).minusNanos(1);
|
|
|
- break;
|
|
|
- }
|
|
|
- return dateTimeRange;
|
|
|
+ @Override
|
|
|
+ public PageResult<RecruitJobCvRelAnalysisRespVO> getLookCvRel(RecruitAnalysisReqVO reqVO) {
|
|
|
+ LocalDateTime[] timeRange = generateDateTimeRange(reqVO);
|
|
|
+ return jobCvRelMapper.getAnalysisDetail(reqVO,timeRange[0], timeRange[1],JobCvRelStatusEnum.LOOK.getStatus());
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
}
|