diff --git a/vetti-admin/src/main/java/com/vetti/web/controller/hotake/HotakeCommonController.java b/vetti-admin/src/main/java/com/vetti/web/controller/hotake/HotakeCommonController.java new file mode 100644 index 0000000..232deba --- /dev/null +++ b/vetti-admin/src/main/java/com/vetti/web/controller/hotake/HotakeCommonController.java @@ -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 handleCandidateStatisticalAnalysisData() + { + HotakePersonalStatisticalAnalysisDataDto data = commonService.getCandidateStatisticalAnalysisData(); + return R.ok(data); + } + +} diff --git a/vetti-admin/src/main/java/com/vetti/web/entity/dto/HotakePersonalStatisticalAnalysisDataDto.java b/vetti-admin/src/main/java/com/vetti/web/entity/dto/HotakePersonalStatisticalAnalysisDataDto.java new file mode 100644 index 0000000..8b8a267 --- /dev/null +++ b/vetti-admin/src/main/java/com/vetti/web/entity/dto/HotakePersonalStatisticalAnalysisDataDto.java @@ -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; +} diff --git a/vetti-admin/src/main/java/com/vetti/web/service/IHotakeCommonService.java b/vetti-admin/src/main/java/com/vetti/web/service/IHotakeCommonService.java new file mode 100644 index 0000000..a8b1709 --- /dev/null +++ b/vetti-admin/src/main/java/com/vetti/web/service/IHotakeCommonService.java @@ -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(); + +} diff --git a/vetti-admin/src/main/java/com/vetti/web/service/impl/HotakeCommonServiceImpl.java b/vetti-admin/src/main/java/com/vetti/web/service/impl/HotakeCommonServiceImpl.java new file mode 100644 index 0000000..db492d8 --- /dev/null +++ b/vetti-admin/src/main/java/com/vetti/web/service/impl/HotakeCommonServiceImpl.java @@ -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 rolesApplyInfoList = applyInfoService.selectHotakeRolesApplyInfoList(queryApplyInfo); + dataDto.setJobApplicationsNum(rolesApplyInfoList.size()); + + Integer totalInterviewsNum = 0; + Integer offersReceivedNum = 0; + + //获取岗位申请Id + if(CollectionUtil.isNotEmpty(rolesApplyInfoList)){ + List applyIds = rolesApplyInfoList.stream().map(HotakeRolesApplyInfo::getId).toList(); + //通过申请Id查询申请操作记录数据 + HotakeRolesApplyOperRecord queryOperRecord = new HotakeRolesApplyOperRecord(); + queryOperRecord.setApplyIds(applyIds); + List applyOperRecordList = operRecordService.selectHotakeRolesApplyOperRecordList(queryOperRecord); + if(CollectionUtil.isNotEmpty(applyOperRecordList)){ + List applyOperRecords = applyOperRecordList.stream().filter(e-> StageEnum.INTERVIEW.getCode(). + equals(e.getApplyStage())).toList(); + if (CollectionUtil.isNotEmpty(applyOperRecords)) { + totalInterviewsNum = applyOperRecords.size(); + } + List 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; + } +} diff --git a/vetti-hotakes/src/main/java/com/vetti/hotake/domain/HotakeComplianceInfo.java b/vetti-hotakes/src/main/java/com/vetti/hotake/domain/HotakeComplianceInfo.java index c75b67c..77357e8 100644 --- a/vetti-hotakes/src/main/java/com/vetti/hotake/domain/HotakeComplianceInfo.java +++ b/vetti-hotakes/src/main/java/com/vetti/hotake/domain/HotakeComplianceInfo.java @@ -57,4 +57,7 @@ public class HotakeComplianceInfo extends BaseEntity @Excel(name = "状态", readConverterExp = "v=erified,验=证,pending,待=验证") private String status; + @ApiModelProperty("数据类型(identity:身份验证 backgroundCheck:背景调查 driverLicense:驾照 legalEligibility:法律资格 other:其他)") + private String dataType; + } diff --git a/vetti-hotakes/src/main/java/com/vetti/hotake/domain/HotakeRolesApplyInfo.java b/vetti-hotakes/src/main/java/com/vetti/hotake/domain/HotakeRolesApplyInfo.java index 85c66df..02348ed 100644 --- a/vetti-hotakes/src/main/java/com/vetti/hotake/domain/HotakeRolesApplyInfo.java +++ b/vetti-hotakes/src/main/java/com/vetti/hotake/domain/HotakeRolesApplyInfo.java @@ -117,6 +117,10 @@ public class HotakeRolesApplyInfo extends BaseEntity @Excel(name = "AI评分百分比") private BigDecimal aiMatchScorePercentage; + /** 申请状态(pending:进行中,complete:已完成,Canceled:取消) */ + @ApiModelProperty("申请状态(pending:进行中,complete:已完成,Canceled:取消)") + private String status; + @ApiModelProperty("岗位信息") private HotakeRolesInfo rolesInfo; diff --git a/vetti-hotakes/src/main/java/com/vetti/hotake/domain/HotakeRolesApplyOperRecord.java b/vetti-hotakes/src/main/java/com/vetti/hotake/domain/HotakeRolesApplyOperRecord.java index e9f677c..3eb0753 100644 --- a/vetti-hotakes/src/main/java/com/vetti/hotake/domain/HotakeRolesApplyOperRecord.java +++ b/vetti-hotakes/src/main/java/com/vetti/hotake/domain/HotakeRolesApplyOperRecord.java @@ -6,6 +6,8 @@ import io.swagger.annotations.ApiModelProperty; import com.vetti.common.annotation.Excel; import com.vetti.common.core.domain.BaseEntity; +import java.util.List; + /** * 岗位申请操作信息对象 hotake_roles_apply_oper_record * @@ -37,4 +39,7 @@ public class HotakeRolesApplyOperRecord extends BaseEntity @Excel(name = "当前阶段") private String applyStage; + @ApiModelProperty("岗位申请Id数据集合") + private List applyIds; + } diff --git a/vetti-hotakes/src/main/resources/mapper/hotake/HotakeComplianceInfoMapper.xml b/vetti-hotakes/src/main/resources/mapper/hotake/HotakeComplianceInfoMapper.xml index 5a372cb..ca4292a 100644 --- a/vetti-hotakes/src/main/resources/mapper/hotake/HotakeComplianceInfoMapper.xml +++ b/vetti-hotakes/src/main/resources/mapper/hotake/HotakeComplianceInfoMapper.xml @@ -13,6 +13,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -22,7 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - 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 @@ -53,6 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" file_suffix, file_size_show, status, + data_type, del_flag, create_by, create_time, @@ -68,6 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{fileSuffix}, #{fileSizeShow}, #{status}, + #{dataType}, #{delFlag}, #{createBy}, #{createTime}, @@ -87,6 +91,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" file_suffix = #{fileSuffix}, file_size_show = #{fileSizeShow}, status = #{status}, + data_type = #{dataType}, del_flag = #{delFlag}, create_by = #{createBy}, create_time = #{createTime}, diff --git a/vetti-hotakes/src/main/resources/mapper/hotake/HotakeRolesApplyInfoMapper.xml b/vetti-hotakes/src/main/resources/mapper/hotake/HotakeRolesApplyInfoMapper.xml index 5be6b10..0a5cccd 100644 --- a/vetti-hotakes/src/main/resources/mapper/hotake/HotakeRolesApplyInfoMapper.xml +++ b/vetti-hotakes/src/main/resources/mapper/hotake/HotakeRolesApplyInfoMapper.xml @@ -25,6 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -34,7 +35,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - 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 @@ -89,6 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" experience, ai_match_score, ai_match_score_percentage, + status, del_flag, create_by, create_time, @@ -116,6 +121,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{experience}, #{aiMatchScore}, #{aiMatchScorePercentage}, + #{status}, #{delFlag}, #{createBy}, #{createTime}, @@ -147,6 +153,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" experience = #{experience}, ai_match_score = #{aiMatchScore}, ai_match_score_percentage = #{aiMatchScorePercentage}, + status = #{status}, del_flag = #{delFlag}, create_by = #{createBy}, create_time = #{createTime}, diff --git a/vetti-hotakes/src/main/resources/mapper/hotake/HotakeRolesApplyOperRecordMapper.xml b/vetti-hotakes/src/main/resources/mapper/hotake/HotakeRolesApplyOperRecordMapper.xml index 08fcf3a..e0215c4 100644 --- a/vetti-hotakes/src/main/resources/mapper/hotake/HotakeRolesApplyOperRecordMapper.xml +++ b/vetti-hotakes/src/main/resources/mapper/hotake/HotakeRolesApplyOperRecordMapper.xml @@ -27,6 +27,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and role_id = #{roleId} and role_apply_id = #{roleApplyId} and apply_stage = #{applyStage} + + and role_apply_id in + + #{applyId} + + order by create_time ASC