业务逻辑修改以及完善

This commit is contained in:
2026-01-18 22:07:06 +08:00
parent 7240cb74ad
commit 62de85c6e0
10 changed files with 194 additions and 2 deletions

View File

@@ -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);
}
}

View File

@@ -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;
}

View File

@@ -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();
}

View File

@@ -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;
}
}

View File

@@ -57,4 +57,7 @@ public class HotakeComplianceInfo extends BaseEntity
@Excel(name = "状态", readConverterExp = "v=erified,验=证pending,待=验证") @Excel(name = "状态", readConverterExp = "v=erified,验=证pending,待=验证")
private String status; private String status;
@ApiModelProperty("数据类型identity:身份验证 backgroundCheck:背景调查 driverLicense:驾照 legalEligibility:法律资格 other:其他)")
private String dataType;
} }

View File

@@ -117,6 +117,10 @@ public class HotakeRolesApplyInfo extends BaseEntity
@Excel(name = "AI评分百分比") @Excel(name = "AI评分百分比")
private BigDecimal aiMatchScorePercentage; private BigDecimal aiMatchScorePercentage;
/** 申请状态pending:进行中complete已完成Canceled取消 */
@ApiModelProperty("申请状态pending:进行中complete已完成Canceled取消")
private String status;
@ApiModelProperty("岗位信息") @ApiModelProperty("岗位信息")
private HotakeRolesInfo rolesInfo; private HotakeRolesInfo rolesInfo;

View File

