From 2ffbe733057a91967840098f6b8d9e8576ca414e Mon Sep 17 00:00:00 2001 From: chenqi Date: Mon, 30 Mar 2026 15:29:56 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat(consultation):=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=A0=B9=E6=8D=AEID=E6=9F=A5=E8=AF=A2=E4=BC=9A=E8=AF=8A?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E8=AF=A6=E6=83=85=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在前端API文件中新增getConsultationById函数用于查询会诊详情 - 在后端服务接口中定义getConsultationById方法 - 在后端服务实现类中实现详细的会诊申请查询逻辑 - 在控制器中添加/detailed{id}接口支持会诊详情查询 - 添加参数验证和异常处理确保查询安全性 - 移除多余的日志输出信息优化代码整洁性 --- .../appservice/IConsultationAppService.java | 8 ++++++ .../impl/ConsultationAppServiceImpl.java | 25 ++++++++++++++++--- .../controller/ConsultationController.java | 16 ++++++++++++ .../consultationapplication/api.js | 11 ++++++++ 4 files changed, 56 insertions(+), 4 deletions(-) diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/consultation/appservice/IConsultationAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/consultation/appservice/IConsultationAppService.java index 4c907756..1117e2d6 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/consultation/appservice/IConsultationAppService.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/consultation/appservice/IConsultationAppService.java @@ -149,6 +149,14 @@ public interface IConsultationAppService { * @return 会诊意见列表 */ List getConsultationOpinions(String consultationId); + + /** + * 根据ID查询会诊申请详情 + * + * @param id 会诊申请ID + * @return 会诊申请详情 + */ + ConsultationRequestDto getConsultationById(Long id); } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/consultation/appservice/impl/ConsultationAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/consultation/appservice/impl/ConsultationAppServiceImpl.java index 15632f7a..32004338 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/consultation/appservice/impl/ConsultationAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/consultation/appservice/impl/ConsultationAppServiceImpl.java @@ -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()); + } + } } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/consultation/controller/ConsultationController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/consultation/controller/ConsultationController.java index de2746f3..5e8672d0 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/consultation/controller/ConsultationController.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/consultation/controller/ConsultationController.java @@ -302,5 +302,21 @@ public class ConsultationController { return R.fail("获取会诊意见列表失败: " + e.getMessage()); } } + + /** + * 根据ID查询会诊申请详情 + */ + @ApiOperation("根据ID查询会诊申请详情") + @GetMapping("/detail/{id}") + public R 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()); + } + } } diff --git a/openhis-ui-vue3/src/views/consultationmanagement/consultationapplication/api.js b/openhis-ui-vue3/src/views/consultationmanagement/consultationapplication/api.js index e6b21b12..add1b16c 100644 --- a/openhis-ui-vue3/src/views/consultationmanagement/consultationapplication/api.js +++ b/openhis-ui-vue3/src/views/consultationmanagement/consultationapplication/api.js @@ -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' + }) +} + From 64b02466b183c6628c27b9c429a3a83e23b89385 Mon Sep 17 00:00:00 2001 From: chenqi Date: Mon, 30 Mar 2026 15:46:06 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat(consultation):=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E4=BC=9A=E8=AF=8AID=E6=9F=A5=E8=AF=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在前端表单中新增会诊ID输入框用于查询过滤 - 更新查询参数对象以包含consultationId字段 - 在后端服务中实现会诊ID的模糊匹配查询逻辑 - 将会诊ID查询条件集成到现有的查询构建器中 - 保持与其他查询条件的兼容性以支持组合筛选 --- .../impl/ConsultationAppServiceImpl.java | 10 ++++++++++ .../consultationapplication/index.vue | 15 +++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/consultation/appservice/impl/ConsultationAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/consultation/appservice/impl/ConsultationAppServiceImpl.java index 32004338..c0b4f143 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/consultation/appservice/impl/ConsultationAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/consultation/appservice/impl/ConsultationAppServiceImpl.java @@ -186,6 +186,11 @@ public class ConsultationAppServiceImpl implements IConsultationAppService { wrapper.like(ConsultationRequest::getPatientName, dto.getPatientName()); } + // 会诊ID查询(支持模糊匹配) + if (StringUtils.hasText(dto.getConsultationId())) { + wrapper.like(ConsultationRequest::getConsultationId, dto.getConsultationId()); + } + // 按创建时间倒序排列 wrapper.orderByDesc(ConsultationRequest::getConsultationRequestDate); @@ -240,6 +245,11 @@ public class ConsultationAppServiceImpl implements IConsultationAppService { wrapper.like(ConsultationRequest::getPatientName, dto.getPatientName()); } + // 会诊ID查询(支持模糊匹配) + if (StringUtils.hasText(dto.getConsultationId())) { + wrapper.like(ConsultationRequest::getConsultationId, dto.getConsultationId()); + } + // 按创建时间倒序排列 wrapper.orderByDesc(ConsultationRequest::getConsultationRequestDate); diff --git a/openhis-ui-vue3/src/views/consultationmanagement/consultationapplication/index.vue b/openhis-ui-vue3/src/views/consultationmanagement/consultationapplication/index.vue index 8e8489d5..613cd172 100644 --- a/openhis-ui-vue3/src/views/consultationmanagement/consultationapplication/index.vue +++ b/openhis-ui-vue3/src/views/consultationmanagement/consultationapplication/index.vue @@ -81,6 +81,15 @@ /> + + + + 查询 @@ -394,7 +403,8 @@ const queryParams = reactive({ applyDoctor: '', urgency: '', consultationStatus: '', - patientName: '' + patientName: '', + consultationId: '' }) // 会诊状态常量 @@ -702,7 +712,8 @@ const loadData = async () => { consultationStatus: queryParams.consultationStatus, patientName: queryParams.patientName, consultationRequestDate: queryParams.startTime, - consultationUrgency: queryParams.urgency + consultationUrgency: queryParams.urgency, + consultationId: queryParams.consultationId } const res = await queryConsultationListPage(queryData, pagination.currentPage, pagination.pageSize)