From 59fa37c6818630d0a44937ecedfd456540c992cd Mon Sep 17 00:00:00 2001 From: zk Date: Thu, 30 Apr 2026 11:02:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E5=B2=97=E4=BD=8DID=E6=89=B9=E9=87=8F=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=8A=95=E9=80=92=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jiayunet/controller/JobController.java | 11 ++++++++ .../pojo/dto/job/JobApplicationDto.java | 26 +++++++++++++++++++ .../java/org/jiayunet/service/JobService.java | 20 ++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 client-api/src/main/java/org/jiayunet/pojo/dto/job/JobApplicationDto.java 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()); + } + /** * 收藏统计 *

方法逻辑流程: