Skip to content

Commit 1f819c9

Browse files
authored
Merge pull request #105 from Boyuan-IT-Club/dhy
优化了一键分配面试时间地点的接口,使其能对应面试时段表中的时间自动分配 实现了修改录取结果的接口 新增了查看面试结果接口 新增了面试结果通知功能 新增了发送录取通知的功能(SMS留白) 新增了面试时间地点的增删改查 优化了application.yml文件以及docker-compose,创建了面试相关的实体类
2 parents d4b8f6c + 1c0c499 commit 1f819c9

18 files changed

+1906
-37
lines changed

mvnw

100644100755
File mode changed.

pom.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,13 @@
9797
<optional>true</optional>
9898
</dependency>
9999

100+
<!--swagger依赖-->
101+
<dependency>
102+
<groupId>org.springdoc</groupId>
103+
<artifactId>springdoc-openapi-ui</artifactId>
104+
<version>1.6.14</version>
105+
</dependency>
106+
100107
<dependency>
101108
<groupId>org.springframework.boot</groupId>
102109
<artifactId>spring-boot-starter-mail</artifactId>

src/main/java/club/boyuan/official/controller/InterviewResultController.java

Lines changed: 37 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
package club.boyuan.official.controller;
22

33

4-
import club.boyuan.official.dto.InterviewResultResponseDTO;
5-
import club.boyuan.official.dto.ResponseMessage;
6-
import club.boyuan.official.dto.SendNotificationsRequestDTO;
7-
import club.boyuan.official.dto.SendNotificationsResponseDTO;
4+
import club.boyuan.official.dto.*;
85
import club.boyuan.official.entity.InterviewResult;
96
import club.boyuan.official.service.IInterviewResultService;
107
import jakarta.validation.Valid;
@@ -29,14 +26,14 @@
2926
@RequiredArgsConstructor
3027
public class InterviewResultController {
3128

32-
private final IInterviewResultService IInterviewResultService;
29+
private final IInterviewResultService interviewResultService;
3330
@PostMapping("/send-notifications")
3431
public ResponseEntity<ResponseMessage<SendNotificationsResponseDTO>> sendNotifications(
3532
@Valid @RequestBody SendNotificationsRequestDTO requestDTO
3633
) {
3734
try {
3835
log.info("发送面试结果通知,通知类型{},结果id数量{}", requestDTO.getNotificationType(), requestDTO.getResultIds().size());
39-
SendNotificationsResponseDTO responseDTO = IInterviewResultService.sendNotifications(requestDTO);
36+
SendNotificationsResponseDTO responseDTO = interviewResultService.sendNotifications(requestDTO);
4037
return ResponseEntity.ok(ResponseMessage.success(responseDTO));
4138
} catch (Exception e) {
4239
log.error("发送面试结果通知失败", e);
@@ -46,23 +43,52 @@ public ResponseEntity<ResponseMessage<SendNotificationsResponseDTO>> sendNotific
4643
}
4744

4845
@GetMapping("/list")
49-
public ResponseEntity<ResponseMessage<List<InterviewResultResponseDTO>>> list(
46+
public ResponseEntity<ResponseMessage<InterviewResultResponseDTO>> list(
5047
@RequestParam Integer cycleId,
5148
@RequestParam(required = false) String name,
5249
@RequestParam(required = false) String decision,
5350
@RequestParam(required = false) String department,
54-
@RequestParam(required = false) Integer page,
55-
@RequestParam(required = false) Integer size
51+
@RequestParam(defaultValue = "1") Integer page,
52+
@RequestParam(defaultValue = "10") Integer size
5653
) {
5754
try {
5855
log.info("获取面试结果列表");
59-
List<InterviewResultResponseDTO> responseDTO = IInterviewResultService.list(cycleId, name, decision, department, page, size);
60-
return ResponseEntity.ok(ResponseMessage.success(responseDTO));
56+
InterviewResultResponseDTO responseDTO = interviewResultService.list(cycleId, name, decision, department, page, size);
57+
ResponseMessage<InterviewResultResponseDTO> response = ResponseMessage.success(responseDTO);
58+
return ResponseEntity.ok(response);
6159
} catch (Exception e) {
6260
log.error("获取面试结果列表失败", e);
6361
return ResponseEntity.badRequest()
6462
.body(ResponseMessage.error(400, "获取面试结果列表失败"));
6563
}
6664

6765
}
66+
67+
@PutMapping("/update/{resultId}")
68+
public ResponseEntity<ResponseMessage<InterviewResult>> update(@PathVariable Integer resultId,
69+
@Valid @RequestBody InterviewResultSaveDTO interviewResult) {
70+
try {
71+
log.info("更新面试结果");
72+
InterviewResult result = interviewResultService.update(resultId, interviewResult);
73+
return ResponseEntity.ok(ResponseMessage.success(result));
74+
} catch (Exception e) {
75+
log.error("更新面试结果失败", e);
76+
return ResponseEntity.badRequest()
77+
.body(ResponseMessage.error(400, "更新面试结果失败"));
78+
}
79+
}
80+
81+
//根据resultId获取面试结果
82+
@GetMapping("/get/{resultId}")
83+
public ResponseEntity<ResponseMessage<InterviewResult>> get(@PathVariable Integer resultId) {
84+
try {
85+
log.info("获取面试结果");
86+
InterviewResult result = interviewResultService.getById(resultId);
87+
return ResponseEntity.ok(ResponseMessage.success(result));
88+
} catch (Exception e) {
89+
log.error("获取面试结果失败", e);
90+
return ResponseEntity.badRequest()
91+
.body(ResponseMessage.error(400, "获取面试结果失败"));
92+
}
93+
}
6894
}
Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
package club.boyuan.official.controller;
22

3-
4-
import org.springframework.web.bind.annotation.RequestMapping;
5-
6-
import org.springframework.web.bind.annotation.RestController;
3+
import club.boyuan.official.dto.AutoAssignInterviewResponseDTO;
4+
import club.boyuan.official.dto.ResponseMessage;
5+
import club.boyuan.official.service.IInterviewScheduleService;
6+
import jakarta.validation.Valid;
7+
import lombok.AllArgsConstructor;
8+
import lombok.extern.slf4j.Slf4j;
9+
import org.springframework.http.ResponseEntity;
10+
import org.springframework.security.access.prepost.PreAuthorize;
11+
import org.springframework.web.bind.annotation.*;
712

813
/**
914
* <p>
@@ -13,8 +18,33 @@
1318
* @author dhy
1419
* @since 2026-01-28
1520
*/
21+
@Slf4j
1622
@RestController
17-
@RequestMapping("/interview-schedule")
23+
@RequestMapping("/api/interview/schedule")
24+
@AllArgsConstructor
1825
public class InterviewScheduleController {
1926

20-
}
27+
private final IInterviewScheduleService interviewScheduleService;
28+
29+
/**
30+
* 一键分配面试成员面试时间地点(按招募周期)- 路径参数版本
31+
*
32+
* @param cycleId 招募周期ID
33+
* @return 分配结果
34+
*/
35+
@PostMapping("/auto-assign/{cycleId}")
36+
@PreAuthorize("hasAuthority(('resume:audit'))")
37+
public ResponseEntity<ResponseMessage<AutoAssignInterviewResponseDTO>> autoAssignInterviewsByCycleId(
38+
@PathVariable Integer cycleId) {
39+
try {
40+
log.info("开始一键分配面试,招募周期ID: {}", cycleId);
41+
AutoAssignInterviewResponseDTO result = interviewScheduleService.autoAssignInterviews(cycleId);
42+
log.info("一键分配面试完成,已分配 {} 人", result.getAssignedCount());
43+
return ResponseEntity.ok(ResponseMessage.success(result));
44+
} catch (Exception e) {
45+
log.error("一键分配面试失败,招募周期ID: {}", cycleId, e);
46+
return ResponseEntity.badRequest()
47+
.body(ResponseMessage.error(400, "分配失败: " + e.getMessage()));
48+
}
49+
}
50+
}

src/main/java/club/boyuan/official/dto/InterviewResultResponseDTO.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77

88
@Data
99
public class InterviewResultResponseDTO {
10+
private Long total;
1011
private List<InterviewResult> interviewResults;
11-
private Integer total;
1212
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package club.boyuan.official.dto;
2+
3+
import lombok.Data;
4+
5+
@Data
6+
public class InterviewResultSaveDTO {
7+
private Integer decision;
8+
private Integer assignedDeptId;
9+
private Integer decisionBy;
10+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package club.boyuan.official.dto;
2+
3+
import lombok.AllArgsConstructor;
4+
import lombok.Data;
5+
import lombok.NoArgsConstructor;
6+
7+
import java.time.LocalDate;
8+
import java.time.LocalTime;
9+
10+
@Data
11+
@AllArgsConstructor
12+
@NoArgsConstructor
13+
public class SlotTimeDTO {
14+
private LocalDate date;
15+
private LocalTime startTime;
16+
private LocalTime endTime;
17+
18+
}

src/main/java/club/boyuan/official/mapper/InterviewResultMapper.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import club.boyuan.official.entity.InterviewResult;
44
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5+
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
56

67
/**
78
* <p>
@@ -13,4 +14,5 @@
1314
*/
1415
public interface InterviewResultMapper extends BaseMapper<InterviewResult> {
1516

17+
Page<InterviewResult> selectResultPage(Page<InterviewResult> pageInfo, Integer cycleId, String name, String decision, String department);
1618
}

src/main/java/club/boyuan/official/service/IInterviewResultService.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package club.boyuan.official.service;
22

33
import club.boyuan.official.dto.InterviewResultResponseDTO;
4+
import club.boyuan.official.dto.InterviewResultSaveDTO;
45
import club.boyuan.official.dto.SendNotificationsRequestDTO;
56
import club.boyuan.official.dto.SendNotificationsResponseDTO;
67
import club.boyuan.official.entity.InterviewResult;
@@ -21,5 +22,7 @@ public interface IInterviewResultService extends IService<InterviewResult> {
2122

2223
SendNotificationsResponseDTO sendNotifications(@Valid SendNotificationsRequestDTO requestDTO);
2324

24-
List<InterviewResultResponseDTO> list(Integer cycleId, String name, String decision, String department, Integer page, Integer size);
25+
InterviewResultResponseDTO list(Integer cycleId, String name, String decision, String department, Integer page, Integer size);
26+
27+
InterviewResult update(Integer resultId, @Valid InterviewResultSaveDTO interviewResult);
2528
}

src/main/java/club/boyuan/official/service/IInterviewScheduleService.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package club.boyuan.official.service;
22

3+
import club.boyuan.official.dto.AutoAssignInterviewResponseDTO;
34
import club.boyuan.official.entity.InterviewSchedule;
45
import com.baomidou.mybatisplus.extension.service.IService;
56

@@ -13,4 +14,11 @@
1314
*/
1415
public interface IInterviewScheduleService extends IService<InterviewSchedule> {
1516

17+
/**
18+
* 一键分配面试成员面试时间地点(按招募周期)
19+
*
20+
* @param cycleId 分配请求参数
21+
* @return 分配结果
22+
*/
23+
AutoAssignInterviewResponseDTO autoAssignInterviews(Integer cycleId);
1624
}

0 commit comments

Comments
 (0)