fix: 优化访客到达核验申请记录通知接口返回值和异常处理
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.example.mini_program.controller;
|
||||
|
||||
import com.example.mini_program.common.Result;
|
||||
import com.example.mini_program.service.VisitorApprovalService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -20,11 +21,21 @@ public class VisitorApprovalController {
|
||||
* 通知受访者访客已到达
|
||||
*
|
||||
* @param id 预约记录ID
|
||||
* @return 操作结果
|
||||
*/
|
||||
@GetMapping("/notify-host")
|
||||
public void notifyHostArrival(@RequestParam String id) {
|
||||
public Result<String> notifyHostArrival(@RequestParam String id) {
|
||||
log.info("通知受访者访客已到达, id={}", id);
|
||||
visitorApprovalService.notifyHostArrival(id);
|
||||
if (id == null || id.trim().isEmpty()) {
|
||||
return Result.error("预约记录ID不能为空");
|
||||
}
|
||||
try {
|
||||
visitorApprovalService.notifyHostArrival(id);
|
||||
return Result.success("通知发送成功");
|
||||
} catch (Exception e) {
|
||||
log.error("通知发送失败, id={}", id, e);
|
||||
return Result.error("通知发送失败: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -72,11 +72,12 @@ public interface VisitApplicationMapper {
|
||||
*/
|
||||
int updateStatus(@Param("id") String id, @Param("status") String status, @Param("statusText") String statusText);
|
||||
|
||||
|
||||
/**
|
||||
* 更新审批状态
|
||||
* 根据ID更新预约记录的核验状态
|
||||
*
|
||||
* @param id 记录ID
|
||||
* @return 影响行数
|
||||
* @param id 预约记录ID
|
||||
* @param checkStatus 核验状态
|
||||
*/
|
||||
void updateCheckStatusById(@Param("id") String id, @Param("checkStatus") String checkStatus);
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ public class VisitorApprovalService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 通知受访者访客已到达
|
||||
* 通知受访者访客已到达 核销记录
|
||||
* 根据预约ID查询企微用户ID,发送应用消息
|
||||
*
|
||||
* @param id 预约记录ID
|
||||
|
||||
Reference in New Issue
Block a user