@@ -6,6 +6,8 @@ import io.swagger.annotations.ApiModelProperty;
import com.vetti.common.annotation.Excel; import com.vetti.common.annotation.Excel;
import com.vetti.common.core.domain.BaseEntity; import com.vetti.common.core.domain.BaseEntity;
import java.util.List;
/** /**
* 岗位申请操作信息对象 hotake_roles_apply_oper_record * 岗位申请操作信息对象 hotake_roles_apply_oper_record
* *
@@ -37,4 +39,7 @@ public class HotakeRolesApplyOperRecord extends BaseEntity
@Excel(name = "当前阶段") @Excel(name = "当前阶段")
private String applyStage; private String applyStage;
@ApiModelProperty("岗位申请Id数据集合")
private List<Long> applyIds;
} }

View File

@@ -13,6 +13,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="fileSuffix" column="file_suffix" /> <result property="fileSuffix" column="file_suffix" />
<result property="fileSizeShow" column="file_size_show" /> <result property="fileSizeShow" column="file_size_show" />
<result property="status" column="status" /> <result property="status" column="status" />
<result property="dataType" column="data_type" />
<result property="delFlag" column="del_flag" /> <result property="delFlag" column="del_flag" />
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by" />
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
@@ -22,7 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectHotakeComplianceInfoVo"> <sql id="selectHotakeComplianceInfoVo">
select id, user_id, file_name, file_type, file_url, file_suffix, file_size_show, status, del_flag, create_by, create_time, update_by, update_time, remark from hotake_compliance_info select id, user_id, file_name, file_type, file_url, file_suffix, file_size_show, status,data_type, del_flag, create_by, create_time, update_by, update_time, remark from hotake_compliance_info
</sql> </sql>
<select id="selectHotakeComplianceInfoList" parameterType="HotakeComplianceInfo" resultMap="HotakeComplianceInfoResult"> <select id="selectHotakeComplianceInfoList" parameterType="HotakeComplianceInfo" resultMap="HotakeComplianceInfoResult">
@@ -35,6 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="fileSuffix != null and fileSuffix != ''"> and file_suffix = #{fileSuffix}</if> <if test="fileSuffix != null and fileSuffix != ''"> and file_suffix = #{fileSuffix}</if>
<if test="fileSizeShow != null and fileSizeShow != ''"> and file_size_show = #{fileSizeShow}</if> <if test="fileSizeShow != null and fileSizeShow != ''"> and file_size_show = #{fileSizeShow}</if>
<if test="status != null and status != ''"> and status = #{status}</if> <if test="status != null and status != ''"> and status = #{status}</if>
<if test="dataType != null and dataType != ''"> and data_type = #{dataType}</if>
</where> </where>
</select> </select>
@@ -53,6 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="fileSuffix != null">file_suffix,</if> <if test="fileSuffix != null">file_suffix,</if>
<if test="fileSizeShow != null">file_size_show,</if> <if test="fileSizeShow != null">file_size_show,</if>
<if test="status != null">status,</if> <if test="status != null">status,</if>
<if test="dataType != null">data_type,</if>
<if test="delFlag != null">del_flag,</if> <if test="delFlag != null">del_flag,</if>
<if test="createBy != null">create_by,</if> <if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
@@ -68,6 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="fileSuffix != null">#{fileSuffix},</if> <if test="fileSuffix != null">#{fileSuffix},</if>
<if test="fileSizeShow != null">#{fileSizeShow},</if> <if test="fileSizeShow != null">#{fileSizeShow},</if>
<if test="status != null">#{status},</if> <if test="status != null">#{status},</if>
<if test="dataType != null">#{dataType},</if>
<if test="delFlag != null">#{delFlag},</if> <if test="delFlag != null">#{delFlag},</if>
<if test="createBy != null">#{createBy},</if> <if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
@@ -87,6 +91,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="fileSuffix != null">file_suffix = #{fileSuffix},</if> <if test="fileSuffix != null">file_suffix = #{fileSuffix},</if>
<if test="fileSizeShow != null">file_size_show = #{fileSizeShow},</if> <if test="fileSizeShow != null">file_size_show = #{fileSizeShow},</if>
<if test="status != null">status = #{status},</if> <if test="status != null">status = #{status},</if>
<if test="dataType != null">data_type = #{dataType},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if> <if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="createBy != null">create_by = #{createBy},</if> <if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>

View File

@@ -25,6 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="experience" column="experience" /> <result property="experience" column="experience" />
<result property="aiMatchScore" column="ai_match_score" /> <result property="aiMatchScore" column="ai_match_score" />
<result property="aiMatchScorePercentage" column="ai_match_score_percentage" /> <result property="aiMatchScorePercentage" column="ai_match_score_percentage" />
<result property="status" column="status" />
<result property="delFlag" column="del_flag" /> <result property="delFlag" column="del_flag" />
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by" />
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
@@ -34,7 +35,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectHotakeRolesApplyInfoVo"> <sql id="selectHotakeRolesApplyInfoVo">
select id, candidate_id,recruiter_id, role_id, full_name, email, phone_number, cv_file, cv_file_suffix,file_size_show,cover_letter, candidate_status, stage, last_contact, cv_template_json, cv_score, cv_md5, experience, ai_match_score, ai_match_score_percentage, del_flag, create_by, create_time, update_by, update_time, remark from hotake_roles_apply_info select id, candidate_id,recruiter_id, role_id, full_name, email, phone_number, cv_file, cv_file_suffix,file_size_show,
cover_letter, candidate_status, stage, last_contact, cv_template_json, cv_score, cv_md5, experience, ai_match_score,
ai_match_score_percentage,status, del_flag, create_by, create_time, update_by, update_time, remark from hotake_roles_apply_info
</sql> </sql>
<select id="selectHotakeRolesApplyInfoList" parameterType="HotakeRolesApplyInfo" resultMap="HotakeRolesApplyInfoResult"> <select id="selectHotakeRolesApplyInfoList" parameterType="HotakeRolesApplyInfo" resultMap="HotakeRolesApplyInfoResult">
@@ -59,6 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="experience != null and experience != ''"> and experience = #{experience}</if> <if test="experience != null and experience != ''"> and experience = #{experience}</if>
<if test="aiMatchScore != null and aiMatchScore != ''"> and ai_match_score = #{aiMatchScore}</if> <if test="aiMatchScore != null and aiMatchScore != ''"> and ai_match_score = #{aiMatchScore}</if>
<if test="aiMatchScorePercentage != null "> and ai_match_score_percentage = #{aiMatchScorePercentage}</if> <if test="aiMatchScorePercentage != null "> and ai_match_score_percentage = #{aiMatchScorePercentage}</if>
<if test="status != null "> and status = #{status}</if>
</where> </where>
</select> </select>
@@ -89,6 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="experience != null">experience,</if> <if test="experience != null">experience,</if>
<if test="aiMatchScore != null">ai_match_score,</if> <if test="aiMatchScore != null">ai_match_score,</if>
<if test="aiMatchScorePercentage != null">ai_match_score_percentage,</if> <if test="aiMatchScorePercentage != null">ai_match_score_percentage,</if>
<if test="status != null">status,</if>
<if test="delFlag != null">del_flag,</if> <if test="delFlag != null">del_flag,</if>
<if test="createBy != null">create_by,</if> <if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
@@ -116,6 +121,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="experience != null">#{experience},</if> <if test="experience != null">#{experience},</if>
<if test="aiMatchScore != null">#{aiMatchScore},</if> <if test="aiMatchScore != null">#{aiMatchScore},</if>
<if test="aiMatchScorePercentage != null">#{aiMatchScorePercentage},</if> <if test="aiMatchScorePercentage != null">#{aiMatchScorePercentage},</if>
<if test="status != null">#{status},</if>
<if test="delFlag != null">#{delFlag},</if> <if test="delFlag != null">#{delFlag},</if>
<if test="createBy != null">#{createBy},</if> <if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
@@ -147,6 +153,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="experience != null">experience = #{experience},</if> <if test="experience != null">experience = #{experience},</if>
<if test="aiMatchScore != null">ai_match_score = #{aiMatchScore},</if> <if test="aiMatchScore != null">ai_match_score = #{aiMatchScore},</if>
<if test="aiMatchScorePercentage != null">ai_match_score_percentage = #{aiMatchScorePercentage},</if> <if test="aiMatchScorePercentage != null">ai_match_score_percentage = #{aiMatchScorePercentage},</if>
<if test="status != null">status = #{status},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if> <if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="createBy != null">create_by = #{createBy},</if> <if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>

View File

@@ -27,6 +27,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="roleId != null "> and role_id = #{roleId}</if> <if test="roleId != null "> and role_id = #{roleId}</if>
<if test="roleApplyId != null "> and role_apply_id = #{roleApplyId}</if> <if test="roleApplyId != null "> and role_apply_id = #{roleApplyId}</if>
<if test="applyStage != null and applyStage != ''"> and apply_stage = #{applyStage}</if> <if test="applyStage != null and applyStage != ''"> and apply_stage = #{applyStage}</if>
<if test="applyIds != null ">
and role_apply_id in
<foreach item="applyId" collection="applyIds" open="(" separator="," close=")">
#{applyId}
</foreach>
</if>
</where> </where>
order by create_time ASC order by create_time ASC
</select> </select>