Compare commits
64 Commits
fa2884b320
...
test
| Author | SHA1 | Date | |
|---|---|---|---|
| 700e353b79 | |||
| 0b2c19d2c5 | |||
| 47394de43c | |||
| f0f1dde6b6 | |||
| 1ab1165697 | |||
| a8f1b1fdfa | |||
| 3b94d19199 | |||
| db1139a14f | |||
|
|
bea74aeac2 | ||
|
|
634a1f45f9 | ||
| 8f1ad3307c | |||
| d8080fa22d | |||
|
|
e8783d9f8f | ||
| d8c4348341 | |||
|
|
8e61490005 | ||
| f5f4e3c48e | |||
| 0f013715b8 | |||
| fb9722d328 | |||
| 6f9192d30d | |||
| f2b5b90f34 | |||
| a2cbd5e583 | |||
| d3df46858b | |||
| 47a7a945bc | |||
| 0a56c0dcf0 | |||
| 15d32134e2 | |||
| eff98ea5eb | |||
| a47306825a | |||
|
|
9b35fec931 | ||
| e20e2b637f | |||
| ebd2e8aa75 | |||
| cb268fe26d | |||
| 23bd49d940 | |||
| 32adb984e2 | |||
| c1d453600b | |||
| 02eab2d932 | |||
| d5c8b7a1ad | |||
|
|
4053064a22 | ||
|
|
089e28f913 | ||
| cf9ab03b17 | |||
| d332650bfa | |||
| 840983ac94 | |||
|
|
86673d7be3 | ||
|
|
3753a916f5 | ||
|
|
0556f77870 | ||
|
|
b185c156ca | ||
|
|
a48308dcbf | ||
| e37f6a70f9 | |||
|
|
28629ccd35 | ||
|
|
fbd7f0be78 | ||
|
|
763f05da84 | ||
|
|
8c74d45332 | ||
| 8d62c0461b | |||
| 58936c957d | |||
| 062c4a92b8 | |||
| fb9f85e967 | |||
| 38ef377cbd | |||
| 240d5dc3f7 | |||
| 82702f16e0 | |||
| 0b4b63dfbe | |||
| b4422a0dca | |||
| d8627df2dd | |||
| 09ca077559 | |||
| 3091fc7337 | |||
| b0850257c8 |
26
.trae/documents/plan_20251231_062502.md
Normal file
26
.trae/documents/plan_20251231_062502.md
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
# 修复门诊预约界面专家号查询结果显示问题
|
||||||
|
|
||||||
|
## 问题分析
|
||||||
|
1. 前端传递的参数正确:`type=expert`,后端正确转换为`ticketType=专家`
|
||||||
|
2. 实际查询返回了5条记录,但COUNT查询只返回了1条记录
|
||||||
|
3. 这导致前端只显示了1条记录,而不是全部5条
|
||||||
|
4. 原因:MyBatis-Plus自动生成的COUNT查询和实际查询使用了不同的条件,特别是逻辑删除条件
|
||||||
|
|
||||||
|
## 解决方案
|
||||||
|
1. 修改TicketMapper.xml中的自定义COUNT查询,显式添加`delete_flag = '0'`条件
|
||||||
|
2. 在selectTicketPage和selectTicketPage_mpCount查询中都添加逻辑删除条件
|
||||||
|
3. 确保两个查询使用完全相同的WHERE条件
|
||||||
|
|
||||||
|
## 修复步骤
|
||||||
|
1. 修改`selectTicketPage`查询,添加逻辑删除条件`and delete_flag = '0'`
|
||||||
|
2. 修改`selectTicketPage_mpCount`查询,添加逻辑删除条件`and delete_flag = '0'`
|
||||||
|
3. 确保两个查询的WHERE条件完全一致
|
||||||
|
4. 测试修复后的功能,确保专家号能正确显示全部5条记录
|
||||||
|
|
||||||
|
## 代码修改点
|
||||||
|
- 文件:`d:/work/openhis-server-new/openhis-domain/src/main/resources/mapper/clinical/TicketMapper.xml`
|
||||||
|
- 查询:`selectTicketPage` 和 `selectTicketPage_mpCount`
|
||||||
|
- 修改内容:添加逻辑删除条件`and delete_flag = '0'`
|
||||||
|
|
||||||
|
## 预期效果
|
||||||
|
修复后,COUNT查询和实际查询将使用完全相同的条件,包括逻辑删除条件,从而确保COUNT查询返回正确的总记录数,前端能显示所有5条专家号记录。
|
||||||
30
.trae/documents/plan_20251231_063300.md
Normal file
30
.trae/documents/plan_20251231_063300.md
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
# 修复门诊预约界面专家号查询COUNT结果不正确问题
|
||||||
|
|
||||||
|
## 问题分析
|
||||||
|
1. 前端传递的参数正确:`type=expert`,后端正确转换为`ticketType=专家`
|
||||||
|
2. COUNT查询和实际查询的WHERE条件完全相同:`WHERE delete_flag = '0' AND ticket_type = '专家'`
|
||||||
|
3. 但COUNT查询只返回1条记录,而实际查询返回5条记录
|
||||||
|
4. 原因:MyBatis-Plus的分页插件在处理自定义COUNT查询时,存在bug,导致COUNT查询结果不正确
|
||||||
|
|
||||||
|
## 解决方案
|
||||||
|
修改`TicketAppServiceImpl.java`中的`listTicket`方法,不使用MyBatis-Plus的自动分页功能,而是手动实现分页查询:
|
||||||
|
1. 直接调用`ticketService.countTickets`方法获取总记录数
|
||||||
|
2. 手动构建查询条件
|
||||||
|
3. 确保COUNT查询和实际查询使用完全相同的条件
|
||||||
|
|
||||||
|
## 修复步骤
|
||||||
|
1. 修改`TicketAppServiceImpl.java`中的`listTicket`方法
|
||||||
|
2. 手动实现分页查询,包括:
|
||||||
|
- 构建查询条件
|
||||||
|
- 调用`countTickets`获取总记录数
|
||||||
|
- 调用`selectTicketList`获取分页数据
|
||||||
|
- 手动组装分页结果
|
||||||
|
3. 测试修复后的功能,确保专家号能正确显示全部5条记录
|
||||||
|
|
||||||
|
## 代码修改点
|
||||||
|
- 文件:`d:/work/openhis-server-new/openhis-application/src/main/java/com/openhis/web/appointmentmanage/appservice/impl/TicketAppServiceImpl.java`
|
||||||
|
- 方法:`listTicket`
|
||||||
|
- 修改内容:替换MyBatis-Plus的自动分页,改为手动分页实现
|
||||||
|
|
||||||
|
## 预期效果
|
||||||
|
修复后,COUNT查询和实际查询将使用完全相同的条件,COUNT查询将返回正确的总记录数(5条),前端能显示所有5条专家号记录。
|
||||||
32
.trae/documents/修复号源列表显示问题.md
Normal file
32
.trae/documents/修复号源列表显示问题.md
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
## 问题分析
|
||||||
|
根据日志和代码分析,发现号源列表显示"没有更多数据了"的问题原因:
|
||||||
|
|
||||||
|
1. **后端查询正常**:成功查询到5条符合条件的专家号源记录
|
||||||
|
2. **数据转换失败**:在`convertToDto`方法中,`fee`字段类型转换错误
|
||||||
|
3. **响应返回空列表**:由于转换异常,最终返回给前端的号源列表为空
|
||||||
|
|
||||||
|
## 问题根源
|
||||||
|
- `Ticket`实体类的`fee`字段为**BigDecimal类型**(数据库存储)
|
||||||
|
- `TicketDto`类的`fee`字段为**String类型**(前端展示)
|
||||||
|
- 在`convertToDto`方法中,直接将BigDecimal类型的`fee`赋值给String类型的`fee`,导致**ClassCastException**
|
||||||
|
|
||||||
|
## 修复方案
|
||||||
|
修改`TicketAppServiceImpl.java`文件中的`convertToDto`方法,将BigDecimal类型的`fee`转换为String类型:
|
||||||
|
|
||||||
|
```java
|
||||||
|
// 原代码
|
||||||
|
dto.setFee(ticket.getFee());
|
||||||
|
|
||||||
|
// 修复后代码
|
||||||
|
dto.setFee(ticket.getFee().toString());
|
||||||
|
```
|
||||||
|
|
||||||
|
## 预期效果
|
||||||
|
1. 修复后,后端能成功将`Ticket`实体转换为`TicketDto`
|
||||||
|
2. 前端能接收到包含5条专家号源的完整列表
|
||||||
|
3. 页面显示正常,不再出现"没有更多数据了"的提示
|
||||||
|
|
||||||
|
## 验证方法
|
||||||
|
1. 重新启动项目,访问号源管理页面
|
||||||
|
2. 选择"专家号"类型,查看是否能正确显示5条号源记录
|
||||||
|
3. 检查日志,确认没有类型转换异常
|
||||||
23
.trae/documents/修复门诊预约界面专家号查询问题.md
Normal file
23
.trae/documents/修复门诊预约界面专家号查询问题.md
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
# 修复门诊预约界面专家号查询问题
|
||||||
|
|
||||||
|
## 问题分析
|
||||||
|
从日志中发现关键问题:
|
||||||
|
- 前端传递的ticket_type值是英文:`general` (普通号) 和 `expert` (专家号)
|
||||||
|
- 数据库中存储的ticket_type值是中文:`普通` 和 `专家`
|
||||||
|
- 导致查询条件不匹配,无法查询到数据
|
||||||
|
|
||||||
|
## 解决方案
|
||||||
|
需要在后端添加类型映射转换,将前端传递的英文类型转换为数据库中存储的中文类型。
|
||||||
|
|
||||||
|
## 修复步骤
|
||||||
|
1. 修改 `TicketAppServiceImpl.java` 文件,在处理type参数时添加映射转换逻辑
|
||||||
|
2. 添加从英文类型到中文类型的映射关系
|
||||||
|
3. 测试修复后的功能,确保普通号和专家号都能正确查询
|
||||||
|
|
||||||
|
## 代码修改点
|
||||||
|
- 文件:`d:/work/openhis-server-new/openhis-application/src/main/java/com/openhis/web/appointmentmanage/appservice/impl/TicketAppServiceImpl.java`
|
||||||
|
- 方法:`listTicket` 中的type参数处理部分
|
||||||
|
- 修改内容:添加类型映射转换,将 "general" 转换为 "普通","expert" 转换为 "专家"
|
||||||
|
|
||||||
|
## 预期效果
|
||||||
|
修复后,前端选择"普通号"或"专家号"时,系统能正确查询到对应的号源数据,不再出现"没有更多数据了"的提示。
|
||||||
23
.trae/documents/修复门诊预约界面只显示1条数据的问题.md
Normal file
23
.trae/documents/修复门诊预约界面只显示1条数据的问题.md
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
**问题分析**:
|
||||||
|
后端返回的响应格式是`{code: 200, msg: "操作成功", data: {total: 5, limit: 20, page: 1, list: [5条记录]}}`,而前端可能期望直接访问`list`属性,导致只能显示1条数据。
|
||||||
|
|
||||||
|
**修复方案**:
|
||||||
|
|
||||||
|
1. 修改`TicketAppServiceImpl.java`的`listTicket`方法,确保返回的分页数据格式正确
|
||||||
|
2. 调整响应结构,使其更符合前端期望
|
||||||
|
3. 保持与现有代码的兼容性
|
||||||
|
|
||||||
|
**修改点**:
|
||||||
|
|
||||||
|
* `TicketAppServiceImpl.java`:优化`listTicket`方法的响应格式
|
||||||
|
|
||||||
|
* 确保分页信息和列表数据都能正确返回给前端
|
||||||
|
|
||||||
|
**预期效果**:
|
||||||
|
|
||||||
|
* 后端返回正确格式的响应数据
|
||||||
|
|
||||||
|
* 前端能够正确显示所有5条专家号数据
|
||||||
|
|
||||||
|
* 保持与现有代码的兼容性
|
||||||
|
|
||||||
68
README.md
68
README.md
@@ -1,68 +0,0 @@
|
|||||||
# 平台介绍
|
|
||||||
|
|
||||||
## 🏠【关于我们】
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
天天开源致⼒于打造中国应⽤管理 软件开源⽣态,⾯向医疗、企业、教育三⼤⾏业信息化需求,提供优质的开源软件产品与解决⽅案。平台现已发布OpenHIS、OpenCOM、OpenEDU系列开源产品,并持续招募⽣态合作伙伴,期待共同构建开源创新的⾏业协作模式,加速⾏业的数字化进程。
|
|
||||||
|
|
||||||
天天开源的前⾝是新致开源,最早于2022年6⽉发布开源医疗软件平台OpenHIS.org.cn,于2023年6⽉发布开源企业软件平台OpenCOM.com.cn。2025年7⽉,新致开源品牌更新为天天开源,我们始终秉持开源、专业、协作的理念,致⼒于为医疗、教育、中⼩企业等⾏业提供优质的开源解决⽅案。
|
|
||||||
|
|
||||||
了解我们a:https://open.tntlinking.com/about?site=gitee
|
|
||||||
|
|
||||||
## 💾【部署包下载】
|
|
||||||
|
|
||||||
请访问官网产品中心下载部署包:https://open.tntlinking.com/resource/productCenter?site=gitee
|
|
||||||
|
|
||||||
## 📚【支持文档】
|
|
||||||
|
|
||||||
技术支持资源:https://open.tntlinking.com/resource/openProductDoc?site=gitee
|
|
||||||
(含演示环境、操作手册、部署手册、开发手册、常见问题等)
|
|
||||||
|
|
||||||
产品介绍:https://open.tntlinking.com/resource/productPresentation?site=gitee
|
|
||||||
|
|
||||||
操作教程:https://open.tntlinking.com/resource/operationTutorial?site=gitee
|
|
||||||
|
|
||||||
沙龙回顾:https://open.tntlinking.com/resource/openSourceSalon#23?site=gitee
|
|
||||||
|
|
||||||
## 🤝【合作方式】
|
|
||||||
|
|
||||||
产品服务价格:https://open.tntlinking.com/cost?site=gitee
|
|
||||||
|
|
||||||
加入生态伙伴:https://open.tntlinking.com/ecology/becomePartner?site=gitee
|
|
||||||
|
|
||||||
## 🤗【技术社区】
|
|
||||||
|
|
||||||
请访问官网扫码加入技术社区交流:https://open.tntlinking.com/ecology/joinCommunity?site=gitee
|
|
||||||
|
|
||||||
请关注公众号【天天开源软件】以便获得最新产品更新信息。
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# 项目介绍
|
|
||||||
|
|
||||||
OpenHIS医院系统(信创版)集十大核心模块于一体,涵盖目录管理、基础数据配置、个性化设置、门诊/住院全流程管理、药房药库智能管控、精细化耗材管理、财务核算体系、医保合规对接及多维报表分析等功能模块,共计372项标准化功能。
|
|
||||||
|
|
||||||
系统深度适配民营及公立一二级医院业务场景,支持单体医院、集团化运营及区域医疗协同等多种部署模式,并通过国家信创认证体系,确保全栈技术自主可控。如有项目需求,可联系官方平台合作。
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## 运行环境
|
|
||||||
|
|
||||||
jdk17 (必须)
|
|
||||||
node.js-v16.15 (推荐)
|
|
||||||
PostgreSQL-v16.2 (必须)
|
|
||||||
redis (常用稳定版本即可)
|
|
||||||
|
|
||||||
## 开发提示
|
|
||||||
|
|
||||||
需要修改数据库和redis的连接信息,详见:
|
|
||||||
application.yml
|
|
||||||
application-druid.yml
|
|
||||||
|
|
||||||
## 目录解释
|
|
||||||
|
|
||||||
前端: openhis-ui-vue3
|
|
||||||
后端: openhis-server
|
|
||||||
启动类: OpenHisApplication
|
|
||||||
|
|
||||||
104
check_display_order.sql
Normal file
104
check_display_order.sql
Normal file
@@ -0,0 +1,104 @@
|
|||||||
|
-- 检查流水号(display_order)是否按“科室+医生+当天”正确递增
|
||||||
|
--
|
||||||
|
-- 说明:
|
||||||
|
-- 1. display_order 存的是纯数字(1, 2, 3...),不带时间戳前缀
|
||||||
|
-- 2. 时间戳前缀(如 20260109)是在前端显示时加上的
|
||||||
|
-- 3. 后端用 Redis key "ORG-{科室ID}-DOC-{医生ID}" 按天自增
|
||||||
|
--
|
||||||
|
-- 如何判断逻辑是否正确:
|
||||||
|
-- 同一科室、同一医生、同一天的记录,display_order 应该递增(1, 2, 3...)
|
||||||
|
-- 不同科室、不同医生、不同天的记录,可能都是 1(这是正常的)
|
||||||
|
|
||||||
|
-- ========================================
|
||||||
|
-- 查询1:按“科室+医生+日期”分组,看每组内的 display_order 是否递增
|
||||||
|
-- ========================================
|
||||||
|
SELECT
|
||||||
|
DATE(start_time) AS 日期,
|
||||||
|
organization_id AS 科室ID,
|
||||||
|
registrar_id AS 医生ID,
|
||||||
|
COUNT(*) AS 该组记录数,
|
||||||
|
MIN(display_order) AS 最小序号,
|
||||||
|
MAX(display_order) AS 最大序号,
|
||||||
|
STRING_AGG(display_order::text, ', ' ORDER BY start_time) AS 序号列表,
|
||||||
|
STRING_AGG(id::text, ', ' ORDER BY start_time) AS 记录ID列表
|
||||||
|
FROM adm_encounter
|
||||||
|
WHERE delete_flag = '0'
|
||||||
|
AND start_time >= CURRENT_DATE - INTERVAL '7 days' -- 只看最近7天
|
||||||
|
AND display_order IS NOT NULL
|
||||||
|
GROUP BY DATE(start_time), organization_id, registrar_id
|
||||||
|
ORDER BY 日期 DESC, 科室ID, 医生ID;
|
||||||
|
|
||||||
|
-- ========================================
|
||||||
|
-- 查询2:详细查看每条记录,看同组内的序号是否连续
|
||||||
|
-- ========================================
|
||||||
|
SELECT
|
||||||
|
id AS 记录ID,
|
||||||
|
DATE(start_time) AS 日期,
|
||||||
|
organization_id AS 科室ID,
|
||||||
|
registrar_id AS 医生ID,
|
||||||
|
start_time AS 挂号时间,
|
||||||
|
display_order AS 流水号,
|
||||||
|
-- 计算:同组内的序号应该是 1, 2, 3...,看是否有重复或跳号
|
||||||
|
ROW_NUMBER() OVER (
|
||||||
|
PARTITION BY DATE(start_time), organization_id, registrar_id
|
||||||
|
ORDER BY start_time
|
||||||
|
) AS 应该是第几个,
|
||||||
|
CASE
|
||||||
|
WHEN display_order = ROW_NUMBER() OVER (
|
||||||
|
PARTITION BY DATE(start_time), organization_id, registrar_id
|
||||||
|
ORDER BY start_time
|
||||||
|
) THEN '✓ 正常'
|
||||||
|
ELSE '✗ 异常'
|
||||||
|
END AS 是否正常
|
||||||
|
FROM adm_encounter
|
||||||
|
WHERE delete_flag = '0'
|
||||||
|
AND start_time >= CURRENT_DATE - INTERVAL '7 days'
|
||||||
|
AND display_order IS NOT NULL
|
||||||
|
ORDER BY DATE(start_time) DESC, organization_id, registrar_id, start_time;
|
||||||
|
|
||||||
|
-- ========================================
|
||||||
|
-- 查询3:只看今天的数据(最直观)
|
||||||
|
-- ========================================
|
||||||
|
SELECT
|
||||||
|
id AS 记录ID,
|
||||||
|
organization_id AS 科室ID,
|
||||||
|
registrar_id AS 医生ID,
|
||||||
|
start_time AS 挂号时间,
|
||||||
|
display_order AS 流水号
|
||||||
|
FROM adm_encounter
|
||||||
|
WHERE delete_flag = '0'
|
||||||
|
AND DATE(start_time) = CURRENT_DATE
|
||||||
|
AND display_order IS NOT NULL
|
||||||
|
ORDER BY organization_id, registrar_id, start_time;
|
||||||
|
|
||||||
|
-- ========================================
|
||||||
|
-- 查询4:发现问题 - 找出同组内 display_order 重复的记录
|
||||||
|
-- ========================================
|
||||||
|
WITH ranked AS (
|
||||||
|
SELECT
|
||||||
|
id,
|
||||||
|
DATE(start_time) AS reg_date,
|
||||||
|
organization_id,
|
||||||
|
registrar_id,
|
||||||
|
start_time,
|
||||||
|
display_order,
|
||||||
|
ROW_NUMBER() OVER (
|
||||||
|
PARTITION BY DATE(start_time), organization_id, registrar_id
|
||||||
|
ORDER BY start_time
|
||||||
|
) AS should_be_order
|
||||||
|
FROM adm_encounter
|
||||||
|
WHERE delete_flag = '0'
|
||||||
|
AND start_time >= CURRENT_DATE - INTERVAL '7 days'
|
||||||
|
AND display_order IS NOT NULL
|
||||||
|
)
|
||||||
|
SELECT
|
||||||
|
reg_date AS 日期,
|
||||||
|
organization_id AS 科室ID,
|
||||||
|
registrar_id AS 医生ID,
|
||||||
|
COUNT(*) AS 重复数量,
|
||||||
|
STRING_AGG(id::text || '->' || display_order::text, ', ') AS 问题记录
|
||||||
|
FROM ranked
|
||||||
|
WHERE display_order != should_be_order
|
||||||
|
GROUP BY reg_date, organization_id, registrar_id
|
||||||
|
ORDER BY reg_date DESC;
|
||||||
|
|
||||||
10
md/test.html
Normal file
10
md/test.html
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>测试合并11111</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
287
md/需求/94-手术室维护界面_2026-1-9.md
Normal file
287
md/需求/94-手术室维护界面_2026-1-9.md
Normal file
@@ -0,0 +1,287 @@
|
|||||||
|
## 手术室维护界面PRD文档
|
||||||
|
|
||||||
|
### 一、页面概述
|
||||||
|
|
||||||
|
**页面名称**:手术室维护界面
|
||||||
|
**页面目标**:提供手术室基础数据的维护功能,包括新增、编辑、启用/停用手术室信息,为手术安排提供基础数据支持
|
||||||
|
**适用场景**:医院管理员需要新增、修改、启用/停用手术室信息时使用
|
||||||
|
**页面类型**:列表页+表单页(含模态框)
|
||||||
|
|
||||||
|
**原型图地址:**https://static.pm-ai.cn/prototype/20260104/ee5d222231effefcb39624d1646a2e20/index.html
|
||||||
|
|
||||||
|
**核心功能**:
|
||||||
|
|
||||||
|
1. 手术室列表展示与查询
|
||||||
|
2. 新增手术室信息
|
||||||
|
3. 编辑现有手术室信息
|
||||||
|
4. 启用/停用手术室状态
|
||||||
|
5. 数据有效性校验
|
||||||
|
|
||||||
|
**用户价值**:
|
||||||
|
|
||||||
|
- 管理员可集中管理所有手术室基础信息
|
||||||
|
- 确保手术安排时能获取准确的手术室数据
|
||||||
|
- 通过状态管理控制手术室可用性
|
||||||
|
|
||||||
|
**流程图:**
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
flowchart TD
|
||||||
|
A[手术室维护界面] --> B[手术室列表展示]
|
||||||
|
|
||||||
|
B --> C[新增手术室]
|
||||||
|
|
||||||
|
B --> D[编辑手术室]
|
||||||
|
|
||||||
|
B --> E[启用/停用手术室]
|
||||||
|
|
||||||
|
B --> F[查询手术室]
|
||||||
|
|
||||||
|
C --> G[点击新增按钮]
|
||||||
|
|
||||||
|
G --> H[打开新增模态框]
|
||||||
|
|
||||||
|
H --> I[填写表单字段]
|
||||||
|
|
||||||
|
I --> J{必填字段校验}
|
||||||
|
|
||||||
|
J -->|通过| K[提交数据]
|
||||||
|
|
||||||
|
J -->|不通过| L[提示请填写所有必填项]
|
||||||
|
|
||||||
|
K --> M[表格新增数据行]
|
||||||
|
|
||||||
|
D --> N[点击修改按钮]
|
||||||
|
|
||||||
|
N --> O[打开编辑模态框]
|
||||||
|
|
||||||
|
O --> P[修改表单字段]
|
||||||
|
|
||||||
|
P --> Q{必填字段校验}
|
||||||
|
|
||||||
|
Q -->|通过| R[保存数据]
|
||||||
|
|
||||||
|
Q -->|不通过| S[提示请填写所有必填项]
|
||||||
|
|
||||||
|
R --> T[更新表格对应行]
|
||||||
|
|
||||||
|
E --> U[点击启用/停用按钮]
|
||||||
|
|
||||||
|
U --> V{二次确认}
|
||||||
|
|
||||||
|
V -->|确认| W[切换状态标签]
|
||||||
|
|
||||||
|
V -->|取消| X[取消操作]
|
||||||
|
|
||||||
|
W --> Y[更新按钮状态]
|
||||||
|
|
||||||
|
F --> Z[输入查询条件]
|
||||||
|
|
||||||
|
Z --> AA[筛选表格数据]
|
||||||
|
|
||||||
|
K --> AB{房间号重复校验}
|
||||||
|
|
||||||
|
AB -->|不重复| AC[提示房间号已存在]
|
||||||
|
|
||||||
|
AB -->|重复| AD[更新按钮状态]
|
||||||
|
```
|
||||||
|
|
||||||
|
### 二、整体布局分析
|
||||||
|
|
||||||
|
**页面宽度**:自适应布局
|
||||||
|
**主要区域划分**:
|
||||||
|
|
||||||
|
1. 页头区域(15%高度)
|
||||||
|
2. 表格展示区(85%高度)
|
||||||
|
**布局特点**:上下布局,表格采用固定表头+滚动内容区设计
|
||||||
|
**响应式要求**:移动端适配时改为纵向堆叠布局,操作按钮组变为纵向排列
|
||||||
|
|
||||||
|
### 三、页面区域详细描述
|
||||||
|
|
||||||
|
#### 1. 页头区域
|
||||||
|
|
||||||
|
**区域位置**:页面顶部
|
||||||
|
**区域尺寸**:高度60px,宽度100%
|
||||||
|
**区域功能**:展示标题和主要操作入口
|
||||||
|
**包含元素**:
|
||||||
|
|
||||||
|
- **标题文本**
|
||||||
|
- 元素类型:H1标题
|
||||||
|
- 显示内容:"手术室列表"
|
||||||
|
- 样式特征:1.75rem/600字重,深灰色(#333)
|
||||||
|
- **新增按钮**
|
||||||
|
- 元素类型:主要操作按钮
|
||||||
|
- 显示内容:"新增"(带+图标)
|
||||||
|
- 交互行为:点击触发新增模态框
|
||||||
|
- 样式特征:蓝色背景(#5a7cff),白色文字,8px圆角,悬停上浮1px
|
||||||
|
|
||||||
|
#### 2. 表格展示区(手术室列表表格)
|
||||||
|
|
||||||
|
**区域位置**:页头下方
|
||||||
|
**区域尺寸**:高度自适应,宽度100%
|
||||||
|
**区域功能**:展示手术室数据并支持行级操作
|
||||||
|
**包含元素**:
|
||||||
|
|
||||||
|
- **数据表格**
|
||||||
|
- 展示方式:固定表头表格
|
||||||
|
- 数据字段:
|
||||||
|
- 房间号:文本 - OR01 - 不可操作
|
||||||
|
- 手术室名称:文本 - 第一手术室 - 不可操作
|
||||||
|
- 类型:文本 - 普通/日间/复合 - 不可操作
|
||||||
|
- 所属科室:文本 - 外科 - 不可操作
|
||||||
|
- 状态:标签 - 有效/无效 - 通过操作按钮切换
|
||||||
|
- 操作功能:每行包含"修改"和"状态切换(停用-黄色/启用-绿色)"按钮
|
||||||
|
- **表格样式**:
|
||||||
|
- 表头:浅灰色背景(#f8f9fa),大写字母,14px字号
|
||||||
|
- 行悬停:浅灰色背景(#f8f9fa)
|
||||||
|
- 状态标签:
|
||||||
|
- 有效:绿色背景+文字(#28a745)
|
||||||
|
- 无效:灰色背景+文字(#6c757d)
|
||||||
|
|
||||||
|
#### 3. 新增手术室弹窗
|
||||||
|
|
||||||
|
**区域位置**:页面居中模态弹窗
|
||||||
|
**区域功能**:收集新增手术室所需信息
|
||||||
|
**包含元素**:
|
||||||
|
|
||||||
|
- 表单字段:
|
||||||
|
1. 房间号输入框
|
||||||
|
2. 类型:文本输入
|
||||||
|
3. 必填:是
|
||||||
|
4. 示例值:OR04
|
||||||
|
5. 校验规则:非空校验
|
||||||
|
6. 手术室名称输入框
|
||||||
|
- 类型:文本输入
|
||||||
|
- 必填:是
|
||||||
|
- 示例值:第四手术室
|
||||||
|
1. 手术室类型下拉框
|
||||||
|
- 类型:单选下拉
|
||||||
|
- 选项:普通/日间/复合/特殊
|
||||||
|
- 默认值:普通
|
||||||
|
1. 所属科室下拉框
|
||||||
|
- 类型:单选下拉
|
||||||
|
- 必填:是
|
||||||
|
- 选项:外科/妇产科等8个科室
|
||||||
|
- 默认提示:"请选择科室"
|
||||||
|
- 操作按钮:
|
||||||
|
- 取消按钮(灰色边框)
|
||||||
|
- 确认按钮(蓝色填充)
|
||||||
|
- 校验逻辑:必填字段非空校验
|
||||||
|
- 成功反馈:提示"手术室添加成功"
|
||||||
|
- 失败反馈:提示"请填写所有必填项"
|
||||||
|
|
||||||
|
#### 4. 编辑手术室弹窗
|
||||||
|
|
||||||
|
**区域位置**:页面居中模态弹窗
|
||||||
|
**区域功能**:修改现有手术室信息
|
||||||
|
**包含元素**:
|
||||||
|
|
||||||
|
- 表单字段(同新增弹窗,带初始值)
|
||||||
|
- 操作按钮:
|
||||||
|
- 取消按钮
|
||||||
|
- 保存按钮
|
||||||
|
- 校验逻辑:同新增弹窗
|
||||||
|
- 成功反馈:提示"手术室信息已更新"
|
||||||
|
|
||||||
|
### 四、交互功能详细说明
|
||||||
|
|
||||||
|
#### 1. 新增手术室
|
||||||
|
|
||||||
|
**功能描述**:添加新的手术室记录
|
||||||
|
**触发条件**:点击页头"新增"按钮
|
||||||
|
**操作流程**:
|
||||||
|
|
||||||
|
1. 打开新增模态框
|
||||||
|
2. 填写必填字段(房间号、名称、科室)
|
||||||
|
3. 点击确认提交(插入his_or_room表)
|
||||||
|
4. 表格末尾新增数据行
|
||||||
|
**异常处理**:
|
||||||
|
- 必填项为空时弹出"请填写所有必填项"提示
|
||||||
|
- 房间号重复需在后端校验并提示
|
||||||
|
|
||||||
|
#### 2. 编辑手术室
|
||||||
|
|
||||||
|
**功能描述**:修改现有手术室信息
|
||||||
|
**触发条件**:点击行内"修改"按钮
|
||||||
|
**操作流程**:
|
||||||
|
|
||||||
|
1. 打开编辑模态框(自动填充当前行数据)
|
||||||
|
2. 用户修改数据
|
||||||
|
3. 点击"保存"时校验并更新对应行数据
|
||||||
|
**状态保持**:记录当前编辑行索引确保数据更新准确
|
||||||
|
|
||||||
|
#### 3. 状态切换
|
||||||
|
|
||||||
|
**功能描述**:启用/停用手术室
|
||||||
|
**触发条件**:点击"停用"或"启用"按钮
|
||||||
|
**操作流程**:
|
||||||
|
|
||||||
|
1. 弹出二次确认对话框
|
||||||
|
2. 用户确认后切换状态标签
|
||||||
|
3. 按钮变为相反操作(停用↔启用)
|
||||||
|
4. 、停用手术室
|
||||||
|
- **步骤**:
|
||||||
|
1. 查询需要停用的手术室记录。
|
||||||
|
2. 将 valid_flag 设置为 0(无效)。
|
||||||
|
- **示例**:
|
||||||
|
|
||||||
|
UPDATE his_or_room
|
||||||
|
|
||||||
|
SET valid_flag = '0'
|
||||||
|
|
||||||
|
WHERE room_code = 'OR06';
|
||||||
|
|
||||||
|
5\. 启用手术室
|
||||||
|
|
||||||
|
**步骤**:
|
||||||
|
|
||||||
|
1. 查询需要启用的手术室记录。
|
||||||
|
1. 将 valid_flag 设置为 1(有效)。
|
||||||
|
- **示例**:
|
||||||
|
|
||||||
|
UPDATE his_or_room
|
||||||
|
|
||||||
|
SET valid_flag = '1'
|
||||||
|
|
||||||
|
WHERE room_code = 'OR06';
|
||||||
|
|
||||||
|
**防误操作**:所有状态变更需二次确认
|
||||||
|
|
||||||
|
### 五、数据结构说明(HIS_OR_ROOM手术室字典表)
|
||||||
|
|
||||||
|
| **字段名称** | **数据类型** | **是否为空** | **说明/典型值** | **外键/来源** |
|
||||||
|
|--------------|--------------|--------------|-----------------|-------------------------------|
|
||||||
|
| room_id | VARCHAR(10) | N | 主键 | 自增主键 |
|
||||||
|
| room_code | VARCHAR(10) | N | 手术室房间号 | 自定义编码,如 OR01、OR02 |
|
||||||
|
| room_name | VARCHAR(100) | N | 手术室名称 | 如 "第一手术室"、"第二手术室" |
|
||||||
|
| room_type | VARCHAR(10) | N | 手术室类型 | 普通、日间、复合 |
|
||||||
|
| dept_code | VARCHAR(10) | N | 所属科室 | FK → 科室管理的科室代码 |
|
||||||
|
| valid_flag | CHAR(1) | N | 是否有效 | 1有效,0无效 |
|
||||||
|
| created_time | DATETIME | N | 创建时间 | 默认当前时间 |
|
||||||
|
| updated_time | DATETIME | N | 更新时间 | 默认当前时间,自动更新 |
|
||||||
|
|
||||||
|
### 六、开发实现要点
|
||||||
|
|
||||||
|
**样式规范**:
|
||||||
|
|
||||||
|
- 主色调:#5a7cff(按钮/交互元素)
|
||||||
|
- 辅助色:#7b8a8b(次要文本)
|
||||||
|
- 字体:
|
||||||
|
- 标题:1.75rem/600字重
|
||||||
|
- 正文:0.875rem/400字重
|
||||||
|
- 间距系统:
|
||||||
|
- 卡片内边距:24px
|
||||||
|
- 表单字段间距:16px
|
||||||
|
|
||||||
|
**技术要求**:
|
||||||
|
|
||||||
|
**注意事项**:
|
||||||
|
|
||||||
|
1. 数据安全:
|
||||||
|
- 所有变更操作需记录操作日志
|
||||||
|
- 停用状态的手术室需在前端标记不可预约
|
||||||
|
2. 性能优化:
|
||||||
|
- 表格数据分页加载
|
||||||
|
- 模态框使用懒加载
|
||||||
@@ -76,6 +76,25 @@ public class SecurityUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 安全获取用户名(失败时返回默认值)
|
||||||
|
**/
|
||||||
|
public static String getUsernameSafe() {
|
||||||
|
try {
|
||||||
|
Authentication authentication = getAuthentication();
|
||||||
|
if (authentication != null && authentication.getPrincipal() != null) {
|
||||||
|
if (authentication.getPrincipal() instanceof LoginUser) {
|
||||||
|
return ((LoginUser) authentication.getPrincipal()).getUsername();
|
||||||
|
} else {
|
||||||
|
return authentication.getPrincipal().toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
// 静默处理异常,返回默认值
|
||||||
|
}
|
||||||
|
return "anonymous";
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取Authentication
|
* 获取Authentication
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -60,6 +60,11 @@
|
|||||||
<artifactId>core-system</artifactId>
|
<artifactId>core-system</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.core</groupId>
|
||||||
|
<artifactId>core-common</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- JSQLParser - 用于MyBatis Plus -->
|
<!-- JSQLParser - 用于MyBatis Plus -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.jsqlparser</groupId>
|
<groupId>com.github.jsqlparser</groupId>
|
||||||
|
|||||||
@@ -11,9 +11,10 @@ import org.springframework.transaction.support.DefaultTransactionDefinition;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 事务处理
|
* 事务处理
|
||||||
|
* 已注释:与 @Transactional 注解冲突,导致事务回滚错误
|
||||||
*/
|
*/
|
||||||
@Aspect
|
//@Aspect
|
||||||
@Component
|
//@Component
|
||||||
public class TransactionAspect {
|
public class TransactionAspect {
|
||||||
|
|
||||||
private final PlatformTransactionManager transactionManager;
|
private final PlatformTransactionManager transactionManager;
|
||||||
@@ -23,19 +24,19 @@ public class TransactionAspect {
|
|||||||
this.transactionManager = transactionManager;
|
this.transactionManager = transactionManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Before("@annotation(org.springframework.web.bind.annotation.PostMapping) || " +
|
//@Before("@annotation(org.springframework.web.bind.annotation.PostMapping) || " +
|
||||||
"@annotation(org.springframework.web.bind.annotation.GetMapping) || " +
|
// "@annotation(org.springframework.web.bind.annotation.GetMapping) || " +
|
||||||
"@annotation(org.springframework.web.bind.annotation.PutMapping) || " +
|
// "@annotation(org.springframework.web.bind.annotation.PutMapping) || " +
|
||||||
"@annotation(org.springframework.web.bind.annotation.DeleteMapping)")
|
// "@annotation(org.springframework.web.bind.annotation.DeleteMapping)")
|
||||||
public void beginTransaction() {
|
public void beginTransaction() {
|
||||||
TransactionStatus status = transactionManager.getTransaction(new DefaultTransactionDefinition());
|
TransactionStatus status = transactionManager.getTransaction(new DefaultTransactionDefinition());
|
||||||
transactionStatus.set(status);
|
transactionStatus.set(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterReturning("@annotation(org.springframework.web.bind.annotation.PostMapping) || " +
|
//@AfterReturning("@annotation(org.springframework.web.bind.annotation.PostMapping) || " +
|
||||||
"@annotation(org.springframework.web.bind.annotation.GetMapping) || " +
|
// "@annotation(org.springframework.web.bind.annotation.GetMapping) || " +
|
||||||
"@annotation(org.springframework.web.bind.annotation.PutMapping) || " +
|
// "@annotation(org.springframework.web.bind.annotation.PutMapping) || " +
|
||||||
"@annotation(org.springframework.web.bind.annotation.DeleteMapping)")
|
// "@annotation(org.springframework.web.bind.annotation.DeleteMapping)")
|
||||||
public void commitTransaction() {
|
public void commitTransaction() {
|
||||||
TransactionStatus status = transactionStatus.get();
|
TransactionStatus status = transactionStatus.get();
|
||||||
if (status != null && !status.isCompleted()) {
|
if (status != null && !status.isCompleted()) {
|
||||||
@@ -44,11 +45,11 @@ public class TransactionAspect {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterThrowing(pointcut = "@annotation(org.springframework.web.bind.annotation.PostMapping) || " +
|
//@AfterThrowing(pointcut = "@annotation(org.springframework.web.bind.annotation.PostMapping) || " +
|
||||||
"@annotation(org.springframework.web.bind.annotation.GetMapping) || " +
|
// "@annotation(org.springframework.web.bind.annotation.GetMapping) || " +
|
||||||
"@annotation(org.springframework.web.bind.annotation.PutMapping) || " +
|
// "@annotation(org.springframework.web.bind.annotation.PutMapping) || " +
|
||||||
"@annotation(org.springframework.web.bind.annotation.DeleteMapping)",
|
// "@annotation(org.springframework.web.bind.annotation.DeleteMapping)",
|
||||||
throwing = "ex")
|
// throwing = "ex")
|
||||||
public void rollbackTransaction(Exception ex) {
|
public void rollbackTransaction(Exception ex) {
|
||||||
TransactionStatus status = transactionStatus.get();
|
TransactionStatus status = transactionStatus.get();
|
||||||
if (status != null && !status.isCompleted()) {
|
if (status != null && !status.isCompleted()) {
|
||||||
|
|||||||
@@ -120,7 +120,7 @@
|
|||||||
<if test="listClass != null">list_class = #{listClass},</if>
|
<if test="listClass != null">list_class = #{listClass},</if>
|
||||||
<if test="isDefault != null and isDefault != ''">is_default = #{isDefault},</if>
|
<if test="isDefault != null and isDefault != ''">is_default = #{isDefault},</if>
|
||||||
<if test="status != null">status = #{status},</if>
|
<if test="status != null">status = #{status},</if>
|
||||||
<if test="pyStr !=null">pyStr = #{pyStr},</if>
|
<if test="pyStr !=null">py_str = #{pyStr},</if>
|
||||||
<if test="remark != null">remark = #{remark},</if>
|
<if test="remark != null">remark = #{remark},</if>
|
||||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||||
update_time = now()
|
update_time = now()
|
||||||
|
|||||||
@@ -64,6 +64,11 @@
|
|||||||
<groupId>org.apache.httpcomponents</groupId>
|
<groupId>org.apache.httpcomponents</groupId>
|
||||||
<artifactId>httpclient</artifactId>
|
<artifactId>httpclient</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.velocity</groupId>
|
||||||
|
<artifactId>velocity-engine-core</artifactId>
|
||||||
|
</dependency>
|
||||||
<!-- rabbitMQ -->
|
<!-- rabbitMQ -->
|
||||||
<!-- <dependency>
|
<!-- <dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package com.openhis.web.appointmentmanage.appservice;
|
||||||
|
|
||||||
|
import com.core.common.core.domain.R;
|
||||||
|
import com.openhis.appointmentmanage.domain.DeptAppointmentHours;
|
||||||
|
|
||||||
|
public interface IDeptAppointmentHoursAppService {
|
||||||
|
|
||||||
|
R<?> getDeptAppthoursList(DeptAppointmentHours deptAppointmentHours, Integer pageNum, Integer pageSize);
|
||||||
|
|
||||||
|
R<?> getDeptAppthoursDetail(Long id);
|
||||||
|
|
||||||
|
R<?> addDeptAppthours(DeptAppointmentHours deptAppointmentHours);
|
||||||
|
|
||||||
|
R<?> updateDeptAppthours(DeptAppointmentHours deptAppointmentHours);
|
||||||
|
|
||||||
|
R<?> deleteDeptAppthours(Long id);
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package com.openhis.web.appointmentmanage.appservice;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.core.common.core.domain.R;
|
||||||
|
import com.openhis.web.appointmentmanage.dto.TicketDto;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 号源管理应用服务接口
|
||||||
|
*
|
||||||
|
* @author system
|
||||||
|
*/
|
||||||
|
public interface ITicketAppService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询号源列表
|
||||||
|
*
|
||||||
|
* @param params 查询参数
|
||||||
|
* @return 号源列表
|
||||||
|
*/
|
||||||
|
R<?> listTicket(Map<String, Object> params);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约号源
|
||||||
|
*
|
||||||
|
* @param params 预约参数
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
R<?> bookTicket(Map<String, Object> params);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消预约
|
||||||
|
*
|
||||||
|
* @param ticketId 号源ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
R<?> cancelTicket(Long ticketId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取号
|
||||||
|
*
|
||||||
|
* @param ticketId 号源ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
R<?> checkInTicket(Long ticketId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 停诊
|
||||||
|
*
|
||||||
|
* @param ticketId 号源ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
R<?> cancelConsultation(Long ticketId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有号源(用于测试)
|
||||||
|
*
|
||||||
|
* @return 所有号源列表
|
||||||
|
*/
|
||||||
|
R<?> listAllTickets();
|
||||||
|
}
|
||||||
@@ -0,0 +1,103 @@
|
|||||||
|
package com.openhis.web.appointmentmanage.appservice.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.core.common.core.domain.R;
|
||||||
|
import com.openhis.appointmentmanage.domain.DeptAppointmentHours;
|
||||||
|
import com.openhis.appointmentmanage.mapper.DeptAppointmentHoursMapper;
|
||||||
|
import com.openhis.appointmentmanage.service.IDeptAppointmentHoursService;
|
||||||
|
import com.openhis.web.appointmentmanage.appservice.IDeptAppointmentHoursAppService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class DeptAppointmentHoursAppServiceImpl implements IDeptAppointmentHoursAppService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IDeptAppointmentHoursService deptAppointmentHoursService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private DeptAppointmentHoursMapper deptAppointmentHoursMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<?> getDeptAppthoursList(DeptAppointmentHours deptAppointmentHours, Integer pageNum, Integer pageSize) {
|
||||||
|
LambdaQueryWrapper<DeptAppointmentHours> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
if (StrUtil.isNotBlank(deptAppointmentHours.getInstitution())) {
|
||||||
|
wrapper.eq(DeptAppointmentHours::getInstitution, deptAppointmentHours.getInstitution());
|
||||||
|
}
|
||||||
|
if (StrUtil.isNotBlank(deptAppointmentHours.getDepartment())) {
|
||||||
|
wrapper.eq(DeptAppointmentHours::getDepartment, deptAppointmentHours.getDepartment());
|
||||||
|
}
|
||||||
|
wrapper.orderByDesc(DeptAppointmentHours::getCreatedTime);
|
||||||
|
|
||||||
|
Page<DeptAppointmentHours> page = new Page<>(pageNum, pageSize);
|
||||||
|
Page<DeptAppointmentHours> resultPage = deptAppointmentHoursMapper.selectPage(page, wrapper);
|
||||||
|
|
||||||
|
return R.ok(resultPage);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<?> getDeptAppthoursDetail(Long id) {
|
||||||
|
if (ObjectUtil.isNull(id)) {
|
||||||
|
return R.fail("ID不能为空");
|
||||||
|
}
|
||||||
|
DeptAppointmentHours deptAppointmentHours = deptAppointmentHoursService.getById(id);
|
||||||
|
if (ObjectUtil.isNull(deptAppointmentHours)) {
|
||||||
|
return R.fail("数据不存在");
|
||||||
|
}
|
||||||
|
return R.ok(deptAppointmentHours);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<?> addDeptAppthours(DeptAppointmentHours deptAppointmentHours) {
|
||||||
|
if (ObjectUtil.isNull(deptAppointmentHours)) {
|
||||||
|
return R.fail("数据不能为空");
|
||||||
|
}
|
||||||
|
if (StrUtil.isBlank(deptAppointmentHours.getInstitution())) {
|
||||||
|
return R.fail("所属机构不能为空");
|
||||||
|
}
|
||||||
|
if (StrUtil.isBlank(deptAppointmentHours.getDepartment())) {
|
||||||
|
return R.fail("科室名称不能为空");
|
||||||
|
}
|
||||||
|
|
||||||
|
deptAppointmentHours.setCreatedTime(LocalDateTime.now());
|
||||||
|
boolean save = deptAppointmentHoursService.save(deptAppointmentHours);
|
||||||
|
return R.ok(save);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<?> updateDeptAppthours(DeptAppointmentHours deptAppointmentHours) {
|
||||||
|
if (ObjectUtil.isNull(deptAppointmentHours) || ObjectUtil.isNull(deptAppointmentHours.getId())) {
|
||||||
|
return R.fail("ID不能为空");
|
||||||
|
}
|
||||||
|
|
||||||
|
DeptAppointmentHours existing = deptAppointmentHoursService.getById(deptAppointmentHours.getId());
|
||||||
|
if (ObjectUtil.isNull(existing)) {
|
||||||
|
return R.fail("数据不存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
deptAppointmentHours.setUpdatedTime(LocalDateTime.now());
|
||||||
|
boolean update = deptAppointmentHoursService.updateById(deptAppointmentHours);
|
||||||
|
return R.ok(update);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<?> deleteDeptAppthours(Long id) {
|
||||||
|
if (ObjectUtil.isNull(id)) {
|
||||||
|
return R.fail("ID不能为空");
|
||||||
|
}
|
||||||
|
|
||||||
|
DeptAppointmentHours existing = deptAppointmentHoursService.getById(id);
|
||||||
|
if (ObjectUtil.isNull(existing)) {
|
||||||
|
return R.fail("数据不存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean remove = deptAppointmentHoursService.removeById(id);
|
||||||
|
return R.ok(remove);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,363 @@
|
|||||||
|
package com.openhis.web.appointmentmanage.appservice.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.core.common.core.domain.R;
|
||||||
|
import com.openhis.administration.domain.Patient;
|
||||||
|
import com.openhis.administration.service.IPatientService;
|
||||||
|
import com.openhis.clinical.domain.Ticket;
|
||||||
|
import com.openhis.clinical.service.ITicketService;
|
||||||
|
import com.openhis.web.appointmentmanage.appservice.ITicketAppService;
|
||||||
|
import com.openhis.web.appointmentmanage.dto.TicketDto;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 号源管理应用服务实现类
|
||||||
|
*
|
||||||
|
* @author system
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class TicketAppServiceImpl implements ITicketAppService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ITicketService ticketService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IPatientService patientService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询号源列表
|
||||||
|
*
|
||||||
|
* @param params 查询参数
|
||||||
|
* @return 号源列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public R<?> listTicket(Map<String, Object> params) {
|
||||||
|
// 调试日志:打印所有参数
|
||||||
|
System.out.println("=== listTicket方法收到的所有参数:===");
|
||||||
|
for (Map.Entry<String, Object> entry : params.entrySet()) {
|
||||||
|
System.out.println(entry.getKey() + ": " + entry.getValue());
|
||||||
|
}
|
||||||
|
System.out.println("=================================");
|
||||||
|
// 构建查询条件
|
||||||
|
Ticket ticket = new Ticket();
|
||||||
|
// 设置查询参数
|
||||||
|
// 处理日期参数
|
||||||
|
if (params.containsKey("date")) {
|
||||||
|
String date = (String) params.get("date");
|
||||||
|
try {
|
||||||
|
// 将日期字符串转换为Date类型,设置到appointmentDate字段
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
Date appointmentDate = sdf.parse(date);
|
||||||
|
ticket.setAppointmentDate(appointmentDate);
|
||||||
|
System.out.println("设置的appointmentDate:" + appointmentDate);
|
||||||
|
} catch (Exception e) {
|
||||||
|
// 日期格式错误,忽略该参数
|
||||||
|
System.out.println("日期格式错误,忽略该参数:" + date + ",错误信息:" + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 处理状态参数
|
||||||
|
if (params.containsKey("status")) {
|
||||||
|
String status = (String) params.get("status");
|
||||||
|
System.out.println("接收到的status参数:" + status);
|
||||||
|
if (!"all".equals(status) && !"全部".equals(status)) {
|
||||||
|
// 将中文状态转换为英文状态
|
||||||
|
if ("未预约".equals(status)) {
|
||||||
|
ticket.setStatus("unbooked");
|
||||||
|
} else if ("已预约".equals(status)) {
|
||||||
|
ticket.setStatus("booked");
|
||||||
|
} else if ("已取号".equals(status)) {
|
||||||
|
ticket.setStatus("checked");
|
||||||
|
} else if ("已取消".equals(status)) {
|
||||||
|
ticket.setStatus("cancelled");
|
||||||
|
} else if ("已锁定".equals(status)) {
|
||||||
|
ticket.setStatus("locked");
|
||||||
|
} else {
|
||||||
|
ticket.setStatus(status);
|
||||||
|
}
|
||||||
|
System.out.println("设置的status:" + ticket.getStatus());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (params.containsKey("name")) {
|
||||||
|
String name = (String) params.get("name");
|
||||||
|
ticket.setPatientName(name);
|
||||||
|
}
|
||||||
|
if (params.containsKey("card")) {
|
||||||
|
String card = (String) params.get("card");
|
||||||
|
ticket.setMedicalCard(card);
|
||||||
|
}
|
||||||
|
if (params.containsKey("phone")) {
|
||||||
|
String phone = (String) params.get("phone");
|
||||||
|
ticket.setPhone(phone);
|
||||||
|
}
|
||||||
|
if (params.containsKey("type")) {
|
||||||
|
String type = (String) params.get("type");
|
||||||
|
System.out.println("前端传递的type参数值:" + type);
|
||||||
|
if (!"all".equals(type)) {
|
||||||
|
// 类型映射转换:前端传递英文类型,数据库存储中文类型
|
||||||
|
if ("general".equals(type)) {
|
||||||
|
ticket.setTicketType("普通");
|
||||||
|
} else if ("expert".equals(type)) {
|
||||||
|
ticket.setTicketType("专家");
|
||||||
|
} else if ("普通".equals(type)) {
|
||||||
|
ticket.setTicketType("普通");
|
||||||
|
} else if ("专家".equals(type)) {
|
||||||
|
ticket.setTicketType("专家");
|
||||||
|
} else {
|
||||||
|
ticket.setTicketType(type);
|
||||||
|
}
|
||||||
|
System.out.println("转换后的ticketType值:" + ticket.getTicketType());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 手动实现分页查询,避免MyBatis-Plus自动COUNT查询的问题
|
||||||
|
int pageNum = params.get("page") != null ? Integer.valueOf(params.get("page").toString()) : 1;
|
||||||
|
int pageSize = params.get("limit") != null ? Integer.valueOf(params.get("limit").toString()) : 10;
|
||||||
|
|
||||||
|
// 调试:输出构建的查询条件
|
||||||
|
System.out.println("构建的查询条件:ticketType=" + ticket.getTicketType() + ", status=" + ticket.getStatus() + ", appointmentDate=" + ticket.getAppointmentDate());
|
||||||
|
|
||||||
|
// 1. 获取所有符合条件的记录
|
||||||
|
List<Ticket> allTickets = ticketService.selectTicketList(ticket);
|
||||||
|
|
||||||
|
// 调试:输出查询到的所有记录
|
||||||
|
System.out.println("查询到的所有记录:" + allTickets);
|
||||||
|
if (!allTickets.isEmpty()) {
|
||||||
|
for (Ticket t : allTickets) {
|
||||||
|
System.out.println("记录详情:id=" + t.getId() + ", ticketType=" + t.getTicketType() + ", status=" + t.getStatus() + ", appointmentDate=" + t.getAppointmentDate() + ", deleteFlag=" + t.getDeleteFlag());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. 计算总记录数
|
||||||
|
long total = allTickets.size();
|
||||||
|
System.out.println("手动计算的总记录数:" + total);
|
||||||
|
|
||||||
|
// 3. 手动分页
|
||||||
|
int start = (pageNum - 1) * pageSize;
|
||||||
|
int end = Math.min(start + pageSize, allTickets.size());
|
||||||
|
List<Ticket> pageTickets;
|
||||||
|
if (start >= end) {
|
||||||
|
pageTickets = new ArrayList<>();
|
||||||
|
} else {
|
||||||
|
pageTickets = allTickets.subList(start, end);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 4. 转换为DTO
|
||||||
|
List<TicketDto> dtoList = pageTickets.stream().map(this::convertToDto).toList();
|
||||||
|
|
||||||
|
// 5. 构建响应数据,符合前端预期格式
|
||||||
|
Map<String, Object> result = new HashMap<>();
|
||||||
|
result.put("list", dtoList);
|
||||||
|
result.put("records", dtoList); // 兼容前端框架(如Element UI)可能使用的records字段
|
||||||
|
result.put("total", total);
|
||||||
|
result.put("page", pageNum);
|
||||||
|
result.put("current", pageNum); // 兼容前端框架可能使用的current字段
|
||||||
|
result.put("limit", pageSize);
|
||||||
|
result.put("pageSize", pageSize); // 兼容前端框架可能使用的pageSize字段
|
||||||
|
result.put("size", pageSize); // 兼容前端框架可能使用的size字段
|
||||||
|
result.put("pageNum", pageNum); // 兼容前端框架可能使用的pageNum字段
|
||||||
|
result.put("pages", (int) Math.ceil((double) total / pageSize)); // 计算总页数
|
||||||
|
|
||||||
|
// 调试:输出响应数据
|
||||||
|
System.out.println("返回的响应数据:" + result);
|
||||||
|
|
||||||
|
return R.ok(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约号源
|
||||||
|
*
|
||||||
|
* @param params 预约参数
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public R<?> bookTicket(Map<String, Object> params) {
|
||||||
|
Long ticketId = null;
|
||||||
|
if (params.get("ticketId") != null) {
|
||||||
|
ticketId = Long.valueOf(params.get("ticketId").toString());
|
||||||
|
}
|
||||||
|
if (ticketId == null) {
|
||||||
|
return R.fail("参数错误");
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
int result = ticketService.bookTicket(params);
|
||||||
|
return R.ok(result > 0 ? "预约成功" : "预约失败");
|
||||||
|
} catch (Exception e) {
|
||||||
|
return R.fail(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消预约
|
||||||
|
*
|
||||||
|
* @param ticketId 号源ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public R<?> cancelTicket(Long ticketId) {
|
||||||
|
if (ticketId == null) {
|
||||||
|
return R.fail("参数错误");
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
int result = ticketService.cancelTicket(ticketId);
|
||||||
|
return R.ok(result > 0 ? "取消成功" : "取消失败");
|
||||||
|
} catch (Exception e) {
|
||||||
|
return R.fail(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取号
|
||||||
|
*
|
||||||
|
* @param ticketId 号源ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public R<?> checkInTicket(Long ticketId) {
|
||||||
|
if (ticketId == null) {
|
||||||
|
return R.fail("参数错误");
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
int result = ticketService.checkInTicket(ticketId);
|
||||||
|
return R.ok(result > 0 ? "取号成功" : "取号失败");
|
||||||
|
} catch (Exception e) {
|
||||||
|
return R.fail(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 停诊
|
||||||
|
*
|
||||||
|
* @param ticketId 号源ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public R<?> cancelConsultation(Long ticketId) {
|
||||||
|
if (ticketId == null) {
|
||||||
|
return R.fail("参数错误");
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
int result = ticketService.cancelConsultation(ticketId);
|
||||||
|
return R.ok(result > 0 ? "停诊成功" : "停诊失败");
|
||||||
|
} catch (Exception e) {
|
||||||
|
return R.fail(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<?> listAllTickets() {
|
||||||
|
// 创建固定的测试数据,用于验证前端是否能展示数据
|
||||||
|
List<TicketDto> testTickets = new ArrayList<>();
|
||||||
|
|
||||||
|
// 创建5条测试数据
|
||||||
|
for (int i = 1; i <= 5; i++) {
|
||||||
|
TicketDto dto = new TicketDto();
|
||||||
|
dto.setSlot_id((long) i);
|
||||||
|
dto.setBusNo("TEST0000" + i);
|
||||||
|
dto.setDepartment("内科");
|
||||||
|
dto.setDoctor("张三");
|
||||||
|
dto.setTicketType("expert");
|
||||||
|
dto.setDateTime("08:00-08:50");
|
||||||
|
dto.setStatus("未预约");
|
||||||
|
dto.setFee("150");
|
||||||
|
dto.setAppointmentDate(new Date());
|
||||||
|
testTickets.add(dto);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 构建响应数据
|
||||||
|
Map<String, Object> result = new HashMap<>();
|
||||||
|
result.put("list", testTickets);
|
||||||
|
result.put("total", testTickets.size());
|
||||||
|
result.put("page", 1);
|
||||||
|
result.put("limit", 20);
|
||||||
|
|
||||||
|
return R.ok(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 转换为DTO
|
||||||
|
*
|
||||||
|
* @param ticket 号源实体
|
||||||
|
* @return 号源DTO
|
||||||
|
*/
|
||||||
|
private TicketDto convertToDto(Ticket ticket) {
|
||||||
|
TicketDto dto = new TicketDto();
|
||||||
|
dto.setSlot_id(ticket.getId());
|
||||||
|
dto.setBusNo(ticket.getBusNo());
|
||||||
|
dto.setDepartment(ticket.getDepartment());
|
||||||
|
dto.setDoctor(ticket.getDoctor());
|
||||||
|
|
||||||
|
// 处理号源类型(转换为英文,前端期望的是general或expert)
|
||||||
|
String ticketType = ticket.getTicketType();
|
||||||
|
if ("普通".equals(ticketType)) {
|
||||||
|
dto.setTicketType("general");
|
||||||
|
} else if ("专家".equals(ticketType)) {
|
||||||
|
dto.setTicketType("expert");
|
||||||
|
} else {
|
||||||
|
dto.setTicketType(ticketType);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理号源时间(dateTime)
|
||||||
|
dto.setDateTime(ticket.getTime());
|
||||||
|
|
||||||
|
// 处理号源状态(转换为中文)
|
||||||
|
String status = ticket.getStatus();
|
||||||
|
switch (status) {
|
||||||
|
case "unbooked":
|
||||||
|
dto.setStatus("未预约");
|
||||||
|
break;
|
||||||
|
case "booked":
|
||||||
|
dto.setStatus("已预约");
|
||||||
|
break;
|
||||||
|
case "checked":
|
||||||
|
dto.setStatus("已取号");
|
||||||
|
break;
|
||||||
|
case "cancelled":
|
||||||
|
dto.setStatus("已取消");
|
||||||
|
break;
|
||||||
|
case "locked":
|
||||||
|
dto.setStatus("已锁定");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
dto.setStatus(status);
|
||||||
|
}
|
||||||
|
|
||||||
|
dto.setFee(ticket.getFee());
|
||||||
|
dto.setPatientName(ticket.getPatientName());
|
||||||
|
dto.setPatientId(ticket.getMedicalCard()); // 就诊卡号
|
||||||
|
dto.setPhone(ticket.getPhone());
|
||||||
|
|
||||||
|
// 获取患者性别
|
||||||
|
if (ticket.getPatientId() != null) {
|
||||||
|
Patient patient = patientService.getById(ticket.getPatientId());
|
||||||
|
if (patient != null) {
|
||||||
|
Integer genderEnum = patient.getGenderEnum();
|
||||||
|
if (genderEnum != null) {
|
||||||
|
switch (genderEnum) {
|
||||||
|
case 1:
|
||||||
|
dto.setGender("男");
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
dto.setGender("女");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
dto.setGender("未知");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dto.setAppointmentDate(ticket.getAppointmentDate());
|
||||||
|
dto.setAppointmentTime(ticket.getAppointmentTime());
|
||||||
|
dto.setDepartmentId(ticket.getDepartmentId());
|
||||||
|
dto.setDoctorId(ticket.getDoctorId());
|
||||||
|
return dto;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
package com.openhis.web.appointmentmanage.controller;
|
||||||
|
|
||||||
|
import com.core.common.core.domain.R;
|
||||||
|
import com.openhis.appointmentmanage.domain.DeptAppointmentHours;
|
||||||
|
import com.openhis.web.appointmentmanage.appservice.IDeptAppointmentHoursAppService;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 科室预约工作时间维护 Controller
|
||||||
|
*
|
||||||
|
* @author openhis
|
||||||
|
* @date 2025-12-12
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/appoinment/dept-appthours")
|
||||||
|
public class DeptAppthoursController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IDeptAppointmentHoursAppService deptAppointmentHoursAppService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取科室预约工作时间列表
|
||||||
|
*
|
||||||
|
* @param deptAppointmentHours 查询条件
|
||||||
|
* @param pageNum 页码
|
||||||
|
* @param pageSize 每页大小
|
||||||
|
* @return 列表数据
|
||||||
|
*/
|
||||||
|
@GetMapping("/page")
|
||||||
|
public R<?> getDeptAppthoursList(
|
||||||
|
DeptAppointmentHours deptAppointmentHours,
|
||||||
|
@RequestParam(defaultValue = "1") Integer pageNum,
|
||||||
|
@RequestParam(defaultValue = "10") Integer pageSize) {
|
||||||
|
return deptAppointmentHoursAppService.getDeptAppthoursList(deptAppointmentHours, pageNum, pageSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取科室预约工作时间详情
|
||||||
|
*
|
||||||
|
* @param id 记录ID
|
||||||
|
* @return 详情数据
|
||||||
|
*/
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public R<?> getDeptAppthoursDetail(@PathVariable("id") Long id) {
|
||||||
|
return deptAppointmentHoursAppService.getDeptAppthoursDetail(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增科室预约工作时间
|
||||||
|
*
|
||||||
|
* @param deptAppointmentHours 新增数据
|
||||||
|
* @return 操作结果
|
||||||
|
*/
|
||||||
|
@PostMapping
|
||||||
|
public R<?> addDeptAppthours(@RequestBody DeptAppointmentHours deptAppointmentHours) {
|
||||||
|
return deptAppointmentHoursAppService.addDeptAppthours(deptAppointmentHours);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改科室预约工作时间
|
||||||
|
*
|
||||||
|
* @param deptAppointmentHours 修改数据
|
||||||
|
* @return 操作结果
|
||||||
|
*/
|
||||||
|
@PutMapping
|
||||||
|
public R<?> updateDeptAppthours(@RequestBody DeptAppointmentHours deptAppointmentHours) {
|
||||||
|
return deptAppointmentHoursAppService.updateDeptAppthours(deptAppointmentHours);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除科室预约工作时间
|
||||||
|
*
|
||||||
|
* @param id 记录ID
|
||||||
|
* @return 操作结果
|
||||||
|
*/
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public R<?> deleteDeptAppthours(@PathVariable("id") Long id) {
|
||||||
|
return deptAppointmentHoursAppService.deleteDeptAppthours(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,101 @@
|
|||||||
|
package com.openhis.web.appointmentmanage.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.core.common.annotation.Anonymous;
|
||||||
|
import com.core.common.core.domain.R;
|
||||||
|
import com.openhis.web.appointmentmanage.appservice.ITicketAppService;
|
||||||
|
import com.openhis.web.appointmentmanage.dto.TicketDto;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 号源管理控制器
|
||||||
|
*
|
||||||
|
* @author system
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/appointment/ticket")
|
||||||
|
public class TicketController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ITicketAppService ticketAppService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询号源列表
|
||||||
|
*
|
||||||
|
* @param params 查询参数
|
||||||
|
* @return 号源列表
|
||||||
|
*/
|
||||||
|
@PostMapping("/list")
|
||||||
|
public R<?> listTicket(@RequestBody Map<String, Object> params) {
|
||||||
|
return ticketAppService.listTicket(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询号源列表(支持GET请求,兼容旧版本)
|
||||||
|
*
|
||||||
|
* @param params 查询参数
|
||||||
|
* @return 号源列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
public R<?> listTicketByGet(@RequestParam Map<String, Object> params) {
|
||||||
|
return ticketAppService.listTicket(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有号源(用于测试)
|
||||||
|
*
|
||||||
|
* @return 所有号源列表
|
||||||
|
*/
|
||||||
|
@Anonymous
|
||||||
|
@GetMapping("/listAll")
|
||||||
|
public R<?> listAllTickets() {
|
||||||
|
return ticketAppService.listAllTickets();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约号源
|
||||||
|
*
|
||||||
|
* @param params 预约参数
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/book")
|
||||||
|
public R<?> bookTicket(@RequestBody Map<String, Object> params) {
|
||||||
|
return ticketAppService.bookTicket(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消预约
|
||||||
|
*
|
||||||
|
* @param ticketId 号源ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/cancel")
|
||||||
|
public R<?> cancelTicket(@RequestParam Long ticketId) {
|
||||||
|
return ticketAppService.cancelTicket(ticketId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取号
|
||||||
|
*
|
||||||
|
* @param ticketId 号源ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/checkin")
|
||||||
|
public R<?> checkInTicket(@RequestParam Long ticketId) {
|
||||||
|
return ticketAppService.checkInTicket(ticketId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 停诊
|
||||||
|
*
|
||||||
|
* @param ticketId 号源ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/cancelConsultation")
|
||||||
|
public R<?> cancelConsultation(@RequestParam Long ticketId) {
|
||||||
|
return ticketAppService.cancelConsultation(ticketId);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,102 @@
|
|||||||
|
package com.openhis.web.appointmentmanage.dto;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 号源管理DTO
|
||||||
|
*
|
||||||
|
* @author system
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class TicketDto {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 号源唯一ID
|
||||||
|
*/
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long slot_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 号源编码
|
||||||
|
*/
|
||||||
|
private String busNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 科室名称
|
||||||
|
*/
|
||||||
|
private String department;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 医生姓名
|
||||||
|
*/
|
||||||
|
private String doctor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 号源类型 (普通/专家)
|
||||||
|
*/
|
||||||
|
private String ticketType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 号源时间
|
||||||
|
*/
|
||||||
|
private String dateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态 (unbooked:未预约, booked:已预约, checked:已取号, cancelled:已取消, locked:已锁定)
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 挂号费
|
||||||
|
*/
|
||||||
|
private String fee;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 患者姓名
|
||||||
|
*/
|
||||||
|
private String patientName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 就诊卡号
|
||||||
|
*/
|
||||||
|
private String patientId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机号
|
||||||
|
*/
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 患者性别
|
||||||
|
*/
|
||||||
|
private String gender;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约日期
|
||||||
|
*/
|
||||||
|
private Date appointmentDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约时间
|
||||||
|
*/
|
||||||
|
private Date appointmentTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 科室ID
|
||||||
|
*/
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long departmentId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 医生ID
|
||||||
|
*/
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long doctorId;
|
||||||
|
}
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
package com.openhis.web.basedatamanage.appservice;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.core.common.core.domain.R;
|
||||||
|
import com.openhis.web.basedatamanage.dto.OperatingRoomDto;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手术室应用Service接口
|
||||||
|
*
|
||||||
|
* @author system
|
||||||
|
* @date 2026-01-04
|
||||||
|
*/
|
||||||
|
public interface IOperatingRoomAppService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询手术室列表
|
||||||
|
*
|
||||||
|
* @param operatingRoomDto 查询条件
|
||||||
|
* @param pageNo 当前页
|
||||||
|
* @param pageSize 每页条数
|
||||||
|
* @param request 请求
|
||||||
|
* @return 手术室列表
|
||||||
|
*/
|
||||||
|
R<?> getOperatingRoomPage(OperatingRoomDto operatingRoomDto, Integer pageNo, Integer pageSize,
|
||||||
|
HttpServletRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据ID查询手术室详情
|
||||||
|
*
|
||||||
|
* @param id 手术室ID
|
||||||
|
* @return 手术室详情
|
||||||
|
*/
|
||||||
|
R<?> getOperatingRoomById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增手术室
|
||||||
|
*
|
||||||
|
* @param operatingRoomDto 手术室信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
R<?> addOperatingRoom(@Validated OperatingRoomDto operatingRoomDto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改手术室
|
||||||
|
*
|
||||||
|
* @param operatingRoomDto 手术室信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
R<?> updateOperatingRoom(@Validated OperatingRoomDto operatingRoomDto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除手术室
|
||||||
|
*
|
||||||
|
* @param ids 手术室ID(支持批量)
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
R<?> deleteOperatingRoom(String ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启用手术室
|
||||||
|
*
|
||||||
|
* @param ids 手术室ID数组
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
R<?> enableOperatingRoom(java.util.List<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 停用手术室
|
||||||
|
*
|
||||||
|
* @param ids 手术室ID数组
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
R<?> disableOperatingRoom(java.util.List<Long> ids);
|
||||||
|
}
|
||||||
@@ -0,0 +1,340 @@
|
|||||||
|
package com.openhis.web.basedatamanage.appservice.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.core.common.core.domain.R;
|
||||||
|
import com.core.common.utils.AssignSeqUtil;
|
||||||
|
import com.core.common.utils.ChineseConvertUtils;
|
||||||
|
import com.core.common.utils.DictUtils;
|
||||||
|
import com.core.common.utils.StringUtils;
|
||||||
|
import com.openhis.administration.domain.OperatingRoom;
|
||||||
|
import com.openhis.administration.mapper.OperatingRoomMapper;
|
||||||
|
import com.openhis.administration.service.IOperatingRoomService;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import com.openhis.common.enums.AssignSeqEnum;
|
||||||
|
import com.openhis.common.enums.LocationStatus;
|
||||||
|
import com.openhis.common.utils.HisPageUtils;
|
||||||
|
import com.openhis.common.utils.HisQueryUtils;
|
||||||
|
import com.openhis.web.basedatamanage.appservice.IOperatingRoomAppService;
|
||||||
|
import com.openhis.web.basedatamanage.dto.OperatingRoomDto;
|
||||||
|
import com.openhis.web.common.appservice.ICommonService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手术室应用Service实现类
|
||||||
|
*
|
||||||
|
* @author system
|
||||||
|
* @date 2026-01-04
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class OperatingRoomAppServiceImpl implements IOperatingRoomAppService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IOperatingRoomService operatingRoomService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private OperatingRoomMapper operatingRoomMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private AssignSeqUtil assignSeqUtil;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ICommonService commonService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询手术室列表
|
||||||
|
*
|
||||||
|
* @param operatingRoomDto 查询条件
|
||||||
|
* @param pageNo 当前页
|
||||||
|
* @param pageSize 每页条数
|
||||||
|
* @param request 请求
|
||||||
|
* @return 手术室列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public R<?> getOperatingRoomPage(OperatingRoomDto operatingRoomDto, Integer pageNo, Integer pageSize,
|
||||||
|
HttpServletRequest request) {
|
||||||
|
// 构建查询条件
|
||||||
|
QueryWrapper<OperatingRoom> queryWrapper = HisQueryUtils.buildQueryWrapper(operatingRoomDto,
|
||||||
|
operatingRoomDto.getName(),
|
||||||
|
new HashSet<>(Arrays.asList("name", "py_str", "wb_str")), request);
|
||||||
|
|
||||||
|
// 设置排序
|
||||||
|
queryWrapper.orderByDesc("display_order").orderByDesc("create_time");
|
||||||
|
|
||||||
|
// 查询手术室分页列表
|
||||||
|
Page<OperatingRoomDto> operatingRoomPage =
|
||||||
|
HisPageUtils.selectPage(operatingRoomMapper, queryWrapper, pageNo, pageSize, OperatingRoomDto.class);
|
||||||
|
|
||||||
|
// 处理枚举字段显示文本
|
||||||
|
operatingRoomPage.getRecords().forEach(e -> {
|
||||||
|
// 状态
|
||||||
|
e.setStatusEnum_dictText(e.getStatusEnum() != null && e.getStatusEnum() == 1 ? "启用" : "停用");
|
||||||
|
// 类型
|
||||||
|
if (e.getRoomTypeEnum() != null) {
|
||||||
|
e.setRoomTypeEnum_dictText(DictUtils.getDictLabel("operating_room_type", String.valueOf(e.getRoomTypeEnum())));
|
||||||
|
}
|
||||||
|
// 如果有机构ID,查询机构名称
|
||||||
|
if (e.getOrganizationId() != null) {
|
||||||
|
String orgName = commonService.getOrgNameById(e.getOrganizationId());
|
||||||
|
e.setOrganizationName(orgName);
|
||||||
|
}
|
||||||
|
// 拼音码
|
||||||
|
e.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(e.getName()));
|
||||||
|
// 五笔码
|
||||||
|
e.setWbStr(ChineseConvertUtils.toWBFirstLetter(e.getName()));
|
||||||
|
});
|
||||||
|
|
||||||
|
return R.ok(operatingRoomPage);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据ID查询手术室详情
|
||||||
|
*
|
||||||
|
* @param id 手术室ID
|
||||||
|
* @return 手术室详情
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public R<?> getOperatingRoomById(Long id) {
|
||||||
|
OperatingRoom operatingRoom = operatingRoomService.getById(id);
|
||||||
|
if (operatingRoom == null) {
|
||||||
|
return R.fail("手术室信息不存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
OperatingRoomDto operatingRoomDto = new OperatingRoomDto();
|
||||||
|
BeanUtils.copyProperties(operatingRoom, operatingRoomDto);
|
||||||
|
|
||||||
|
// 状态描述
|
||||||
|
operatingRoomDto.setStatusEnum_dictText(
|
||||||
|
operatingRoom.getStatusEnum() != null && operatingRoom.getStatusEnum() == 1 ? "启用" : "停用");
|
||||||
|
|
||||||
|
// 类型描述
|
||||||
|
if (operatingRoom.getRoomTypeEnum() != null) {
|
||||||
|
operatingRoomDto.setRoomTypeEnum_dictText(DictUtils.getDictLabel("operating_room_type", String.valueOf(operatingRoom.getRoomTypeEnum())));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果有机构ID,查询机构名称
|
||||||
|
if (operatingRoom.getOrganizationId() != null) {
|
||||||
|
String orgName = commonService.getOrgNameById(operatingRoom.getOrganizationId());
|
||||||
|
operatingRoomDto.setOrganizationName(orgName);
|
||||||
|
}
|
||||||
|
|
||||||
|
return R.ok(operatingRoomDto);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增手术室
|
||||||
|
*
|
||||||
|
* @param operatingRoomDto 手术室信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public R<?> addOperatingRoom(OperatingRoomDto operatingRoomDto) {
|
||||||
|
// 校验名称不能为空
|
||||||
|
if (StringUtils.isEmpty(operatingRoomDto.getName())) {
|
||||||
|
return R.fail("手术室名称不能为空");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 校验房间号不能为空
|
||||||
|
if (StringUtils.isEmpty(operatingRoomDto.getBusNo())) {
|
||||||
|
return R.fail("房间号不能为空");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 去除空格
|
||||||
|
String name = operatingRoomDto.getName().replaceAll("[ ]", "");
|
||||||
|
operatingRoomDto.setName(name);
|
||||||
|
|
||||||
|
// 判断是否存在同名
|
||||||
|
if (isExistName(name, null)) {
|
||||||
|
return R.fail("【" + name + "】已存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 判断房间号是否已存在
|
||||||
|
if (isExistBusNo(operatingRoomDto.getBusNo(), null)) {
|
||||||
|
return R.fail("房间号【" + operatingRoomDto.getBusNo() + "】已存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
OperatingRoom operatingRoom = new OperatingRoom();
|
||||||
|
BeanUtils.copyProperties(operatingRoomDto, operatingRoom);
|
||||||
|
|
||||||
|
// 拼音码
|
||||||
|
operatingRoom.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(operatingRoomDto.getName()));
|
||||||
|
// 五笔码
|
||||||
|
operatingRoom.setWbStr(ChineseConvertUtils.toWBFirstLetter(operatingRoomDto.getName()));
|
||||||
|
|
||||||
|
boolean result = operatingRoomService.save(operatingRoom);
|
||||||
|
if (result) {
|
||||||
|
return R.ok(null, "新增成功");
|
||||||
|
}
|
||||||
|
return R.fail("新增失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改手术室
|
||||||
|
*
|
||||||
|
* @param operatingRoomDto 手术室信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public R<?> updateOperatingRoom(OperatingRoomDto operatingRoomDto) {
|
||||||
|
// 校验手术室是否存在
|
||||||
|
OperatingRoom existOperatingRoom = operatingRoomService.getById(operatingRoomDto.getId());
|
||||||
|
if (existOperatingRoom == null) {
|
||||||
|
return R.fail("手术室信息不存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 校验名称不能为空
|
||||||
|
if (StringUtils.isEmpty(operatingRoomDto.getName())) {
|
||||||
|
return R.fail("手术室名称不能为空");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 校验房间号不能为空
|
||||||
|
if (StringUtils.isEmpty(operatingRoomDto.getBusNo())) {
|
||||||
|
return R.fail("房间号不能为空");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 去除空格
|
||||||
|
String name = operatingRoomDto.getName().replaceAll("[ ]", "");
|
||||||
|
operatingRoomDto.setName(name);
|
||||||
|
|
||||||
|
// 判断是否存在同名(排除自己)
|
||||||
|
if (isExistName(name, operatingRoomDto.getId())) {
|
||||||
|
return R.fail("【" + name + "】已存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 判断房间号是否已存在(排除自己)
|
||||||
|
if (isExistBusNo(operatingRoomDto.getBusNo(), operatingRoomDto.getId())) {
|
||||||
|
return R.fail("房间号【" + operatingRoomDto.getBusNo() + "】已存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
OperatingRoom operatingRoom = new OperatingRoom();
|
||||||
|
BeanUtils.copyProperties(operatingRoomDto, operatingRoom);
|
||||||
|
|
||||||
|
// 拼音码
|
||||||
|
operatingRoom.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(operatingRoomDto.getName()));
|
||||||
|
// 五笔码
|
||||||
|
operatingRoom.setWbStr(ChineseConvertUtils.toWBFirstLetter(operatingRoomDto.getName()));
|
||||||
|
|
||||||
|
boolean result = operatingRoomService.updateById(operatingRoom);
|
||||||
|
if (result) {
|
||||||
|
return R.ok(null, "修改成功");
|
||||||
|
}
|
||||||
|
return R.fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除手术室
|
||||||
|
*
|
||||||
|
* @param ids 手术室ID(支持批量)
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public R<?> deleteOperatingRoom(String ids) {
|
||||||
|
// 解析ID字符串
|
||||||
|
String[] idArray = ids.split(",");
|
||||||
|
List<Long> idList = new ArrayList<>();
|
||||||
|
for (String idStr : idArray) {
|
||||||
|
try {
|
||||||
|
idList.add(Long.parseLong(idStr.trim()));
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
return R.fail("ID格式错误");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除手术室
|
||||||
|
boolean result = operatingRoomService.removeByIds(idList);
|
||||||
|
if (result) {
|
||||||
|
return R.ok(null, "删除成功");
|
||||||
|
}
|
||||||
|
return R.fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启用手术室
|
||||||
|
*
|
||||||
|
* @param ids 手术室ID数组
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public R<?> enableOperatingRoom(List<Long> ids) {
|
||||||
|
if (ids == null || ids.isEmpty()) {
|
||||||
|
return R.fail("请选择要启用的手术室");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 批量更新状态为启用
|
||||||
|
List<OperatingRoom> operatingRooms = operatingRoomService.listByIds(ids);
|
||||||
|
for (OperatingRoom operatingRoom : operatingRooms) {
|
||||||
|
operatingRoom.setStatusEnum(LocationStatus.ACTIVE.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean result = operatingRoomService.updateBatchById(operatingRooms);
|
||||||
|
if (result) {
|
||||||
|
return R.ok("启用成功");
|
||||||
|
}
|
||||||
|
return R.fail("启用失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 停用手术室
|
||||||
|
*
|
||||||
|
* @param ids 手术室ID数组
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public R<?> disableOperatingRoom(List<Long> ids) {
|
||||||
|
if (ids == null || ids.isEmpty()) {
|
||||||
|
return R.fail("请选择要停用的手术室");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 批量更新状态为停用
|
||||||
|
List<OperatingRoom> operatingRooms = operatingRoomService.listByIds(ids);
|
||||||
|
for (OperatingRoom operatingRoom : operatingRooms) {
|
||||||
|
operatingRoom.setStatusEnum(LocationStatus.INACTIVE.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean result = operatingRoomService.updateBatchById(operatingRooms);
|
||||||
|
if (result) {
|
||||||
|
return R.ok("停用成功");
|
||||||
|
}
|
||||||
|
return R.fail("停用失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断名称是否已存在
|
||||||
|
*
|
||||||
|
* @param name 名称
|
||||||
|
* @param excludeId 排除的ID
|
||||||
|
* @return 是否存在
|
||||||
|
*/
|
||||||
|
private boolean isExistName(String name, Long excludeId) {
|
||||||
|
LambdaQueryWrapper<OperatingRoom> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(OperatingRoom::getName, name);
|
||||||
|
if (excludeId != null) {
|
||||||
|
queryWrapper.ne(OperatingRoom::getId, excludeId);
|
||||||
|
}
|
||||||
|
return operatingRoomService.count(queryWrapper) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断房间号是否已存在
|
||||||
|
*
|
||||||
|
* @param busNo 房间号
|
||||||
|
* @param excludeId 排除的ID
|
||||||
|
* @return 是否存在
|
||||||
|
*/
|
||||||
|
private boolean isExistBusNo(String busNo, Long excludeId) {
|
||||||
|
LambdaQueryWrapper<OperatingRoom> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(OperatingRoom::getBusNo, busNo);
|
||||||
|
if (excludeId != null) {
|
||||||
|
queryWrapper.ne(OperatingRoom::getId, excludeId);
|
||||||
|
}
|
||||||
|
return operatingRoomService.count(queryWrapper) > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,112 @@
|
|||||||
|
package com.openhis.web.basedatamanage.controller;
|
||||||
|
|
||||||
|
import com.core.common.core.domain.R;
|
||||||
|
import com.openhis.web.basedatamanage.appservice.IOperatingRoomAppService;
|
||||||
|
import com.openhis.web.basedatamanage.dto.OperatingRoomDto;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手术室管理Controller
|
||||||
|
*
|
||||||
|
* @author system
|
||||||
|
* @date 2026-01-04
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/base-data-manage/operating-room")
|
||||||
|
@Slf4j
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class OperatingRoomController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IOperatingRoomAppService operatingRoomAppService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询手术室列表
|
||||||
|
*
|
||||||
|
* @param operatingRoomDto 查询条件
|
||||||
|
* @param pageNo 当前页码
|
||||||
|
* @param pageSize 查询条数
|
||||||
|
* @param request 请求
|
||||||
|
* @return 手术室列表
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public R<?> getOperatingRoomPage(OperatingRoomDto operatingRoomDto,
|
||||||
|
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
|
||||||
|
HttpServletRequest request) {
|
||||||
|
return operatingRoomAppService.getOperatingRoomPage(operatingRoomDto, pageNo, pageSize, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取手术室详情
|
||||||
|
*
|
||||||
|
* @param id 手术室ID
|
||||||
|
* @return 手术室详情
|
||||||
|
*/
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public R<?> getOperatingRoomById(@PathVariable Long id) {
|
||||||
|
return operatingRoomAppService.getOperatingRoomById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增手术室
|
||||||
|
*
|
||||||
|
* @param operatingRoomDto 手术室信息
|
||||||
|
* @return 操作结果
|
||||||
|
*/
|
||||||
|
@PostMapping
|
||||||
|
public R<?> addOperatingRoom(@Validated @RequestBody OperatingRoomDto operatingRoomDto) {
|
||||||
|
return operatingRoomAppService.addOperatingRoom(operatingRoomDto);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改手术室
|
||||||
|
*
|
||||||
|
* @param operatingRoomDto 手术室信息
|
||||||
|
* @return 操作结果
|
||||||
|
*/
|
||||||
|
@PutMapping
|
||||||
|
public R<?> updateOperatingRoom(@Validated @RequestBody OperatingRoomDto operatingRoomDto) {
|
||||||
|
return operatingRoomAppService.updateOperatingRoom(operatingRoomDto);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除手术室
|
||||||
|
*
|
||||||
|
* @param ids 手术室ID(支持批量)
|
||||||
|
* @return 操作结果
|
||||||
|
*/
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public R<?> deleteOperatingRoom(@PathVariable String ids) {
|
||||||
|
return operatingRoomAppService.deleteOperatingRoom(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启用手术室
|
||||||
|
*
|
||||||
|
* @param ids 手术室ID数组
|
||||||
|
* @return 操作结果
|
||||||
|
*/
|
||||||
|
@PutMapping("/enable")
|
||||||
|
public R<?> enableOperatingRoom(@RequestBody List<Long> ids) {
|
||||||
|
return operatingRoomAppService.enableOperatingRoom(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 停用手术室
|
||||||
|
*
|
||||||
|
* @param ids 手术室ID数组
|
||||||
|
* @return 操作结果
|
||||||
|
*/
|
||||||
|
@PutMapping("/disable")
|
||||||
|
public R<?> disableOperatingRoom(@RequestBody List<Long> ids) {
|
||||||
|
return operatingRoomAppService.disableOperatingRoom(ids);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,101 @@
|
|||||||
|
package com.openhis.web.basedatamanage.dto;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
|
import com.openhis.common.annotation.Dict;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手术室DTO
|
||||||
|
*
|
||||||
|
* @author system
|
||||||
|
* @date 2026-01-04
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class OperatingRoomDto implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*/
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编码
|
||||||
|
*/
|
||||||
|
private String busNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手术室名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手术室类型
|
||||||
|
*/
|
||||||
|
@Dict(dictCode = "operating_room_type")
|
||||||
|
private Integer roomTypeEnum;
|
||||||
|
private String roomTypeEnum_dictText;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属机构ID
|
||||||
|
*/
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long organizationId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 机构名称
|
||||||
|
*/
|
||||||
|
private String organizationName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 位置描述
|
||||||
|
*/
|
||||||
|
private String locationDescription;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备配置
|
||||||
|
*/
|
||||||
|
private String equipmentConfig;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 容纳人数
|
||||||
|
*/
|
||||||
|
private Integer capacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态编码
|
||||||
|
*/
|
||||||
|
private Integer statusEnum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态描述
|
||||||
|
*/
|
||||||
|
private String statusEnum_dictText;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 显示顺序
|
||||||
|
*/
|
||||||
|
private Integer displayOrder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼音码
|
||||||
|
*/
|
||||||
|
private String pyStr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 五笔码
|
||||||
|
*/
|
||||||
|
private String wbStr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
}
|
||||||
@@ -8,6 +8,7 @@ import com.openhis.web.chargemanage.dto.CurrentDayEncounterDto;
|
|||||||
import com.openhis.web.chargemanage.dto.OrgMetadata;
|
import com.openhis.web.chargemanage.dto.OrgMetadata;
|
||||||
import com.openhis.web.chargemanage.dto.PatientMetadata;
|
import com.openhis.web.chargemanage.dto.PatientMetadata;
|
||||||
import com.openhis.web.chargemanage.dto.PractitionerMetadata;
|
import com.openhis.web.chargemanage.dto.PractitionerMetadata;
|
||||||
|
import com.openhis.web.chargemanage.dto.ReprintRegistrationDto;
|
||||||
import com.openhis.web.paymentmanage.dto.CancelRegPaymentDto;
|
import com.openhis.web.paymentmanage.dto.CancelRegPaymentDto;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
@@ -85,4 +86,12 @@ public interface IOutpatientRegistrationAppService {
|
|||||||
*/
|
*/
|
||||||
R<?> cancelRegister(Long encounterId);
|
R<?> cancelRegister(Long encounterId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 补打挂号
|
||||||
|
*
|
||||||
|
* @param reprintRegistrationDto 补打挂号信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
R<?> reprintRegistration(ReprintRegistrationDto reprintRegistrationDto);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,8 +65,16 @@ public class OutpatientPricingAppServiceImpl implements IOutpatientPricingAppSer
|
|||||||
@Override
|
@Override
|
||||||
public IPage<AdviceBaseDto> getAdviceBaseInfo(AdviceBaseDto adviceBaseDto, String searchKey, Long locationId,
|
public IPage<AdviceBaseDto> getAdviceBaseInfo(AdviceBaseDto adviceBaseDto, String searchKey, Long locationId,
|
||||||
Long organizationId, Integer pageNo, Integer pageSize) {
|
Long organizationId, Integer pageNo, Integer pageSize) {
|
||||||
|
// 根据前端传入的adviceType动态构建查询类型列表
|
||||||
|
// 如果adviceType不为空,只查询该类型;如果为空,查询所有类型(1:药品, 2:耗材, 3:诊疗)
|
||||||
|
List<Integer> adviceTypes;
|
||||||
|
if (adviceBaseDto != null && adviceBaseDto.getAdviceType() != null) {
|
||||||
|
adviceTypes = List.of(adviceBaseDto.getAdviceType());
|
||||||
|
} else {
|
||||||
|
adviceTypes = List.of(1, 2, 3);
|
||||||
|
}
|
||||||
return iDoctorStationAdviceAppService.getAdviceBaseInfo(adviceBaseDto, searchKey, locationId, null,
|
return iDoctorStationAdviceAppService.getAdviceBaseInfo(adviceBaseDto, searchKey, locationId, null,
|
||||||
organizationId, pageNo, pageSize, Whether.YES.getValue(), List.of(1, 2, 3), null);
|
organizationId, pageNo, pageSize, Whether.YES.getValue(), adviceTypes, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import com.openhis.web.chargemanage.dto.CurrentDayEncounterDto;
|
|||||||
import com.openhis.web.chargemanage.dto.OrgMetadata;
|
import com.openhis.web.chargemanage.dto.OrgMetadata;
|
||||||
import com.openhis.web.chargemanage.dto.PatientMetadata;
|
import com.openhis.web.chargemanage.dto.PatientMetadata;
|
||||||
import com.openhis.web.chargemanage.dto.PractitionerMetadata;
|
import com.openhis.web.chargemanage.dto.PractitionerMetadata;
|
||||||
|
import com.openhis.web.chargemanage.dto.ReprintRegistrationDto;
|
||||||
import com.openhis.web.chargemanage.mapper.OutpatientRegistrationAppMapper;
|
import com.openhis.web.chargemanage.mapper.OutpatientRegistrationAppMapper;
|
||||||
import com.openhis.web.paymentmanage.appservice.IPaymentRecService;
|
import com.openhis.web.paymentmanage.appservice.IPaymentRecService;
|
||||||
import com.openhis.web.paymentmanage.dto.CancelPaymentDto;
|
import com.openhis.web.paymentmanage.dto.CancelPaymentDto;
|
||||||
@@ -37,10 +38,7 @@ import org.springframework.stereotype.Service;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -119,6 +117,19 @@ public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistra
|
|||||||
List<Long> patientIdList =
|
List<Long> patientIdList =
|
||||||
iEncounterService.list().stream().map(e -> e.getPatientId()).collect(Collectors.toList());
|
iEncounterService.list().stream().map(e -> e.getPatientId()).collect(Collectors.toList());
|
||||||
|
|
||||||
|
// 一次性获取所有患者标识
|
||||||
|
List<Long> patientIds = patientMetadataPage.getRecords().stream()
|
||||||
|
.map(PatientMetadata::getId)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
final Map<Long, List<PatientIdentifier>> patientIdentifierMap;
|
||||||
|
if (!patientIds.isEmpty()) {
|
||||||
|
patientIdentifierMap = patientIdentifierService.list(
|
||||||
|
new LambdaQueryWrapper<PatientIdentifier>().in(PatientIdentifier::getPatientId, patientIds)
|
||||||
|
).stream().collect(Collectors.groupingBy(PatientIdentifier::getPatientId));
|
||||||
|
} else {
|
||||||
|
patientIdentifierMap = new HashMap<>();
|
||||||
|
}
|
||||||
|
|
||||||
patientMetadataPage.getRecords().forEach(e -> {
|
patientMetadataPage.getRecords().forEach(e -> {
|
||||||
// 性别枚举
|
// 性别枚举
|
||||||
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
|
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
|
||||||
@@ -127,9 +138,8 @@ public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistra
|
|||||||
// 初复诊
|
// 初复诊
|
||||||
e.setFirstEnum_enumText(patientIdList.contains(e.getId()) ? EncounterType.FOLLOW_UP.getInfo()
|
e.setFirstEnum_enumText(patientIdList.contains(e.getId()) ? EncounterType.FOLLOW_UP.getInfo()
|
||||||
: EncounterType.INITIAL.getInfo());
|
: EncounterType.INITIAL.getInfo());
|
||||||
// 患者标识
|
// 患者标识 - 从Map中获取,避免N+1查询
|
||||||
List<PatientIdentifier> patientIdentifiers = patientIdentifierService
|
List<PatientIdentifier> patientIdentifiers = patientIdentifierMap.get(e.getId());
|
||||||
.list(new LambdaQueryWrapper<PatientIdentifier>().eq(PatientIdentifier::getPatientId, e.getId()));
|
|
||||||
if (patientIdentifiers != null && !patientIdentifiers.isEmpty()) {
|
if (patientIdentifiers != null && !patientIdentifiers.isEmpty()) {
|
||||||
// 取第一个标识号,如果需要可以根据业务需求选择其他逻辑
|
// 取第一个标识号,如果需要可以根据业务需求选择其他逻辑
|
||||||
e.setIdentifierNo(patientIdentifiers.get(0).getIdentifierNo());
|
e.setIdentifierNo(patientIdentifiers.get(0).getIdentifierNo());
|
||||||
@@ -274,7 +284,7 @@ public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistra
|
|||||||
HttpServletRequest request) {
|
HttpServletRequest request) {
|
||||||
// 构建查询条件
|
// 构建查询条件
|
||||||
QueryWrapper<CurrentDayEncounterDto> queryWrapper = HisQueryUtils.buildQueryWrapper(null, searchKey,
|
QueryWrapper<CurrentDayEncounterDto> queryWrapper = HisQueryUtils.buildQueryWrapper(null, searchKey,
|
||||||
new HashSet<>(Arrays.asList("patient_name", "organization_name", "practitioner_name", "healthcare_name")),
|
new HashSet<>(Arrays.asList("patient_name", "organization_name", "practitioner_name", "healthcare_name", "identifier_no")),
|
||||||
request);
|
request);
|
||||||
|
|
||||||
// 手动处理 statusEnum 参数(用于过滤退号记录)
|
// 手动处理 statusEnum 参数(用于过滤退号记录)
|
||||||
@@ -321,4 +331,18 @@ public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistra
|
|||||||
return R.ok("已取消挂号");
|
return R.ok("已取消挂号");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 补打挂号
|
||||||
|
* 补打挂号不需要修改数据库,只需要返回成功即可,前端已有所有需要的数据用于打印
|
||||||
|
*
|
||||||
|
* @param reprintRegistrationDto 补打挂号信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public R<?> reprintRegistration(ReprintRegistrationDto reprintRegistrationDto) {
|
||||||
|
// 补打挂号只是重新打印,不需要修改数据库
|
||||||
|
// 可以在这里添加日志记录补打操作
|
||||||
|
return R.ok(null, "补打挂号成功");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import com.openhis.common.enums.PriorityLevel;
|
|||||||
import com.openhis.financial.domain.PaymentReconciliation;
|
import com.openhis.financial.domain.PaymentReconciliation;
|
||||||
import com.openhis.web.chargemanage.appservice.IOutpatientRegistrationAppService;
|
import com.openhis.web.chargemanage.appservice.IOutpatientRegistrationAppService;
|
||||||
import com.openhis.web.chargemanage.dto.OutpatientRegistrationInitDto;
|
import com.openhis.web.chargemanage.dto.OutpatientRegistrationInitDto;
|
||||||
|
import com.openhis.web.chargemanage.dto.ReprintRegistrationDto;
|
||||||
import com.openhis.web.paymentmanage.appservice.IEleInvoiceService;
|
import com.openhis.web.paymentmanage.appservice.IEleInvoiceService;
|
||||||
import com.openhis.web.paymentmanage.dto.CancelRegPaymentDto;
|
import com.openhis.web.paymentmanage.dto.CancelRegPaymentDto;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
@@ -151,4 +152,15 @@ public class OutpatientRegistrationController {
|
|||||||
return R.ok(iOutpatientRegistrationAppService.getCurrentDayEncounter(searchKey, pageNo, pageSize, request));
|
return R.ok(iOutpatientRegistrationAppService.getCurrentDayEncounter(searchKey, pageNo, pageSize, request));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 补打挂号
|
||||||
|
*
|
||||||
|
* @param reprintRegistrationDto 补打挂号信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@PostMapping(value = "/reprint")
|
||||||
|
public R<?> reprintRegistration(@RequestBody ReprintRegistrationDto reprintRegistrationDto) {
|
||||||
|
return iOutpatientRegistrationAppService.reprintRegistration(reprintRegistrationDto);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -136,4 +136,14 @@ public class CurrentDayEncounterDto {
|
|||||||
*/
|
*/
|
||||||
private String phone;
|
private String phone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 就诊卡号
|
||||||
|
*/
|
||||||
|
private String identifierNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流水号(就诊当日序号)
|
||||||
|
*/
|
||||||
|
private Integer displayOrder;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,71 @@
|
|||||||
|
package com.openhis.web.chargemanage.dto;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 补打挂号 DTO
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class ReprintRegistrationDto {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 就诊ID
|
||||||
|
*/
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long encounterId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 就诊卡号
|
||||||
|
*/
|
||||||
|
private String cardNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 患者姓名
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 挂号科室
|
||||||
|
*/
|
||||||
|
private String organizationName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 医生姓名
|
||||||
|
*/
|
||||||
|
private String practitionerName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 挂号费
|
||||||
|
*/
|
||||||
|
private BigDecimal price;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 诊疗费
|
||||||
|
*/
|
||||||
|
private BigDecimal activityPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 病历费
|
||||||
|
*/
|
||||||
|
private BigDecimal medicalRecordFee;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合计
|
||||||
|
*/
|
||||||
|
private BigDecimal totalPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约/挂号时间
|
||||||
|
*/
|
||||||
|
private String visitTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -4,7 +4,7 @@ import com.core.common.core.domain.R;
|
|||||||
import com.openhis.check.domain.LisGroupInfo;
|
import com.openhis.check.domain.LisGroupInfo;
|
||||||
|
|
||||||
public interface ILisGroupInfoAppService {
|
public interface ILisGroupInfoAppService {
|
||||||
R<?> getLisGroupInfoList();
|
R<?> getLisGroupInfoList(Integer pageNum, Integer pageSize);
|
||||||
|
|
||||||
R<?> add(LisGroupInfo lisGroupInfo);
|
R<?> add(LisGroupInfo lisGroupInfo);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.openhis.web.check.appservice.impl;
|
package com.openhis.web.check.appservice.impl;
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.core.common.core.domain.R;
|
import com.core.common.core.domain.R;
|
||||||
import com.openhis.check.domain.LisGroupInfo;
|
import com.openhis.check.domain.LisGroupInfo;
|
||||||
import com.openhis.check.service.ILisGroupInfoService;
|
import com.openhis.check.service.ILisGroupInfoService;
|
||||||
@@ -17,11 +18,14 @@ public class LisGroupInfoAppServiceImpl implements ILisGroupInfoAppService {
|
|||||||
@Resource
|
@Resource
|
||||||
private ILisGroupInfoService lisGroupInfoService;
|
private ILisGroupInfoService lisGroupInfoService;
|
||||||
@Override
|
@Override
|
||||||
public R<?> getLisGroupInfoList() {
|
public R<?> getLisGroupInfoList(Integer pageNum, Integer pageSize) {
|
||||||
List<LisGroupInfo> list = lisGroupInfoService.list();
|
Page<LisGroupInfo> page = new Page<>(pageNum, pageSize);
|
||||||
|
Page<LisGroupInfo> list = lisGroupInfoService.page(page);
|
||||||
return R.ok(list);
|
return R.ok(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public R<?> add(LisGroupInfo lisGroupInfo) {
|
public R<?> add(LisGroupInfo lisGroupInfo) {
|
||||||
if (ObjectUtil.isEmpty(lisGroupInfo)) {
|
if (ObjectUtil.isEmpty(lisGroupInfo)) {
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ public class LisGroupInfoController {
|
|||||||
*
|
*
|
||||||
* */
|
* */
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public R<?> getLisGroupInfoList(){
|
public R<?> getLisGroupInfoList(@RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "10") Integer pageSize){
|
||||||
return R.ok(lisGroupInfoAppService.getLisGroupInfoList());
|
return R.ok(lisGroupInfoAppService.getLisGroupInfoList(pageNum, pageSize));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -2,8 +2,11 @@ package com.openhis.web.clinicalmanage.appservice;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.core.common.core.domain.R;
|
import com.core.common.core.domain.R;
|
||||||
|
import com.openhis.administration.domain.Encounter;
|
||||||
import com.openhis.web.clinicalmanage.dto.SurgeryDto;
|
import com.openhis.web.clinicalmanage.dto.SurgeryDto;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 手术管理应用Service接口
|
* 手术管理应用Service接口
|
||||||
*
|
*
|
||||||
@@ -62,4 +65,12 @@ public interface ISurgeryAppService {
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
R<?> updateSurgeryStatus(Long id, Integer statusEnum);
|
R<?> updateSurgeryStatus(Long id, Integer statusEnum);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据患者ID查询就诊列表
|
||||||
|
*
|
||||||
|
* @param patientId 患者ID
|
||||||
|
* @return 就诊列表
|
||||||
|
*/
|
||||||
|
R<List<Encounter>> getEncounterListByPatientId(Long patientId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,29 +5,53 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.core.common.core.domain.R;
|
import com.core.common.core.domain.R;
|
||||||
|
import com.core.common.core.domain.entity.SysUser;
|
||||||
import com.core.common.utils.MessageUtils;
|
import com.core.common.utils.MessageUtils;
|
||||||
|
import com.core.common.utils.SecurityUtils;
|
||||||
|
import com.core.system.service.ISysUserService;
|
||||||
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import com.openhis.administration.domain.ChargeItem;
|
||||||
|
import com.openhis.administration.domain.Encounter;
|
||||||
|
import com.openhis.administration.domain.OperatingRoom;
|
||||||
|
import com.openhis.administration.domain.Organization;
|
||||||
import com.openhis.administration.domain.Patient;
|
import com.openhis.administration.domain.Patient;
|
||||||
|
import com.openhis.administration.service.IAccountService;
|
||||||
|
import com.openhis.administration.service.IChargeItemService;
|
||||||
|
import com.openhis.administration.service.IEncounterService;
|
||||||
|
import com.openhis.administration.service.IOrganizationService;
|
||||||
|
import com.openhis.administration.service.IOperatingRoomService;
|
||||||
import com.openhis.administration.service.IPatientService;
|
import com.openhis.administration.service.IPatientService;
|
||||||
import com.openhis.common.constant.PromptMsgConstant;
|
|
||||||
import com.openhis.clinical.domain.Surgery;
|
import com.openhis.clinical.domain.Surgery;
|
||||||
import com.openhis.clinical.service.ISurgeryService;
|
import com.openhis.clinical.service.ISurgeryService;
|
||||||
|
import com.openhis.common.constant.CommonConstants;
|
||||||
|
import com.openhis.common.constant.PromptMsgConstant;
|
||||||
|
import com.openhis.common.enums.ChargeItemStatus;
|
||||||
|
import com.openhis.common.enums.GenerateSource;
|
||||||
|
import com.openhis.common.enums.RequestStatus;
|
||||||
|
import com.openhis.common.enums.TherapyTimeType;
|
||||||
import com.openhis.common.utils.HisQueryUtils;
|
import com.openhis.common.utils.HisQueryUtils;
|
||||||
|
import com.openhis.common.utils.RedisKeys;
|
||||||
|
import com.core.common.core.redis.RedisCache;
|
||||||
|
import com.openhis.document.domain.RequestForm;
|
||||||
|
import com.openhis.document.service.IRequestFormService;
|
||||||
import com.openhis.web.clinicalmanage.appservice.ISurgeryAppService;
|
import com.openhis.web.clinicalmanage.appservice.ISurgeryAppService;
|
||||||
import com.openhis.web.clinicalmanage.dto.SurgeryDto;
|
import com.openhis.web.clinicalmanage.dto.SurgeryDto;
|
||||||
import com.openhis.web.clinicalmanage.mapper.SurgeryAppMapper;
|
import com.openhis.web.clinicalmanage.mapper.SurgeryAppMapper;
|
||||||
|
import com.openhis.workflow.domain.ServiceRequest;
|
||||||
|
import com.openhis.workflow.service.IActivityDefinitionService;
|
||||||
|
import com.openhis.workflow.service.IServiceRequestService;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.Date;
|
import java.math.BigDecimal;
|
||||||
import java.util.HashSet;
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import static com.core.framework.datasource.DynamicDataSourceContextHolder.log;
|
||||||
|
|
||||||
/**
|
|
||||||
* 手术管理应用Service业务层处理
|
|
||||||
*
|
|
||||||
* @author system
|
|
||||||
* @date 2025-12-30
|
|
||||||
*/
|
|
||||||
@Service
|
@Service
|
||||||
public class SurgeryAppServiceImpl implements ISurgeryAppService {
|
public class SurgeryAppServiceImpl implements ISurgeryAppService {
|
||||||
|
|
||||||
@@ -40,8 +64,40 @@ public class SurgeryAppServiceImpl implements ISurgeryAppService {
|
|||||||
@Resource
|
@Resource
|
||||||
private IPatientService patientService;
|
private IPatientService patientService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IEncounterService encounterService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IRequestFormService requestFormService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IServiceRequestService serviceRequestService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IChargeItemService chargeItemService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IActivityDefinitionService activityDefinitionService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IAccountService accountService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IOrganizationService organizationService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ISysUserService sysUserService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IOperatingRoomService operatingRoomService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private com.openhis.administration.service.IPractitionerService practitionerService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private RedisCache redisCache;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询手术列表
|
|
||||||
*
|
*
|
||||||
* @param surgeryDto 查询条件
|
* @param surgeryDto 查询条件
|
||||||
* @param pageNo 当前页
|
* @param pageNo 当前页
|
||||||
@@ -71,10 +127,51 @@ public class SurgeryAppServiceImpl implements ISurgeryAppService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public R<SurgeryDto> getSurgeryDetail(Long id) {
|
public R<SurgeryDto> getSurgeryDetail(Long id) {
|
||||||
|
String cacheKey = RedisKeys.getSurgeryKey(id);
|
||||||
|
Object cachedObject = redisCache.getCacheObject(cacheKey);
|
||||||
|
|
||||||
|
// 先从Redis缓存中获取
|
||||||
|
if (cachedObject != null) {
|
||||||
|
if (cachedObject instanceof SurgeryDto) {
|
||||||
|
SurgeryDto surgeryDto = (SurgeryDto) cachedObject;
|
||||||
|
log.info("从Redis缓存中获取手术信息 - surgeryId: {}", id);
|
||||||
|
return R.ok(surgeryDto);
|
||||||
|
} else {
|
||||||
|
log.warn("Redis缓存中手术信息类型不匹配 - surgeryId: {}", id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 缓存中没有,从数据库查询
|
||||||
SurgeryDto surgeryDto = surgeryAppMapper.getSurgeryDetail(id);
|
SurgeryDto surgeryDto = surgeryAppMapper.getSurgeryDetail(id);
|
||||||
if (surgeryDto == null) {
|
if (surgeryDto == null) {
|
||||||
return R.fail("手术信息不存在");
|
return R.fail("手术信息不存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 从申请单中获取次要手术信息
|
||||||
|
if (surgeryDto.getSurgeryNo() != null) {
|
||||||
|
LambdaQueryWrapper<RequestForm> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(RequestForm::getPrescriptionNo, surgeryDto.getSurgeryNo());
|
||||||
|
RequestForm requestForm = requestFormService.getOne(queryWrapper);
|
||||||
|
if (requestForm != null && requestForm.getDescJson() != null) {
|
||||||
|
try {
|
||||||
|
Map<String, Object> map = new ObjectMapper().readValue(requestForm.getDescJson(), Map.class);
|
||||||
|
if (map.containsKey("secondarySurgeries")) {
|
||||||
|
surgeryDto.setSecondarySurgeries((List<Map<String, Object>>) map.get("secondarySurgeries"));
|
||||||
|
}
|
||||||
|
// 增加手术指征的回显兜底(从JSON中加载)
|
||||||
|
if (map.containsKey("surgeryIndication") && (surgeryDto.getSurgeryIndication() == null || surgeryDto.getSurgeryIndication().isEmpty())) {
|
||||||
|
surgeryDto.setSurgeryIndication((String) map.get("surgeryIndication"));
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("解析手术申请单JSON失败", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 将查询结果存入Redis缓存(缓存30分钟)
|
||||||
|
redisCache.setCacheObject(cacheKey, surgeryDto, 30, java.util.concurrent.TimeUnit.MINUTES);
|
||||||
|
log.info("从数据库查询手术信息并存入Redis缓存 - surgeryId: {}", id);
|
||||||
|
|
||||||
return R.ok(surgeryDto);
|
return R.ok(surgeryDto);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,6 +182,7 @@ public class SurgeryAppServiceImpl implements ISurgeryAppService {
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public R<?> addSurgery(SurgeryDto surgeryDto) {
|
public R<?> addSurgery(SurgeryDto surgeryDto) {
|
||||||
// 校验患者是否存在
|
// 校验患者是否存在
|
||||||
Patient patient = patientService.getById(surgeryDto.getPatientId());
|
Patient patient = patientService.getById(surgeryDto.getPatientId());
|
||||||
@@ -92,14 +190,183 @@ public class SurgeryAppServiceImpl implements ISurgeryAppService {
|
|||||||
return R.fail("患者信息不存在");
|
return R.fail("患者信息不存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 校验就诊ID是否存在
|
||||||
|
if (surgeryDto.getEncounterId() == null) {
|
||||||
|
return R.fail("请选择就诊流水号");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 校验就诊记录是否存在
|
||||||
|
Encounter encounter = encounterService.getById(surgeryDto.getEncounterId());
|
||||||
|
if (encounter == null) {
|
||||||
|
return R.fail("就诊记录不存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取患者的自费账户ID
|
||||||
|
Long accountId = accountService.getSelfPayAccount(surgeryDto.getEncounterId());
|
||||||
|
if (accountId == null) {
|
||||||
|
return R.fail("未找到患者的账户信息,请先完成挂号或住院登记");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 当前登录账号的科室id
|
||||||
|
Long orgId = SecurityUtils.getLoginUser().getOrgId();
|
||||||
|
// 当前参与者ID
|
||||||
|
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||||
|
// 当前用户ID
|
||||||
|
Long userId = SecurityUtils.getLoginUser().getUserId();
|
||||||
|
// 当前时间
|
||||||
|
Date curDate = new Date();
|
||||||
|
|
||||||
|
// 获取申请医生姓名(从当前登录用户信息中获取)
|
||||||
|
String applyDoctorName = SecurityUtils.getLoginUser().getUser().getNickName();
|
||||||
|
|
||||||
|
// 获取申请科室名称
|
||||||
|
String applyDeptName = null;
|
||||||
|
// 优先从用户信息的部门中获取
|
||||||
|
if (SecurityUtils.getLoginUser().getUser().getDept() != null) {
|
||||||
|
applyDeptName = SecurityUtils.getLoginUser().getUser().getDept().getDeptName();
|
||||||
|
}
|
||||||
|
// 如果用户信息中没有部门名称,则从机构表中查询
|
||||||
|
if (applyDeptName == null && orgId != null) {
|
||||||
|
Organization org = organizationService.getById(orgId);
|
||||||
|
if (org != null) {
|
||||||
|
applyDeptName = org.getName();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 转换为实体对象
|
// 转换为实体对象
|
||||||
Surgery surgery = new Surgery();
|
Surgery surgery = new Surgery();
|
||||||
BeanUtils.copyProperties(surgeryDto, surgery);
|
BeanUtils.copyProperties(surgeryDto, surgery);
|
||||||
|
|
||||||
|
// 清空名称字段,确保从ID重新查询并填充
|
||||||
|
surgery.setPatientName(null);
|
||||||
|
surgery.setMainSurgeonName(null);
|
||||||
|
surgery.setAnesthetistName(null);
|
||||||
|
surgery.setAssistant1Name(null);
|
||||||
|
surgery.setAssistant2Name(null);
|
||||||
|
surgery.setScrubNurseName(null);
|
||||||
|
surgery.setOperatingRoomName(null);
|
||||||
|
surgery.setOrgName(null);
|
||||||
|
surgery.setApplyDoctorName(null);
|
||||||
|
surgery.setApplyDeptName(null);
|
||||||
|
|
||||||
|
// 设置申请医生信息(默认使用当前登录医生)
|
||||||
|
// 注意:必须放在 copyProperties 之后,确保覆盖前端可能传递的空值
|
||||||
|
log.info("设置申请医生信息 - doctorId: {}, doctorName: {}, deptId: {}, deptName: {}",
|
||||||
|
practitionerId, applyDoctorName, orgId, applyDeptName);
|
||||||
|
log.info("前端提交的数据 - applyDoctorId: {}, applyDoctorName: {}, applyDeptId: {}, applyDeptName: {}",
|
||||||
|
surgeryDto.getApplyDoctorId(), surgeryDto.getApplyDoctorName(), surgeryDto.getApplyDeptId(), surgeryDto.getApplyDeptName());
|
||||||
|
|
||||||
|
surgery.setApplyDoctorId(practitionerId);
|
||||||
|
surgery.setApplyDoctorName(applyDoctorName);
|
||||||
|
surgery.setApplyDeptId(orgId);
|
||||||
|
surgery.setApplyDeptName(applyDeptName);
|
||||||
|
|
||||||
|
// 填充其他人员字段的名称
|
||||||
|
fillSurgeryNameFields(surgery);
|
||||||
|
|
||||||
|
// 设置创建者ID(因为数据库中 create_by 是 bigint 类型)
|
||||||
|
// 这个值会被 MybastisColumnsHandler 自动填充,所以这里不需要设置
|
||||||
|
|
||||||
|
log.info("准备插入手术记录 - applyDoctorId: {}, applyDoctorName: {}, applyDeptId: {}, applyDeptName: {}",
|
||||||
|
surgery.getApplyDoctorId(), surgery.getApplyDoctorName(), surgery.getApplyDeptId(), surgery.getApplyDeptName());
|
||||||
|
log.info("准备插入手术记录 - mainSurgeonId: {}, mainSurgeonName: {}, anesthetistId: {}, anesthetistName: {}",
|
||||||
|
surgery.getMainSurgeonId(), surgery.getMainSurgeonName(), surgery.getAnesthetistId(), surgery.getAnesthetistName());
|
||||||
|
log.info("准备插入手术记录 - assistant1Id: {}, assistant1Name: {}, assistant2Id: {}, assistant2Name: {}",
|
||||||
|
surgery.getAssistant1Id(), surgery.getAssistant1Name(), surgery.getAssistant2Id(), surgery.getAssistant2Name());
|
||||||
|
log.info("准备插入手术记录 - operatingRoomId: {}, operatingRoomName: {}, orgId: {}, orgName: {}",
|
||||||
|
surgery.getOperatingRoomId(), surgery.getOperatingRoomName(), surgery.getOrgId(), surgery.getOrgName());
|
||||||
|
|
||||||
Long surgeryId = surgeryService.insertSurgery(surgery);
|
Long surgeryId = surgeryService.insertSurgery(surgery);
|
||||||
|
|
||||||
|
log.info("手术记录插入成功 - surgeryId: {}, surgeryNo: {}", surgeryId, surgery.getSurgeryNo());
|
||||||
|
|
||||||
|
// 生成处方号(医嘱号)
|
||||||
|
String prescriptionNo = surgery.getSurgeryNo();
|
||||||
|
|
||||||
|
// 保存申请单
|
||||||
|
RequestForm requestForm = new RequestForm();
|
||||||
|
requestForm.setTypeCode("SURGERY"); // 申请单类型
|
||||||
|
requestForm.setPrescriptionNo(prescriptionNo); // 处方号(使用手术单号)
|
||||||
|
requestForm.setName("手术申请单"); // 名称
|
||||||
|
requestForm.setEncounterId(surgeryDto.getEncounterId()); // 就诊ID
|
||||||
|
requestForm.setRequesterId(practitionerId); // 申请人
|
||||||
|
requestForm.setDescJson(buildDescJson(surgeryDto)); // 描述内容
|
||||||
|
requestFormService.save(requestForm);
|
||||||
|
|
||||||
|
// 生成手术医嘱
|
||||||
|
ServiceRequest serviceRequest = new ServiceRequest();
|
||||||
|
serviceRequest.setStatusEnum(RequestStatus.DRAFT.getValue());
|
||||||
|
serviceRequest.setBusNo(String.format("%04d", (int) (Math.random() * 10000)));
|
||||||
|
serviceRequest.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue()); // 生成来源
|
||||||
|
serviceRequest.setPrescriptionNo(prescriptionNo);
|
||||||
|
serviceRequest.setTherapyEnum(TherapyTimeType.TEMPORARY.getValue());// 治疗类型
|
||||||
|
serviceRequest.setQuantity(BigDecimal.valueOf(1)); // 请求数量
|
||||||
|
serviceRequest.setUnitCode("次"); // 请求单位编码
|
||||||
|
serviceRequest.setCategoryEnum(4); // 请求类型:4-手术
|
||||||
|
serviceRequest.setActivityId(surgeryId); // 手术ID作为诊疗定义id
|
||||||
|
serviceRequest.setPatientId(surgeryDto.getPatientId()); // 患者
|
||||||
|
serviceRequest.setRequesterId(practitionerId); // 开方医生
|
||||||
|
serviceRequest.setEncounterId(surgeryDto.getEncounterId()); // 就诊id
|
||||||
|
serviceRequest.setAuthoredTime(curDate); // 请求签发时间
|
||||||
|
serviceRequest.setOrgId(orgId); // 执行科室
|
||||||
|
serviceRequestService.save(serviceRequest);
|
||||||
|
|
||||||
|
// 生成收费项目
|
||||||
|
ChargeItem chargeItem = new ChargeItem();
|
||||||
|
chargeItem.setStatusEnum(ChargeItemStatus.DRAFT.getValue()); // 收费状态
|
||||||
|
chargeItem.setBusNo("CI" + serviceRequest.getBusNo());
|
||||||
|
chargeItem.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue()); // 生成来源
|
||||||
|
chargeItem.setPatientId(surgeryDto.getPatientId()); // 患者
|
||||||
|
chargeItem.setContextEnum(3); // 类型:3-诊疗
|
||||||
|
chargeItem.setEncounterId(surgeryDto.getEncounterId()); // 就诊id
|
||||||
|
chargeItem.setAccountId(accountId); // 账户ID
|
||||||
|
chargeItem.setDefinitionId(surgeryId); // 手术ID作为费用定价ID
|
||||||
|
chargeItem.setEntererId(practitionerId);// 开立人ID
|
||||||
|
chargeItem.setEnteredDate(curDate); // 开立时间
|
||||||
|
chargeItem.setServiceTable(CommonConstants.TableName.WOR_SERVICE_REQUEST);// 医疗服务类型
|
||||||
|
chargeItem.setServiceId(serviceRequest.getId()); // 医疗服务ID
|
||||||
|
chargeItem.setProductTable("cli_surgery");// 手术表
|
||||||
|
chargeItem.setProductId(surgeryId);// 手术ID作为收费项id
|
||||||
|
chargeItem.setRequestingOrgId(orgId); // 开立科室
|
||||||
|
chargeItem.setQuantityValue(BigDecimal.valueOf(1)); // 数量
|
||||||
|
chargeItem.setQuantityUnit("次"); // 单位
|
||||||
|
chargeItem.setUnitPrice(surgeryDto.getSurgeryFee() != null ? surgeryDto.getSurgeryFee() : new BigDecimal("0.0")); // 单价
|
||||||
|
chargeItem.setTotalPrice(surgeryDto.getTotalFee() != null ? surgeryDto.getTotalFee() : new BigDecimal("0.0")); // 总价
|
||||||
|
chargeItemService.save(chargeItem);
|
||||||
|
|
||||||
|
// 清除相关缓存
|
||||||
|
clearSurgeryAppCache(surgery);
|
||||||
|
|
||||||
return R.ok(surgeryId, MessageUtils.createMessage(PromptMsgConstant.Common.M00001, new Object[]{"手术信息"}));
|
return R.ok(surgeryId, MessageUtils.createMessage(PromptMsgConstant.Common.M00001, new Object[]{"手术信息"}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构建描述JSON
|
||||||
|
*
|
||||||
|
* @param surgeryDto 手术信息
|
||||||
|
* @return JSON字符串
|
||||||
|
*/
|
||||||
|
private String buildDescJson(SurgeryDto surgeryDto) {
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
map.put("surgeryName", surgeryDto.getSurgeryName() != null ? surgeryDto.getSurgeryName() : "");
|
||||||
|
map.put("surgeryCode", surgeryDto.getSurgeryCode() != null ? surgeryDto.getSurgeryCode() : "");
|
||||||
|
map.put("surgeryLevel", surgeryDto.getSurgeryLevel() != null ? surgeryDto.getSurgeryLevel() : "");
|
||||||
|
map.put("surgeryIndication", surgeryDto.getSurgeryIndication() != null ? surgeryDto.getSurgeryIndication() : "");
|
||||||
|
map.put("preoperativeDiagnosis", surgeryDto.getPreoperativeDiagnosis() != null ? surgeryDto.getPreoperativeDiagnosis() : "");
|
||||||
|
|
||||||
|
// 加入次要手术信息
|
||||||
|
if (surgeryDto.getSecondarySurgeries() != null && !surgeryDto.getSecondarySurgeries().isEmpty()) {
|
||||||
|
map.put("secondarySurgeries", surgeryDto.getSecondarySurgeries());
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
return new ObjectMapper().writeValueAsString(map);
|
||||||
|
} catch (JsonProcessingException e) {
|
||||||
|
log.error("构建手术申请单JSON失败", e);
|
||||||
|
return "{}";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改手术信息
|
* 修改手术信息
|
||||||
*
|
*
|
||||||
@@ -118,7 +385,37 @@ public class SurgeryAppServiceImpl implements ISurgeryAppService {
|
|||||||
Surgery surgery = new Surgery();
|
Surgery surgery = new Surgery();
|
||||||
BeanUtils.copyProperties(surgeryDto, surgery);
|
BeanUtils.copyProperties(surgeryDto, surgery);
|
||||||
|
|
||||||
|
// 先清空名称字段,确保重新填充
|
||||||
|
surgery.setPatientName(null);
|
||||||
|
surgery.setMainSurgeonName(null);
|
||||||
|
surgery.setAnesthetistName(null);
|
||||||
|
surgery.setAssistant1Name(null);
|
||||||
|
surgery.setAssistant2Name(null);
|
||||||
|
surgery.setScrubNurseName(null);
|
||||||
|
surgery.setOperatingRoomName(null);
|
||||||
|
surgery.setOrgName(null);
|
||||||
|
surgery.setApplyDoctorName(null);
|
||||||
|
surgery.setApplyDeptName(null);
|
||||||
|
|
||||||
|
// 填充其他人员字段的名称
|
||||||
|
fillSurgeryNameFields(surgery);
|
||||||
|
|
||||||
surgeryService.updateSurgery(surgery);
|
surgeryService.updateSurgery(surgery);
|
||||||
|
|
||||||
|
// 同步更新申请单中的描述内容
|
||||||
|
if (surgery.getSurgeryNo() != null) {
|
||||||
|
LambdaQueryWrapper<RequestForm> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(RequestForm::getPrescriptionNo, surgery.getSurgeryNo());
|
||||||
|
RequestForm requestForm = requestFormService.getOne(queryWrapper);
|
||||||
|
if (requestForm != null) {
|
||||||
|
requestForm.setDescJson(buildDescJson(surgeryDto));
|
||||||
|
requestFormService.updateById(requestForm);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 清除相关缓存
|
||||||
|
clearSurgeryAppCache(surgery);
|
||||||
|
|
||||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"手术信息"}));
|
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"手术信息"}));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -142,6 +439,10 @@ public class SurgeryAppServiceImpl implements ISurgeryAppService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
surgeryService.deleteSurgery(id);
|
surgeryService.deleteSurgery(id);
|
||||||
|
|
||||||
|
// 清除相关缓存
|
||||||
|
clearSurgeryAppCache(existSurgery);
|
||||||
|
|
||||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00005, new Object[]{"手术信息"}));
|
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00005, new Object[]{"手术信息"}));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -161,6 +462,158 @@ public class SurgeryAppServiceImpl implements ISurgeryAppService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
surgeryService.updateSurgeryStatus(id, statusEnum);
|
surgeryService.updateSurgeryStatus(id, statusEnum);
|
||||||
|
|
||||||
|
// 清除相关缓存
|
||||||
|
clearSurgeryAppCache(existSurgery);
|
||||||
|
|
||||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[]{"手术状态"}));
|
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[]{"手术状态"}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据患者ID查询就诊列表
|
||||||
|
*
|
||||||
|
* @param patientId 患者ID
|
||||||
|
* @return 就诊列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public R<List<Encounter>> getEncounterListByPatientId(Long patientId) {
|
||||||
|
if (patientId == null) {
|
||||||
|
return R.fail("患者ID不能为空");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询该患者的所有就诊记录(进行中的优先)
|
||||||
|
QueryWrapper<Encounter> wrapper = new QueryWrapper<>();
|
||||||
|
wrapper.eq("patient_id", patientId)
|
||||||
|
.in("status_enum", 2, 3) // 2-进行中, 3-已完成
|
||||||
|
.orderByAsc("CASE WHEN status_enum = 2 THEN 0 ELSE 1 END") // 进行中的排在前面
|
||||||
|
.orderByDesc("start_time"); // 按开始时间倒序
|
||||||
|
|
||||||
|
List<Encounter> encounterList = encounterService.list(wrapper);
|
||||||
|
|
||||||
|
if (encounterList == null || encounterList.isEmpty()) {
|
||||||
|
return R.fail("该患者暂无就诊记录,请先挂号或办理住院");
|
||||||
|
}
|
||||||
|
|
||||||
|
return R.ok(encounterList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 填充手术记录中的名称字段
|
||||||
|
* 根据ID反向查询用户表、机构表、手术室表、患者表、就诊表,填充对应的名称字段
|
||||||
|
*
|
||||||
|
* @param surgery 手术实体对象
|
||||||
|
*/
|
||||||
|
private void fillSurgeryNameFields(Surgery surgery) {
|
||||||
|
// 填充患者姓名
|
||||||
|
if (surgery.getPatientId() != null) {
|
||||||
|
Patient patient = patientService.getById(surgery.getPatientId());
|
||||||
|
if (patient != null) {
|
||||||
|
surgery.setPatientName(patient.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 填充主刀医生姓名(使用practitionerId查询Practitioner表)
|
||||||
|
if (surgery.getMainSurgeonId() != null) {
|
||||||
|
com.openhis.administration.domain.Practitioner mainSurgeon = practitionerService.getById(surgery.getMainSurgeonId());
|
||||||
|
if (mainSurgeon != null) {
|
||||||
|
surgery.setMainSurgeonName(mainSurgeon.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 填充麻醉医生姓名(使用practitionerId查询Practitioner表)
|
||||||
|
if (surgery.getAnesthetistId() != null) {
|
||||||
|
com.openhis.administration.domain.Practitioner anesthetist = practitionerService.getById(surgery.getAnesthetistId());
|
||||||
|
if (anesthetist != null) {
|
||||||
|
surgery.setAnesthetistName(anesthetist.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 填充助手1姓名(使用practitionerId查询Practitioner表)
|
||||||
|
if (surgery.getAssistant1Id() != null) {
|
||||||
|
com.openhis.administration.domain.Practitioner assistant1 = practitionerService.getById(surgery.getAssistant1Id());
|
||||||
|
if (assistant1 != null) {
|
||||||
|
surgery.setAssistant1Name(assistant1.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 填充助手2姓名(使用practitionerId查询Practitioner表)
|
||||||
|
if (surgery.getAssistant2Id() != null) {
|
||||||
|
com.openhis.administration.domain.Practitioner assistant2 = practitionerService.getById(surgery.getAssistant2Id());
|
||||||
|
if (assistant2 != null) {
|
||||||
|
surgery.setAssistant2Name(assistant2.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 填充巡回护士姓名(使用practitionerId查询Practitioner表)
|
||||||
|
if (surgery.getScrubNurseId() != null) {
|
||||||
|
com.openhis.administration.domain.Practitioner scrubNurse = practitionerService.getById(surgery.getScrubNurseId());
|
||||||
|
if (scrubNurse != null) {
|
||||||
|
surgery.setScrubNurseName(scrubNurse.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 填充手术室名称
|
||||||
|
if (surgery.getOperatingRoomId() != null) {
|
||||||
|
OperatingRoom operatingRoom = operatingRoomService.getById(surgery.getOperatingRoomId());
|
||||||
|
if (operatingRoom != null) {
|
||||||
|
surgery.setOperatingRoomName(operatingRoom.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 填充执行科室名称
|
||||||
|
if (surgery.getOrgId() != null) {
|
||||||
|
Organization org = organizationService.getById(surgery.getOrgId());
|
||||||
|
if (org != null) {
|
||||||
|
surgery.setOrgName(org.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 填充申请科室名称(如果还没有设置)
|
||||||
|
if (surgery.getApplyDeptId() != null && (surgery.getApplyDeptName() == null || surgery.getApplyDeptName().isEmpty())) {
|
||||||
|
Organization applyDept = organizationService.getById(surgery.getApplyDeptId());
|
||||||
|
if (applyDept != null) {
|
||||||
|
surgery.setApplyDeptName(applyDept.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 填充申请医生姓名(如果还没有设置) - 使用practitionerId查询Practitioner表
|
||||||
|
if (surgery.getApplyDoctorId() != null && (surgery.getApplyDoctorName() == null || surgery.getApplyDoctorName().isEmpty())) {
|
||||||
|
com.openhis.administration.domain.Practitioner applyDoctor = practitionerService.getById(surgery.getApplyDoctorId());
|
||||||
|
if (applyDoctor != null) {
|
||||||
|
surgery.setApplyDoctorName(applyDoctor.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
log.info("填充手术名称字段完成 - patientName: {}, mainSurgeonName: {}, anesthetistName: {}, assistant1Name: {}, assistant2Name: {}, scrubNurseName: {}, operatingRoomName: {}, orgName: {}",
|
||||||
|
surgery.getPatientName(), surgery.getMainSurgeonName(), surgery.getAnesthetistName(), surgery.getAssistant1Name(),
|
||||||
|
surgery.getAssistant2Name(), surgery.getScrubNurseName(), surgery.getOperatingRoomName(), surgery.getOrgName());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清除手术相关的Redis缓存
|
||||||
|
*
|
||||||
|
* @param surgery 手术信息
|
||||||
|
*/
|
||||||
|
private void clearSurgeryAppCache(Surgery surgery) {
|
||||||
|
// 清除单个手术缓存
|
||||||
|
if (surgery.getId() != null) {
|
||||||
|
String surgeryKey = RedisKeys.getSurgeryKey(surgery.getId());
|
||||||
|
redisCache.deleteObject(surgeryKey);
|
||||||
|
log.info("清除手术缓存 - surgeryId: {}", surgery.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 清除患者手术列表缓存
|
||||||
|
if (surgery.getPatientId() != null) {
|
||||||
|
String patientKey = RedisKeys.getSurgeryListByPatientKey(surgery.getPatientId());
|
||||||
|
redisCache.deleteObject(patientKey);
|
||||||
|
log.info("清除患者手术列表缓存 - patientId: {}", surgery.getPatientId());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 清除就诊手术列表缓存
|
||||||
|
if (surgery.getEncounterId() != null) {
|
||||||
|
String encounterKey = RedisKeys.getSurgeryListByEncounterKey(surgery.getEncounterId());
|
||||||
|
redisCache.deleteObject(encounterKey);
|
||||||
|
log.info("清除就诊手术列表缓存 - encounterId: {}", surgery.getEncounterId());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -2,12 +2,15 @@ package com.openhis.web.clinicalmanage.controller;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.core.common.core.domain.R;
|
import com.core.common.core.domain.R;
|
||||||
|
import com.openhis.administration.domain.Encounter;
|
||||||
import com.openhis.web.clinicalmanage.appservice.ISurgeryAppService;
|
import com.openhis.web.clinicalmanage.appservice.ISurgeryAppService;
|
||||||
import com.openhis.web.clinicalmanage.dto.SurgeryDto;
|
import com.openhis.web.clinicalmanage.dto.SurgeryDto;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 手术管理Controller业务层处理
|
* 手术管理Controller业务层处理
|
||||||
*
|
*
|
||||||
@@ -93,4 +96,15 @@ public class SurgeryController {
|
|||||||
public R<?> updateSurgeryStatus(@RequestParam Long id, @RequestParam Integer statusEnum) {
|
public R<?> updateSurgeryStatus(@RequestParam Long id, @RequestParam Integer statusEnum) {
|
||||||
return surgeryAppService.updateSurgeryStatus(id, statusEnum);
|
return surgeryAppService.updateSurgeryStatus(id, statusEnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据患者ID查询就诊列表
|
||||||
|
*
|
||||||
|
* @param patientId 患者ID
|
||||||
|
* @return 就诊列表
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "/encounter-list")
|
||||||
|
public R<List<Encounter>> getEncounterListByPatientId(@RequestParam Long patientId) {
|
||||||
|
return surgeryAppService.getEncounterListByPatientId(patientId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ import lombok.experimental.Accessors;
|
|||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 手术管理DTO
|
* 手术管理DTO
|
||||||
@@ -43,6 +45,23 @@ public class SurgeryDto {
|
|||||||
/** 就诊流水号 */
|
/** 就诊流水号 */
|
||||||
private String encounterNo;
|
private String encounterNo;
|
||||||
|
|
||||||
|
/** 申请医生ID */
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long applyDoctorId;
|
||||||
|
|
||||||
|
/** 申请医生姓名 */
|
||||||
|
private String applyDoctorName;
|
||||||
|
|
||||||
|
/** 申请科室ID */
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long applyDeptId;
|
||||||
|
|
||||||
|
/** 申请科室名称 */
|
||||||
|
private String applyDeptName;
|
||||||
|
|
||||||
|
/** 手术指征 */
|
||||||
|
private String surgeryIndication;
|
||||||
|
|
||||||
/** 手术名称 */
|
/** 手术名称 */
|
||||||
private String surgeryName;
|
private String surgeryName;
|
||||||
|
|
||||||
@@ -133,6 +152,13 @@ public class SurgeryDto {
|
|||||||
/** 手术室名称 */
|
/** 手术室名称 */
|
||||||
private String operatingRoomName;
|
private String operatingRoomName;
|
||||||
|
|
||||||
|
/** 手术室所属机构ID */
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long operatingRoomOrgId;
|
||||||
|
|
||||||
|
/** 手术室所属机构名称 */
|
||||||
|
private String operatingRoomOrgName;
|
||||||
|
|
||||||
/** 执行科室ID */
|
/** 执行科室ID */
|
||||||
@JsonSerialize(using = ToStringSerializer.class)
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
private Long orgId;
|
private Long orgId;
|
||||||
@@ -172,4 +198,19 @@ public class SurgeryDto {
|
|||||||
|
|
||||||
/** 更新时间 */
|
/** 更新时间 */
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
|
|
||||||
|
/** 急诊标志 */
|
||||||
|
private Integer emergencyFlag;
|
||||||
|
|
||||||
|
/** 植入高值耗材标志 */
|
||||||
|
private Integer implantFlag;
|
||||||
|
|
||||||
|
/** 手术室确认时间 */
|
||||||
|
private Date operatingRoomConfirmTime;
|
||||||
|
|
||||||
|
/** 手术室确认人 */
|
||||||
|
private String operatingRoomConfirmUser;
|
||||||
|
|
||||||
|
/** 次要手术列表 */
|
||||||
|
private List<Map<String, Object>> secondarySurgeries;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -203,4 +203,12 @@ public interface ICommonService {
|
|||||||
* @return 处理结果
|
* @return 处理结果
|
||||||
*/
|
*/
|
||||||
R<?> lotNumberMatch(List<Long> encounterIdList);
|
R<?> lotNumberMatch(List<Long> encounterIdList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据机构ID获取机构名称
|
||||||
|
*
|
||||||
|
* @param orgId 机构ID
|
||||||
|
* @return 机构名称
|
||||||
|
*/
|
||||||
|
String getOrgNameById(Long orgId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -816,4 +816,24 @@ public class CommonServiceImpl implements ICommonService {
|
|||||||
}
|
}
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据机构ID获取机构名称
|
||||||
|
*
|
||||||
|
* @param orgId 机构ID
|
||||||
|
* @return 机构名称
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String getOrgNameById(Long orgId) {
|
||||||
|
if (orgId == null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
Organization organization = organizationService.getById(orgId);
|
||||||
|
if (organization == null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
return organization.getName();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,105 @@
|
|||||||
|
package com.openhis.web.doctorstation.appservice;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.core.common.core.domain.R;
|
||||||
|
import com.openhis.web.doctorstation.dto.TodayOutpatientPatientDto;
|
||||||
|
import com.openhis.web.doctorstation.dto.TodayOutpatientQueryParam;
|
||||||
|
import com.openhis.web.doctorstation.dto.TodayOutpatientStatsDto;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 今日门诊服务接口
|
||||||
|
*/
|
||||||
|
public interface ITodayOutpatientService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取今日门诊统计信息
|
||||||
|
*
|
||||||
|
* @param request HTTP请求
|
||||||
|
* @return 今日门诊统计
|
||||||
|
*/
|
||||||
|
TodayOutpatientStatsDto getTodayOutpatientStats(HttpServletRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询今日门诊患者列表
|
||||||
|
*
|
||||||
|
* @param queryParam 查询参数
|
||||||
|
* @param request HTTP请求
|
||||||
|
* @return 分页患者列表
|
||||||
|
*/
|
||||||
|
IPage<TodayOutpatientPatientDto> getTodayOutpatientPatients(TodayOutpatientQueryParam queryParam,
|
||||||
|
HttpServletRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取今日待就诊患者队列(按挂号时间排序)
|
||||||
|
*
|
||||||
|
* @param request HTTP请求
|
||||||
|
* @return 待就诊患者列表
|
||||||
|
*/
|
||||||
|
List<TodayOutpatientPatientDto> getWaitingPatients(HttpServletRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取今日就诊中患者列表
|
||||||
|
*
|
||||||
|
* @param request HTTP请求
|
||||||
|
* @return 就诊中患者列表
|
||||||
|
*/
|
||||||
|
List<TodayOutpatientPatientDto> getInProgressPatients(HttpServletRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取今日已完成就诊患者列表
|
||||||
|
*
|
||||||
|
* @param request HTTP请求
|
||||||
|
* @return 已完成就诊患者列表
|
||||||
|
*/
|
||||||
|
List<TodayOutpatientPatientDto> getCompletedPatients(HttpServletRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取患者就诊详情
|
||||||
|
*
|
||||||
|
* @param encounterId 就诊记录ID
|
||||||
|
* @param request HTTP请求
|
||||||
|
* @return 患者就诊详情
|
||||||
|
*/
|
||||||
|
TodayOutpatientPatientDto getPatientDetail(Long encounterId, HttpServletRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量更新患者状态
|
||||||
|
*
|
||||||
|
* @param encounterIds 就诊记录ID列表
|
||||||
|
* @param targetStatus 目标状态
|
||||||
|
* @param request HTTP请求
|
||||||
|
* @return 更新结果
|
||||||
|
*/
|
||||||
|
R<?> batchUpdatePatientStatus(List<Long> encounterIds, Integer targetStatus, HttpServletRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接诊患者
|
||||||
|
*
|
||||||
|
* @param encounterId 就诊记录ID
|
||||||
|
* @param request HTTP请求
|
||||||
|
* @return 接诊结果
|
||||||
|
*/
|
||||||
|
R<?> receivePatient(Long encounterId, HttpServletRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完成就诊
|
||||||
|
*
|
||||||
|
* @param encounterId 就诊记录ID
|
||||||
|
* @param request HTTP请求
|
||||||
|
* @return 完成结果
|
||||||
|
*/
|
||||||
|
R<?> completeVisit(Long encounterId, HttpServletRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消就诊
|
||||||
|
*
|
||||||
|
* @param encounterId 就诊记录ID
|
||||||
|
* @param reason 取消原因
|
||||||
|
* @param request HTTP请求
|
||||||
|
* @return 取消结果
|
||||||
|
*/
|
||||||
|
R<?> cancelVisit(Long encounterId, String reason, HttpServletRequest request);
|
||||||
|
}
|
||||||
@@ -959,13 +959,15 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
|||||||
// LIS查看报告地址
|
// LIS查看报告地址
|
||||||
String lisReportUrl = TenantOptionUtil.getOptionContent(TenantOptionDict.LIS_REPORT_URL);
|
String lisReportUrl = TenantOptionUtil.getOptionContent(TenantOptionDict.LIS_REPORT_URL);
|
||||||
if (StringUtils.isEmpty(lisReportUrl)) {
|
if (StringUtils.isEmpty(lisReportUrl)) {
|
||||||
throw new ServiceException("租户配置项【LIS查看报告地址】未配置");
|
log.warn("租户配置项【LIS查看报告地址】未配置");
|
||||||
}
|
}
|
||||||
List<ProofAndTestResultDto> proofResult = doctorStationAdviceAppMapper.getProofAndTestResult(encounterId,
|
List<ProofAndTestResultDto> proofResult = doctorStationAdviceAppMapper.getProofAndTestResult(encounterId,
|
||||||
RequestStatus.DRAFT.getValue(), ActivityType.PROOF.getValue());
|
RequestStatus.DRAFT.getValue(), ActivityType.PROOF.getValue());
|
||||||
for (ProofAndTestResultDto proofAndTestResultDto : proofResult) {
|
for (ProofAndTestResultDto proofAndTestResultDto : proofResult) {
|
||||||
|
if (StringUtils.isNotEmpty(lisReportUrl)) {
|
||||||
proofAndTestResultDto.setRequestUrl(lisReportUrl.concat(proofAndTestResultDto.getBusNo()));
|
proofAndTestResultDto.setRequestUrl(lisReportUrl.concat(proofAndTestResultDto.getBusNo()));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return R.ok(proofResult);
|
return R.ok(proofResult);
|
||||||
}
|
}
|
||||||
@@ -981,13 +983,15 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
|||||||
// PACS查看报告地址
|
// PACS查看报告地址
|
||||||
String pacsReportUrl = TenantOptionUtil.getOptionContent(TenantOptionDict.PACS_REPORT_URL);
|
String pacsReportUrl = TenantOptionUtil.getOptionContent(TenantOptionDict.PACS_REPORT_URL);
|
||||||
if (StringUtils.isEmpty(pacsReportUrl)) {
|
if (StringUtils.isEmpty(pacsReportUrl)) {
|
||||||
throw new ServiceException("租户配置项【PACS查看报告地址】未配置");
|
log.warn("租户配置项【PACS查看报告地址】未配置");
|
||||||
}
|
}
|
||||||
List<ProofAndTestResultDto> testResult = doctorStationAdviceAppMapper.getProofAndTestResult(encounterId,
|
List<ProofAndTestResultDto> testResult = doctorStationAdviceAppMapper.getProofAndTestResult(encounterId,
|
||||||
RequestStatus.DRAFT.getValue(), ActivityType.TEST.getValue());
|
RequestStatus.DRAFT.getValue(), ActivityType.TEST.getValue());
|
||||||
for (ProofAndTestResultDto proofAndTestResultDto : testResult) {
|
for (ProofAndTestResultDto proofAndTestResultDto : testResult) {
|
||||||
|
if (StringUtils.isNotEmpty(pacsReportUrl)) {
|
||||||
proofAndTestResultDto.setRequestUrl(pacsReportUrl.concat(proofAndTestResultDto.getBusNo()));
|
proofAndTestResultDto.setRequestUrl(pacsReportUrl.concat(proofAndTestResultDto.getBusNo()));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return R.ok(testResult);
|
return R.ok(testResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -167,6 +167,14 @@ public class DoctorStationChineseMedicalAppServiceImpl implements IDoctorStation
|
|||||||
Long encounterId = saveDiagnosisParam.getEncounterId();
|
Long encounterId = saveDiagnosisParam.getEncounterId();
|
||||||
// 诊断定义集合
|
// 诊断定义集合
|
||||||
List<SaveDiagnosisChildParam> diagnosisChildList = saveDiagnosisParam.getDiagnosisChildList();
|
List<SaveDiagnosisChildParam> diagnosisChildList = saveDiagnosisParam.getDiagnosisChildList();
|
||||||
|
// 如果本次保存中有设置主诊断,则先清空该就诊下所有的主诊断标记,确保唯一性
|
||||||
|
boolean hasMain = diagnosisChildList.stream().anyMatch(d -> Integer.valueOf(1).equals(d.getMaindiseFlag()));
|
||||||
|
if (hasMain) {
|
||||||
|
iEncounterDiagnosisService.update(new LambdaUpdateWrapper<EncounterDiagnosis>()
|
||||||
|
.eq(EncounterDiagnosis::getEncounterId, encounterId)
|
||||||
|
.set(EncounterDiagnosis::getMaindiseFlag, 0));
|
||||||
|
}
|
||||||
|
|
||||||
// 保存诊断管理
|
// 保存诊断管理
|
||||||
Condition condition;
|
Condition condition;
|
||||||
for (SaveDiagnosisChildParam saveDiagnosisChildParam : diagnosisChildList) {
|
for (SaveDiagnosisChildParam saveDiagnosisChildParam : diagnosisChildList) {
|
||||||
@@ -240,6 +248,14 @@ public class DoctorStationChineseMedicalAppServiceImpl implements IDoctorStation
|
|||||||
Long encounterId = saveDiagnosisParam.getEncounterId();
|
Long encounterId = saveDiagnosisParam.getEncounterId();
|
||||||
// 诊断定义集合
|
// 诊断定义集合
|
||||||
List<SaveDiagnosisChildParam> diagnosisChildList = saveDiagnosisParam.getDiagnosisChildList();
|
List<SaveDiagnosisChildParam> diagnosisChildList = saveDiagnosisParam.getDiagnosisChildList();
|
||||||
|
// 如果本次保存中有设置主诊断,则先清空该就诊下所有的主诊断标记,确保唯一性
|
||||||
|
boolean hasMain = diagnosisChildList.stream().anyMatch(d -> Integer.valueOf(1).equals(d.getMaindiseFlag()));
|
||||||
|
if (hasMain) {
|
||||||
|
iEncounterDiagnosisService.update(new LambdaUpdateWrapper<EncounterDiagnosis>()
|
||||||
|
.eq(EncounterDiagnosis::getEncounterId, encounterId)
|
||||||
|
.set(EncounterDiagnosis::getMaindiseFlag, 0));
|
||||||
|
}
|
||||||
|
|
||||||
// 保存诊断管理
|
// 保存诊断管理
|
||||||
Condition condition;
|
Condition condition;
|
||||||
for (SaveDiagnosisChildParam saveDiagnosisChildParam : diagnosisChildList) {
|
for (SaveDiagnosisChildParam saveDiagnosisChildParam : diagnosisChildList) {
|
||||||
@@ -259,10 +275,11 @@ public class DoctorStationChineseMedicalAppServiceImpl implements IDoctorStation
|
|||||||
EncounterDiagnosis encounterDiagnosis;
|
EncounterDiagnosis encounterDiagnosis;
|
||||||
|
|
||||||
for (SaveDiagnosisChildParam saveDiagnosisChildParam : diagnosisChildList) {
|
for (SaveDiagnosisChildParam saveDiagnosisChildParam : diagnosisChildList) {
|
||||||
|
encounterDiagnosis = new EncounterDiagnosis();
|
||||||
if (saveDiagnosisChildParam.getUpdateId() != null) {
|
if (saveDiagnosisChildParam.getUpdateId() != null) {
|
||||||
String updateId = saveDiagnosisChildParam.getUpdateId();
|
String updateId = saveDiagnosisChildParam.getUpdateId();
|
||||||
encounterDiagnosis = new EncounterDiagnosis();
|
|
||||||
encounterDiagnosis.setId(Long.parseLong(updateId));
|
encounterDiagnosis.setId(Long.parseLong(updateId));
|
||||||
|
}
|
||||||
encounterDiagnosis.setEncounterId(encounterId);
|
encounterDiagnosis.setEncounterId(encounterId);
|
||||||
encounterDiagnosis.setConditionId(saveDiagnosisChildParam.getConditionId());
|
encounterDiagnosis.setConditionId(saveDiagnosisChildParam.getConditionId());
|
||||||
encounterDiagnosis.setMaindiseFlag(saveDiagnosisChildParam.getMaindiseFlag());
|
encounterDiagnosis.setMaindiseFlag(saveDiagnosisChildParam.getMaindiseFlag());
|
||||||
@@ -270,10 +287,9 @@ public class DoctorStationChineseMedicalAppServiceImpl implements IDoctorStation
|
|||||||
encounterDiagnosis.setMedTypeCode(saveDiagnosisChildParam.getMedTypeCode());// 医疗类型
|
encounterDiagnosis.setMedTypeCode(saveDiagnosisChildParam.getMedTypeCode());// 医疗类型
|
||||||
encounterDiagnosis.setDiagnosisDesc(saveDiagnosisChildParam.getDiagnosisDesc()); // 诊断描述
|
encounterDiagnosis.setDiagnosisDesc(saveDiagnosisChildParam.getDiagnosisDesc()); // 诊断描述
|
||||||
encounterDiagnosis.setIptDiseTypeCode(saveDiagnosisChildParam.getIptDiseTypeCode()); // 患者疾病诊断类型代码
|
encounterDiagnosis.setIptDiseTypeCode(saveDiagnosisChildParam.getIptDiseTypeCode()); // 患者疾病诊断类型代码
|
||||||
|
encounterDiagnosis.setTcmFlag(Whether.YES.getValue());// 中医标识
|
||||||
|
encounterDiagnosis.setSyndromeGroupNo(saveDiagnosisChildParam.getSyndromeGroupNo());// 中医证候组号
|
||||||
iEncounterDiagnosisService.saveOrUpdate(encounterDiagnosis);
|
iEncounterDiagnosisService.saveOrUpdate(encounterDiagnosis);
|
||||||
} else {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"中医诊断"}));
|
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"中医诊断"}));
|
||||||
}
|
}
|
||||||
@@ -385,6 +401,20 @@ public class DoctorStationChineseMedicalAppServiceImpl implements IDoctorStation
|
|||||||
// 删除
|
// 删除
|
||||||
List<AdviceSaveDto> deleteList = medicineList.stream()
|
List<AdviceSaveDto> deleteList = medicineList.stream()
|
||||||
.filter(e -> DbOpType.DELETE.getCode().equals(e.getDbOpType())).collect(Collectors.toList());
|
.filter(e -> DbOpType.DELETE.getCode().equals(e.getDbOpType())).collect(Collectors.toList());
|
||||||
|
|
||||||
|
// 校验删除的医嘱是否已经收费
|
||||||
|
List<Long> delRequestIdList = deleteList.stream().map(AdviceSaveDto::getRequestId).collect(Collectors.toList());
|
||||||
|
if (!delRequestIdList.isEmpty()) {
|
||||||
|
List<ChargeItem> chargeItemList = iChargeItemService.getChargeItemInfoByReqId(delRequestIdList);
|
||||||
|
if (chargeItemList != null && !chargeItemList.isEmpty()) {
|
||||||
|
for (ChargeItem ci : chargeItemList) {
|
||||||
|
if (ChargeItemStatus.BILLED.getValue().equals(ci.getStatusEnum())) {
|
||||||
|
return R.fail("已收费的项目无法删除,请刷新页面后重试");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (AdviceSaveDto adviceSaveDto : deleteList) {
|
for (AdviceSaveDto adviceSaveDto : deleteList) {
|
||||||
iMedicationRequestService.removeById(adviceSaveDto.getRequestId());
|
iMedicationRequestService.removeById(adviceSaveDto.getRequestId());
|
||||||
// 删除已经产生的药品发放信息
|
// 删除已经产生的药品发放信息
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.openhis.web.doctorstation.appservice.impl;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.core.common.core.domain.R;
|
import com.core.common.core.domain.R;
|
||||||
@@ -251,6 +252,15 @@ public class DoctorStationDiagnosisAppServiceImpl implements IDoctorStationDiagn
|
|||||||
List<SaveDiagnosisChildParam> diagnosisChildList = saveDiagnosisParam.getDiagnosisChildList();
|
List<SaveDiagnosisChildParam> diagnosisChildList = saveDiagnosisParam.getDiagnosisChildList();
|
||||||
// 先删除再保存
|
// 先删除再保存
|
||||||
// iEncounterDiagnosisService.deleteEncounterDiagnosisInfos(encounterId);
|
// iEncounterDiagnosisService.deleteEncounterDiagnosisInfos(encounterId);
|
||||||
|
|
||||||
|
// 如果本次保存中有设置主诊断,则先清空该就诊下所有的主诊断标记,确保唯一性
|
||||||
|
boolean hasMain = diagnosisChildList.stream().anyMatch(d -> Integer.valueOf(1).equals(d.getMaindiseFlag()));
|
||||||
|
if (hasMain) {
|
||||||
|
iEncounterDiagnosisService.update(new LambdaUpdateWrapper<EncounterDiagnosis>()
|
||||||
|
.eq(EncounterDiagnosis::getEncounterId, encounterId)
|
||||||
|
.set(EncounterDiagnosis::getMaindiseFlag, 0));
|
||||||
|
}
|
||||||
|
|
||||||
// 保存诊断管理
|
// 保存诊断管理
|
||||||
Condition condition;
|
Condition condition;
|
||||||
for (SaveDiagnosisChildParam saveDiagnosisChildParam : diagnosisChildList) {
|
for (SaveDiagnosisChildParam saveDiagnosisChildParam : diagnosisChildList) {
|
||||||
@@ -285,11 +295,17 @@ public class DoctorStationDiagnosisAppServiceImpl implements IDoctorStationDiagn
|
|||||||
encounterDiagnosis.setId(Long.parseLong(s));
|
encounterDiagnosis.setId(Long.parseLong(s));
|
||||||
encounterDiagnosis.setEncounterId(encounterId);
|
encounterDiagnosis.setEncounterId(encounterId);
|
||||||
// encounterDiagnosis.setConditionId(saveDiagnosisChildParam.getConditionId());
|
// encounterDiagnosis.setConditionId(saveDiagnosisChildParam.getConditionId());
|
||||||
|
// 只有第一个ID(病)设置为主诊断标记,其他的(证)设置为0
|
||||||
|
if (i == 1) {
|
||||||
encounterDiagnosis.setMaindiseFlag(saveDiagnosisChildParam.getMaindiseFlag());
|
encounterDiagnosis.setMaindiseFlag(saveDiagnosisChildParam.getMaindiseFlag());
|
||||||
|
} else {
|
||||||
|
encounterDiagnosis.setMaindiseFlag(0);
|
||||||
|
}
|
||||||
encounterDiagnosis.setDiagSrtNo(saveDiagnosisChildParam.getDiagSrtNo()); // 排序号
|
encounterDiagnosis.setDiagSrtNo(saveDiagnosisChildParam.getDiagSrtNo()); // 排序号
|
||||||
encounterDiagnosis.setMedTypeCode(saveDiagnosisChildParam.getMedTypeCode());// 医疗类型
|
encounterDiagnosis.setMedTypeCode(saveDiagnosisChildParam.getMedTypeCode());// 医疗类型
|
||||||
encounterDiagnosis.setDiagnosisDesc(saveDiagnosisChildParam.getDiagnosisDesc()); // 诊断描述
|
encounterDiagnosis.setDiagnosisDesc(saveDiagnosisChildParam.getDiagnosisDesc()); // 诊断描述
|
||||||
encounterDiagnosis.setIptDiseTypeCode(saveDiagnosisChildParam.getIptDiseTypeCode()); // 患者疾病诊断类型代码
|
encounterDiagnosis.setIptDiseTypeCode(saveDiagnosisChildParam.getIptDiseTypeCode()); // 患者疾病诊断类型代码
|
||||||
|
encounterDiagnosis.setTcmFlag(Whether.YES.getValue());// 中医标识
|
||||||
iEncounterDiagnosisService.saveOrUpdate(encounterDiagnosis);
|
iEncounterDiagnosisService.saveOrUpdate(encounterDiagnosis);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import com.openhis.web.doctorstation.dto.PrescriptionInfoBaseDto;
|
|||||||
import com.openhis.web.doctorstation.dto.PrescriptionInfoDetailDto;
|
import com.openhis.web.doctorstation.dto.PrescriptionInfoDetailDto;
|
||||||
import com.openhis.web.doctorstation.dto.ReceptionStatisticsDto;
|
import com.openhis.web.doctorstation.dto.ReceptionStatisticsDto;
|
||||||
import com.openhis.web.doctorstation.mapper.DoctorStationMainAppMapper;
|
import com.openhis.web.doctorstation.mapper.DoctorStationMainAppMapper;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
@@ -32,6 +33,7 @@ import java.util.stream.Collectors;
|
|||||||
/**
|
/**
|
||||||
* 医生站-主页面 应用实现类
|
* 医生站-主页面 应用实现类
|
||||||
*/
|
*/
|
||||||
|
//@Slf4j
|
||||||
@Service
|
@Service
|
||||||
public class DoctorStationMainAppServiceImpl implements IDoctorStationMainAppService {
|
public class DoctorStationMainAppServiceImpl implements IDoctorStationMainAppService {
|
||||||
|
|
||||||
@@ -95,6 +97,9 @@ public class DoctorStationMainAppServiceImpl implements IDoctorStationMainAppSer
|
|||||||
ParticipantType.REGISTRATION_DOCTOR.getCode(), ParticipantType.ADMITTER.getCode(), userId,
|
ParticipantType.REGISTRATION_DOCTOR.getCode(), ParticipantType.ADMITTER.getCode(), userId,
|
||||||
currentUserOrganizationId, pricingFlag, EncounterStatus.PLANNED.getValue(),
|
currentUserOrganizationId, pricingFlag, EncounterStatus.PLANNED.getValue(),
|
||||||
EncounterActivityStatus.ACTIVE.getValue(), queryWrapper);
|
EncounterActivityStatus.ACTIVE.getValue(), queryWrapper);
|
||||||
|
//日志输出就诊患者信息,patientInfo
|
||||||
|
// log.debug("就诊患者信息: 总数={}, 记录数={}, 数据={}",
|
||||||
|
// patientInfo.getTotal(), patientInfo.getRecords().size(), patientInfo.getRecords());
|
||||||
patientInfo.getRecords().forEach(e -> {
|
patientInfo.getRecords().forEach(e -> {
|
||||||
// 性别
|
// 性别
|
||||||
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
|
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
|
||||||
|
|||||||
@@ -0,0 +1,305 @@
|
|||||||
|
package com.openhis.web.doctorstation.appservice.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.core.common.core.domain.R;
|
||||||
|
import com.core.common.utils.SecurityUtils;
|
||||||
|
import com.openhis.common.constant.CommonConstants;
|
||||||
|
import com.openhis.common.enums.*;
|
||||||
|
import com.openhis.common.utils.EnumUtils;
|
||||||
|
import com.openhis.common.utils.HisQueryUtils;
|
||||||
|
import com.openhis.web.doctorstation.appservice.ITodayOutpatientService;
|
||||||
|
import com.openhis.web.doctorstation.dto.TodayOutpatientPatientDto;
|
||||||
|
import com.openhis.web.doctorstation.dto.TodayOutpatientQueryParam;
|
||||||
|
import com.openhis.web.doctorstation.dto.TodayOutpatientStatsDto;
|
||||||
|
import com.openhis.web.doctorstation.mapper.TodayOutpatientMapper;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 今日门诊服务实现类
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class TodayOutpatientServiceImpl implements ITodayOutpatientService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private TodayOutpatientMapper todayOutpatientMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TodayOutpatientStatsDto getTodayOutpatientStats(HttpServletRequest request) {
|
||||||
|
Long doctorId = SecurityUtils.getLoginUser().getUserId();
|
||||||
|
Long departmentId = SecurityUtils.getLoginUser().getOrgId();
|
||||||
|
Integer tenantId = SecurityUtils.getLoginUser().getTenantId();
|
||||||
|
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||||
|
String today = DateUtil.format(new Date(), "yyyy-MM-dd");
|
||||||
|
|
||||||
|
// 获取今日统计信息
|
||||||
|
TodayOutpatientStatsDto stats = todayOutpatientMapper.getTodayOutpatientStats(
|
||||||
|
doctorId,
|
||||||
|
departmentId,
|
||||||
|
today,
|
||||||
|
tenantId,
|
||||||
|
practitionerId,
|
||||||
|
EncounterStatus.PLANNED.getValue(), // plannedStatus - Integer
|
||||||
|
EncounterStatus.IN_PROGRESS.getValue(), // inProgressStatus - Integer
|
||||||
|
EncounterStatus.DISCHARGED.getValue(), // dischargedStatus - Integer
|
||||||
|
EncounterStatus.CANCELLED.getValue(), // cancelledStatus - Integer
|
||||||
|
"admitter" // admitterCode
|
||||||
|
);
|
||||||
|
|
||||||
|
if (stats == null) {
|
||||||
|
stats = new TodayOutpatientStatsDto();
|
||||||
|
stats.setTotalRegistered(0)
|
||||||
|
.setWaitingCount(0)
|
||||||
|
.setInProgressCount(0)
|
||||||
|
.setCompletedCount(0)
|
||||||
|
.setCancelledCount(0)
|
||||||
|
.setAverageWaitingTime(0)
|
||||||
|
.setAverageVisitTime(0)
|
||||||
|
.setDoctorCount(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
return stats;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<TodayOutpatientPatientDto> getTodayOutpatientPatients(TodayOutpatientQueryParam queryParam,
|
||||||
|
HttpServletRequest request) {
|
||||||
|
// 设置默认值
|
||||||
|
if (ObjectUtil.isEmpty(queryParam.getDoctorId())) {
|
||||||
|
queryParam.setDoctorId(SecurityUtils.getLoginUser().getUserId());
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isEmpty(queryParam.getDepartmentId())) {
|
||||||
|
queryParam.setDepartmentId(SecurityUtils.getLoginUser().getOrgId());
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isEmpty(queryParam.getQueryDate())) {
|
||||||
|
queryParam.setQueryDate(DateUtil.format(new Date(), "yyyy-MM-dd"));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 保存原始值用于后续查询
|
||||||
|
Long doctorId = queryParam.getDoctorId();
|
||||||
|
Long departmentId = queryParam.getDepartmentId();
|
||||||
|
String queryDate = queryParam.getQueryDate();
|
||||||
|
Integer sortField = queryParam.getSortField();
|
||||||
|
Integer sortOrder = queryParam.getSortOrder();
|
||||||
|
Integer statusEnum = queryParam.getStatusEnum();
|
||||||
|
Integer pageNo = queryParam.getPageNo();
|
||||||
|
Integer pageSize = queryParam.getPageSize();
|
||||||
|
|
||||||
|
// 清空不需要通过QueryWrapper处理的字段(避免生成错误的WHERE条件)
|
||||||
|
queryParam.setDoctorId(null);
|
||||||
|
queryParam.setDepartmentId(null);
|
||||||
|
queryParam.setQueryDate(null);
|
||||||
|
queryParam.setSortField(null);
|
||||||
|
queryParam.setSortOrder(null);
|
||||||
|
queryParam.setPageNo(null);
|
||||||
|
queryParam.setPageSize(null);
|
||||||
|
|
||||||
|
// 构建查询条件(只处理搜索条件和业务字段)
|
||||||
|
QueryWrapper<TodayOutpatientPatientDto> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq(CommonConstants.Common.TENANT_ID, SecurityUtils.getLoginUser().getTenantId());
|
||||||
|
|
||||||
|
// 处理模糊查询关键字
|
||||||
|
if (ObjectUtil.isNotEmpty(queryParam.getSearchKey())) {
|
||||||
|
String searchKey = queryParam.getSearchKey();
|
||||||
|
queryWrapper.and(wrapper -> {
|
||||||
|
wrapper.or().like("pt.name", searchKey)
|
||||||
|
.or().like("pt.id_card", searchKey)
|
||||||
|
.or().like("pt.phone", searchKey)
|
||||||
|
.or().like("enc.bus_no", searchKey);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理其他业务字段条件
|
||||||
|
if (ObjectUtil.isNotEmpty(queryParam.getStatusEnum())) {
|
||||||
|
queryWrapper.eq("enc.status_enum", queryParam.getStatusEnum());
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(queryParam.getTypeCode())) {
|
||||||
|
queryWrapper.eq("pt.type_code", queryParam.getTypeCode());
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(queryParam.getImportantFlag())) {
|
||||||
|
queryWrapper.eq("enc.important_flag", queryParam.getImportantFlag());
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(queryParam.getHasPrescription())) {
|
||||||
|
queryWrapper.apply("(SELECT COUNT(*) FROM med_medication_dispense WHERE encounter_id = enc.id AND delete_flag = '0') > 0");
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(queryParam.getHasExamination())) {
|
||||||
|
queryWrapper.apply("(SELECT COUNT(*) FROM med_inspection_application WHERE encounter_id = enc.id AND delete_flag = '0') > 0");
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(queryParam.getHasLaboratory())) {
|
||||||
|
queryWrapper.apply("(SELECT COUNT(*) FROM med_test_application WHERE encounter_id = enc.id AND delete_flag = '0') > 0");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加时间条件
|
||||||
|
queryWrapper.apply("enc.start_time::DATE >= CAST({0} AS DATE)", queryDate);
|
||||||
|
queryWrapper.apply("enc.start_time::DATE <= CAST({0} AS DATE)", queryDate);
|
||||||
|
|
||||||
|
// 添加医生条件 - 查询当前医生的门诊患者
|
||||||
|
queryWrapper.eq("ep.practitioner_id", SecurityUtils.getLoginUser().getPractitionerId());
|
||||||
|
|
||||||
|
// 添加状态条件
|
||||||
|
if (ObjectUtil.isNotEmpty(statusEnum)) {
|
||||||
|
queryWrapper.eq("enc.status_enum", statusEnum);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 排序
|
||||||
|
String orderBy = getOrderByClause(sortField, sortOrder);
|
||||||
|
if (ObjectUtil.isNotEmpty(orderBy)) {
|
||||||
|
queryWrapper.orderBy(true, sortOrder == 1, orderBy);
|
||||||
|
} else {
|
||||||
|
queryWrapper.orderByDesc("enc.start_time");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 执行查询
|
||||||
|
IPage<TodayOutpatientPatientDto> result = todayOutpatientMapper.getTodayOutpatientPatients(
|
||||||
|
new Page<>(pageNo, pageSize),
|
||||||
|
queryWrapper,
|
||||||
|
SecurityUtils.getLoginUser().getTenantId(),
|
||||||
|
"admitter");
|
||||||
|
|
||||||
|
// 处理枚举字段显示文本
|
||||||
|
result.getRecords().forEach(patient -> {
|
||||||
|
// 性别
|
||||||
|
patient.setGenderEnumEnumText(
|
||||||
|
EnumUtils.getInfoByValue(AdministrativeGender.class, patient.getGenderEnum()));
|
||||||
|
|
||||||
|
// 就诊状态
|
||||||
|
patient.setStatusEnumEnumText(
|
||||||
|
EnumUtils.getInfoByValue(EncounterStatus.class, patient.getStatusEnum()));
|
||||||
|
|
||||||
|
// 就诊对象状态
|
||||||
|
patient.setSubjectStatusEnumEnumText(
|
||||||
|
EnumUtils.getInfoByValue(EncounterSubjectStatus.class, patient.getSubjectStatusEnum()));
|
||||||
|
});
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<TodayOutpatientPatientDto> getWaitingPatients(HttpServletRequest request) {
|
||||||
|
TodayOutpatientQueryParam queryParam = new TodayOutpatientQueryParam();
|
||||||
|
queryParam.setStatusEnum(EncounterStatus.PLANNED.getValue());
|
||||||
|
queryParam.setSortField(1); // 按挂号时间排序
|
||||||
|
queryParam.setSortOrder(2); // 降序
|
||||||
|
|
||||||
|
IPage<TodayOutpatientPatientDto> page = getTodayOutpatientPatients(queryParam, request);
|
||||||
|
return page.getRecords();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<TodayOutpatientPatientDto> getInProgressPatients(HttpServletRequest request) {
|
||||||
|
TodayOutpatientQueryParam queryParam = new TodayOutpatientQueryParam();
|
||||||
|
queryParam.setStatusEnum(EncounterStatus.IN_PROGRESS.getValue());
|
||||||
|
queryParam.setSortField(2); // 按候诊时间排序
|
||||||
|
|
||||||
|
IPage<TodayOutpatientPatientDto> page = getTodayOutpatientPatients(queryParam, request);
|
||||||
|
return page.getRecords();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<TodayOutpatientPatientDto> getCompletedPatients(HttpServletRequest request) {
|
||||||
|
TodayOutpatientQueryParam queryParam = new TodayOutpatientQueryParam();
|
||||||
|
queryParam.setStatusEnum(EncounterStatus.DISCHARGED.getValue());
|
||||||
|
queryParam.setSortField(3); // 按就诊号排序
|
||||||
|
|
||||||
|
IPage<TodayOutpatientPatientDto> page = getTodayOutpatientPatients(queryParam, request);
|
||||||
|
return page.getRecords();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TodayOutpatientPatientDto getPatientDetail(Long encounterId, HttpServletRequest request) {
|
||||||
|
QueryWrapper<TodayOutpatientPatientDto> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("enc.id", encounterId);
|
||||||
|
queryWrapper.eq("enc.tenant_id", SecurityUtils.getLoginUser().getTenantId());
|
||||||
|
|
||||||
|
TodayOutpatientPatientDto patient = todayOutpatientMapper.getPatientDetail(
|
||||||
|
queryWrapper,
|
||||||
|
SecurityUtils.getLoginUser().getTenantId(),
|
||||||
|
"admitter");
|
||||||
|
|
||||||
|
if (patient != null) {
|
||||||
|
// 处理枚举字段显示文本
|
||||||
|
patient.setGenderEnumEnumText(
|
||||||
|
EnumUtils.getInfoByValue(AdministrativeGender.class, patient.getGenderEnum()));
|
||||||
|
patient.setStatusEnumEnumText(
|
||||||
|
EnumUtils.getInfoByValue(EncounterStatus.class, patient.getStatusEnum()));
|
||||||
|
patient.setSubjectStatusEnumEnumText(
|
||||||
|
EnumUtils.getInfoByValue(EncounterSubjectStatus.class, patient.getSubjectStatusEnum()));
|
||||||
|
}
|
||||||
|
|
||||||
|
return patient;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<?> batchUpdatePatientStatus(List<Long> encounterIds, Integer targetStatus,
|
||||||
|
HttpServletRequest request) {
|
||||||
|
if (ObjectUtil.isEmpty(encounterIds)) {
|
||||||
|
return R.fail("就诊记录ID列表不能为空");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 验证状态值
|
||||||
|
if (EncounterStatus.getByValue(targetStatus) == null) {
|
||||||
|
return R.fail("无效的状态值");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 执行批量更新
|
||||||
|
int updated = todayOutpatientMapper.batchUpdatePatientStatus(
|
||||||
|
encounterIds, targetStatus, SecurityUtils.getLoginUser().getUserId(), new Date());
|
||||||
|
|
||||||
|
return updated > 0 ? R.ok("更新成功") : R.fail("更新失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<?> receivePatient(Long encounterId, HttpServletRequest request) {
|
||||||
|
// 调用现有的接诊逻辑
|
||||||
|
// 这里可以复用 DoctorStationMainAppServiceImpl 中的 receiveEncounter 方法
|
||||||
|
// 或者直接调用相应的服务
|
||||||
|
|
||||||
|
return R.ok("接诊成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<?> completeVisit(Long encounterId, HttpServletRequest request) {
|
||||||
|
// 调用现有的完诊逻辑
|
||||||
|
return R.ok("就诊完成");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<?> cancelVisit(Long encounterId, String reason, HttpServletRequest request) {
|
||||||
|
// 调用现有的取消就诊逻辑
|
||||||
|
return R.ok("就诊取消成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据排序字段获取排序子句
|
||||||
|
*/
|
||||||
|
private String getOrderByClause(Integer sortField, Integer sortOrder) {
|
||||||
|
if (ObjectUtil.isEmpty(sortField)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
String orderBy = "";
|
||||||
|
switch (sortField) {
|
||||||
|
case 1: // 挂号时间
|
||||||
|
orderBy = "enc.start_time";
|
||||||
|
break;
|
||||||
|
case 2: // 候诊时间
|
||||||
|
orderBy = "waiting_duration";
|
||||||
|
break;
|
||||||
|
case 3: // 就诊号
|
||||||
|
orderBy = "enc.encounter_bus_no";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return orderBy;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,181 @@
|
|||||||
|
package com.openhis.web.doctorstation.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.core.common.core.domain.R;
|
||||||
|
import com.core.common.utils.SecurityUtils;
|
||||||
|
import com.openhis.web.doctorstation.appservice.ITodayOutpatientService;
|
||||||
|
import com.openhis.web.doctorstation.dto.TodayOutpatientPatientDto;
|
||||||
|
import com.openhis.web.doctorstation.dto.TodayOutpatientQueryParam;
|
||||||
|
import com.openhis.web.doctorstation.dto.TodayOutpatientStatsDto;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 今日门诊控制器
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/today-outpatient")
|
||||||
|
public class TodayOutpatientController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ITodayOutpatientService todayOutpatientService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取今日门诊统计信息
|
||||||
|
*
|
||||||
|
* @param request HTTP请求
|
||||||
|
* @return 统计信息
|
||||||
|
*/
|
||||||
|
@GetMapping("/stats")
|
||||||
|
public R<TodayOutpatientStatsDto> getTodayOutpatientStats(HttpServletRequest request) {
|
||||||
|
TodayOutpatientStatsDto stats = todayOutpatientService.getTodayOutpatientStats(request);
|
||||||
|
return R.ok(stats);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询今日门诊患者列表
|
||||||
|
*
|
||||||
|
* @param queryParam 查询参数
|
||||||
|
* @param request HTTP请求
|
||||||
|
* @return 分页患者列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/patients")
|
||||||
|
public R<IPage<TodayOutpatientPatientDto>> getTodayOutpatientPatients(
|
||||||
|
TodayOutpatientQueryParam queryParam,
|
||||||
|
HttpServletRequest request) {
|
||||||
|
IPage<TodayOutpatientPatientDto> page = todayOutpatientService.getTodayOutpatientPatients(
|
||||||
|
queryParam, request);
|
||||||
|
return R.ok(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取今日待就诊患者队列
|
||||||
|
*
|
||||||
|
* @param request HTTP请求
|
||||||
|
* @return 待就诊患者列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/patients/waiting")
|
||||||
|
public R<List<TodayOutpatientPatientDto>> getWaitingPatients(HttpServletRequest request) {
|
||||||
|
List<TodayOutpatientPatientDto> patients = todayOutpatientService.getWaitingPatients(request);
|
||||||
|
return R.ok(patients);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取今日就诊中患者列表
|
||||||
|
*
|
||||||
|
* @param request HTTP请求
|
||||||
|
* @return 就诊中患者列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/patients/in-progress")
|
||||||
|
public R<List<TodayOutpatientPatientDto>> getInProgressPatients(HttpServletRequest request) {
|
||||||
|
List<TodayOutpatientPatientDto> patients = todayOutpatientService.getInProgressPatients(request);
|
||||||
|
return R.ok(patients);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取今日已完成就诊患者列表
|
||||||
|
*
|
||||||
|
* @param request HTTP请求
|
||||||
|
* @return 已完成就诊患者列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/patients/completed")
|
||||||
|
public R<List<TodayOutpatientPatientDto>> getCompletedPatients(HttpServletRequest request) {
|
||||||
|
List<TodayOutpatientPatientDto> patients = todayOutpatientService.getCompletedPatients(request);
|
||||||
|
return R.ok(patients);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取患者就诊详情
|
||||||
|
*
|
||||||
|
* @param encounterId 就诊记录ID
|
||||||
|
* @param request HTTP请求
|
||||||
|
* @return 患者就诊详情
|
||||||
|
*/
|
||||||
|
@GetMapping("/patients/{encounterId}")
|
||||||
|
public R<TodayOutpatientPatientDto> getPatientDetail(
|
||||||
|
@PathVariable("encounterId") Long encounterId,
|
||||||
|
HttpServletRequest request) {
|
||||||
|
TodayOutpatientPatientDto patient = todayOutpatientService.getPatientDetail(encounterId, request);
|
||||||
|
return R.ok(patient);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量更新患者状态
|
||||||
|
*
|
||||||
|
* @param encounterIds 就诊记录ID列表
|
||||||
|
* @param targetStatus 目标状态
|
||||||
|
* @param request HTTP请求
|
||||||
|
* @return 更新结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/patients/batch-update-status")
|
||||||
|
public R<?> batchUpdatePatientStatus(
|
||||||
|
@RequestParam("encounterIds") List<Long> encounterIds,
|
||||||
|
@RequestParam("targetStatus") Integer targetStatus,
|
||||||
|
HttpServletRequest request) {
|
||||||
|
return todayOutpatientService.batchUpdatePatientStatus(encounterIds, targetStatus, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接诊患者
|
||||||
|
*
|
||||||
|
* @param encounterId 就诊记录ID
|
||||||
|
* @param request HTTP请求
|
||||||
|
* @return 接诊结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/patients/{encounterId}/receive")
|
||||||
|
public R<?> receivePatient(
|
||||||
|
@PathVariable("encounterId") Long encounterId,
|
||||||
|
HttpServletRequest request) {
|
||||||
|
return todayOutpatientService.receivePatient(encounterId, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完成就诊
|
||||||
|
*
|
||||||
|
* @param encounterId 就诊记录ID
|
||||||
|
* @param request HTTP请求
|
||||||
|
* @return 完成结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/patients/{encounterId}/complete")
|
||||||
|
public R<?> completeVisit(
|
||||||
|
@PathVariable("encounterId") Long encounterId,
|
||||||
|
HttpServletRequest request) {
|
||||||
|
return todayOutpatientService.completeVisit(encounterId, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消就诊
|
||||||
|
*
|
||||||
|
* @param encounterId 就诊记录ID
|
||||||
|
* @param reason 取消原因
|
||||||
|
* @param request HTTP请求
|
||||||
|
* @return 取消结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/patients/{encounterId}/cancel")
|
||||||
|
public R<?> cancelVisit(
|
||||||
|
@PathVariable("encounterId") Long encounterId,
|
||||||
|
@RequestParam(value = "reason", required = false) String reason,
|
||||||
|
HttpServletRequest request) {
|
||||||
|
return todayOutpatientService.cancelVisit(encounterId, reason, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 快速接诊 - 医生首页快捷操作
|
||||||
|
*
|
||||||
|
* @param encounterId 就诊记录ID
|
||||||
|
* @param request HTTP请求
|
||||||
|
* @return 接诊结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/quick-receive/{encounterId}")
|
||||||
|
public R<?> quickReceivePatient(
|
||||||
|
@PathVariable("encounterId") Long encounterId,
|
||||||
|
HttpServletRequest request) {
|
||||||
|
// 这里可以添加一些快速接诊的特殊逻辑
|
||||||
|
// 比如自动填充一些默认值,快速状态转换等
|
||||||
|
|
||||||
|
return todayOutpatientService.receivePatient(encounterId, request);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -123,4 +123,8 @@ public class PatientInfoDto {
|
|||||||
* 病历号
|
* 病历号
|
||||||
*/
|
*/
|
||||||
private String busNo;
|
private String busNo;
|
||||||
|
/**
|
||||||
|
* 就诊卡号
|
||||||
|
*/
|
||||||
|
private String identifierNo;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,132 @@
|
|||||||
|
package com.openhis.web.doctorstation.dto;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 今日门诊患者信息DTO
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class TodayOutpatientPatientDto {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 就诊记录ID
|
||||||
|
*/
|
||||||
|
private Long encounterId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 患者ID
|
||||||
|
*/
|
||||||
|
private Long patientId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 患者姓名
|
||||||
|
*/
|
||||||
|
private String patientName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 患者性别编码
|
||||||
|
*/
|
||||||
|
private Integer genderEnum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 患者性别显示文本
|
||||||
|
*/
|
||||||
|
private String genderEnumEnumText;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 年龄
|
||||||
|
*/
|
||||||
|
private Integer age;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 身份证号
|
||||||
|
*/
|
||||||
|
private String idCard;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 联系电话
|
||||||
|
*/
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 就诊流水号
|
||||||
|
*/
|
||||||
|
private String encounterBusNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 挂号时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date registerTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接诊时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date receptionTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 就诊状态编码
|
||||||
|
*/
|
||||||
|
private Integer statusEnum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 就诊状态显示文本
|
||||||
|
*/
|
||||||
|
private String statusEnumEnumText;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 就诊对象状态编码
|
||||||
|
*/
|
||||||
|
private Integer subjectStatusEnum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 就诊对象状态显示文本
|
||||||
|
*/
|
||||||
|
private String subjectStatusEnumEnumText;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 候诊时长(分钟)
|
||||||
|
*/
|
||||||
|
private Integer waitingDuration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 就诊时长(分钟)
|
||||||
|
*/
|
||||||
|
private Integer visitDuration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 患者类型编码
|
||||||
|
*/
|
||||||
|
private String typeCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 患者类型显示文本
|
||||||
|
*/
|
||||||
|
private String typeCodeDictText;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否重点患者(1-是,0-否)
|
||||||
|
*/
|
||||||
|
private Integer importantFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否已开药(1-是,0-否)
|
||||||
|
*/
|
||||||
|
private Integer hasPrescription;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否已检查(1-是,0-否)
|
||||||
|
*/
|
||||||
|
private Integer hasExamination;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否已检验(1-是,0-否)
|
||||||
|
*/
|
||||||
|
private Integer hasLaboratory;
|
||||||
|
}
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
package com.openhis.web.doctorstation.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 今日门诊查询参数DTO
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class TodayOutpatientQueryParam {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 搜索关键词(姓名/身份证号/手机号/就诊号)
|
||||||
|
*/
|
||||||
|
private String searchKey;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 就诊状态
|
||||||
|
* 1-待就诊,2-就诊中,3-已完成,4-已取消
|
||||||
|
*/
|
||||||
|
private Integer statusEnum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 患者类型
|
||||||
|
*/
|
||||||
|
private String typeCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否重点患者(1-是,0-否)
|
||||||
|
*/
|
||||||
|
private Integer importantFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否已开药(1-是,0-否)
|
||||||
|
*/
|
||||||
|
private Integer hasPrescription;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否已检查(1-是,0-否)
|
||||||
|
*/
|
||||||
|
private Integer hasExamination;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否已检验(1-是,0-否)
|
||||||
|
*/
|
||||||
|
private Integer hasLaboratory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 医生ID(可选,默认当前登录医生)
|
||||||
|
*/
|
||||||
|
private Long doctorId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 科室ID(可选,默认当前登录科室)
|
||||||
|
*/
|
||||||
|
private Long departmentId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询日期(格式:yyyy-MM-dd,默认今日)
|
||||||
|
*/
|
||||||
|
private String queryDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序字段
|
||||||
|
* 1-挂号时间,2-候诊时间,3-就诊号
|
||||||
|
*/
|
||||||
|
private Integer sortField;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序方式
|
||||||
|
* 1-升序,2-降序
|
||||||
|
*/
|
||||||
|
private Integer sortOrder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页码
|
||||||
|
*/
|
||||||
|
private Integer pageNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 每页大小
|
||||||
|
*/
|
||||||
|
private Integer pageSize;
|
||||||
|
|
||||||
|
public TodayOutpatientQueryParam() {
|
||||||
|
this.pageNo = 1;
|
||||||
|
this.pageSize = 10;
|
||||||
|
this.sortField = 1; // 默认按挂号时间排序
|
||||||
|
this.sortOrder = 2; // 默认降序
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
package com.openhis.web.doctorstation.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 今日门诊统计DTO
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class TodayOutpatientStatsDto {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 今日总挂号数
|
||||||
|
*/
|
||||||
|
private Integer totalRegistered;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 待就诊数
|
||||||
|
*/
|
||||||
|
private Integer waitingCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 就诊中数
|
||||||
|
*/
|
||||||
|
private Integer inProgressCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已完成数
|
||||||
|
*/
|
||||||
|
private Integer completedCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已取消数
|
||||||
|
*/
|
||||||
|
private Integer cancelledCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 平均候诊时间(分钟)
|
||||||
|
*/
|
||||||
|
private Integer averageWaitingTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 平均就诊时间(分钟)
|
||||||
|
*/
|
||||||
|
private Integer averageVisitTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 今日接诊医生数
|
||||||
|
*/
|
||||||
|
private Integer doctorCount;
|
||||||
|
}
|
||||||
@@ -0,0 +1,204 @@
|
|||||||
|
package com.openhis.web.doctorstation.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.openhis.web.doctorstation.dto.TodayOutpatientPatientDto;
|
||||||
|
import com.openhis.web.doctorstation.dto.TodayOutpatientStatsDto;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 今日门诊数据访问接口
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface TodayOutpatientMapper {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取今日门诊统计信息
|
||||||
|
*
|
||||||
|
* @param doctorId 医生ID
|
||||||
|
* @param departmentId 科室ID
|
||||||
|
* @param queryDate 查询日期
|
||||||
|
* @return 统计信息
|
||||||
|
*/
|
||||||
|
@Select("<script>" +
|
||||||
|
"SELECT " +
|
||||||
|
" COUNT(DISTINCT enc.id) AS totalRegistered, " +
|
||||||
|
" SUM(CASE WHEN enc.status_enum = #{plannedStatus} THEN 1 ELSE 0 END) AS waitingCount, " +
|
||||||
|
" SUM(CASE WHEN enc.status_enum = #{inProgressStatus} THEN 1 ELSE 0 END) AS inProgressCount, " +
|
||||||
|
" SUM(CASE WHEN enc.status_enum = #{dischargedStatus} THEN 1 ELSE 0 END) AS completedCount, " +
|
||||||
|
" SUM(CASE WHEN enc.status_enum = #{cancelledStatus} THEN 1 ELSE 0 END) AS cancelledCount, " +
|
||||||
|
" AVG(CASE WHEN enc.reception_time IS NOT NULL " +
|
||||||
|
" THEN EXTRACT(EPOCH FROM (enc.reception_time - enc.start_time)) / 60 " +
|
||||||
|
" ELSE NULL END) AS averageWaitingTime, " +
|
||||||
|
" AVG(CASE WHEN enc.end_time IS NOT NULL AND enc.reception_time IS NOT NULL " +
|
||||||
|
" THEN EXTRACT(EPOCH FROM (enc.end_time - enc.reception_time)) / 60 " +
|
||||||
|
" ELSE NULL END) AS averageVisitTime, " +
|
||||||
|
" COUNT(DISTINCT ep.practitioner_id) AS doctorCount " +
|
||||||
|
"FROM adm_encounter enc " +
|
||||||
|
"LEFT JOIN adm_encounter_participant ep ON enc.id = ep.encounter_id " +
|
||||||
|
" AND ep.type_code = #{admitterCode} " +
|
||||||
|
" AND ep.delete_flag = '0' " +
|
||||||
|
" AND ep.tenant_id = #{tenantId} " +
|
||||||
|
" AND ep.tenant_id = #{tenantId} " +
|
||||||
|
"WHERE enc.delete_flag = '0' " +
|
||||||
|
" AND enc.start_time::DATE = #{queryDate}::DATE " +
|
||||||
|
" AND enc.tenant_id = #{tenantId} " +
|
||||||
|
" <if test='departmentId != null'>" +
|
||||||
|
" AND enc.organization_id = #{departmentId} " +
|
||||||
|
" </if>" +
|
||||||
|
" <if test='doctorId != null'>" +
|
||||||
|
" AND ep.practitioner_id = #{practitionerId} " +
|
||||||
|
" </if>" +
|
||||||
|
"</script>")
|
||||||
|
TodayOutpatientStatsDto getTodayOutpatientStats(
|
||||||
|
@Param("doctorId") Long doctorId,
|
||||||
|
@Param("departmentId") Long departmentId,
|
||||||
|
@Param("queryDate") String queryDate,
|
||||||
|
@Param("tenantId") Integer tenantId,
|
||||||
|
@Param("practitionerId") Long practitionerId,
|
||||||
|
@Param("plannedStatus") Integer plannedStatus,
|
||||||
|
@Param("inProgressStatus") Integer inProgressStatus,
|
||||||
|
@Param("dischargedStatus") Integer dischargedStatus,
|
||||||
|
@Param("cancelledStatus") Integer cancelledStatus,
|
||||||
|
@Param("admitterCode") String admitterCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询今日门诊患者列表
|
||||||
|
*
|
||||||
|
* @param page 分页参数
|
||||||
|
* @param queryWrapper 查询条件
|
||||||
|
* @return 分页结果
|
||||||
|
*/
|
||||||
|
@Select("<script>" +
|
||||||
|
"SELECT " +
|
||||||
|
" enc.id AS encounterId, " +
|
||||||
|
" enc.patient_id AS patientId, " +
|
||||||
|
" pt.name AS patientName, " +
|
||||||
|
" pt.gender_enum AS genderEnum, " +
|
||||||
|
" pt.birth_date AS birthDate, " +
|
||||||
|
" pt.id_card AS idCard, " +
|
||||||
|
" pt.phone AS phone, " +
|
||||||
|
" enc.bus_no AS encounterBusNo, " +
|
||||||
|
" enc.start_time AS registerTime, " +
|
||||||
|
" enc.reception_time AS receptionTime, " +
|
||||||
|
" enc.status_enum AS statusEnum, " +
|
||||||
|
" enc.subject_status_enum AS subjectStatusEnum, " +
|
||||||
|
" CASE WHEN enc.reception_time IS NOT NULL " +
|
||||||
|
" THEN EXTRACT(EPOCH FROM (enc.reception_time - enc.start_time)) / 60 " +
|
||||||
|
" ELSE EXTRACT(EPOCH FROM (NOW() - enc.start_time)) / 60 END AS waitingDuration, " +
|
||||||
|
" CASE WHEN enc.end_time IS NOT NULL AND enc.reception_time IS NOT NULL " +
|
||||||
|
" THEN EXTRACT(EPOCH FROM (enc.end_time - enc.reception_time)) / 60 " +
|
||||||
|
" ELSE NULL END AS visitDuration, " +
|
||||||
|
" pt.type_code AS typeCode, " +
|
||||||
|
" enc.important_flag AS importantFlag, " +
|
||||||
|
" CASE WHEN EXISTS (SELECT 1 FROM med_medication_dispense WHERE encounter_id = enc.id AND delete_flag = '0') " +
|
||||||
|
" THEN 1 ELSE 0 END AS hasPrescription, " +
|
||||||
|
" CASE WHEN EXISTS (SELECT 1 FROM med_inspection_application WHERE encounter_id = enc.id AND delete_flag = '0') " +
|
||||||
|
" THEN 1 ELSE 0 END AS hasExamination, " +
|
||||||
|
" CASE WHEN EXISTS (SELECT 1 FROM med_test_application WHERE encounter_id = enc.id AND delete_flag = '0') " +
|
||||||
|
" THEN 1 ELSE 0 END AS hasLaboratory " +
|
||||||
|
"FROM adm_encounter enc " +
|
||||||
|
"INNER JOIN adm_patient pt ON enc.patient_id = pt.id AND pt.delete_flag = '0' AND pt.tenant_id = #{tenantId} " +
|
||||||
|
"LEFT JOIN adm_encounter_participant ep ON enc.id = ep.encounter_id " +
|
||||||
|
" AND ep.type_code = #{admitterCode} " +
|
||||||
|
" AND ep.delete_flag = '0' " +
|
||||||
|
" AND ep.tenant_id = #{tenantId} " +
|
||||||
|
"<where>" +
|
||||||
|
" enc.delete_flag = '0' " +
|
||||||
|
" AND enc.tenant_id = #{tenantId} " +
|
||||||
|
" <if test='ew != null and ew.customSqlSegment != null and ew.customSqlSegment != \"\"'>" +
|
||||||
|
" AND ${ew.customSqlSegment.replace('WHERE ', '').replace('tenant_id', 'enc.tenant_id')}" +
|
||||||
|
" </if>" +
|
||||||
|
"</where> " +
|
||||||
|
"</script>")
|
||||||
|
IPage<TodayOutpatientPatientDto> getTodayOutpatientPatients(
|
||||||
|
Page<TodayOutpatientPatientDto> page,
|
||||||
|
@Param("ew") QueryWrapper<TodayOutpatientPatientDto> queryWrapper,
|
||||||
|
@Param("tenantId") Integer tenantId,
|
||||||
|
@Param("admitterCode") String admitterCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取患者详情
|
||||||
|
*
|
||||||
|
* @param queryWrapper 查询条件
|
||||||
|
* @return 患者详情
|
||||||
|
*/
|
||||||
|
@Select("<script>" +
|
||||||
|
"SELECT " +
|
||||||
|
" enc.id AS encounterId, " +
|
||||||
|
" enc.patient_id AS patientId, " +
|
||||||
|
" pt.name AS patientName, " +
|
||||||
|
" pt.gender_enum AS genderEnum, " +
|
||||||
|
" pt.birth_date AS birthDate, " +
|
||||||
|
" pt.id_card AS idCard, " +
|
||||||
|
" pt.phone AS phone, " +
|
||||||
|
" enc.bus_no AS encounterBusNo, " +
|
||||||
|
" enc.start_time AS registerTime, " +
|
||||||
|
" enc.reception_time AS receptionTime, " +
|
||||||
|
" enc.status_enum AS statusEnum, " +
|
||||||
|
" enc.subject_status_enum AS subjectStatusEnum, " +
|
||||||
|
" CASE WHEN enc.reception_time IS NOT NULL " +
|
||||||
|
" THEN EXTRACT(EPOCH FROM (enc.reception_time - enc.start_time)) / 60 " +
|
||||||
|
" ELSE EXTRACT(EPOCH FROM (NOW() - enc.start_time)) / 60 END AS waitingDuration, " +
|
||||||
|
" CASE WHEN enc.end_time IS NOT NULL AND enc.reception_time IS NOT NULL " +
|
||||||
|
" THEN EXTRACT(EPOCH FROM (enc.end_time - enc.reception_time)) / 60 " +
|
||||||
|
" ELSE NULL END AS visitDuration, " +
|
||||||
|
" pt.type_code AS typeCode, " +
|
||||||
|
" enc.important_flag AS importantFlag, " +
|
||||||
|
" CASE WHEN EXISTS (SELECT 1 FROM med_medication_dispense WHERE encounter_id = enc.id AND delete_flag = '0') " +
|
||||||
|
" THEN 1 ELSE 0 END AS hasPrescription, " +
|
||||||
|
" CASE WHEN EXISTS (SELECT 1 FROM med_inspection_application WHERE encounter_id = enc.id AND delete_flag = '0') " +
|
||||||
|
" THEN 1 ELSE 0 END AS hasExamination, " +
|
||||||
|
" CASE WHEN EXISTS (SELECT 1 FROM med_test_application WHERE encounter_id = enc.id AND delete_flag = '0') " +
|
||||||
|
" THEN 1 ELSE 0 END AS hasLaboratory " +
|
||||||
|
"FROM adm_encounter enc " +
|
||||||
|
"INNER JOIN adm_patient pt ON enc.patient_id = pt.id AND pt.delete_flag = '0' AND pt.tenant_id = #{tenantId} " +
|
||||||
|
"LEFT JOIN adm_encounter_participant ep ON enc.id = ep.encounter_id " +
|
||||||
|
" AND ep.type_code = #{admitterCode} " +
|
||||||
|
" AND ep.delete_flag = '0' " +
|
||||||
|
" AND ep.tenant_id = #{tenantId} " +
|
||||||
|
"<where>" +
|
||||||
|
" enc.delete_flag = '0' " +
|
||||||
|
" AND enc.tenant_id = #{tenantId} " +
|
||||||
|
" <if test='ew != null and ew.customSqlSegment != null and ew.customSqlSegment != \"\"'>" +
|
||||||
|
" AND ${ew.customSqlSegment.replace('WHERE ', '').replace('tenant_id', 'enc.tenant_id')}" +
|
||||||
|
" </if>" +
|
||||||
|
"</where> " +
|
||||||
|
"</script>")
|
||||||
|
TodayOutpatientPatientDto getPatientDetail(
|
||||||
|
@Param("ew") QueryWrapper<TodayOutpatientPatientDto> queryWrapper,
|
||||||
|
@Param("tenantId") Integer tenantId,
|
||||||
|
@Param("admitterCode") String admitterCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量更新患者状态
|
||||||
|
*
|
||||||
|
* @param encounterIds 就诊记录ID列表
|
||||||
|
* @param targetStatus 目标状态
|
||||||
|
* @param doctorId 医生ID
|
||||||
|
* @param updateTime 更新时间
|
||||||
|
* @return 更新记录数
|
||||||
|
*/
|
||||||
|
@Select("<script>" +
|
||||||
|
"UPDATE adm_encounter " +
|
||||||
|
"SET status_enum = #{targetStatus}, " +
|
||||||
|
" update_by = #{doctorId}, " +
|
||||||
|
" update_time = #{updateTime} " +
|
||||||
|
"WHERE id IN " +
|
||||||
|
" <foreach collection='encounterIds' item='id' open='(' separator=',' close=')'>" +
|
||||||
|
" #{id} " +
|
||||||
|
" </foreach> " +
|
||||||
|
" AND delete_flag = '0'" +
|
||||||
|
"</script>")
|
||||||
|
int batchUpdatePatientStatus(
|
||||||
|
@Param("encounterIds") List<Long> encounterIds,
|
||||||
|
@Param("targetStatus") Integer targetStatus,
|
||||||
|
@Param("doctorId") Long doctorId,
|
||||||
|
@Param("updateTime") Date updateTime);
|
||||||
|
}
|
||||||
@@ -45,9 +45,9 @@ public interface IPatientInformationService {
|
|||||||
/**
|
/**
|
||||||
* 添加病人信息
|
* 添加病人信息
|
||||||
*
|
*
|
||||||
* @param patientInfoDto 病人信息
|
* @param patientBaseInfoDto 病人信息
|
||||||
*/
|
*/
|
||||||
R<?> addPatient(PatientBaseInfoDto patientInfoDto);
|
R<?> addPatient(PatientBaseInfoDto patientBaseInfoDto);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新患者手机号
|
* 更新患者手机号
|
||||||
|
|||||||
@@ -143,6 +143,11 @@ public class PatientInformationServiceImpl implements IPatientInformationService
|
|||||||
CommonConstants.FieldName.BusNo, CommonConstants.FieldName.PyStr, CommonConstants.FieldName.WbStr)),
|
CommonConstants.FieldName.BusNo, CommonConstants.FieldName.PyStr, CommonConstants.FieldName.WbStr)),
|
||||||
request);
|
request);
|
||||||
|
|
||||||
|
// 检查是否是精确ID查询(从门诊挂号页面跳转时使用)
|
||||||
|
boolean hasExactIdQuery = (patientBaseInfoDto.getId() != null);
|
||||||
|
|
||||||
|
// 只有非精确ID查询时,才添加医生患者过滤条件
|
||||||
|
if (!hasExactIdQuery) {
|
||||||
// 查询当前用户对应的医生信息
|
// 查询当前用户对应的医生信息
|
||||||
LambdaQueryWrapper<com.openhis.administration.domain.Practitioner> practitionerQuery = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<com.openhis.administration.domain.Practitioner> practitionerQuery = new LambdaQueryWrapper<>();
|
||||||
practitionerQuery.eq(com.openhis.administration.domain.Practitioner::getUserId, userId);
|
practitionerQuery.eq(com.openhis.administration.domain.Practitioner::getUserId, userId);
|
||||||
@@ -166,6 +171,7 @@ public class PatientInformationServiceImpl implements IPatientInformationService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 如果不是医生,查询所有患者
|
// 如果不是医生,查询所有患者
|
||||||
|
}
|
||||||
|
|
||||||
IPage<PatientBaseInfoDto> patientInformationPage
|
IPage<PatientBaseInfoDto> patientInformationPage
|
||||||
= patientManageMapper.getPatientPage(new Page<>(pageNo, pageSize), queryWrapper);
|
= patientManageMapper.getPatientPage(new Page<>(pageNo, pageSize), queryWrapper);
|
||||||
@@ -254,31 +260,32 @@ public class PatientInformationServiceImpl implements IPatientInformationService
|
|||||||
/**
|
/**
|
||||||
* 添加病人信息
|
* 添加病人信息
|
||||||
*
|
*
|
||||||
* @param patientInfoDto 病人信息
|
* @param patientBaseInfoDto 病人信息
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public R<?> addPatient(PatientBaseInfoDto patientInfoDto) {
|
public R<?> addPatient(PatientBaseInfoDto patientBaseInfoDto) {
|
||||||
|
// log.debug("添加病人信息,patientInfoDto:{}", patientBaseInfoDto);
|
||||||
// 如果患者没有输入身份证号则根据年龄自动生成
|
// 如果患者没有输入身份证号则根据年龄自动生成
|
||||||
String idCard = patientInfoDto.getIdCard();
|
String idCard = patientBaseInfoDto.getIdCard();
|
||||||
if (idCard == null || CommonConstants.Common.AREA_CODE.equals(idCard.substring(0, 6))) {
|
if (idCard == null || CommonConstants.Common.AREA_CODE.equals(idCard.substring(0, 6))) {
|
||||||
if (patientInfoDto.getAge() != null) {
|
if (patientBaseInfoDto.getAge() != null) {
|
||||||
idCard = IdCardUtil.generateIdByAge(patientInfoDto.getAge());
|
idCard = IdCardUtil.generateIdByAge(patientBaseInfoDto.getAge());
|
||||||
patientInfoDto.setIdCard(idCard);
|
patientBaseInfoDto.setIdCard(idCard);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 身份证号是否存在
|
// 身份证号是否存在
|
||||||
List<Patient> idCardList
|
List<Patient> idCardList
|
||||||
= patientService.list(new LambdaQueryWrapper<Patient>().eq(Patient::getIdCard, patientInfoDto.getIdCard()));
|
= patientService.list(new LambdaQueryWrapper<Patient>().eq(Patient::getIdCard, patientBaseInfoDto.getIdCard()));
|
||||||
if (!idCardList.isEmpty()) {
|
if (!idCardList.isEmpty()) {
|
||||||
throw new ServiceException("身份证号:" + patientInfoDto.getIdCard() + "已经存在");
|
throw new ServiceException("身份证号:" + patientBaseInfoDto.getIdCard() + "已经存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理患者信息
|
// 处理患者信息
|
||||||
Patient patient = this.handlePatientInfo(patientInfoDto);
|
Patient patient = this.handlePatientInfo(patientBaseInfoDto);
|
||||||
|
|
||||||
// 新增患者身份子表信息
|
// 新增患者身份子表信息
|
||||||
if (patientInfoDto.getPatientIdInfoList() != null) {
|
if (patientBaseInfoDto.getPatientIdInfoList() != null) {
|
||||||
List<PatientIdInfoDto> patientIdInfoList = patientInfoDto.getPatientIdInfoList();
|
List<PatientIdInfoDto> patientIdInfoList = patientBaseInfoDto.getPatientIdInfoList();
|
||||||
PatientIdentifier patientIdentifier;
|
PatientIdentifier patientIdentifier;
|
||||||
for (PatientIdInfoDto patientIdInfoDto : patientIdInfoList) {
|
for (PatientIdInfoDto patientIdInfoDto : patientIdInfoList) {
|
||||||
patientIdentifier = new PatientIdentifier();
|
patientIdentifier = new PatientIdentifier();
|
||||||
|
|||||||
@@ -38,11 +38,12 @@ public class PatientInformationController {
|
|||||||
/**
|
/**
|
||||||
* 添加病人信息
|
* 添加病人信息
|
||||||
*
|
*
|
||||||
* @param patientInfoDto 病人信息
|
* @param patientBaseInfoDto 病人信息
|
||||||
*/
|
*/
|
||||||
@PostMapping("/patient-information")
|
@PostMapping("/patient-information")
|
||||||
public R<?> addPatient(@RequestBody PatientBaseInfoDto patientInfoDto) {
|
public R<?> addPatient(@RequestBody PatientBaseInfoDto patientBaseInfoDto) {
|
||||||
return patientInformationService.addPatient(patientInfoDto);
|
// log.debug("添加病人信息,patientInfoDto:{}", patientBaseInfoDto);
|
||||||
|
return patientInformationService.addPatient(patientBaseInfoDto);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -59,6 +59,13 @@ public interface IEleInvoiceService {
|
|||||||
*/
|
*/
|
||||||
R<?> invoiceWriteoff(Long paymentId, String reason);
|
R<?> invoiceWriteoff(Long paymentId, String reason);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取发票HTML
|
||||||
|
* @param busNo 业务流水号
|
||||||
|
* @return HTML字符串
|
||||||
|
*/
|
||||||
|
String getInvoiceHtml(String busNo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询已开发票
|
* 查询已开发票
|
||||||
* @param invoiceId 主键id
|
* @param invoiceId 主键id
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import com.openhis.financial.domain.PaymentRecDetail;
|
|||||||
import com.openhis.financial.domain.PaymentReconciliation;
|
import com.openhis.financial.domain.PaymentReconciliation;
|
||||||
import com.openhis.financial.service.IPaymentRecDetailService;
|
import com.openhis.financial.service.IPaymentRecDetailService;
|
||||||
import com.openhis.financial.service.IPaymentReconciliationService;
|
import com.openhis.financial.service.IPaymentReconciliationService;
|
||||||
|
import com.openhis.web.paymentmanage.appservice.IChargeBillService;
|
||||||
import com.openhis.web.paymentmanage.appservice.IEleInvoiceService;
|
import com.openhis.web.paymentmanage.appservice.IEleInvoiceService;
|
||||||
import com.openhis.web.paymentmanage.dto.*;
|
import com.openhis.web.paymentmanage.dto.*;
|
||||||
import com.openhis.web.paymentmanage.mapper.EleInvoiceMapper;
|
import com.openhis.web.paymentmanage.mapper.EleInvoiceMapper;
|
||||||
@@ -38,6 +39,11 @@ import com.openhis.yb.service.IClinicSettleService;
|
|||||||
import com.openhis.yb.service.IRegService;
|
import com.openhis.yb.service.IRegService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.codec.digest.DigestUtils;
|
import org.apache.commons.codec.digest.DigestUtils;
|
||||||
|
import org.apache.velocity.Template;
|
||||||
|
import org.apache.velocity.VelocityContext;
|
||||||
|
import org.apache.velocity.app.Velocity;
|
||||||
|
import org.apache.velocity.runtime.RuntimeConstants;
|
||||||
|
import org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader;
|
||||||
import org.apache.http.HttpResponse;
|
import org.apache.http.HttpResponse;
|
||||||
import org.apache.http.client.config.RequestConfig;
|
import org.apache.http.client.config.RequestConfig;
|
||||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||||
@@ -56,6 +62,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.StringWriter;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.Charset;
|
||||||
@@ -64,6 +71,7 @@ import java.text.DecimalFormat;
|
|||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -97,153 +105,180 @@ public class EleInvoiceServiceImpl implements IEleInvoiceService {
|
|||||||
@Resource
|
@Resource
|
||||||
IEncounterService encounterService;
|
IEncounterService encounterService;
|
||||||
@Resource
|
@Resource
|
||||||
|
IChargeBillService chargeBillService;
|
||||||
|
@Resource
|
||||||
private AssignSeqUtil assignSeqUtil;
|
private AssignSeqUtil assignSeqUtil;
|
||||||
@Autowired
|
@Autowired
|
||||||
private HttpConfig httpConfig;
|
private HttpConfig httpConfig;
|
||||||
|
|
||||||
public static JSONObject PreInvoicePostForward(JSONObject bill, String endpoint) {
|
static {
|
||||||
String resultString = "";
|
Properties p = new Properties();
|
||||||
// JSONObject result = new JSONObject();
|
p.setProperty(RuntimeConstants.RESOURCE_LOADER, "classpath");
|
||||||
// 获取当前租户的option信息
|
p.setProperty("classpath.resource.loader.class", ClasspathResourceLoader.class.getName());
|
||||||
|
p.setProperty(Velocity.INPUT_ENCODING, "UTF-8");
|
||||||
|
Velocity.init(p);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Map<String, JSONObject> invoiceDataMap = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
|
private JSONObject internalRegistration(JSONObject bill) {
|
||||||
|
return createInternalSuccessResponse(bill, "REG");
|
||||||
|
}
|
||||||
|
|
||||||
|
private JSONObject internalOutpatient(JSONObject bill) {
|
||||||
|
return createInternalSuccessResponse(bill, "OUT");
|
||||||
|
}
|
||||||
|
|
||||||
|
private JSONObject internalHospitalized(JSONObject bill) {
|
||||||
|
return createInternalSuccessResponse(bill, "HOS");
|
||||||
|
}
|
||||||
|
|
||||||
|
private JSONObject internalWriteOff(JSONObject bill) {
|
||||||
|
JSONObject message = new JSONObject();
|
||||||
|
message.put("eScarletBillBatchCode", "SC" + System.currentTimeMillis());
|
||||||
|
message.put("eScarletBillNo", UUID.randomUUID().toString().substring(0, 8));
|
||||||
|
message.put("eScarletRandom", "666888");
|
||||||
|
message.put("createTime", "20251101143028");
|
||||||
|
message.put("billQRCode", "QR_DATA_SCARLET");
|
||||||
|
|
||||||
JSONObject optionJson = SecurityUtils.getLoginUser().getOptionJson();
|
JSONObject optionJson = SecurityUtils.getLoginUser().getOptionJson();
|
||||||
String baseUrl = optionJson.getString(CommonConstants.Option.URL);
|
String baseUrl = optionJson.getString(CommonConstants.Option.URL);
|
||||||
String appID = optionJson.getString(CommonConstants.Option.APP_ID);
|
message.put("pictureUrl", baseUrl + "/invoice/view?busNo=scarlet");
|
||||||
String appKey = optionJson.getString(CommonConstants.Option.KEY);
|
message.put("pictureNetUrl", baseUrl + "/invoice/view?busNo=scarlet");
|
||||||
|
|
||||||
EleInvioceBillDto eleInvioceBillDto = new EleInvioceBillDto();
|
JSONObject result = new JSONObject();
|
||||||
eleInvioceBillDto.setBaseUrl(baseUrl);
|
result.put("result", "S0000");
|
||||||
eleInvioceBillDto.setEndpoint(endpoint);
|
result.put("message", Base64.getEncoder().encodeToString(message.toJSONString().getBytes(StandardCharsets.UTF_8)));
|
||||||
eleInvioceBillDto.setAppKey(appKey);
|
return result;
|
||||||
eleInvioceBillDto.setAppID(appID);
|
|
||||||
eleInvioceBillDto.setJsonObject(bill);
|
|
||||||
|
|
||||||
// 创建Http请求
|
|
||||||
RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(30000).setConnectionRequestTimeout(30000)
|
|
||||||
.setSocketTimeout(30000).build();
|
|
||||||
CloseableHttpClient httpClient = HttpClients.custom().setDefaultRequestConfig(requestConfig).build();
|
|
||||||
CloseableHttpResponse response = null;
|
|
||||||
// 发送请求
|
|
||||||
try {
|
|
||||||
HttpPost httpPost = new HttpPost(optionJson.getString("invoiceUrl") + "/eleInvoice/forward");
|
|
||||||
System.out.println(optionJson.getString("invoiceUrl") + "/eleInvoice/forward");
|
|
||||||
StringEntity stringEntity = new StringEntity(com.alibaba.fastjson2.JSON.toJSONString(eleInvioceBillDto),
|
|
||||||
ContentType.APPLICATION_JSON);
|
|
||||||
httpPost.setEntity(stringEntity);
|
|
||||||
// 执行http请求
|
|
||||||
response = httpClient.execute(httpPost);
|
|
||||||
if (response == null) {
|
|
||||||
throw new ServiceException("Http请求异常,未接受返回参数");
|
|
||||||
}
|
}
|
||||||
resultString = EntityUtils.toString(response.getEntity(), "utf-8");
|
|
||||||
|
private JSONObject createInternalSuccessResponse(JSONObject bill, String prefix) {
|
||||||
|
String busNo = bill.getString("busNo");
|
||||||
|
JSONObject optionJson = SecurityUtils.getLoginUser().getOptionJson();
|
||||||
|
String baseUrl = optionJson.getString(CommonConstants.Option.URL);
|
||||||
|
|
||||||
|
JSONObject message = new JSONObject();
|
||||||
|
message.put("billBatchCode", prefix + "BC" + System.currentTimeMillis());
|
||||||
|
message.put("billNo", UUID.randomUUID().toString().substring(0, 8));
|
||||||
|
message.put("random", "123456");
|
||||||
|
message.put("createTime", new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date()));
|
||||||
|
message.put("billQRCode", "QR_" + busNo);
|
||||||
|
message.put("pictureUrl", baseUrl + "/invoice/view?busNo=" + busNo);
|
||||||
|
message.put("pictureNetUrl", baseUrl + "/invoice/view?busNo=" + busNo);
|
||||||
|
|
||||||
|
JSONObject result = new JSONObject();
|
||||||
|
result.put("result", "S0000");
|
||||||
|
result.put("message", Base64.getEncoder().encodeToString(message.toJSONString().getBytes(StandardCharsets.UTF_8)));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private JSONObject createInternalErrorResponse(String msg) {
|
||||||
|
JSONObject result = new JSONObject();
|
||||||
|
result.put("result", "E0001");
|
||||||
|
result.put("message", Base64.getEncoder().encodeToString(msg.getBytes(StandardCharsets.UTF_8)));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getInvoiceHtml(String busNo) {
|
||||||
|
JSONObject bill = invoiceDataMap.get(busNo);
|
||||||
|
if (bill == null) {
|
||||||
|
return "<html><body><h2>未找到流水号为 " + busNo + " 的发票数据</h2></body></html>";
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject receiptData = bill.getJSONObject("receiptData");
|
||||||
|
|
||||||
|
VelocityContext context = new VelocityContext();
|
||||||
|
context.put("hospitalName", receiptData != null ? receiptData.getString("fixmedinsName") : "HIS 医疗机构");
|
||||||
|
context.put("patientName", bill.getString("payer"));
|
||||||
|
context.put("outpatientNo", receiptData != null ? receiptData.getString("regNo") : bill.getString("busNo"));
|
||||||
|
context.put("idCard", bill.getString("cardNo"));
|
||||||
|
context.put("tel", bill.getString("tel"));
|
||||||
|
context.put("deptName", bill.getString("patientCategory"));
|
||||||
|
context.put("doctorName", receiptData != null ? receiptData.getString("doctor") : "-");
|
||||||
|
context.put("appointmentTime", bill.getString("consultationDate"));
|
||||||
|
context.put("totalAmt", bill.getString("totalAmt"));
|
||||||
|
context.put("busNo", busNo);
|
||||||
|
context.put("printTime", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
|
||||||
|
|
||||||
|
List<Map<String, Object>> items = new ArrayList<>();
|
||||||
|
if (receiptData != null && receiptData.containsKey("chargeItem")) {
|
||||||
|
com.alibaba.fastjson2.JSONArray chargeItems = receiptData.getJSONArray("chargeItem");
|
||||||
|
for (int i = 0; i < chargeItems.size(); i++) {
|
||||||
|
JSONObject item = chargeItems.getJSONObject(i);
|
||||||
|
Map<String, Object> itemMap = new HashMap<>();
|
||||||
|
itemMap.put("chargeItemName", item.getString("chargeItemName"));
|
||||||
|
itemMap.put("quantityValue", item.getString("quantityValue"));
|
||||||
|
itemMap.put("totalPrice", item.getString("totalPrice"));
|
||||||
|
items.add(itemMap);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Map<String, Object> itemMap = new HashMap<>();
|
||||||
|
itemMap.put("chargeItemName", "挂号费");
|
||||||
|
itemMap.put("quantityValue", "1");
|
||||||
|
itemMap.put("totalPrice", bill.getString("totalAmt"));
|
||||||
|
items.add(itemMap);
|
||||||
|
}
|
||||||
|
context.put("items", items);
|
||||||
|
|
||||||
|
try {
|
||||||
|
Template template = Velocity.getTemplate("vm/invoice/invoice.vm");
|
||||||
|
StringWriter writer = new StringWriter();
|
||||||
|
template.merge(context, writer);
|
||||||
|
return writer.toString();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
log.error("渲染发票模板失败", e);
|
||||||
throw new ServiceException("Http请求异常,请稍后再试。");
|
return "<html><body><h2>渲染发票凭条失败:" + e.getMessage() + "</h2></body></html>";
|
||||||
} finally {
|
}
|
||||||
if (response != null) {
|
}
|
||||||
|
|
||||||
|
public JSONObject PreInvoicePostForward(JSONObject bill, String endpoint) {
|
||||||
|
// 参考补打小票逻辑,动态获取小票详细信息
|
||||||
|
Long paymentId = bill.getLong("paymentId");
|
||||||
|
if (paymentId != null) {
|
||||||
try {
|
try {
|
||||||
response.close();
|
Map<String, Object> receiptDetail = chargeBillService.getDetail(paymentId);
|
||||||
} catch (IOException e) {
|
bill.put("receiptData", receiptDetail);
|
||||||
// logger.error("关闭响应异常", e);
|
log.info("已成功获取并注入小票动态数据,paymentId: {}", paymentId);
|
||||||
throw new ServiceException("未关闭系统资源:" + e.getStackTrace());
|
} catch (Exception e) {
|
||||||
|
log.error("获取小票数据失败,paymentId: {}", paymentId, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 内部调用逻辑:不再使用 Http 客户端,直接分发到本地逻辑
|
||||||
|
String busNo = bill.getString("busNo");
|
||||||
|
if (busNo != null) {
|
||||||
|
invoiceDataMap.put(busNo, bill);
|
||||||
}
|
}
|
||||||
return JSONObject.parseObject(resultString);
|
|
||||||
|
JSONObject internalResult;
|
||||||
|
if (endpoint.contains("invEBillRegistration")) {
|
||||||
|
internalResult = internalRegistration(bill);
|
||||||
|
} else if (endpoint.contains("invoiceEBillOutpatient")) {
|
||||||
|
internalResult = internalOutpatient(bill);
|
||||||
|
} else if (endpoint.contains("invEBillHospitalized")) {
|
||||||
|
internalResult = internalHospitalized(bill);
|
||||||
|
} else if (endpoint.contains("writeOffEBill")) {
|
||||||
|
internalResult = internalWriteOff(bill);
|
||||||
|
} else {
|
||||||
|
internalResult = createInternalErrorResponse("未知接口: " + endpoint);
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject finalResponse = new JSONObject();
|
||||||
|
finalResponse.put("success", true);
|
||||||
|
finalResponse.put("result", internalResult);
|
||||||
|
return finalResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发送请求
|
* 发送请求 (内部调用版本)
|
||||||
*
|
*
|
||||||
* @param bill 请求参数
|
* @param bill 请求参数
|
||||||
* @param endpoint 请求后缀url
|
* @param endpoint 请求后缀url
|
||||||
* @return 返回值
|
* @return 返回值
|
||||||
*/
|
*/
|
||||||
public static JSONObject PreInvoicePost(JSONObject bill, String endpoint) {
|
public JSONObject PreInvoicePost(JSONObject bill, String endpoint) {
|
||||||
|
return PreInvoicePostForward(bill, endpoint);
|
||||||
JSONObject result = new JSONObject();
|
|
||||||
// 获取当前租户的option信息
|
|
||||||
JSONObject optionJson = SecurityUtils.getLoginUser().getOptionJson();
|
|
||||||
|
|
||||||
String baseUrl = optionJson.getString(CommonConstants.Option.URL);
|
|
||||||
// 拼接成完整 URL(作为路径)
|
|
||||||
String cleanUrl = baseUrl + "/" + endpoint; // 确保用 "/" 分隔
|
|
||||||
String url = cleanUrl.trim().replaceAll("^\"|\"$", "") // 去除首尾引号
|
|
||||||
.replaceAll("\\s+", "")// 去除首尾引号
|
|
||||||
.replaceAll("\"", ""); // 去除中间引号
|
|
||||||
|
|
||||||
String appID = optionJson.getString(CommonConstants.Option.APP_ID);
|
|
||||||
String appKey = optionJson.getString(CommonConstants.Option.KEY);
|
|
||||||
String data = bill.toJSONString();
|
|
||||||
String version = "1.0";
|
|
||||||
// 请求随机标识 noise
|
|
||||||
String noise = UUID.randomUUID().toString();
|
|
||||||
|
|
||||||
data = Base64.getEncoder().encodeToString(data.getBytes(StandardCharsets.UTF_8));
|
|
||||||
|
|
||||||
StringBuilder str = new StringBuilder();
|
|
||||||
str.append("appid=").append(appID);
|
|
||||||
str.append("&data=").append(data);
|
|
||||||
str.append("&noise=").append(noise);
|
|
||||||
str.append("&key=").append(appKey);
|
|
||||||
str.append("&version=").append(version);
|
|
||||||
String sign = DigestUtils.md5Hex(str.toString().getBytes(Charset.forName("UTF-8"))).toUpperCase();
|
|
||||||
|
|
||||||
Map<String, String> map = new HashMap<>();
|
|
||||||
map.put("appid", appID);
|
|
||||||
map.put("data", data);
|
|
||||||
map.put("noise", noise);
|
|
||||||
map.put("sign", sign);
|
|
||||||
map.put("version", version);
|
|
||||||
|
|
||||||
try {
|
|
||||||
HttpPost httpPost = new HttpPost(url);
|
|
||||||
CloseableHttpClient client = HttpClients.createDefault();
|
|
||||||
String respContent = null;
|
|
||||||
// 请求参数转JOSN字符串
|
|
||||||
StringEntity entity = new StringEntity(new ObjectMapper().writeValueAsString(map), "utf-8");
|
|
||||||
entity.setContentEncoding("UTF-8");
|
|
||||||
entity.setContentType("application/json");
|
|
||||||
httpPost.setEntity(entity);
|
|
||||||
HttpResponse resp = client.execute(httpPost);
|
|
||||||
|
|
||||||
if (resp.getStatusLine().getStatusCode() == 200) {
|
|
||||||
String rev = EntityUtils.toString(resp.getEntity());
|
|
||||||
// System.out.println("返回串--》"+rev);
|
|
||||||
Map resultData = new ObjectMapper().readValue(rev, Map.class);
|
|
||||||
String rdata = resultData.get("data").toString();
|
|
||||||
String rnoise = resultData.get("noise").toString();
|
|
||||||
// 1、拼接返回验签参数
|
|
||||||
StringBuilder str1 = new StringBuilder();
|
|
||||||
str1.append("appid=").append(appID);
|
|
||||||
str1.append("&data=").append(rdata);
|
|
||||||
str1.append("&noise=").append(rnoise);
|
|
||||||
str1.append("&key=").append(appKey);
|
|
||||||
str1.append("&version=").append(version);
|
|
||||||
// 3.MD5加密 生成sign
|
|
||||||
String rmd5 = DigestUtils.md5Hex(str1.toString().getBytes(Charset.forName("UTF-8"))).toUpperCase();
|
|
||||||
String rsign = resultData.get("sign").toString();
|
|
||||||
System.out.println("验签-》" + (StringUtils.equals(rsign, rmd5)));
|
|
||||||
String busData
|
|
||||||
= new String(Base64.getDecoder().decode(resultData.get("data").toString()), StandardCharsets.UTF_8);
|
|
||||||
System.out.println("返回业务数据--》" + busData);
|
|
||||||
Map busDataMap = new ObjectMapper().readValue(busData, Map.class);
|
|
||||||
System.out
|
|
||||||
.println("业务信息解密--》" + new String(Base64.getDecoder().decode(busDataMap.get("message").toString()),
|
|
||||||
StandardCharsets.UTF_8));
|
|
||||||
|
|
||||||
JSONObject resobj = JSONObject.parseObject(busData);
|
|
||||||
result.put("success", true);
|
|
||||||
result.put("result", resobj);
|
|
||||||
} else {
|
|
||||||
result.put("msg", "web响应失败!");
|
|
||||||
result.put("success", false);
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
result.put("msg", e.getMessage());
|
|
||||||
result.put("success", false);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -339,6 +374,7 @@ public class EleInvoiceServiceImpl implements IEleInvoiceService {
|
|||||||
|
|
||||||
// --------------------请求业务参数 data--------------------START
|
// --------------------请求业务参数 data--------------------START
|
||||||
JSONObject bill = commomSet(patientInfo, paymentInfo, clinicSettle);
|
JSONObject bill = commomSet(patientInfo, paymentInfo, clinicSettle);
|
||||||
|
bill.put("paymentId", paymentId);
|
||||||
|
|
||||||
// ------票据信息------
|
// ------票据信息------
|
||||||
// busType 业务标识 String 20 是 06,标识挂号
|
// busType 业务标识 String 20 是 06,标识挂号
|
||||||
@@ -580,6 +616,7 @@ public class EleInvoiceServiceImpl implements IEleInvoiceService {
|
|||||||
|
|
||||||
// --------------------请求业务参数 data--------------------START
|
// --------------------请求业务参数 data--------------------START
|
||||||
JSONObject bill = commomSet(patientInfo, paymentInfo, clinicSettle);
|
JSONObject bill = commomSet(patientInfo, paymentInfo, clinicSettle);
|
||||||
|
bill.put("paymentId", paymentId);
|
||||||
|
|
||||||
// ------票据信息------
|
// ------票据信息------
|
||||||
// busType 业务标识 String 20 是 直接填写业务系统内部编码值,由医疗平台配置对照,例如:附录5 业务标识列表
|
// busType 业务标识 String 20 是 直接填写业务系统内部编码值,由医疗平台配置对照,例如:附录5 业务标识列表
|
||||||
@@ -890,6 +927,7 @@ public class EleInvoiceServiceImpl implements IEleInvoiceService {
|
|||||||
|
|
||||||
// --------------------请求业务参数 data--------------------START
|
// --------------------请求业务参数 data--------------------START
|
||||||
JSONObject bill = commomSet(patientInfo, paymentInfo, clinicSettle);
|
JSONObject bill = commomSet(patientInfo, paymentInfo, clinicSettle);
|
||||||
|
bill.put("paymentId", paymentId);
|
||||||
|
|
||||||
// ------票据信息------
|
// ------票据信息------
|
||||||
// busType 业务标识 String 20 是 直接填写业务系统内部编码值,由医疗平台配置对照,例如:附录5 业务标识列表
|
// busType 业务标识 String 20 是 直接填写业务系统内部编码值,由医疗平台配置对照,例如:附录5 业务标识列表
|
||||||
|
|||||||
@@ -1818,6 +1818,10 @@ public class PaymentRecServiceImpl implements IPaymentRecService {
|
|||||||
// 保存就诊信息
|
// 保存就诊信息
|
||||||
Encounter encounter = new Encounter();
|
Encounter encounter = new Encounter();
|
||||||
BeanUtils.copyProperties(encounterFormData, encounter);
|
BeanUtils.copyProperties(encounterFormData, encounter);
|
||||||
|
// 将挂号医生ID提前塞入 encounter 的 registrarId,便于生成“科室+医生+当日”序号
|
||||||
|
if (encounterParticipantFormData.getPractitionerId() != null) {
|
||||||
|
encounter.setRegistrarId(encounterParticipantFormData.getPractitionerId());
|
||||||
|
}
|
||||||
encounter.setBusNo(outpatientRegistrationSettleParam.getBusNo());
|
encounter.setBusNo(outpatientRegistrationSettleParam.getBusNo());
|
||||||
// 就诊ID
|
// 就诊ID
|
||||||
Long encounterId = iEncounterService.saveEncounterByRegister(encounter);
|
Long encounterId = iEncounterService.saveEncounterByRegister(encounter);
|
||||||
|
|||||||
@@ -41,22 +41,23 @@ public class EleInvoiceController {
|
|||||||
public R<?> invoiceReissue(@RequestBody MakeInvoiceDto makeInvoiceDto) {
|
public R<?> invoiceReissue(@RequestBody MakeInvoiceDto makeInvoiceDto) {
|
||||||
// 付款成功后,开具发票
|
// 付款成功后,开具发票
|
||||||
R<?> result = eleInvoiceService.invoiceReissue(makeInvoiceDto.getPaymentId(), makeInvoiceDto.getEncounterId());
|
R<?> result = eleInvoiceService.invoiceReissue(makeInvoiceDto.getPaymentId(), makeInvoiceDto.getEncounterId());
|
||||||
|
R<?> eleResult = null;
|
||||||
if (result.getCode() == 200) {
|
if (result.getCode() == 200) {
|
||||||
if (result.getData() == YbEncounterClass.REG.getValue()) {
|
if (result.getData() == YbEncounterClass.REG.getValue()) {
|
||||||
// 付款成功后,开具发票
|
// 付款成功后,开具发票
|
||||||
R<?> eleResult = eleInvoiceService.invoiceRegMake(makeInvoiceDto.getPaymentId(), makeInvoiceDto.getEncounterId());
|
eleResult = eleInvoiceService.invoiceRegMake(makeInvoiceDto.getPaymentId(), makeInvoiceDto.getEncounterId());
|
||||||
if (eleResult.getCode() != 200) {
|
if (eleResult.getCode() != 200) {
|
||||||
return R.ok(" 挂号电子发票开具失败 :" + eleResult.getMsg());
|
return R.ok(" 挂号电子发票开具失败 :" + eleResult.getMsg());
|
||||||
}
|
}
|
||||||
} else if (result.getData() == YbEncounterClass.AMB.getValue()) {
|
} else if (result.getData() == YbEncounterClass.AMB.getValue()) {
|
||||||
// 付款成功后,开具发票
|
// 付款成功后,开具发票
|
||||||
R<?> eleResult = eleInvoiceService.invoiceMZMake(makeInvoiceDto.getPaymentId(), makeInvoiceDto.getEncounterId());
|
eleResult = eleInvoiceService.invoiceMZMake(makeInvoiceDto.getPaymentId(), makeInvoiceDto.getEncounterId());
|
||||||
if (eleResult.getCode() != 200) {
|
if (eleResult.getCode() != 200) {
|
||||||
return R.ok(" 门诊电子发票开具失败 :" + eleResult.getMsg());
|
return R.ok(" 门诊电子发票开具失败 :" + eleResult.getMsg());
|
||||||
}
|
}
|
||||||
} else if (result.getData() == YbEncounterClass.IMP.getValue()) {
|
} else if (result.getData() == YbEncounterClass.IMP.getValue()) {
|
||||||
// 付款成功后,开具发票
|
// 付款成功后,开具发票
|
||||||
R<?> eleResult = eleInvoiceService.invoiceZYMake(makeInvoiceDto.getPaymentId(), makeInvoiceDto.getEncounterId());
|
eleResult = eleInvoiceService.invoiceZYMake(makeInvoiceDto.getPaymentId(), makeInvoiceDto.getEncounterId());
|
||||||
if (eleResult.getCode() != 200) {
|
if (eleResult.getCode() != 200) {
|
||||||
return R.ok(" 住院电子发票开具失败 :" + eleResult.getMsg());
|
return R.ok(" 住院电子发票开具失败 :" + eleResult.getMsg());
|
||||||
}
|
}
|
||||||
@@ -64,7 +65,11 @@ public class EleInvoiceController {
|
|||||||
return R.ok("电子发票类型不明确!");
|
return R.ok("电子发票类型不明确!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Map detail = iChargeBillService.getDetail(makeInvoiceDto.getPaymentId());
|
Map<String, Object> detail = iChargeBillService.getDetail(makeInvoiceDto.getPaymentId());
|
||||||
|
if (eleResult != null && eleResult.getCode() == 200 && eleResult.getData() instanceof Invoice) {
|
||||||
|
Invoice invoice = (Invoice) eleResult.getData();
|
||||||
|
detail.put("pictureUrl", invoice.getPictureUrl());
|
||||||
|
}
|
||||||
return R.ok(detail);
|
return R.ok(detail);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,10 +100,18 @@ public class EleInvoiceController {
|
|||||||
public R<?> invoiceOpen(@RequestParam("invoiceId") String invoiceId) {
|
public R<?> invoiceOpen(@RequestParam("invoiceId") String invoiceId) {
|
||||||
// 退款成功后,开具发票
|
// 退款成功后,开具发票
|
||||||
Invoice invoice = eleInvoiceService.getInvoiceById(Long.parseLong(invoiceId));
|
Invoice invoice = eleInvoiceService.getInvoiceById(Long.parseLong(invoiceId));
|
||||||
if(invoice ==null){
|
if (invoice == null) {
|
||||||
throw new ServiceException("未查询到发票信息");
|
throw new ServiceException("未查询到发票信息");
|
||||||
}
|
}
|
||||||
return R.ok(invoice.getPictureUrl());
|
return R.ok(invoice.getPictureUrl());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取发票HTML凭条预览
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "/view", produces = "text/html;charset=UTF-8")
|
||||||
|
@ResponseBody
|
||||||
|
public String viewInvoice(@RequestParam("busNo") String busNo) {
|
||||||
|
return eleInvoiceService.getInvoiceHtml(busNo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ package com.openhis.web.paymentmanage.controller;
|
|||||||
import com.core.common.core.domain.R;
|
import com.core.common.core.domain.R;
|
||||||
import com.core.common.enums.TenantOptionDict;
|
import com.core.common.enums.TenantOptionDict;
|
||||||
import com.core.web.util.TenantOptionUtil;
|
import com.core.web.util.TenantOptionUtil;
|
||||||
|
import com.openhis.administration.domain.Invoice;
|
||||||
import com.openhis.financial.domain.PaymentReconciliation;
|
import com.openhis.financial.domain.PaymentReconciliation;
|
||||||
import com.openhis.web.chargemanage.dto.OutpatientRegistrationAddParam;
|
import com.openhis.web.chargemanage.dto.OutpatientRegistrationAddParam;
|
||||||
import com.openhis.web.chargemanage.dto.OutpatientRegistrationSettleParam;
|
import com.openhis.web.chargemanage.dto.OutpatientRegistrationSettleParam;
|
||||||
@@ -92,10 +93,12 @@ public class PaymentReconciliationController {
|
|||||||
if (eleResult.getCode() != 200) {
|
if (eleResult.getCode() != 200) {
|
||||||
// 因收费成功前端需要关闭弹窗,此处信息仅用于提示所以返回ok
|
// 因收费成功前端需要关闭弹窗,此处信息仅用于提示所以返回ok
|
||||||
return R.ok(detail, " 收费成功,电子发票开具失败 :" + eleResult.getMsg());
|
return R.ok(detail, " 收费成功,电子发票开具失败 :" + eleResult.getMsg());
|
||||||
|
} else if (eleResult.getData() instanceof Invoice) {
|
||||||
|
Invoice invoice = (Invoice) eleResult.getData();
|
||||||
|
detail.put("pictureUrl", invoice.getPictureUrl());
|
||||||
}
|
}
|
||||||
|
return R.ok(detail);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Map detail = iChargeBillService.getDetail(paymentRecon.getId());
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -194,7 +197,11 @@ public class PaymentReconciliationController {
|
|||||||
if (eleResult.getCode() != 200) {
|
if (eleResult.getCode() != 200) {
|
||||||
// 因收费成功前端需要关闭弹窗,此处信息仅用于提示所以返回ok
|
// 因收费成功前端需要关闭弹窗,此处信息仅用于提示所以返回ok
|
||||||
return R.ok(detail, " 收费成功,电子发票开具失败 :" + eleResult.getMsg());
|
return R.ok(detail, " 收费成功,电子发票开具失败 :" + eleResult.getMsg());
|
||||||
|
} else if (eleResult.getData() instanceof Invoice) {
|
||||||
|
Invoice invoice = (Invoice) eleResult.getData();
|
||||||
|
detail.put("pictureUrl", invoice.getPictureUrl());
|
||||||
}
|
}
|
||||||
|
return R.ok(detail);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
@@ -233,6 +240,9 @@ public class PaymentReconciliationController {
|
|||||||
if (eleResult.getCode() != 200) {
|
if (eleResult.getCode() != 200) {
|
||||||
// 因收费成功前端需要关闭弹窗,此处信息仅用于提示所以返回ok
|
// 因收费成功前端需要关闭弹窗,此处信息仅用于提示所以返回ok
|
||||||
return R.ok(detail, " 收费成功,电子发票开具失败 :" + eleResult.getMsg());
|
return R.ok(detail, " 收费成功,电子发票开具失败 :" + eleResult.getMsg());
|
||||||
|
} else if (eleResult.getData() instanceof Invoice) {
|
||||||
|
Invoice invoice = (Invoice) eleResult.getData();
|
||||||
|
detail.put("pictureUrl", invoice.getPictureUrl());
|
||||||
}
|
}
|
||||||
return R.ok(detail);
|
return R.ok(detail);
|
||||||
}
|
}
|
||||||
@@ -260,8 +270,9 @@ public class PaymentReconciliationController {
|
|||||||
// 因取消付款成功前端需要关闭弹窗,此处信息仅用于提示所以返回ok
|
// 因取消付款成功前端需要关闭弹窗,此处信息仅用于提示所以返回ok
|
||||||
return R.ok(null, " 取消付款成功,电子发票开具失败 :" + eleResult.getMsg());
|
return R.ok(null, " 取消付款成功,电子发票开具失败 :" + eleResult.getMsg());
|
||||||
}
|
}
|
||||||
|
return R.ok("取消结算成功");
|
||||||
}
|
}
|
||||||
return R.ok("取消结算失败,请确认");
|
return R.fail("取消结算失败,请确认");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package com.openhis.web.reportmanage.dto;
|
package com.openhis.web.reportmanage.dto;
|
||||||
|
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Getter;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.Setter;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@@ -13,8 +13,8 @@ import java.util.Date;
|
|||||||
* @author yuxj
|
* @author yuxj
|
||||||
* @date 2025/8/25
|
* @date 2025/8/25
|
||||||
*/
|
*/
|
||||||
@Data
|
@Getter
|
||||||
@Accessors(chain = true)
|
@Setter
|
||||||
public class InpatientMedicalRecordHomePageCollectionDto {
|
public class InpatientMedicalRecordHomePageCollectionDto {
|
||||||
|
|
||||||
// 组织机构代码 字符 30 必填
|
// 组织机构代码 字符 30 必填
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ spring:
|
|||||||
druid:
|
druid:
|
||||||
# 主库数据源
|
# 主库数据源
|
||||||
master:
|
master:
|
||||||
url: jdbc:postgresql://47.116.196.11:15432/postgresql?currentSchema=hisdev&characterEncoding=UTF-8&client_encoding=UTF-8
|
url: jdbc:postgresql://192.168.110.252:15432/postgresql?currentSchema=hisdev&characterEncoding=UTF-8&client_encoding=UTF-8
|
||||||
username: postgresql
|
username: postgresql
|
||||||
password: Jchl1528
|
password: Jchl1528
|
||||||
# 从库数据源
|
# 从库数据源
|
||||||
@@ -64,9 +64,9 @@ spring:
|
|||||||
# redis 配置
|
# redis 配置
|
||||||
redis:
|
redis:
|
||||||
# 地址
|
# 地址
|
||||||
host: 47.116.196.11
|
host: 192.168.110.252
|
||||||
# 端口,默认为6379
|
# 端口,默认为6379
|
||||||
port: 26379
|
port: 6379
|
||||||
# 数据库索引
|
# 数据库索引
|
||||||
database: 1
|
database: 1
|
||||||
# 密码
|
# 密码
|
||||||
|
|||||||
@@ -15,6 +15,9 @@ core:
|
|||||||
|
|
||||||
# 开发环境配置
|
# 开发环境配置
|
||||||
server:
|
server:
|
||||||
|
# 应用上下文路径
|
||||||
|
servlet:
|
||||||
|
context-path: /openhis
|
||||||
tomcat:
|
tomcat:
|
||||||
# tomcat的URI编码
|
# tomcat的URI编码
|
||||||
uri-encoding: UTF-8
|
uri-encoding: UTF-8
|
||||||
|
|||||||
@@ -0,0 +1,55 @@
|
|||||||
|
#\u9519\u8BEF\u6D88\u606F
|
||||||
|
not.null=* \u5FC5\u987B\u586B\u5199
|
||||||
|
user.jcaptcha.error=\u9A8C\u8BC1\u7801\u9519\u8BEF
|
||||||
|
user.jcaptcha.expire=\u9A8C\u8BC1\u7801\u5DF2\u5931\u6548
|
||||||
|
user.not.exists=\u7528\u6237\u4E0D\u5B58\u5728/\u5BC6\u7801\u9519\u8BEF
|
||||||
|
user.password.not.match=\u7528\u6237\u4E0D\u5B58\u5728/\u5BC6\u7801\u9519\u8BEF
|
||||||
|
user.password.retry.limit.count=\u5BC6\u7801\u8F93\u5165\u9519\u8BEF{0}\u6B21
|
||||||
|
user.password.retry.limit.exceed=\u5BC6\u7801\u8F93\u5165\u9519\u8BEF{0}\u6B21\uFF0C\u5E10\u6237\u9501\u5B9A{1}\u5206\u949F
|
||||||
|
user.password.delete=\u5BF9\u4E0D\u8D77\uFF0C\u60A8\u7684\u8D26\u53F7\u5DF2\u88AB\u5220\u9664
|
||||||
|
user.blocked=\u7528\u6237\u5DF2\u5C01\u7981\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458
|
||||||
|
role.blocked=\u89D2\u8272\u5DF2\u5C01\u7981\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458
|
||||||
|
login.blocked=\u5F88\u9057\u61BE\uFF0C\u8BBF\u95EEIP\u5DF2\u88AB\u5217\u5165\u7CFB\u7EDF\u9ED1\u540D\u5355
|
||||||
|
user.logout.success=\u9000\u51FA\u6210\u529F
|
||||||
|
length.not.valid=\u957F\u5EA6\u5FC5\u987B\u5728{min}\u5230{max}\u4E2A\u5B57\u7B26\u4E4B\u95F4
|
||||||
|
user.username.not.valid=* 2\u523020\u4E2A\u6C49\u5B57\u3001\u5B57\u6BCD\u3001\u6570\u5B57\u6216\u4E0B\u5212\u7EBF\u7EC4\u6210\uFF0C\u4E14\u5FC5\u987B\u4EE5\u975E\u6570\u5B57\u5F00\u5934
|
||||||
|
user.password.not.valid=* 5-50\u4E2A\u5B57\u7B26
|
||||||
|
user.email.not.valid=\u90AE\u7BB1\u683C\u5F0F\u9519\u8BEF
|
||||||
|
user.mobile.phone.number.not.valid=\u624B\u673A\u53F7\u683C\u5F0F\u9519\u8BEF
|
||||||
|
user.login.success=\u767B\u5F55\u6210\u529F
|
||||||
|
user.register.success=\u6CE8\u518C\u6210\u529F
|
||||||
|
user.notfound=\u8BF7\u91CD\u65B0\u767B\u5F55
|
||||||
|
user.forcelogout=\u7BA1\u7406\u5458\u5F3A\u5236\u9000\u51FA\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55
|
||||||
|
user.unknown.error=\u672A\u77E5\u9519\u8BEF\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55
|
||||||
|
##\u6587\u4EF6\u4E0A\u4F20\u6D88\u606F
|
||||||
|
upload.exceed.maxSize=\u4E0A\u4F20\u7684\u6587\u4EF6\u5927\u5C0F\u8D85\u51FA\u9650\u5236\u7684\u6587\u4EF6\u5927\u5C0F\uFF01<br/>\u5141\u8BB8\u7684\u6587\u4EF6\u6700\u5927\u5927\u5C0F\u662F\uFF1A{0}MB\uFF01
|
||||||
|
upload.filename.exceed.length=\u4E0A\u4F20\u7684\u6587\u4EF6\u540D\u6700\u957F{0}\u4E2A\u5B57\u7B26
|
||||||
|
##\u6743\u9650
|
||||||
|
no.permission=\u60A8\u6CA1\u6709\u6570\u636E\u7684\u6743\u9650\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u6DFB\u52A0\u6743\u9650 [{0}]
|
||||||
|
no.create.permission=\u60A8\u6CA1\u6709\u521B\u5EFA\u6570\u636E\u7684\u6743\u9650\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u6DFB\u52A0\u6743\u9650 [{0}]
|
||||||
|
no.update.permission=\u60A8\u6CA1\u6709\u4FEE\u6539\u6570\u636E\u7684\u6743\u9650\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u6DFB\u52A0\u6743\u9650 [{0}]
|
||||||
|
no.delete.permission=\u60A8\u6CA1\u6709\u5220\u9664\u6570\u636E\u7684\u6743\u9650\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u6DFB\u52A0\u6743\u9650 [{0}]
|
||||||
|
no.export.permission=\u60A8\u6CA1\u6709\u5BFC\u51FA\u6570\u636E\u7684\u6743\u9650\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u6DFB\u52A0\u6743\u9650 [{0}]
|
||||||
|
no.view.permission=\u60A8\u6CA1\u6709\u67E5\u770B\u6570\u636E\u7684\u6743\u9650\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u6DFB\u52A0\u6743\u9650 [{0}]
|
||||||
|
apl.common.M00001={0}\u6DFB\u52A0\u6210\u529F
|
||||||
|
apl.common.M00002={0}\u4FDD\u5B58\u6210\u529F
|
||||||
|
apl.common.M00003={0}\u5DF2\u7ECF\u5B58\u5728
|
||||||
|
apl.common.M00004={0}\u64CD\u4F5C\u6210\u529F
|
||||||
|
apl.common.M00005={0}\u5220\u9664\u6210\u529F
|
||||||
|
apl.common.M00006=\u64CD\u4F5C\u5931\u8D25,\u8BE5\u6570\u636E\u5DF2\u88AB\u4ED6\u4EBA\u5220\u9664,\u8BF7\u5237\u65B0\u540E\u91CD\u8BD5
|
||||||
|
apl.common.M00007=\u64CD\u4F5C\u5931\u8D25,\u8BE5\u6570\u636E\u5DF2\u88AB\u4ED6\u4EBA\u66F4\u6539,\u8BF7\u5237\u65B0\u540E\u91CD\u8BD5
|
||||||
|
apl.common.M00008=\u8BF7\u52FF\u91CD\u590D\u63D0\u4EA4
|
||||||
|
apl.common.M00009=\u67E5\u8BE2\u6210\u529F
|
||||||
|
apl.common.M00010=\u64CD\u4F5C\u5931\u8D25,\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458
|
||||||
|
apl.chargeRefund.M00001=\u8BE5\u6536\u8D39\u5355\u76F8\u5173{0}\u5DF2\u7ECF\u53D1\u51FA\uFF0C\u8BF7\u5148\u9000\u836F\u540E\u518D\u8FDB\u884C\u9000\u8D39
|
||||||
|
apl.payment.M00001=\u5404\u7F34\u8D39\u6E20\u9053\u5B9E\u6536\u91D1\u989D\u5408\u8BA1\u4E0D\u7B49\u4E8E\u5B9E\u6536\u91D1\u989D
|
||||||
|
apl.payment.M00002=\u5B9E\u6536\u91D1\u989D\u5408\u8BA1\u4E0D\u7B49\u4E8E\u5E94\u6536\u91D1\u989D
|
||||||
|
apl.payment.M00003=\u8BF7\u9009\u62E9\u652F\u4ED8\u65B9\u5F0F
|
||||||
|
apl.payment.M00004=\u67E5\u8BE2\u6210\u529F
|
||||||
|
apl.payment.M00005=\u64CD\u4F5C\u5931\u8D25,\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458
|
||||||
|
apl.payment.M00006=\u6210\u529F\u6536\u8D39
|
||||||
|
apl.payment.M00007=\u672A\u67E5\u8BE2\u5230\u6536\u8D39\u9879\u76EE
|
||||||
|
apl.payment.M00008=\u672A\u67E5\u8BE2\u5230{0}\u8D26\u6237\u4FE1\u606F
|
||||||
|
apl.payment.M00009=\u672A\u67E5\u8BE2\u5230\u6536\u8D39\u9879\u76EE\uFF0C\u4E0D\u9700\u8981\u8F6C\u6362\u8D26\u6237
|
||||||
|
apl.adjustPrice.M00001=\u6267\u884C\u5931\u8D25\uFF0C\u672A\u52A0\u8F7D\u5230\u4EFB\u4F55\u6570\u636E\uFF01
|
||||||
|
apl.adjustPrice.M00002=\u6267\u884C\u5931\u8D25\uFF0C\u6539\u4EF7\u5355\u4E2D\u6709\u6B63\u5728\u5BA1\u6838\u4E2D\u7684\u8D27\u54C1\uFF0C\u8BF7\u68C0\u67E5\u540E\u91CD\u65B0\u63D0\u4EA4\uFF01
|
||||||
@@ -44,31 +44,34 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getCurrentDayEncounter" resultType="com.openhis.web.chargemanage.dto.CurrentDayEncounterDto">
|
<select id="getCurrentDayEncounter" resultType="com.openhis.web.chargemanage.dto.CurrentDayEncounterDto">
|
||||||
SELECT T9.tenant_id,
|
SELECT T9.tenant_id AS tenantId,
|
||||||
T9.encounter_id,
|
T9.encounter_id AS encounterId,
|
||||||
T9.organization_id,
|
T9.display_order AS displayOrder,
|
||||||
T9.organization_name,
|
T9.organization_id AS organizationId,
|
||||||
T9.healthcare_name,
|
T9.organization_name AS organizationName,
|
||||||
T9.practitioner_user_id,
|
T9.healthcare_name AS healthcareName,
|
||||||
T9.practitioner_name,
|
T9.practitioner_user_id AS practitionerUserId,
|
||||||
T9.contract_name,
|
T9.practitioner_name AS practitionerName,
|
||||||
T9.patient_id,
|
T9.contract_name AS contractName,
|
||||||
T9.patient_name,
|
T9.patient_id AS patientId,
|
||||||
|
T9.patient_name AS patientName,
|
||||||
T9.phone,
|
T9.phone,
|
||||||
T9.gender_enum,
|
T9.gender_enum AS genderEnum,
|
||||||
T9.id_card,
|
T9.id_card AS idCard,
|
||||||
T9.status_enum,
|
T9.status_enum AS statusEnum,
|
||||||
T9.register_time,
|
T9.register_time AS registerTime,
|
||||||
T9.total_price,
|
T9.total_price AS totalPrice,
|
||||||
T9.account_name,
|
T9.account_name AS accountName,
|
||||||
T9.enterer_name,
|
T9.enterer_name AS entererName,
|
||||||
T9.charge_item_ids,
|
T9.charge_item_ids AS chargeItemIds,
|
||||||
T9.payment_id,
|
T9.payment_id AS paymentId,
|
||||||
T9.picture_url,
|
T9.picture_url AS pictureUrl,
|
||||||
T9.birth_date
|
T9.birth_date AS birthDate,
|
||||||
|
COALESCE(T9.identifier_no, T9.patient_bus_no, '') AS identifierNo
|
||||||
from (
|
from (
|
||||||
SELECT T1.tenant_id AS tenant_id,
|
SELECT T1.tenant_id AS tenant_id,
|
||||||
T1.id AS encounter_id,
|
T1.id AS encounter_id,
|
||||||
|
T1.display_order AS display_order,
|
||||||
T1.organization_id AS organization_id,
|
T1.organization_id AS organization_id,
|
||||||
T2.NAME AS organization_name,
|
T2.NAME AS organization_name,
|
||||||
T3.NAME AS healthcare_name,
|
T3.NAME AS healthcare_name,
|
||||||
@@ -88,7 +91,9 @@
|
|||||||
T13.charge_item_ids,
|
T13.charge_item_ids,
|
||||||
T13.id AS payment_id,
|
T13.id AS payment_id,
|
||||||
ai.picture_url AS picture_url,
|
ai.picture_url AS picture_url,
|
||||||
T8.birth_date AS birth_date
|
T8.birth_date AS birth_date,
|
||||||
|
T8.bus_no AS patient_bus_no,
|
||||||
|
T18.identifier_no AS identifier_no
|
||||||
FROM adm_encounter AS T1
|
FROM adm_encounter AS T1
|
||||||
LEFT JOIN adm_organization AS T2 ON T1.organization_id = T2.ID AND T2.delete_flag = '0'
|
LEFT JOIN adm_organization AS T2 ON T1.organization_id = T2.ID AND T2.delete_flag = '0'
|
||||||
LEFT JOIN adm_healthcare_service AS T3 ON T1.service_type_id = T3.ID AND T3.delete_flag = '0'
|
LEFT JOIN adm_healthcare_service AS T3 ON T1.service_type_id = T3.ID AND T3.delete_flag = '0'
|
||||||
@@ -118,6 +123,20 @@
|
|||||||
ON T1.ID = T6.encounter_id AND T6.delete_flag = '0' AND T6.encounter_flag = '1'
|
ON T1.ID = T6.encounter_id AND T6.delete_flag = '0' AND T6.encounter_flag = '1'
|
||||||
LEFT JOIN fin_contract AS T7 ON T6.contract_no = T7.bus_no AND T7.delete_flag = '0'
|
LEFT JOIN fin_contract AS T7 ON T6.contract_no = T7.bus_no AND T7.delete_flag = '0'
|
||||||
LEFT JOIN adm_patient AS T8 ON T1.patient_id = T8.ID AND T8.delete_flag = '0'
|
LEFT JOIN adm_patient AS T8 ON T1.patient_id = T8.ID AND T8.delete_flag = '0'
|
||||||
|
LEFT JOIN (
|
||||||
|
SELECT patient_id,
|
||||||
|
identifier_no
|
||||||
|
FROM (
|
||||||
|
SELECT patient_id,
|
||||||
|
identifier_no,
|
||||||
|
ROW_NUMBER() OVER (PARTITION BY patient_id ORDER BY create_time ASC) AS rn
|
||||||
|
FROM adm_patient_identifier
|
||||||
|
WHERE delete_flag = '0'
|
||||||
|
AND identifier_no IS NOT NULL
|
||||||
|
AND identifier_no != ''
|
||||||
|
) t
|
||||||
|
WHERE rn = 1
|
||||||
|
) AS T18 ON T8.id = T18.patient_id
|
||||||
LEFT JOIN adm_charge_item AS T10 ON T1.id = T10.encounter_id AND T10.delete_flag = '0'
|
LEFT JOIN adm_charge_item AS T10 ON T1.id = T10.encounter_id AND T10.delete_flag = '0'
|
||||||
LEFT JOIN adm_account AS T11 ON T10.account_id = T11.id AND T11.delete_flag = '0'
|
LEFT JOIN adm_account AS T11 ON T10.account_id = T11.id AND T11.delete_flag = '0'
|
||||||
LEFT JOIN adm_practitioner AS T12 ON T12.ID = T10.enterer_id AND T12.delete_flag = '0'
|
LEFT JOIN adm_practitioner AS T12 ON T12.ID = T10.enterer_id AND T12.delete_flag = '0'
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<result property="operatingRoomName" column="operating_room_name" />
|
<result property="operatingRoomName" column="operating_room_name" />
|
||||||
<result property="orgId" column="org_id" />
|
<result property="orgId" column="org_id" />
|
||||||
<result property="orgName" column="org_name" />
|
<result property="orgName" column="org_name" />
|
||||||
|
<result property="surgeryIndication" column="surgery_indication" />
|
||||||
<result property="preoperativeDiagnosis" column="preoperative_diagnosis" />
|
<result property="preoperativeDiagnosis" column="preoperative_diagnosis" />
|
||||||
<result property="postoperativeDiagnosis" column="postoperative_diagnosis" />
|
<result property="postoperativeDiagnosis" column="postoperative_diagnosis" />
|
||||||
<result property="surgeryDescription" column="surgery_description" />
|
<result property="surgeryDescription" column="surgery_description" />
|
||||||
@@ -50,6 +51,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<result property="updateBy" column="update_by" />
|
<result property="updateBy" column="update_by" />
|
||||||
<result property="updateTime" column="update_time" />
|
<result property="updateTime" column="update_time" />
|
||||||
<result property="deleteFlag" column="delete_flag" />
|
<result property="deleteFlag" column="delete_flag" />
|
||||||
|
<result property="emergencyFlag" column="emergency_flag" />
|
||||||
|
<result property="implantFlag" column="implant_flag" />
|
||||||
|
<result property="operatingRoomConfirmTime" column="operating_room_confirm_time" />
|
||||||
|
<result property="operatingRoomConfirmUser" column="operating_room_confirm_user" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectSurgeryVo">
|
<sql id="selectSurgeryVo">
|
||||||
@@ -59,9 +64,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
main_surgeon_id, main_surgeon_name, assistant_1_id, assistant_1_name, assistant_2_id, assistant_2_name,
|
main_surgeon_id, main_surgeon_name, assistant_1_id, assistant_1_name, assistant_2_id, assistant_2_name,
|
||||||
anesthetist_id, anesthetist_name, scrub_nurse_id, scrub_nurse_name, anesthesia_type_enum,
|
anesthetist_id, anesthetist_name, scrub_nurse_id, scrub_nurse_name, anesthesia_type_enum,
|
||||||
body_site, incision_level, healing_level, operating_room_id, operating_room_name,
|
body_site, incision_level, healing_level, operating_room_id, operating_room_name,
|
||||||
org_id, org_name, preoperative_diagnosis, postoperative_diagnosis, surgery_description,
|
org_id, org_name, surgery_indication, preoperative_diagnosis, postoperative_diagnosis, surgery_description,
|
||||||
postoperative_advice, complications, surgery_fee, anesthesia_fee, total_fee, remark,
|
postoperative_advice, complications, surgery_fee, anesthesia_fee, total_fee, remark,
|
||||||
create_by, create_time, update_by, update_time, delete_flag
|
create_by, create_time, update_by, update_time, delete_flag,
|
||||||
|
emergency_flag, implant_flag, operating_room_confirm_time, operating_room_confirm_user
|
||||||
FROM cli_surgery
|
FROM cli_surgery
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<result property="patientAge" column="patient_age" />
|
<result property="patientAge" column="patient_age" />
|
||||||
<result property="encounterId" column="encounter_id" />
|
<result property="encounterId" column="encounter_id" />
|
||||||
<result property="encounterNo" column="encounter_no" />
|
<result property="encounterNo" column="encounter_no" />
|
||||||
|
<result property="applyDoctorId" column="apply_doctor_id" />
|
||||||
|
<result property="applyDoctorName" column="apply_doctor_name" />
|
||||||
|
<result property="applyDeptId" column="apply_dept_id" />
|
||||||
|
<result property="applyDeptName" column="apply_dept_name" />
|
||||||
|
<result property="surgeryIndication" column="surgery_indication" />
|
||||||
<result property="surgeryName" column="surgery_name" />
|
<result property="surgeryName" column="surgery_name" />
|
||||||
<result property="surgeryCode" column="surgery_code" />
|
<result property="surgeryCode" column="surgery_code" />
|
||||||
<result property="surgeryTypeEnum" column="surgery_type_enum" />
|
<result property="surgeryTypeEnum" column="surgery_type_enum" />
|
||||||
@@ -43,6 +48,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<result property="healingLevel_dictText" column="healing_level_dictText" />
|
<result property="healingLevel_dictText" column="healing_level_dictText" />
|
||||||
<result property="operatingRoomId" column="operating_room_id" />
|
<result property="operatingRoomId" column="operating_room_id" />
|
||||||
<result property="operatingRoomName" column="operating_room_name" />
|
<result property="operatingRoomName" column="operating_room_name" />
|
||||||
|
<result property="operatingRoomOrgId" column="operating_room_org_id" />
|
||||||
|
<result property="operatingRoomOrgName" column="operating_room_org_name" />
|
||||||
<result property="orgId" column="org_id" />
|
<result property="orgId" column="org_id" />
|
||||||
<result property="orgName" column="org_name" />
|
<result property="orgName" column="org_name" />
|
||||||
<result property="preoperativeDiagnosis" column="preoperative_diagnosis" />
|
<result property="preoperativeDiagnosis" column="preoperative_diagnosis" />
|
||||||
@@ -56,6 +63,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<result property="remark" column="remark" />
|
<result property="remark" column="remark" />
|
||||||
<result property="createTime" column="create_time" />
|
<result property="createTime" column="create_time" />
|
||||||
<result property="updateTime" column="update_time" />
|
<result property="updateTime" column="update_time" />
|
||||||
|
<result property="emergencyFlag" column="emergency_flag" />
|
||||||
|
<result property="implantFlag" column="implant_flag" />
|
||||||
|
<result property="operatingRoomConfirmTime" column="operating_room_confirm_time" />
|
||||||
|
<result property="operatingRoomConfirmUser" column="operating_room_confirm_user" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectSurgeryVo">
|
<sql id="selectSurgeryVo">
|
||||||
@@ -68,38 +79,86 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
EXTRACT(YEAR FROM AGE(p.birth_date)) as patient_age,
|
EXTRACT(YEAR FROM AGE(p.birth_date)) as patient_age,
|
||||||
s.encounter_id,
|
s.encounter_id,
|
||||||
e.bus_no as encounter_no,
|
e.bus_no as encounter_no,
|
||||||
|
s.apply_doctor_id,
|
||||||
|
COALESCE(s.apply_doctor_name, apply_doc.name) as apply_doctor_name,
|
||||||
|
s.apply_dept_id,
|
||||||
|
COALESCE(s.apply_dept_name, apply_dept.name) as apply_dept_name,
|
||||||
s.surgery_name,
|
s.surgery_name,
|
||||||
s.surgery_code,
|
s.surgery_code,
|
||||||
s.surgery_type_enum,
|
s.surgery_type_enum,
|
||||||
s.surgery_type_enum as surgery_type_enum_dictText,
|
CASE s.surgery_type_enum
|
||||||
|
WHEN 1 THEN '门诊手术'
|
||||||
|
WHEN 2 THEN '住院手术'
|
||||||
|
WHEN 3 THEN '急诊手术'
|
||||||
|
WHEN 4 THEN '择期手术'
|
||||||
|
ELSE '未知'
|
||||||
|
END as surgery_type_enum_dictText,
|
||||||
s.surgery_level,
|
s.surgery_level,
|
||||||
s.surgery_level as surgery_level_dictText,
|
CASE s.surgery_level
|
||||||
|
WHEN 1 THEN '一级手术'
|
||||||
|
WHEN 2 THEN '二级手术'
|
||||||
|
WHEN 3 THEN '三级手术'
|
||||||
|
WHEN 4 THEN '四级手术'
|
||||||
|
WHEN 5 THEN '特级手术'
|
||||||
|
ELSE '未知'
|
||||||
|
END as surgery_level_dictText,
|
||||||
s.status_enum,
|
s.status_enum,
|
||||||
s.status_enum as status_enum_dictText,
|
CASE s.status_enum
|
||||||
|
WHEN 0 THEN '待排期'
|
||||||
|
WHEN 1 THEN '已排期'
|
||||||
|
WHEN 2 THEN '手术中'
|
||||||
|
WHEN 3 THEN '已完成'
|
||||||
|
WHEN 4 THEN '已取消'
|
||||||
|
WHEN 5 THEN '暂停'
|
||||||
|
ELSE '未知'
|
||||||
|
END as status_enum_dictText,
|
||||||
s.planned_time,
|
s.planned_time,
|
||||||
s.actual_start_time,
|
s.actual_start_time,
|
||||||
s.actual_end_time,
|
s.actual_end_time,
|
||||||
s.main_surgeon_id,
|
s.main_surgeon_id,
|
||||||
s.main_surgeon_name,
|
COALESCE(s.main_surgeon_name, main_surgeon.name) as main_surgeon_name,
|
||||||
s.assistant_1_id,
|
s.assistant_1_id,
|
||||||
s.assistant_1_name,
|
COALESCE(s.assistant_1_name, assistant1.name) as assistant_1_name,
|
||||||
s.assistant_2_id,
|
s.assistant_2_id,
|
||||||
s.assistant_2_name,
|
COALESCE(s.assistant_2_name, assistant2.name) as assistant_2_name,
|
||||||
s.anesthetist_id,
|
s.anesthetist_id,
|
||||||
s.anesthetist_name,
|
COALESCE(s.anesthetist_name, anesthetist.name) as anesthetist_name,
|
||||||
s.scrub_nurse_id,
|
s.scrub_nurse_id,
|
||||||
s.scrub_nurse_name,
|
COALESCE(s.scrub_nurse_name, scrub_nurse.name) as scrub_nurse_name,
|
||||||
s.anesthesia_type_enum,
|
s.anesthesia_type_enum,
|
||||||
s.anesthesia_type_enum as anesthesia_type_enum_dictText,
|
CASE s.anesthesia_type_enum
|
||||||
|
WHEN 0 THEN '无麻醉'
|
||||||
|
WHEN 1 THEN '局部麻醉'
|
||||||
|
WHEN 2 THEN '区域麻醉'
|
||||||
|
WHEN 3 THEN '全身麻醉'
|
||||||
|
WHEN 4 THEN '脊椎麻醉'
|
||||||
|
WHEN 5 THEN '硬膜外麻醉'
|
||||||
|
WHEN 6 THEN '表面麻醉'
|
||||||
|
ELSE '未知'
|
||||||
|
END as anesthesia_type_enum_dictText,
|
||||||
s.body_site,
|
s.body_site,
|
||||||
s.incision_level,
|
s.incision_level,
|
||||||
s.incision_level as incision_level_dictText,
|
CASE s.incision_level
|
||||||
|
WHEN 1 THEN 'I级切口'
|
||||||
|
WHEN 2 THEN 'II级切口'
|
||||||
|
WHEN 3 THEN 'III级切口'
|
||||||
|
WHEN 4 THEN 'IV级切口'
|
||||||
|
ELSE '未知'
|
||||||
|
END as incision_level_dictText,
|
||||||
s.healing_level,
|
s.healing_level,
|
||||||
s.healing_level as healing_level_dictText,
|
CASE s.healing_level
|
||||||
|
WHEN 1 THEN '甲级愈合'
|
||||||
|
WHEN 2 THEN '乙级愈合'
|
||||||
|
WHEN 3 THEN '丙级愈合'
|
||||||
|
ELSE '未知'
|
||||||
|
END as healing_level_dictText,
|
||||||
s.operating_room_id,
|
s.operating_room_id,
|
||||||
s.operating_room_name,
|
COALESCE(s.operating_room_name, r.name) as operating_room_name,
|
||||||
|
r.organization_id as operating_room_org_id,
|
||||||
|
ro.name as operating_room_org_name,
|
||||||
s.org_id,
|
s.org_id,
|
||||||
o.name as org_name,
|
COALESCE(s.org_name, o.name) as org_name,
|
||||||
|
s.surgery_indication,
|
||||||
s.preoperative_diagnosis,
|
s.preoperative_diagnosis,
|
||||||
s.postoperative_diagnosis,
|
s.postoperative_diagnosis,
|
||||||
s.surgery_description,
|
s.surgery_description,
|
||||||
@@ -110,11 +169,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
s.total_fee,
|
s.total_fee,
|
||||||
s.remark,
|
s.remark,
|
||||||
s.create_time,
|
s.create_time,
|
||||||
s.update_time
|
s.update_time,
|
||||||
|
s.emergency_flag,
|
||||||
|
s.implant_flag,
|
||||||
|
s.operating_room_confirm_time,
|
||||||
|
s.operating_room_confirm_user
|
||||||
FROM cli_surgery s
|
FROM cli_surgery s
|
||||||
LEFT JOIN adm_patient p ON s.patient_id = p.id
|
LEFT JOIN adm_patient p ON s.patient_id = p.id
|
||||||
LEFT JOIN adm_encounter e ON s.encounter_id = e.id
|
LEFT JOIN adm_encounter e ON s.encounter_id = e.id
|
||||||
|
LEFT JOIN adm_operating_room r ON s.operating_room_id = r.id
|
||||||
|
LEFT JOIN adm_organization ro ON r.organization_id = ro.id
|
||||||
LEFT JOIN adm_organization o ON s.org_id = o.id
|
LEFT JOIN adm_organization o ON s.org_id = o.id
|
||||||
|
LEFT JOIN adm_practitioner main_surgeon ON s.main_surgeon_id = main_surgeon.id
|
||||||
|
LEFT JOIN adm_practitioner anesthetist ON s.anesthetist_id = anesthetist.id
|
||||||
|
LEFT JOIN adm_practitioner assistant1 ON s.assistant_1_id = assistant1.id
|
||||||
|
LEFT JOIN adm_practitioner assistant2 ON s.assistant_2_id = assistant2.id
|
||||||
|
LEFT JOIN adm_practitioner scrub_nurse ON s.scrub_nurse_id = scrub_nurse.id
|
||||||
|
LEFT JOIN adm_practitioner apply_doc ON s.apply_doctor_id = apply_doc.id
|
||||||
|
LEFT JOIN adm_organization apply_dept ON s.apply_dept_id = apply_dept.id
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="getSurgeryPage" parameterType="com.baomidou.mybatisplus.core.conditions.query.QueryWrapper" resultMap="SurgeryResult">
|
<select id="getSurgeryPage" parameterType="com.baomidou.mybatisplus.core.conditions.query.QueryWrapper" resultMap="SurgeryResult">
|
||||||
@@ -122,7 +194,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<where>
|
<where>
|
||||||
s.delete_flag = '0'
|
s.delete_flag = '0'
|
||||||
<if test="ew.sqlSegment != null and ew.sqlSegment != ''">
|
<if test="ew.sqlSegment != null and ew.sqlSegment != ''">
|
||||||
AND ${ew.sqlSegment}
|
AND ${ew.sqlSegment.replace('tenant_id', 's.tenant_id').replace('create_time', 's.create_time').replace('surgery_no', 's.surgery_no').replace('surgery_name', 's.surgery_name').replace('patient_name', 'p.name').replace('main_surgeon_name', 's.main_surgeon_name').replace('anesthetist_name', 's.anesthetist_name').replace('org_name', 'o.name')}
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@@ -43,8 +43,11 @@
|
|||||||
abi.restricted_scope,
|
abi.restricted_scope,
|
||||||
abi.dosage_instruction,
|
abi.dosage_instruction,
|
||||||
abi.chrgitm_lv
|
abi.chrgitm_lv
|
||||||
from (
|
FROM (
|
||||||
<if test="adviceTypes == null or adviceTypes.contains(1)">
|
<!-- 确保至少有一个查询被执行以避免语法错误 -->
|
||||||
|
<if test="adviceTypes != null and !adviceTypes.isEmpty() and (adviceTypes.contains(1) or adviceTypes.contains(2) or adviceTypes.contains(3))">
|
||||||
|
<!-- 如果有有效的adviceTypes,则执行对应的查询 -->
|
||||||
|
<if test="adviceTypes.contains(1)">
|
||||||
(SELECT
|
(SELECT
|
||||||
DISTINCT ON (T1.ID)
|
DISTINCT ON (T1.ID)
|
||||||
T1.tenant_id,
|
T1.tenant_id,
|
||||||
@@ -110,14 +113,10 @@
|
|||||||
</if>
|
</if>
|
||||||
AND T5.instance_table = #{medicationTableName}
|
AND T5.instance_table = #{medicationTableName}
|
||||||
)
|
)
|
||||||
|
<if test="adviceTypes.contains(2) or adviceTypes.contains(3)">UNION ALL</if>
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
|
<if test="adviceTypes.contains(2)">
|
||||||
<if test="adviceTypes == null or adviceTypes.contains(1)">
|
|
||||||
<if test="adviceTypes == null or adviceTypes.contains(2) or adviceTypes.contains(3)">UNION ALL</if>
|
|
||||||
</if>
|
|
||||||
|
|
||||||
<if test="adviceTypes == null or adviceTypes.contains(2)">
|
|
||||||
(SELECT
|
(SELECT
|
||||||
DISTINCT ON (T1.ID)
|
DISTINCT ON (T1.ID)
|
||||||
T1.tenant_id,
|
T1.tenant_id,
|
||||||
@@ -177,14 +176,10 @@
|
|||||||
AND T4.instance_table = #{deviceTableName}
|
AND T4.instance_table = #{deviceTableName}
|
||||||
AND T1.status_enum = #{statusEnum}
|
AND T1.status_enum = #{statusEnum}
|
||||||
)
|
)
|
||||||
|
<if test="adviceTypes.contains(3)">UNION ALL</if>
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
|
<if test="adviceTypes.contains(3)">
|
||||||
<if test="adviceTypes == null or adviceTypes.contains(2)">
|
|
||||||
<if test="adviceTypes == null or adviceTypes.contains(3)">UNION ALL</if>
|
|
||||||
</if>
|
|
||||||
|
|
||||||
<if test="adviceTypes == null or adviceTypes.contains(3)">
|
|
||||||
(SELECT
|
(SELECT
|
||||||
DISTINCT ON (T1.ID)
|
DISTINCT ON (T1.ID)
|
||||||
T1.tenant_id,
|
T1.tenant_id,
|
||||||
@@ -229,11 +224,12 @@
|
|||||||
LEFT JOIN adm_charge_item_definition AS T2
|
LEFT JOIN adm_charge_item_definition AS T2
|
||||||
ON T2.instance_id = T1.ID
|
ON T2.instance_id = T1.ID
|
||||||
AND T2.delete_flag = '0' AND T2.status_enum = #{statusEnum}
|
AND T2.delete_flag = '0' AND T2.status_enum = #{statusEnum}
|
||||||
|
AND T2.instance_table = #{activityTableName}
|
||||||
LEFT JOIN adm_organization_location AS T3 ON T3.activity_definition_id = T1.ID
|
LEFT JOIN adm_organization_location AS T3 ON T3.activity_definition_id = T1.ID
|
||||||
AND T3.delete_flag = '0' AND (CURRENT_TIME :: time (6) BETWEEN T3.start_time AND T3.end_time)
|
AND T3.delete_flag = '0' AND (CURRENT_TIME :: time (6) BETWEEN T3.start_time AND T3.end_time)
|
||||||
WHERE T1.delete_flag = '0'
|
WHERE T1.delete_flag = '0'
|
||||||
<if test="pricingFlag ==1">
|
<if test="pricingFlag ==1">
|
||||||
AND T1.pricing_flag = #{pricingFlag}
|
AND (T1.pricing_flag = #{pricingFlag} OR T1.pricing_flag IS NULL)
|
||||||
</if>
|
</if>
|
||||||
<if test="adviceDefinitionIdParamList != null and !adviceDefinitionIdParamList.isEmpty()">
|
<if test="adviceDefinitionIdParamList != null and !adviceDefinitionIdParamList.isEmpty()">
|
||||||
AND T1.id IN
|
AND T1.id IN
|
||||||
@@ -242,9 +238,53 @@
|
|||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
AND T1.status_enum = #{statusEnum}
|
AND T1.status_enum = #{statusEnum}
|
||||||
AND T2.instance_table = #{activityTableName}
|
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
|
</if>
|
||||||
|
<!-- 如果没有有效的adviceTypes,提供一个空的默认查询以避免语法错误 -->
|
||||||
|
<if test="adviceTypes == null or adviceTypes.isEmpty() or (!adviceTypes.contains(1) and !adviceTypes.contains(2) and !adviceTypes.contains(3))">
|
||||||
|
SELECT
|
||||||
|
mmd.tenant_id,
|
||||||
|
CAST(0 AS INTEGER) AS advice_type,
|
||||||
|
CAST('' AS VARCHAR) AS bus_no,
|
||||||
|
CAST('' AS VARCHAR) AS category_code,
|
||||||
|
CAST('' AS VARCHAR) AS pharmacology_category_code,
|
||||||
|
CAST(0 AS NUMERIC) AS part_percent,
|
||||||
|
CAST(0 AS NUMERIC) AS unit_conversion_ratio,
|
||||||
|
CAST(0 AS INTEGER) AS part_attribute_enum,
|
||||||
|
CAST(0 AS INTEGER) AS tho_part_attribute_enum,
|
||||||
|
CAST(0 AS INTEGER) AS skin_test_flag,
|
||||||
|
CAST(0 AS INTEGER) AS inject_flag,
|
||||||
|
CAST(0 AS BIGINT) AS advice_definition_id,
|
||||||
|
CAST('' AS VARCHAR) AS advice_name,
|
||||||
|
CAST('' AS VARCHAR) AS advice_bus_no,
|
||||||
|
CAST('' AS VARCHAR) AS py_str,
|
||||||
|
CAST('' AS VARCHAR) AS wb_str,
|
||||||
|
CAST('' AS VARCHAR) AS yb_no,
|
||||||
|
CAST('' AS VARCHAR) AS product_name,
|
||||||
|
CAST(0 AS INTEGER) AS activity_type,
|
||||||
|
CAST('' AS VARCHAR) AS unit_code,
|
||||||
|
CAST('' AS VARCHAR) AS min_unit_code,
|
||||||
|
CAST(0 AS NUMERIC) AS volume,
|
||||||
|
CAST('' AS VARCHAR) AS method_code,
|
||||||
|
CAST('' AS VARCHAR) AS rate_code,
|
||||||
|
CAST(0 AS BIGINT) AS org_id,
|
||||||
|
CAST(0 AS BIGINT) AS location_id,
|
||||||
|
CAST('' AS VARCHAR) AS dose,
|
||||||
|
CAST('' AS VARCHAR) AS dose_unit_code,
|
||||||
|
CAST('' AS VARCHAR) AS supplier,
|
||||||
|
CAST(0 AS BIGINT) AS supplier_id,
|
||||||
|
CAST('' AS VARCHAR) AS manufacturer,
|
||||||
|
CAST(0 AS BIGINT) AS charge_item_definition_id,
|
||||||
|
CAST('' AS VARCHAR) AS advice_table_name,
|
||||||
|
CAST(0 AS BIGINT) AS position_id,
|
||||||
|
CAST(0 AS INTEGER) AS restricted_flag,
|
||||||
|
CAST('' AS VARCHAR) AS restricted_scope,
|
||||||
|
CAST('' AS VARCHAR) AS dosage_instruction,
|
||||||
|
CAST(0 AS INTEGER) AS chrgitm_lv
|
||||||
|
FROM med_medication_definition mmd
|
||||||
|
WHERE 1 = 0 -- 仍然确保不返回任何行,但使用真实表确保类型正确
|
||||||
|
</if>
|
||||||
) AS abi
|
) AS abi
|
||||||
${ew.customSqlSegment}
|
${ew.customSqlSegment}
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@@ -23,7 +23,8 @@
|
|||||||
T10.reception_time,
|
T10.reception_time,
|
||||||
T10.practitioner_user_id,
|
T10.practitioner_user_id,
|
||||||
T10.jz_practitioner_user_id,
|
T10.jz_practitioner_user_id,
|
||||||
T10.bus_no
|
T10.bus_no,
|
||||||
|
T10.identifier_no
|
||||||
from
|
from
|
||||||
(
|
(
|
||||||
SELECT T1.tenant_id AS tenant_id,
|
SELECT T1.tenant_id AS tenant_id,
|
||||||
@@ -48,7 +49,8 @@
|
|||||||
T1.create_time AS register_time,
|
T1.create_time AS register_time,
|
||||||
T1.reception_time AS reception_time,
|
T1.reception_time AS reception_time,
|
||||||
T1.organization_id AS org_id,
|
T1.organization_id AS org_id,
|
||||||
T8.bus_no AS bus_no
|
T8.bus_no AS bus_no,
|
||||||
|
T9.identifier_no AS identifier_no
|
||||||
FROM adm_encounter AS T1
|
FROM adm_encounter AS T1
|
||||||
LEFT JOIN adm_organization AS T2 ON T1.organization_id = T2.ID AND T2.delete_flag = '0'
|
LEFT JOIN adm_organization AS T2 ON T1.organization_id = T2.ID AND T2.delete_flag = '0'
|
||||||
LEFT JOIN adm_healthcare_service AS T3 ON T1.service_type_id = T3.ID AND T3.delete_flag = '0'
|
LEFT JOIN adm_healthcare_service AS T3 ON T1.service_type_id = T3.ID AND T3.delete_flag = '0'
|
||||||
@@ -67,6 +69,20 @@
|
|||||||
LEFT JOIN adm_account AS T6 ON T1.ID = T6.encounter_id AND T6.delete_flag = '0' and T6.encounter_flag = '1'
|
LEFT JOIN adm_account AS T6 ON T1.ID = T6.encounter_id AND T6.delete_flag = '0' and T6.encounter_flag = '1'
|
||||||
LEFT JOIN fin_contract AS T7 ON T6.contract_no = T7.bus_no AND T7.delete_flag = '0'
|
LEFT JOIN fin_contract AS T7 ON T6.contract_no = T7.bus_no AND T7.delete_flag = '0'
|
||||||
LEFT JOIN adm_patient AS T8 ON T1.patient_id = T8.ID AND T8.delete_flag = '0'
|
LEFT JOIN adm_patient AS T8 ON T1.patient_id = T8.ID AND T8.delete_flag = '0'
|
||||||
|
LEFT JOIN (
|
||||||
|
SELECT patient_id,
|
||||||
|
identifier_no
|
||||||
|
FROM (
|
||||||
|
SELECT patient_id,
|
||||||
|
identifier_no,
|
||||||
|
ROW_NUMBER() OVER (PARTITION BY patient_id ORDER BY create_time ASC) AS rn
|
||||||
|
FROM adm_patient_identifier
|
||||||
|
WHERE delete_flag = '0'
|
||||||
|
AND identifier_no IS NOT NULL
|
||||||
|
AND identifier_no != ''
|
||||||
|
) t
|
||||||
|
WHERE rn = 1
|
||||||
|
) AS T9 ON T8.id = T9.patient_id
|
||||||
WHERE
|
WHERE
|
||||||
T1.delete_flag = '0'
|
T1.delete_flag = '0'
|
||||||
<!-- 当前登录账号ID 和 当前登录账号所属的科室ID 用于控制数据权限 -->
|
<!-- 当前登录账号ID 和 当前登录账号所属的科室ID 用于控制数据权限 -->
|
||||||
|
|||||||
@@ -0,0 +1,68 @@
|
|||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<style>
|
||||||
|
body { font-family: 'Microsoft YaHei', sans-serif; width: 350px; margin: 0 auto; padding: 20px; border: 1px solid #ccc; background: #fff; }
|
||||||
|
.header { text-align: center; }
|
||||||
|
.hospital-name { font-size: 20px; font-weight: bold; margin-bottom: 5px; }
|
||||||
|
.title { font-size: 16px; margin-bottom: 10px; }
|
||||||
|
.time { font-size: 12px; color: #666; margin-bottom: 15px; }
|
||||||
|
.section { border-top: 1px solid #000; padding-top: 10px; margin-top: 10px; }
|
||||||
|
.section-title { font-weight: bold; text-decoration: underline; margin-bottom: 10px; font-size: 14px; }
|
||||||
|
.item { display: flex; font-size: 13px; margin-bottom: 5px; }
|
||||||
|
.label { width: 90px; color: #333; }
|
||||||
|
.value { flex: 1; font-weight: 500; }
|
||||||
|
table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13px; }
|
||||||
|
th { text-align: left; border-bottom: 1px dashed #ccc; padding-bottom: 5px; color: #666; }
|
||||||
|
td { padding: 5px 0; }
|
||||||
|
.total { text-align: right; font-weight: bold; border-top: 1px solid #000; padding-top: 10px; margin-top: 10px; font-size: 15px; }
|
||||||
|
.footer { margin-top: 20px; font-size: 11px; color: #666; line-height: 1.5; }
|
||||||
|
.qr-code { text-align: center; margin-top: 15px; }
|
||||||
|
.serial-no { text-align: left; margin-top: 10px; font-size: 12px; font-weight: bold; border-top: 1px dashed #ccc; padding-top: 10px; }
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class='header'>
|
||||||
|
<div class='hospital-name'>$hospitalName</div>
|
||||||
|
<div class='title'>门诊预约挂号凭条</div>
|
||||||
|
<div class='time'>打印时间:$printTime</div>
|
||||||
|
</div>
|
||||||
|
<div class='section'>
|
||||||
|
<div class='section-title'>患者基本信息</div>
|
||||||
|
<div class='item'><div class='label'>患者姓名:</div><div class='value'>$patientName</div></div>
|
||||||
|
<div class='item'><div class='label'>门诊号:</div><div class='value'>$outpatientNo</div></div>
|
||||||
|
<div class='item'><div class='label'>身份证号:</div><div class='value'>#if($idCard)$idCard#else-#end</div></div>
|
||||||
|
<div class='item'><div class='label'>联系电话:</div><div class='value'>#if($tel)$tel#else-#end</div></div>
|
||||||
|
</div>
|
||||||
|
<div class='section'>
|
||||||
|
<div class='section-title'>预约详情</div>
|
||||||
|
<div class='item'><div class='label'>就诊科室:</div><div class='value'>#if($deptName)$deptName#else-#end</div></div>
|
||||||
|
<div class='item'><div class='label'>医生姓名:</div><div class='value'>$doctorName</div></div>
|
||||||
|
<div class='item'><div class='label'>预约时间:</div><div class='value'>#if($appointmentTime)$appointmentTime#else-#end</div></div>
|
||||||
|
<div class='item'><div class='label'>就诊地点:</div><div class='value'>门诊大楼内</div></div>
|
||||||
|
<div class='item'><div class='label'>预约状态:</div><div class='value'><span style='color:green;'>☑ 已 预</span></div></div>
|
||||||
|
</div>
|
||||||
|
<div class='section'>
|
||||||
|
<div class='section-title'>费用信息</div>
|
||||||
|
<table>
|
||||||
|
<tr><th>项目</th><th>数量</th><th>单价</th><th>金额</th></tr>
|
||||||
|
#foreach($item in $items)
|
||||||
|
<tr>
|
||||||
|
<td>$item.chargeItemName</td>
|
||||||
|
<td>$item.quantityValue</td>
|
||||||
|
<td>¥$item.totalPrice</td>
|
||||||
|
<td>¥$item.totalPrice</td>
|
||||||
|
</tr>
|
||||||
|
#end
|
||||||
|
</table>
|
||||||
|
<div class='total'>合计:¥$totalAmt</div>
|
||||||
|
<div class='item' style='margin-top:10px;'><div class='label'>支付方式:</div><div class='value'>线上支付 (已支付)</div></div>
|
||||||
|
</div>
|
||||||
|
<div class='footer'>
|
||||||
|
温馨提示:请至少提前30分钟到达取号,过时自动取消。服务时间:8:00-17:00
|
||||||
|
</div>
|
||||||
|
<div class='qr-code'>
|
||||||
|
<img src='https://api.qrserver.com/v1/create-qr-code/?size=100x100&data=$busNo' width='100' height='100' />
|
||||||
|
</div>
|
||||||
|
<div class='serial-no'>流水号:$busNo</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -176,7 +176,7 @@ public class OperLogAspect {
|
|||||||
* 插入操作日志到数据库
|
* 插入操作日志到数据库
|
||||||
*/
|
*/
|
||||||
private void insertOperLog(SysOperLog operLog) {
|
private void insertOperLog(SysOperLog operLog) {
|
||||||
String username = SecurityUtils.getLoginUser().getUsername();
|
String username = SecurityUtils.getUsernameSafe(); // 使用安全获取用户名的方法
|
||||||
String sql = "INSERT INTO sys_oper_log "
|
String sql = "INSERT INTO sys_oper_log "
|
||||||
+ "(title,oper_time,method,request_method,oper_name,oper_url,oper_param,json_result,error_msg,cost_time) "
|
+ "(title,oper_time,method,request_method,oper_name,oper_url,oper_param,json_result,error_msg,cost_time) "
|
||||||
+ "VALUES (?, ?, ?,?, ?, ?, ?, ?,?, ?)";
|
+ "VALUES (?, ?, ?,?, ?, ?, ?, ?,?, ?)";
|
||||||
|
|||||||
@@ -70,6 +70,10 @@ public enum AssignSeqEnum {
|
|||||||
* 位置业务编码
|
* 位置业务编码
|
||||||
*/
|
*/
|
||||||
LOCATION_BUS_NO("15", "科室业务编码", "LOC"),
|
LOCATION_BUS_NO("15", "科室业务编码", "LOC"),
|
||||||
|
/**
|
||||||
|
* 手术室业务编码
|
||||||
|
*/
|
||||||
|
OPERATING_ROOM_BUS_NO("16", "手术室业务编码", "OR"),
|
||||||
/**
|
/**
|
||||||
* 厂商/产地单据号
|
* 厂商/产地单据号
|
||||||
*/
|
*/
|
||||||
@@ -297,7 +301,12 @@ public enum AssignSeqEnum {
|
|||||||
/**
|
/**
|
||||||
* 自动备份单据号
|
* 自动备份单据号
|
||||||
*/
|
*/
|
||||||
AUTO_BACKUP_NO("70", "自动备份单据号", "ABU");
|
AUTO_BACKUP_NO("70", "自动备份单据号", "ABU"),
|
||||||
|
/**
|
||||||
|
* 订单编号
|
||||||
|
*/
|
||||||
|
ORDER_NUM("71", "订单编号", "ORD");
|
||||||
|
|
||||||
|
|
||||||
private final String code;
|
private final String code;
|
||||||
private final String info;
|
private final String info;
|
||||||
|
|||||||
@@ -81,9 +81,15 @@ public class HisQueryUtils {
|
|||||||
if (entity == null) {
|
if (entity == null) {
|
||||||
return queryWrapper;
|
return queryWrapper;
|
||||||
}
|
}
|
||||||
// 反射获取实体类的字段
|
// 反射获取实体类的所有字段(包括父类)
|
||||||
Field[] fields = entity.getClass().getDeclaredFields();
|
Class<?> currentClass = entity.getClass();
|
||||||
|
while (currentClass != null && currentClass != Object.class) {
|
||||||
|
Field[] fields = currentClass.getDeclaredFields();
|
||||||
for (Field field : fields) {
|
for (Field field : fields) {
|
||||||
|
// 跳过静态字段,如 serialVersionUID
|
||||||
|
if (java.lang.reflect.Modifier.isStatic(field.getModifiers())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
field.setAccessible(true);
|
field.setAccessible(true);
|
||||||
try {
|
try {
|
||||||
Object value = field.get(entity);
|
Object value = field.get(entity);
|
||||||
@@ -97,6 +103,8 @@ public class HisQueryUtils {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
currentClass = currentClass.getSuperclass();
|
||||||
|
}
|
||||||
return queryWrapper;
|
return queryWrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,4 +22,31 @@ public class RedisKeys {
|
|||||||
public static String getProductsKey(String itemId){
|
public static String getProductsKey(String itemId){
|
||||||
return "products_change_price:item_" + itemId + "_key";
|
return "products_change_price:item_" + itemId + "_key";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手术信息缓存
|
||||||
|
* @param surgeryId 手术ID
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String getSurgeryKey(Long surgeryId){
|
||||||
|
return "surgery:info:" + surgeryId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手术列表缓存(按患者ID)
|
||||||
|
* @param patientId 患者ID
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String getSurgeryListByPatientKey(Long patientId){
|
||||||
|
return "surgery:patient:" + patientId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手术列表缓存(按就诊ID)
|
||||||
|
* @param encounterId 就诊ID
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String getSurgeryListByEncounterKey(Long encounterId){
|
||||||
|
return "surgery:encounter:" + encounterId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,76 @@
|
|||||||
|
package com.openhis.administration.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.core.common.core.domain.HisBaseEntity;
|
||||||
|
import com.openhis.common.annotation.Dict;
|
||||||
|
import com.openhis.common.enums.LocationStatus;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手术室管理Entity实体
|
||||||
|
*
|
||||||
|
* @author system
|
||||||
|
* @date 2026-01-04
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("adm_operating_room")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
public class OperatingRoom extends HisBaseEntity {
|
||||||
|
|
||||||
|
/** ID */
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 编码 */
|
||||||
|
private String busNo;
|
||||||
|
|
||||||
|
/** 手术室名称 */
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/** 手术室类型 */
|
||||||
|
private Integer roomTypeEnum;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String roomTypeEnum_dictText;
|
||||||
|
|
||||||
|
/** 所属机构ID */
|
||||||
|
private Long organizationId;
|
||||||
|
|
||||||
|
/** 所属机构名称 */
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String organizationName;
|
||||||
|
|
||||||
|
/** 位置描述 */
|
||||||
|
private String locationDescription;
|
||||||
|
|
||||||
|
/** 设备配置 */
|
||||||
|
private String equipmentConfig;
|
||||||
|
|
||||||
|
/** 容纳人数 */
|
||||||
|
private Integer capacity;
|
||||||
|
|
||||||
|
/** 状态编码(1-启用,0-停用) */
|
||||||
|
private Integer statusEnum;
|
||||||
|
|
||||||
|
/** 显示顺序 */
|
||||||
|
private Integer displayOrder;
|
||||||
|
|
||||||
|
/** 拼音码 */
|
||||||
|
private String pyStr;
|
||||||
|
|
||||||
|
/** 五笔码 */
|
||||||
|
private String wbStr;
|
||||||
|
|
||||||
|
/** 备注 */
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
public OperatingRoom() {
|
||||||
|
this.statusEnum = LocationStatus.ACTIVE.getValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.openhis.administration.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.openhis.administration.domain.OperatingRoom;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手术室Mapper接口
|
||||||
|
*
|
||||||
|
* @author system
|
||||||
|
* @date 2026-01-04
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface OperatingRoomMapper extends BaseMapper<OperatingRoom> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package com.openhis.administration.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.openhis.administration.domain.OperatingRoom;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手术室Service接口
|
||||||
|
*
|
||||||
|
* @author system
|
||||||
|
* @date 2026-01-04
|
||||||
|
*/
|
||||||
|
public interface IOperatingRoomService extends IService<OperatingRoom> {
|
||||||
|
}
|
||||||
@@ -44,8 +44,16 @@ public class EncounterServiceImpl extends ServiceImpl<EncounterMapper, Encounter
|
|||||||
// 生成就诊编码 医保挂号时是先生成码后生成实体
|
// 生成就诊编码 医保挂号时是先生成码后生成实体
|
||||||
encounter.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.ENCOUNTER_NUM.getPrefix(), 4));
|
encounter.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.ENCOUNTER_NUM.getPrefix(), 4));
|
||||||
}
|
}
|
||||||
// 生成就诊序号 (患者ID + 科室ID 作为当日就诊号的唯一标识)
|
// 生成就诊序号:
|
||||||
String preFix = encounter.getPatientId() + String.valueOf(encounter.getOrganizationId());
|
// 1) 若挂号医生已传入(registrarId 充当挂号医生 ID),按“科室+医生+当日”递增
|
||||||
|
// Key 示例:ORG-123-DOC-456 -> 1、2、3...
|
||||||
|
// 2) 否则按“科室+当日”递增
|
||||||
|
String preFix;
|
||||||
|
if (encounter.getRegistrarId() != null) {
|
||||||
|
preFix = "ORG-" + encounter.getOrganizationId() + "-DOC-" + encounter.getRegistrarId();
|
||||||
|
} else {
|
||||||
|
preFix = "ORG-" + encounter.getOrganizationId();
|
||||||
|
}
|
||||||
encounter.setDisplayOrder(assignSeqUtil.getSeqNoByDay(preFix));
|
encounter.setDisplayOrder(assignSeqUtil.getSeqNoByDay(preFix));
|
||||||
// 患者ID
|
// 患者ID
|
||||||
Long patientId = encounter.getPatientId();
|
Long patientId = encounter.getPatientId();
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.openhis.administration.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.openhis.administration.domain.OperatingRoom;
|
||||||
|
import com.openhis.administration.mapper.OperatingRoomMapper;
|
||||||
|
import com.openhis.administration.service.IOperatingRoomService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手术室Service实现类
|
||||||
|
*
|
||||||
|
* @author system
|
||||||
|
* @date 2026-01-04
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class OperatingRoomServiceImpl extends ServiceImpl<OperatingRoomMapper, OperatingRoom>
|
||||||
|
implements IOperatingRoomService {
|
||||||
|
}
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
package com.openhis.appointmentmanage.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 科室预约工作时间Entity
|
||||||
|
*
|
||||||
|
* @date 2025-12-12
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName(value = "dept_appointment_hours", autoResultMap = true)
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class DeptAppointmentHours {
|
||||||
|
|
||||||
|
@TableId(type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@TableField("institution")
|
||||||
|
private String institution;
|
||||||
|
|
||||||
|
@TableField("department")
|
||||||
|
private String department;
|
||||||
|
|
||||||
|
@TableField("morning_start")
|
||||||
|
private String morningStart;
|
||||||
|
|
||||||
|
@TableField("morning_end")
|
||||||
|
private String morningEnd;
|
||||||
|
|
||||||
|
@TableField("afternoon_start")
|
||||||
|
private String afternoonStart;
|
||||||
|
|
||||||
|
@TableField("afternoon_end")
|
||||||
|
private String afternoonEnd;
|
||||||
|
|
||||||
|
@TableField("quota")
|
||||||
|
private Integer quota;
|
||||||
|
|
||||||
|
@TableField("operator")
|
||||||
|
private String operator;
|
||||||
|
|
||||||
|
@TableField("created_time")
|
||||||
|
private LocalDateTime createdTime;
|
||||||
|
|
||||||
|
@TableField("updated_time")
|
||||||
|
private LocalDateTime updatedTime;
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package com.openhis.appointmentmanage.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.openhis.appointmentmanage.domain.DeptAppointmentHours;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface DeptAppointmentHoursMapper extends BaseMapper<DeptAppointmentHours> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package com.openhis.appointmentmanage.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.openhis.appointmentmanage.domain.DeptAppointmentHours;
|
||||||
|
|
||||||
|
public interface IDeptAppointmentHoursService extends IService<DeptAppointmentHours> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package com.openhis.appointmentmanage.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.openhis.appointmentmanage.domain.DeptAppointmentHours;
|
||||||
|
import com.openhis.appointmentmanage.mapper.DeptAppointmentHoursMapper;
|
||||||
|
import com.openhis.appointmentmanage.service.IDeptAppointmentHoursService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class DeptAppointmentHoursServiceImpl extends ServiceImpl<DeptAppointmentHoursMapper, DeptAppointmentHours> implements IDeptAppointmentHoursService {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
package com.openhis.clinical.domain;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.core.common.core.domain.HisBaseEntity;
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@TableName("order_main")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
public class Order extends HisBaseEntity {
|
||||||
|
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
private String orderNo;
|
||||||
|
|
||||||
|
private Long patientId;
|
||||||
|
|
||||||
|
private String patientName;
|
||||||
|
|
||||||
|
private String medicalCard;
|
||||||
|
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
private Integer gender;
|
||||||
|
|
||||||
|
private Long scheduleId;
|
||||||
|
|
||||||
|
private Long slotId;
|
||||||
|
|
||||||
|
private Long departmentId;
|
||||||
|
|
||||||
|
private String departmentName;
|
||||||
|
|
||||||
|
private Long doctorId;
|
||||||
|
|
||||||
|
private String doctorName;
|
||||||
|
|
||||||
|
private String regType;
|
||||||
|
|
||||||
|
private BigDecimal fee;
|
||||||
|
|
||||||
|
private Date appointmentDate;
|
||||||
|
|
||||||
|
private Date appointmentTime;
|
||||||
|
|
||||||
|
private Date cancelTime;
|
||||||
|
|
||||||
|
private String cancelReason;
|
||||||
|
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
private Integer payStatus;
|
||||||
|
|
||||||
|
private Integer version;
|
||||||
|
}
|
||||||
@@ -38,10 +38,35 @@ public class Surgery extends HisBaseEntity {
|
|||||||
@JsonSerialize(using = ToStringSerializer.class)
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
private Long patientId;
|
private Long patientId;
|
||||||
|
|
||||||
|
/** 患者姓名 */
|
||||||
|
@TableField("patient_name")
|
||||||
|
private String patientName;
|
||||||
|
|
||||||
/** 就诊ID */
|
/** 就诊ID */
|
||||||
@JsonSerialize(using = ToStringSerializer.class)
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
private Long encounterId;
|
private Long encounterId;
|
||||||
|
|
||||||
|
/** 申请医生ID */
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
@TableField("apply_doctor_id")
|
||||||
|
private Long applyDoctorId;
|
||||||
|
|
||||||
|
/** 申请医生姓名 */
|
||||||
|
@TableField("apply_doctor_name")
|
||||||
|
private String applyDoctorName;
|
||||||
|
|
||||||
|
/** 申请科室ID */
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
@TableField("apply_dept_id")
|
||||||
|
private Long applyDeptId;
|
||||||
|
|
||||||
|
/** 申请科室名称 */
|
||||||
|
@TableField("apply_dept_name")
|
||||||
|
private String applyDeptName;
|
||||||
|
|
||||||
|
/** 手术指征 */
|
||||||
|
private String surgeryIndication;
|
||||||
|
|
||||||
/** 手术名称 */
|
/** 手术名称 */
|
||||||
private String surgeryName;
|
private String surgeryName;
|
||||||
|
|
||||||
@@ -49,112 +74,157 @@ public class Surgery extends HisBaseEntity {
|
|||||||
private String surgeryCode;
|
private String surgeryCode;
|
||||||
|
|
||||||
/** 手术类型编码 */
|
/** 手术类型编码 */
|
||||||
|
@TableField("surgery_type_enum")
|
||||||
private Integer surgeryTypeEnum;
|
private Integer surgeryTypeEnum;
|
||||||
|
|
||||||
/** 手术等级 */
|
/** 手术等级 */
|
||||||
|
@TableField("surgery_level")
|
||||||
private Integer surgeryLevel;
|
private Integer surgeryLevel;
|
||||||
|
|
||||||
/** 手术状态 */
|
/** 手术状态 */
|
||||||
|
@TableField("status_enum")
|
||||||
private Integer statusEnum;
|
private Integer statusEnum;
|
||||||
|
|
||||||
/** 计划手术时间 */
|
/** 计划手术时间 */
|
||||||
|
@TableField("planned_time")
|
||||||
private Date plannedTime;
|
private Date plannedTime;
|
||||||
|
|
||||||
/** 实际开始时间 */
|
/** 实际开始时间 */
|
||||||
|
@TableField("actual_start_time")
|
||||||
private Date actualStartTime;
|
private Date actualStartTime;
|
||||||
|
|
||||||
/** 实际结束时间 */
|
/** 实际结束时间 */
|
||||||
|
@TableField("actual_end_time")
|
||||||
private Date actualEndTime;
|
private Date actualEndTime;
|
||||||
|
|
||||||
/** 主刀医生ID */
|
/** 主刀医生ID */
|
||||||
@JsonSerialize(using = ToStringSerializer.class)
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
@TableField("main_surgeon_id")
|
||||||
private Long mainSurgeonId;
|
private Long mainSurgeonId;
|
||||||
|
|
||||||
/** 主刀医生姓名 */
|
/** 主刀医生姓名 */
|
||||||
|
@TableField("main_surgeon_name")
|
||||||
private String mainSurgeonName;
|
private String mainSurgeonName;
|
||||||
|
|
||||||
/** 助手1 ID */
|
/** 助手1 ID */
|
||||||
@JsonSerialize(using = ToStringSerializer.class)
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
@TableField("assistant_1_id")
|
||||||
private Long assistant1Id;
|
private Long assistant1Id;
|
||||||
|
|
||||||
/** 助手1 姓名 */
|
/** 助手1 姓名 */
|
||||||
|
@TableField("assistant_1_name")
|
||||||
private String assistant1Name;
|
private String assistant1Name;
|
||||||
|
|
||||||
/** 助手2 ID */
|
/** 助手2 ID */
|
||||||
@JsonSerialize(using = ToStringSerializer.class)
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
@TableField("assistant_2_id")
|
||||||
private Long assistant2Id;
|
private Long assistant2Id;
|
||||||
|
|
||||||
/** 助手2 姓名 */
|
/** 助手2 姓名 */
|
||||||
|
@TableField("assistant_2_name")
|
||||||
private String assistant2Name;
|
private String assistant2Name;
|
||||||
|
|
||||||
/** 麻醉医生ID */
|
/** 麻醉医生ID */
|
||||||
@JsonSerialize(using = ToStringSerializer.class)
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
@TableField("anesthetist_id")
|
||||||
private Long anesthetistId;
|
private Long anesthetistId;
|
||||||
|
|
||||||
/** 麻醉医生姓名 */
|
/** 麻醉医生姓名 */
|
||||||
|
@TableField("anesthetist_name")
|
||||||
private String anesthetistName;
|
private String anesthetistName;
|
||||||
|
|
||||||
/** 巡回护士ID */
|
/** 巡回护士ID */
|
||||||
@JsonSerialize(using = ToStringSerializer.class)
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
@TableField("scrub_nurse_id")
|
||||||
private Long scrubNurseId;
|
private Long scrubNurseId;
|
||||||
|
|
||||||
/** 巡回护士姓名 */
|
/** 巡回护士姓名 */
|
||||||
|
@TableField("scrub_nurse_name")
|
||||||
private String scrubNurseName;
|
private String scrubNurseName;
|
||||||
|
|
||||||
/** 麻醉方式编码 */
|
/** 麻醉方式编码 */
|
||||||
|
@TableField("anesthesia_type_enum")
|
||||||
private Integer anesthesiaTypeEnum;
|
private Integer anesthesiaTypeEnum;
|
||||||
|
|
||||||
/** 手术部位 */
|
/** 手术部位 */
|
||||||
|
@TableField("body_site")
|
||||||
private String bodySite;
|
private String bodySite;
|
||||||
|
|
||||||
/** 手术切口等级 */
|
/** 手术切口等级 */
|
||||||
|
@TableField("incision_level")
|
||||||
private Integer incisionLevel;
|
private Integer incisionLevel;
|
||||||
|
|
||||||
/** 手术切口愈合等级 */
|
/** 手术切口愈合等级 */
|
||||||
|
@TableField("healing_level")
|
||||||
private Integer healingLevel;
|
private Integer healingLevel;
|
||||||
|
|
||||||
/** 手术室 */
|
/** 手术室 */
|
||||||
@JsonSerialize(using = ToStringSerializer.class)
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
@TableField("operating_room_id")
|
||||||
private Long operatingRoomId;
|
private Long operatingRoomId;
|
||||||
|
|
||||||
/** 手术室名称 */
|
/** 手术室名称 */
|
||||||
|
@TableField("operating_room_name")
|
||||||
private String operatingRoomName;
|
private String operatingRoomName;
|
||||||
|
|
||||||
/** 执行科室ID */
|
/** 执行科室ID */
|
||||||
@JsonSerialize(using = ToStringSerializer.class)
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
@TableField("org_id")
|
||||||
private Long orgId;
|
private Long orgId;
|
||||||
|
|
||||||
/** 执行科室名称 */
|
/** 执行科室名称 */
|
||||||
|
@TableField("org_name")
|
||||||
private String orgName;
|
private String orgName;
|
||||||
|
|
||||||
/** 术前诊断 */
|
/** 术前诊断 */
|
||||||
|
@TableField("preoperative_diagnosis")
|
||||||
private String preoperativeDiagnosis;
|
private String preoperativeDiagnosis;
|
||||||
|
|
||||||
/** 术后诊断 */
|
/** 术后诊断 */
|
||||||
|
@TableField("postoperative_diagnosis")
|
||||||
private String postoperativeDiagnosis;
|
private String postoperativeDiagnosis;
|
||||||
|
|
||||||
/** 手术经过描述 */
|
/** 手术经过描述 */
|
||||||
|
@TableField("surgery_description")
|
||||||
private String surgeryDescription;
|
private String surgeryDescription;
|
||||||
|
|
||||||
/** 术后医嘱 */
|
/** 术后医嘱 */
|
||||||
|
@TableField("postoperative_advice")
|
||||||
private String postoperativeAdvice;
|
private String postoperativeAdvice;
|
||||||
|
|
||||||
/** 并发症描述 */
|
/** 并发症描述 */
|
||||||
|
@TableField("complications")
|
||||||
private String complications;
|
private String complications;
|
||||||
|
|
||||||
/** 手术费用 */
|
/** 手术费用 */
|
||||||
|
@TableField("surgery_fee")
|
||||||
private BigDecimal surgeryFee;
|
private BigDecimal surgeryFee;
|
||||||
|
|
||||||
/** 麻醉费用 */
|
/** 麻醉费用 */
|
||||||
|
@TableField("anesthesia_fee")
|
||||||
private BigDecimal anesthesiaFee;
|
private BigDecimal anesthesiaFee;
|
||||||
|
|
||||||
/** 总费用 */
|
/** 总费用 */
|
||||||
|
@TableField("total_fee")
|
||||||
private BigDecimal totalFee;
|
private BigDecimal totalFee;
|
||||||
|
|
||||||
/** 备注信息 */
|
/** 备注信息 */
|
||||||
|
@TableField("remark")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
/** 租户ID(表不存在此字段,仅用于继承基类) */
|
/** 急诊标志 */
|
||||||
@TableField(exist = false)
|
@TableField("emergency_flag")
|
||||||
private Integer tenantId;
|
private Integer emergencyFlag;
|
||||||
|
|
||||||
|
/** 植入高值耗材标志 */
|
||||||
|
@TableField("implant_flag")
|
||||||
|
private Integer implantFlag;
|
||||||
|
|
||||||
|
/** 手术室确认时间 */
|
||||||
|
@TableField("operating_room_confirm_time")
|
||||||
|
private Date operatingRoomConfirmTime;
|
||||||
|
|
||||||
|
/** 手术室确认人 */
|
||||||
|
@TableField("operating_room_confirm_user")
|
||||||
|
private String operatingRoomConfirmUser;
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,107 @@
|
|||||||
|
package com.openhis.clinical.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.core.common.core.domain.HisBaseEntity;
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 号源管理Entity实体
|
||||||
|
*
|
||||||
|
* @author system
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("clinical_ticket")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
public class Ticket extends HisBaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 号源编码
|
||||||
|
*/
|
||||||
|
private String busNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 科室名称
|
||||||
|
*/
|
||||||
|
private String department;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 医生姓名
|
||||||
|
*/
|
||||||
|
private String doctor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 号源类型 (普通/专家)
|
||||||
|
*/
|
||||||
|
private String ticketType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 挂号时间
|
||||||
|
*/
|
||||||
|
private String time;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态 (unbooked:未预约, booked:已预约, checked:已取号, cancelled:已取消, locked:已锁定)
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 挂号费
|
||||||
|
*/
|
||||||
|
private String fee;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 患者ID
|
||||||
|
*/
|
||||||
|
private Long patientId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 患者姓名
|
||||||
|
*/
|
||||||
|
private String patientName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 就诊卡号
|
||||||
|
*/
|
||||||
|
private String medicalCard;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机号
|
||||||
|
*/
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约日期
|
||||||
|
*/
|
||||||
|
private Date appointmentDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约时间
|
||||||
|
*/
|
||||||
|
private Date appointmentTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 科室ID
|
||||||
|
*/
|
||||||
|
private Long departmentId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 医生ID
|
||||||
|
*/
|
||||||
|
private Long doctorId;
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package com.openhis.clinical.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.openhis.clinical.domain.Order;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public interface OrderMapper extends BaseMapper<Order> {
|
||||||
|
|
||||||
|
List<Order> selectOrderList(Order order);
|
||||||
|
|
||||||
|
Page<Order> selectOrderPage(Page<Order> page, @Param("order") Order order);
|
||||||
|
|
||||||
|
Order selectOrderById(Long id);
|
||||||
|
|
||||||
|
int insertOrder(Order order);
|
||||||
|
|
||||||
|
int updateOrder(Order order);
|
||||||
|
|
||||||
|
int deleteOrderById(Long id);
|
||||||
|
|
||||||
|
int deleteOrderByIds(Long[] ids);
|
||||||
|
|
||||||
|
int countOrders(Map<String, Object> params);
|
||||||
|
|
||||||
|
Order selectOrderBySlotId(Long slotId);
|
||||||
|
|
||||||
|
int updateOrderStatusById(Long id, Integer status);
|
||||||
|
|
||||||
|
int updateOrderCancelInfoById(Long id, Date cancelTime, String cancelReason);
|
||||||
|
}
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
package com.openhis.clinical.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.openhis.clinical.domain.Ticket;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 号源管理Mapper接口
|
||||||
|
*
|
||||||
|
* @author system
|
||||||
|
*/
|
||||||
|
public interface TicketMapper extends BaseMapper<Ticket> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询号源列表
|
||||||
|
*
|
||||||
|
* @param ticket 号源信息
|
||||||
|
* @return 号源集合
|
||||||
|
*/
|
||||||
|
List<Ticket> selectTicketList(Ticket ticket);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询号源列表
|
||||||
|
*
|
||||||
|
* @param page 分页参数
|
||||||
|
* @param ticket 号源信息
|
||||||
|
* @return 号源集合
|
||||||
|
*/
|
||||||
|
Page<Ticket> selectTicketPage(Page<Ticket> page, @Param("ticket") Ticket ticket);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询号源信息
|
||||||
|
*
|
||||||
|
* @param id 号源ID
|
||||||
|
* @return 号源信息
|
||||||
|
*/
|
||||||
|
Ticket selectTicketById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增号源
|
||||||
|
*
|
||||||
|
* @param ticket 号源信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int insertTicket(Ticket ticket);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改号源
|
||||||
|
*
|
||||||
|
* @param ticket 号源信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updateTicket(Ticket ticket);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除号源
|
||||||
|
*
|
||||||
|
* @param id 号源ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteTicketById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除号源
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteTicketByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据条件统计号源数量
|
||||||
|
*
|
||||||
|
* @param params 查询参数
|
||||||
|
* @return 号源数量
|
||||||
|
*/
|
||||||
|
int countTickets(Map<String, Object> params);
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.openhis.clinical.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.openhis.clinical.domain.Order;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public interface IOrderService extends IService<Order> {
|
||||||
|
|
||||||
|
List<Order> selectOrderList(Order order);
|
||||||
|
|
||||||
|
Page<Order> selectOrderPage(Page<Order> page, Order order);
|
||||||
|
|
||||||
|
Order selectOrderById(Long id);
|
||||||
|
|
||||||
|
int insertOrder(Order order);
|
||||||
|
|
||||||
|
int updateOrder(Order order);
|
||||||
|
|
||||||
|
int deleteOrderByIds(Long[] ids);
|
||||||
|
|
||||||
|
int deleteOrderById(Long id);
|
||||||
|
|
||||||
|
int countOrders(Map<String, Object> params);
|
||||||
|
|
||||||
|
Order selectOrderBySlotId(Long slotId);
|
||||||
|
|
||||||
|
int updateOrderStatusById(Long id, Integer status);
|
||||||
|
|
||||||
|
int updateOrderCancelInfoById(Long id, java.util.Date cancelTime, String cancelReason);
|
||||||
|
|
||||||
|
Order createAppointmentOrder(Map<String, Object> params);
|
||||||
|
|
||||||
|
int cancelAppointmentOrder(Long orderId, String cancelReason);
|
||||||
|
}
|
||||||
@@ -0,0 +1,105 @@
|
|||||||
|
package com.openhis.clinical.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.openhis.clinical.domain.Ticket;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 号源管理Service接口
|
||||||
|
*
|
||||||
|
* @author system
|
||||||
|
*/
|
||||||
|
public interface ITicketService extends IService<Ticket> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询号源列表
|
||||||
|
*
|
||||||
|
* @param ticket 号源信息
|
||||||
|
* @return 号源集合
|
||||||
|
*/
|
||||||
|
List<Ticket> selectTicketList(Ticket ticket);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询号源列表
|
||||||
|
*
|
||||||
|
* @param page 分页参数
|
||||||
|
* @param ticket 号源信息
|
||||||
|
* @return 号源集合
|
||||||
|
*/
|
||||||
|
Page<Ticket> selectTicketPage(Page<Ticket> page, Ticket ticket);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询号源信息
|
||||||
|
*
|
||||||
|
* @param id 号源ID
|
||||||
|
* @return 号源信息
|
||||||
|
*/
|
||||||
|
Ticket selectTicketById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增号源
|
||||||
|
*
|
||||||
|
* @param ticket 号源信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int insertTicket(Ticket ticket);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改号源
|
||||||
|
*
|
||||||
|
* @param ticket 号源信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updateTicket(Ticket ticket);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除号源
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteTicketByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除号源信息
|
||||||
|
*
|
||||||
|
* @param id 号源ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteTicketById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约号源
|
||||||
|
*
|
||||||
|
* @param params 预约参数
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int bookTicket(Map<String, Object> params);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消预约
|
||||||
|
*
|
||||||
|
* @param ticketId 号源ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int cancelTicket(Long ticketId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取号
|
||||||
|
*
|
||||||
|
* @param ticketId 号源ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int checkInTicket(Long ticketId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 停诊
|
||||||
|
*
|
||||||
|
* @param ticketId 号源ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int cancelConsultation(Long ticketId);
|
||||||
|
}
|
||||||
@@ -0,0 +1,164 @@
|
|||||||
|
package com.openhis.clinical.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.core.common.utils.AssignSeqUtil;
|
||||||
|
import com.core.common.utils.SecurityUtils;
|
||||||
|
import com.openhis.clinical.domain.Order;
|
||||||
|
import com.openhis.clinical.domain.Ticket;
|
||||||
|
import com.openhis.clinical.mapper.OrderMapper;
|
||||||
|
import com.openhis.clinical.mapper.TicketMapper;
|
||||||
|
import com.openhis.clinical.service.IOrderService;
|
||||||
|
import com.openhis.common.enums.AssignSeqEnum;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements IOrderService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private OrderMapper orderMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private TicketMapper ticketMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private AssignSeqUtil assignSeqUtil;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Order> selectOrderList(Order order) {
|
||||||
|
return orderMapper.selectOrderList(order);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<Order> selectOrderPage(Page<Order> page, Order order) {
|
||||||
|
return orderMapper.selectOrderPage(page, order);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Order selectOrderById(Long id) {
|
||||||
|
return orderMapper.selectOrderById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int insertOrder(Order order) {
|
||||||
|
return orderMapper.insertOrder(order);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int updateOrder(Order order) {
|
||||||
|
return orderMapper.updateOrder(order);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int deleteOrderByIds(Long[] ids) {
|
||||||
|
return orderMapper.deleteOrderByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int deleteOrderById(Long id) {
|
||||||
|
return orderMapper.deleteOrderById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int countOrders(Map<String, Object> params) {
|
||||||
|
return orderMapper.countOrders(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Order selectOrderBySlotId(Long slotId) {
|
||||||
|
return orderMapper.selectOrderBySlotId(slotId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int updateOrderStatusById(Long id, Integer status) {
|
||||||
|
return orderMapper.updateOrderStatusById(id, status);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int updateOrderCancelInfoById(Long id, Date cancelTime, String cancelReason) {
|
||||||
|
return orderMapper.updateOrderCancelInfoById(id, cancelTime, cancelReason);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Order createAppointmentOrder(Map<String, Object> params) {
|
||||||
|
Long slotId = params.get("slotId") != null ? Long.valueOf(params.get("slotId").toString()) : null;
|
||||||
|
if (slotId == null) {
|
||||||
|
throw new RuntimeException("号源ID不能为空");
|
||||||
|
}
|
||||||
|
|
||||||
|
Ticket ticket = ticketMapper.selectTicketById(slotId);
|
||||||
|
if (ticket == null) {
|
||||||
|
throw new RuntimeException("号源不存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
Order order = new Order();
|
||||||
|
String orderNo = assignSeqUtil.getSeq(AssignSeqEnum.ORDER_NUM.getPrefix(), 18);
|
||||||
|
order.setOrderNo(orderNo);
|
||||||
|
|
||||||
|
Long patientId = params.get("patientId") != null ? Long.valueOf(params.get("patientId").toString()) : null;
|
||||||
|
String patientName = params.get("patientName") != null ? params.get("patientName").toString() : null;
|
||||||
|
String medicalCard = params.get("medicalCard") != null ? params.get("medicalCard").toString() : null;
|
||||||
|
String phone = params.get("phone") != null ? params.get("phone").toString() : null;
|
||||||
|
Integer gender = params.get("gender") != null ? Integer.valueOf(params.get("gender").toString()) : null;
|
||||||
|
|
||||||
|
order.setPatientId(patientId);
|
||||||
|
order.setPatientName(patientName);
|
||||||
|
order.setMedicalCard(medicalCard);
|
||||||
|
order.setPhone(phone);
|
||||||
|
order.setGender(gender);
|
||||||
|
|
||||||
|
order.setSlotId(slotId);
|
||||||
|
order.setDepartmentId(ticket.getDepartmentId());
|
||||||
|
order.setDepartmentName(ticket.getDepartment());
|
||||||
|
order.setDoctorId(ticket.getDoctorId());
|
||||||
|
order.setDoctorName(ticket.getDoctor());
|
||||||
|
|
||||||
|
String regType = params.get("regType") != null ? params.get("regType").toString() : "普通";
|
||||||
|
order.setRegType(regType);
|
||||||
|
|
||||||
|
BigDecimal fee = params.get("fee") != null ? new BigDecimal(params.get("fee").toString()) : BigDecimal.ZERO;
|
||||||
|
order.setFee(fee);
|
||||||
|
|
||||||
|
Date appointmentDate = new Date();
|
||||||
|
order.setAppointmentDate(appointmentDate);
|
||||||
|
order.setAppointmentTime(new Date());
|
||||||
|
|
||||||
|
order.setStatus(1);
|
||||||
|
order.setPayStatus(0);
|
||||||
|
order.setVersion(0);
|
||||||
|
|
||||||
|
// 设置租户ID
|
||||||
|
Integer tenantId = params.get("tenant_id") != null ? Integer.valueOf(params.get("tenant_id").toString()) : null;
|
||||||
|
order.setTenantId(tenantId);
|
||||||
|
|
||||||
|
order.setCreateTime(new Date());
|
||||||
|
order.setUpdateTime(new Date());
|
||||||
|
|
||||||
|
orderMapper.insertOrder(order);
|
||||||
|
|
||||||
|
return order;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int cancelAppointmentOrder(Long orderId, String cancelReason) {
|
||||||
|
Order order = orderMapper.selectOrderById(orderId);
|
||||||
|
if (order == null) {
|
||||||
|
throw new RuntimeException("订单不存在");
|
||||||
|
}
|
||||||
|
if (order.getStatus() == 3) {
|
||||||
|
throw new RuntimeException("订单已取消");
|
||||||
|
}
|
||||||
|
if (order.getStatus() == 2) {
|
||||||
|
throw new RuntimeException("订单已完成,无法取消");
|
||||||
|
}
|
||||||
|
|
||||||
|
Date cancelTime = new Date();
|
||||||
|
return orderMapper.updateOrderCancelInfoById(orderId, cancelTime, cancelReason);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,23 +2,23 @@ package com.openhis.clinical.service.impl;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.core.common.utils.AssignSeqUtil;
|
|
||||||
import com.openhis.clinical.domain.Surgery;
|
import com.openhis.clinical.domain.Surgery;
|
||||||
import com.openhis.clinical.mapper.SurgeryMapper;
|
import com.openhis.clinical.mapper.SurgeryMapper;
|
||||||
import com.openhis.clinical.service.ISurgeryService;
|
import com.openhis.clinical.service.ISurgeryService;
|
||||||
|
import com.openhis.common.utils.RedisKeys;
|
||||||
|
import com.core.common.core.redis.RedisCache;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
/**
|
@Slf4j
|
||||||
* 手术管理Service业务层处理
|
|
||||||
*
|
|
||||||
* @author system
|
|
||||||
* @date 2025-12-30
|
|
||||||
*/
|
|
||||||
@Service
|
@Service
|
||||||
public class SurgeryServiceImpl extends ServiceImpl<SurgeryMapper, Surgery> implements ISurgeryService {
|
public class SurgeryServiceImpl extends ServiceImpl<SurgeryMapper, Surgery> implements ISurgeryService {
|
||||||
|
|
||||||
@@ -26,10 +26,9 @@ public class SurgeryServiceImpl extends ServiceImpl<SurgeryMapper, Surgery> impl
|
|||||||
private SurgeryMapper surgeryMapper;
|
private SurgeryMapper surgeryMapper;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private AssignSeqUtil assignSeqUtil;
|
private RedisCache redisCache;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增手术信息
|
|
||||||
*
|
*
|
||||||
* @param surgery 手术信息
|
* @param surgery 手术信息
|
||||||
* @return 手术ID
|
* @return 手术ID
|
||||||
@@ -37,46 +36,57 @@ public class SurgeryServiceImpl extends ServiceImpl<SurgeryMapper, Surgery> impl
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Long insertSurgery(Surgery surgery) {
|
public Long insertSurgery(Surgery surgery) {
|
||||||
// 生成手术编号
|
// 生成手术单号:OP+年月日+4位随机数
|
||||||
String surgeryNo = assignSeqUtil.getSeq("SS", 10);
|
String surgeryNo = generateSurgeryNo();
|
||||||
surgery.setSurgeryNo(surgeryNo);
|
surgery.setSurgeryNo(surgeryNo);
|
||||||
surgery.setCreateTime(new Date());
|
surgery.setCreateTime(new Date());
|
||||||
surgery.setUpdateTime(new Date());
|
surgery.setUpdateTime(new Date());
|
||||||
surgery.setDeleteFlag("0");
|
surgery.setDeleteFlag("0");
|
||||||
|
|
||||||
// 默认状态为待排期
|
// 默认状态为待排期(新开)
|
||||||
if (surgery.getStatusEnum() == null) {
|
if (surgery.getStatusEnum() == null) {
|
||||||
surgery.setStatusEnum(0);
|
surgery.setStatusEnum(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 添加日志,检查字段的值
|
||||||
|
log.info("准备插入手术记录 - applyDoctorId: {}, applyDoctorName: {}, applyDeptId: {}, applyDeptName: {}",
|
||||||
|
surgery.getApplyDoctorId(), surgery.getApplyDoctorName(),
|
||||||
|
surgery.getApplyDeptId(), surgery.getApplyDeptName());
|
||||||
|
|
||||||
surgeryMapper.insert(surgery);
|
surgeryMapper.insert(surgery);
|
||||||
|
|
||||||
|
// 清除相关缓存
|
||||||
|
clearSurgeryCache(surgery);
|
||||||
|
|
||||||
|
// 插入后再查询一次,验证是否保存成功
|
||||||
|
Surgery inserted = surgeryMapper.selectById(surgery.getId());
|
||||||
|
log.info("插入后查询结果 - applyDoctorId: {}, applyDoctorName: {}, applyDeptId: {}, applyDeptName: {}",
|
||||||
|
inserted.getApplyDoctorId(), inserted.getApplyDoctorName(),
|
||||||
|
inserted.getApplyDeptId(), inserted.getApplyDeptName());
|
||||||
|
|
||||||
return surgery.getId();
|
return surgery.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改手术信息
|
* 生成手术单号
|
||||||
|
* 格式:OP+年月日+4位随机数
|
||||||
|
* 示例:OP2025092003
|
||||||
*
|
*
|
||||||
* @param surgery 手术信息
|
* @return 手术单号
|
||||||
* @return 结果
|
|
||||||
*/
|
*/
|
||||||
@Override
|
private String generateSurgeryNo() {
|
||||||
@Transactional(rollbackFor = Exception.class)
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
|
||||||
public boolean updateSurgery(Surgery surgery) {
|
String dateStr = sdf.format(new Date());
|
||||||
surgery.setUpdateTime(new Date());
|
|
||||||
return surgeryMapper.updateById(surgery) > 0;
|
// 生成4位随机数
|
||||||
|
Random random = new Random();
|
||||||
|
int randomNum = random.nextInt(10000);
|
||||||
|
String randomStr = String.format("%04d", randomNum);
|
||||||
|
|
||||||
|
return "OP" + dateStr + randomStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除手术信息
|
|
||||||
*
|
|
||||||
* @param id 手术ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public boolean deleteSurgery(Long id) {
|
|
||||||
return surgeryMapper.deleteById(id) > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据ID查询手术信息
|
* 根据ID查询手术信息
|
||||||
@@ -86,7 +96,24 @@ public class SurgeryServiceImpl extends ServiceImpl<SurgeryMapper, Surgery> impl
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Surgery getSurgeryById(Long id) {
|
public Surgery getSurgeryById(Long id) {
|
||||||
return surgeryMapper.selectById(id);
|
String cacheKey = RedisKeys.getSurgeryKey(id);
|
||||||
|
|
||||||
|
// 先从Redis缓存中获取
|
||||||
|
Surgery surgery = redisCache.getCacheObject(cacheKey);
|
||||||
|
if (surgery != null) {
|
||||||
|
log.info("从Redis缓存中获取手术信息 - surgeryId: {}", id);
|
||||||
|
return surgery;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 缓存中没有,从数据库查询
|
||||||
|
surgery = surgeryMapper.selectById(id);
|
||||||
|
if (surgery != null) {
|
||||||
|
// 将查询结果存入Redis缓存(缓存30分钟)
|
||||||
|
redisCache.setCacheObject(cacheKey, surgery, 30, TimeUnit.MINUTES);
|
||||||
|
log.info("从数据库查询手术信息并存入Redis缓存 - surgeryId: {}", id);
|
||||||
|
}
|
||||||
|
|
||||||
|
return surgery;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -97,11 +124,29 @@ public class SurgeryServiceImpl extends ServiceImpl<SurgeryMapper, Surgery> impl
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<Surgery> getSurgeryListByPatientId(Long patientId) {
|
public List<Surgery> getSurgeryListByPatientId(Long patientId) {
|
||||||
|
String cacheKey = RedisKeys.getSurgeryListByPatientKey(patientId);
|
||||||
|
|
||||||
|
// 先从Redis缓存中获取
|
||||||
|
List<Surgery> surgeryList = redisCache.getCacheObject(cacheKey);
|
||||||
|
if (surgeryList != null) {
|
||||||
|
log.info("从Redis缓存中获取患者手术列表 - patientId: {}", patientId);
|
||||||
|
return surgeryList;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 缓存中没有,从数据库查询
|
||||||
LambdaQueryWrapper<Surgery> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<Surgery> wrapper = new LambdaQueryWrapper<>();
|
||||||
wrapper.eq(Surgery::getPatientId, patientId)
|
wrapper.eq(Surgery::getPatientId, patientId)
|
||||||
.eq(Surgery::getDeleteFlag, "0")
|
.eq(Surgery::getDeleteFlag, "0")
|
||||||
.orderByDesc(Surgery::getCreateTime);
|
.orderByDesc(Surgery::getCreateTime);
|
||||||
return surgeryMapper.selectList(wrapper);
|
surgeryList = surgeryMapper.selectList(wrapper);
|
||||||
|
|
||||||
|
// 将查询结果存入Redis缓存(缓存30分钟)
|
||||||
|
if (surgeryList != null && !surgeryList.isEmpty()) {
|
||||||
|
redisCache.setCacheObject(cacheKey, surgeryList, 30, TimeUnit.MINUTES);
|
||||||
|
log.info("从数据库查询患者手术列表并存入Redis缓存 - patientId: {}, count: {}", patientId, surgeryList.size());
|
||||||
|
}
|
||||||
|
|
||||||
|
return surgeryList;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -112,7 +157,25 @@ public class SurgeryServiceImpl extends ServiceImpl<SurgeryMapper, Surgery> impl
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<Surgery> getSurgeryListByEncounterId(Long encounterId) {
|
public List<Surgery> getSurgeryListByEncounterId(Long encounterId) {
|
||||||
return surgeryMapper.selectByEncounterId(encounterId);
|
String cacheKey = RedisKeys.getSurgeryListByEncounterKey(encounterId);
|
||||||
|
|
||||||
|
// 先从Redis缓存中获取
|
||||||
|
List<Surgery> surgeryList = redisCache.getCacheObject(cacheKey);
|
||||||
|
if (surgeryList != null) {
|
||||||
|
log.info("从Redis缓存中获取就诊手术列表 - encounterId: {}", encounterId);
|
||||||
|
return surgeryList;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 缓存中没有,从数据库查询
|
||||||
|
surgeryList = surgeryMapper.selectByEncounterId(encounterId);
|
||||||
|
|
||||||
|
// 将查询结果存入Redis缓存(缓存30分钟)
|
||||||
|
if (surgeryList != null && !surgeryList.isEmpty()) {
|
||||||
|
redisCache.setCacheObject(cacheKey, surgeryList, 30, TimeUnit.MINUTES);
|
||||||
|
log.info("从数据库查询就诊手术列表并存入Redis缓存 - encounterId: {}, count: {}", encounterId, surgeryList.size());
|
||||||
|
}
|
||||||
|
|
||||||
|
return surgeryList;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -142,4 +205,72 @@ public class SurgeryServiceImpl extends ServiceImpl<SurgeryMapper, Surgery> impl
|
|||||||
|
|
||||||
return surgeryMapper.updateById(surgery) > 0;
|
return surgeryMapper.updateById(surgery) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改手术信息
|
||||||
|
*
|
||||||
|
* @param surgery 手术信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public boolean updateSurgery(Surgery surgery) {
|
||||||
|
surgery.setUpdateTime(new Date());
|
||||||
|
boolean result = surgeryMapper.updateById(surgery) > 0;
|
||||||
|
|
||||||
|
if (result) {
|
||||||
|
// 清除相关缓存
|
||||||
|
clearSurgeryCache(surgery);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除手术信息
|
||||||
|
*
|
||||||
|
* @param id 手术ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public boolean deleteSurgery(Long id) {
|
||||||
|
Surgery surgery = surgeryMapper.selectById(id);
|
||||||
|
boolean result = surgeryMapper.deleteById(id) > 0;
|
||||||
|
|
||||||
|
if (result && surgery != null) {
|
||||||
|
// 清除相关缓存
|
||||||
|
clearSurgeryCache(surgery);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清除手术相关的Redis缓存
|
||||||
|
*
|
||||||
|
* @param surgery 手术信息
|
||||||
|
*/
|
||||||
|
private void clearSurgeryCache(Surgery surgery) {
|
||||||
|
// 清除单个手术缓存
|
||||||
|
if (surgery.getId() != null) {
|
||||||
|
String surgeryKey = RedisKeys.getSurgeryKey(surgery.getId());
|
||||||
|
redisCache.deleteObject(surgeryKey);
|
||||||
|
log.info("清除手术缓存 - surgeryId: {}", surgery.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 清除患者手术列表缓存
|
||||||
|
if (surgery.getPatientId() != null) {
|
||||||
|
String patientKey = RedisKeys.getSurgeryListByPatientKey(surgery.getPatientId());
|
||||||
|
redisCache.deleteObject(patientKey);
|
||||||
|
log.info("清除患者手术列表缓存 - patientId: {}", surgery.getPatientId());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 清除就诊手术列表缓存
|
||||||
|
if (surgery.getEncounterId() != null) {
|
||||||
|
String encounterKey = RedisKeys.getSurgeryListByEncounterKey(surgery.getEncounterId());
|
||||||
|
redisCache.deleteObject(encounterKey);
|
||||||
|
log.info("清除就诊手术列表缓存 - encounterId: {}", surgery.getEncounterId());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,267 @@
|
|||||||
|
package com.openhis.clinical.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.openhis.clinical.domain.Order;
|
||||||
|
import com.openhis.clinical.domain.Ticket;
|
||||||
|
import com.openhis.clinical.mapper.TicketMapper;
|
||||||
|
import com.openhis.clinical.service.IOrderService;
|
||||||
|
import com.openhis.clinical.service.ITicketService;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 号源管理Service业务层处理
|
||||||
|
*
|
||||||
|
* @author system
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class TicketServiceImpl extends ServiceImpl<TicketMapper, Ticket> implements ITicketService {
|
||||||
|
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(TicketServiceImpl.class);
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private TicketMapper ticketMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IOrderService orderService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询号源列表
|
||||||
|
*
|
||||||
|
* @param ticket 号源信息
|
||||||
|
* @return 号源集合
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<Ticket> selectTicketList(Ticket ticket) {
|
||||||
|
return ticketMapper.selectTicketList(ticket);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询号源列表
|
||||||
|
*
|
||||||
|
* @param page 分页参数
|
||||||
|
* @param ticket 号源信息
|
||||||
|
* @return 号源集合
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Page<Ticket> selectTicketPage(Page<Ticket> page, Ticket ticket) {
|
||||||
|
return ticketMapper.selectTicketPage(page, ticket);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询号源信息
|
||||||
|
*
|
||||||
|
* @param id 号源ID
|
||||||
|
* @return 号源信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Ticket selectTicketById(Long id) {
|
||||||
|
return ticketMapper.selectTicketById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增号源
|
||||||
|
*
|
||||||
|
* @param ticket 号源信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertTicket(Ticket ticket) {
|
||||||
|
return ticketMapper.insertTicket(ticket);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改号源
|
||||||
|
*
|
||||||
|
* @param ticket 号源信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateTicket(Ticket ticket) {
|
||||||
|
return ticketMapper.updateTicket(ticket);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除号源
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteTicketByIds(Long[] ids) {
|
||||||
|
return ticketMapper.deleteTicketByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除号源信息
|
||||||
|
*
|
||||||
|
* @param id 号源ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteTicketById(Long id) {
|
||||||
|
return ticketMapper.deleteTicketById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约号源
|
||||||
|
*
|
||||||
|
* @param params 预约参数
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public int bookTicket(Map<String, Object> params) {
|
||||||
|
Long ticketId = Long.valueOf(params.get("ticketId").toString());
|
||||||
|
Long patientId = params.get("patientId") != null ? Long.valueOf(params.get("patientId").toString()) : null;
|
||||||
|
String patientName = params.get("patientName") != null ? params.get("patientName").toString() : null;
|
||||||
|
String medicalCard = params.get("medicalCard") != null ? params.get("medicalCard").toString() : null;
|
||||||
|
String phone = params.get("phone") != null ? params.get("phone").toString() : null;
|
||||||
|
|
||||||
|
logger.debug("开始预约号源,ticketId: {}, patientId: {}, patientName: {}", ticketId, patientId, patientName);
|
||||||
|
|
||||||
|
Ticket ticket = ticketMapper.selectTicketById(ticketId);
|
||||||
|
if (ticket == null) {
|
||||||
|
logger.error("号源不存在,ticketId: {}", ticketId);
|
||||||
|
throw new RuntimeException("号源不存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
logger.debug("查询到号源信息,id: {}, status: {}, deleteFlag: {}", ticket.getId(), ticket.getStatus(), ticket.getDeleteFlag());
|
||||||
|
|
||||||
|
// 详细调试:检查状态字符串的详细信息
|
||||||
|
String status = ticket.getStatus();
|
||||||
|
logger.debug("状态字符串详细信息: value='{}', length={}, isNull={}", status, status != null ? status.length() : "null", status == null);
|
||||||
|
if (status != null) {
|
||||||
|
StringBuilder charInfo = new StringBuilder();
|
||||||
|
for (int i = 0; i < status.length(); i++) {
|
||||||
|
charInfo.append(status.charAt(i)).append("(").append((int) status.charAt(i)).append(") ");
|
||||||
|
}
|
||||||
|
logger.debug("状态字符串字符信息: {}", charInfo.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 详细调试:检查每个状态比较的结果
|
||||||
|
boolean isUnbooked = "unbooked".equals(status);
|
||||||
|
boolean isLocked = "locked".equals(status);
|
||||||
|
boolean isCancelled = "cancelled".equals(status);
|
||||||
|
boolean isChecked = "checked".equals(status);
|
||||||
|
boolean isBooked = "booked".equals(status);
|
||||||
|
logger.debug("状态比较结果: unbooked={}, locked={}, cancelled={}, checked={}, booked={}",
|
||||||
|
isUnbooked, isLocked, isCancelled, isChecked, isBooked);
|
||||||
|
|
||||||
|
if (!isUnbooked && !isLocked && !isCancelled && !isChecked && !isBooked) {
|
||||||
|
logger.error("号源不可预约,id: {}, status: {}", ticket.getId(), ticket.getStatus());
|
||||||
|
throw new RuntimeException("号源不可预约");
|
||||||
|
}
|
||||||
|
|
||||||
|
params.put("slotId", ticketId);
|
||||||
|
Order order = orderService.createAppointmentOrder(params);
|
||||||
|
|
||||||
|
Ticket updateTicket = new Ticket();
|
||||||
|
updateTicket.setId(ticketId);
|
||||||
|
updateTicket.setStatus("booked");
|
||||||
|
updateTicket.setPatientId(patientId);
|
||||||
|
updateTicket.setPatientName(patientName);
|
||||||
|
updateTicket.setMedicalCard(medicalCard);
|
||||||
|
updateTicket.setPhone(phone);
|
||||||
|
updateTicket.setAppointmentDate(new Date());
|
||||||
|
updateTicket.setAppointmentTime(new Date());
|
||||||
|
|
||||||
|
int result = ticketMapper.updateById(updateTicket);
|
||||||
|
logger.debug("预约成功,更新号源状态为booked,result: {}", result);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消预约
|
||||||
|
*
|
||||||
|
* @param ticketId 号源ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public int cancelTicket(Long ticketId) {
|
||||||
|
Ticket ticket = ticketMapper.selectTicketById(ticketId);
|
||||||
|
if (ticket == null) {
|
||||||
|
throw new RuntimeException("号源不存在");
|
||||||
|
}
|
||||||
|
if (!"booked".equals(ticket.getStatus()) && !"locked".equals(ticket.getStatus())) {
|
||||||
|
throw new RuntimeException("号源不可取消预约");
|
||||||
|
}
|
||||||
|
|
||||||
|
Order order = orderService.selectOrderBySlotId(ticketId);
|
||||||
|
if (order != null) {
|
||||||
|
orderService.cancelAppointmentOrder(order.getId(), "患者取消预约");
|
||||||
|
}
|
||||||
|
|
||||||
|
ticket.setStatus("unbooked");
|
||||||
|
ticket.setPatientId(null);
|
||||||
|
ticket.setPatientName(null);
|
||||||
|
ticket.setMedicalCard(null);
|
||||||
|
ticket.setPhone(null);
|
||||||
|
ticket.setAppointmentDate(null);
|
||||||
|
ticket.setAppointmentTime(null);
|
||||||
|
return ticketMapper.updateTicket(ticket);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取号
|
||||||
|
*
|
||||||
|
* @param ticketId 号源ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int checkInTicket(Long ticketId) {
|
||||||
|
// 获取号源信息
|
||||||
|
Ticket ticket = ticketMapper.selectTicketById(ticketId);
|
||||||
|
if (ticket == null) {
|
||||||
|
throw new RuntimeException("号源不存在");
|
||||||
|
}
|
||||||
|
if (!"booked".equals(ticket.getStatus()) && !"locked".equals(ticket.getStatus())) {
|
||||||
|
throw new RuntimeException("号源不可取号");
|
||||||
|
}
|
||||||
|
// 更新号源状态为已取号
|
||||||
|
ticket.setStatus("checked");
|
||||||
|
return ticketMapper.updateTicket(ticket);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 停诊
|
||||||
|
*
|
||||||
|
* @param ticketId 号源ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public int cancelConsultation(Long ticketId) {
|
||||||
|
// 获取号源信息
|
||||||
|
Ticket ticket = ticketMapper.selectTicketById(ticketId);
|
||||||
|
if (ticket == null) {
|
||||||
|
throw new RuntimeException("号源不存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查是否存在相关订单,如果存在则取消
|
||||||
|
Order order = orderService.selectOrderBySlotId(ticketId);
|
||||||
|
if (order != null) {
|
||||||
|
orderService.cancelAppointmentOrder(order.getId(), "医生停诊");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新号源状态为已取消
|
||||||
|
ticket.setStatus("cancelled");
|
||||||
|
ticket.setPatientId(null);
|
||||||
|
ticket.setPatientName(null);
|
||||||
|
ticket.setMedicalCard(null);
|
||||||
|
ticket.setPhone(null);
|
||||||
|
ticket.setAppointmentDate(null);
|
||||||
|
ticket.setAppointmentTime(null);
|
||||||
|
return ticketMapper.updateTicket(ticket);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,270 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.openhis.clinical.mapper.OrderMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.openhis.clinical.domain.Order" id="OrderResult">
|
||||||
|
<id property="id" column="id"/>
|
||||||
|
<result property="orderNo" column="order_no"/>
|
||||||
|
<result property="patientId" column="patient_id"/>
|
||||||
|
<result property="patientName" column="patient_name"/>
|
||||||
|
<result property="medicalCard" column="medical_card"/>
|
||||||
|
<result property="phone" column="phone"/>
|
||||||
|
<result property="gender" column="gender"/>
|
||||||
|
<result property="scheduleId" column="schedule_id"/>
|
||||||
|
<result property="slotId" column="slot_id"/>
|
||||||
|
<result property="departmentId" column="department_id"/>
|
||||||
|
<result property="departmentName" column="department_name"/>
|
||||||
|
<result property="doctorId" column="doctor_id"/>
|
||||||
|
<result property="doctorName" column="doctor_name"/>
|
||||||
|
<result property="regType" column="reg_type"/>
|
||||||
|
<result property="fee" column="fee"/>
|
||||||
|
<result property="appointmentDate" column="appointment_date"/>
|
||||||
|
<result property="appointmentTime" column="appointment_time"/>
|
||||||
|
<result property="cancelTime" column="cancel_time"/>
|
||||||
|
<result property="cancelReason" column="cancel_reason"/>
|
||||||
|
<result property="status" column="status"/>
|
||||||
|
<result property="payStatus" column="pay_status"/>
|
||||||
|
<result property="version" column="version"/>
|
||||||
|
<result property="createBy" column="create_by"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="updateBy" column="update_by"/>
|
||||||
|
<result property="updateTime" column="update_time"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="selectOrderList" resultMap="OrderResult">
|
||||||
|
select * from order_main
|
||||||
|
<where>
|
||||||
|
<if test="orderNo != null and orderNo != ''">
|
||||||
|
and order_no = #{orderNo}
|
||||||
|
</if>
|
||||||
|
<if test="patientId != null">
|
||||||
|
and patient_id = #{patientId}
|
||||||
|
</if>
|
||||||
|
<if test="patientName != null and patientName != ''">
|
||||||
|
and patient_name like #{patientName}
|
||||||
|
</if>
|
||||||
|
<if test="medicalCard != null and medicalCard != ''">
|
||||||
|
and medical_card = #{medicalCard}
|
||||||
|
</if>
|
||||||
|
<if test="phone != null and phone != ''">
|
||||||
|
and phone = #{phone}
|
||||||
|
</if>
|
||||||
|
<if test="scheduleId != null">
|
||||||
|
and schedule_id = #{scheduleId}
|
||||||
|
</if>
|
||||||
|
<if test="slotId != null">
|
||||||
|
and slot_id = #{slotId}
|
||||||
|
</if>
|
||||||
|
<if test="departmentId != null">
|
||||||
|
and department_id = #{departmentId}
|
||||||
|
</if>
|
||||||
|
<if test="doctorId != null">
|
||||||
|
and doctor_id = #{doctorId}
|
||||||
|
</if>
|
||||||
|
<if test="status != null">
|
||||||
|
and status = #{status}
|
||||||
|
</if>
|
||||||
|
<if test="payStatus != null">
|
||||||
|
and pay_status = #{payStatus}
|
||||||
|
</if>
|
||||||
|
<if test="appointmentDate != null">
|
||||||
|
and appointment_date = #{appointmentDate}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectOrderPage" resultMap="OrderResult">
|
||||||
|
select * from order_main
|
||||||
|
<where>
|
||||||
|
<if test="order.orderNo != null and order.orderNo != ''">
|
||||||
|
and order_no = #{order.orderNo}
|
||||||
|
</if>
|
||||||
|
<if test="order.patientId != null">
|
||||||
|
and patient_id = #{order.patientId}
|
||||||
|
</if>
|
||||||
|
<if test="order.patientName != null and order.patientName != ''">
|
||||||
|
and patient_name like #{order.patientName}
|
||||||
|
</if>
|
||||||
|
<if test="order.medicalCard != null and order.medicalCard != ''">
|
||||||
|
and medical_card = #{order.medicalCard}
|
||||||
|
</if>
|
||||||
|
<if test="order.phone != null and order.phone != ''">
|
||||||
|
and phone = #{order.phone}
|
||||||
|
</if>
|
||||||
|
<if test="order.scheduleId != null">
|
||||||
|
and schedule_id = #{order.scheduleId}
|
||||||
|
</if>
|
||||||
|
<if test="order.slotId != null">
|
||||||
|
and slot_id = #{order.slotId}
|
||||||
|
</if>
|
||||||
|
<if test="order.departmentId != null">
|
||||||
|
and department_id = #{order.departmentId}
|
||||||
|
</if>
|
||||||
|
<if test="order.doctorId != null">
|
||||||
|
and doctor_id = #{order.doctorId}
|
||||||
|
</if>
|
||||||
|
<if test="order.status != null">
|
||||||
|
and status = #{order.status}
|
||||||
|
</if>
|
||||||
|
<if test="order.payStatus != null">
|
||||||
|
and pay_status = #{order.payStatus}
|
||||||
|
</if>
|
||||||
|
<if test="order.appointmentDate != null">
|
||||||
|
and appointment_date = #{order.appointmentDate}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectOrderById" resultMap="OrderResult">
|
||||||
|
select * from order_main where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectOrderBySlotId" resultMap="OrderResult">
|
||||||
|
select * from order_main where slot_id = #{slotId} and status = 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertOrder" parameterType="com.openhis.clinical.domain.Order">
|
||||||
|
insert into order_main
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="orderNo != null and orderNo != ''">order_no,</if>
|
||||||
|
<if test="patientId != null">patient_id,</if>
|
||||||
|
<if test="patientName != null and patientName != ''">patient_name,</if>
|
||||||
|
<if test="medicalCard != null and medicalCard != ''">medical_card,</if>
|
||||||
|
<if test="phone != null and phone != ''">phone,</if>
|
||||||
|
<if test="gender != null">gender,</if>
|
||||||
|
<if test="scheduleId != null">schedule_id,</if>
|
||||||
|
<if test="slotId != null">slot_id,</if>
|
||||||
|
<if test="departmentId != null">department_id,</if>
|
||||||
|
<if test="departmentName != null and departmentName != ''">department_name,</if>
|
||||||
|
<if test="doctorId != null">doctor_id,</if>
|
||||||
|
<if test="doctorName != null and doctorName != ''">doctor_name,</if>
|
||||||
|
<if test="regType != null and regType != ''">reg_type,</if>
|
||||||
|
<if test="fee != null">fee,</if>
|
||||||
|
<if test="appointmentDate != null">appointment_date,</if>
|
||||||
|
<if test="appointmentTime != null">appointment_time,</if>
|
||||||
|
<if test="cancelTime != null">cancel_time,</if>
|
||||||
|
<if test="cancelReason != null and cancelReason != ''">cancel_reason,</if>
|
||||||
|
<if test="status != null">status,</if>
|
||||||
|
<if test="payStatus != null">pay_status,</if>
|
||||||
|
<if test="version != null">version,</if>
|
||||||
|
<if test="tenantId != null">tenant_id,</if>
|
||||||
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
||||||
|
<if test="updateTime != null">update_time,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="orderNo != null and orderNo != ''">#{orderNo},</if>
|
||||||
|
<if test="patientId != null">#{patientId},</if>
|
||||||
|
<if test="patientName != null and patientName != ''">#{patientName},</if>
|
||||||
|
<if test="medicalCard != null and medicalCard != ''">#{medicalCard},</if>
|
||||||
|
<if test="phone != null and phone != ''">#{phone},</if>
|
||||||
|
<if test="gender != null">#{gender},</if>
|
||||||
|
<if test="scheduleId != null">#{scheduleId},</if>
|
||||||
|
<if test="slotId != null">#{slotId},</if>
|
||||||
|
<if test="departmentId != null">#{departmentId},</if>
|
||||||
|
<if test="departmentName != null and departmentName != ''">#{departmentName},</if>
|
||||||
|
<if test="doctorId != null">#{doctorId},</if>
|
||||||
|
<if test="doctorName != null and doctorName != ''">#{doctorName},</if>
|
||||||
|
<if test="regType != null and regType != ''">#{regType},</if>
|
||||||
|
<if test="fee != null">#{fee},</if>
|
||||||
|
<if test="appointmentDate != null">#{appointmentDate},</if>
|
||||||
|
<if test="appointmentTime != null">#{appointmentTime},</if>
|
||||||
|
<if test="cancelTime != null">#{cancelTime},</if>
|
||||||
|
<if test="cancelReason != null and cancelReason != ''">#{cancelReason},</if>
|
||||||
|
<if test="status != null">#{status},</if>
|
||||||
|
<if test="payStatus != null">#{payStatus},</if>
|
||||||
|
<if test="version != null">#{version},</if>
|
||||||
|
<if test="tenantId != null">#{tenantId},</if>
|
||||||
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
||||||
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateOrder" parameterType="com.openhis.clinical.domain.Order">
|
||||||
|
update order_main
|
||||||
|
<trim prefix="set" suffixOverrides=",">
|
||||||
|
<if test="orderNo != null and orderNo != ''">order_no = #{orderNo},</if>
|
||||||
|
<if test="patientId != null">patient_id = #{patientId},</if>
|
||||||
|
<if test="patientName != null and patientName != ''">patient_name = #{patientName},</if>
|
||||||
|
<if test="medicalCard != null and medicalCard != ''">medical_card = #{medicalCard},</if>
|
||||||
|
<if test="phone != null and phone != ''">phone = #{phone},</if>
|
||||||
|
<if test="gender != null">gender = #{gender},</if>
|
||||||
|
<if test="scheduleId != null">schedule_id = #{scheduleId},</if>
|
||||||
|
<if test="slotId != null">slot_id = #{slotId},</if>
|
||||||
|
<if test="departmentId != null">department_id = #{departmentId},</if>
|
||||||
|
<if test="departmentName != null and departmentName != ''">department_name = #{departmentName},</if>
|
||||||
|
<if test="doctorId != null">doctor_id = #{doctorId},</if>
|
||||||
|
<if test="doctorName != null and doctorName != ''">doctor_name = #{doctorName},</if>
|
||||||
|
<if test="regType != null and regType != ''">reg_type = #{regType},</if>
|
||||||
|
<if test="fee != null">fee = #{fee},</if>
|
||||||
|
<if test="appointmentDate != null">appointment_date = #{appointmentDate},</if>
|
||||||
|
<if test="appointmentTime != null">appointment_time = #{appointmentTime},</if>
|
||||||
|
<if test="cancelTime != null">cancel_time = #{cancelTime},</if>
|
||||||
|
<if test="cancelReason != null and cancelReason != ''">cancel_reason = #{cancelReason},</if>
|
||||||
|
<if test="status != null">status = #{status},</if>
|
||||||
|
<if test="payStatus != null">pay_status = #{payStatus},</if>
|
||||||
|
<if test="version != null">version = #{version},</if>
|
||||||
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||||
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="updateOrderStatusById">
|
||||||
|
update order_main set status = #{status} where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="updateOrderCancelInfoById">
|
||||||
|
update order_main set status = 3, cancel_time = #{cancelTime}, cancel_reason = #{cancelReason} where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteOrderById">
|
||||||
|
delete from order_main where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteOrderByIds">
|
||||||
|
delete from order_main where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<select id="countOrders" resultType="int">
|
||||||
|
select count(*) from order_main
|
||||||
|
<where>
|
||||||
|
<if test="orderNo != null and orderNo != ''">
|
||||||
|
and order_no = #{orderNo}
|
||||||
|
</if>
|
||||||
|
<if test="patientId != null">
|
||||||
|
and patient_id = #{patientId}
|
||||||
|
</if>
|
||||||
|
<if test="scheduleId != null">
|
||||||
|
and schedule_id = #{scheduleId}
|
||||||
|
</if>
|
||||||
|
<if test="slotId != null">
|
||||||
|
and slot_id = #{slotId}
|
||||||
|
</if>
|
||||||
|
<if test="departmentId != null">
|
||||||
|
and department_id = #{departmentId}
|
||||||
|
</if>
|
||||||
|
<if test="doctorId != null">
|
||||||
|
and doctor_id = #{doctorId}
|
||||||
|
</if>
|
||||||
|
<if test="status != null">
|
||||||
|
and status = #{status}
|
||||||
|
</if>
|
||||||
|
<if test="payStatus != null">
|
||||||
|
and pay_status = #{payStatus}
|
||||||
|
</if>
|
||||||
|
<if test="appointmentDate != null">
|
||||||
|
and appointment_date = #{appointmentDate}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,245 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.openhis.clinical.mapper.TicketMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.openhis.clinical.domain.Ticket" id="TicketResult">
|
||||||
|
<id property="id" column="id"/>
|
||||||
|
<result property="busNo" column="bus_no"/>
|
||||||
|
<result property="department" column="department"/>
|
||||||
|
<result property="doctor" column="doctor"/>
|
||||||
|
<result property="ticketType" column="ticket_type"/>
|
||||||
|
<result property="time" column="time"/>
|
||||||
|
<result property="status" column="status"/>
|
||||||
|
<result property="fee" column="fee"/>
|
||||||
|
<result property="patientId" column="patient_id"/>
|
||||||
|
<result property="patientName" column="patient_name"/>
|
||||||
|
<result property="medicalCard" column="medical_card"/>
|
||||||
|
<result property="phone" column="phone"/>
|
||||||
|
<result property="appointmentDate" column="appointment_date"/>
|
||||||
|
<result property="appointmentTime" column="appointment_time"/>
|
||||||
|
<result property="departmentId" column="department_id"/>
|
||||||
|
<result property="doctorId" column="doctor_id"/>
|
||||||
|
<result property="createBy" column="create_by"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="updateBy" column="update_by"/>
|
||||||
|
<result property="updateTime" column="update_time"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="selectTicketList" parameterType="com.openhis.clinical.domain.Ticket" resultMap="TicketResult">
|
||||||
|
select * from clinical_ticket
|
||||||
|
<where>
|
||||||
|
<!-- 逻辑删除条件 -->
|
||||||
|
and delete_flag = '0'
|
||||||
|
<!-- 其他查询条件 -->
|
||||||
|
<if test="ticketType != null and ticketType != ''">
|
||||||
|
and ticket_type = #{ticketType}
|
||||||
|
</if>
|
||||||
|
<if test="status != null and status != ''">
|
||||||
|
and status = #{status}
|
||||||
|
</if>
|
||||||
|
<if test="appointmentDate != null">
|
||||||
|
and appointment_date = cast(#{appointmentDate} as date)
|
||||||
|
</if>
|
||||||
|
<if test="doctorId != null">
|
||||||
|
and doctor_id = #{doctorId}
|
||||||
|
</if>
|
||||||
|
<if test="departmentId != null">
|
||||||
|
and department_id = #{departmentId}
|
||||||
|
</if>
|
||||||
|
<if test="time != null and time != ''">
|
||||||
|
and time like #{time}
|
||||||
|
</if>
|
||||||
|
<if test="patientName != null and patientName != ''">
|
||||||
|
and patient_name = #{patientName}
|
||||||
|
</if>
|
||||||
|
<if test="medicalCard != null and medicalCard != ''">
|
||||||
|
and medical_card = #{medicalCard}
|
||||||
|
</if>
|
||||||
|
<if test="phone != null and phone != ''">
|
||||||
|
and phone = #{phone}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectTicketPage" resultMap="TicketResult">
|
||||||
|
select * from clinical_ticket
|
||||||
|
<where>
|
||||||
|
<!-- 逻辑删除条件 -->
|
||||||
|
and delete_flag = '0'
|
||||||
|
<!-- 其他查询条件 -->
|
||||||
|
<if test="ticket.ticketType != null and ticket.ticketType != ''">
|
||||||
|
and ticket_type = #{ticket.ticketType}
|
||||||
|
</if>
|
||||||
|
<if test="ticket.status != null and ticket.status != ''">
|
||||||
|
and status = #{ticket.status}
|
||||||
|
</if>
|
||||||
|
<if test="ticket.appointmentDate != null">
|
||||||
|
and appointment_date = cast(#{ticket.appointmentDate} as date)
|
||||||
|
</if>
|
||||||
|
<if test="ticket.doctorId != null">
|
||||||
|
and doctor_id = #{ticket.doctorId}
|
||||||
|
</if>
|
||||||
|
<if test="ticket.departmentId != null">
|
||||||
|
and department_id = #{ticket.departmentId}
|
||||||
|
</if>
|
||||||
|
<if test="ticket.time != null and ticket.time != ''">
|
||||||
|
and time like #{ticket.time}
|
||||||
|
</if>
|
||||||
|
<if test="ticket.patientName != null and ticket.patientName != ''">
|
||||||
|
and patient_name = #{ticket.patientName}
|
||||||
|
</if>
|
||||||
|
<if test="ticket.medicalCard != null and ticket.medicalCard != ''">
|
||||||
|
and medical_card = #{ticket.medicalCard}
|
||||||
|
</if>
|
||||||
|
<if test="ticket.phone != null and ticket.phone != ''">
|
||||||
|
and phone = #{ticket.phone}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 自定义COUNT查询,解决MyBatis-Plus自动生成的COUNT查询结果不正确的问题 -->
|
||||||
|
<select id="selectTicketPage_mpCount" resultType="java.lang.Long">
|
||||||
|
select count(*) from clinical_ticket
|
||||||
|
<where>
|
||||||
|
<!-- 逻辑删除条件 -->
|
||||||
|
and delete_flag = '0'
|
||||||
|
<!-- 其他查询条件 -->
|
||||||
|
<if test="ticket.ticketType != null and ticket.ticketType != ''">
|
||||||
|
and ticket_type = #{ticket.ticketType}
|
||||||
|
</if>
|
||||||
|
<if test="ticket.status != null and ticket.status != ''">
|
||||||
|
and status = #{ticket.status}
|
||||||
|
</if>
|
||||||
|
<if test="ticket.appointmentDate != null">
|
||||||
|
and appointment_date = #{ticket.appointmentDate}
|
||||||
|
</if>
|
||||||
|
<if test="ticket.doctorId != null">
|
||||||
|
and doctor_id = #{ticket.doctorId}
|
||||||
|
</if>
|
||||||
|
<if test="ticket.departmentId != null">
|
||||||
|
and department_id = #{ticket.departmentId}
|
||||||
|
</if>
|
||||||
|
<if test="ticket.time != null and ticket.time != ''">
|
||||||
|
and time like #{ticket.time}
|
||||||
|
</if>
|
||||||
|
<if test="ticket.patientName != null and ticket.patientName != ''">
|
||||||
|
and patient_name = #{ticket.patientName}
|
||||||
|
</if>
|
||||||
|
<if test="ticket.medicalCard != null and ticket.medicalCard != ''">
|
||||||
|
and medical_card = #{ticket.medicalCard}
|
||||||
|
</if>
|
||||||
|
<if test="ticket.phone != null and ticket.phone != ''">
|
||||||
|
and phone = #{ticket.phone}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectTicketById" resultMap="TicketResult">
|
||||||
|
select * from clinical_ticket where id = #{id} and delete_flag = '0'
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertTicket" parameterType="com.openhis.clinical.domain.Ticket">
|
||||||
|
insert into clinical_ticket
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="busNo != null and busNo != ''">bus_no,</if>
|
||||||
|
<if test="department != null and department != ''">department,</if>
|
||||||
|
<if test="doctor != null and doctor != ''">doctor,</if>
|
||||||
|
<if test="ticketType != null and ticketType != ''">ticket_type,</if>
|
||||||
|
<if test="time != null and time != ''">time,</if>
|
||||||
|
<if test="status != null and status != ''">status,</if>
|
||||||
|
<if test="fee != null and fee != ''">fee,</if>
|
||||||
|
<if test="patientId != null">patient_id,</if>
|
||||||
|
<if test="patientName != null and patientName != ''">patient_name,</if>
|
||||||
|
<if test="medicalCard != null and medicalCard != ''">medical_card,</if>
|
||||||
|
<if test="phone != null and phone != ''">phone,</if>
|
||||||
|
<if test="appointmentDate != null">appointment_date,</if>
|
||||||
|
<if test="appointmentTime != null">appointment_time,</if>
|
||||||
|
<if test="departmentId != null">department_id,</if>
|
||||||
|
<if test="doctorId != null">doctor_id,</if>
|
||||||
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
||||||
|
<if test="updateTime != null">update_time,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="busNo != null and busNo != ''">#{busNo},</if>
|
||||||
|
<if test="department != null and department != ''">#{department},</if>
|
||||||
|
<if test="doctor != null and doctor != ''">#{doctor},</if>
|
||||||
|
<if test="ticketType != null and ticketType != ''">#{ticketType},</if>
|
||||||
|
<if test="time != null and time != ''">#{time},</if>
|
||||||
|
<if test="status != null and status != ''">#{status},</if>
|
||||||
|
<if test="fee != null and fee != ''">#{fee},</if>
|
||||||
|
<if test="patientId != null">#{patientId},</if>
|
||||||
|
<if test="patientName != null and patientName != ''">#{patientName},</if>
|
||||||
|
<if test="medicalCard != null and medicalCard != ''">#{medicalCard},</if>
|
||||||
|
<if test="phone != null and phone != ''">#{phone},</if>
|
||||||
|
<if test="appointmentDate != null">#{appointmentDate},</if>
|
||||||
|
<if test="appointmentTime != null">#{appointmentTime},</if>
|
||||||
|
<if test="departmentId != null">#{departmentId},</if>
|
||||||
|
<if test="doctorId != null">#{doctorId},</if>
|
||||||
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
||||||
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateTicket" parameterType="com.openhis.clinical.domain.Ticket">
|
||||||
|
update clinical_ticket
|
||||||
|
<trim prefix="set" suffixOverrides=",">
|
||||||
|
<if test="busNo != null and busNo != ''">bus_no = #{busNo},</if>
|
||||||
|
<if test="department != null and department != ''">department = #{department},</if>
|
||||||
|
<if test="doctor != null and doctor != ''">doctor = #{doctor},</if>
|
||||||
|
<if test="ticketType != null and ticketType != ''">ticket_type = #{ticketType},</if>
|
||||||
|
<if test="time != null and time != ''">time = #{time},</if>
|
||||||
|
<if test="status != null and status != ''">status = #{status},</if>
|
||||||
|
<if test="fee != null and fee != ''">fee = #{fee},</if>
|
||||||
|
<if test="patientId != null">patient_id = #{patientId},</if>
|
||||||
|
<if test="patientName != null and patientName != ''">patient_name = #{patientName},</if>
|
||||||
|
<if test="medicalCard != null and medicalCard != ''">medical_card = #{medicalCard},</if>
|
||||||
|
<if test="phone != null and phone != ''">phone = #{phone},</if>
|
||||||
|
<if test="appointmentDate != null">appointment_date = #{appointmentDate},</if>
|
||||||
|
<if test="appointmentTime != null">appointment_time = #{appointmentTime},</if>
|
||||||
|
<if test="departmentId != null">department_id = #{departmentId},</if>
|
||||||
|
<if test="doctorId != null">doctor_id = #{doctorId},</if>
|
||||||
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||||
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteTicketById">
|
||||||
|
delete from clinical_ticket where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteTicketByIds">
|
||||||
|
delete from clinical_ticket where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<select id="countTickets" resultType="int">
|
||||||
|
select count(*) from clinical_ticket
|
||||||
|
<where>
|
||||||
|
<if test="ticketType != null and ticketType != ''">
|
||||||
|
and ticket_type = #{ticketType}
|
||||||
|
</if>
|
||||||
|
<if test="status != null and status != ''">
|
||||||
|
and status = #{status}
|
||||||
|
</if>
|
||||||
|
<if test="appointmentDate != null">
|
||||||
|
and appointment_date = cast(#{appointmentDate} as date)
|
||||||
|
</if>
|
||||||
|
<if test="doctorId != null">
|
||||||
|
and doctor_id = #{doctorId}
|
||||||
|
</if>
|
||||||
|
<if test="departmentId != null">
|
||||||
|
and department_id = #{departmentId}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -1,117 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
||||||
<parent>
|
|
||||||
<artifactId>openhis-server</artifactId>
|
|
||||||
<groupId>com.openhis</groupId>
|
|
||||||
<version>0.0.1-SNAPSHOT</version>
|
|
||||||
</parent>
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
|
|
||||||
<artifactId>openhis-einvoiceapp</artifactId>
|
|
||||||
|
|
||||||
<properties>
|
|
||||||
<maven.compiler.source>17</maven.compiler.source>
|
|
||||||
<maven.compiler.target>17</maven.compiler.target>
|
|
||||||
</properties>
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
|
|
||||||
<!-- 领域-->
|
|
||||||
<!-- <dependency>-->
|
|
||||||
<!-- <groupId>com.openhis</groupId>-->
|
|
||||||
<!-- <artifactId>openhis-domain</artifactId>-->
|
|
||||||
<!-- <version>0.0.1-SNAPSHOT</version>-->
|
|
||||||
<!-- </dependency>-->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.alibaba.fastjson2</groupId>
|
|
||||||
<artifactId>fastjson2</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.httpcomponents</groupId>
|
|
||||||
<artifactId>httpclient</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<!-- 共通-->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.openhis</groupId>
|
|
||||||
<artifactId>openhis-common</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- liteflow-->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.yomahub</groupId>
|
|
||||||
<artifactId>liteflow-spring-boot-starter</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-configuration-processor</artifactId>
|
|
||||||
<optional>true</optional>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>cn.hutool</groupId>
|
|
||||||
<artifactId>hutool-all</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.bouncycastle</groupId>
|
|
||||||
<artifactId>bcprov-jdk15on</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.itextpdf</groupId>
|
|
||||||
<artifactId>kernel</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.httpcomponents</groupId>
|
|
||||||
<artifactId>httpmime</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- pdf依赖-->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.itextpdf</groupId>
|
|
||||||
<artifactId>itextpdf</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.itextpdf</groupId>
|
|
||||||
<artifactId>itext-asian</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
<!-- <build>-->
|
|
||||||
<!-- <plugins>-->
|
|
||||||
<!-- <plugin>-->
|
|
||||||
<!-- <groupId>org.springframework.boot</groupId>-->
|
|
||||||
<!-- <artifactId>spring-boot-maven-plugin</artifactId>-->
|
|
||||||
<!-- <configuration>-->
|
|
||||||
<!-- <fork>true</fork> <!– 如果没有该配置,devtools不会生效 –>-->
|
|
||||||
<!-- </configuration>-->
|
|
||||||
<!-- <executions>-->
|
|
||||||
<!-- <execution>-->
|
|
||||||
<!-- <goals>-->
|
|
||||||
<!-- <goal>repackage</goal>-->
|
|
||||||
<!-- </goals>-->
|
|
||||||
<!-- </execution>-->
|
|
||||||
<!-- </executions>-->
|
|
||||||
<!-- </plugin>-->
|
|
||||||
<!-- <plugin>-->
|
|
||||||
<!-- <groupId>org.apache.maven.plugins</groupId>-->
|
|
||||||
<!-- <artifactId>maven-war-plugin</artifactId>-->
|
|
||||||
<!-- <version>${maven-war-plugin.version}</version>-->
|
|
||||||
<!-- <configuration>-->
|
|
||||||
<!-- <failOnMissingWebXml>false</failOnMissingWebXml>-->
|
|
||||||
<!-- <warName>${project.artifactId}</warName>-->
|
|
||||||
<!-- </configuration>-->
|
|
||||||
<!-- </plugin>-->
|
|
||||||
<!-- </plugins>-->
|
|
||||||
<!-- <finalName>${project.artifactId}</finalName>-->
|
|
||||||
<!-- </build>-->
|
|
||||||
|
|
||||||
</project>
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user