feat(consultation): 添加根据ID查询会诊申请详情功能
- 在前端API文件中新增getConsultationById函数用于查询会诊详情
- 在后端服务接口中定义getConsultationById方法
- 在后端服务实现类中实现详细的会诊申请查询逻辑
- 在控制器中添加/detailed{id}接口支持会诊详情查询
- 添加参数验证和异常处理确保查询安全性
- 移除多余的日志输出信息优化代码整洁性
This commit is contained in:
@@ -149,6 +149,14 @@ public interface IConsultationAppService {
|
||||
* @return 会诊意见列表
|
||||
*/
|
||||
List<ConsultationOpinionDto> getConsultationOpinions(String consultationId);
|
||||
|
||||
/**
|
||||
* 根据ID查询会诊申请详情
|
||||
*
|
||||
* @param id 会诊申请ID
|
||||
* @return 会诊申请详情
|
||||
*/
|
||||
ConsultationRequestDto getConsultationById(Long id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -786,10 +786,6 @@ public class ConsultationAppServiceImpl implements IConsultationAppService {
|
||||
}
|
||||
}
|
||||
|
||||
log.info("填充会诊记录信息,已确认和已签名医生数:{},已签名医生数:{}",
|
||||
confirmedAndSignedPhysicians.size(), signedPhysicians.size());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1822,5 +1818,26 @@ public class ConsultationAppServiceImpl implements IConsultationAppService {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConsultationRequestDto getConsultationById(Long id) {
|
||||
try {
|
||||
if (id == null) {
|
||||
throw new IllegalArgumentException("会诊申请ID不能为空");
|
||||
}
|
||||
|
||||
// 1. 查询会诊申请
|
||||
ConsultationRequest request = consultationRequestMapper.selectById(id);
|
||||
if (request == null) {
|
||||
throw new IllegalArgumentException("会诊申请不存在,ID: " + id);
|
||||
}
|
||||
|
||||
// 2. 转换为DTO并返回
|
||||
return convertToDto(request);
|
||||
} catch (Exception e) {
|
||||
log.error("查询会诊申请详情失败", e);
|
||||
throw new RuntimeException("查询会诊申请详情失败: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -302,5 +302,21 @@ public class ConsultationController {
|
||||
return R.fail("获取会诊意见列表失败: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID查询会诊申请详情
|
||||
*/
|
||||
@ApiOperation("根据ID查询会诊申请详情")
|
||||
@GetMapping("/detail/{id}")
|
||||
public R<ConsultationRequestDto> getConsultationById(
|
||||
@ApiParam("会诊申请ID") @PathVariable Long id) {
|
||||
try {
|
||||
ConsultationRequestDto detail = consultationAppService.getConsultationById(id);
|
||||
return R.ok(detail);
|
||||
} catch (Exception e) {
|
||||
log.error("查询会诊申请详情失败", e);
|
||||
return R.fail("查询会诊申请详情失败: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -135,3 +135,14 @@ export function getConsultationOpinions(consultationId) {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID查询会诊申请详情
|
||||
* @param {Number} id 会诊申请ID
|
||||
*/
|
||||
export function getConsultationById(id) {
|
||||
return request({
|
||||
url: `/consultation/detail/${id}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user