增加根据id获取预约信息接口
This commit is contained in:
@@ -2,8 +2,10 @@ package com.example.mini_program.service;
|
||||
|
||||
import com.example.mini_program.entity.VisitApplication;
|
||||
import com.example.mini_program.mapper.VisitApplicationMapper;
|
||||
import com.example.mini_program.vo.VisitApplicationVo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -103,7 +105,6 @@ public class AppointmentService {
|
||||
log.warn("预约状态不允许取消, id: {}, status: {}", id, existing.getStatus());
|
||||
return false;
|
||||
}
|
||||
|
||||
int rows = visitApplicationMapper.updateStatusToCancelled(id, openid);
|
||||
if (rows > 0) {
|
||||
log.info("取消预约成功, id: {}", id);
|
||||
@@ -113,6 +114,20 @@ public class AppointmentService {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 预约详情
|
||||
*/
|
||||
public VisitApplicationVo detail(String id, String openid) throws Exception {
|
||||
log.info("预约详情, id: {}, openid: {}", id, openid);
|
||||
VisitApplication existing = visitApplicationMapper.selectByIdAndOpenid(id, openid);
|
||||
if (existing == null) {
|
||||
throw new Exception("未查询到该用户的访客预约记录");
|
||||
}
|
||||
VisitApplicationVo visitApplicationVo = new VisitApplicationVo();
|
||||
BeanUtils.copyProperties(visitApplicationVo, existing);
|
||||
return visitApplicationVo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 审批预约(通过/拒绝)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user