业务逻辑修改以及完善
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
package com.vetti.web.controller.hotake;
|
||||
|
||||
import com.vetti.common.core.controller.BaseController;
|
||||
import com.vetti.common.core.domain.R;
|
||||
import com.vetti.web.entity.dto.HotakePersonalStatisticalAnalysisDataDto;
|
||||
import com.vetti.web.service.IHotakeCommonService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 通用业务逻辑处理接口 Controller
|
||||
*
|
||||
* @author wangxiangshun
|
||||
* @date 2025-11-09
|
||||
*/
|
||||
@Api(tags ="通用业务逻辑处理接口")
|
||||
@RestController
|
||||
@RequestMapping("/hotake/commonInfo")
|
||||
public class HotakeCommonController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IHotakeCommonService commonService;
|
||||
|
||||
/**
|
||||
* 个人信息-统计分析数据
|
||||
*/
|
||||
@ApiOperation("候选者-个人信息-统计分析数据")
|
||||
@GetMapping("/getCandidateStatisticalAnalysisData")
|
||||
public R<HotakePersonalStatisticalAnalysisDataDto> handleCandidateStatisticalAnalysisData()
|
||||
{
|
||||
HotakePersonalStatisticalAnalysisDataDto data = commonService.getCandidateStatisticalAnalysisData();
|
||||
return R.ok(data);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.vetti.web.entity.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 个人统计分析数据 返回对象
|
||||
*
|
||||
* @author wangxiangshun
|
||||
* @date 2025-11-02
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class HotakePersonalStatisticalAnalysisDataDto {
|
||||
|
||||
@ApiModelProperty("岗位申请数")
|
||||
private Integer jobApplicationsNum;
|
||||
@ApiModelProperty("总的面试数")
|
||||
private Integer totalInterviewsNum;
|
||||
@ApiModelProperty("收到录用的通知数")
|
||||
private Integer offersReceivedNum;
|
||||
@ApiModelProperty("节省的时间(小时)")
|
||||
private Integer timeSavedNum;
|
||||
@ApiModelProperty("可见性提升")
|
||||
private Integer visibilityIncreaseNum;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.vetti.web.service;
|
||||
|
||||
import com.vetti.web.entity.dto.HotakePersonalStatisticalAnalysisDataDto;
|
||||
|
||||
/**
|
||||
* 通用业务信息 信息 服务类
|
||||
*
|
||||
* @author WangXiangShun
|
||||
* @since 2025-08-27
|
||||
*/
|
||||
public interface IHotakeCommonService {
|
||||
|
||||
|
||||
/**
|
||||
* 个人信息-统计分析数据
|
||||
* @return
|
||||
*/
|
||||
public HotakePersonalStatisticalAnalysisDataDto getCandidateStatisticalAnalysisData();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.vetti.web.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.vetti.common.enums.StageEnum;
|
||||
import com.vetti.common.utils.SecurityUtils;
|
||||
import com.vetti.hotake.domain.HotakeRolesApplyInfo;
|
||||
import com.vetti.hotake.domain.HotakeRolesApplyOperRecord;
|
||||
import com.vetti.hotake.service.IHotakeRolesApplyInfoService;
|
||||
import com.vetti.hotake.service.IHotakeRolesApplyOperRecordService;
|
||||
import com.vetti.web.entity.dto.HotakePersonalStatisticalAnalysisDataDto;
|
||||
import com.vetti.web.service.IHotakeCommonService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 通用业务逻辑 信息 服务实现类
|
||||
*
|
||||
* @author WangXiangShun
|
||||
* @since 2025-08-27
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class HotakeCommonServiceImpl implements IHotakeCommonService {
|
||||
|
||||
|
||||
@Autowired
|
||||
private IHotakeRolesApplyInfoService applyInfoService;
|
||||
|
||||
@Autowired
|
||||
private IHotakeRolesApplyOperRecordService operRecordService;
|
||||
|
||||
/**
|
||||
* 个人信息-统计分析数据
|
||||
* @return
|
||||
*/
|
||||
public HotakePersonalStatisticalAnalysisDataDto getCandidateStatisticalAnalysisData(){
|
||||
HotakePersonalStatisticalAnalysisDataDto dataDto = new HotakePersonalStatisticalAnalysisDataDto();
|
||||
HotakeRolesApplyInfo queryApplyInfo = new HotakeRolesApplyInfo();
|
||||
queryApplyInfo.setCandidateId(SecurityUtils.getUserId());
|
||||
List<HotakeRolesApplyInfo> rolesApplyInfoList = applyInfoService.selectHotakeRolesApplyInfoList(queryApplyInfo);
|
||||
dataDto.setJobApplicationsNum(rolesApplyInfoList.size());
|
||||
|
||||
Integer totalInterviewsNum = 0;
|
||||
Integer offersReceivedNum = 0;
|
||||
|
||||
//获取岗位申请Id
|
||||
if(CollectionUtil.isNotEmpty(rolesApplyInfoList)){
|
||||
List<Long> applyIds = rolesApplyInfoList.stream().map(HotakeRolesApplyInfo::getId).toList();
|
||||
//通过申请Id查询申请操作记录数据
|
||||
HotakeRolesApplyOperRecord queryOperRecord = new HotakeRolesApplyOperRecord();
|
||||
queryOperRecord.setApplyIds(applyIds);
|
||||
List<HotakeRolesApplyOperRecord> applyOperRecordList = operRecordService.selectHotakeRolesApplyOperRecordList(queryOperRecord);
|
||||
if(CollectionUtil.isNotEmpty(applyOperRecordList)){
|
||||
List<HotakeRolesApplyOperRecord> applyOperRecords = applyOperRecordList.stream().filter(e-> StageEnum.INTERVIEW.getCode().
|
||||
equals(e.getApplyStage())).toList();
|
||||
if (CollectionUtil.isNotEmpty(applyOperRecords)) {
|
||||
totalInterviewsNum = applyOperRecords.size();
|
||||
}
|
||||
List<HotakeRolesApplyOperRecord> applyOperRecords1 = applyOperRecordList.stream().filter(e-> StageEnum.OFFER.getCode().
|
||||
equals(e.getApplyStage())).toList();
|
||||
if (CollectionUtil.isNotEmpty(applyOperRecords1)) {
|
||||
offersReceivedNum = applyOperRecords1.size();
|
||||
}
|
||||
}
|
||||
}
|
||||
dataDto.setTotalInterviewsNum(totalInterviewsNum);
|
||||
dataDto.setOffersReceivedNum(offersReceivedNum);
|
||||
dataDto.setTimeSavedNum(7);
|
||||
dataDto.setVisibilityIncreaseNum(32);
|
||||
return dataDto;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user