diff --git a/client-api/src/main/java/org/jiayunet/controller/JobController.java b/client-api/src/main/java/org/jiayunet/controller/JobController.java index 05f0c4c..093f1f8 100644 --- a/client-api/src/main/java/org/jiayunet/controller/JobController.java +++ b/client-api/src/main/java/org/jiayunet/controller/JobController.java @@ -2,11 +2,13 @@ package org.jiayunet.controller; import lombok.AllArgsConstructor; 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.JobDto; import org.jiayunet.pojo.dto.job.JobAgentRecommendDto; import org.jiayunet.pojo.param.job.*; import org.jiayunet.pojo.vo.JobApplyCountVo; +import java.util.List; import org.jiayunet.pojo.vo.JobFavoriteCountVo; import org.jiayunet.service.JobService; import org.jiayunet.tool.UserSecurityTool; @@ -123,6 +125,15 @@ public class JobController { jobService.deleteApplication(jobId, userId); } + /** + * 根据岗位ID批量查询投递记录 + */ + @PostMapping("/apply/listByJobIds") + public List listApplicationsByJobIds(@RequestBody List jobIds) { + Long userId = UserSecurityTool.getUserId(); + return jobService.listApplicationsByJobIds(jobIds, userId); + } + /** * 收藏统计 */ diff --git a/client-api/src/main/java/org/jiayunet/pojo/dto/job/JobApplicationDto.java b/client-api/src/main/java/org/jiayunet/pojo/dto/job/JobApplicationDto.java new file mode 100644 index 0000000..5648cd0 --- /dev/null +++ b/client-api/src/main/java/org/jiayunet/pojo/dto/job/JobApplicationDto.java @@ -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; +} diff --git a/client-api/src/main/java/org/jiayunet/service/JobService.java b/client-api/src/main/java/org/jiayunet/service/JobService.java index 0fe167d..4457a5f 100644 --- a/client-api/src/main/java/org/jiayunet/service/JobService.java +++ b/client-api/src/main/java/org/jiayunet/service/JobService.java @@ -12,6 +12,7 @@ import org.jiayunet.pojo.dto.job.JobDetailDto; import org.jiayunet.pojo.dto.job.JobDto; import org.jiayunet.pojo.dto.job.JobMatchScoreDto; 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.JobAgentTaskQueryParam; import org.jiayunet.pojo.param.job.JobApplyQueryParam; @@ -540,6 +541,25 @@ public class JobService { userJobApplicationMapper.delete(new LambdaQueryWrapper().eq(UserJobApplication::getUserId, userId).eq(UserJobApplication::getJobId, jobId)); } + /** + * 根据岗位ID批量查询投递记录 + *

1. 校验参数 2. 查询当前用户对指定岗位的投递记录 3. 转换为DTO返回

+ */ + public List listApplicationsByJobIds(List jobIds, Long userId) { + if (jobIds == null || jobIds.isEmpty()) { + return Collections.emptyList(); + } + List applications = userJobApplicationMapper.selectList(new LambdaQueryWrapper().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()); + } + /** * 收藏统计 *

方法逻辑流程: