添加 根据岗位ID批量查询投递记录

This commit is contained in:
zk
2026-04-30 11:02:59 +08:00
parent d05b51895a
commit 59fa37c681
3 changed files with 57 additions and 0 deletions
@@ -2,11 +2,13 @@ package org.jiayunet.controller;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.jiayunet.pojo.PageResult; import org.jiayunet.pojo.PageResult;
import org.jiayunet.pojo.dto.job.JobApplicationDto;
import org.jiayunet.pojo.dto.job.JobDetailDto; import org.jiayunet.pojo.dto.job.JobDetailDto;
import org.jiayunet.pojo.dto.job.JobDto; import org.jiayunet.pojo.dto.job.JobDto;
import org.jiayunet.pojo.dto.job.JobAgentRecommendDto; import org.jiayunet.pojo.dto.job.JobAgentRecommendDto;
import org.jiayunet.pojo.param.job.*; import org.jiayunet.pojo.param.job.*;
import org.jiayunet.pojo.vo.JobApplyCountVo; import org.jiayunet.pojo.vo.JobApplyCountVo;
import java.util.List;
import org.jiayunet.pojo.vo.JobFavoriteCountVo; import org.jiayunet.pojo.vo.JobFavoriteCountVo;
import org.jiayunet.service.JobService; import org.jiayunet.service.JobService;
import org.jiayunet.tool.UserSecurityTool; import org.jiayunet.tool.UserSecurityTool;
@@ -123,6 +125,15 @@ public class JobController {
jobService.deleteApplication(jobId, userId); jobService.deleteApplication(jobId, userId);
} }
/**
* 根据岗位ID批量查询投递记录
*/
@PostMapping("/apply/listByJobIds")
public List<JobApplicationDto> listApplicationsByJobIds(@RequestBody List<Long> jobIds) {
Long userId = UserSecurityTool.getUserId();
return jobService.listApplicationsByJobIds(jobIds, userId);
}
/** /**
* 收藏统计 * 收藏统计
*/ */
@@ -0,0 +1,26 @@
package org.jiayunet.pojo.dto.job;
import lombok.Data;
import java.time.Instant;
/**
* 投递记录出参
*
* @author zk
*/
@Data
public class JobApplicationDto {
/** 岗位ID */
private Long jobId;
/** 投递状态 -1=待投递 0=已投递 1=面试中 2=有Offer 3=未通过 4=已结束 */
private Integer status;
/** 投递时间 */
private Instant applyTime;
/** 创建时间 */
private Instant createTime;
}
@@ -12,6 +12,7 @@ import org.jiayunet.pojo.dto.job.JobDetailDto;
import org.jiayunet.pojo.dto.job.JobDto; import org.jiayunet.pojo.dto.job.JobDto;
import org.jiayunet.pojo.dto.job.JobMatchScoreDto; import org.jiayunet.pojo.dto.job.JobMatchScoreDto;
import org.jiayunet.pojo.dto.job.JobAgentRecommendDto; import org.jiayunet.pojo.dto.job.JobAgentRecommendDto;
import org.jiayunet.pojo.dto.job.JobApplicationDto;
import org.jiayunet.pojo.param.job.JobAgentRecommendParam; import org.jiayunet.pojo.param.job.JobAgentRecommendParam;
import org.jiayunet.pojo.param.job.JobAgentTaskQueryParam; import org.jiayunet.pojo.param.job.JobAgentTaskQueryParam;
import org.jiayunet.pojo.param.job.JobApplyQueryParam; import org.jiayunet.pojo.param.job.JobApplyQueryParam;
@@ -540,6 +541,25 @@ public class JobService {
userJobApplicationMapper.delete(new LambdaQueryWrapper<UserJobApplication>().eq(UserJobApplication::getUserId, userId).eq(UserJobApplication::getJobId, jobId)); userJobApplicationMapper.delete(new LambdaQueryWrapper<UserJobApplication>().eq(UserJobApplication::getUserId, userId).eq(UserJobApplication::getJobId, jobId));
} }
/**
* 根据岗位ID批量查询投递记录
* <p>1. 校验参数 2. 查询当前用户对指定岗位的投递记录 3. 转换为DTO返回</p>
*/
public List<JobApplicationDto> listApplicationsByJobIds(List<Long> jobIds, Long userId) {
if (jobIds == null || jobIds.isEmpty()) {
return Collections.emptyList();
}
List<UserJobApplication> applications = userJobApplicationMapper.selectList(new LambdaQueryWrapper<UserJobApplication>().eq(UserJobApplication::getUserId, userId).in(UserJobApplication::getJobId, jobIds));
return applications.stream().map(app -> {
JobApplicationDto dto = new JobApplicationDto();
dto.setJobId(app.getJobId());
dto.setStatus(app.getStatus());
dto.setApplyTime(app.getApplyTime());
dto.setCreateTime(app.getCreateTime());
return dto;
}).collect(Collectors.toList());
}
/** /**
* 收藏统计 * 收藏统计
* <p>方法逻辑流程:</p> * <p>方法逻辑流程:</p>