Compare commits
401 Commits
V1.3
...
79ea4ed4f7
| Author | SHA1 | Date | |
|---|---|---|---|
| 79ea4ed4f7 | |||
| cbd3e7f981 | |||
| 3c497417dc | |||
| 088861f66e | |||
| 8c607c8749 | |||
| 3115e38cc4 | |||
| ae6c486114 | |||
| a41ffa4cfc | |||
| b1f74161f8 | |||
| 3bab56a19b | |||
| abc0674531 | |||
| 85fcb7c2e2 | |||
| fc6a7437a3 | |||
| 999a0992e7 | |||
| 55b3dfc077 | |||
|
|
32d1673667 | ||
| 17c7cc70ed | |||
| 44be570ffa | |||
| c6f4996ba7 | |||
| 6c20b15339 | |||
| c297072b36 | |||
| 4c6886be6a | |||
| 8beb7f3d3d | |||
| 91968530b4 | |||
| 0833f82fb4 | |||
| cce71f324b | |||
| ee6efafde4 | |||
| 2051807ecf | |||
| 0a4de15599 | |||
| 25b3c26ec2 | |||
| 91d673de77 | |||
| 0bfa7183f9 | |||
| 79d451931d | |||
| ae5f1c795b | |||
| c1074fc4fb | |||
| e832b6d38e | |||
| 5043466e84 | |||
| fcaeedb543 | |||
| 8cf434a46f | |||
| bfbc061b0b | |||
| f92cd830e9 | |||
| a7a1a18445 | |||
| d1331cd4e1 | |||
| 37d08b8545 | |||
| e69f499ac0 | |||
| 3baf7161f1 | |||
| 85188651ca | |||
| d6fbfb1427 | |||
| 966847499a | |||
| 1e91171001 | |||
| 51f495f81e | |||
| 1e6a5972b9 | |||
| 515f03a5cd | |||
| b27542ba6d | |||
| 4790855079 | |||
| 72cf9c6f2d | |||
| 19ecb65183 | |||
| d85a8684a6 | |||
| 574a9267bf | |||
| 27a7396c78 | |||
| 633cf2c17f | |||
| 3188ca5752 | |||
| c79e4c2623 | |||
| f3c451d0a1 | |||
| a077bd57d4 | |||
| cf16c497bd | |||
| fd1ab239a9 | |||
| caf65e3113 | |||
| c18c21ff4c | |||
| ab6849c9eb | |||
| 6b555f2563 | |||
| 7645405c5b | |||
| 5bfadb9174 | |||
| e1b9d36153 | |||
| fdb8d6c934 | |||
| 22a1ac57b2 | |||
| 4d243815a6 | |||
| 882e8c9199 | |||
| a0c87f6335 | |||
| 538dde55f7 | |||
| f33e3c6f15 | |||
| 0794782505 | |||
| d37fa46b5f | |||
| 8fcc229ad8 | |||
| 39aa710fd3 | |||
| 49f95b40ea | |||
| eb2d7302b7 | |||
| eb26f9db34 | |||
| bd6f3ca587 | |||
| a58e02f2cb | |||
| 8c8ef13021 | |||
| d9a0a98f52 | |||
| 8c84b6eb46 | |||
| 3d797cc0e0 | |||
| df7281a2d4 | |||
| f83d7ae520 | |||
| d9c8525b94 | |||
| bcc5cbb2fb | |||
| 67a8351d70 | |||
| 391506e423 | |||
| b1117b4157 | |||
| b0eb9861b9 | |||
| b863c14f2b | |||
| 18f6a845e6 | |||
| e1385cb3e6 | |||
| c8ca56c3f5 | |||
| b149f7d687 | |||
| 19702c25e5 | |||
|
|
eaa681c9ff | ||
| 205c58782b | |||
| 00e1c62de0 | |||
| 46c9787216 | |||
| e0a768de2e | |||
| fc7f931728 | |||
|
|
3ccb970a09 | ||
|
|
8a9a622aeb | ||
|
|
29e7f0937b | ||
| 029d534b3c | |||
|
|
213723b220 | ||
|
|
c636e77fd0 | ||
|
|
7407562ec5 | ||
|
|
b3c27ec789 | ||
|
|
601ae40666 | ||
| 3dda5ce72d | |||
|
|
99d4c28b95 | ||
|
|
0e70de6de7 | ||
| 72eb1088df | |||
| a853c16854 | |||
| 73a349f98a | |||
| 5fb7a3f488 | |||
| a8eb7d5697 | |||
| eb3b142ce4 | |||
| 9f6a39ba30 | |||
| f7f2f98bbe | |||
| 79e68ee14e | |||
| bc8987c463 | |||
| 3f7174fcd1 | |||
| 080008f447 | |||
| 5c3d935615 | |||
| a0845127c6 | |||
| ba65ab303b | |||
|
|
6fbdddf0ee | ||
| 173cbc7f87 | |||
|
|
2e341a123e | ||
|
|
8beff2ee14 | ||
| 1b939ba5b7 | |||
| 577daabe1c | |||
| 327e88e6d4 | |||
|
|
548fabcffe | ||
| 263e21e157 | |||
| d7955aa628 | |||
|
|
d197f7555f | ||
| a0e52da437 | |||
|
|
88d79729fe | ||
| 6dc6480e64 | |||
| 98c263a72b | |||
| 50a2ef9e00 | |||
| 065f7052c6 | |||
| e23d42404d | |||
| 4120d4e001 | |||
| 1bd2089047 | |||
| 6d9ff7dc10 | |||
| ae7ca984f8 | |||
| 69b7a4d865 | |||
| 864bf55025 | |||
| 249ef5f87e | |||
|
|
df3fb6c66c | ||
|
|
10ec9f4c1b | ||
| 0b98763c05 | |||
|
|
3d3b21a775 | ||
|
|
4ba4f80946 | ||
|
|
ed7cb2dab5 | ||
| 50ef9e6743 | |||
| 250d7dde34 | |||
| 69f3e066db | |||
|
|
afb0c3933c | ||
|
|
45ac07e57c | ||
|
|
262ea97824 | ||
|
|
dcfa13f239 | ||
|
|
27c3c850d6 | ||
| 122a15a73d | |||
| 61749aee4d | |||
| 97a29a31c5 | |||
| c3734f921c | |||
| c561586cfa | |||
|
|
60593233bc | ||
| 992b03f9c2 | |||
| 36628342dc | |||
|
|
3783e4a872 | ||
| 584f79294b | |||
| a5884ec069 | |||
| cc2f7db754 | |||
| fcccfc1959 | |||
| c5ec91e7d3 | |||
| 6b67e25d94 | |||
| 6da3b63012 | |||
|
|
ea0f0e2294 | ||
|
|
980f0aeb9c | ||
|
|
17b40118ce | ||
|
|
d10a78e5e8 | ||
|
|
f7ad010b2a | ||
|
|
1a7ff0a686 | ||
|
|
3ad3f21362 | ||
|
|
c84fc3c236 | ||
|
|
a6561e2ca6 | ||
|
|
dfe35bb7f0 | ||
| 18c96e006f | |||
| f5db504363 | |||
| deb31c969a | |||
| e7dac9762d | |||
|
|
89862878b5 | ||
|
|
e105919dab | ||
|
|
e83fc94334 | ||
| 5bf7ab481f | |||
| afa904bd83 | |||
| a343464d8d | |||
| 4a2485e434 | |||
|
|
4e2d4d85ec | ||
| 7ddf6211ee | |||
| d44600b641 | |||
| a68c4402de | |||
| 93103f7f40 | |||
| 7202151a41 | |||
| 491d8f8930 | |||
| b886726ecc | |||
|
|
9d0dde6794 | ||
|
|
f3578b3202 | ||
|
|
0610ba7cb5 | ||
|
|
8b848f787a | ||
| a794cd0ce3 | |||
|
|
d97fd0bed1 | ||
|
|
c0e67722d9 | ||
|
|
aca7fea69f | ||
| ce9344f9ce | |||
| 991ad61655 | |||
|
|
e4ac857461 | ||
|
|
24ab98ae89 | ||
| e79ab9ac4f | |||
| b66c2027d1 | |||
| 09bf895711 | |||
|
|
825cdd58ae | ||
| 0977eb8145 | |||
|
|
73efeecfc1 | ||
| fe8fb3d321 | |||
|
|
618fb1e340 | ||
|
|
215fe8b889 | ||
|
|
3e32458b7f | ||
| a8e170ea45 | |||
| 1856ae50fd | |||
| 1711e6c115 | |||
|
|
b3f226feab | ||
| c086dc8c77 | |||
| 6762341fbd | |||
| d5f8b0f23b | |||
|
|
38233110f2 | ||
| 6ebb59bc5e | |||
| 69aefab280 | |||
| 3d3ff82e24 | |||
| 69780d204f | |||
|
|
ef52f290fe | ||
| e9d1119777 | |||
|
|
cf182f0e34 | ||
|
|
626ae1a459 | ||
| 3d6977328f | |||
| 2dcd7ba1d5 | |||
|
|
16a4d38113 | ||
| 57c98ea39d | |||
| 08f7e35042 | |||
| 43f3d1ba94 | |||
| 2e45c6c029 | |||
| 945182c6f8 | |||
|
|
f7de87860b | ||
| 67e4de0d68 | |||
|
|
602d521424 | ||
|
|
01e14ee084 | ||
|
|
4a5572de26 | ||
| 88a516d1be | |||
| 9ce967002a | |||
| fd536a035e | |||
| df84a7eefa | |||
| 2804703eaa | |||
| e14a0e3d13 | |||
| 5a99fe8234 | |||
| 3ad5c5533f | |||
|
|
9997f4f7c9 | ||
|
|
3d4e4a8119 | ||
|
|
3deac74898 | ||
| 7bbc50ef47 | |||
| 4ae6765a15 | |||
| 1292853c5d | |||
|
|
41791c9ccc | ||
|
|
0674215b53 | ||
| e42d990304 | |||
| 0dbe9a57c8 | |||
| 85ea831a1c | |||
| 7ac26cf781 | |||
| b7412648b4 | |||
|
|
97571652e5 | ||
| b5d4da97f9 | |||
|
|
e5edb6bda2 | ||
|
|
0e1ae53194 | ||
| a1efd3f91b | |||
| 3211553d0d | |||
| a57a326b83 | |||
| f77d0a2567 | |||
| 72581466aa | |||
|
|
4b3471df06 | ||
|
|
68c65ae8bd | ||
| 1b879addc7 | |||
|
|
3888859b2b | ||
|
|
f03d2e1633 | ||
| bc91eb7cdc | |||
|
|
93120e973a | ||
| c6a27f6276 | |||
| 778704c9dc | |||
| ff227b40c1 | |||
| c7d8ab5b48 | |||
| 9c27b2a134 | |||
|
|
3f919188d2 | ||
| 8942058972 | |||
|
|
6c2dbf0418 | ||
|
|
85e185bab8 | ||
|
|
88aa1517ef | ||
|
|
c05118c427 | ||
|
|
2a7f1326b9 | ||
|
|
c07255fe5b | ||
|
|
749bfc89dd | ||
| 52cc5e3aae | |||
| 642c4a0941 | |||
| 30953d5771 | |||
| 83e0c663c9 | |||
| b19337e76a | |||
| ba607346bd | |||
|
|
433c452a40 | ||
|
|
a1be7fdbfd | ||
|
|
87409d0c93 | ||
| d5c8ae8d45 | |||
| bc45e9c8c6 | |||
|
|
42992382c0 | ||
|
|
22d7eba510 | ||
| 9728c8a6dd | |||
| c951144ac6 | |||
|
|
0b179fffd6 | ||
|
|
75374ac5d3 | ||
|
|
2a83719b87 | ||
|
|
e58f2d807b | ||
|
|
b2884def17 | ||
|
|
064840dd42 | ||
| 1aa814c766 | |||
|
|
b9719a51d1 | ||
|
|
03b83aaf7c | ||
|
|
d93976483b | ||
| dd0a3a915c | |||
| 2f3994c575 | |||
| daa78e128f | |||
| 2ca594cb39 | |||
|
|
7805c26f4a | ||
|
|
b7d34537c2 | ||
| c1213fcf59 | |||
| a64edace55 | |||
| 4afe0d107c | |||
|
|
d8af11412f | ||
|
|
00816c9834 | ||
|
|
4fb7bea80a | ||
|
|
0fc72cb270 | ||
|
|
eadf521903 | ||
| f786fdbc3f | |||
| 92c4c938a3 | |||
|
|
a94a1b7b69 | ||
|
|
48755c2d9e | ||
|
|
f99f8eb560 | ||
|
|
ddc7ce2fe7 | ||
|
|
c9899c62d2 | ||
| 8b9837d7dc | |||
| 2cba41331a | |||
| 4da5ca427b | |||
| f4605b1af7 | |||
|
|
d2babdc9ed | ||
| 4d0599eac1 | |||
|
|
35d99df274 | ||
|
|
ce76b2f98d | ||
| 8fbca1a898 | |||
| d548215123 | |||
| 953d17dc8c | |||
|
|
b71a21ea5c | ||
|
|
0a20b5e34e | ||
| 388425084e | |||
| 51ee8d1b43 | |||
|
|
d29d56e712 | ||
|
|
9084ddaa98 | ||
|
|
be6d5c1ccc | ||
| 1bba9e598a | |||
| d58a5e8ab3 | |||
| e6ffb7101f | |||
|
|
48b2188cf9 | ||
|
|
8bc5d45976 | ||
| 04f6e7e960 | |||
| 8fb58bdab8 | |||
|
|
fdfe5334a1 | ||
|
|
66b99009e6 | ||
|
|
2c7456531d |
76
.github/copilot-instructions.md
vendored
Normal file
76
.github/copilot-instructions.md
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
# OpenHIS — AI 编码助手 指南
|
||||
|
||||
目的:帮助自动化/AI 编码代理快速上手本仓库,包含架构要点、关键文件、常用构建/运行命令以及项目约定。请只按照仓库内真实可见的内容提出修改建议或补充说明。
|
||||
|
||||
- **代码组织**: 本项目是一个 Java 后端(多模块 Maven)+ Vue3 前端(Vite)的大型应用。
|
||||
- 后端主模块目录:`openhis-server-new/`(顶层为 `pom`,包含多个子模块)。关键子模块示例:`openhis-application`, `openhis-domain`, `openhis-common`, `core-*` 系列。
|
||||
- 前端目录:`openhis-ui-vue3/`(Vite + Vue 3,使用 Pinia、Element Plus 等)。
|
||||
|
||||
- **大局观(Big Picture)**: 后端以 Spring Boot(Java 17)实现,使用多模块 Maven 管理公共库与业务模块;前端由单独仓库目录通过 Vite 构建并以环境变量(`VITE_APP_BASE_API`)与后端交互。后端扫描 `com.core` 与 `com.openhis` 包(见 `OpenHisApplication.java`),启动类位于:`openhis-server-new/openhis-application/src/main/java/com/openhis/OpenHisApplication.java`。
|
||||
|
||||
- **运行/构建(Windows PowerShell 示例)**:
|
||||
- 构建后端(从仓库根执行):
|
||||
|
||||
```powershell
|
||||
cd openhis-server-new
|
||||
mvn clean package -DskipTests
|
||||
```
|
||||
|
||||
- 仅运行后端模块(开发时常用):
|
||||
|
||||
```powershell
|
||||
cd openhis-server-new/openhis-application
|
||||
mvn spring-boot:run
|
||||
# 或在 IDE 中运行 `com.openhis.OpenHisApplication` 的 main()
|
||||
```
|
||||
|
||||
- 前端启动与构建(需要 Node.js v16.x,仓库 README 建议 v16.15):
|
||||
|
||||
```powershell
|
||||
cd openhis-ui-vue3
|
||||
npm install
|
||||
npm run dev # 本地开发(热重载)
|
||||
npm run build:prod # 生产构建
|
||||
```
|
||||
|
||||
- **环境与配置**:
|
||||
- 后端配置:`openhis-server-new/openhis-application/src/main/resources/application.yml`(数据库、端口、profile 等)。README 还提及 `application-druid.yml`(若存在请优先查看)。
|
||||
- 前端配置:多个 `.env.*` 文件(例如 `.env.development`, `.env.staging`, `.env.production`),关键变量:`VITE_APP_BASE_API`(例如 `/dev-api`),前端通过 `import.meta.env.VITE_APP_BASE_API` 拼接后端 URL(见 `src/utils/request.js`、多个视图与组件)。
|
||||
|
||||
- **重要约定 / 模式**:
|
||||
- 后端采用 Java 17、Spring Boot 2.5.x 家族,父 POM在 `openhis-server-new/pom.xml` 定义。常用依赖版本在该 POM 的 `<properties>` 中集中维护。
|
||||
- 模块间以 Maven 模块依赖与 `com.core` / `com.openhis` 包名分层(见 `pom.xml` 的 `<modules>` 与 `dependencyManagement`)。
|
||||
- 前端通过 Vite 插件配置(`openhis-ui-vue3/vite/plugins`)管理 svg、自动导入等。UI 框架为 Element Plus,状态管理为 Pinia。
|
||||
|
||||
- **集成点 & 外部依赖**:
|
||||
- 数据库:PostgreSQL(README 建议 v16.2),仓库根含一个大型初始化 SQL:`数据库初始话脚本(请使用navicat16版本导入).sql`,用于初始化表与演示数据。
|
||||
- 缓存/会话:Redis(需自行配置)。
|
||||
- 其他:Flowable(工作流),Druid(连接池监控),第三方服务通过特定配置类(例如 `YbServiceConfig` 在 `OpenHisApplication` 中启用)。
|
||||
|
||||
- **调试与常见位置**:
|
||||
- 启动类:`openhis-server-new/openhis-application/src/main/java/com/openhis/OpenHisApplication.java`。
|
||||
- 全局配置:`openhis-server-new/openhis-application/src/main/resources/`(`application.yml`、profile 文件等)。
|
||||
- 前端入口:`openhis-ui-vue3/src/main.js`、路由在 `openhis-ui-vue3/src/router/index.js`。
|
||||
- API 文档与监控路径(通常由后端暴露并被前端访问):
|
||||
- Swagger UI: `<VITE_APP_BASE_API>/swagger-ui/index.html`(前端视图在 `src/views/tool/swagger/index.vue`)。
|
||||
- Druid: `<VITE_APP_BASE_API>/druid/login.html`(见前端相关视图引用)。
|
||||
|
||||
- **为 AI 代理的具体建议(如何安全、有效地修改代码)**:
|
||||
- 修改后端时:优先在子模块(例如 `openhis-application`)本地运行 `mvn spring-boot:run` 验证启动与基础 API;大量改动前先执行 `mvn -T1C -DskipTests clean package` 在 CI 环境上验证构建(本地机器也可用)。
|
||||
- 修改前端时:检查/调整对应 `.env.*` 文件中的 `VITE_APP_BASE_API`,使用 `npm run dev` 本地联调后端接口(可通过代理或将 `VITE_APP_BASE_API` 指向后端地址)。
|
||||
- 修改数据库结构或 seed:请参考仓库根的 SQL 初始化脚本,任何 DDL/数据变更需同步该脚本并通知数据库管理员/运维。
|
||||
|
||||
- **举例(常见任务示例)**:
|
||||
- 本地联调前端 + 后端(PowerShell):
|
||||
|
||||
```powershell
|
||||
# 启动后端
|
||||
cd openhis-server-new/openhis-application
|
||||
mvn spring-boot:run
|
||||
|
||||
# 启动前端(另开终端)
|
||||
cd openhis-ui-vue3
|
||||
npm run dev
|
||||
```
|
||||
|
||||
如需我把这些内容合并为更短或更详细的版本,或把其中某部分(例如后端模块依赖关系图、关键 Java 包说明)展开,请告诉我要增强哪一节。
|
||||
7
.gitignore
vendored
7
.gitignore
vendored
@@ -57,4 +57,9 @@
|
||||
# 忽略设计书
|
||||
PostgreSQL/openHis_DB设计书.xlsx
|
||||
|
||||
public.sql
|
||||
public.sql
|
||||
发版记录/2025-11-12/~$发版日志.docx
|
||||
发版记录/2025-11-12/~$S-管理系统-调价管理.docx
|
||||
发版记录/2025-11-12/发版日志.docx
|
||||
.gitignore
|
||||
openhis-server-new/openhis-application/src/main/resources/application-dev.yml
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
|
||||

|
||||
|
||||
天天开源致⼒于打造中国应⽤管理软件开源⽣态,⾯向医疗、企业、教育三⼤⾏业信息化需求,提供优质的开源软件产品与解决⽅案。平台现已发布OpenHIS、OpenCOM、OpenEDU系列开源产品,并持续招募⽣态合作伙伴,期待共同构建开源创新的⾏业协作模式,加速⾏业的数字化进程。
|
||||
天天开源致⼒于打造中国应⽤管理 软件开源⽣态,⾯向医疗、企业、教育三⼤⾏业信息化需求,提供优质的开源软件产品与解决⽅案。平台现已发布OpenHIS、OpenCOM、OpenEDU系列开源产品,并持续招募⽣态合作伙伴,期待共同构建开源创新的⾏业协作模式,加速⾏业的数字化进程。
|
||||
|
||||
天天开源的前⾝是新致开源,最早于2022年6⽉发布开源医疗软件平台OpenHIS.org.cn,于2023年6⽉发布开源企业软件平台OpenCOM.com.cn。2025年7⽉,新致开源品牌更新为天天开源,我们始终秉持开源、专业、协作的理念,致⼒于为医疗、教育、中⼩企业等⾏业提供优质的开源解决⽅案。
|
||||
|
||||
了解我们:https://open.tntlinking.com/about?site=gitee
|
||||
了解我们a:https://open.tntlinking.com/about?site=gitee
|
||||
|
||||
## 💾【部署包下载】
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
|
||||
## 📚【支持文档】
|
||||
|
||||
技术支持资源:https://open.tntlinking.com/resource/technicalSupport?site=gitee
|
||||
技术支持资源:https://open.tntlinking.com/resource/openProductDoc?site=gitee
|
||||
(含演示环境、操作手册、部署手册、开发手册、常见问题等)
|
||||
|
||||
产品介绍:https://open.tntlinking.com/resource/industryKnowledge?site=gitee
|
||||
产品介绍:https://open.tntlinking.com/resource/productPresentation?site=gitee
|
||||
|
||||
操作教程:https://open.tntlinking.com/resource/operationTutorial?site=gitee
|
||||
|
||||
|
||||
39
TestDeleteInspectionType.java
Normal file
39
TestDeleteInspectionType.java
Normal file
@@ -0,0 +1,39 @@
|
||||
import java.io.IOException;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.util.Scanner;
|
||||
|
||||
public class TestDeleteInspectionType {
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
// 测试删除ID为1的检验类型
|
||||
long inspectionTypeId = 1;
|
||||
URL url = new URL("http://localhost:8080/system/inspection-type/" + inspectionTypeId);
|
||||
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
|
||||
connection.setRequestMethod("DELETE");
|
||||
connection.setRequestProperty("Content-Type", "application/json");
|
||||
connection.setRequestProperty("Accept", "application/json");
|
||||
|
||||
// 发送请求
|
||||
int responseCode = connection.getResponseCode();
|
||||
System.out.println("响应代码: " + responseCode);
|
||||
|
||||
// 读取响应
|
||||
Scanner scanner;
|
||||
if (responseCode >= 200 && responseCode < 300) {
|
||||
scanner = new Scanner(connection.getInputStream());
|
||||
} else {
|
||||
scanner = new Scanner(connection.getErrorStream());
|
||||
}
|
||||
|
||||
String response = scanner.useDelimiter("\\A").next();
|
||||
System.out.println("响应内容: " + response);
|
||||
|
||||
scanner.close();
|
||||
connection.disconnect();
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
45
openhis-server-new/com/openhis/tool/DatabaseFieldAdder.java
Normal file
45
openhis-server-new/com/openhis/tool/DatabaseFieldAdder.java
Normal file
@@ -0,0 +1,45 @@
|
||||
package com.openhis.tool;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.Statement;
|
||||
|
||||
/**
|
||||
* Database field adder tool
|
||||
*/
|
||||
public class DatabaseFieldAdder {
|
||||
public static void main(String[] args) {
|
||||
String url = "jdbc:postgresql://192.168.110.252:15432/postgresql?currentSchema=public";
|
||||
String username = "postgresql";
|
||||
String password = "Jchl1528";
|
||||
|
||||
try (Connection conn = DriverManager.getConnection(url, username, password);
|
||||
Statement stmt = conn.createStatement()) {
|
||||
|
||||
// Check if field exists
|
||||
String checkSql = "SELECT column_name FROM information_schema.columns " +
|
||||
"WHERE table_name = 'adm_healthcare_service' AND column_name = 'practitioner_id'";
|
||||
|
||||
boolean fieldExists = stmt.executeQuery(checkSql).next();
|
||||
|
||||
if (!fieldExists) {
|
||||
// Add field
|
||||
String addSql = "ALTER TABLE \"public\".\"adm_healthcare_service\" " +
|
||||
"ADD COLUMN \"practitioner_id\" int8";
|
||||
stmt.execute(addSql);
|
||||
|
||||
// Add comment
|
||||
String commentSql = "COMMENT ON COLUMN \"public\".\"adm_healthcare_service\".\"practitioner_id\" IS 'practitioner_id'";
|
||||
stmt.execute(commentSql);
|
||||
|
||||
System.out.println("Successfully added practitioner_id field to adm_healthcare_service table");
|
||||
} else {
|
||||
System.out.println("practitioner_id field already exists");
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
System.err.println("Error executing SQL: " + e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -25,6 +25,11 @@
|
||||
<artifactId>spring-boot-devtools</artifactId>
|
||||
<optional>true</optional> <!-- 表示依赖不会传递 -->
|
||||
</dependency>
|
||||
<!-- lombok -->
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- swagger3-->
|
||||
<dependency>
|
||||
@@ -68,45 +73,13 @@
|
||||
<groupId>com.core</groupId>
|
||||
<artifactId>core-flowable</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 通用工具-->
|
||||
<dependency>
|
||||
<groupId>com.core</groupId>
|
||||
<artifactId>core-common</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<!-- <build>-->
|
||||
<!-- <plugins>-->
|
||||
<!-- <plugin>-->
|
||||
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||
<!-- <artifactId>spring-boot-maven-plugin</artifactId>-->
|
||||
<!-- <version>2.5.15</version>-->
|
||||
<!-- <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>3.1.0</version>-->
|
||||
<!-- <configuration>-->
|
||||
<!-- <failOnMissingWebXml>false</failOnMissingWebXml>-->
|
||||
<!-- <warName>${project.artifactId}</warName>-->
|
||||
<!-- </configuration>-->
|
||||
<!-- </plugin>-->
|
||||
<!-- <plugin>-->
|
||||
<!-- <groupId>org.apache.maven.plugins</groupId>-->
|
||||
<!-- <artifactId>maven-compiler-plugin</artifactId>-->
|
||||
<!-- <configuration>-->
|
||||
<!-- <source>8</source>-->
|
||||
<!-- <target>8</target>-->
|
||||
<!-- </configuration>-->
|
||||
<!-- </plugin>-->
|
||||
<!-- </plugins>-->
|
||||
<!-- <finalName>${project.artifactId}</finalName>-->
|
||||
<!-- </build>-->
|
||||
|
||||
|
||||
</project>
|
||||
@@ -62,11 +62,12 @@ public class SysDictDataController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据字典类型查询字典数据信息
|
||||
* 根据字典类型查询字典数据信息(支持拼音搜索)
|
||||
*/
|
||||
@GetMapping(value = "/type/{dictType}")
|
||||
public AjaxResult dictType(@PathVariable String dictType) {
|
||||
List<SysDictData> data = dictTypeService.selectDictDataByType(dictType);
|
||||
public AjaxResult dictType(@PathVariable String dictType,
|
||||
@RequestParam(value = "searchKey", required = false) String searchKey) {
|
||||
List<SysDictData> data = dictTypeService.selectDictDataByType(dictType, searchKey);
|
||||
if (StringUtils.isNull(data)) {
|
||||
data = new ArrayList<SysDictData>();
|
||||
}
|
||||
|
||||
@@ -144,6 +144,11 @@
|
||||
<artifactId>gson</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -53,6 +53,9 @@ public class SysDictData extends BaseEntity {
|
||||
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
|
||||
/** 拼音首字母 */
|
||||
private String pyStr;
|
||||
|
||||
public Long getDictCode() {
|
||||
return dictCode;
|
||||
}
|
||||
@@ -136,13 +139,21 @@ public class SysDictData extends BaseEntity {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getPyStr() {
|
||||
return pyStr;
|
||||
}
|
||||
|
||||
public void setPyStr(String pyStr) {
|
||||
this.pyStr = pyStr;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("dictCode", getDictCode())
|
||||
.append("dictSort", getDictSort()).append("dictLabel", getDictLabel()).append("dictValue", getDictValue())
|
||||
.append("dictType", getDictType()).append("cssClass", getCssClass()).append("listClass", getListClass())
|
||||
.append("isDefault", getIsDefault()).append("status", getStatus()).append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime()).append("updateBy", getUpdateBy())
|
||||
.append("isDefault", getIsDefault()).append("status", getStatus()).append("pyStr", getPyStr())
|
||||
.append("createBy", getCreateBy()).append("createTime", getCreateTime()).append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime()).append("remark", getRemark()).toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@ public enum TenantOptionDict {
|
||||
* 医院名称
|
||||
*/
|
||||
YB_HOSPITAL_NAME("hospitalName", "医保-医院名称", 0),
|
||||
|
||||
/**
|
||||
* 医保-医疗机构等级(3101接口)
|
||||
*/
|
||||
@@ -24,37 +23,30 @@ public enum TenantOptionDict {
|
||||
* 电子发票appid
|
||||
*/
|
||||
EINVOICE_APP_ID("app_id", "电子发票-appid", 3),
|
||||
|
||||
/**
|
||||
* 电子发票key
|
||||
*/
|
||||
EINVOICE_KEY("key", "电子发票-key", 4),
|
||||
|
||||
/**
|
||||
* 电子发票url
|
||||
*/
|
||||
EINVOICE_URL("url", "电子发票-url", 5),
|
||||
|
||||
/**
|
||||
* 医保开关
|
||||
*/
|
||||
YB_SWITCH("yb_switch", "医保开关", 6),
|
||||
|
||||
/**
|
||||
* 电子地址
|
||||
*/
|
||||
ELE_ADDRESS("eleAddress", "电子处方-请求地址", 22),
|
||||
|
||||
/**
|
||||
* 服务地址
|
||||
*/
|
||||
ADDRESS("address", "服务地址", 23),
|
||||
|
||||
/**
|
||||
* 超时时间
|
||||
*/
|
||||
TIME("time", "超时时间", 24),
|
||||
|
||||
/**
|
||||
* 是否加密
|
||||
*/
|
||||
@@ -63,32 +55,26 @@ public enum TenantOptionDict {
|
||||
* 医保区划
|
||||
*/
|
||||
YB_INSUPLC_ADMDVS("insuplc_admdvs", "医保-区划", 26),
|
||||
|
||||
/**
|
||||
* 电子处方appId
|
||||
*/
|
||||
ELE_PRE_APP_ID("pre_app_id", "电子处方-appId", 27),
|
||||
|
||||
/**
|
||||
* 电子处方appSecret
|
||||
*/
|
||||
ELE_PRE_APP_SECRET("pre_app_secret", "电子处方-appSecret", 28),
|
||||
|
||||
/**
|
||||
* 电子处方私钥
|
||||
*/
|
||||
ELE_APP_PRVKEY("APP_PRVKEY", "电子处方-私钥", 29),
|
||||
|
||||
/**
|
||||
* 电子处方公钥
|
||||
*/
|
||||
ELE_PLAF_PUBKEY("PLAF_PUBKEY", "电子处方-公钥", 30),
|
||||
|
||||
/**
|
||||
* 医院等级
|
||||
*/
|
||||
EINVOICE_HOSPITAL_LV("hospital_lv", "电子发票-医院等级", 39),
|
||||
|
||||
/**
|
||||
* 无视LIS&PACS报错
|
||||
*/
|
||||
@@ -161,12 +147,10 @@ public enum TenantOptionDict {
|
||||
* 电子发票开关
|
||||
*/
|
||||
INVOICE_SWITCH("invoiceSwitch", "电子发票开关", 56),
|
||||
|
||||
/**
|
||||
* 医嘱定价来源
|
||||
*/
|
||||
ORDER_PRICING_SOURCE("orderPricingSource", "定价来源 batchSellingPrice/retailPrice", 57),
|
||||
|
||||
/**
|
||||
* 三方支付(签到)
|
||||
*/
|
||||
@@ -199,7 +183,6 @@ public enum TenantOptionDict {
|
||||
* 三方支付(消费)
|
||||
*/
|
||||
THREE_PART_PAY_MAPPING_METHOD("threePartPayMappingMethod", "三方支付【消费】请求方式", 65),
|
||||
|
||||
/**
|
||||
* 三方支付(退费)
|
||||
*/
|
||||
@@ -216,7 +199,6 @@ public enum TenantOptionDict {
|
||||
* 三方支付(退费)
|
||||
*/
|
||||
THREE_PART_RETURN_MAPPING_METHOD("threePartReturnMappingMethod", "三方支付【退费】请求方式", 69),
|
||||
|
||||
/**
|
||||
* 三方支付(隔天退费)
|
||||
*/
|
||||
@@ -233,7 +215,6 @@ public enum TenantOptionDict {
|
||||
* 三方支付(隔天退费)
|
||||
*/
|
||||
THREE_PART_NEXT_DAY_RETURN_MAPPING_METHOD("threePartNextDayReturnMappingMethod", "三方支付【隔天退费】请求方式", 73),
|
||||
|
||||
/**
|
||||
* 三方支付路径(支付结果查询)
|
||||
*/
|
||||
@@ -250,7 +231,6 @@ public enum TenantOptionDict {
|
||||
* 三方支付(支付结果查询)
|
||||
*/
|
||||
THREE_PART_PAY_QUERY_MAPPING_METHOD("threePartPayQueryMappingMethod", "三方支付【支付结果查询】请求方式", 77),
|
||||
|
||||
/**
|
||||
* 三方支付路径(退费结果查询)
|
||||
*/
|
||||
@@ -267,7 +247,6 @@ public enum TenantOptionDict {
|
||||
* 三方支付(退费结果查询)
|
||||
*/
|
||||
THREE_PART_RETURN_QUERY_MAPPING_METHOD("threePartReturnQueryMappingMethod", "三方支付【退费结果查询】请求方式", 81),
|
||||
|
||||
/**
|
||||
* 三方支付路径(隔天退费结果查询)
|
||||
*/
|
||||
@@ -284,8 +263,7 @@ public enum TenantOptionDict {
|
||||
* 三方支付(隔天退费结果查询)
|
||||
*/
|
||||
THREE_PART_NEXT_DAY_RETURN_QUERY_MAPPING_METHOD("threePartNextDayReturnQueryMappingMethod", "三方支付【隔天退费结果查询】请求方式",
|
||||
85),
|
||||
|
||||
85),
|
||||
/**
|
||||
* 三方支付(签出)
|
||||
*/
|
||||
@@ -302,27 +280,22 @@ public enum TenantOptionDict {
|
||||
* 三方支付(签出)
|
||||
*/
|
||||
THREE_PART_SIGN_OUT_MAPPING_METHOD("threePartSignOutMappingMethod", "三方支付【签出】请求方式", 89),
|
||||
|
||||
/**
|
||||
* 三方支付(签出)
|
||||
*/
|
||||
YB_INPATIENT_SETTLEMENT_UP_URL("ybInpatientSetlUp", "选填4101或4101A", 90),
|
||||
|
||||
/**
|
||||
* PACS查看报告地址
|
||||
*/
|
||||
PACS_REPORT_URL("pacsReportUrl", "PACS查看报告地址", 91),
|
||||
|
||||
/**
|
||||
* LIS查看报告地址
|
||||
*/
|
||||
LIS_REPORT_URL("lisReportUrl", "LIS查看报告地址", 92),
|
||||
|
||||
/**
|
||||
* 开药时药房允许多选开关
|
||||
*/
|
||||
PHARMACY_MULTIPLE_CHOICE_SWITCH("pharmacyMultipleChoiceSwitch", "开药时药房允许多选开关", 93),
|
||||
|
||||
/**
|
||||
* PEIS服务地址
|
||||
*/
|
||||
|
||||
@@ -37,6 +37,10 @@ public final class AgeCalculatorUtil {
|
||||
* 当前年龄取得(床位列表表示年龄用)
|
||||
*/
|
||||
public static String getAge(Date date) {
|
||||
// 添加空值检查
|
||||
if (date == null) {
|
||||
return "";
|
||||
}
|
||||
// 将 Date 转换为 LocalDateTime
|
||||
LocalDateTime dateTime = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
|
||||
@@ -22,10 +22,11 @@ import com.core.common.utils.StringUtils;
|
||||
*/
|
||||
@Configuration
|
||||
public class FilterConfig {
|
||||
@Value("${xss.excludes}")
|
||||
// 添加默认值,避免配置不存在时启动失败
|
||||
@Value("${xss.excludes:/system/notice}")
|
||||
private String excludes;
|
||||
|
||||
@Value("${xss.urlPatterns}")
|
||||
@Value("${xss.urlPatterns:/system/*,/monitor/*,/tool/*}")
|
||||
private String urlPatterns;
|
||||
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
|
||||
@@ -54,6 +54,12 @@ public class UserDetailsServiceImpl implements UserDetailsService {
|
||||
}
|
||||
|
||||
public UserDetails createLoginUser(SysUser user) {
|
||||
return new LoginUser(user.getUserId(), user.getDeptId(), user, permissionService.getMenuPermission(user));
|
||||
LoginUser loginUser = new LoginUser(user.getUserId(), user.getDeptId(), user, permissionService.getMenuPermission(user));
|
||||
// 设置所属医院ID
|
||||
loginUser.setOrgId(user.getOrgId());
|
||||
if (user.getOrgId() != null) {
|
||||
loginUser.setHospitalId(userService.getHospitalIdByOrgId(user.getOrgId()));
|
||||
}
|
||||
return loginUser;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,6 +58,7 @@ public class GenController extends BaseController {
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo genList(GenTable genTable) {
|
||||
startPage();
|
||||
|
||||
List<GenTable> list = genTableService.selectGenTableList(genTable);
|
||||
return getDataTable(list);
|
||||
}
|
||||
@@ -251,12 +252,10 @@ public class GenController extends BaseController {
|
||||
InputStream is = file.getInputStream();
|
||||
Workbook wb = WorkbookFactory.create(is);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
// 遍历每个sheet页(每个表)
|
||||
for (int i = 0; i < wb.getNumberOfSheets(); i++) {
|
||||
sb.append("-- ----------------------------------------------------------------------------------\n");
|
||||
Sheet st = wb.getSheetAt(i);
|
||||
|
||||
// 从第一行读取表名表注释
|
||||
Row row0 = st.getRow(0);// 表名
|
||||
String tableName = row0.getCell(4).toString();// 表名
|
||||
|
||||
@@ -23,11 +23,12 @@
|
||||
<groupId>com.core</groupId>
|
||||
<artifactId>core-common</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-annotations</artifactId>
|
||||
@@ -39,6 +40,11 @@
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
@@ -66,4 +66,6 @@ public class SysTenantOption implements Serializable {
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -28,6 +28,18 @@ public interface SysDictDataMapper {
|
||||
*/
|
||||
public List<SysDictData> selectDictDataByType(String dictType);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据字典类型和搜索关键字查询字典数据(支持拼音搜索)
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @param searchKey 搜索关键字(支持名称和拼音首字母搜索)
|
||||
* @return 字典数据集合信息
|
||||
*/
|
||||
public List<SysDictData> selectDictDataByTypeWithSearch(@Param("dictType") String dictType, @Param("searchKey") String searchKey);
|
||||
|
||||
|
||||
/**
|
||||
* 根据字典类型和字典键值查询字典数据信息
|
||||
*
|
||||
|
||||
@@ -84,6 +84,14 @@ public interface SysMenuMapper {
|
||||
*/
|
||||
public SysMenu selectMenuById(Long menuId);
|
||||
|
||||
/**
|
||||
* 根据路径Path查询信息
|
||||
*
|
||||
* @param path 路径
|
||||
* @return 菜单信息
|
||||
*/
|
||||
public SysMenu selectMenuByPath(String path);
|
||||
|
||||
/**
|
||||
* 是否存在菜单子节点
|
||||
*
|
||||
|
||||
@@ -34,6 +34,15 @@ public interface ISysDictTypeService {
|
||||
*/
|
||||
public List<SysDictData> selectDictDataByType(String dictType);
|
||||
|
||||
/**
|
||||
* 根据字典类型和搜索关键字查询字典数据(支持拼音搜索)
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @param searchKey 搜索关键字(支持名称和拼音首字母搜索),可为null
|
||||
* @return 字典数据集合信息
|
||||
*/
|
||||
public List<SysDictData> selectDictDataByType(String dictType, String searchKey);
|
||||
|
||||
/**
|
||||
* 根据字典类型ID查询信息
|
||||
*
|
||||
|
||||
@@ -8,6 +8,7 @@ import org.springframework.stereotype.Service;
|
||||
import com.core.common.core.domain.entity.SysDictData;
|
||||
import com.core.common.utils.DictUtils;
|
||||
import com.core.system.mapper.SysDictDataMapper;
|
||||
import com.core.common.utils.ChineseConvertUtils;
|
||||
import com.core.system.service.ISysDictDataService;
|
||||
|
||||
/**
|
||||
@@ -88,6 +89,10 @@ public class SysDictDataServiceImpl implements ISysDictDataService {
|
||||
*/
|
||||
@Override
|
||||
public int insertDictData(SysDictData data) {
|
||||
// 自动计算拼音首字母
|
||||
if (data.getDictLabel() != null && !data.getDictLabel().isEmpty()) {
|
||||
data.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(data.getDictLabel()));
|
||||
}
|
||||
int row = dictDataMapper.insertDictData(data);
|
||||
if (row > 0) {
|
||||
List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(data.getDictType());
|
||||
@@ -104,6 +109,10 @@ public class SysDictDataServiceImpl implements ISysDictDataService {
|
||||
*/
|
||||
@Override
|
||||
public int updateDictData(SysDictData data) {
|
||||
// 如果字典标签有变化,重新计算拼音首字母
|
||||
if (data.getDictLabel() != null && !data.getDictLabel().isEmpty()) {
|
||||
data.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(data.getDictLabel()));
|
||||
}
|
||||
int row = dictDataMapper.updateDictData(data);
|
||||
if (row > 0) {
|
||||
List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(data.getDictType());
|
||||
|
||||
@@ -71,6 +71,24 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService {
|
||||
*/
|
||||
@Override
|
||||
public List<SysDictData> selectDictDataByType(String dictType) {
|
||||
return selectDictDataByType(dictType, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据字典类型和搜索关键字查询字典数据(支持拼音搜索)
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @param searchKey 搜索关键字(支持名称和拼音首字母搜索),可为null
|
||||
* @return 字典数据集合信息
|
||||
*/
|
||||
public List<SysDictData> selectDictDataByType(String dictType, String searchKey) {
|
||||
// 如果有搜索关键字,使用带搜索的SQL查询
|
||||
if (StringUtils.isNotEmpty(searchKey) && !searchKey.trim().isEmpty()) {
|
||||
String trimmedKey = searchKey.trim();
|
||||
return dictDataMapper.selectDictDataByTypeWithSearch(dictType, trimmedKey);
|
||||
}
|
||||
|
||||
// 否则使用原有方法(带缓存)
|
||||
List<SysDictData> dictDatas = DictUtils.getDictCache(dictType);
|
||||
if (StringUtils.isNotEmpty(dictDatas)) {
|
||||
return dictDatas;
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.core.system.service.impl;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -266,6 +267,11 @@ public class SysMenuServiceImpl implements ISysMenuService {
|
||||
*/
|
||||
@Override
|
||||
public int insertMenu(SysMenu menu) {
|
||||
//路径Path唯一性判断
|
||||
SysMenu sysMenu = menuMapper.selectMenuByPath(menu.getPath());
|
||||
if (sysMenu != null){
|
||||
return -1;
|
||||
}
|
||||
return menuMapper.insertMenu(menu);
|
||||
}
|
||||
|
||||
@@ -277,6 +283,16 @@ public class SysMenuServiceImpl implements ISysMenuService {
|
||||
*/
|
||||
@Override
|
||||
public int updateMenu(SysMenu menu) {
|
||||
//路径Path唯一性判断
|
||||
String path = menu.getPath();
|
||||
if (StringUtils.isNotBlank(path)) {
|
||||
SysMenu sysMenu = menuMapper.selectMenuByPath(menu.getPath());
|
||||
// 先判断sysMenu是否不为null,再比较menuId
|
||||
if (sysMenu != null && !menu.getMenuId().equals(sysMenu.getMenuId())) {
|
||||
return -1; // 路由地址已存在
|
||||
}
|
||||
}
|
||||
// 执行更新
|
||||
return menuMapper.updateMenu(menu);
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
<result property="listClass" column="list_class"/>
|
||||
<result property="isDefault" column="is_default"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="pyStr" column="py_str"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
@@ -30,6 +31,7 @@
|
||||
list_class,
|
||||
is_default,
|
||||
status,
|
||||
py_str,
|
||||
create_by,
|
||||
create_time,
|
||||
remark
|
||||
@@ -56,6 +58,19 @@
|
||||
<include refid="selectDictDataVo"/>
|
||||
where status = '0' and dict_type = #{dictType} order by dict_sort asc
|
||||
</select>
|
||||
<select id="selectDictDataByTypeWithSearch" resultMap="SysDictDataResult">
|
||||
<include refid="selectDictDataVo"/>
|
||||
where status = '0'
|
||||
and dict_type = #{dictType}
|
||||
<if test="searchKey != null and searchKey != ''">
|
||||
and (
|
||||
(dict_label is not null and dict_label like concat('%', #{searchKey}, '%'))
|
||||
or (py_str is not null and py_str like concat('%', #{searchKey}, '%'))
|
||||
)
|
||||
</if>
|
||||
order by dict_sort asc
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectDictLabel" resultType="String">
|
||||
select dict_label
|
||||
@@ -105,6 +120,7 @@
|
||||
<if test="listClass != null">list_class = #{listClass},</if>
|
||||
<if test="isDefault != null and isDefault != ''">is_default = #{isDefault},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="pyStr !=null">pyStr = #{pyStr}</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = now()
|
||||
@@ -128,6 +144,7 @@
|
||||
<if test="listClass != null and listClass != ''">list_class,</if>
|
||||
<if test="isDefault != null and isDefault != ''">is_default,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="pyStr !=null and pyStr !=null ''" >py_str,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
@@ -140,6 +157,7 @@
|
||||
<if test="listClass != null and listClass != ''">#{listClass},</if>
|
||||
<if test="isDefault != null and isDefault != ''">#{isDefault},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="pyStr !=null and pyStr !=''" >{pystr},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
now()
|
||||
|
||||
@@ -174,6 +174,11 @@
|
||||
and rm.role_id = #{roleId}
|
||||
</select>
|
||||
|
||||
<select id="selectMenuByPath" parameterType="String" resultMap="SysMenuResult">
|
||||
<include refid="selectMenuVo"/>
|
||||
where path = #{path}
|
||||
</select>
|
||||
|
||||
<select id="selectMenuById" parameterType="Long" resultMap="SysMenuResult">
|
||||
<include refid="selectMenuVo"/>
|
||||
where menu_id = #{menuId}
|
||||
|
||||
@@ -16,6 +16,18 @@
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- Spring 配置 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
@@ -54,10 +66,10 @@
|
||||
<artifactId>httpclient</artifactId>
|
||||
</dependency>
|
||||
<!-- rabbitMQ -->
|
||||
<dependency>
|
||||
<!-- <dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-amqp</artifactId>
|
||||
</dependency>
|
||||
</dependency> -->
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ import com.openhis.web.ybmanage.config.YbServiceConfig;
|
||||
/**
|
||||
* 启动程序
|
||||
*
|
||||
* @author system
|
||||
* @author system 1
|
||||
*/
|
||||
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}, scanBasePackages = {"com.core", "com.openhis"})
|
||||
@EnableConfigurationProperties(YbServiceConfig.class)
|
||||
|
||||
@@ -16,7 +16,7 @@ import org.springframework.stereotype.Component;
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = "http")
|
||||
@PropertySource(value = {"classpath:http.yml"})
|
||||
public class HttpConfig {
|
||||
public class HttpConfig {
|
||||
private String appId;
|
||||
private String key;
|
||||
private String url;
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.openhis.web.appointmentmanage.appservice;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.appointmentmanage.domain.ClinicRoom;
|
||||
|
||||
public interface IClinicRoomAppService {
|
||||
|
||||
/**
|
||||
* 分页查询诊室列表
|
||||
* @param pageNum 页码
|
||||
* @param pageSize 每页条数
|
||||
* @param orgName 卫生机构名称
|
||||
* @param roomName 诊室名称
|
||||
* @return 分页查询结果
|
||||
*/
|
||||
R<?> selectClinicRoomPage(Integer pageNum, Integer pageSize, String orgName, String roomName);
|
||||
|
||||
/**
|
||||
* 查询诊室详情
|
||||
* @param id 诊室ID
|
||||
* @return 诊室详情
|
||||
*/
|
||||
R<?> selectClinicRoomById(Long id);
|
||||
|
||||
/**
|
||||
* 新增诊室
|
||||
* @param clinicRoom 诊室信息
|
||||
* @return 新增结果
|
||||
*/
|
||||
R<?> insertClinicRoom(ClinicRoom clinicRoom);
|
||||
|
||||
/**
|
||||
* 更新诊室
|
||||
* @param clinicRoom 诊室信息
|
||||
* @return 更新结果
|
||||
*/
|
||||
R<?> updateClinicRoom(ClinicRoom clinicRoom);
|
||||
|
||||
/**
|
||||
* 删除诊室
|
||||
* @param id 诊室ID
|
||||
* @return 删除结果
|
||||
*/
|
||||
R<?> deleteClinicRoomById(Long id);
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.openhis.web.appointmentmanage.appservice;
|
||||
import com.core.common.core.domain.R;
|
||||
public interface IDeptAppService {
|
||||
|
||||
R<?> getDeptList();
|
||||
|
||||
R<?> searchDept(Integer pageNo, Integer pageSize, String orgName, String deptName);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.openhis.web.appointmentmanage.appservice;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.appointmentmanage.domain.DoctorSchedule;
|
||||
|
||||
public interface IDoctorScheduleAppService {
|
||||
|
||||
R<?> getDoctorScheduleList();
|
||||
|
||||
R<?> addDoctorSchedule(DoctorSchedule doctorSchedule);
|
||||
|
||||
R<?> removeDoctorSchedule(Integer doctorScheduleId);
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.openhis.web.appointmentmanage.appservice;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.appointmentmanage.dto.SchedulePoolDto;
|
||||
|
||||
public interface ISchedulePoolAppService {
|
||||
R<?> addSchedulePool(SchedulePoolDto schedulePoolDto);
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package com.openhis.web.appointmentmanage.appservice;
|
||||
|
||||
public interface IScheduleSlotAppService {
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
package com.openhis.web.appointmentmanage.appservice.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.appointmentmanage.domain.ClinicRoom;
|
||||
import com.openhis.appointmentmanage.service.IClinicRoomService;
|
||||
import com.openhis.web.appointmentmanage.appservice.IClinicRoomAppService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@Service
|
||||
public class ClinicRoomAppServiceImpl implements IClinicRoomAppService {
|
||||
|
||||
@Resource
|
||||
private IClinicRoomService clinicRoomService;
|
||||
|
||||
@Override
|
||||
public R<?> selectClinicRoomPage(Integer pageNum, Integer pageSize, String orgName, String roomName) {
|
||||
// 构建查询条件
|
||||
ClinicRoom clinicRoom = new ClinicRoom();
|
||||
if (orgName != null && ObjectUtil.isNotEmpty(orgName)) {
|
||||
clinicRoom.setOrgName(orgName);
|
||||
}
|
||||
if (roomName != null && ObjectUtil.isNotEmpty(roomName)) {
|
||||
clinicRoom.setRoomName(roomName);
|
||||
}
|
||||
|
||||
// 分页查询
|
||||
Page<ClinicRoom> page = new Page<>(pageNum, pageSize);
|
||||
Page<ClinicRoom> result = clinicRoomService.selectClinicRoomPage(page, clinicRoom);
|
||||
|
||||
return R.ok(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> selectClinicRoomById(Long id) {
|
||||
ClinicRoom clinicRoom = clinicRoomService.selectClinicRoomById(id);
|
||||
if (clinicRoom == null) {
|
||||
return R.fail(404, "诊室不存在");
|
||||
}
|
||||
return R.ok(clinicRoom);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> insertClinicRoom(ClinicRoom clinicRoom) {
|
||||
// 数据校验
|
||||
if (ObjectUtil.isEmpty(clinicRoom.getRoomName())) {
|
||||
return R.fail(400, "诊室名称不能为空");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(clinicRoom.getDepartment())) {
|
||||
return R.fail(400, "科室名称不能为空");
|
||||
}
|
||||
if (clinicRoom.getRoomName().length() > 50) {
|
||||
return R.fail(400, "诊室名称长度不能超过50个字符");
|
||||
}
|
||||
if (clinicRoom.getRemarks() != null && clinicRoom.getRemarks().length() > 500) {
|
||||
return R.fail(400, "备注长度不能超过500个字符");
|
||||
}
|
||||
|
||||
// 新增诊室
|
||||
int result = clinicRoomService.insertClinicRoom(clinicRoom);
|
||||
if (result > 0) {
|
||||
return R.ok(null, "新增成功");
|
||||
} else {
|
||||
return R.fail("新增失败");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> updateClinicRoom(ClinicRoom clinicRoom) {
|
||||
// 数据校验
|
||||
if (ObjectUtil.isEmpty(clinicRoom.getId())) {
|
||||
return R.fail(400, "诊室ID不能为空");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(clinicRoom.getRoomName())) {
|
||||
return R.fail(400, "诊室名称不能为空");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(clinicRoom.getDepartment())) {
|
||||
return R.fail(400, "科室名称不能为空");
|
||||
}
|
||||
if (clinicRoom.getRoomName().length() > 50) {
|
||||
return R.fail(400, "诊室名称长度不能超过50个字符");
|
||||
}
|
||||
if (clinicRoom.getRemarks() != null && clinicRoom.getRemarks().length() > 500) {
|
||||
return R.fail(400, "备注长度不能超过500个字符");
|
||||
}
|
||||
|
||||
// 检查诊室是否存在
|
||||
ClinicRoom existingClinicRoom = clinicRoomService.selectClinicRoomById(clinicRoom.getId());
|
||||
if (existingClinicRoom == null) {
|
||||
return R.fail(404, "诊室不存在");
|
||||
}
|
||||
|
||||
// 更新诊室
|
||||
int result = clinicRoomService.updateClinicRoom(clinicRoom);
|
||||
if (result > 0) {
|
||||
return R.ok(null, "修改成功");
|
||||
} else {
|
||||
return R.fail("修改失败");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> deleteClinicRoomById(Long id) {
|
||||
// 检查诊室是否存在
|
||||
ClinicRoom existingClinicRoom = clinicRoomService.selectClinicRoomById(id);
|
||||
if (existingClinicRoom == null) {
|
||||
return R.fail(404, "诊室不存在");
|
||||
}
|
||||
|
||||
// 删除诊室
|
||||
int result = clinicRoomService.deleteClinicRoomById(id);
|
||||
if (result > 0) {
|
||||
return R.ok(null, "删除成功");
|
||||
} else {
|
||||
return R.fail("删除失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.openhis.web.appointmentmanage.appservice.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.appointmentmanage.domain.Dept;
|
||||
import com.openhis.appointmentmanage.service.IDeptService;
|
||||
import com.openhis.web.appointmentmanage.appservice.IDeptAppService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class DeptAppServiceImpl implements IDeptAppService {
|
||||
|
||||
@Resource
|
||||
private IDeptService deptService;
|
||||
|
||||
@Override
|
||||
public R<?> getDeptList() {
|
||||
List<Dept> list = deptService.list();
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> searchDept(Integer pageNo, Integer pageSize, String orgName, String deptName) {
|
||||
LambdaQueryWrapper<Dept> wrapper = new LambdaQueryWrapper<>();
|
||||
if (orgName != null && ObjectUtil.isNotEmpty(orgName)) {
|
||||
wrapper.eq(Dept::getOrgName, orgName);
|
||||
}
|
||||
if (deptName != null && ObjectUtil.isNotEmpty(deptName)) {
|
||||
wrapper.eq(Dept::getDeptName, deptName);
|
||||
}
|
||||
List<Dept> list = deptService.list(wrapper);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.openhis.web.appointmentmanage.appservice.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.appointmentmanage.domain.DoctorSchedule;
|
||||
import com.openhis.appointmentmanage.mapper.DoctorScheduleMapper;
|
||||
import com.openhis.appointmentmanage.service.IDoctorScheduleService;
|
||||
import com.openhis.web.appointmentmanage.appservice.IDoctorScheduleAppService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class DoctorScheduleAppServiceImpl implements IDoctorScheduleAppService {
|
||||
@Resource
|
||||
private IDoctorScheduleService doctorScheduleService;
|
||||
|
||||
@Resource
|
||||
private DoctorScheduleMapper doctorScheduleMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public R<?> getDoctorScheduleList() {
|
||||
List<DoctorSchedule> list = doctorScheduleService.list();
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> addDoctorSchedule(DoctorSchedule doctorSchedule) {
|
||||
if (ObjectUtil.isEmpty(doctorSchedule)) {
|
||||
return R.fail("医生排班不能为空");
|
||||
}
|
||||
// 创建新对象,排除id字段(数据库id列是GENERATED ALWAYS,由数据库自动生成)
|
||||
DoctorSchedule newSchedule = new DoctorSchedule();
|
||||
newSchedule.setWeekday(doctorSchedule.getWeekday());
|
||||
newSchedule.setTimePeriod(doctorSchedule.getTimePeriod());
|
||||
newSchedule.setDoctor(doctorSchedule.getDoctor());
|
||||
newSchedule.setClinic(doctorSchedule.getClinic());
|
||||
newSchedule.setStartTime(doctorSchedule.getStartTime());
|
||||
newSchedule.setEndTime(doctorSchedule.getEndTime());
|
||||
newSchedule.setLimitNumber(doctorSchedule.getLimitNumber());
|
||||
// call_sign_record 字段不能为null,设置默认值为空字符串
|
||||
newSchedule.setCallSignRecord(doctorSchedule.getCallSignRecord() != null ? doctorSchedule.getCallSignRecord() : "");
|
||||
newSchedule.setRegisterItem(doctorSchedule.getRegisterItem() != null ? doctorSchedule.getRegisterItem() : "");
|
||||
newSchedule.setRegisterFee(doctorSchedule.getRegisterFee() != null ? doctorSchedule.getRegisterFee() : 0);
|
||||
newSchedule.setDiagnosisItem(doctorSchedule.getDiagnosisItem() != null ? doctorSchedule.getDiagnosisItem() : "");
|
||||
newSchedule.setDiagnosisFee(doctorSchedule.getDiagnosisFee() != null ? doctorSchedule.getDiagnosisFee() : 0);
|
||||
newSchedule.setIsOnline(doctorSchedule.getIsOnline() != null ? doctorSchedule.getIsOnline() : false);
|
||||
newSchedule.setIsStopped(doctorSchedule.getIsStopped() != null ? doctorSchedule.getIsStopped() : false);
|
||||
newSchedule.setStopReason(doctorSchedule.getStopReason() != null ? doctorSchedule.getStopReason() : "");
|
||||
newSchedule.setDeptId(doctorSchedule.getDeptId());
|
||||
// 不设置id字段,让数据库自动生成
|
||||
// 使用自定义的insertWithoutId方法,确保INSERT语句不包含id字段
|
||||
int result = doctorScheduleMapper.insertWithoutId(newSchedule);
|
||||
boolean save = result > 0;
|
||||
if (save) {
|
||||
// 返回保存后的实体对象,包含数据库生成的ID
|
||||
return R.ok(newSchedule);
|
||||
} else {
|
||||
return R.fail("保存失败");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> removeDoctorSchedule(Integer doctorScheduleId) {
|
||||
if (doctorScheduleId == null && ObjectUtil.isEmpty(doctorScheduleId)) {
|
||||
return R.fail("排班id不能为空");
|
||||
}
|
||||
boolean remove = doctorScheduleService.removeById(doctorScheduleId);
|
||||
return R.ok(remove);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.openhis.web.appointmentmanage.appservice.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.appointmentmanage.domain.SchedulePool;
|
||||
import com.openhis.appointmentmanage.service.ISchedulePoolService;
|
||||
import com.openhis.web.appointmentmanage.appservice.ISchedulePoolAppService;
|
||||
import com.openhis.web.appointmentmanage.dto.SchedulePoolDto;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@Service
|
||||
public class SchedulePoolAppServiceImpl implements ISchedulePoolAppService {
|
||||
|
||||
@Resource
|
||||
private ISchedulePoolService schedulePoolService;
|
||||
|
||||
@Override
|
||||
public R<?> addSchedulePool(SchedulePoolDto schedulePoolDto) {
|
||||
//1.数据检验
|
||||
if(ObjectUtil.isNull(schedulePoolDto)){
|
||||
return R.fail("号源不能为空");
|
||||
}
|
||||
//2.封装实体
|
||||
SchedulePool schedulePool = new SchedulePool();
|
||||
schedulePool.setHospitalId(schedulePoolDto.getHospitalId());
|
||||
schedulePool.setDeptId(schedulePoolDto.getDeptId());
|
||||
schedulePool.setDoctorId(schedulePoolDto.getDoctorId());
|
||||
schedulePool.setDoctorName(schedulePoolDto.getDoctorName());
|
||||
schedulePool.setScheduleDate(schedulePoolDto.getScheduleDate());
|
||||
schedulePool.setShift(schedulePoolDto.getShift());
|
||||
schedulePool.setStartTime(schedulePoolDto.getStartTime());
|
||||
schedulePool.setEndTime(schedulePoolDto.getEndTime());
|
||||
|
||||
schedulePool.setRegType(schedulePoolDto.getRegType());
|
||||
schedulePool.setFee(schedulePoolDto.getFee());
|
||||
//3.保存
|
||||
boolean save = schedulePoolService.save(schedulePool);
|
||||
return R.ok(save);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.openhis.web.appointmentmanage.appservice.impl;
|
||||
|
||||
import com.openhis.web.appointmentmanage.appservice.IScheduleSlotAppService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class ScheduleSlotAppServiceImpl implements IScheduleSlotAppService {
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.openhis.web.appointmentmanage.controller;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.appointmentmanage.domain.ClinicRoom;
|
||||
import com.openhis.web.appointmentmanage.appservice.IClinicRoomAppService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/appoinment/clinic-room")
|
||||
public class ClinicRoomController {
|
||||
|
||||
@Resource
|
||||
private IClinicRoomAppService clinicRoomAppService;
|
||||
|
||||
/**
|
||||
* 分页查询诊室列表
|
||||
* @param pageNum 页码
|
||||
* @param pageSize 每页条数
|
||||
* @param orgName 卫生机构名称
|
||||
* @param roomName 诊室名称
|
||||
* @return 分页查询结果
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
public R<?> selectClinicRoomPage(
|
||||
@RequestParam(required = true) Integer pageNum,
|
||||
@RequestParam(required = true) Integer pageSize,
|
||||
@RequestParam(required = false) String orgName,
|
||||
@RequestParam(required = false) String roomName) {
|
||||
return clinicRoomAppService.selectClinicRoomPage(pageNum, pageSize, orgName, roomName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询诊室详情
|
||||
* @param id 诊室ID
|
||||
* @return 诊室详情
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public R<?> selectClinicRoomById(@PathVariable Long id) {
|
||||
return clinicRoomAppService.selectClinicRoomById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增诊室
|
||||
* @param clinicRoom 诊室信息
|
||||
* @return 新增结果
|
||||
*/
|
||||
@PostMapping
|
||||
public R<?> insertClinicRoom(@RequestBody ClinicRoom clinicRoom) {
|
||||
return clinicRoomAppService.insertClinicRoom(clinicRoom);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新诊室
|
||||
* @param clinicRoom 诊室信息
|
||||
* @return 更新结果
|
||||
*/
|
||||
@PutMapping
|
||||
public R<?> updateClinicRoom(@RequestBody ClinicRoom clinicRoom) {
|
||||
return clinicRoomAppService.updateClinicRoom(clinicRoom);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除诊室
|
||||
* @param id 诊室ID
|
||||
* @return 删除结果
|
||||
*/
|
||||
@DeleteMapping("/{id}")
|
||||
public R<?> deleteClinicRoomById(@PathVariable Long id) {
|
||||
return clinicRoomAppService.deleteClinicRoomById(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.openhis.web.appointmentmanage.controller;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.appointmentmanage.appservice.IDeptAppService;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/dept")
|
||||
public class DeptController {
|
||||
|
||||
@Resource
|
||||
private IDeptAppService deptAppService;
|
||||
|
||||
/*
|
||||
* 获取科室列表
|
||||
*
|
||||
* */
|
||||
@GetMapping("/list")
|
||||
public R<?> getDeptList(){
|
||||
return R.ok(deptAppService.getDeptList());
|
||||
}
|
||||
|
||||
/*
|
||||
* 查询科室
|
||||
*
|
||||
* */
|
||||
@GetMapping("/search")
|
||||
public R<?> searchDept(
|
||||
@RequestParam(required = false,defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(required = false,defaultValue = "10") Integer pageSize,
|
||||
@RequestParam(required = false)String orgName,
|
||||
@RequestParam(required = false)String deptName
|
||||
){
|
||||
return R.ok(deptAppService.searchDept(pageNo,pageSize,orgName,deptName));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.openhis.web.appointmentmanage.controller;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.appointmentmanage.domain.DoctorSchedule;
|
||||
import com.openhis.web.appointmentmanage.appservice.IDoctorScheduleAppService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/doctor-schedule")
|
||||
public class DoctorScheduleController {
|
||||
@Resource
|
||||
private IDoctorScheduleAppService doctorScheduleAppService;
|
||||
|
||||
/*
|
||||
* 获取医生排班List
|
||||
*
|
||||
* */
|
||||
@GetMapping("/list")
|
||||
public R<?> getDoctorScheduleList() {
|
||||
return R.ok(doctorScheduleAppService.getDoctorScheduleList());
|
||||
}
|
||||
|
||||
/*
|
||||
* 新增医生排班
|
||||
*
|
||||
* */
|
||||
@PostMapping("/add")
|
||||
public R<?> addDoctorSchedule(@RequestBody DoctorSchedule doctorSchedule) {
|
||||
return R.ok(doctorScheduleAppService.addDoctorSchedule(doctorSchedule));
|
||||
}
|
||||
|
||||
/*
|
||||
* 删除医生排班
|
||||
*
|
||||
* */
|
||||
@DeleteMapping("/delete/{doctorScheduleId}")
|
||||
public R<?> removeDoctorSchedule(@PathVariable Integer doctorScheduleId){
|
||||
return R.ok(doctorScheduleAppService.removeDoctorSchedule(doctorScheduleId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.openhis.web.appointmentmanage.controller;
|
||||
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.appointmentmanage.domain.SchedulePool;
|
||||
import com.openhis.web.appointmentmanage.appservice.ISchedulePoolAppService;
|
||||
import com.openhis.web.appointmentmanage.dto.SchedulePoolDto;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/schedule-pool")
|
||||
public class SchedulePoolController {
|
||||
@Resource
|
||||
private ISchedulePoolAppService schedulePoolAppService;
|
||||
|
||||
/*
|
||||
* 新增号源
|
||||
*
|
||||
* */
|
||||
public R<?> addSchedulePool(@RequestBody SchedulePoolDto schedulePoolDto) {
|
||||
return R.ok(schedulePoolAppService.addSchedulePool(schedulePoolDto));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.openhis.web.appointmentmanage.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/schedule-slot")
|
||||
public class ScheduleSlotController {
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.openhis.web.appointmentmanage.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
|
||||
/**
|
||||
* 号源池Dto
|
||||
*
|
||||
* @date 2025-12-12
|
||||
*/
|
||||
@Data
|
||||
public class SchedulePoolDto {
|
||||
/** id */
|
||||
private Integer id;
|
||||
|
||||
/** 业务编号 */
|
||||
private String poolCode;
|
||||
|
||||
/** 医院ID */
|
||||
private Integer hospitalId;
|
||||
|
||||
/** 科室ID */
|
||||
private Integer deptId;
|
||||
|
||||
/** 医生ID */
|
||||
private Integer doctorId;
|
||||
|
||||
/** 医生姓名 */
|
||||
private String doctorName;
|
||||
|
||||
/** 诊室 */
|
||||
private String clinicRoom;
|
||||
|
||||
/** 出诊日期 */
|
||||
private LocalDate scheduleDate;
|
||||
|
||||
/** 班别 */
|
||||
private String shift;
|
||||
|
||||
/** 开始时间 */
|
||||
private LocalTime startTime;
|
||||
|
||||
/** 结束时间 */
|
||||
private LocalTime endTime;
|
||||
|
||||
/** 总号量 */
|
||||
private Integer totalQuota;
|
||||
|
||||
/** 已约 */
|
||||
private Integer bookedNum;
|
||||
|
||||
/** 铁号数 */
|
||||
private Integer lockedNum;
|
||||
|
||||
/** 剩余号数 */
|
||||
private Integer availableNum;
|
||||
|
||||
/** 号别 */
|
||||
private String regType;
|
||||
|
||||
/** 原价 (元) */
|
||||
private Double fee;
|
||||
|
||||
/** 医保限价 (元) */
|
||||
private Double insurancePrice;
|
||||
|
||||
/** 支持渠道 */
|
||||
private String supportChannel;
|
||||
|
||||
/** 号源状态 */
|
||||
private Integer status;
|
||||
|
||||
/** 停诊原因 */
|
||||
private String stopReason;
|
||||
|
||||
/** 放号时间 */
|
||||
private LocalDateTime releaseTime;
|
||||
|
||||
/** 截止预约时间 */
|
||||
private LocalDateTime deadlineTime;
|
||||
|
||||
/** 乐观锁版本 */
|
||||
private Integer version;
|
||||
|
||||
/** 操作人ID */
|
||||
private Integer opUserId;
|
||||
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
/** 排班ID */
|
||||
private Integer scheduleId;
|
||||
|
||||
/** 创建时间 */
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/** 更新时间 */
|
||||
private LocalDateTime updateTime;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.openhis.web.appointmentmanage.mapper;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public interface DeptAppMapper {
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.openhis.web.appointmentmanage.mapper;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public interface DoctorScheduleAppMapper {
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.openhis.web.appointmentmanage.mapper;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public interface SchedulePoolAppMapper {
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.openhis.web.appointmentmanage.mapper;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public interface ScheduleSlotAppMapper {
|
||||
}
|
||||
@@ -120,7 +120,18 @@ public class OrganizationAppServiceImpl implements IOrganizationAppService {
|
||||
@Override
|
||||
public R<?> getOrgInfo(Long orgId) {
|
||||
Organization organization = organizationService.getById(orgId);
|
||||
return R.ok(organization, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"机构信息查询"}));
|
||||
if (organization == null) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00006, new Object[] {"机构信息"}));
|
||||
}
|
||||
|
||||
// 转换为DTO对象,确保数据格式一致
|
||||
OrganizationDto organizationDto = new OrganizationDto();
|
||||
BeanUtils.copyProperties(organization, organizationDto);
|
||||
organizationDto.setTypeEnum_dictText(EnumUtils.getInfoByValue(OrganizationType.class, organizationDto.getTypeEnum()));
|
||||
organizationDto.setClassEnum_dictText(EnumUtils.getInfoByValue(OrganizationClass.class, organizationDto.getClassEnum()));
|
||||
organizationDto.setActiveFlag_dictText(EnumUtils.getInfoByValue(AccountStatus.class, organizationDto.getActiveFlag()));
|
||||
|
||||
return R.ok(organizationDto, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"机构信息查询"}));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -60,4 +60,16 @@ public class OrganizationDto {
|
||||
|
||||
/** 子集合 */
|
||||
private List<OrganizationDto> children = new ArrayList<>();
|
||||
|
||||
/** 挂号科室标记 */
|
||||
private Integer registerFlag;
|
||||
|
||||
/** 科室位置 */
|
||||
private String location;
|
||||
|
||||
/** 科室简介 */
|
||||
private String intro;
|
||||
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.openhis.web.basicmanage.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.openhis.administration.domain.Invoice;
|
||||
import com.openhis.administration.service.IInvoiceService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* 发票管理控制器
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/basicmanage/invoice")
|
||||
public class InvoiceController {
|
||||
|
||||
@Autowired
|
||||
private IInvoiceService invoiceService;
|
||||
|
||||
/**
|
||||
* 分页查询发票列表(带用户角色权限过滤)
|
||||
*
|
||||
* @param pageNo 页码
|
||||
* @param pageSize 每页条数
|
||||
* @param request 请求对象
|
||||
* @return 发票列表
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
public R<?> selectInvoicePage(
|
||||
@RequestParam(defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest request) {
|
||||
|
||||
// 获取当前用户ID
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
|
||||
// 判断当前用户是否为管理员
|
||||
boolean isAdmin = SecurityUtils.isAdmin(userId);
|
||||
|
||||
// 分页查询发票列表
|
||||
Page<Invoice> page = new Page<>(pageNo, pageSize);
|
||||
return R.ok(invoiceService.selectInvoicePage(page, isAdmin, userId));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package com.openhis.web.basicmanage.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.openhis.administration.domain.InvoiceSegment;
|
||||
import com.openhis.administration.service.IInvoiceSegmentService;
|
||||
import com.openhis.web.basicmanage.domain.InvoiceSegmentDeleteRequest;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* 发票段管理控制器
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-11-18
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/basicmanage/invoice-segment")
|
||||
public class InvoiceSegmentController {
|
||||
|
||||
@Autowired
|
||||
private IInvoiceSegmentService invoiceSegmentService;
|
||||
|
||||
/**
|
||||
* 分页查询发票段列表(带用户角色权限过滤)
|
||||
*
|
||||
* @param pageNo 页码
|
||||
* @param pageSize 每页条数
|
||||
* @param request 请求对象
|
||||
* @return 发票段列表
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
public R<?> selectInvoiceSegmentPage(
|
||||
@RequestParam(defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(defaultValue = "100") Integer pageSize,
|
||||
HttpServletRequest request) {
|
||||
|
||||
// 获取当前用户ID
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
|
||||
// 判断当前用户是否为管理员
|
||||
boolean isAdmin = SecurityUtils.isAdmin(userId);
|
||||
|
||||
// 分页查询发票段列表
|
||||
Page<InvoiceSegment> page = new Page<>(pageNo, pageSize);
|
||||
return R.ok(invoiceSegmentService.selectInvoiceSegmentPage(page, isAdmin, userId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增发票段
|
||||
*
|
||||
* @param invoiceSegment 发票段信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PostMapping("/add")
|
||||
public R<?> addInvoiceSegment(@RequestBody InvoiceSegment invoiceSegment) {
|
||||
// 设置创建人信息
|
||||
invoiceSegment.setCreateBy(SecurityUtils.getUsername());
|
||||
int result = invoiceSegmentService.insertInvoiceSegment(invoiceSegment);
|
||||
return result > 0 ? R.ok() : R.fail();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改发票段
|
||||
*
|
||||
* @param invoiceSegment 发票段信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
public R<?> updateInvoiceSegment(@RequestBody InvoiceSegment invoiceSegment) {
|
||||
// 设置更新人信息
|
||||
invoiceSegment.setUpdateBy(SecurityUtils.getUsername());
|
||||
int result = invoiceSegmentService.updateInvoiceSegment(invoiceSegment);
|
||||
return result > 0 ? R.ok() : R.fail();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除发票段
|
||||
*/
|
||||
@PostMapping("/delete")
|
||||
public R<?> delete(@RequestBody InvoiceSegmentDeleteRequest request) {
|
||||
int rows = invoiceSegmentService.deleteInvoiceSegmentByIds(request.getIds());
|
||||
return rows > 0 ? R.ok("删除成功") : R.fail("删除失败");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,219 @@
|
||||
package com.openhis.web.basicmanage.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.annotation.Log;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.enums.BusinessType;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.core.common.utils.StringUtils;
|
||||
import com.openhis.administration.domain.OutpatientNoSegment;
|
||||
import com.openhis.administration.service.IOutpatientNoSegmentService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* 门诊号码段管理控制器
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-01-XX
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/business-rule/outpatient-no")
|
||||
public class OutpatientNoSegmentController {
|
||||
|
||||
@Autowired
|
||||
private IOutpatientNoSegmentService outpatientNoSegmentService;
|
||||
|
||||
/**
|
||||
* 分页查询门诊号码段列表
|
||||
*
|
||||
* @param pageNo 页码
|
||||
* @param pageSize 每页条数
|
||||
* @param onlySelf 是否只查询自己的(true=只查询自己的,false=查询所有)
|
||||
* @return 门诊号码段列表
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
public R<?> selectOutpatientNoSegmentPage(
|
||||
@RequestParam(defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(defaultValue = "10") Integer pageSize,
|
||||
@RequestParam(required = false) Boolean onlySelf) {
|
||||
|
||||
// 获取当前用户ID
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
|
||||
// 如果onlySelf为null,默认只查询自己的
|
||||
boolean onlySelfFlag = onlySelf != null ? onlySelf : true;
|
||||
|
||||
// 分页查询门诊号码段列表
|
||||
Page<OutpatientNoSegment> page = new Page<>(pageNo, pageSize);
|
||||
Page<OutpatientNoSegment> result = outpatientNoSegmentService.selectOutpatientNoSegmentPage(page, onlySelfFlag, userId);
|
||||
|
||||
return R.ok(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增门诊号码段
|
||||
*
|
||||
* @param outpatientNoSegment 门诊号码段信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Log(title = "门诊号码管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public R<?> addOutpatientNoSegment(@RequestBody OutpatientNoSegment outpatientNoSegment) {
|
||||
// 校验必填字段
|
||||
if (StringUtils.isEmpty(outpatientNoSegment.getStartNo()) ||
|
||||
StringUtils.isEmpty(outpatientNoSegment.getEndNo()) ||
|
||||
StringUtils.isEmpty(outpatientNoSegment.getUsedNo())) {
|
||||
return R.fail("起始号码、终止号码和使用号码不能为空");
|
||||
}
|
||||
|
||||
// 校验号码段是否重复
|
||||
if (outpatientNoSegmentService.checkNumberSegmentOverlap(
|
||||
outpatientNoSegment.getStartNo(),
|
||||
outpatientNoSegment.getEndNo(),
|
||||
null)) {
|
||||
return R.fail("门诊号码设置重复");
|
||||
}
|
||||
|
||||
// 设置创建人信息
|
||||
outpatientNoSegment.setOperatorId(SecurityUtils.getUserId());
|
||||
if (StringUtils.isEmpty(outpatientNoSegment.getOperatorName())) {
|
||||
outpatientNoSegment.setOperatorName(SecurityUtils.getUsername());
|
||||
}
|
||||
outpatientNoSegment.setCreateBy(SecurityUtils.getUsername());
|
||||
|
||||
int result = outpatientNoSegmentService.insertOutpatientNoSegment(outpatientNoSegment);
|
||||
return result > 0 ? R.ok("保存成功") : R.fail("保存失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改门诊号码段
|
||||
*
|
||||
* @param outpatientNoSegment 门诊号码段信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Log(title = "门诊号码管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public R<?> updateOutpatientNoSegment(@RequestBody OutpatientNoSegment outpatientNoSegment) {
|
||||
// 校验必填字段
|
||||
if (StringUtils.isEmpty(outpatientNoSegment.getStartNo()) ||
|
||||
StringUtils.isEmpty(outpatientNoSegment.getEndNo()) ||
|
||||
StringUtils.isEmpty(outpatientNoSegment.getUsedNo())) {
|
||||
return R.fail("起始号码、终止号码和使用号码不能为空");
|
||||
}
|
||||
|
||||
// 校验号码段是否重复(排除自身)
|
||||
if (outpatientNoSegmentService.checkNumberSegmentOverlap(
|
||||
outpatientNoSegment.getStartNo(),
|
||||
outpatientNoSegment.getEndNo(),
|
||||
outpatientNoSegment.getId())) {
|
||||
return R.fail("门诊号码设置重复");
|
||||
}
|
||||
|
||||
// 设置更新人信息
|
||||
outpatientNoSegment.setUpdateBy(SecurityUtils.getUsername());
|
||||
|
||||
int result = outpatientNoSegmentService.updateOutpatientNoSegment(outpatientNoSegment);
|
||||
return result > 0 ? R.ok("保存成功") : R.fail("保存失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除门诊号码段
|
||||
*
|
||||
* @param request 包含ids数组的请求对象
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Log(title = "门诊号码管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping
|
||||
public R<?> deleteOutpatientNoSegment(@RequestBody java.util.Map<String, Object> request) {
|
||||
// 支持接收 Long[] 或 String[] 或混合类型,处理大整数ID
|
||||
Object idsObj = request.get("ids");
|
||||
System.out.println("删除请求 - 接收到的ids原始数据: " + idsObj);
|
||||
System.out.println("删除请求 - 接收到的ids类型: " + (idsObj != null ? idsObj.getClass().getName() : "null"));
|
||||
|
||||
if (idsObj == null) {
|
||||
return R.fail("请选择要删除的数据");
|
||||
}
|
||||
|
||||
// 转换为 Long[] 数组
|
||||
Long[] ids = null;
|
||||
if (idsObj instanceof java.util.List) {
|
||||
java.util.List<?> idList = (java.util.List<?>) idsObj;
|
||||
ids = new Long[idList.size()];
|
||||
for (int i = 0; i < idList.size(); i++) {
|
||||
Object idObj = idList.get(i);
|
||||
if (idObj instanceof Long) {
|
||||
ids[i] = (Long) idObj;
|
||||
} else if (idObj instanceof Integer) {
|
||||
ids[i] = ((Integer) idObj).longValue();
|
||||
} else if (idObj instanceof String) {
|
||||
try {
|
||||
String idStr = (String) idObj;
|
||||
System.out.println("删除请求 - 转换字符串ID: " + idStr);
|
||||
ids[i] = Long.parseLong(idStr);
|
||||
System.out.println("删除请求 - 转换后的Long ID: " + ids[i]);
|
||||
// 验证转换是否正确
|
||||
if (!String.valueOf(ids[i]).equals(idStr)) {
|
||||
System.out.println("删除请求 - 警告:ID转换后值不匹配!原始: " + idStr + ", 转换后: " + ids[i]);
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
System.out.println("删除请求 - ID转换失败: " + idObj + ", 错误: " + e.getMessage());
|
||||
return R.fail("无效的ID格式: " + idObj);
|
||||
}
|
||||
} else if (idObj instanceof Number) {
|
||||
ids[i] = ((Number) idObj).longValue();
|
||||
} else {
|
||||
return R.fail("无效的ID类型: " + (idObj != null ? idObj.getClass().getName() : "null"));
|
||||
}
|
||||
}
|
||||
} else if (idsObj instanceof Long[]) {
|
||||
ids = (Long[]) idsObj;
|
||||
} else {
|
||||
return R.fail("无效的ID数组格式");
|
||||
}
|
||||
|
||||
System.out.println("删除请求 - 转换后的ids: " + java.util.Arrays.toString(ids));
|
||||
|
||||
if (ids == null || ids.length == 0) {
|
||||
return R.fail("请选择要删除的数据");
|
||||
}
|
||||
|
||||
// 获取当前用户ID
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
System.out.println("删除请求 - 当前用户ID: " + userId);
|
||||
|
||||
// 校验删除权限和使用状态
|
||||
for (Long id : ids) {
|
||||
System.out.println("删除验证 - 检查ID: " + id);
|
||||
OutpatientNoSegment segment = outpatientNoSegmentService.getById(id);
|
||||
|
||||
if (segment == null) {
|
||||
// 记录日志以便调试
|
||||
System.out.println("删除失败:记录不存在,ID=" + id + ",可能已被软删除或不存在");
|
||||
return R.fail("数据不存在,ID: " + id);
|
||||
}
|
||||
|
||||
System.out.println("删除验证 - 找到记录: ID=" + segment.getId() + ", operatorId=" + segment.getOperatorId() + ", usedNo=" + segment.getUsedNo() + ", startNo=" + segment.getStartNo());
|
||||
|
||||
// 校验归属权
|
||||
if (!segment.getOperatorId().equals(userId)) {
|
||||
System.out.println("删除验证 - 权限检查失败: segment.operatorId=" + segment.getOperatorId() + ", userId=" + userId);
|
||||
return R.fail("只能删除自己维护的门诊号码段");
|
||||
}
|
||||
|
||||
// 校验使用状态(使用号码=起始号码表示未使用)
|
||||
if (!segment.getUsedNo().equals(segment.getStartNo())) {
|
||||
System.out.println("删除验证 - 使用状态检查失败: usedNo=" + segment.getUsedNo() + ", startNo=" + segment.getStartNo());
|
||||
return R.fail("已有门诊号码段已有使用的门诊号码,请核对!");
|
||||
}
|
||||
}
|
||||
|
||||
System.out.println("删除验证 - 所有检查通过,开始执行删除");
|
||||
int rows = outpatientNoSegmentService.deleteOutpatientNoSegmentByIds(ids);
|
||||
System.out.println("删除执行 - 影响行数: " + rows);
|
||||
return rows > 0 ? R.ok("删除成功") : R.fail("删除失败");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.openhis.web.basicmanage.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 发票段删除请求类
|
||||
*
|
||||
* @author system
|
||||
* @date 2024-06-19
|
||||
*/
|
||||
public class InvoiceSegmentDeleteRequest implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long[] ids;
|
||||
|
||||
public Long[] getIds() {
|
||||
return ids;
|
||||
}
|
||||
|
||||
public void setIds(Long[] ids) {
|
||||
this.ids = ids;
|
||||
}
|
||||
}
|
||||
@@ -90,6 +90,14 @@ public class HealthcareServiceDto {
|
||||
private Integer appointmentRequiredFlag;
|
||||
private String appointmentRequiredFlag_enumText;
|
||||
|
||||
/**
|
||||
* 出诊医生ID
|
||||
*/
|
||||
@Dict(dictTable = "adm_practitioner", dictCode = "id", dictText = "name")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long practitionerId;
|
||||
private String practitionerId_dictText;
|
||||
|
||||
/**
|
||||
* 费用定价ID
|
||||
*/
|
||||
|
||||
@@ -82,6 +82,11 @@ public class HealthcareServiceFormData {
|
||||
@NotBlank(message = "预约要求不能为空")
|
||||
private Integer appointmentRequiredFlag;
|
||||
|
||||
/**
|
||||
* 出诊医生ID
|
||||
*/
|
||||
private Long practitionerId;
|
||||
|
||||
/** 医保编码 */
|
||||
private String ybNo;
|
||||
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.openhis.web.charge.patientcardrenewal;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 患者换卡控制器
|
||||
*
|
||||
* @author system
|
||||
* @date 2024-01-01
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/charge/patientCardRenewal")
|
||||
@Slf4j
|
||||
public class PatientCardRenewalController {
|
||||
|
||||
@Autowired
|
||||
private PatientCardRenewalService patientCardRenewalService;
|
||||
|
||||
/**
|
||||
* 执行患者换卡操作
|
||||
*
|
||||
* @param request 换卡请求参数
|
||||
* @return 换卡结果
|
||||
*/
|
||||
@PostMapping("/renewCard")
|
||||
public R<?> renewCard(@RequestBody RenewalRequest request) {
|
||||
try {
|
||||
log.info("患者换卡请求: 旧卡号={}, 新卡号={}, 患者ID={}",
|
||||
request.getOldCardNo(), request.getNewCardNo(), request.getPatientId());
|
||||
|
||||
// 执行换卡操作
|
||||
boolean success = patientCardRenewalService.renewCard(request);
|
||||
|
||||
if (success) {
|
||||
log.info("患者换卡成功: 旧卡号={} -> 新卡号={}",
|
||||
request.getOldCardNo(), request.getNewCardNo());
|
||||
return R.ok("换卡成功");
|
||||
} else {
|
||||
return R.fail("换卡失败");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("患者换卡异常: ", e);
|
||||
return R.fail("换卡操作异常: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.openhis.web.charge.patientcardrenewal;
|
||||
|
||||
/**
|
||||
* 患者换卡服务接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2024-01-01
|
||||
*/
|
||||
public interface PatientCardRenewalService {
|
||||
|
||||
/**
|
||||
* 执行患者换卡操作
|
||||
*
|
||||
* @param request 换卡请求参数
|
||||
* @return 是否换卡成功
|
||||
*/
|
||||
boolean renewCard(RenewalRequest request);
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.openhis.web.charge.patientcardrenewal;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import com.openhis.administration.domain.PatientIdentifier;
|
||||
import com.openhis.administration.service.IPatientIdentifierService;
|
||||
import com.openhis.common.enums.IdentifierStatusEnum;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 患者换卡服务实现类
|
||||
*
|
||||
* @author system
|
||||
* @date 2024-01-01
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class PatientCardRenewalServiceImpl implements PatientCardRenewalService {
|
||||
|
||||
@Autowired
|
||||
private IPatientIdentifierService patientIdentifierService;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean renewCard(RenewalRequest request) {
|
||||
log.info("执行患者换卡操作: 患者ID={}, 旧卡号={}, 新卡号={}, 原因={}",
|
||||
request.getPatientId(), request.getOldCardNo(), request.getNewCardNo(), request.getReason());
|
||||
|
||||
// 1. 验证参数合法性
|
||||
if (StringUtils.isEmpty(request.getPatientId())) {
|
||||
throw new IllegalArgumentException("患者ID不能为空");
|
||||
}
|
||||
|
||||
if (StringUtils.isEmpty(request.getNewCardNo())) {
|
||||
throw new IllegalArgumentException("新卡号不能为空");
|
||||
}
|
||||
|
||||
// 2. 检查新卡号是否已被使用
|
||||
LambdaQueryWrapper<PatientIdentifier> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(PatientIdentifier::getIdentifierNo, request.getNewCardNo());
|
||||
List<PatientIdentifier> existingIdentifiers = patientIdentifierService.list(queryWrapper);
|
||||
if (existingIdentifiers != null && !existingIdentifiers.isEmpty()) {
|
||||
throw new IllegalArgumentException("新卡号已被其他患者使用,请更换新卡号");
|
||||
}
|
||||
|
||||
// 3. 直接使用患者ID作为查询条件
|
||||
Long patientId = Long.parseLong(request.getPatientId());
|
||||
// 4. 通过患者ID查询现有标识信息
|
||||
PatientIdentifier patientIdentifier = patientIdentifierService.selectByPatientId(patientId);
|
||||
|
||||
if (patientIdentifier != null) {
|
||||
// 5. 只更新就诊卡号这一个参数
|
||||
|
||||
patientIdentifier.setIdentifierNo(request.getNewCardNo());
|
||||
patientIdentifierService.updateById(patientIdentifier);
|
||||
log.info("患者ID={} 换卡成功,已更新就诊卡号", patientId);
|
||||
} else {
|
||||
throw new IllegalArgumentException("未找到患者标识信息,无法进行换卡操作");
|
||||
}
|
||||
|
||||
// 4. 记录换卡日志 - 可以根据需要扩展日志记录功能
|
||||
// 5. 处理相关业务系统的卡号更新 - 可以根据需要扩展
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.openhis.web.charge.patientcardrenewal;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 换卡请求参数类
|
||||
*
|
||||
* @author system
|
||||
* @date 2024-01-01
|
||||
*/
|
||||
@Data
|
||||
public class RenewalRequest {
|
||||
|
||||
/**
|
||||
* 旧门诊号码
|
||||
*/
|
||||
private String oldCardNo;
|
||||
|
||||
/**
|
||||
* 新门诊号码
|
||||
*/
|
||||
private String newCardNo;
|
||||
|
||||
/**
|
||||
* 患者ID
|
||||
*/
|
||||
private String patientId;
|
||||
|
||||
/**
|
||||
* 换卡原因
|
||||
*/
|
||||
private String reason;
|
||||
|
||||
/**
|
||||
* 备注信息
|
||||
*/
|
||||
private String remark;
|
||||
}
|
||||
@@ -65,11 +65,11 @@ public class OutpatientChargeAppServiceImpl implements IOutpatientChargeAppServi
|
||||
OutpatientInitDto initDto = new OutpatientInitDto();
|
||||
List<OutpatientInitDto.chargeItemStatusOption> chargeItemStatusOptions = new ArrayList<>();
|
||||
chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.PLANNED.getValue(),
|
||||
ChargeItemStatus.PLANNED.getInfo()));
|
||||
ChargeItemStatus.PLANNED.getInfo()));
|
||||
chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.BILLABLE.getValue(),
|
||||
ChargeItemStatus.BILLABLE.getInfo()));
|
||||
ChargeItemStatus.BILLABLE.getInfo()));
|
||||
chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.BILLED.getValue(),
|
||||
ChargeItemStatus.BILLED.getInfo()));
|
||||
ChargeItemStatus.BILLED.getInfo()));
|
||||
initDto.setChargeItemStatusOptions(chargeItemStatusOptions);
|
||||
return R.ok(initDto);
|
||||
}
|
||||
@@ -86,17 +86,17 @@ public class OutpatientChargeAppServiceImpl implements IOutpatientChargeAppServi
|
||||
*/
|
||||
@Override
|
||||
public R<?> getEncounterPatientPage(EncounterPatientPageParam encounterPatientPageParam, String searchKey,
|
||||
Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
||||
Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
||||
// 构建查询条件
|
||||
QueryWrapper<EncounterPatientPageParam> queryWrapper = HisQueryUtils.buildQueryWrapper(
|
||||
encounterPatientPageParam, searchKey,
|
||||
new HashSet<>(Arrays.asList(CommonConstants.FieldName.PatientWbStr, CommonConstants.FieldName.PatientPyStr,
|
||||
CommonConstants.FieldName.PatientName, CommonConstants.FieldName.PatientBusNo,
|
||||
CommonConstants.FieldName.EncounterBusNo, CommonConstants.FieldName.IdCard)),
|
||||
request);
|
||||
encounterPatientPageParam, searchKey,
|
||||
new HashSet<>(Arrays.asList(CommonConstants.FieldName.PatientWbStr, CommonConstants.FieldName.PatientPyStr,
|
||||
CommonConstants.FieldName.PatientName, CommonConstants.FieldName.PatientBusNo,
|
||||
CommonConstants.FieldName.EncounterBusNo, CommonConstants.FieldName.IdCard)),
|
||||
request);
|
||||
// 就诊患者分页列表
|
||||
Page<EncounterPatientPageDto> encounterPatientPage = outpatientChargeAppMapper
|
||||
.selectEncounterPatientPage(new Page<>(pageNo, pageSize), queryWrapper, EncounterClass.AMB.getValue());
|
||||
.selectEncounterPatientPage(new Page<>(pageNo, pageSize), queryWrapper, EncounterClass.AMB.getValue());
|
||||
|
||||
encounterPatientPage.getRecords().forEach(e -> {
|
||||
// 性别枚举
|
||||
@@ -117,13 +117,13 @@ public class OutpatientChargeAppServiceImpl implements IOutpatientChargeAppServi
|
||||
*/
|
||||
@Override
|
||||
public List<EncounterPatientPrescriptionDto> getEncounterPatientPrescription(Long encounterId) {
|
||||
List<EncounterPatientPrescriptionDto> prescriptionDtoList =
|
||||
outpatientChargeAppMapper.selectEncounterPatientPrescription(encounterId,
|
||||
ChargeItemContext.ACTIVITY.getValue(), ChargeItemContext.MEDICATION.getValue(),
|
||||
ChargeItemContext.DEVICE.getValue(), ChargeItemContext.REGISTER.getValue(),
|
||||
ChargeItemStatus.PLANNED.getValue(), ChargeItemStatus.BILLABLE.getValue(),
|
||||
ChargeItemStatus.BILLED.getValue(), ChargeItemStatus.REFUNDING.getValue(),
|
||||
ChargeItemStatus.REFUNDED.getValue(), ChargeItemStatus.PART_REFUND.getValue());
|
||||
List<EncounterPatientPrescriptionDto> prescriptionDtoList
|
||||
= outpatientChargeAppMapper.selectEncounterPatientPrescription(encounterId,
|
||||
ChargeItemContext.ACTIVITY.getValue(), ChargeItemContext.MEDICATION.getValue(),
|
||||
ChargeItemContext.DEVICE.getValue(), ChargeItemContext.REGISTER.getValue(),
|
||||
ChargeItemStatus.PLANNED.getValue(), ChargeItemStatus.BILLABLE.getValue(),
|
||||
ChargeItemStatus.BILLED.getValue(), ChargeItemStatus.REFUNDING.getValue(),
|
||||
ChargeItemStatus.REFUNDED.getValue(), ChargeItemStatus.PART_REFUND.getValue());
|
||||
prescriptionDtoList.forEach(e -> {
|
||||
// 收费状态枚举
|
||||
e.setStatusEnum_enumText(EnumUtils.getInfoByValue(ChargeItemStatus.class, e.getStatusEnum()));
|
||||
@@ -142,7 +142,7 @@ public class OutpatientChargeAppServiceImpl implements IOutpatientChargeAppServi
|
||||
// 获取就诊患者的自费账户id
|
||||
Long accountId = accountService.getSelfPayAccount(encounterId);
|
||||
if (accountId == null) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00008, new Object[] {"自费账户"}));
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00008, new Object[]{"自费账户"}));
|
||||
}
|
||||
// 医保转自费
|
||||
boolean result = chargeItemService.updateAccountType(encounterId, accountId);
|
||||
@@ -163,7 +163,7 @@ public class OutpatientChargeAppServiceImpl implements IOutpatientChargeAppServi
|
||||
// 获取就诊患者的医保账户id
|
||||
Long accountId = accountService.getMedicalInsuranceAccount(encounterId);
|
||||
if (accountId == null) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00008, new Object[] {"医保账户"}));
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00008, new Object[]{"医保账户"}));
|
||||
}
|
||||
// 自费转医保
|
||||
boolean result = chargeItemService.updateAccountType(encounterId, accountId);
|
||||
@@ -184,7 +184,7 @@ public class OutpatientChargeAppServiceImpl implements IOutpatientChargeAppServi
|
||||
// 获取就诊患者的学生自费账户id
|
||||
Long accountId = accountService.getStudentSelfAccount(encounterId);
|
||||
if (accountId == null) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00008, new Object[] {"医保账户"}));
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00008, new Object[]{"医保账户"}));
|
||||
}
|
||||
// 自费转医保
|
||||
boolean result = chargeItemService.updateAccountType(encounterId, accountId);
|
||||
@@ -205,7 +205,7 @@ public class OutpatientChargeAppServiceImpl implements IOutpatientChargeAppServi
|
||||
// 获取就诊患者的学生医保账户id
|
||||
Long accountId = accountService.getStudentYbAccount(encounterId);
|
||||
if (accountId == null) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00008, new Object[] {"医保账户"}));
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00008, new Object[]{"医保账户"}));
|
||||
}
|
||||
// 自费转医保
|
||||
boolean result = chargeItemService.updateAccountType(encounterId, accountId);
|
||||
@@ -224,14 +224,14 @@ public class OutpatientChargeAppServiceImpl implements IOutpatientChargeAppServi
|
||||
@Override
|
||||
public List<EncounterPatientPrescriptionDto> getEncounterPatientPrescriptionWithPrice(Long encounterId) {
|
||||
List<EncounterPatientPrescriptionDto> prescriptionDtoList = outpatientChargeAppMapper
|
||||
.selectEncounterPatientPrescriptionWithPrice(encounterId, ChargeItemContext.ACTIVITY.getValue(),
|
||||
ChargeItemContext.MEDICATION.getValue(), ChargeItemContext.DEVICE.getValue(),
|
||||
ChargeItemContext.REGISTER.getValue(), ChargeItemStatus.PLANNED.getValue(),
|
||||
ChargeItemStatus.BILLABLE.getValue(), ChargeItemStatus.BILLED.getValue(),
|
||||
ChargeItemStatus.REFUNDING.getValue(), ChargeItemStatus.REFUNDED.getValue(),
|
||||
ChargeItemStatus.PART_REFUND.getValue(), YbPayment.DISCOUNT_PAY.getValue(),
|
||||
YbPayment.SELF_CASH_VALUE.getValue(), YbPayment.SELF_CASH_VX_VALUE.getValue(),
|
||||
YbPayment.SELF_CASH_ALI_VALUE.getValue(), YbPayment.SELF_CASH_UNION_VALUE.getValue());
|
||||
.selectEncounterPatientPrescriptionWithPrice(encounterId, ChargeItemContext.ACTIVITY.getValue(),
|
||||
ChargeItemContext.MEDICATION.getValue(), ChargeItemContext.DEVICE.getValue(),
|
||||
ChargeItemContext.REGISTER.getValue(), ChargeItemStatus.PLANNED.getValue(),
|
||||
ChargeItemStatus.BILLABLE.getValue(), ChargeItemStatus.BILLED.getValue(),
|
||||
ChargeItemStatus.REFUNDING.getValue(), ChargeItemStatus.REFUNDED.getValue(),
|
||||
ChargeItemStatus.PART_REFUND.getValue(), YbPayment.DISCOUNT_PAY.getValue(),
|
||||
YbPayment.SELF_CASH_VALUE.getValue(), YbPayment.SELF_CASH_VX_VALUE.getValue(),
|
||||
YbPayment.SELF_CASH_ALI_VALUE.getValue(), YbPayment.SELF_CASH_UNION_VALUE.getValue());
|
||||
prescriptionDtoList.forEach(e -> {
|
||||
// 应收金额
|
||||
BigDecimal receivableAmount = e.getReceivableAmount();
|
||||
@@ -240,7 +240,7 @@ public class OutpatientChargeAppServiceImpl implements IOutpatientChargeAppServi
|
||||
// 计算折扣率
|
||||
BigDecimal discountRate = BigDecimal.ONE;
|
||||
if (receivableAmount.compareTo(BigDecimal.ZERO) > 0 && receivedAmount.compareTo(BigDecimal.ZERO) > 0
|
||||
&& receivableAmount.compareTo(receivedAmount) > 0) {
|
||||
&& receivableAmount.compareTo(receivedAmount) > 0) {
|
||||
discountRate = receivedAmount.divide(receivableAmount, 2, RoundingMode.HALF_UP);
|
||||
}
|
||||
e.setDiscountRate(this.returnDiscountRate(discountRate));
|
||||
@@ -252,10 +252,11 @@ public class OutpatientChargeAppServiceImpl implements IOutpatientChargeAppServi
|
||||
|
||||
/**
|
||||
* 调整折扣率
|
||||
*
|
||||
*
|
||||
* @param discountRate 折扣率
|
||||
* @return 调整后的折扣率(0.05的倍数)
|
||||
**/
|
||||
*
|
||||
*/
|
||||
private String returnDiscountRate(BigDecimal discountRate) {
|
||||
BigDecimal compareValue = BigDecimal.valueOf(0.05);
|
||||
BigDecimal remainder = discountRate.remainder(compareValue);
|
||||
|
||||
@@ -92,17 +92,27 @@ public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistra
|
||||
*/
|
||||
@Override
|
||||
public Page<PatientMetadata> getPatientMetadataBySearchKey(String searchKey, Integer pageNo, Integer pageSize) {
|
||||
// 构建查询条件
|
||||
// 构建查询条件,添加phone字段支持手机号搜索
|
||||
QueryWrapper<Patient> queryWrapper = HisQueryUtils.buildQueryWrapper(null, searchKey,
|
||||
new HashSet<>(Arrays.asList("id_card", "name", "py_str", "wb_str")), null);
|
||||
new HashSet<>(Arrays.asList("id_card", "name", "py_str", "wb_str", "phone")), null);
|
||||
// 设置排序
|
||||
queryWrapper.orderByDesc("update_time");
|
||||
// 通过证件号匹配 patient
|
||||
if (StringUtils.isNotEmpty(searchKey)) {
|
||||
PatientIdentifier patientIdentifier = patientIdentifierService
|
||||
.getOne(new LambdaQueryWrapper<PatientIdentifier>().eq(PatientIdentifier::getIdentifierNo, searchKey));
|
||||
if (patientIdentifier != null) {
|
||||
queryWrapper.or(q -> q.eq("id", patientIdentifier.getPatientId()));
|
||||
List<PatientIdentifier> patientIdentifiers = patientIdentifierService
|
||||
.list(new LambdaQueryWrapper<PatientIdentifier>().eq(PatientIdentifier::getIdentifierNo, searchKey));
|
||||
if (patientIdentifiers != null && !patientIdentifiers.isEmpty()) {
|
||||
// 如果有多个匹配结果,将它们全部添加到查询条件中
|
||||
if (patientIdentifiers.size() == 1) {
|
||||
// 单个结果时直接添加条件
|
||||
queryWrapper.or(q -> q.eq("id", patientIdentifiers.get(0).getPatientId()));
|
||||
} else {
|
||||
// 多个结果时使用in条件
|
||||
List<Long> patientIds = patientIdentifiers.stream()
|
||||
.map(PatientIdentifier::getPatientId)
|
||||
.collect(Collectors.toList());
|
||||
queryWrapper.or(q -> q.in("id", patientIds));
|
||||
}
|
||||
}
|
||||
}
|
||||
// 患者信息
|
||||
@@ -120,6 +130,13 @@ public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistra
|
||||
// 初复诊
|
||||
e.setFirstEnum_enumText(patientIdList.contains(e.getId()) ? EncounterType.FOLLOW_UP.getInfo()
|
||||
: EncounterType.INITIAL.getInfo());
|
||||
// 患者标识
|
||||
List<PatientIdentifier> patientIdentifiers = patientIdentifierService
|
||||
.list(new LambdaQueryWrapper<PatientIdentifier>().eq(PatientIdentifier::getPatientId, e.getId()));
|
||||
if (patientIdentifiers != null && !patientIdentifiers.isEmpty()) {
|
||||
// 取第一个标识号,如果需要可以根据业务需求选择其他逻辑
|
||||
e.setIdentifierNo(patientIdentifiers.get(0).getIdentifierNo());
|
||||
}
|
||||
|
||||
});
|
||||
return patientMetadataPage;
|
||||
@@ -263,6 +280,23 @@ public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistra
|
||||
new HashSet<>(Arrays.asList("patient_name", "organization_name", "practitioner_name", "healthcare_name")),
|
||||
request);
|
||||
|
||||
// 手动处理 statusEnum 参数(用于过滤退号记录)
|
||||
String statusEnumParam = request.getParameter("statusEnum");
|
||||
if (statusEnumParam != null && !statusEnumParam.isEmpty()) {
|
||||
try {
|
||||
Integer statusEnum = Integer.parseInt(statusEnumParam);
|
||||
if (statusEnum == -1) {
|
||||
// -1 表示排除退号记录(正常挂号)
|
||||
queryWrapper.ne("status_enum", 6);
|
||||
} else {
|
||||
// 其他值表示精确匹配
|
||||
queryWrapper.eq("status_enum", statusEnum);
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
// 忽略无效的参数值
|
||||
}
|
||||
}
|
||||
|
||||
IPage<CurrentDayEncounterDto> currentDayEncounter = outpatientRegistrationAppMapper.getCurrentDayEncounter(
|
||||
new Page<>(pageNo, pageSize), EncounterClass.AMB.getValue(), EncounterStatus.IN_PROGRESS.getValue(),
|
||||
ParticipantType.ADMITTER.getCode(), ParticipantType.REGISTRATION_DOCTOR.getCode(), queryWrapper,
|
||||
|
||||
@@ -16,7 +16,9 @@ import lombok.experimental.Accessors;
|
||||
@Accessors(chain = true)
|
||||
public class CurrentDayEncounterDto {
|
||||
|
||||
/** 租户ID */
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private Integer tenantId;
|
||||
|
||||
/**
|
||||
|
||||
@@ -23,124 +23,189 @@ import lombok.experimental.Accessors;
|
||||
@Accessors(chain = true)
|
||||
public class EncounterPatientPrescriptionDto {
|
||||
|
||||
/** 收费项目类型 */
|
||||
/**
|
||||
* 收费项目类型
|
||||
*/
|
||||
private Integer contextEnum;
|
||||
private String contextEnum_enumText;
|
||||
|
||||
/** 收费状态 */
|
||||
/**
|
||||
* 收费状态
|
||||
*/
|
||||
private Integer statusEnum;
|
||||
private String statusEnum_enumText;
|
||||
|
||||
/** 就诊ID */
|
||||
/**
|
||||
* 就诊ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterId;
|
||||
|
||||
/** 患者id */
|
||||
/**
|
||||
* 患者id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long patientId;
|
||||
|
||||
/** ID */
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 开立科室 */
|
||||
/**
|
||||
* 开立科室
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long requestingOrgId;
|
||||
|
||||
/** 数量 */
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private Long quantityValue;
|
||||
|
||||
/** 单位 */
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String quantityUnit;
|
||||
private String quantityUnit_dictText;
|
||||
|
||||
/** 单价 */
|
||||
/**
|
||||
* 单价
|
||||
*/
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
/** 总价 */
|
||||
/**
|
||||
* 总价
|
||||
*/
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
/** 处方号 */
|
||||
/**
|
||||
* 处方号
|
||||
*/
|
||||
private String prescriptionNo;
|
||||
|
||||
/** 业务编码 */
|
||||
/**
|
||||
* 业务编码
|
||||
*/
|
||||
private String busNo;
|
||||
|
||||
/** 收款人ID */
|
||||
/**
|
||||
* 收款人ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@Dict(dictCode = "id", dictTable = "adm_practitioner", dictText = "name")
|
||||
private Long entererId;
|
||||
private String entererId_dictText;
|
||||
|
||||
/** 开立时间 */
|
||||
/**
|
||||
* 开立时间
|
||||
*/
|
||||
private Date enteredDate;
|
||||
|
||||
/** 收费时间 */
|
||||
/**
|
||||
* 收费时间
|
||||
*/
|
||||
private Date billDate;
|
||||
|
||||
/** 关联账户ID */
|
||||
/**
|
||||
* 关联账户ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long accountId;
|
||||
|
||||
/** 物品编码 */
|
||||
/**
|
||||
* 物品编码
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long itemId;
|
||||
|
||||
/** 物品名称 */
|
||||
/**
|
||||
* 物品名称
|
||||
*/
|
||||
private String itemName;
|
||||
|
||||
/** 特病标识 */
|
||||
/**
|
||||
* 特病标识
|
||||
*/
|
||||
@Dict(dictCode = "med_type")
|
||||
private String medTypeCode;
|
||||
private String medTypeCode_dictText;
|
||||
|
||||
/** 用法 */
|
||||
/**
|
||||
* 用法
|
||||
*/
|
||||
@Dict(dictCode = "method_code")
|
||||
private String methodCode;
|
||||
private String methodCode_dictText;
|
||||
|
||||
/** 剂量 */
|
||||
/**
|
||||
* 剂量
|
||||
*/
|
||||
private String dose;
|
||||
|
||||
/** 剂量单位 */
|
||||
/**
|
||||
* 剂量单位
|
||||
*/
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String doseUnitCode;
|
||||
private String doseUnitCode_dictText;
|
||||
|
||||
/** 频次 */
|
||||
/**
|
||||
* 频次
|
||||
*/
|
||||
private String rateCode;
|
||||
|
||||
/** 合同编码 */
|
||||
/**
|
||||
* 合同编码
|
||||
*/
|
||||
private String contractNo;
|
||||
|
||||
/** 医保编码 */
|
||||
/**
|
||||
* 医保编码
|
||||
*/
|
||||
private String ybNo;
|
||||
|
||||
/** 合同名称 */
|
||||
/**
|
||||
* 合同名称
|
||||
*/
|
||||
private String contractName;
|
||||
|
||||
/** 服务所在表 */
|
||||
/**
|
||||
* 服务所在表
|
||||
*/
|
||||
private String serviceTable;
|
||||
|
||||
/** 服务所在表对应的id */
|
||||
/**
|
||||
* 服务所在表对应的id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long serviceId;
|
||||
|
||||
/** 付款id */
|
||||
/**
|
||||
* 付款id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long paymentId;
|
||||
|
||||
/** 实收金额 */
|
||||
/**
|
||||
* 实收金额
|
||||
*/
|
||||
private BigDecimal receivedAmount = BigDecimal.ZERO;
|
||||
|
||||
/** 优惠金额 */
|
||||
/**
|
||||
* 优惠金额
|
||||
*/
|
||||
private BigDecimal discountAmount = BigDecimal.ZERO;
|
||||
|
||||
/** 应收金额 */
|
||||
/**
|
||||
* 应收金额
|
||||
*/
|
||||
private BigDecimal receivableAmount = BigDecimal.ZERO;
|
||||
|
||||
/** 折扣率 */
|
||||
/**
|
||||
* 折扣率
|
||||
*/
|
||||
@Dict(dictCode = "charge_discount")
|
||||
private String discountRate = "0";
|
||||
private String discountRate_dictText;
|
||||
|
||||
@@ -56,4 +56,8 @@ public class PatientMetadata {
|
||||
*/
|
||||
private String firstEnum_enumText;
|
||||
|
||||
/**
|
||||
* 就诊卡号
|
||||
*/
|
||||
private String identifierNo;
|
||||
}
|
||||
|
||||
@@ -82,5 +82,11 @@ public class RefundItemDto {
|
||||
|
||||
/** 项目名 */
|
||||
private String itemName;
|
||||
|
||||
/** 费用支付方式编码 */
|
||||
private String medfeePaymtdCode;
|
||||
|
||||
/** 费用类型 */
|
||||
private String feeType;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.openhis.web.check.appservice;
|
||||
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.check.domain.CheckMethod;
|
||||
import io.swagger.models.auth.In;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* 检查方法Service接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-07-22
|
||||
*/
|
||||
public interface ICheckMethodAppService{
|
||||
|
||||
R<?> getCheckMethodList();
|
||||
|
||||
R<?> addCheckMethod(CheckMethod checkMethod);
|
||||
|
||||
R<?> updateCheckMethod(CheckMethod checkPart);
|
||||
|
||||
R<?> removeCheckMethod(Integer checkMethodId);
|
||||
|
||||
R<?> searchCheckMethodList(Integer pageNo, Integer pageSize, String checkType, String name, String packageName);
|
||||
|
||||
R<?> exportCheckMethod(String checkType, String name, String packageName, HttpServletResponse response);
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.openhis.web.check.appservice;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.check.dto.CheckPackageDto;
|
||||
|
||||
/**
|
||||
* 检查套餐AppService接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-11-26
|
||||
*/
|
||||
public interface ICheckPackageAppService {
|
||||
|
||||
/**
|
||||
* 获取检查套餐列表
|
||||
* @return 检查套餐列表
|
||||
*/
|
||||
R<?> getCheckPackageList();
|
||||
|
||||
/**
|
||||
* 根据ID获取检查套餐详情
|
||||
* @param id 套餐ID
|
||||
* @return 套餐详情
|
||||
*/
|
||||
R<?> getCheckPackageById(Long id);
|
||||
|
||||
/**
|
||||
* 新增检查套餐
|
||||
* @param checkPackageDto 套餐信息
|
||||
* @return 新增结果
|
||||
*/
|
||||
R<?> addCheckPackage(CheckPackageDto checkPackageDto);
|
||||
|
||||
/**
|
||||
* 更新检查套餐
|
||||
* @param checkPackageDto 套餐信息
|
||||
* @return 更新结果
|
||||
*/
|
||||
R<?> updateCheckPackage(CheckPackageDto checkPackageDto);
|
||||
|
||||
/**
|
||||
* 删除检查套餐
|
||||
* @param id 套餐ID
|
||||
* @return 删除结果
|
||||
*/
|
||||
R<?> deleteCheckPackage(Long id);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.openhis.web.check.appservice;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.check.domain.CheckPart;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
public interface ICheckPartAppService {
|
||||
R<?> getCheckPartList();
|
||||
|
||||
R<?> addCheckPart(CheckPart checkPart);
|
||||
|
||||
R<?> removeCheckPart(Integer checkPartId);
|
||||
|
||||
R<?> updateCheckPart(CheckPart checkPart);
|
||||
|
||||
R<?> searchCheckPartList(Integer pageNo, Integer pageSize, String checkType, String name, String packageName);
|
||||
|
||||
R<?> exportCheckPart(String checkType, String name, String packageName, HttpServletResponse response);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.openhis.web.check.appservice;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.check.domain.LisGroupInfo;
|
||||
|
||||
public interface ILisGroupInfoAppService {
|
||||
R<?> getLisGroupInfoList();
|
||||
|
||||
R<?> add(LisGroupInfo lisGroupInfo);
|
||||
|
||||
R<?> update(LisGroupInfo lisGroupInfo);
|
||||
|
||||
R<?> delete(Integer lisGroupInfoId);
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
package com.openhis.web.check.appservice.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.check.domain.CheckMethod;
|
||||
import com.openhis.check.service.ICheckMethodService;
|
||||
import com.openhis.web.check.appservice.ICheckMethodAppService;
|
||||
import com.openhis.web.reportmanage.utils.ExcelFillerUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class CheckMethodAppServiceImpl implements ICheckMethodAppService {
|
||||
|
||||
@Resource
|
||||
private ICheckMethodService checkMethodService;
|
||||
|
||||
@Override
|
||||
public R<?> getCheckMethodList() {
|
||||
List<CheckMethod> list = checkMethodService.list();
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> searchCheckMethodList(Integer pageNo, Integer pageSize, String checkType, String name, String packageName) {
|
||||
LambdaQueryWrapper<CheckMethod> wrapper = new LambdaQueryWrapper<>();
|
||||
if (checkType != null && ObjectUtil.isNotEmpty(checkType)) {
|
||||
wrapper.eq(CheckMethod::getCheckType, checkType);
|
||||
}
|
||||
if (name != null && ObjectUtil.isNotEmpty(name)) {
|
||||
wrapper.like(CheckMethod::getName, name);
|
||||
}
|
||||
if (packageName != null && ObjectUtil.isNotEmpty(packageName)) {
|
||||
wrapper.eq(CheckMethod::getPackageName, packageName);
|
||||
}
|
||||
List<CheckMethod> list = checkMethodService.list(wrapper);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> addCheckMethod(CheckMethod checkMethod) {
|
||||
//1.数据校验
|
||||
if (ObjectUtil.isEmpty(checkMethod.getName())) {
|
||||
return R.fail("检查方法名称不能为空!");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(checkMethod.getCode())) {
|
||||
return R.fail("检查方法代码不能为空!");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(checkMethod.getCheckType())) {
|
||||
return R.fail("检查方法的检查类型不能为空!");
|
||||
}
|
||||
//2.保存
|
||||
boolean save = checkMethodService.save(checkMethod);
|
||||
return R.ok(save);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> updateCheckMethod(CheckMethod checkMethod) {
|
||||
//1.数据校验
|
||||
if (ObjectUtil.isEmpty(checkMethod.getName())) {
|
||||
return R.fail("检查方法名称不能为空!");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(checkMethod.getCode())) {
|
||||
return R.fail("检查方法代码不能为空!");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(checkMethod.getCheckType())) {
|
||||
return R.fail("检查方法的检查类型不能为空!");
|
||||
}
|
||||
//2.更新
|
||||
boolean b = checkMethodService.updateById(checkMethod);
|
||||
return R.ok(b);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> removeCheckMethod(Integer checkMethodId) {
|
||||
boolean remove = checkMethodService.removeById(checkMethodId);
|
||||
return R.ok(remove);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> exportCheckMethod(String checkType, String name, String packageName, HttpServletResponse response) {
|
||||
LambdaQueryWrapper<CheckMethod> wrapper = new LambdaQueryWrapper<>();
|
||||
if (checkType != null && ObjectUtil.isNotEmpty(checkType)) {
|
||||
wrapper.eq(CheckMethod::getCheckType, checkType);
|
||||
}
|
||||
if (name != null && ObjectUtil.isNotEmpty(name)) {
|
||||
wrapper.like(CheckMethod::getName, name);
|
||||
}
|
||||
if (packageName != null && ObjectUtil.isNotEmpty(packageName)) {
|
||||
wrapper.eq(CheckMethod::getPackageName, packageName);
|
||||
}
|
||||
List<CheckMethod> list = checkMethodService.list(wrapper);
|
||||
|
||||
if (list.isEmpty()) {
|
||||
return R.fail("导出Excel失败,无数据。");
|
||||
}
|
||||
|
||||
try {
|
||||
// 准备表头(key对应实体的字段名)
|
||||
Map<String, String> headers = new LinkedHashMap<>();
|
||||
headers.put("checkType", "检查类型");
|
||||
headers.put("code", "方法代码");
|
||||
headers.put("name", "方法名称");
|
||||
headers.put("packageName", "套餐名称");
|
||||
headers.put("exposureNum", "曝光次数");
|
||||
headers.put("orderNum", "序号");
|
||||
headers.put("remark", "备注");
|
||||
|
||||
// 文件名,只传文字部分
|
||||
String excelName = "检查方法列表";
|
||||
// 导出到Excel
|
||||
ExcelFillerUtil.makeExcelFile(response, list, headers, excelName, null);
|
||||
} catch (IOException | IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
return R.fail("导出Excel失败:" + e.getMessage());
|
||||
}
|
||||
|
||||
return R.ok(null, "导出Excel成功");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,206 @@
|
||||
package com.openhis.web.check.appservice.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.check.domain.CheckPackage;
|
||||
import com.openhis.check.domain.CheckPackageDetail;
|
||||
import com.openhis.check.service.ICheckPackageDetailService;
|
||||
import com.openhis.check.service.ICheckPackageService;
|
||||
import com.openhis.web.check.appservice.ICheckPackageAppService;
|
||||
import com.openhis.web.check.dto.CheckPackageDetailDto;
|
||||
import com.openhis.web.check.dto.CheckPackageDto;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 检查套餐AppService实现
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-11-26
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class CheckPackageAppServiceImpl implements ICheckPackageAppService {
|
||||
|
||||
private final ICheckPackageService checkPackageService;
|
||||
private final ICheckPackageDetailService checkPackageDetailService;
|
||||
|
||||
@Override
|
||||
public R<?> getCheckPackageList() {
|
||||
try {
|
||||
List<CheckPackage> list = checkPackageService.list();
|
||||
return R.ok(list);
|
||||
} catch (Exception e) {
|
||||
log.error("获取检查套餐列表失败", e);
|
||||
return R.fail("获取检查套餐列表失败");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> getCheckPackageById(Long id) {
|
||||
try {
|
||||
CheckPackage checkPackage = checkPackageService.getById(id);
|
||||
if (checkPackage == null) {
|
||||
return R.fail("套餐不存在");
|
||||
}
|
||||
|
||||
// 获取套餐明细
|
||||
List<CheckPackageDetail> details = checkPackageDetailService.list(
|
||||
new LambdaQueryWrapper<CheckPackageDetail>()
|
||||
.eq(CheckPackageDetail::getPackageId, id)
|
||||
.orderByAsc(CheckPackageDetail::getOrderNum)
|
||||
);
|
||||
|
||||
// 转换为DTO
|
||||
CheckPackageDto dto = new CheckPackageDto();
|
||||
BeanUtils.copyProperties(checkPackage, dto);
|
||||
|
||||
List<CheckPackageDetailDto> detailDtos = details.stream().map(detail -> {
|
||||
CheckPackageDetailDto detailDto = new CheckPackageDetailDto();
|
||||
BeanUtils.copyProperties(detail, detailDto);
|
||||
return detailDto;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
dto.setItems(detailDtos);
|
||||
|
||||
return R.ok(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("获取检查套餐详情失败", e);
|
||||
return R.fail("获取检查套餐详情失败");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public R<?> addCheckPackage(CheckPackageDto checkPackageDto) {
|
||||
try {
|
||||
// 创建套餐主表数据
|
||||
CheckPackage checkPackage = new CheckPackage();
|
||||
BeanUtils.copyProperties(checkPackageDto, checkPackage);
|
||||
|
||||
// 设置套餐维护日期为当前系统日期
|
||||
checkPackage.setMaintainDate(LocalDate.now());
|
||||
checkPackage.setCreateTime(LocalDateTime.now());
|
||||
checkPackage.setUpdateTime(LocalDateTime.now());
|
||||
|
||||
// 保存套餐主表
|
||||
boolean saveResult = checkPackageService.save(checkPackage);
|
||||
if (!saveResult) {
|
||||
return R.fail("保存套餐失败");
|
||||
}
|
||||
|
||||
// 保存套餐明细
|
||||
if (checkPackageDto.getItems() != null && !checkPackageDto.getItems().isEmpty()) {
|
||||
List<CheckPackageDetail> details = new ArrayList<>();
|
||||
int orderNum = 1;
|
||||
for (CheckPackageDetailDto detailDto : checkPackageDto.getItems()) {
|
||||
CheckPackageDetail detail = new CheckPackageDetail();
|
||||
BeanUtils.copyProperties(detailDto, detail);
|
||||
detail.setPackageId(checkPackage.getId());
|
||||
detail.setOrderNum(orderNum++);
|
||||
detail.setCreateTime(LocalDateTime.now());
|
||||
detail.setUpdateTime(LocalDateTime.now());
|
||||
details.add(detail);
|
||||
}
|
||||
checkPackageDetailService.saveBatch(details);
|
||||
}
|
||||
|
||||
return R.ok(checkPackage.getId(), "保存成功");
|
||||
} catch (Exception e) {
|
||||
log.error("新增检查套餐失败", e);
|
||||
return R.fail("新增检查套餐失败: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public R<?> updateCheckPackage(CheckPackageDto checkPackageDto) {
|
||||
try {
|
||||
// 检查套餐是否存在
|
||||
CheckPackage existPackage = checkPackageService.getById(checkPackageDto.getId());
|
||||
if (existPackage == null) {
|
||||
return R.fail("套餐不存在");
|
||||
}
|
||||
|
||||
// 更新套餐主表数据
|
||||
CheckPackage checkPackage = new CheckPackage();
|
||||
BeanUtils.copyProperties(checkPackageDto, checkPackage);
|
||||
|
||||
// 更新套餐维护日期为当前系统日期
|
||||
checkPackage.setMaintainDate(LocalDate.now());
|
||||
checkPackage.setUpdateTime(LocalDateTime.now());
|
||||
|
||||
boolean updateResult = checkPackageService.updateById(checkPackage);
|
||||
if (!updateResult) {
|
||||
return R.fail("更新套餐失败");
|
||||
}
|
||||
|
||||
// 删除原有明细
|
||||
checkPackageDetailService.remove(
|
||||
new LambdaQueryWrapper<CheckPackageDetail>()
|
||||
.eq(CheckPackageDetail::getPackageId, checkPackage.getId())
|
||||
);
|
||||
|
||||
// 保存新的套餐明细
|
||||
if (checkPackageDto.getItems() != null && !checkPackageDto.getItems().isEmpty()) {
|
||||
List<CheckPackageDetail> details = new ArrayList<>();
|
||||
int orderNum = 1;
|
||||
for (CheckPackageDetailDto detailDto : checkPackageDto.getItems()) {
|
||||
CheckPackageDetail detail = new CheckPackageDetail();
|
||||
BeanUtils.copyProperties(detailDto, detail);
|
||||
detail.setPackageId(checkPackage.getId());
|
||||
detail.setOrderNum(orderNum++);
|
||||
detail.setCreateTime(LocalDateTime.now());
|
||||
detail.setUpdateTime(LocalDateTime.now());
|
||||
details.add(detail);
|
||||
}
|
||||
checkPackageDetailService.saveBatch(details);
|
||||
}
|
||||
|
||||
return R.ok("更新成功");
|
||||
} catch (Exception e) {
|
||||
log.error("更新检查套餐失败", e);
|
||||
return R.fail("更新检查套餐失败: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public R<?> deleteCheckPackage(Long id) {
|
||||
try {
|
||||
// 检查套餐是否存在
|
||||
CheckPackage existPackage = checkPackageService.getById(id);
|
||||
if (existPackage == null) {
|
||||
return R.fail("套餐不存在");
|
||||
}
|
||||
|
||||
// 删除套餐明细
|
||||
checkPackageDetailService.remove(
|
||||
new LambdaQueryWrapper<CheckPackageDetail>()
|
||||
.eq(CheckPackageDetail::getPackageId, id)
|
||||
);
|
||||
|
||||
// 删除套餐主表
|
||||
boolean deleteResult = checkPackageService.removeById(id);
|
||||
if (!deleteResult) {
|
||||
return R.fail("删除套餐失败");
|
||||
}
|
||||
|
||||
return R.ok("删除成功");
|
||||
} catch (Exception e) {
|
||||
log.error("删除检查套餐失败", e);
|
||||
return R.fail("删除检查套餐失败: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
package com.openhis.web.check.appservice.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.check.domain.CheckPart;
|
||||
import com.openhis.check.service.ICheckPartService;
|
||||
import com.openhis.web.check.appservice.ICheckPartAppService;
|
||||
import com.openhis.web.reportmanage.utils.ExcelFillerUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@Service
|
||||
@Slf4j
|
||||
public class CheckPartAppServiceImpl implements ICheckPartAppService {
|
||||
@Resource
|
||||
private ICheckPartService checkPartService;
|
||||
@Override
|
||||
public R<?> getCheckPartList() {
|
||||
List<CheckPart> list = checkPartService.list();
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> searchCheckPartList(Integer pageNo, Integer pageSize, String checkType, String name, String packageName) {
|
||||
LambdaQueryWrapper<CheckPart> wrapper = new LambdaQueryWrapper<>();
|
||||
if (checkType != null && ObjectUtil.isNotEmpty(checkType)) {
|
||||
wrapper.eq(CheckPart::getCheckType, checkType);
|
||||
}
|
||||
if (name != null && ObjectUtil.isNotEmpty(name)) {
|
||||
wrapper.like(CheckPart::getName, name);
|
||||
}
|
||||
if (packageName != null && ObjectUtil.isNotEmpty(packageName)) {
|
||||
wrapper.eq(CheckPart::getPackageName, packageName);
|
||||
}
|
||||
List<CheckPart> list = checkPartService.list(wrapper);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> addCheckPart(CheckPart checkPart) {
|
||||
//数据检验
|
||||
|
||||
//保存
|
||||
boolean save = checkPartService.save(checkPart);
|
||||
return R.ok(save);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> removeCheckPart(Integer checkPartId) {
|
||||
boolean remove = checkPartService.removeById(checkPartId);
|
||||
return R.ok(remove);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> updateCheckPart(CheckPart checkPart) {
|
||||
boolean b = checkPartService.updateById(checkPart);
|
||||
return R.ok(b);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> exportCheckPart(String checkType, String name, String packageName, HttpServletResponse response) {
|
||||
LambdaQueryWrapper<CheckPart> wrapper = new LambdaQueryWrapper<>();
|
||||
if (checkType != null && ObjectUtil.isNotEmpty(checkType)) {
|
||||
wrapper.eq(CheckPart::getCheckType, checkType);
|
||||
}
|
||||
if (name != null && ObjectUtil.isNotEmpty(name)) {
|
||||
wrapper.like(CheckPart::getName, name);
|
||||
}
|
||||
if (packageName != null && ObjectUtil.isNotEmpty(packageName)) {
|
||||
wrapper.eq(CheckPart::getPackageName, packageName);
|
||||
}
|
||||
List<CheckPart> list = checkPartService.list(wrapper);
|
||||
|
||||
if (list.isEmpty()) {
|
||||
return R.fail("导出Excel失败,无数据。");
|
||||
}
|
||||
|
||||
try {
|
||||
// 准备表头(key对应实体的字段名)
|
||||
Map<String, String> headers = new LinkedHashMap<>();
|
||||
headers.put("checkType", "检查类型");
|
||||
headers.put("code", "部位代码");
|
||||
headers.put("name", "部位名称");
|
||||
headers.put("packageName", "套餐名称");
|
||||
headers.put("exposureNum", "曝光次数");
|
||||
headers.put("price", "金额");
|
||||
headers.put("number", "序号");
|
||||
headers.put("serviceScope", "服务范围");
|
||||
headers.put("subType", "下级医技类型");
|
||||
headers.put("remark", "备注");
|
||||
|
||||
// 文件名,只传文字部分
|
||||
String excelName = "检查部位列表";
|
||||
// 导出到Excel
|
||||
ExcelFillerUtil.makeExcelFile(response, list, headers, excelName, null);
|
||||
} catch (IOException | IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
return R.fail("导出Excel失败:" + e.getMessage());
|
||||
}
|
||||
return R.ok(null, "导出Excel成功");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.openhis.web.check.appservice.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.check.domain.LisGroupInfo;
|
||||
import com.openhis.check.service.ILisGroupInfoService;
|
||||
import com.openhis.web.check.appservice.ILisGroupInfoAppService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class LisGroupInfoAppServiceImpl implements ILisGroupInfoAppService {
|
||||
@Resource
|
||||
private ILisGroupInfoService lisGroupInfoService;
|
||||
@Override
|
||||
public R<?> getLisGroupInfoList() {
|
||||
List<LisGroupInfo> list = lisGroupInfoService.list();
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> add(LisGroupInfo lisGroupInfo) {
|
||||
if (ObjectUtil.isEmpty(lisGroupInfo)) {
|
||||
return R.fail("信息不能为空");
|
||||
}
|
||||
boolean save = lisGroupInfoService.save(lisGroupInfo);
|
||||
return R.ok(save);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> update(LisGroupInfo lisGroupInfo) {
|
||||
if (ObjectUtil.isEmpty(lisGroupInfo)) {
|
||||
return R.fail("信息不能为空");
|
||||
}
|
||||
boolean update = lisGroupInfoService.updateById(lisGroupInfo);
|
||||
return R.ok( update);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> delete(Integer lisGroupInfoId) {
|
||||
boolean b = lisGroupInfoService.removeById(lisGroupInfoId);
|
||||
return R.ok(b);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.openhis.web.check.controller;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.check.domain.CheckMethod;
|
||||
import com.openhis.web.check.appservice.ICheckMethodAppService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
|
||||
@RestController
|
||||
@Slf4j
|
||||
@RequestMapping("/check/method")
|
||||
public class CheckMethodController {
|
||||
@Resource
|
||||
private ICheckMethodAppService checkMethodAppService;
|
||||
|
||||
/*
|
||||
* 获取检查方法
|
||||
* @Param 此处参数注释有问题,完全是按照需求给的图来注释的
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public R<?> getCheckMethodList(){
|
||||
return R.ok(checkMethodAppService.getCheckMethodList());
|
||||
}
|
||||
|
||||
/*
|
||||
* 条件查询检查方法
|
||||
* @Para
|
||||
* */
|
||||
@GetMapping("/search")
|
||||
public R<?> searchCheckMethodList(
|
||||
@RequestParam(required = false) Integer pageNo,
|
||||
@RequestParam(required = false) Integer pageSize,
|
||||
@RequestParam(required = false) String checkType,
|
||||
@RequestParam(required = false) String name,
|
||||
@RequestParam(required = false) String packageName) {
|
||||
return R.ok(checkMethodAppService.searchCheckMethodList(pageNo,pageSize,checkType,name,packageName));
|
||||
}
|
||||
|
||||
/*
|
||||
* 新增检查方法
|
||||
* @Param
|
||||
*/
|
||||
@PostMapping("/add")
|
||||
public R<?> addCheckMethod(@RequestBody CheckMethod checkMethod){
|
||||
return R.ok(checkMethodAppService.addCheckMethod(checkMethod));
|
||||
}
|
||||
|
||||
/*
|
||||
* 删除检查方法
|
||||
* @Param code代码
|
||||
*/
|
||||
@DeleteMapping("/delete/{checkMethodId}")
|
||||
public R<?> deleteCheckMethod(@PathVariable Integer checkMethodId){
|
||||
return R.ok(checkMethodAppService.removeCheckMethod(checkMethodId));
|
||||
}
|
||||
|
||||
/*
|
||||
* 更新检查方法
|
||||
* @Param
|
||||
*/
|
||||
@PutMapping("/update")
|
||||
public R<?> updateCheckMethod(@RequestBody CheckMethod checkMethod){
|
||||
return R.ok(checkMethodAppService.updateCheckMethod(checkMethod));
|
||||
}
|
||||
|
||||
/*
|
||||
* 导出检查方法列表
|
||||
* @Param
|
||||
*/
|
||||
@GetMapping("/export")
|
||||
public void exportCheckMethod(
|
||||
@RequestParam(required = false) String checkType,
|
||||
@RequestParam(required = false) String name,
|
||||
@RequestParam(required = false) String packageName,
|
||||
HttpServletResponse response) {
|
||||
checkMethodAppService.exportCheckMethod(checkType, name, packageName, response);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.openhis.web.check.controller;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.check.domain.CheckPart;
|
||||
import com.openhis.web.check.appservice.ICheckPartAppService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@RestController
|
||||
@Slf4j
|
||||
@RequestMapping("/check/part")
|
||||
public class CheckPartController {
|
||||
@Resource
|
||||
private ICheckPartAppService checkPartAppService;
|
||||
|
||||
/*
|
||||
* 获取检查部位
|
||||
* @Param检查方法 此处参数注释有问题,完全是按照需求给的图来注释的
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public R<?> getCheckPartList(){
|
||||
return R.ok(checkPartAppService.getCheckPartList());
|
||||
}
|
||||
|
||||
/*
|
||||
* 条件搜索检查部位
|
||||
* @Param
|
||||
* */
|
||||
@GetMapping("/search")
|
||||
public R<?> searchCheckPartList(@RequestParam(required = false) Integer pageNo,
|
||||
@RequestParam(required = false) Integer pageSize,
|
||||
@RequestParam(required = false) String checkType,
|
||||
@RequestParam(required = false) String name,
|
||||
@RequestParam(required = false) String packageName){
|
||||
return R.ok(checkPartAppService.searchCheckPartList(pageNo,pageSize,checkType,name,packageName));
|
||||
}
|
||||
|
||||
/*
|
||||
* 新增检查部位
|
||||
* @Param
|
||||
*/
|
||||
@PostMapping("/add")
|
||||
public R<?> addCheckPart(@RequestBody CheckPart checkPart){
|
||||
return R.ok(checkPartAppService.addCheckPart(checkPart));
|
||||
}
|
||||
|
||||
/*
|
||||
* 删除检查部位
|
||||
* @Param code代码
|
||||
*/
|
||||
@DeleteMapping("/delete/{checkPartId}")
|
||||
public R<?> deleteCheckPart(@PathVariable Integer checkPartId){
|
||||
return R.ok(checkPartAppService.removeCheckPart(checkPartId));
|
||||
}
|
||||
|
||||
/*
|
||||
* 更新检查部位
|
||||
* @Param
|
||||
*/
|
||||
@PutMapping("/update")
|
||||
public R<?> updateCheckPart(@RequestBody CheckPart checkPart){
|
||||
return R.ok(checkPartAppService.updateCheckPart(checkPart));
|
||||
}
|
||||
|
||||
/*
|
||||
* 导出检查部位列表
|
||||
* @Param
|
||||
*/
|
||||
@GetMapping("/export")
|
||||
public void exportCheckPart(
|
||||
@RequestParam(required = false) String checkType,
|
||||
@RequestParam(required = false) String name,
|
||||
@RequestParam(required = false) String packageName,
|
||||
HttpServletResponse response) {
|
||||
checkPartAppService.exportCheckPart(checkType, name, packageName, response);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,186 @@
|
||||
package com.openhis.web.check.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.core.common.core.controller.BaseController;
|
||||
import com.core.common.core.domain.AjaxResult;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.check.domain.CheckMethod;
|
||||
import com.openhis.check.domain.CheckPackage;
|
||||
import com.openhis.check.domain.CheckPart;
|
||||
import com.openhis.check.domain.CheckType;
|
||||
import com.openhis.check.service.ICheckMethodService;
|
||||
import com.openhis.check.service.ICheckPackageService;
|
||||
import com.openhis.check.service.ICheckPartService;
|
||||
import com.openhis.check.service.ICheckTypeService;
|
||||
import com.openhis.web.check.appservice.ICheckPackageAppService;
|
||||
import com.openhis.web.check.dto.CheckPackageDto;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 检查类型管理Controller
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-07-22
|
||||
* @updated 2025-11-26 - 增加套餐设置相关接口
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping({"/system/check-type", "/system"})
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class CheckTypeController extends BaseController {
|
||||
|
||||
private final ICheckTypeService checkTypeService;
|
||||
private final ICheckMethodService checkMethodService;
|
||||
private final ICheckPartService checkPartService;
|
||||
private final ICheckPackageService checkPackageService;
|
||||
private final ICheckPackageAppService checkPackageAppService;
|
||||
|
||||
/**
|
||||
* 获取检查类型列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list() {
|
||||
List<CheckType> list = checkTypeService.list();
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取检查方法列表
|
||||
*/
|
||||
@GetMapping({"/method/list", "/check-method/list"})
|
||||
public AjaxResult methodList() {
|
||||
List<CheckMethod> list = checkMethodService.list();
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取检查部位列表
|
||||
*/
|
||||
@GetMapping({"/part/list", "/check-part/list"})
|
||||
public AjaxResult partList() {
|
||||
List<CheckPart> list = checkPartService.list();
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取检查套餐列表(支持分页和筛选)
|
||||
*/
|
||||
@GetMapping({"/package/list", "/check-package/list"})
|
||||
public AjaxResult packageList(
|
||||
@RequestParam(required = false) Integer pageNo,
|
||||
@RequestParam(required = false) Integer pageSize,
|
||||
@RequestParam(required = false) String organization,
|
||||
@RequestParam(required = false) String packageName,
|
||||
@RequestParam(required = false) String packageLevel,
|
||||
@RequestParam(required = false) String packageType,
|
||||
@RequestParam(required = false) String department,
|
||||
@RequestParam(required = false) String user,
|
||||
@RequestParam(required = false) String startDate,
|
||||
@RequestParam(required = false) String endDate) {
|
||||
|
||||
LambdaQueryWrapper<CheckPackage> wrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
// 添加筛选条件
|
||||
if (organization != null && !organization.isEmpty()) {
|
||||
wrapper.eq(CheckPackage::getOrganization, organization);
|
||||
}
|
||||
if (packageName != null && !packageName.isEmpty()) {
|
||||
wrapper.like(CheckPackage::getPackageName, packageName);
|
||||
}
|
||||
if (packageLevel != null && !packageLevel.isEmpty()) {
|
||||
wrapper.eq(CheckPackage::getPackageLevel, packageLevel);
|
||||
}
|
||||
if (packageType != null && !packageType.isEmpty()) {
|
||||
wrapper.eq(CheckPackage::getPackageType, packageType);
|
||||
}
|
||||
if (department != null && !department.isEmpty()) {
|
||||
wrapper.like(CheckPackage::getDepartment, department);
|
||||
}
|
||||
if (user != null && !user.isEmpty()) {
|
||||
wrapper.like(CheckPackage::getUser, user);
|
||||
}
|
||||
if (startDate != null && !startDate.isEmpty()) {
|
||||
wrapper.ge(CheckPackage::getMaintainDate, LocalDate.parse(startDate));
|
||||
}
|
||||
if (endDate != null && !endDate.isEmpty()) {
|
||||
wrapper.le(CheckPackage::getMaintainDate, LocalDate.parse(endDate));
|
||||
}
|
||||
|
||||
// 按更新时间倒序排列
|
||||
wrapper.orderByDesc(CheckPackage::getUpdateTime);
|
||||
|
||||
// 如果需要分页
|
||||
if (pageNo != null && pageSize != null) {
|
||||
com.baomidou.mybatisplus.extension.plugins.pagination.Page<CheckPackage> page =
|
||||
new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(pageNo, pageSize);
|
||||
com.baomidou.mybatisplus.extension.plugins.pagination.Page<CheckPackage> result =
|
||||
checkPackageService.page(page, wrapper);
|
||||
return AjaxResult.success(result);
|
||||
} else {
|
||||
List<CheckPackage> list = checkPackageService.list(wrapper);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增检查类型
|
||||
*/
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody CheckType checkType) {
|
||||
return toAjax(checkTypeService.save(checkType));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改检查类型
|
||||
*/
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody CheckType checkType) {
|
||||
return toAjax(checkTypeService.updateById(checkType));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除检查类型
|
||||
*/
|
||||
@DeleteMapping("/{checkTypeId}")
|
||||
public AjaxResult remove(@PathVariable Long checkTypeId) {
|
||||
return toAjax(checkTypeService.removeById(checkTypeId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID获取检查套餐详情
|
||||
*/
|
||||
@GetMapping({"/package/{id}", "/check-package/{id}"})
|
||||
public R<?> getCheckPackageById(@PathVariable Long id) {
|
||||
return checkPackageAppService.getCheckPackageById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增检查套餐
|
||||
*/
|
||||
@PostMapping({"/package", "/check-package"})
|
||||
public R<?> addCheckPackage(@Valid @RequestBody CheckPackageDto checkPackageDto) {
|
||||
return checkPackageAppService.addCheckPackage(checkPackageDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新检查套餐
|
||||
*/
|
||||
@PutMapping({"/package", "/check-package"})
|
||||
public R<?> updateCheckPackage(@Valid @RequestBody CheckPackageDto checkPackageDto) {
|
||||
return checkPackageAppService.updateCheckPackage(checkPackageDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除检查套餐
|
||||
*/
|
||||
@DeleteMapping({"/package/{id}", "/check-package/{id}"})
|
||||
public R<?> deleteCheckPackage(@PathVariable Long id) {
|
||||
return checkPackageAppService.deleteCheckPackage(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.openhis.web.check.controller;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.check.appservice.ILisGroupInfoAppService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.openhis.check.domain.LisGroupInfo;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/check/lisGroupInfo")
|
||||
public class LisGroupInfoController {
|
||||
@Resource
|
||||
private ILisGroupInfoAppService lisGroupInfoAppService;
|
||||
|
||||
/*
|
||||
*
|
||||
* 获取Lis分组信息
|
||||
*
|
||||
* */
|
||||
@GetMapping("/list")
|
||||
public R<?> getLisGroupInfoList(){
|
||||
return R.ok(lisGroupInfoAppService.getLisGroupInfoList());
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
* 新增Lis分组信息
|
||||
*
|
||||
* */
|
||||
@PostMapping("/add")
|
||||
public R<?> addLisGroupInfo(@RequestBody LisGroupInfo lisGroupInfo){
|
||||
return R.ok(lisGroupInfoAppService.add(lisGroupInfo));
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
* 修改Lis分组信息
|
||||
*
|
||||
* */
|
||||
@PutMapping("/update")
|
||||
public R<?> updateLisGroupInfo(@RequestBody LisGroupInfo lisGroupInfo){
|
||||
return R.ok(lisGroupInfoAppService.update(lisGroupInfo));
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
* 删除Lis分组信息
|
||||
*
|
||||
* */
|
||||
@DeleteMapping("/{lisGroupInfoId}")
|
||||
public R<?> deleteLisGroupInfo(@PathVariable Integer lisGroupInfoId){
|
||||
return R.ok(lisGroupInfoAppService.delete(lisGroupInfoId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.openhis.web.check.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class CheckMethodDto {
|
||||
|
||||
/**
|
||||
* 检查方法ID
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/* 检查类型 */
|
||||
private String checkType;
|
||||
|
||||
/* 方法代码 */
|
||||
private String code;
|
||||
|
||||
/* 方法名称 */
|
||||
private String name;
|
||||
|
||||
/* 套餐名称 */
|
||||
private String packageName;
|
||||
|
||||
/* 曝光次数 */
|
||||
private Integer exposureNum;
|
||||
|
||||
/* 序号 */
|
||||
private Integer orderNum;
|
||||
|
||||
/* 备注 */
|
||||
private String remark;
|
||||
|
||||
/** 创建时间 */
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/** 更新时间 */
|
||||
private LocalDateTime updateTime;
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.openhis.web.check.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 检查套餐明细DTO
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-11-26
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class CheckPackageDetailDto {
|
||||
|
||||
/** 套餐明细ID */
|
||||
private Long id;
|
||||
|
||||
/** 套餐ID */
|
||||
private Long packageId;
|
||||
|
||||
/** 项目编号 */
|
||||
private String itemCode;
|
||||
|
||||
/** 项目名称/规格 */
|
||||
@NotBlank(message = "项目名称不能为空")
|
||||
private String itemName;
|
||||
|
||||
/** 检查项目ID(诊疗项目ID) */
|
||||
private Long checkItemId;
|
||||
|
||||
/** 剂量 */
|
||||
private String dose;
|
||||
|
||||
/** 途径 */
|
||||
private String method;
|
||||
|
||||
/** 频次 */
|
||||
private String frequency;
|
||||
|
||||
/** 天数 */
|
||||
private String days;
|
||||
|
||||
/** 数量 */
|
||||
@NotNull(message = "数量不能为空")
|
||||
private Integer quantity;
|
||||
|
||||
/** 单价 */
|
||||
@NotNull(message = "单价不能为空")
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
/** 金额 */
|
||||
private BigDecimal amount;
|
||||
|
||||
/** 服务费 */
|
||||
private BigDecimal serviceCharge;
|
||||
|
||||
/** 总金额 */
|
||||
private BigDecimal total;
|
||||
|
||||
/** 产地 */
|
||||
private String origin;
|
||||
|
||||
/** 序号 */
|
||||
private Integer orderNum;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
package com.openhis.web.check.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 检查套餐DTO
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-11-26
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class CheckPackageDto {
|
||||
|
||||
/** 检查套餐ID */
|
||||
private Long id;
|
||||
|
||||
/** 套餐名称 */
|
||||
@NotBlank(message = "套餐名称不能为空")
|
||||
private String packageName;
|
||||
|
||||
/** 套餐编码 */
|
||||
private String code;
|
||||
|
||||
/** 套餐类别 */
|
||||
@NotBlank(message = "套餐类别不能为空")
|
||||
private String packageType;
|
||||
|
||||
/** 套餐级别 */
|
||||
@NotBlank(message = "套餐级别不能为空")
|
||||
private String packageLevel;
|
||||
|
||||
/** 适用科室 */
|
||||
private String department;
|
||||
|
||||
/** 适用用户 */
|
||||
private String user;
|
||||
|
||||
/** 卫生机构 */
|
||||
private String organization;
|
||||
|
||||
/** 套餐金额 */
|
||||
private BigDecimal packagePrice;
|
||||
|
||||
/** 折扣 */
|
||||
private BigDecimal discount;
|
||||
|
||||
/** 制单人 */
|
||||
private String creator;
|
||||
|
||||
/** 是否停用 */
|
||||
private Integer isDisabled;
|
||||
|
||||
/** 显示套餐名 */
|
||||
private Integer showPackageName;
|
||||
|
||||
/** 生成服务费 */
|
||||
private Integer generateServiceFee;
|
||||
|
||||
/** 套餐价格启用状态 */
|
||||
private Integer packagePriceEnabled;
|
||||
|
||||
/** 服务费 */
|
||||
private BigDecimal serviceFee;
|
||||
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
/** 描述 */
|
||||
private String description;
|
||||
|
||||
/** 套餐维护日期 */
|
||||
private LocalDate createDate;
|
||||
|
||||
/** 套餐明细列表 */
|
||||
@NotNull(message = "套餐明细不能为空")
|
||||
private List<CheckPackageDetailDto> items;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.openhis.web.check.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class CheckPartDto {
|
||||
/** 检查部位id */
|
||||
private Long id;
|
||||
|
||||
/** 检查部位名称 */
|
||||
private String name;
|
||||
|
||||
/** 检查部位编码 */
|
||||
private String code;
|
||||
|
||||
/** 检查部位检查类型 */
|
||||
private String checkType;
|
||||
|
||||
/** 曝光次数 */
|
||||
private Integer exposureNum;
|
||||
|
||||
/** 费用套餐 */
|
||||
private String packageName;
|
||||
|
||||
/** 金额 */
|
||||
private Double price;
|
||||
|
||||
/** 序号 */
|
||||
private Integer number;
|
||||
|
||||
/** 服务范围 */
|
||||
private String serviceScope;
|
||||
|
||||
/** 下级医技类型 */
|
||||
private String subType;
|
||||
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.openhis.web.check.mapper;
|
||||
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
|
||||
@Repository
|
||||
public interface CheckMethodAppMapper{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.openhis.web.check.mapper;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public interface CheckPartAppMapper {
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.openhis.web.check.mapper;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public interface LisGroupInfoAppMapper {
|
||||
}
|
||||
@@ -29,7 +29,7 @@ public interface ICommonService {
|
||||
/**
|
||||
* 药房列表(库房用)
|
||||
*
|
||||
* @return 药房列表
|
||||
* @return 药房列表1
|
||||
*/
|
||||
List<LocationDto> getInventoryPharmacyList();
|
||||
|
||||
@@ -79,7 +79,7 @@ public interface ICommonService {
|
||||
* @return 库存项目信息
|
||||
*/
|
||||
R<?> getInventoryItemList(InventoryItemParam inventoryItemParam, String searchKey, Integer pageNo,
|
||||
Integer pageSize);
|
||||
Integer pageSize);
|
||||
|
||||
/**
|
||||
* 根据项目相关信息查询项目库存相关信息
|
||||
|
||||
@@ -10,6 +10,7 @@ import java.util.stream.Collectors;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
@@ -106,6 +107,7 @@ public class CommonServiceImpl implements ICommonService {
|
||||
public List<LocationDto> getPharmacyList() {
|
||||
|
||||
List<Location> pharmacyList = locationService.getPharmacyList();
|
||||
|
||||
List<LocationDto> locationDtoList = new ArrayList<>();
|
||||
LocationDto locationDto;
|
||||
for (Location location : pharmacyList) {
|
||||
@@ -113,6 +115,7 @@ public class CommonServiceImpl implements ICommonService {
|
||||
BeanUtils.copyProperties(location, locationDto);
|
||||
locationDtoList.add(locationDto);
|
||||
}
|
||||
|
||||
return locationDtoList;
|
||||
}
|
||||
|
||||
@@ -260,20 +263,20 @@ public class CommonServiceImpl implements ICommonService {
|
||||
*/
|
||||
@Override
|
||||
public R<?> getInventoryItemList(InventoryItemParam inventoryItemParam, String searchKey, Integer pageNo,
|
||||
Integer pageSize) {
|
||||
Integer pageSize) {
|
||||
Integer purchaseFlag = inventoryItemParam.getPurchaseFlag();
|
||||
inventoryItemParam.setPurchaseFlag(null);
|
||||
|
||||
// 构建查询条件
|
||||
QueryWrapper<InventoryItemParam> queryWrapper = HisQueryUtils.buildQueryWrapper(inventoryItemParam, searchKey,
|
||||
new HashSet<>(Arrays.asList(CommonConstants.FieldName.Name, CommonConstants.FieldName.PyStr,
|
||||
CommonConstants.FieldName.WbStr)),
|
||||
null);
|
||||
new HashSet<>(Arrays.asList(CommonConstants.FieldName.Name, CommonConstants.FieldName.PyStr,
|
||||
CommonConstants.FieldName.WbStr)),
|
||||
null);
|
||||
// 查询库存项目信息
|
||||
IPage<InventoryItemDto> inventoryItems = commonAppMapper.selectInventoryItemList(new Page<>(pageNo, pageSize),
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, CommonConstants.TableName.ADM_DEVICE_DEFINITION,
|
||||
ItemType.MEDICINE.getValue(), ItemType.DEVICE.getValue(), purchaseFlag, ConditionCode.PURCHASE.getCode(),
|
||||
PublicationStatus.RETIRED.getValue(), queryWrapper);
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, CommonConstants.TableName.ADM_DEVICE_DEFINITION,
|
||||
ItemType.MEDICINE.getValue(), ItemType.DEVICE.getValue(), purchaseFlag, ConditionCode.PURCHASE.getCode(),
|
||||
PublicationStatus.RETIRED.getValue(), queryWrapper);
|
||||
List<InventoryItemDto> inventoryItemDtoList = inventoryItems.getRecords();
|
||||
inventoryItemDtoList.forEach(e -> {
|
||||
// 项目类型
|
||||
@@ -300,9 +303,9 @@ public class CommonServiceImpl implements ICommonService {
|
||||
public R<?> getInventoryItemInfo(InventoryItemParam inventoryItemParam) {
|
||||
// 查询项目库存相关信息
|
||||
List<LocationInventoryDto> locationInventoryDtoList = commonAppMapper.selectInventoryItemInfo(
|
||||
inventoryItemParam.getOrgLocationId(), CommonConstants.TableName.MED_MEDICATION_DEFINITION,
|
||||
CommonConstants.TableName.ADM_DEVICE_DEFINITION, inventoryItemParam.getObjLocationId(),
|
||||
inventoryItemParam.getLotNumber(), inventoryItemParam.getItemId(), ConditionCode.PURCHASE.getCode());
|
||||
inventoryItemParam.getOrgLocationId(), CommonConstants.TableName.MED_MEDICATION_DEFINITION,
|
||||
CommonConstants.TableName.ADM_DEVICE_DEFINITION, inventoryItemParam.getObjLocationId(),
|
||||
inventoryItemParam.getLotNumber(), inventoryItemParam.getItemId(), ConditionCode.PURCHASE.getCode());
|
||||
|
||||
// 医保编码和生产厂家校验
|
||||
for (LocationInventoryDto dto : locationInventoryDtoList) {
|
||||
@@ -346,7 +349,7 @@ public class CommonServiceImpl implements ICommonService {
|
||||
if (traceNo != null && !StringUtils.isEmpty(traceNo)) {
|
||||
// 数据源更改
|
||||
InventoryItem inventoryItem = inventoryItemService.getOne(
|
||||
new LambdaQueryWrapper<InventoryItem>().like(InventoryItem::getTraceNo, traceNo).last("LIMIT 1"));
|
||||
new LambdaQueryWrapper<InventoryItem>().like(InventoryItem::getTraceNo, traceNo).last("LIMIT 1"));
|
||||
if (inventoryItem != null) {
|
||||
String itemId = inventoryItem.getItemId().toString();
|
||||
// TraceNoManage traceNoManage = commonAppMapper.getInfoByTraceNo("%" + traceNo + "%");
|
||||
@@ -380,11 +383,11 @@ public class CommonServiceImpl implements ICommonService {
|
||||
// 判断传入的是药品还是耗材,查询追溯码状态只有进的数据
|
||||
if (searchTraceNoParam.getItemType().equals(ItemType.MEDICINE.getValue())) {
|
||||
traceNoManageList = traceNoManageMapper.getItemTraceNoInfo(
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, searchTraceNoParam.getItemId(),
|
||||
searchTraceNoParam.getLocationId(), searchTraceNoParam.getLotNumber());
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, searchTraceNoParam.getItemId(),
|
||||
searchTraceNoParam.getLocationId(), searchTraceNoParam.getLotNumber());
|
||||
} else if (searchTraceNoParam.getItemType().equals(ItemType.DEVICE.getValue())) {
|
||||
traceNoManageList = traceNoManageMapper.getItemTraceNoInfo(CommonConstants.TableName.ADM_DEVICE_DEFINITION,
|
||||
searchTraceNoParam.getItemId(), searchTraceNoParam.getLocationId(), searchTraceNoParam.getLotNumber());
|
||||
searchTraceNoParam.getItemId(), searchTraceNoParam.getLocationId(), searchTraceNoParam.getLotNumber());
|
||||
}
|
||||
if (traceNoManageList != null) {
|
||||
for (TraceNoManage traceNoItem : traceNoManageList) {
|
||||
@@ -402,8 +405,8 @@ public class CommonServiceImpl implements ICommonService {
|
||||
@Override
|
||||
public R<?> getContractMetadata() {
|
||||
// TODO: Contract表的基础数据维护还没做,具体不知道状态字段的取值是什么,先查询默认值为0的数据
|
||||
List<Contract> ContractList =
|
||||
contractMapper.selectList(new LambdaQueryWrapper<Contract>().eq(Contract::getStatusEnum, 0));
|
||||
List<Contract> ContractList
|
||||
= contractMapper.selectList(new LambdaQueryWrapper<Contract>().eq(Contract::getStatusEnum, 0));
|
||||
// 复制同名字段并 return
|
||||
return R.ok(ContractList.stream().map(contract -> {
|
||||
ContractMetadata metadata = new ContractMetadata();
|
||||
@@ -440,8 +443,8 @@ public class CommonServiceImpl implements ICommonService {
|
||||
Location location = locationService.getById(locationId);
|
||||
// 查询所有子集位置
|
||||
List<Location> childLocations = locationService.list(new LambdaQueryWrapper<Location>()
|
||||
.likeRight(Location::getBusNo, location.getBusNo()).eq(Location::getFormEnum, locationForm)
|
||||
.ne(Location::getStatusEnum, LocationStatus.INACTIVE.getValue()));
|
||||
.likeRight(Location::getBusNo, location.getBusNo()).eq(Location::getFormEnum, locationForm)
|
||||
.ne(Location::getStatusEnum, LocationStatus.INACTIVE.getValue()));
|
||||
List<LocationDto> locationDtoList = new ArrayList<>();
|
||||
LocationDto locationDto;
|
||||
for (Location childLocation : childLocations) {
|
||||
@@ -463,8 +466,8 @@ public class CommonServiceImpl implements ICommonService {
|
||||
// 查询当前登录者管理的病区
|
||||
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||
List<Long> locationIds = practitionerRoleService.getLocationIdsByPractitionerId(practitionerId);
|
||||
List<Location> locationList =
|
||||
locationService.getLocationList(locationIds, Collections.singletonList(LocationStatus.ACTIVE.getValue()));
|
||||
List<Location> locationList
|
||||
= locationService.getLocationList(locationIds, Collections.singletonList(LocationStatus.ACTIVE.getValue()));
|
||||
List<Location> wardList = new ArrayList<>();
|
||||
for (Location ward : locationList) {
|
||||
if (LocationForm.WARD.getValue().equals(ward.getFormEnum())) {
|
||||
@@ -510,12 +513,12 @@ public class CommonServiceImpl implements ICommonService {
|
||||
advicePrintInfoDto = commonAppMapper.selectTreatmentPrintInfo(requestIds);
|
||||
}
|
||||
advicePrintInfoDto
|
||||
.setAge(advicePrintInfoDto.getBirthDate() != null
|
||||
? AgeCalculatorUtil.getAge(advicePrintInfoDto.getBirthDate()) : "")
|
||||
.setGenderEnum_enumText(
|
||||
EnumUtils.getInfoByValue(AdministrativeGender.class, advicePrintInfoDto.getGenderEnum()))
|
||||
.setEncounterYbClass_enumText(
|
||||
EnumUtils.getInfoByValue(EncounterYbClass.class, advicePrintInfoDto.getEncounterYbClass()));
|
||||
.setAge(advicePrintInfoDto.getBirthDate() != null
|
||||
? AgeCalculatorUtil.getAge(advicePrintInfoDto.getBirthDate()) : "")
|
||||
.setGenderEnum_enumText(
|
||||
EnumUtils.getInfoByValue(AdministrativeGender.class, advicePrintInfoDto.getGenderEnum()))
|
||||
.setEncounterYbClass_enumText(
|
||||
EnumUtils.getInfoByValue(EncounterYbClass.class, advicePrintInfoDto.getEncounterYbClass()));
|
||||
if (advicePrintInfoDto.getChrgitmLv() != null) {
|
||||
advicePrintInfoDto
|
||||
.setChrgitmLv_enumText(EnumUtils.getInfoByValue(InsuranceLevel.class, advicePrintInfoDto.getChrgitmLv()));
|
||||
@@ -542,8 +545,8 @@ public class CommonServiceImpl implements ICommonService {
|
||||
@Override
|
||||
public R<?> getSupplierList() {
|
||||
return R.ok(supplierService.list(new LambdaQueryWrapper<Supplier>().select(Supplier::getId, Supplier::getName)
|
||||
.eq(Supplier::getTypeEnum, SupplierType.SUPPLIER.getValue())
|
||||
.eq(Supplier::getDeleteFlag, DelFlag.NO.getCode()).eq(Supplier::getActiveFlag, Whether.YES.getValue())));
|
||||
.eq(Supplier::getTypeEnum, SupplierType.SUPPLIER.getValue())
|
||||
.eq(Supplier::getDeleteFlag, DelFlag.NO.getCode()).eq(Supplier::getActiveFlag, Whether.YES.getValue())));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -563,16 +566,16 @@ public class CommonServiceImpl implements ICommonService {
|
||||
*/
|
||||
@Override
|
||||
public R<?> getBackupNoList() {
|
||||
List<DocInventoryItemStatic> docInventoryItemStaticList =
|
||||
iDocInventoryItemStaticService.list(new LambdaQueryWrapper<DocInventoryItemStatic>()
|
||||
.eq(DocInventoryItemStatic::getDeleteFlag, DelFlag.NO.getCode())
|
||||
.eq(DocInventoryItemStatic::getTenantId, SecurityUtils.getLoginUser().getTenantId()));
|
||||
List<DocInventoryItemStatic> docInventoryItemStaticList
|
||||
= iDocInventoryItemStaticService.list(new LambdaQueryWrapper<DocInventoryItemStatic>()
|
||||
.eq(DocInventoryItemStatic::getDeleteFlag, DelFlag.NO.getCode())
|
||||
.eq(DocInventoryItemStatic::getTenantId, SecurityUtils.getLoginUser().getTenantId()));
|
||||
if (docInventoryItemStaticList.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
// 直接去重并按BusNo倒序排序
|
||||
List<String> busNoList = docInventoryItemStaticList.stream().map(DocInventoryItemStatic::getBusNo).distinct() // 去重
|
||||
.sorted(Comparator.reverseOrder()).collect(Collectors.toList());
|
||||
.sorted(Comparator.reverseOrder()).collect(Collectors.toList());
|
||||
return R.ok(busNoList);
|
||||
}
|
||||
|
||||
@@ -586,27 +589,27 @@ public class CommonServiceImpl implements ICommonService {
|
||||
public R<?> lotNumberMatch(List<Long> encounterIdList) {
|
||||
// 查询患者待发放的药品信息
|
||||
List<MedicationDispense> medicationDispenseList = medicationDispenseService
|
||||
.list(new LambdaQueryWrapper<MedicationDispense>().in(MedicationDispense::getEncounterId, encounterIdList)
|
||||
.eq(MedicationDispense::getStatusEnum, DispenseStatus.PREPARATION.getValue())
|
||||
.eq(MedicationDispense::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
.list(new LambdaQueryWrapper<MedicationDispense>().in(MedicationDispense::getEncounterId, encounterIdList)
|
||||
.eq(MedicationDispense::getStatusEnum, DispenseStatus.PREPARATION.getValue())
|
||||
.eq(MedicationDispense::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
// 药品批号匹配
|
||||
if (medicationDispenseList != null && !medicationDispenseList.isEmpty()) {
|
||||
// 获取待发放的药品id
|
||||
List<Long> medicationIdList =
|
||||
medicationDispenseList.stream().map(MedicationDispense::getMedicationId).distinct().toList();
|
||||
List<Long> medicationIdList
|
||||
= medicationDispenseList.stream().map(MedicationDispense::getMedicationId).distinct().toList();
|
||||
// 获取发药药房
|
||||
List<Long> locationIdList =
|
||||
medicationDispenseList.stream().map(MedicationDispense::getLocationId).distinct().toList();
|
||||
List<Long> locationIdList
|
||||
= medicationDispenseList.stream().map(MedicationDispense::getLocationId).distinct().toList();
|
||||
|
||||
// 查询待发放药品的库存明细
|
||||
List<InventoryDetailDto> inventoryDetailList = commonAppMapper
|
||||
.selectMedicineInventoryDetail(medicationIdList, locationIdList, PublicationStatus.ACTIVE.getValue());
|
||||
.selectMedicineInventoryDetail(medicationIdList, locationIdList, PublicationStatus.ACTIVE.getValue());
|
||||
if (inventoryDetailList == null || inventoryDetailList.isEmpty()) {
|
||||
return R.fail("发药单生成失败,请检查药品库存");
|
||||
}
|
||||
// 将库存信息根据药品id和库房id进行分组
|
||||
Map<String, List<InventoryDetailDto>> inventoryDetailMap = inventoryDetailList.stream()
|
||||
.collect(Collectors.groupingBy(x -> x.getItemId() + CommonConstants.Common.DASH + x.getLocationId()));
|
||||
.collect(Collectors.groupingBy(x -> x.getItemId() + CommonConstants.Common.DASH + x.getLocationId()));
|
||||
// 按照效期排序(先进先出)
|
||||
for (List<InventoryDetailDto> inventoryList : inventoryDetailMap.values()) {
|
||||
inventoryList.sort(Comparator.comparing(InventoryDetailDto::getExpirationDate));
|
||||
@@ -619,7 +622,7 @@ public class CommonServiceImpl implements ICommonService {
|
||||
currentIndex++;
|
||||
// 根据发放药品和发放药房做key
|
||||
String inventoryKey = medicationDispense.getMedicationId() + CommonConstants.Common.DASH
|
||||
+ medicationDispense.getLocationId();
|
||||
+ medicationDispense.getLocationId();
|
||||
// 查询对应的库存信息
|
||||
if (!inventoryDetailMap.containsKey(inventoryKey)) {
|
||||
return R.fail("药品库存不存在,药品ID: " + medicationDispense.getMedicationId());
|
||||
@@ -644,8 +647,8 @@ public class CommonServiceImpl implements ICommonService {
|
||||
}
|
||||
|
||||
// 获取库存剩余数量
|
||||
BigDecimal remainingInventoryQuantity =
|
||||
inventoryDetailDto.getInventoryQuantity().subtract(dispenseQuantity);
|
||||
BigDecimal remainingInventoryQuantity
|
||||
= inventoryDetailDto.getInventoryQuantity().subtract(dispenseQuantity);
|
||||
// 如果剩余库存数量大于等于0,则说明当前批号库存充足
|
||||
if (remainingInventoryQuantity.compareTo(BigDecimal.ZERO) >= 0) {
|
||||
medicationDispense.setLotNumber(inventoryDetailDto.getInventoryLotNumber());
|
||||
@@ -656,7 +659,7 @@ public class CommonServiceImpl implements ICommonService {
|
||||
if (!inventoryDetailDto.getInventoryUnitCode().equals(medicationDispense.getUnitCode())) {
|
||||
// 发药数量取库存大单位数量
|
||||
dispenseQuantity = inventoryDetailDto.getInventoryQuantity()
|
||||
.divide(inventoryDetailDto.getPartPercent(), 0, RoundingMode.HALF_UP);
|
||||
.divide(inventoryDetailDto.getPartPercent(), 0, RoundingMode.HALF_UP);
|
||||
// 大单位数量不足则跳出循环
|
||||
if (dispenseQuantity.compareTo(BigDecimal.ZERO) == 0) {
|
||||
continue;
|
||||
@@ -671,10 +674,10 @@ public class CommonServiceImpl implements ICommonService {
|
||||
BeanUtils.copyProperties(medicationDispense, splitMedicationDispense);
|
||||
// 数量拆分
|
||||
splitMedicationDispense.setQuantity(medicationDispense.getQuantity().subtract(dispenseQuantity))
|
||||
// 重置id与批号
|
||||
.setId(null).setLotNumber(null)
|
||||
// 重新生成发药单编码
|
||||
.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.MEDICATION_DIS_NO.getPrefix(), 4));
|
||||
// 重置id与批号
|
||||
.setId(null).setLotNumber(null)
|
||||
// 重新生成发药单编码
|
||||
.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.MEDICATION_DIS_NO.getPrefix(), 4));
|
||||
// 将拆分出来的发药单添加到原发药单列表中
|
||||
medicationDispenseList.add(splitMedicationDispense);
|
||||
|
||||
@@ -701,27 +704,27 @@ public class CommonServiceImpl implements ICommonService {
|
||||
}
|
||||
// 查询患者待发放的耗材信息
|
||||
List<DeviceDispense> deviceDispenseList = deviceDispenseService
|
||||
.list(new LambdaQueryWrapper<DeviceDispense>().in(DeviceDispense::getEncounterId, encounterIdList)
|
||||
.eq(DeviceDispense::getStatusEnum, DispenseStatus.PREPARATION.getValue())
|
||||
.eq(DeviceDispense::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
.list(new LambdaQueryWrapper<DeviceDispense>().in(DeviceDispense::getEncounterId, encounterIdList)
|
||||
.eq(DeviceDispense::getStatusEnum, DispenseStatus.PREPARATION.getValue())
|
||||
.eq(DeviceDispense::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
// 耗材批号匹配
|
||||
if (deviceDispenseList != null && !deviceDispenseList.isEmpty()) {
|
||||
// 获取待发放的耗材id
|
||||
List<Long> deviceIdList =
|
||||
deviceDispenseList.stream().map(DeviceDispense::getDeviceDefId).distinct().toList();
|
||||
List<Long> deviceIdList
|
||||
= deviceDispenseList.stream().map(DeviceDispense::getDeviceDefId).distinct().toList();
|
||||
// 获取发耗材房
|
||||
List<Long> locationIdList =
|
||||
deviceDispenseList.stream().map(DeviceDispense::getLocationId).distinct().toList();
|
||||
List<Long> locationIdList
|
||||
= deviceDispenseList.stream().map(DeviceDispense::getLocationId).distinct().toList();
|
||||
|
||||
// 查询待发放耗材的库存明细
|
||||
List<InventoryDetailDto> inventoryDetailList = commonAppMapper.selectDeviceInventoryDetail(deviceIdList,
|
||||
locationIdList, PublicationStatus.ACTIVE.getValue());
|
||||
locationIdList, PublicationStatus.ACTIVE.getValue());
|
||||
if (inventoryDetailList == null || inventoryDetailList.isEmpty()) {
|
||||
return R.fail("发耗材单生成失败,请检查耗材库存");
|
||||
}
|
||||
// 将库存信息根据耗材id和库房id进行分组
|
||||
Map<String, List<InventoryDetailDto>> inventoryDetailMap = inventoryDetailList.stream()
|
||||
.collect(Collectors.groupingBy(x -> x.getItemId() + CommonConstants.Common.DASH + x.getLocationId()));
|
||||
.collect(Collectors.groupingBy(x -> x.getItemId() + CommonConstants.Common.DASH + x.getLocationId()));
|
||||
// 按照效期排序(先进先出)
|
||||
for (List<InventoryDetailDto> inventoryList : inventoryDetailMap.values()) {
|
||||
inventoryList.sort(Comparator.comparing(InventoryDetailDto::getExpirationDate));
|
||||
@@ -733,8 +736,8 @@ public class CommonServiceImpl implements ICommonService {
|
||||
DeviceDispense deviceDispense = deviceDispenseList.get(currentIndex);
|
||||
currentIndex++;
|
||||
// 根据发放耗材和发放耗材房做key
|
||||
String inventoryKey =
|
||||
deviceDispense.getDeviceDefId() + CommonConstants.Common.DASH + deviceDispense.getLocationId();
|
||||
String inventoryKey
|
||||
= deviceDispense.getDeviceDefId() + CommonConstants.Common.DASH + deviceDispense.getLocationId();
|
||||
// 查询对应的库存信息
|
||||
if (!inventoryDetailMap.containsKey(inventoryKey)) {
|
||||
return R.fail("耗材库存不存在,耗材ID: " + deviceDispense.getDeviceDefId());
|
||||
@@ -759,8 +762,8 @@ public class CommonServiceImpl implements ICommonService {
|
||||
}
|
||||
|
||||
// 获取库存剩余数量
|
||||
BigDecimal remainingInventoryQuantity =
|
||||
inventoryDetailDto.getInventoryQuantity().subtract(dispenseQuantity);
|
||||
BigDecimal remainingInventoryQuantity
|
||||
= inventoryDetailDto.getInventoryQuantity().subtract(dispenseQuantity);
|
||||
// 如果剩余库存数量大于等于0,则说明当前批号库存充足
|
||||
if (remainingInventoryQuantity.compareTo(BigDecimal.ZERO) >= 0) {
|
||||
deviceDispense.setLotNumber(inventoryDetailDto.getInventoryLotNumber());
|
||||
@@ -771,7 +774,7 @@ public class CommonServiceImpl implements ICommonService {
|
||||
if (!inventoryDetailDto.getInventoryUnitCode().equals(deviceDispense.getUnitCode())) {
|
||||
// 发耗材数量取库存大单位数量
|
||||
dispenseQuantity = inventoryDetailDto.getInventoryQuantity()
|
||||
.divide(inventoryDetailDto.getPartPercent(), 0, RoundingMode.HALF_UP);
|
||||
.divide(inventoryDetailDto.getPartPercent(), 0, RoundingMode.HALF_UP);
|
||||
// 大单位数量不足则跳出循环
|
||||
if (dispenseQuantity.compareTo(BigDecimal.ZERO) == 0) {
|
||||
continue;
|
||||
@@ -786,10 +789,10 @@ public class CommonServiceImpl implements ICommonService {
|
||||
BeanUtils.copyProperties(deviceDispense, splitDeviceDispense);
|
||||
// 数量拆分
|
||||
splitDeviceDispense.setQuantity(deviceDispense.getQuantity().subtract(dispenseQuantity))
|
||||
// 重置id与批号
|
||||
.setId(null).setLotNumber(null)
|
||||
// 重新生成发耗材单编码
|
||||
.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEVICE_DIS_NO.getPrefix(), 4));
|
||||
// 重置id与批号
|
||||
.setId(null).setLotNumber(null)
|
||||
// 重新生成发耗材单编码
|
||||
.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEVICE_DIS_NO.getPrefix(), 4));
|
||||
// 将拆分出来的发耗材单添加到原发耗材单列表中
|
||||
deviceDispenseList.add(splitDeviceDispense);
|
||||
|
||||
|
||||
@@ -117,9 +117,9 @@ public class CommonAppController {
|
||||
*/
|
||||
@GetMapping(value = "/inventory-item")
|
||||
public R<?> getInventoryItemList(InventoryItemParam inventoryItemParam,
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "50") Integer pageSize) {
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "50") Integer pageSize) {
|
||||
return commonService.getInventoryItemList(inventoryItemParam, searchKey, pageNo, pageSize);
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ public class CommonAppController {
|
||||
|
||||
/**
|
||||
* 查询参与者下拉列表
|
||||
*
|
||||
*
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @return 参与者下拉列表
|
||||
*/
|
||||
@@ -224,7 +224,7 @@ public class CommonAppController {
|
||||
|
||||
/**
|
||||
* 查询参与者签名
|
||||
*
|
||||
*
|
||||
* @param practitionerId 参与者id
|
||||
* @return 参与者签名
|
||||
*/
|
||||
|
||||
@@ -38,10 +38,10 @@ public interface CommonAppMapper {
|
||||
* @return 库存项目信息
|
||||
*/
|
||||
IPage<InventoryItemDto> selectInventoryItemList(@Param("page") Page<InventoryItemDto> page,
|
||||
@Param("medicationTableName") String medicationTableName, @Param("deviceTableName") String deviceTableName,
|
||||
@Param("medicine") Integer medicine, @Param("device") Integer device,
|
||||
@Param("purchaseFlag") Integer purchaseFlag, @Param("purchase") String purchase,
|
||||
@Param("retired") Integer retired, @Param(Constants.WRAPPER) QueryWrapper<InventoryItemParam> queryWrapper);
|
||||
@Param("medicationTableName") String medicationTableName, @Param("deviceTableName") String deviceTableName,
|
||||
@Param("medicine") Integer medicine, @Param("device") Integer device,
|
||||
@Param("purchaseFlag") Integer purchaseFlag, @Param("purchase") String purchase,
|
||||
@Param("retired") Integer retired, @Param(Constants.WRAPPER) QueryWrapper<InventoryItemParam> queryWrapper);
|
||||
|
||||
/**
|
||||
* 查询项目库存相关信息
|
||||
@@ -54,9 +54,9 @@ public interface CommonAppMapper {
|
||||
* @return 项目库存相关信息
|
||||
*/
|
||||
List<LocationInventoryDto> selectInventoryItemInfo(@Param("orgLocationId") Long orgLocationId,
|
||||
@Param("medicationTableName") String medicationTableName, @Param("deviceTableName") String deviceTableName,
|
||||
@Param("objLocationId") Long objLocationId, @Param("lotNumber") String lotNumber, @Param("itemId") Long itemId,
|
||||
@Param("purchase") String purchase);
|
||||
@Param("medicationTableName") String medicationTableName, @Param("deviceTableName") String deviceTableName,
|
||||
@Param("objLocationId") Long objLocationId, @Param("lotNumber") String lotNumber, @Param("itemId") Long itemId,
|
||||
@Param("purchase") String purchase);
|
||||
|
||||
/**
|
||||
* 查询追溯码信息
|
||||
@@ -100,7 +100,7 @@ public interface CommonAppMapper {
|
||||
|
||||
/**
|
||||
* 查询所有诊疗项目
|
||||
*
|
||||
*
|
||||
* @param statusEnum 启用状态
|
||||
* @return 诊疗项目
|
||||
*/
|
||||
@@ -115,7 +115,7 @@ public interface CommonAppMapper {
|
||||
* @return 库存详细信息
|
||||
*/
|
||||
List<InventoryDetailDto> selectMedicineInventoryDetail(@Param("medicationIdList") List<Long> medicationIdList,
|
||||
@Param("locationIdList") List<Long> locationIdList, @Param("active") Integer active);
|
||||
@Param("locationIdList") List<Long> locationIdList, @Param("active") Integer active);
|
||||
|
||||
/**
|
||||
* 查询耗材库存详细信息
|
||||
@@ -126,5 +126,5 @@ public interface CommonAppMapper {
|
||||
* @return 库存详细信息
|
||||
*/
|
||||
List<InventoryDetailDto> selectDeviceInventoryDetail(@Param("deviceIdList") List<Long> deviceIdList,
|
||||
@Param("locationIdList") List<Long> locationIdList, @Param("active") Integer active);
|
||||
@Param("locationIdList") List<Long> locationIdList, @Param("active") Integer active);
|
||||
}
|
||||
|
||||
@@ -111,8 +111,8 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
|
||||
// 获取状态
|
||||
List<DeviceManageInitDto.statusEnumOption> statusEnumOptions = Stream.of(PublicationStatus.values())
|
||||
.map(status -> new DeviceManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
.map(status -> new DeviceManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
deviceManageInitDto.setStatusFlagOptions(statusEnumOptions);
|
||||
|
||||
// // 获取执行科室
|
||||
@@ -128,28 +128,27 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
// .map(category -> new DeviceManageInitDto.deviceCategory(category.getValue(), category.getInfo()))
|
||||
// .collect(Collectors.toList());
|
||||
// deviceManageInitDto.setDeviceCategories(deviceCategories);
|
||||
|
||||
// 获取器材
|
||||
List<SysDictData> deviceList =
|
||||
sysDictTypeService.selectDictDataByType(CommonConstants.DictName.DEVICE_CATEGORY_CODE);
|
||||
List<SysDictData> deviceList
|
||||
= sysDictTypeService.selectDictDataByType(CommonConstants.DictName.DEVICE_CATEGORY_CODE);
|
||||
// 从字典中获取器材分类
|
||||
List<DeviceManageInitDto.dictCategoryCode> deviceCategories = deviceList.stream()
|
||||
.map(category -> new DeviceManageInitDto.dictCategoryCode(category.getDictValue(), category.getDictLabel()))
|
||||
.collect(Collectors.toList());
|
||||
.map(category -> new DeviceManageInitDto.dictCategoryCode(category.getDictValue(), category.getDictLabel()))
|
||||
.collect(Collectors.toList());
|
||||
deviceManageInitDto.setDeviceCategories(deviceCategories);
|
||||
|
||||
// 获取医保是否对码
|
||||
List<DeviceManageInitDto.statusEnumOption> statusYBWeatherOption = Stream.of(Whether.values())
|
||||
.map(status -> new DeviceManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
.map(status -> new DeviceManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
deviceManageInitDto.setStatusYBWeatherOptions(statusYBWeatherOption);
|
||||
|
||||
// 查询供应商列表
|
||||
List<Supplier> supplierList = supplierService.getList();
|
||||
// 供应商信息
|
||||
List<DeviceManageInitDto.supplierListOption> supplierListOptions = supplierList.stream()
|
||||
.map(supplier -> new DeviceManageInitDto.supplierListOption(supplier.getId(), supplier.getName()))
|
||||
.collect(Collectors.toList());
|
||||
.map(supplier -> new DeviceManageInitDto.supplierListOption(supplier.getId(), supplier.getName()))
|
||||
.collect(Collectors.toList());
|
||||
deviceManageInitDto.setSupplierListOptions(supplierListOptions);
|
||||
|
||||
return R.ok(deviceManageInitDto);
|
||||
@@ -166,15 +165,15 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
*/
|
||||
@Override
|
||||
public R<?> getDevicePage(DeviceManageSelParam deviceManageSelParam, String searchKey, Integer pageNo,
|
||||
Integer pageSize, HttpServletRequest request) {
|
||||
Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
// 构建查询条件
|
||||
QueryWrapper<DeviceManageDto> queryWrapper = HisQueryUtils.buildQueryWrapper(deviceManageSelParam, searchKey,
|
||||
new HashSet<>(Arrays.asList("bus_no", "name", "py_str", "wb_str")), request);
|
||||
new HashSet<>(Arrays.asList("bus_no", "name", "py_str", "wb_str")), request);
|
||||
|
||||
// 分页查询
|
||||
IPage<DeviceManageDto> deviceManagePage =
|
||||
deviceManageMapper.getDevicePage(new Page<>(pageNo, pageSize), queryWrapper);
|
||||
IPage<DeviceManageDto> deviceManagePage
|
||||
= deviceManageMapper.getDevicePage(new Page<>(pageNo, pageSize), queryWrapper);
|
||||
|
||||
deviceManagePage.getRecords().forEach(e -> {
|
||||
// 高值器材标志枚举类回显赋值
|
||||
@@ -216,8 +215,8 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
// 调用医保目录对照接口
|
||||
String ybSwitch = SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH); // 医保开关
|
||||
if (Whether.YES.getCode().equals(ybSwitch) && StringUtils.isNotEmpty(deviceDefinition.getYbNo())) {
|
||||
R<?> r =
|
||||
ybService.directoryCheck(CommonConstants.TableName.ADM_DEVICE_DEFINITION, deviceDefinition.getId());
|
||||
R<?> r
|
||||
= ybService.directoryCheck(CommonConstants.TableName.ADM_DEVICE_DEFINITION, deviceDefinition.getId());
|
||||
if (200 != r.getCode()) {
|
||||
throw new RuntimeException("医保目录对照接口异常");
|
||||
}
|
||||
@@ -225,29 +224,29 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
|
||||
ChargeItemDefinition chargeItemDefinition = new ChargeItemDefinition();
|
||||
chargeItemDefinition.setYbType(deviceManageDto.getYbType()).setTypeCode(deviceManageDto.getItemTypeCode())
|
||||
.setInstanceTable(CommonConstants.TableName.ADM_DEVICE_DEFINITION)
|
||||
.setInstanceId(deviceDefinition.getId()).setPrice(deviceManageDto.getRetailPrice())
|
||||
.setChargeName(deviceManageDto.getName());;
|
||||
.setInstanceTable(CommonConstants.TableName.ADM_DEVICE_DEFINITION)
|
||||
.setInstanceId(deviceDefinition.getId()).setPrice(deviceManageDto.getRetailPrice())
|
||||
.setChargeName(deviceManageDto.getName());;
|
||||
// 插入操作记录
|
||||
operationRecordService.addEntityOperationRecord(DbOpType.UPDATE.getCode(),
|
||||
CommonConstants.TableName.ADM_DEVICE_DEFINITION, deviceDefinition);
|
||||
CommonConstants.TableName.ADM_DEVICE_DEFINITION, deviceDefinition);
|
||||
// 更新价格表
|
||||
boolean upItemDef = itemDefinitionServic.updateItem(chargeItemDefinition);
|
||||
|
||||
// 更新子表,修改购入价,条件:采购
|
||||
boolean upItemDetail1 = itemDefinitionServic.updateItemDetail(chargeItemDefinition,
|
||||
deviceManageDto.getPurchasePrice(), ConditionCode.PURCHASE.getCode());
|
||||
deviceManageDto.getPurchasePrice(), ConditionCode.PURCHASE.getCode());
|
||||
// 更新子表,修改零售价,条件:单位
|
||||
boolean upItemDetail2 = itemDefinitionServic.updateItemDetail(chargeItemDefinition,
|
||||
deviceManageDto.getRetailPrice(), ConditionCode.UNIT.getCode());
|
||||
deviceManageDto.getRetailPrice(), ConditionCode.UNIT.getCode());
|
||||
// 更新子表,修改最高零售价,条件:限制
|
||||
boolean upItemDetail3 = itemDefinitionServic.updateItemDetail(chargeItemDefinition,
|
||||
deviceManageDto.getMaximumRetailPrice(), ConditionCode.LIMIT.getCode());
|
||||
deviceManageDto.getMaximumRetailPrice(), ConditionCode.LIMIT.getCode());
|
||||
|
||||
// 更新价格表
|
||||
return upItemDef && upItemDetail1 && upItemDetail2 && upItemDetail3
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"器材目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"器材目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
return R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
@@ -285,12 +284,12 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
}
|
||||
// 插入操作记录
|
||||
operationRecordService.addIdsOperationRecord(DbOpType.STOP.getCode(),
|
||||
CommonConstants.TableName.ADM_DEVICE_DEFINITION, ids);
|
||||
CommonConstants.TableName.ADM_DEVICE_DEFINITION, ids);
|
||||
|
||||
// 更新器材信息
|
||||
return deviceDefinitionService.updateBatchById(DeviceDefinitionList)
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"器材目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"器材目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -311,12 +310,12 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
}
|
||||
// 插入操作记录
|
||||
operationRecordService.addIdsOperationRecord(DbOpType.START.getCode(),
|
||||
CommonConstants.TableName.ADM_DEVICE_DEFINITION, ids);
|
||||
CommonConstants.TableName.ADM_DEVICE_DEFINITION, ids);
|
||||
|
||||
// 更新器材信息
|
||||
return deviceDefinitionService.updateBatchById(DeviceDefinitionList)
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"器材目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"器材目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -341,27 +340,27 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
// 调用医保目录对照接口
|
||||
String ybSwitch = SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH); // 医保开关
|
||||
if (Whether.YES.getCode().equals(ybSwitch) && StringUtils.isNotEmpty(deviceDefinition.getYbNo())) {
|
||||
R<?> r =
|
||||
ybService.directoryCheck(CommonConstants.TableName.ADM_DEVICE_DEFINITION, deviceDefinition.getId());
|
||||
R<?> r
|
||||
= ybService.directoryCheck(CommonConstants.TableName.ADM_DEVICE_DEFINITION, deviceDefinition.getId());
|
||||
if (200 != r.getCode()) {
|
||||
throw new RuntimeException("医保目录对照接口异常");
|
||||
}
|
||||
}
|
||||
// 插入操作记录
|
||||
operationRecordService.addEntityOperationRecord(DbOpType.INSERT.getCode(),
|
||||
CommonConstants.TableName.ADM_DEVICE_DEFINITION, deviceDefinition);
|
||||
CommonConstants.TableName.ADM_DEVICE_DEFINITION, deviceDefinition);
|
||||
|
||||
ItemUpFromDirectoryDto itemUpFromDirectoryDto = new ItemUpFromDirectoryDto();
|
||||
BeanUtils.copyProperties(deviceManageUpDto, itemUpFromDirectoryDto);
|
||||
itemUpFromDirectoryDto.setTypeCode(deviceManageUpDto.getItemTypeCode())
|
||||
.setInstanceTable(CommonConstants.TableName.ADM_DEVICE_DEFINITION)
|
||||
.setEffectiveStart(DateUtils.getNowDate()).setStatusEnum(PublicationStatus.ACTIVE.getValue())
|
||||
.setConditionFlag(Whether.YES.getValue()).setChargeName(deviceManageUpDto.getName())
|
||||
.setInstanceId(deviceDefinition.getId()).setPrice(deviceManageUpDto.getRetailPrice());
|
||||
.setInstanceTable(CommonConstants.TableName.ADM_DEVICE_DEFINITION)
|
||||
.setEffectiveStart(DateUtils.getNowDate()).setStatusEnum(PublicationStatus.ACTIVE.getValue())
|
||||
.setConditionFlag(Whether.YES.getValue()).setChargeName(deviceManageUpDto.getName())
|
||||
.setInstanceId(deviceDefinition.getId()).setPrice(deviceManageUpDto.getRetailPrice());
|
||||
|
||||
return itemDefinitionServic.addItem(itemUpFromDirectoryDto)
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"器材目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null));
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"器材目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null));
|
||||
}
|
||||
return R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null));
|
||||
}
|
||||
@@ -388,21 +387,21 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
// 查询机构ID、位置信息供后续使用
|
||||
Long orgId = SecurityUtils.getLoginUser().getOrgId();
|
||||
List<Location> locationList = locationService.list(new LambdaQueryWrapper<Location>()
|
||||
.eq(Location::getDeleteFlag, DelFlag.NO.getCode()).orderByAsc(Location::getId));
|
||||
.eq(Location::getDeleteFlag, DelFlag.NO.getCode()).orderByAsc(Location::getId));
|
||||
Long defaultLocationId = locationList.stream().findFirst().orElse(new Location()).getId();
|
||||
Map<String, List<Location>> locationNameMap =
|
||||
locationList.stream().collect(Collectors.groupingBy(Location::getName));
|
||||
Map<String, List<Location>> locationNameMap
|
||||
= locationList.stream().collect(Collectors.groupingBy(Location::getName));
|
||||
// 创建表数据
|
||||
for (DeviceImportDto importDto : importDtoList) {
|
||||
// 创建器材定义
|
||||
DeviceDefinition deviceDefinition =
|
||||
createDeviceDefinitionEntity(importDto, orgId, defaultLocationId, locationNameMap);
|
||||
DeviceDefinition deviceDefinition
|
||||
= createDeviceDefinitionEntity(importDto, orgId, defaultLocationId, locationNameMap);
|
||||
deviceDefinitionService.save(deviceDefinition);
|
||||
// 创建费用定价和详情
|
||||
chargeItemDefinitionService.addChargeItemDefinitionAndDetail(importDto.getName(), importDto.getTypeCode(),
|
||||
importDto.getYbType(), importDto.getUnitCode(), importDto.getPurchasePrice(),
|
||||
importDto.getRetailPrice(), importDto.getMaximumRetailPrice(), orgId,
|
||||
CommonConstants.TableName.ADM_DEVICE_DEFINITION, deviceDefinition.getId());
|
||||
importDto.getYbType(), importDto.getUnitCode(), importDto.getPurchasePrice(),
|
||||
importDto.getRetailPrice(), importDto.getMaximumRetailPrice(), orgId,
|
||||
CommonConstants.TableName.ADM_DEVICE_DEFINITION, deviceDefinition.getId());
|
||||
}
|
||||
return R.ok(null, "导入成功!");
|
||||
}
|
||||
@@ -429,7 +428,7 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
List<DeviceRequest> deviceRequestList = deviceRequestService.getDevRequestByDeviceId(deviceId);
|
||||
if (!deviceRequestList.isEmpty()) {
|
||||
if (deviceRequestList.stream()
|
||||
.allMatch(x -> x.getStatusEnum().equals(RequestStatus.COMPLETED.getValue()))) {
|
||||
.allMatch(x -> x.getStatusEnum().equals(RequestStatus.COMPLETED.getValue()))) {
|
||||
return R.ok(1, "医生开过该耗材,不可编辑");
|
||||
} else {
|
||||
// 校验是否可以编辑
|
||||
@@ -555,7 +554,7 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
}
|
||||
if (!lineValidateMsgList.isEmpty()) {
|
||||
fieldValidateMsgList
|
||||
.add("■ 第" + importDto.getLineNumber() + "行:" + String.join(",", lineValidateMsgList) + ";");
|
||||
.add("■ 第" + importDto.getLineNumber() + "行:" + String.join(",", lineValidateMsgList) + ";");
|
||||
}
|
||||
}
|
||||
if (!fieldValidateMsgList.isEmpty()) {
|
||||
@@ -564,12 +563,12 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
// 重复校验(文件行重复)
|
||||
List<String> lineRepeatedValidateMsgList = new ArrayList<>();
|
||||
List<List<DeviceImportDto>> importDtoGroupList = new ArrayList<>(importDtoList.stream()
|
||||
.collect(Collectors.groupingBy(e -> e.getName() + e.getManufacturerText() + e.getSize())).values());
|
||||
.collect(Collectors.groupingBy(e -> e.getName() + e.getManufacturerText() + e.getSize())).values());
|
||||
for (List<DeviceImportDto> importDtoGroup : importDtoGroupList) {
|
||||
if (importDtoGroup.size() > 1) {
|
||||
lineRepeatedValidateMsgList.add(
|
||||
"■ 第" + importDtoGroup.stream().map(DeviceImportDto::getLineNumber).sorted().map(Object::toString)
|
||||
.collect(Collectors.joining(",")) + "行的【" + importDtoGroup.get(0).getName() + "】重复;");
|
||||
"■ 第" + importDtoGroup.stream().map(DeviceImportDto::getLineNumber).sorted().map(Object::toString)
|
||||
.collect(Collectors.joining(",")) + "行的【" + importDtoGroup.get(0).getName() + "】重复;");
|
||||
}
|
||||
}
|
||||
if (!lineRepeatedValidateMsgList.isEmpty()) {
|
||||
@@ -579,12 +578,12 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
List<String> dbRepeatedValidateMsgList = new ArrayList<>();
|
||||
for (DeviceImportDto importDto : importDtoList) {
|
||||
List<DeviceDefinition> deviceDefinitionList = deviceDefinitionService
|
||||
.list(new LambdaQueryWrapper<DeviceDefinition>().eq(DeviceDefinition::getName, importDto.getName())
|
||||
.eq(DeviceDefinition::getManufacturerText, importDto.getManufacturerText())
|
||||
.eq(DeviceDefinition::getSize, importDto.getSize()));
|
||||
.list(new LambdaQueryWrapper<DeviceDefinition>().eq(DeviceDefinition::getName, importDto.getName())
|
||||
.eq(DeviceDefinition::getManufacturerText, importDto.getManufacturerText())
|
||||
.eq(DeviceDefinition::getSize, importDto.getSize()));
|
||||
if (!deviceDefinitionList.isEmpty()) {
|
||||
dbRepeatedValidateMsgList
|
||||
.add("■ 第" + importDto.getLineNumber() + "行的【" + importDto.getName() + "】在系统中已存在;");
|
||||
.add("■ 第" + importDto.getLineNumber() + "行的【" + importDto.getName() + "】在系统中已存在;");
|
||||
}
|
||||
}
|
||||
if (!dbRepeatedValidateMsgList.isEmpty()) {
|
||||
@@ -603,7 +602,7 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
* @return 器材定义实体
|
||||
*/
|
||||
private DeviceDefinition createDeviceDefinitionEntity(DeviceImportDto importDto, Long orgId, Long defaultLocationId,
|
||||
Map<String, List<Location>> locationNameMap) {
|
||||
Map<String, List<Location>> locationNameMap) {
|
||||
DeviceDefinition deviceDefinition = new DeviceDefinition();
|
||||
// 根据输入的所在位置名称获取位置ID
|
||||
List<Location> mapLocationList = locationNameMap.get(importDto.getLocationName());
|
||||
@@ -613,20 +612,20 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
deviceDefinition.setLocationId(mapLocationList.get(0).getId());
|
||||
}
|
||||
deviceDefinition.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.DEVICE_NUM.getPrefix(), 10))
|
||||
.setName(importDto.getName()).setPyStr(ChineseConvertUtils.toPinyinFirstLetter(importDto.getName()))
|
||||
.setWbStr(ChineseConvertUtils.toWBFirstLetter(importDto.getName()))
|
||||
.setCategoryCode(importDto.getCategoryCode()).setTypeCode(importDto.getTypeCode())
|
||||
.setUnitCode(importDto.getUnitCode()).setSize(importDto.getSize())
|
||||
.setItemMinQuantity(importDto.getItemMinQuantity()).setItemMaxQuantity(importDto.getItemMaxQuantity())
|
||||
.setPartPercent(importDto.getPartPercent()).setMinUnitCode(importDto.getMinUnitCode()).setOrgId(orgId)
|
||||
.setHvcmFlag(CommonUtil.tryParseInt(importDto.getHvcmFlag())).setSalesUnitCode(importDto.getSalesUnitCode())
|
||||
.setApprovalNumber(importDto.getApprovalNumber()).setYbFlag(CommonUtil.tryParseInt(importDto.getYbFlag()))
|
||||
.setYbNo(importDto.getYbNo()).setYbOrgNo(importDto.getYbOrgNo())
|
||||
.setYbMatchFlag(CommonUtil.tryParseInt(importDto.getYbMatchFlag()))
|
||||
.setChrgitmLv(CommonUtil.tryParseInt(importDto.getChrgitmLv()))
|
||||
.setStatusEnum(PublicationStatus.ACTIVE.getValue()).setManufacturerText(importDto.getManufacturerText())
|
||||
.setAllergenFlag(CommonUtil.tryParseInt(importDto.getAllergenFlag()))
|
||||
.setRxFlag(CommonUtil.tryParseInt(importDto.getRxFlag()));
|
||||
.setName(importDto.getName()).setPyStr(ChineseConvertUtils.toPinyinFirstLetter(importDto.getName()))
|
||||
.setWbStr(ChineseConvertUtils.toWBFirstLetter(importDto.getName()))
|
||||
.setCategoryCode(importDto.getCategoryCode()).setTypeCode(importDto.getTypeCode())
|
||||
.setUnitCode(importDto.getUnitCode()).setSize(importDto.getSize())
|
||||
.setItemMinQuantity(importDto.getItemMinQuantity()).setItemMaxQuantity(importDto.getItemMaxQuantity())
|
||||
.setPartPercent(importDto.getPartPercent()).setMinUnitCode(importDto.getMinUnitCode()).setOrgId(orgId)
|
||||
.setHvcmFlag(CommonUtil.tryParseInt(importDto.getHvcmFlag())).setSalesUnitCode(importDto.getSalesUnitCode())
|
||||
.setApprovalNumber(importDto.getApprovalNumber()).setYbFlag(CommonUtil.tryParseInt(importDto.getYbFlag()))
|
||||
.setYbNo(importDto.getYbNo()).setYbOrgNo(importDto.getYbOrgNo())
|
||||
.setYbMatchFlag(CommonUtil.tryParseInt(importDto.getYbMatchFlag()))
|
||||
.setChrgitmLv(CommonUtil.tryParseInt(importDto.getChrgitmLv()))
|
||||
.setStatusEnum(PublicationStatus.ACTIVE.getValue()).setManufacturerText(importDto.getManufacturerText())
|
||||
.setAllergenFlag(CommonUtil.tryParseInt(importDto.getAllergenFlag()))
|
||||
.setRxFlag(CommonUtil.tryParseInt(importDto.getRxFlag()));
|
||||
return deviceDefinition;
|
||||
}
|
||||
|
||||
|
||||
@@ -87,26 +87,26 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
DiagnosisTreatmentInitDto diagnosisTreatmentInitDto = new DiagnosisTreatmentInitDto();
|
||||
// 获取状态
|
||||
List<DiagnosisTreatmentInitDto.statusEnumOption> statusEnumOptions = Stream.of(PublicationStatus.values())
|
||||
.map(status -> new DiagnosisTreatmentInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
.map(status -> new DiagnosisTreatmentInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
diagnosisTreatmentInitDto.setStatusFlagOptions(statusEnumOptions);
|
||||
// 获取执行科室
|
||||
LambdaQueryWrapper<Organization> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(Organization::getTypeEnum, OrganizationType.DEPARTMENT);
|
||||
List<Organization> organizations = organizationService.list(queryWrapper);
|
||||
List<DiagnosisTreatmentInitDto.exeOrganization> exeOrganizations = organizations.stream()
|
||||
.map(exeOrg -> new DiagnosisTreatmentInitDto.exeOrganization(exeOrg.getId(), exeOrg.getName()))
|
||||
.collect(Collectors.toList());
|
||||
.map(exeOrg -> new DiagnosisTreatmentInitDto.exeOrganization(exeOrg.getId(), exeOrg.getName()))
|
||||
.collect(Collectors.toList());
|
||||
diagnosisTreatmentInitDto.setExeOrganizations(exeOrganizations);
|
||||
|
||||
// 获取诊目录疗分类
|
||||
List<SysDictData> diagnosisList =
|
||||
sysDictTypeService.selectDictDataByType(CommonConstants.DictName.DIAGNOSIS_CATEGORY_CODE);
|
||||
List<SysDictData> diagnosisList
|
||||
= sysDictTypeService.selectDictDataByType(CommonConstants.DictName.DIAGNOSIS_CATEGORY_CODE);
|
||||
// 获取诊疗录疗分类
|
||||
List<DiagnosisTreatmentInitDto.dictCategoryCode> diagnosisCategories = diagnosisList.stream()
|
||||
.map(category -> new DiagnosisTreatmentInitDto.dictCategoryCode(category.getDictValue(),
|
||||
.map(category -> new DiagnosisTreatmentInitDto.dictCategoryCode(category.getDictValue(),
|
||||
category.getDictLabel()))
|
||||
.collect(Collectors.toList());
|
||||
.collect(Collectors.toList());
|
||||
diagnosisTreatmentInitDto.setDiagnosisCategoryOptions(diagnosisCategories);
|
||||
|
||||
// // 查询医疗服务项类型
|
||||
@@ -143,18 +143,17 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
// diseaseTreatmentCategories.add(diseaseTreatmentCategory2);
|
||||
//
|
||||
// diagnosisTreatmentInitDto.setDiseaseTreatmentCategoryList(diseaseTreatmentCategories);
|
||||
|
||||
// 获取类型
|
||||
List<DiagnosisTreatmentInitDto.statusEnumOption> typeEnumOptions = Stream.of(ActivityType.values())
|
||||
.map(status -> new DiagnosisTreatmentInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
.map(status -> new DiagnosisTreatmentInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
diagnosisTreatmentInitDto.setTypeEnumOptions(typeEnumOptions);
|
||||
|
||||
// 获取是/否 列表
|
||||
// 获取状态
|
||||
List<DiagnosisTreatmentInitDto.statusEnumOption> statusWeatherOption = Stream.of(Whether.values())
|
||||
.map(status -> new DiagnosisTreatmentInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
.map(status -> new DiagnosisTreatmentInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
diagnosisTreatmentInitDto.setStatusWeatherOption(statusWeatherOption);
|
||||
|
||||
return R.ok(diagnosisTreatmentInitDto);
|
||||
@@ -171,15 +170,15 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
*/
|
||||
@Override
|
||||
public R<?> getDiseaseTreatmentPage(DiagnosisTreatmentSelParam DiagnosisTreatmentSelParam, String searchKey,
|
||||
Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
||||
Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
// 构建查询条件
|
||||
QueryWrapper<DiagnosisTreatmentDto> queryWrapper = HisQueryUtils.buildQueryWrapper(DiagnosisTreatmentSelParam,
|
||||
searchKey, new HashSet<>(Arrays.asList("bus_no", "name", "py_str", "wb_str")), request);
|
||||
searchKey, new HashSet<>(Arrays.asList("bus_no", "name", "py_str", "wb_str")), request);
|
||||
|
||||
// 分页查询
|
||||
IPage<DiagnosisTreatmentDto> diseaseTreatmentPage =
|
||||
activityDefinitionManageMapper.getDiseaseTreatmentPage(new Page<>(pageNo, pageSize), queryWrapper);
|
||||
IPage<DiagnosisTreatmentDto> diseaseTreatmentPage
|
||||
= activityDefinitionManageMapper.getDiseaseTreatmentPage(new Page<DiagnosisTreatmentDto>(pageNo, pageSize), queryWrapper);
|
||||
|
||||
diseaseTreatmentPage.getRecords().forEach(e -> {
|
||||
// 医保标记枚举类回显赋值
|
||||
@@ -237,7 +236,7 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
String ybSwitch = SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH); // 医保开关
|
||||
if (Whether.YES.getCode().equals(ybSwitch) && StringUtils.isNotEmpty(activityDefinition.getYbNo())) {
|
||||
R<?> r = ybService.directoryCheck(CommonConstants.TableName.WOR_ACTIVITY_DEFINITION,
|
||||
activityDefinition.getId());
|
||||
activityDefinition.getId());
|
||||
if (200 != r.getCode()) {
|
||||
throw new RuntimeException("医保目录对照接口异常");
|
||||
}
|
||||
@@ -245,27 +244,27 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
|
||||
ChargeItemDefinition chargeItemDefinition = new ChargeItemDefinition();
|
||||
chargeItemDefinition.setYbType(diagnosisTreatmentUpDto.getYbType())
|
||||
.setTypeCode(diagnosisTreatmentUpDto.getItemTypeCode())
|
||||
.setInstanceTable(CommonConstants.TableName.WOR_ACTIVITY_DEFINITION)
|
||||
.setInstanceId(diagnosisTreatmentUpDto.getId()).setPrice(diagnosisTreatmentUpDto.getRetailPrice())
|
||||
.setPriceCode(diagnosisTreatmentUpDto.getPriceCode()).setChargeName(diagnosisTreatmentUpDto.getName());
|
||||
.setTypeCode(diagnosisTreatmentUpDto.getItemTypeCode())
|
||||
.setInstanceTable(CommonConstants.TableName.WOR_ACTIVITY_DEFINITION)
|
||||
.setInstanceId(diagnosisTreatmentUpDto.getId()).setPrice(diagnosisTreatmentUpDto.getRetailPrice())
|
||||
.setPriceCode(diagnosisTreatmentUpDto.getPriceCode()).setChargeName(diagnosisTreatmentUpDto.getName());
|
||||
// 插入操作记录
|
||||
operationRecordService.addEntityOperationRecord(DbOpType.UPDATE.getCode(),
|
||||
CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, activityDefinition);
|
||||
CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, activityDefinition);
|
||||
|
||||
// 更新价格表
|
||||
boolean upItemDef = itemDefinitionService.updateItem(chargeItemDefinition);
|
||||
// 更新子表,修改零售价,条件:单位
|
||||
boolean upItemDetail1 = itemDefinitionService.updateItemDetail(chargeItemDefinition,
|
||||
diagnosisTreatmentUpDto.getRetailPrice(), ConditionCode.UNIT.getCode());
|
||||
diagnosisTreatmentUpDto.getRetailPrice(), ConditionCode.UNIT.getCode());
|
||||
// 更新子表,修改最高零售价,条件:限制
|
||||
boolean upItemDetail2 = itemDefinitionService.updateItemDetail(chargeItemDefinition,
|
||||
diagnosisTreatmentUpDto.getMaximumRetailPrice(), ConditionCode.LIMIT.getCode());
|
||||
diagnosisTreatmentUpDto.getMaximumRetailPrice(), ConditionCode.LIMIT.getCode());
|
||||
|
||||
// 更新价格表
|
||||
return upItemDef && upItemDetail1 && upItemDetail2
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"诊疗目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"诊疗目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
|
||||
}
|
||||
return R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
@@ -291,11 +290,11 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
}
|
||||
// 插入操作记录
|
||||
operationRecordService.addIdsOperationRecord(DbOpType.STOP.getCode(),
|
||||
CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, ids);
|
||||
CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, ids);
|
||||
// 更新诊疗信息
|
||||
return activityDefinitionService.updateBatchById(ActivityDefinitionList)
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"诊疗目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"诊疗目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
|
||||
}
|
||||
|
||||
@@ -319,11 +318,11 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
}
|
||||
// 插入操作记录
|
||||
operationRecordService.addIdsOperationRecord(DbOpType.START.getCode(),
|
||||
CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, ids);
|
||||
CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, ids);
|
||||
// 更新诊疗信息
|
||||
return activityDefinitionService.updateBatchById(ActivityDefinitionList)
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"诊疗目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"诊疗目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
|
||||
}
|
||||
|
||||
@@ -359,28 +358,28 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
String ybSwitch = SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH); // 医保开关
|
||||
if (Whether.YES.getCode().equals(ybSwitch) && StringUtils.isNotEmpty(activityDefinition.getYbNo())) {
|
||||
R<?> r = ybService.directoryCheck(CommonConstants.TableName.WOR_ACTIVITY_DEFINITION,
|
||||
activityDefinition.getId());
|
||||
activityDefinition.getId());
|
||||
if (200 != r.getCode()) {
|
||||
throw new RuntimeException("医保目录对照接口异常");
|
||||
}
|
||||
}
|
||||
// 插入操作记录
|
||||
operationRecordService.addEntityOperationRecord(DbOpType.INSERT.getCode(),
|
||||
CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, activityDefinition);
|
||||
CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, activityDefinition);
|
||||
|
||||
ItemUpFromDirectoryDto itemUpFromDirectoryDto = new ItemUpFromDirectoryDto();
|
||||
BeanUtils.copyProperties(diagnosisTreatmentUpDto, itemUpFromDirectoryDto);
|
||||
itemUpFromDirectoryDto.setTypeCode(diagnosisTreatmentUpDto.getItemTypeCode())
|
||||
.setUnitCode(diagnosisTreatmentUpDto.getPermittedUnitCode())
|
||||
.setInstanceTable(CommonConstants.TableName.WOR_ACTIVITY_DEFINITION)
|
||||
.setEffectiveStart(DateUtils.getNowDate()).setStatusEnum(PublicationStatus.ACTIVE.getValue())
|
||||
.setConditionFlag(Whether.YES.getValue()).setChargeName(diagnosisTreatmentUpDto.getName())
|
||||
.setInstanceId(activityDefinition.getId()).setPrice(diagnosisTreatmentUpDto.getRetailPrice())
|
||||
.setPriceCode(diagnosisTreatmentUpDto.getPriceCode());
|
||||
.setUnitCode(diagnosisTreatmentUpDto.getPermittedUnitCode())
|
||||
.setInstanceTable(CommonConstants.TableName.WOR_ACTIVITY_DEFINITION)
|
||||
.setEffectiveStart(DateUtils.getNowDate()).setStatusEnum(PublicationStatus.ACTIVE.getValue())
|
||||
.setConditionFlag(Whether.YES.getValue()).setChargeName(diagnosisTreatmentUpDto.getName())
|
||||
.setInstanceId(activityDefinition.getId()).setPrice(diagnosisTreatmentUpDto.getRetailPrice())
|
||||
.setPriceCode(diagnosisTreatmentUpDto.getPriceCode());
|
||||
|
||||
return itemDefinitionService.addItem(itemUpFromDirectoryDto)
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"诊疗目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null));
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"诊疗目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null));
|
||||
|
||||
}
|
||||
return R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null));
|
||||
@@ -396,8 +395,8 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
@Override
|
||||
public R<?> importData(MultipartFile file) {
|
||||
// 读取文件
|
||||
R<List<DiagnosisTreatmentImportDto>> readResult =
|
||||
CommonUtil.readImportedExcelFile(file, DiagnosisTreatmentImportDto.class);
|
||||
R<List<DiagnosisTreatmentImportDto>> readResult
|
||||
= CommonUtil.readImportedExcelFile(file, DiagnosisTreatmentImportDto.class);
|
||||
if (R.SUCCESS != readResult.getCode()) {
|
||||
return readResult;
|
||||
}
|
||||
@@ -416,9 +415,9 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
activityDefinitionService.save(activityDefinition);
|
||||
// 创建费用定价和详情
|
||||
chargeItemDefinitionService.addChargeItemDefinitionAndDetail(importDto.getName(), importDto.getTypeCode(),
|
||||
importDto.getYbType(), importDto.getPermittedUnitCode(), null, importDto.getRetailPrice(),
|
||||
importDto.getMaximumRetailPrice(), orgId, CommonConstants.TableName.WOR_ACTIVITY_DEFINITION,
|
||||
activityDefinition.getId());
|
||||
importDto.getYbType(), importDto.getPermittedUnitCode(), null, importDto.getRetailPrice(),
|
||||
importDto.getMaximumRetailPrice(), orgId, CommonConstants.TableName.WOR_ACTIVITY_DEFINITION,
|
||||
activityDefinition.getId());
|
||||
}
|
||||
return R.ok(null, "导入成功!");
|
||||
}
|
||||
@@ -446,7 +445,7 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
List<ServiceRequest> serviceRequestList = serviceRequestService.getServiceRequestByActivityId(activityId);
|
||||
if (!serviceRequestList.isEmpty()) {
|
||||
if (serviceRequestList.stream().anyMatch(
|
||||
serviceRequest -> RequestStatus.COMPLETED.getValue().equals(serviceRequest.getStatusEnum()))) {
|
||||
serviceRequest -> RequestStatus.COMPLETED.getValue().equals(serviceRequest.getStatusEnum()))) {
|
||||
return R.ok(1, "医生开过该诊疗项目,不可编辑");
|
||||
}
|
||||
}
|
||||
@@ -514,7 +513,7 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
}
|
||||
if (!lineValidateMsgList.isEmpty()) {
|
||||
fieldValidateMsgList
|
||||
.add("■ 第" + importDto.getLineNumber() + "行:" + String.join(",", lineValidateMsgList) + ";");
|
||||
.add("■ 第" + importDto.getLineNumber() + "行:" + String.join(",", lineValidateMsgList) + ";");
|
||||
}
|
||||
}
|
||||
if (!fieldValidateMsgList.isEmpty()) {
|
||||
@@ -523,13 +522,13 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
// 重复校验(文件行重复)
|
||||
List<String> lineRepeatedValidateMsgList = new ArrayList<>();
|
||||
List<List<DiagnosisTreatmentImportDto>> importDtoGroupList = new ArrayList<>(
|
||||
importDtoList.stream().collect(Collectors.groupingBy(DiagnosisTreatmentImportDto::getName)).values());
|
||||
importDtoList.stream().collect(Collectors.groupingBy(DiagnosisTreatmentImportDto::getName)).values());
|
||||
for (List<DiagnosisTreatmentImportDto> importDtoGroup : importDtoGroupList) {
|
||||
if (importDtoGroup.size() > 1) {
|
||||
lineRepeatedValidateMsgList.add("■ 第"
|
||||
+ importDtoGroup.stream().map(DiagnosisTreatmentImportDto::getLineNumber).sorted()
|
||||
.map(Object::toString).collect(Collectors.joining(","))
|
||||
+ "行的【" + importDtoGroup.get(0).getName() + "】重复;");
|
||||
+ importDtoGroup.stream().map(DiagnosisTreatmentImportDto::getLineNumber).sorted()
|
||||
.map(Object::toString).collect(Collectors.joining(","))
|
||||
+ "行的【" + importDtoGroup.get(0).getName() + "】重复;");
|
||||
}
|
||||
}
|
||||
if (!lineRepeatedValidateMsgList.isEmpty()) {
|
||||
@@ -539,10 +538,10 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
List<String> dbRepeatedValidateMsgList = new ArrayList<>();
|
||||
for (DiagnosisTreatmentImportDto importDto : importDtoList) {
|
||||
List<ActivityDefinition> deviceDefinitionList = activityDefinitionService.list(
|
||||
new LambdaQueryWrapper<ActivityDefinition>().eq(ActivityDefinition::getName, importDto.getName()));
|
||||
new LambdaQueryWrapper<ActivityDefinition>().eq(ActivityDefinition::getName, importDto.getName()));
|
||||
if (!deviceDefinitionList.isEmpty()) {
|
||||
dbRepeatedValidateMsgList
|
||||
.add("■ 第" + importDto.getLineNumber() + "行的【" + importDto.getName() + "】在系统中已存在;");
|
||||
.add("■ 第" + importDto.getLineNumber() + "行的【" + importDto.getName() + "】在系统中已存在;");
|
||||
}
|
||||
}
|
||||
if (!dbRepeatedValidateMsgList.isEmpty()) {
|
||||
@@ -561,14 +560,14 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
private ActivityDefinition createActivityDefinitionEntity(DiagnosisTreatmentImportDto importDto, Long orgId) {
|
||||
ActivityDefinition activityDefinition = new ActivityDefinition();
|
||||
activityDefinition.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.ACTIVITY_DEFINITION_NUM.getPrefix(), 10))
|
||||
.setName(importDto.getName()).setCategoryCode(importDto.getCategoryCode())
|
||||
.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(importDto.getName()))
|
||||
.setWbStr(ChineseConvertUtils.toWBFirstLetter(importDto.getName()))
|
||||
.setPermittedUnitCode(importDto.getPermittedUnitCode()).setOrgId(orgId)
|
||||
.setYbFlag(CommonUtil.tryParseInt(importDto.getYbFlag())).setYbNo(importDto.getYbNo())
|
||||
.setYbMatchFlag(CommonUtil.tryParseInt(importDto.getYbMatchFlag()))
|
||||
.setStatusEnum(PublicationStatus.ACTIVE.getValue())
|
||||
.setChrgitmLv(CommonUtil.tryParseInt(importDto.getChrgitmLv()));
|
||||
.setName(importDto.getName()).setCategoryCode(importDto.getCategoryCode())
|
||||
.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(importDto.getName()))
|
||||
.setWbStr(ChineseConvertUtils.toWBFirstLetter(importDto.getName()))
|
||||
.setPermittedUnitCode(importDto.getPermittedUnitCode()).setOrgId(orgId)
|
||||
.setYbFlag(CommonUtil.tryParseInt(importDto.getYbFlag())).setYbNo(importDto.getYbNo())
|
||||
.setYbMatchFlag(CommonUtil.tryParseInt(importDto.getYbMatchFlag()))
|
||||
.setStatusEnum(PublicationStatus.ACTIVE.getValue())
|
||||
.setChrgitmLv(CommonUtil.tryParseInt(importDto.getChrgitmLv()));
|
||||
return activityDefinition;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,53 +115,53 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
MedicationManageInitDto medicationManageInitDto = new MedicationManageInitDto();
|
||||
// 获取状态,从枚举里面取下拉值
|
||||
List<MedicationManageInitDto.statusEnumOption> statusEnumOptions = Stream.of(PublicationStatus.values())
|
||||
.map(status -> new MedicationManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
.map(status -> new MedicationManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
// 获取适用范围
|
||||
List<MedicationManageInitDto.domainEnumOption> domainEnumOptions = Stream.of(ApplicableScope.values())
|
||||
.map(domain -> new MedicationManageInitDto.domainEnumOption(domain.getValue(), domain.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
.map(domain -> new MedicationManageInitDto.domainEnumOption(domain.getValue(), domain.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
// 查询供应商列表
|
||||
List<Supplier> supplierList = supplierService.getList();
|
||||
// 供应商信息
|
||||
List<MedicationManageInitDto.supplierListOption> supplierListOptions = supplierList.stream()
|
||||
.map(supplier -> new MedicationManageInitDto.supplierListOption(supplier.getId(), supplier.getName()))
|
||||
.collect(Collectors.toList());
|
||||
.map(supplier -> new MedicationManageInitDto.supplierListOption(supplier.getId(), supplier.getName()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 获取药品分类
|
||||
List<SysDictData> medicalList =
|
||||
sysDictTypeService.selectDictDataByType(CommonConstants.DictName.MED_CATEGORY_CODE);
|
||||
List<SysDictData> medicalList
|
||||
= sysDictTypeService.selectDictDataByType(CommonConstants.DictName.MED_CATEGORY_CODE);
|
||||
// 获取药品分类
|
||||
List<MedicationManageInitDto.dictCategoryCode> medicationCategories = medicalList.stream().map(
|
||||
category -> new MedicationManageInitDto.dictCategoryCode(category.getDictValue(), category.getDictLabel()))
|
||||
.collect(Collectors.toList());
|
||||
category -> new MedicationManageInitDto.dictCategoryCode(category.getDictValue(), category.getDictLabel()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 获取是/否 列表
|
||||
// 获取状态
|
||||
List<MedicationManageInitDto.statusEnumOption> statusWeatherOption = Stream.of(Whether.values())
|
||||
.map(status -> new MedicationManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 权限限制
|
||||
List<MedicationManageInitDto.statusEnumOption> statusRestrictedOptions = Stream.of(PermissionLimit.values())
|
||||
.map(status -> new MedicationManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 拆分属性
|
||||
List<MedicationManageInitDto.statusEnumOption> partAttributeEnumOptions = Stream.of(SplitPropertyCode.values())
|
||||
.map(status -> new MedicationManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 住院临时医嘱拆分属性的枚举
|
||||
List<MedicationManageInitDto.statusEnumOption> tempOrderSplitPropertyOptions =
|
||||
Stream.of(TempOrderSplitPropertyCode.values())
|
||||
.map(status -> new MedicationManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 权限限制
|
||||
List<MedicationManageInitDto.statusEnumOption> statusRestrictedOptions = Stream.of(PermissionLimit.values())
|
||||
.map(status -> new MedicationManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 拆分属性
|
||||
List<MedicationManageInitDto.statusEnumOption> partAttributeEnumOptions = Stream.of(SplitPropertyCode.values())
|
||||
.map(status -> new MedicationManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 住院临时医嘱拆分属性的枚举
|
||||
List<MedicationManageInitDto.statusEnumOption> tempOrderSplitPropertyOptions
|
||||
= Stream.of(TempOrderSplitPropertyCode.values())
|
||||
.map(status -> new MedicationManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 医保等级List
|
||||
List<MedicationManageInitDto.statusEnumOption> chrgitmLvOptions = Stream.of(InsuranceLevel.values())
|
||||
.map(status -> new MedicationManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
.map(status -> new MedicationManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
medicationManageInitDto.setStatusFlagOptions(statusEnumOptions);
|
||||
medicationManageInitDto.setDomainFlagOptions(domainEnumOptions);
|
||||
@@ -187,18 +187,18 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
*/
|
||||
@Override
|
||||
public R<?> getMedicationList(MedicationSearchParam medicationSearchParam,
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
// 构建查询条件
|
||||
QueryWrapper<MedicationManageDto> queryWrapper = HisQueryUtils.buildQueryWrapper(medicationSearchParam,
|
||||
searchKey, new HashSet<>(Arrays.asList("name", "name_en", "merchandise_name", "bus_no", "py_str", "wb_str",
|
||||
"merchandise_py_str", "merchandise_wb_str")),
|
||||
null);
|
||||
searchKey, new HashSet<>(Arrays.asList("name", "name_en", "merchandise_name", "bus_no", "py_str", "wb_str",
|
||||
"merchandise_py_str", "merchandise_wb_str")),
|
||||
null);
|
||||
|
||||
IPage<MedicationManageDto> medicationManageDtoPage =
|
||||
medicationManageSearchMapper.getPage(new Page<>(pageNo, pageSize), queryWrapper);
|
||||
IPage<MedicationManageDto> medicationManageDtoPage
|
||||
= medicationManageSearchMapper.getPage(new Page<>(pageNo, pageSize), queryWrapper);
|
||||
|
||||
// 枚举类回显赋值
|
||||
medicationManageDtoPage.getRecords().forEach(e -> {
|
||||
@@ -229,10 +229,10 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
e.setBasicFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getBasicFlag()));
|
||||
// 拆分分属性
|
||||
e.setPartAttributeEnum_enumText(
|
||||
EnumUtils.getInfoByValue(SplitPropertyCode.class, e.getPartAttributeEnum()));
|
||||
EnumUtils.getInfoByValue(SplitPropertyCode.class, e.getPartAttributeEnum()));
|
||||
// 住院临时医嘱拆分属性
|
||||
e.setThoPartAttributeEnum_enumText(
|
||||
EnumUtils.getInfoByValue(TempOrderSplitPropertyCode.class, e.getThoPartAttributeEnum()));
|
||||
EnumUtils.getInfoByValue(TempOrderSplitPropertyCode.class, e.getThoPartAttributeEnum()));
|
||||
// // 活动标记
|
||||
// e.setActiveFlag_enumText(EnumUtils.getInfoByValue(AccountStatus.class, e.getActiveFlag()));
|
||||
|
||||
@@ -260,18 +260,18 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
// 拼音码
|
||||
medicationDefinition.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(medicationDefinition.getName()));
|
||||
medicationDefinition
|
||||
.setMerchandisePyStr(ChineseConvertUtils.toPinyinFirstLetter(medicationDefinition.getMerchandiseName()));
|
||||
.setMerchandisePyStr(ChineseConvertUtils.toPinyinFirstLetter(medicationDefinition.getMerchandiseName()));
|
||||
// 五笔码
|
||||
medicationDefinition.setWbStr(ChineseConvertUtils.toWBFirstLetter(medicationDefinition.getName()));
|
||||
medicationDefinition
|
||||
.setMerchandiseWbStr(ChineseConvertUtils.toWBFirstLetter(medicationDefinition.getMerchandiseName()));
|
||||
.setMerchandiseWbStr(ChineseConvertUtils.toWBFirstLetter(medicationDefinition.getMerchandiseName()));
|
||||
|
||||
ChargeItemDefinition chargeItemDefinition = new ChargeItemDefinition();
|
||||
chargeItemDefinition.setYbType(medicationManageUpDto.getYbType())
|
||||
.setTypeCode(medicationManageUpDto.getTypeCode())
|
||||
.setInstanceTable(CommonConstants.TableName.MED_MEDICATION_DEFINITION)
|
||||
.setInstanceId(medicationManageUpDto.getMedicationDefId()).setPrice(medicationManageUpDto.getRetailPrice())
|
||||
.setChargeName(medicationManageUpDto.getName());
|
||||
.setTypeCode(medicationManageUpDto.getTypeCode())
|
||||
.setInstanceTable(CommonConstants.TableName.MED_MEDICATION_DEFINITION)
|
||||
.setInstanceId(medicationManageUpDto.getMedicationDefId()).setPrice(medicationManageUpDto.getRetailPrice())
|
||||
.setChargeName(medicationManageUpDto.getName());
|
||||
|
||||
// 更新子表药品信息
|
||||
if (medicationService.updateById(medication)) {
|
||||
@@ -279,11 +279,11 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
boolean updateMedicationDefinition = medicationDefinitionService.updateById(medicationDefinition);
|
||||
if (updateMedicationDefinition) {
|
||||
// 调用医保目录对照接口
|
||||
String ybSwitch =
|
||||
SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH); // 医保开关
|
||||
String ybSwitch
|
||||
= SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH); // 医保开关
|
||||
if (Whether.YES.getCode().equals(ybSwitch) && StringUtils.isNotEmpty(medicationDefinition.getYbNo())) {
|
||||
R<?> r = ybService.directoryCheck(CommonConstants.TableName.MED_MEDICATION_DEFINITION,
|
||||
medicationDefinition.getId());
|
||||
medicationDefinition.getId());
|
||||
if (200 != r.getCode()) {
|
||||
throw new RuntimeException("医保目录对照接口异常");
|
||||
}
|
||||
@@ -292,24 +292,24 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
|
||||
// 插入操作记录
|
||||
operationRecordService.addEntityOperationRecord(DbOpType.UPDATE.getCode(),
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, medication);
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, medication);
|
||||
// Todo:封装一个价格初始话的方法给app层调用
|
||||
// 更新价格表
|
||||
boolean updateChargeItemDefinition = itemDefinitionServic.updateItem(chargeItemDefinition);
|
||||
// 更新子表,修改购入价,条件:采购
|
||||
boolean upItemDetail1 = itemDefinitionServic.updateItemDetail(chargeItemDefinition,
|
||||
medicationManageUpDto.getPurchasePrice(), ConditionCode.PURCHASE.getCode());
|
||||
medicationManageUpDto.getPurchasePrice(), ConditionCode.PURCHASE.getCode());
|
||||
// 更新子表,修改零售价,条件:单位
|
||||
boolean upItemDetail2 = itemDefinitionServic.updateItemDetail(chargeItemDefinition,
|
||||
medicationManageUpDto.getRetailPrice(), ConditionCode.UNIT.getCode());
|
||||
medicationManageUpDto.getRetailPrice(), ConditionCode.UNIT.getCode());
|
||||
// 更新子表,修改最高零售价,条件:限制
|
||||
boolean upItemDetail3 = itemDefinitionServic.updateItemDetail(chargeItemDefinition,
|
||||
medicationManageUpDto.getMaximumRetailPrice(), ConditionCode.LIMIT.getCode());
|
||||
medicationManageUpDto.getMaximumRetailPrice(), ConditionCode.LIMIT.getCode());
|
||||
|
||||
return (updateMedicationDefinition && updateChargeItemDefinition && upItemDetail1 && upItemDetail2
|
||||
&& upItemDetail3)
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"药品目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
&& upItemDetail3)
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"药品目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
} else {
|
||||
return R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
@@ -353,11 +353,11 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
// TODO:别用三元,日志在业务代码以后记录
|
||||
// 插入操作记录
|
||||
operationRecordService.addIdsOperationRecord(DbOpType.STOP.getCode(),
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, ids);
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, ids);
|
||||
// 更新药品信息
|
||||
return medicationService.updateBatchById(medicationList)
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"药品目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"药品目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -379,11 +379,11 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
}
|
||||
// 插入操作记录
|
||||
operationRecordService.addIdsOperationRecord(DbOpType.START.getCode(),
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, ids);
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, ids);
|
||||
// 更新药品信息
|
||||
return medicationService.updateBatchById(medicationList)
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"药品目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"药品目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -403,11 +403,11 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
// 拼音码
|
||||
medicationDetail.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(medicationDetail.getName()));
|
||||
medicationDetail
|
||||
.setMerchandisePyStr(ChineseConvertUtils.toPinyinFirstLetter(medicationDetail.getMerchandiseName()));
|
||||
.setMerchandisePyStr(ChineseConvertUtils.toPinyinFirstLetter(medicationDetail.getMerchandiseName()));
|
||||
// 五笔码
|
||||
medicationDetail.setWbStr(ChineseConvertUtils.toWBFirstLetter(medicationDetail.getName()));
|
||||
medicationDetail
|
||||
.setMerchandiseWbStr(ChineseConvertUtils.toWBFirstLetter(medicationDetail.getMerchandiseName()));
|
||||
.setMerchandiseWbStr(ChineseConvertUtils.toWBFirstLetter(medicationDetail.getMerchandiseName()));
|
||||
|
||||
// 新增主表外来药品目录
|
||||
if (medicationDefinitionService.addMedication(medicationDetail)) {
|
||||
@@ -415,31 +415,31 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
String ybSwitch = SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH); // 医保开关
|
||||
if (Whether.YES.getCode().equals(ybSwitch) && StringUtils.isNotEmpty(medicationDetail.getYbNo())) {
|
||||
R<?> r = ybService.directoryCheck(CommonConstants.TableName.MED_MEDICATION_DEFINITION,
|
||||
medicationDetail.getId());
|
||||
medicationDetail.getId());
|
||||
if (200 != r.getCode()) {
|
||||
throw new RuntimeException("医保目录对照接口异常");
|
||||
}
|
||||
}
|
||||
// 插入操作记录
|
||||
operationRecordService.addEntityOperationRecord(DbOpType.INSERT.getCode(),
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, medicationDetail);
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, medicationDetail);
|
||||
// 新增子表外来药品目录
|
||||
boolean insertMedicationSuccess = medicationService.addMedication(medicationDetail);
|
||||
ItemUpFromDirectoryDto itemUpFromDirectoryDto = new ItemUpFromDirectoryDto();
|
||||
BeanUtils.copyProperties(medicationManageUpDto, itemUpFromDirectoryDto);
|
||||
itemUpFromDirectoryDto.setInstanceId(medicationDetail.getMedicationDefId())
|
||||
.setStatusEnum(PublicationStatus.ACTIVE.getValue())
|
||||
.setInstanceTable(CommonConstants.TableName.MED_MEDICATION_DEFINITION)
|
||||
.setEffectiveStart(DateUtils.getNowDate()).setOrgId(SecurityUtils.getLoginUser().getOrgId())
|
||||
.setConditionFlag(Whether.YES.getValue()).setChargeName(medicationDetail.getName())
|
||||
.setPrice(medicationManageUpDto.getRetailPrice());
|
||||
.setStatusEnum(PublicationStatus.ACTIVE.getValue())
|
||||
.setInstanceTable(CommonConstants.TableName.MED_MEDICATION_DEFINITION)
|
||||
.setEffectiveStart(DateUtils.getNowDate()).setOrgId(SecurityUtils.getLoginUser().getOrgId())
|
||||
.setConditionFlag(Whether.YES.getValue()).setChargeName(medicationDetail.getName())
|
||||
.setPrice(medicationManageUpDto.getRetailPrice());
|
||||
|
||||
// 添加药品成功后,添加相应的条件价格表信息
|
||||
boolean insertItemDefinitionSuccess = itemDefinitionServic.addItem(itemUpFromDirectoryDto);
|
||||
|
||||
return (insertMedicationSuccess && insertItemDefinitionSuccess)
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"药品目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null));
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"药品目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null));
|
||||
} else {
|
||||
return R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null));
|
||||
}
|
||||
@@ -447,11 +447,11 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
|
||||
@Override
|
||||
public R<?> exportMedication(String searchKey, Integer ybMatchFlag, Integer statusEnum, String categoryCode,
|
||||
HttpServletResponse response) {
|
||||
HttpServletResponse response) {
|
||||
// 获取租户ID
|
||||
Integer tenantId = SecurityUtils.getLoginUser().getTenantId();
|
||||
List<MedicationManageDto> list =
|
||||
medicationManageSearchMapper.getList(searchKey, ybMatchFlag, statusEnum, categoryCode, tenantId);
|
||||
List<MedicationManageDto> list
|
||||
= medicationManageSearchMapper.getList(searchKey, ybMatchFlag, statusEnum, categoryCode, tenantId);
|
||||
ExcelUtil<MedicationManageDto> util = new ExcelUtil<>(MedicationManageDto.class);
|
||||
util.exportExcel(response, list, "药品目录");
|
||||
return null;
|
||||
@@ -479,24 +479,24 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
// 查询机构ID、位置信息供后续使用
|
||||
Long orgId = SecurityUtils.getLoginUser().getOrgId();
|
||||
List<Location> locationList = locationService.list(new LambdaQueryWrapper<Location>()
|
||||
.eq(Location::getDeleteFlag, DelFlag.NO.getCode()).orderByAsc(Location::getId));
|
||||
.eq(Location::getDeleteFlag, DelFlag.NO.getCode()).orderByAsc(Location::getId));
|
||||
Long defaultLocationId = locationList.stream().findFirst().orElse(new Location()).getId();
|
||||
Map<String, List<Location>> locationNameMap =
|
||||
locationList.stream().collect(Collectors.groupingBy(Location::getName));
|
||||
Map<String, List<Location>> locationNameMap
|
||||
= locationList.stream().collect(Collectors.groupingBy(Location::getName));
|
||||
// 创建表数据
|
||||
for (MedicationImportDto importDto : importDtoList) {
|
||||
// 创建药品定义
|
||||
MedicationDefinition medicationDefinition = createMedicationDefinitionEntity(importDto);
|
||||
medicationDefinitionService.save(medicationDefinition);
|
||||
// 创建药品
|
||||
Medication medication =
|
||||
createMedicationEntity(importDto, medicationDefinition.getId(), defaultLocationId, locationNameMap);
|
||||
Medication medication
|
||||
= createMedicationEntity(importDto, medicationDefinition.getId(), defaultLocationId, locationNameMap);
|
||||
medicationService.save(medication);
|
||||
// 创建费用定价和详情
|
||||
chargeItemDefinitionService.addChargeItemDefinitionAndDetail(importDto.getName(), importDto.getTypeCode(),
|
||||
importDto.getYbType(), importDto.getUnitCode(), importDto.getPurchasePrice(),
|
||||
importDto.getRetailPrice(), importDto.getMaximumRetailPrice(), orgId,
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, medicationDefinition.getId());
|
||||
importDto.getYbType(), importDto.getUnitCode(), importDto.getPurchasePrice(),
|
||||
importDto.getRetailPrice(), importDto.getMaximumRetailPrice(), orgId,
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, medicationDefinition.getId());
|
||||
}
|
||||
return R.ok(null, "导入成功!");
|
||||
}
|
||||
@@ -520,11 +520,11 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
*/
|
||||
@Override
|
||||
public R<?> validateMedicationEdit(Long medicationId) {
|
||||
List<MedicationRequest> medicationRequestList =
|
||||
medicationRequestService.getMedRequestByMedicationId(medicationId);
|
||||
List<MedicationRequest> medicationRequestList
|
||||
= medicationRequestService.getMedRequestByMedicationId(medicationId);
|
||||
if (!medicationRequestList.isEmpty()) {
|
||||
if (medicationRequestList.stream()
|
||||
.allMatch(x -> x.getStatusEnum().equals(RequestStatus.COMPLETED.getValue()))) {
|
||||
.allMatch(x -> x.getStatusEnum().equals(RequestStatus.COMPLETED.getValue()))) {
|
||||
return R.ok(1, "医生开过该药品,不可编辑");
|
||||
} else {
|
||||
// 校验是否可以编辑
|
||||
@@ -539,7 +539,7 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
|
||||
/**
|
||||
* 导入信息校验
|
||||
*
|
||||
*
|
||||
* @param importDtoList 药品目录导入数据列表
|
||||
*/
|
||||
private R<?> validateImportDtoList(List<MedicationImportDto> importDtoList) {
|
||||
@@ -556,9 +556,9 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
lineValidateMsgList.add("药品分类必填");
|
||||
}
|
||||
if (Whether.YES.getCode().equals(importDto.getYbMatchFlag())
|
||||
&& !MedCategoryCode.TRADITIONAL_CHINESE_MEDICINE.getValue().equals(importDto.getCategoryCode())
|
||||
&& !MedCategoryCode.WESTERN_MEDICINE.getValue().equals(importDto.getCategoryCode())
|
||||
&& !MedCategoryCode.CHINESE_HERBAL_MEDICINE.getValue().equals(importDto.getCategoryCode())) {
|
||||
&& !MedCategoryCode.TRADITIONAL_CHINESE_MEDICINE.getValue().equals(importDto.getCategoryCode())
|
||||
&& !MedCategoryCode.WESTERN_MEDICINE.getValue().equals(importDto.getCategoryCode())
|
||||
&& !MedCategoryCode.CHINESE_HERBAL_MEDICINE.getValue().equals(importDto.getCategoryCode())) {
|
||||
lineValidateMsgList.add("医保药的药品分类只能选择中成药、西药或中草药;");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getMerchandiseName())) {
|
||||
@@ -602,7 +602,7 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
lineValidateMsgList.add("是否限制使用必填");
|
||||
}
|
||||
if (Whether.YES.getCode().equals(importDto.getRestrictedFlag())
|
||||
&& StringUtils.isEmpty(importDto.getRestrictedScope())) {
|
||||
&& StringUtils.isEmpty(importDto.getRestrictedScope())) {
|
||||
lineValidateMsgList.add("限制使用时,限制使用范围必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getChildrenFlag())) {
|
||||
@@ -615,7 +615,7 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
lineValidateMsgList.add("是否抗生素必填");
|
||||
}
|
||||
if (Whether.YES.getCode().equals(importDto.getAntibioticFlag())
|
||||
&& StringUtils.isEmpty(importDto.getAntibioticCode())) {
|
||||
&& StringUtils.isEmpty(importDto.getAntibioticCode())) {
|
||||
lineValidateMsgList.add("为抗生素时,抗生素分类必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getSelfFlag())) {
|
||||
@@ -728,7 +728,7 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
}
|
||||
if (!lineValidateMsgList.isEmpty()) {
|
||||
fieldValidateMsgList
|
||||
.add("■ 第" + importDto.getLineNumber() + "行:" + String.join(",", lineValidateMsgList) + ";");
|
||||
.add("■ 第" + importDto.getLineNumber() + "行:" + String.join(",", lineValidateMsgList) + ";");
|
||||
}
|
||||
}
|
||||
if (!fieldValidateMsgList.isEmpty()) {
|
||||
@@ -737,15 +737,15 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
// 重复校验(文件行重复)
|
||||
List<String> lineRepeatedValidateMsgList = new ArrayList<>();
|
||||
List<List<MedicationImportDto>> importDtoGroupList = new ArrayList<>(importDtoList.stream()
|
||||
.collect(Collectors.groupingBy(e -> e.getName() + e.getManufacturerText() + e.getTotalVolume())).values());
|
||||
.collect(Collectors.groupingBy(e -> e.getName() + e.getManufacturerText() + e.getTotalVolume())).values());
|
||||
for (List<MedicationImportDto> importDtoGroup : importDtoGroupList) {
|
||||
if (importDtoGroup.size() > 1) {
|
||||
lineRepeatedValidateMsgList
|
||||
.add(
|
||||
"■ 第"
|
||||
+ importDtoGroup.stream().map(MedicationImportDto::getLineNumber).sorted()
|
||||
.map(Object::toString).collect(Collectors.joining(","))
|
||||
+ "行的【" + importDtoGroup.get(0).getName() + "】重复;");
|
||||
.add(
|
||||
"■ 第"
|
||||
+ importDtoGroup.stream().map(MedicationImportDto::getLineNumber).sorted()
|
||||
.map(Object::toString).collect(Collectors.joining(","))
|
||||
+ "行的【" + importDtoGroup.get(0).getName() + "】重复;");
|
||||
}
|
||||
}
|
||||
if (!lineRepeatedValidateMsgList.isEmpty()) {
|
||||
@@ -755,18 +755,18 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
List<String> dbRepeatedValidateMsgList = new ArrayList<>();
|
||||
for (MedicationImportDto importDto : importDtoList) {
|
||||
List<MedicationDefinition> medicationDefinitionList = medicationDefinitionService.list(
|
||||
new LambdaQueryWrapper<MedicationDefinition>().eq(MedicationDefinition::getName, importDto.getName())
|
||||
.eq(MedicationDefinition::getManufacturerText, importDto.getManufacturerText()));
|
||||
new LambdaQueryWrapper<MedicationDefinition>().eq(MedicationDefinition::getName, importDto.getName())
|
||||
.eq(MedicationDefinition::getManufacturerText, importDto.getManufacturerText()));
|
||||
if (!medicationDefinitionList.isEmpty()) {
|
||||
List<Medication> medicationList =
|
||||
medicationService.list(new LambdaQueryWrapper<Medication>()
|
||||
.in(Medication::getMedicationDefId,
|
||||
medicationDefinitionList.stream().map(MedicationDefinition::getId)
|
||||
.collect(Collectors.toList()))
|
||||
.eq(Medication::getTotalVolume, importDto.getTotalVolume()));
|
||||
List<Medication> medicationList
|
||||
= medicationService.list(new LambdaQueryWrapper<Medication>()
|
||||
.in(Medication::getMedicationDefId,
|
||||
medicationDefinitionList.stream().map(MedicationDefinition::getId)
|
||||
.collect(Collectors.toList()))
|
||||
.eq(Medication::getTotalVolume, importDto.getTotalVolume()));
|
||||
if (!medicationList.isEmpty()) {
|
||||
dbRepeatedValidateMsgList
|
||||
.add("■ 第" + importDto.getLineNumber() + "行的【" + importDto.getName() + "】在系统中已存在;");
|
||||
.add("■ 第" + importDto.getLineNumber() + "行的【" + importDto.getName() + "】在系统中已存在;");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -778,48 +778,48 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
|
||||
/**
|
||||
* 创建药品定义实体
|
||||
*
|
||||
*
|
||||
* @param importDto 药品目录导入Dto
|
||||
* @return 药品定义实体
|
||||
*/
|
||||
private MedicationDefinition createMedicationDefinitionEntity(MedicationImportDto importDto) {
|
||||
MedicationDefinition medicationDefinition = new MedicationDefinition();
|
||||
medicationDefinition.setName(importDto.getName())
|
||||
.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.MEDICATION_NUM.getPrefix(), 10)).setDomainEnum(1)
|
||||
.setVersion(importDto.getVersion()).setNameEn(importDto.getNameEn())
|
||||
.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(importDto.getName()))
|
||||
.setWbStr(ChineseConvertUtils.toWBFirstLetter(importDto.getName()))
|
||||
.setCategoryCode(importDto.getCategoryCode()).setMerchandiseName(importDto.getMerchandiseName())
|
||||
.setMerchandisePyStr(ChineseConvertUtils.toPinyinFirstLetter(importDto.getMerchandiseName()))
|
||||
.setMerchandiseWbStr(ChineseConvertUtils.toPinyinFirstLetter(importDto.getMerchandiseName()))
|
||||
.setUnitCode(importDto.getUnitCode()).setMinUnitCode(importDto.getMinUnitCode())
|
||||
.setPartPercent(importDto.getPartPercent()).setDoseFrom(CommonUtil.tryParseInt(importDto.getDoseFrom()))
|
||||
.setApprovalNumber(importDto.getApprovalNumber())
|
||||
.setYbMatchFlag(CommonUtil.tryParseInt(importDto.getYbMatchFlag())).setYbNo(importDto.getYbNo())
|
||||
.setPharmacologyCategoryCode(importDto.getPharmacologyCategoryCode())
|
||||
.setSkinTestFlag(CommonUtil.tryParseInt(importDto.getSkinTestFlag()))
|
||||
.setInjectFlag(CommonUtil.tryParseInt(importDto.getInjectFlag()))
|
||||
.setManufacturerText(importDto.getManufacturerText())
|
||||
.setRestrictedFlag(CommonUtil.tryParseInt(importDto.getRestrictedFlag()))
|
||||
.setRestrictedScope(importDto.getRestrictedScope()).setActiveFlag(Whether.YES.getValue())
|
||||
.setChildrenFlag(CommonUtil.tryParseInt(importDto.getChildrenFlag()))
|
||||
.setNationalDrugCode(importDto.getNationalDrugCode())
|
||||
.setPartAttributeEnum(CommonUtil.tryParseInt(importDto.getPartAttributeEnum()))
|
||||
.setAntibioticCode(importDto.getAntibioticCode())
|
||||
.setSelfFlag(CommonUtil.tryParseInt(importDto.getSelfFlag()))
|
||||
.setAntibioticFlag(CommonUtil.tryParseInt(importDto.getAntibioticFlag()))
|
||||
.setBasicFlag(CommonUtil.tryParseInt(importDto.getBasicFlag()))
|
||||
.setThoPartAttributeEnum(CommonUtil.tryParseInt(importDto.getThoPartAttributeEnum()))
|
||||
.setUnitConversionRatio(importDto.getUnitConversionRatio())
|
||||
.setChrgitmLv(CommonUtil.tryParseInt(importDto.getChrgitmLv()))
|
||||
.setRxFlag(CommonUtil.tryParseInt(importDto.getRxFlag())).setItemMinQuantity(importDto.getItemMinQuantity())
|
||||
.setItemMaxQuantity(importDto.getItemMaxQuantity());
|
||||
.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.MEDICATION_NUM.getPrefix(), 10)).setDomainEnum(1)
|
||||
.setVersion(importDto.getVersion()).setNameEn(importDto.getNameEn())
|
||||
.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(importDto.getName()))
|
||||
.setWbStr(ChineseConvertUtils.toWBFirstLetter(importDto.getName()))
|
||||
.setCategoryCode(importDto.getCategoryCode()).setMerchandiseName(importDto.getMerchandiseName())
|
||||
.setMerchandisePyStr(ChineseConvertUtils.toPinyinFirstLetter(importDto.getMerchandiseName()))
|
||||
.setMerchandiseWbStr(ChineseConvertUtils.toPinyinFirstLetter(importDto.getMerchandiseName()))
|
||||
.setUnitCode(importDto.getUnitCode()).setMinUnitCode(importDto.getMinUnitCode())
|
||||
.setPartPercent(importDto.getPartPercent()).setDoseFrom(CommonUtil.tryParseInt(importDto.getDoseFrom()))
|
||||
.setApprovalNumber(importDto.getApprovalNumber())
|
||||
.setYbMatchFlag(CommonUtil.tryParseInt(importDto.getYbMatchFlag())).setYbNo(importDto.getYbNo())
|
||||
.setPharmacologyCategoryCode(importDto.getPharmacologyCategoryCode())
|
||||
.setSkinTestFlag(CommonUtil.tryParseInt(importDto.getSkinTestFlag()))
|
||||
.setInjectFlag(CommonUtil.tryParseInt(importDto.getInjectFlag()))
|
||||
.setManufacturerText(importDto.getManufacturerText())
|
||||
.setRestrictedFlag(CommonUtil.tryParseInt(importDto.getRestrictedFlag()))
|
||||
.setRestrictedScope(importDto.getRestrictedScope()).setActiveFlag(Whether.YES.getValue())
|
||||
.setChildrenFlag(CommonUtil.tryParseInt(importDto.getChildrenFlag()))
|
||||
.setNationalDrugCode(importDto.getNationalDrugCode())
|
||||
.setPartAttributeEnum(CommonUtil.tryParseInt(importDto.getPartAttributeEnum()))
|
||||
.setAntibioticCode(importDto.getAntibioticCode())
|
||||
.setSelfFlag(CommonUtil.tryParseInt(importDto.getSelfFlag()))
|
||||
.setAntibioticFlag(CommonUtil.tryParseInt(importDto.getAntibioticFlag()))
|
||||
.setBasicFlag(CommonUtil.tryParseInt(importDto.getBasicFlag()))
|
||||
.setThoPartAttributeEnum(CommonUtil.tryParseInt(importDto.getThoPartAttributeEnum()))
|
||||
.setUnitConversionRatio(importDto.getUnitConversionRatio())
|
||||
.setChrgitmLv(CommonUtil.tryParseInt(importDto.getChrgitmLv()))
|
||||
.setRxFlag(CommonUtil.tryParseInt(importDto.getRxFlag())).setItemMinQuantity(importDto.getItemMinQuantity())
|
||||
.setItemMaxQuantity(importDto.getItemMaxQuantity());
|
||||
return medicationDefinition;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建药品基本实体
|
||||
*
|
||||
*
|
||||
* @param importDto 药品目录导入Dto
|
||||
* @param medicationDefId 药品定义ID
|
||||
* @param defaultLocationId 默认位置ID
|
||||
@@ -827,7 +827,7 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
* @return 药品基本实体
|
||||
*/
|
||||
private Medication createMedicationEntity(MedicationImportDto importDto, Long medicationDefId,
|
||||
Long defaultLocationId, Map<String, List<Location>> locationNameMap) {
|
||||
Long defaultLocationId, Map<String, List<Location>> locationNameMap) {
|
||||
Medication medication = new Medication();
|
||||
// 根据输入的所在位置名称获取位置ID
|
||||
List<Location> mapLocationList = locationNameMap.get(importDto.getLocationName());
|
||||
@@ -837,10 +837,10 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
medication.setLocationId(mapLocationList.get(0).getId());
|
||||
}
|
||||
medication.setMedicationDefId(medicationDefId).setStatusEnum(PublicationStatus.ACTIVE.getValue())
|
||||
.setDoseFormCode(importDto.getDoseFrom()).setTotalVolume(importDto.getTotalVolume())
|
||||
.setActiveFlag(Whether.YES.getValue()).setMethodCode(importDto.getMethodCode())
|
||||
.setRateCode(importDto.getRateCode()).setDose(importDto.getDose())
|
||||
.setDoseUnitCode(importDto.getDoseUnitCode()).setMaxUnit(importDto.getMaxUnit());
|
||||
.setDoseFormCode(importDto.getDoseFrom()).setTotalVolume(importDto.getTotalVolume())
|
||||
.setActiveFlag(Whether.YES.getValue()).setMethodCode(importDto.getMethodCode())
|
||||
.setRateCode(importDto.getRateCode()).setDose(importDto.getDose())
|
||||
.setDoseUnitCode(importDto.getDoseUnitCode()).setMaxUnit(importDto.getMaxUnit());
|
||||
return medication;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,271 +22,414 @@ import javax.validation.constraints.NotNull;
|
||||
@Accessors(chain = true)
|
||||
public class MedicationManageDto {
|
||||
|
||||
/** ID */
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 药品编码 */
|
||||
/**
|
||||
* 药品编码
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long medicationDefId;
|
||||
|
||||
/** 药品状态 */
|
||||
/**
|
||||
* 药品状态
|
||||
*/
|
||||
private Integer statusEnum;
|
||||
private String statusEnum_enumText;
|
||||
|
||||
/** 所属科室 */
|
||||
/**
|
||||
* 所属科室
|
||||
*/
|
||||
@Dict(dictTable = "adm_organization", dictCode = "id", dictText = "name")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long orgId;
|
||||
private String orgId_dictText;
|
||||
|
||||
/** 所在位置 */
|
||||
/**
|
||||
* 所在位置
|
||||
*/
|
||||
@Dict(dictTable = "adm_location", dictCode = "id", dictText = "name")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long locationId;
|
||||
private String locationId_dictText;
|
||||
|
||||
/** 剂型 */
|
||||
/**
|
||||
* 剂型
|
||||
*/
|
||||
@Dict(dictCode = "dose_form_code")
|
||||
private String doseFormCode;
|
||||
private String doseFormCode_dictText;
|
||||
|
||||
/** 规格 */
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
private String totalVolume;
|
||||
|
||||
/** 成分 */
|
||||
/**
|
||||
* 成分
|
||||
*/
|
||||
private String ingredientItem;
|
||||
|
||||
/** 是否为活性 */
|
||||
/**
|
||||
* 是否为活性
|
||||
*/
|
||||
private Integer activeFlag;
|
||||
private String activeFlag_enumText;
|
||||
|
||||
/** 批次号 */
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
private String lotNumber;
|
||||
|
||||
/** 生效日期 */
|
||||
/**
|
||||
* 生效日期
|
||||
*/
|
||||
private Date effectiveDate;
|
||||
|
||||
/** 到期日期 */
|
||||
/**
|
||||
* 到期日期
|
||||
*/
|
||||
private Date expirationDate;
|
||||
|
||||
/** 用法 */
|
||||
/**
|
||||
* 用法
|
||||
*/
|
||||
@Dict(dictCode = "method_code")
|
||||
private String methodCode;
|
||||
private String methodCode_dictText;
|
||||
|
||||
/** 用药频次 */
|
||||
/**
|
||||
* 用药频次
|
||||
*/
|
||||
@Dict(dictCode = "rate_code")
|
||||
private String rateCode;
|
||||
private String rateCode_dictText;
|
||||
|
||||
/** 单次剂量 */
|
||||
/**
|
||||
* 单次剂量
|
||||
*/
|
||||
private BigDecimal dose;
|
||||
|
||||
/** 剂量单位 */
|
||||
/**
|
||||
* 剂量单位
|
||||
*/
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String doseUnitCode;
|
||||
private String doseUnitCode_dictText;
|
||||
|
||||
/** 单次最大剂量 */
|
||||
/**
|
||||
* 单次最大剂量
|
||||
*/
|
||||
private BigDecimal maxUnit;
|
||||
|
||||
/** 药品定义 */
|
||||
/**
|
||||
* 药品定义
|
||||
*/
|
||||
private String definition;
|
||||
|
||||
/** 用量限定 */
|
||||
/**
|
||||
* 用量限定
|
||||
*/
|
||||
private BigDecimal usageLimit;
|
||||
|
||||
/** DDD值 */
|
||||
/**
|
||||
* DDD值
|
||||
*/
|
||||
@Dict(dictCode = "ddd_code")
|
||||
private String dddCode;
|
||||
private String dddCode_dictText;
|
||||
|
||||
/** DDD单位 */
|
||||
/**
|
||||
* DDD单位
|
||||
*/
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String dddUnitCode;
|
||||
private String dddUnitCode_dictText;
|
||||
|
||||
/** 药品编号 */
|
||||
/**
|
||||
* 药品编号
|
||||
*/
|
||||
private String busNo;
|
||||
|
||||
/** 药品名称 */
|
||||
/**
|
||||
* 药品名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/** 适用范围 */
|
||||
/**
|
||||
* 适用范围
|
||||
*/
|
||||
private Integer domainEnum;
|
||||
private String domainEnum_enumText;
|
||||
|
||||
/** 药品版本 */
|
||||
/**
|
||||
* 药品版本
|
||||
*/
|
||||
private String version;
|
||||
|
||||
/** 英文药名 */
|
||||
/**
|
||||
* 英文药名
|
||||
*/
|
||||
private String nameEn;
|
||||
|
||||
/** 药品名称拼音码 */
|
||||
/**
|
||||
* 药品名称拼音码
|
||||
*/
|
||||
private String pyStr;
|
||||
|
||||
/** 药品五笔码 */
|
||||
/**
|
||||
* 药品五笔码
|
||||
*/
|
||||
private String wbStr;
|
||||
|
||||
/** 药品分类 */
|
||||
/**
|
||||
* 药品分类
|
||||
*/
|
||||
@Dict(dictCode = "med_category_code")
|
||||
private String categoryCode;
|
||||
private String categoryCode_dictText;
|
||||
|
||||
/** 商品名称 */
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String merchandiseName;
|
||||
|
||||
/** 商品名称拼音码 */
|
||||
/**
|
||||
* 商品名称拼音码
|
||||
*/
|
||||
private String merchandisePyStr;
|
||||
|
||||
/** 商品五笔码 */
|
||||
/**
|
||||
* 商品五笔码
|
||||
*/
|
||||
private String merchandiseWbStr;
|
||||
|
||||
/** 药品单位 */
|
||||
/**
|
||||
* 药品单位
|
||||
*/
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String unitCode;
|
||||
private String unitCode_dictText;
|
||||
|
||||
/** 最小单位 */
|
||||
/**
|
||||
* 最小单位
|
||||
*/
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String minUnitCode;
|
||||
private String minUnitCode_dictText;
|
||||
|
||||
/** 所含耗材 */
|
||||
/**
|
||||
* 所含耗材
|
||||
*/
|
||||
private String comprisedText;
|
||||
|
||||
/** 拆零比 */
|
||||
/**
|
||||
* 拆零比
|
||||
*/
|
||||
private BigDecimal partPercent;
|
||||
|
||||
/** 剂量形式 */
|
||||
/**
|
||||
* 剂量形式
|
||||
*/
|
||||
@Dict(dictCode = "dose_form_code")
|
||||
private Integer doseFrom;
|
||||
private String doseFrom_dictText;
|
||||
|
||||
/** 批准文号 */
|
||||
/**
|
||||
* 批准文号
|
||||
*/
|
||||
private String approvalNumber;
|
||||
|
||||
/** 医保是否对码 */
|
||||
/**
|
||||
* 医保是否对码
|
||||
*/
|
||||
private Integer ybMatchFlag;
|
||||
private String ybMatchFlag_enumText;;
|
||||
private String ybMatchFlag_enumText;
|
||||
;
|
||||
|
||||
/** 医保编码 */
|
||||
private String ybNo;
|
||||
|
||||
/** 药理作用分类 */
|
||||
/**
|
||||
* 药理作用分类
|
||||
*/
|
||||
private String pharmacologyCategoryCode;
|
||||
|
||||
/** 是否皮试 */
|
||||
/**
|
||||
* 是否皮试
|
||||
*/
|
||||
private Integer skinTestFlag;
|
||||
private String skinTestFlag_enumText;
|
||||
|
||||
/** 是否为注射药物 */
|
||||
/**
|
||||
* 是否为注射药物
|
||||
*/
|
||||
private Integer injectFlag;
|
||||
private String injectFlag_enumText;
|
||||
|
||||
/** 生产厂家 */
|
||||
/**
|
||||
* 生产厂家
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long manufacturerId;
|
||||
|
||||
/** 供应商 */
|
||||
/**
|
||||
* 供应商
|
||||
*/
|
||||
@Dict(dictTable = "adm_supplier", dictCode = "id", dictText = "name")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long supplyId;
|
||||
private String supplyId_dictText;
|
||||
|
||||
/** 是否限制使用 */
|
||||
/**
|
||||
* 是否限制使用
|
||||
*/
|
||||
private Integer restrictedFlag;
|
||||
private String restrictedFlag_enumText;
|
||||
|
||||
/** 限制使用范围 */
|
||||
/**
|
||||
* 限制使用范围
|
||||
*/
|
||||
private String restrictedScope;
|
||||
|
||||
/** 儿童用药标志 */
|
||||
/**
|
||||
* 儿童用药标志
|
||||
*/
|
||||
private Integer childrenFlag;
|
||||
private String childrenFlag_enumText;
|
||||
|
||||
/** 产品特性 */
|
||||
/**
|
||||
* 产品特性
|
||||
*/
|
||||
private Integer characteristic;
|
||||
private String characteristic_enumText;
|
||||
|
||||
/** 贯标国家编码 */
|
||||
/**
|
||||
* 贯标国家编码
|
||||
*/
|
||||
private String nationalDrugCode;
|
||||
|
||||
/** 拆分属性 */
|
||||
/**
|
||||
* 拆分属性
|
||||
*/
|
||||
private Integer partAttributeEnum;
|
||||
private String partAttributeEnum_enumText;
|
||||
|
||||
/** 抗生素分类 */
|
||||
/**
|
||||
* 抗生素分类
|
||||
*/
|
||||
@Dict(dictCode = "antibiotic_type_code")
|
||||
private String antibioticCode;
|
||||
private String antibioticCode_dictText;
|
||||
|
||||
/** 权限限制 */
|
||||
/**
|
||||
* 权限限制
|
||||
*/
|
||||
private Integer restrictedEnum;
|
||||
private String restrictedEnum_enumText;
|
||||
|
||||
/** 是否自制 */
|
||||
/**
|
||||
* 是否自制
|
||||
*/
|
||||
private Integer selfFlag;
|
||||
private String selfFlag_enumText;
|
||||
|
||||
/** 是否抗生素 */
|
||||
/**
|
||||
* 是否抗生素
|
||||
*/
|
||||
private Integer antibioticFlag;
|
||||
private String antibioticFlag_enumText;
|
||||
|
||||
/** 基药标识 */
|
||||
/**
|
||||
* 基药标识
|
||||
*/
|
||||
private Integer basicFlag;
|
||||
private String basicFlag_enumText;
|
||||
|
||||
/** 生产厂商文本 */
|
||||
/**
|
||||
* 生产厂商文本
|
||||
*/
|
||||
private String manufacturerText;
|
||||
|
||||
/** 最小库存警戒数量(常规单位) */
|
||||
/**
|
||||
* 最小库存警戒数量(常规单位)
|
||||
*/
|
||||
private BigDecimal itemMinQuantity;
|
||||
|
||||
/** 最大库存警戒数量(常规单位) */
|
||||
/**
|
||||
* 最大库存警戒数量(常规单位)
|
||||
*/
|
||||
private BigDecimal itemMaxQuantity;
|
||||
|
||||
/** 售价 */
|
||||
/**
|
||||
* 售价
|
||||
*/
|
||||
private BigDecimal price;
|
||||
|
||||
/** 单次最小用药频次 */
|
||||
/**
|
||||
* 单次最小用药频次
|
||||
*/
|
||||
private String minRateCode;
|
||||
|
||||
/** 单次最大用药频次 */
|
||||
/**
|
||||
* 单次最大用药频次
|
||||
*/
|
||||
private String maxRateCode;
|
||||
|
||||
/** 医保类别 */
|
||||
/**
|
||||
* 医保类别
|
||||
*/
|
||||
private String ybType;
|
||||
|
||||
/** 财务类别 */
|
||||
/**
|
||||
* 财务类别
|
||||
*/
|
||||
@Dict(dictCode = "fin_type_code")
|
||||
private String typeCode;
|
||||
private String typeCode_dictText;
|
||||
|
||||
/** 成分 */
|
||||
/**
|
||||
* 成分
|
||||
*/
|
||||
private String ingredient;
|
||||
|
||||
/** 购入价 */
|
||||
/**
|
||||
* 购入价
|
||||
*/
|
||||
private BigDecimal purchasePrice;
|
||||
|
||||
/** 零售价 */
|
||||
/**
|
||||
* 零售价
|
||||
*/
|
||||
private BigDecimal retailPrice;
|
||||
|
||||
/** 最高零售价 */
|
||||
/**
|
||||
* 最高零售价
|
||||
*/
|
||||
private BigDecimal maximumRetailPrice;
|
||||
|
||||
/** 住院临时医嘱拆分属性 */
|
||||
/**
|
||||
* 住院临时医嘱拆分属性
|
||||
*/
|
||||
private Integer thoPartAttributeEnum;
|
||||
private String thoPartAttributeEnum_enumText;
|
||||
|
||||
/** 剂量单位换算比 */
|
||||
/**
|
||||
* 剂量单位换算比
|
||||
*/
|
||||
private BigDecimal unitConversionRatio;
|
||||
|
||||
/** 医保等级 */
|
||||
/**
|
||||
* 医保等级
|
||||
*/
|
||||
private Integer chrgitmLv;
|
||||
|
||||
/** 处方标志 */
|
||||
/**
|
||||
* 处方标志
|
||||
*/
|
||||
private Integer rxFlag;
|
||||
|
||||
/**
|
||||
|
||||
@@ -24,238 +24,380 @@ import lombok.experimental.Accessors;
|
||||
@Accessors(chain = true)
|
||||
public class MedicationManageUpDto {
|
||||
|
||||
/** ID */
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 药品编码 */
|
||||
/**
|
||||
* 药品编码
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long medicationDefId;
|
||||
|
||||
/** 所属科室 */
|
||||
/**
|
||||
* 所属科室
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long orgId;
|
||||
|
||||
/** 所在位置 */
|
||||
/**
|
||||
* 所在位置
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long locationId;
|
||||
|
||||
/** 剂型 */
|
||||
/**
|
||||
* 剂型
|
||||
*/
|
||||
private String doseFormCode;
|
||||
|
||||
/** 规格 */
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
private String totalVolume;
|
||||
|
||||
/** 成分 */
|
||||
/**
|
||||
* 成分
|
||||
*/
|
||||
private String ingredientItem;
|
||||
|
||||
/** 是否为活性 */
|
||||
/**
|
||||
* 是否为活性
|
||||
*/
|
||||
private Integer activeFlag;
|
||||
|
||||
/** 批次号 */
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
private String lotNumber;
|
||||
|
||||
/** 生效日期 */
|
||||
/**
|
||||
* 生效日期
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date effectiveDate;
|
||||
|
||||
/** 到期日期 */
|
||||
/**
|
||||
* 到期日期
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date expirationDate;
|
||||
|
||||
/** 用法 */
|
||||
/**
|
||||
* 用法
|
||||
*/
|
||||
private String methodCode;
|
||||
|
||||
/** 用药频次 */
|
||||
/**
|
||||
* 用药频次
|
||||
*/
|
||||
private String rateCode;
|
||||
|
||||
/** 单次剂量 */
|
||||
/**
|
||||
* 单次剂量
|
||||
*/
|
||||
private BigDecimal dose;
|
||||
|
||||
/** 剂量单位 */
|
||||
/**
|
||||
* 剂量单位
|
||||
*/
|
||||
@Dict(dictCode = "unit_code")
|
||||
@NotBlank(message = "剂量单位不能为空")
|
||||
private String doseUnitCode;
|
||||
private String doseUnitCode_dictText;
|
||||
|
||||
/** 单次最大剂量 */
|
||||
/**
|
||||
* 单次最大剂量
|
||||
*/
|
||||
private BigDecimal maxUnit;
|
||||
|
||||
/** 药品定义 */
|
||||
/**
|
||||
* 药品定义
|
||||
*/
|
||||
private String definition;
|
||||
|
||||
/** 药品编号 */
|
||||
/**
|
||||
* 药品编号
|
||||
*/
|
||||
private String busNo;
|
||||
|
||||
/** 药品名称 */
|
||||
/**
|
||||
* 药品名称
|
||||
*/
|
||||
@NotBlank(message = "药品名称不能为空")
|
||||
private String name;
|
||||
|
||||
/** 适用范围 */
|
||||
/**
|
||||
* 适用范围
|
||||
*/
|
||||
private Integer domainEnum;
|
||||
|
||||
/** 药品版本 */
|
||||
/**
|
||||
* 药品版本
|
||||
*/
|
||||
private String version;
|
||||
|
||||
/** 英文药名 */
|
||||
/**
|
||||
* 英文药名
|
||||
*/
|
||||
private String nameEn;
|
||||
|
||||
/** 药品名称拼音码 */
|
||||
/**
|
||||
* 药品名称拼音码
|
||||
*/
|
||||
private String pyStr;
|
||||
|
||||
/** 药品五笔码 */
|
||||
/**
|
||||
* 药品五笔码
|
||||
*/
|
||||
private String wbStr;
|
||||
|
||||
/** 药品分类 */
|
||||
/**
|
||||
* 药品分类
|
||||
*/
|
||||
private String categoryCode;
|
||||
|
||||
/** 商品名称 */
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String merchandiseName;
|
||||
|
||||
/** 商品名称拼音码 */
|
||||
/**
|
||||
* 商品名称拼音码
|
||||
*/
|
||||
private String merchandisePyStr;
|
||||
|
||||
/** 商品五笔码 */
|
||||
/**
|
||||
* 商品五笔码
|
||||
*/
|
||||
private String merchandiseWbStr;
|
||||
|
||||
/** 药品单位 */
|
||||
/**
|
||||
* 药品单位
|
||||
*/
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String unitCode;
|
||||
private String unitCode_dictText;
|
||||
|
||||
/** 最小单位 */
|
||||
/**
|
||||
* 最小单位
|
||||
*/
|
||||
private String minUnitCode;
|
||||
|
||||
/** 所含耗材 */
|
||||
/**
|
||||
* 所含耗材
|
||||
*/
|
||||
private String comprisedText;
|
||||
|
||||
/** 成分 */
|
||||
/**
|
||||
* 成分
|
||||
*/
|
||||
private String ingredient;
|
||||
|
||||
/** 拆零比 */
|
||||
/**
|
||||
* 拆零比
|
||||
*/
|
||||
private BigDecimal partPercent;
|
||||
|
||||
/** 剂量形式 */
|
||||
/**
|
||||
* 剂量形式
|
||||
*/
|
||||
@Dict(dictCode = "dose_form_code")
|
||||
private Integer doseFrom;
|
||||
private String doseFrom_dictText;
|
||||
|
||||
/** 批准文号 */
|
||||
/**
|
||||
* 批准文号
|
||||
*/
|
||||
private String approvalNumber;
|
||||
|
||||
/** 医保是否对码 */
|
||||
/**
|
||||
* 医保是否对码
|
||||
*/
|
||||
private Integer ybMatchFlag;
|
||||
|
||||
/** 医保编码 */
|
||||
/**
|
||||
* 医保编码
|
||||
*/
|
||||
private String ybNo;
|
||||
|
||||
/** 药理作用分类 */
|
||||
/**
|
||||
* 药理作用分类
|
||||
*/
|
||||
private String pharmacologyCategoryCode;
|
||||
|
||||
/** 是否皮试 */
|
||||
/**
|
||||
* 是否皮试
|
||||
*/
|
||||
private Integer skinTestFlag;
|
||||
|
||||
/** 是否为注射药物 */
|
||||
/**
|
||||
* 是否为注射药物
|
||||
*/
|
||||
private Integer injectFlag;
|
||||
|
||||
/** 生产厂家 */
|
||||
/**
|
||||
* 生产厂家
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long manufacturerId;
|
||||
|
||||
/** 生产厂商文本 */
|
||||
/**
|
||||
* 生产厂商文本
|
||||
*/
|
||||
private String manufacturerText;
|
||||
|
||||
/** 供应商 */
|
||||
/**
|
||||
* 供应商
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long supplyId;
|
||||
|
||||
/** 是否限制使用 */
|
||||
/**
|
||||
* 是否限制使用
|
||||
*/
|
||||
private Integer restrictedFlag;
|
||||
|
||||
/** 限制使用范围 */
|
||||
/**
|
||||
* 限制使用范围
|
||||
*/
|
||||
private String restrictedScope;
|
||||
|
||||
/** 儿童用药标志 */
|
||||
/**
|
||||
* 儿童用药标志
|
||||
*/
|
||||
private Integer childrenFlag;
|
||||
|
||||
/** 产品特性 */
|
||||
/**
|
||||
* 产品特性
|
||||
*/
|
||||
private Integer characteristic;
|
||||
|
||||
/** 购入价 */
|
||||
/**
|
||||
* 购入价
|
||||
*/
|
||||
private BigDecimal purchasePrice;
|
||||
|
||||
/** 零售价 */
|
||||
/**
|
||||
* 零售价
|
||||
*/
|
||||
private BigDecimal retailPrice;
|
||||
|
||||
/** 最高零售价 */
|
||||
/**
|
||||
* 最高零售价
|
||||
*/
|
||||
private BigDecimal maximumRetailPrice;
|
||||
|
||||
/** 医保类别 */
|
||||
/**
|
||||
* 医保类别
|
||||
*/
|
||||
private String ybType;
|
||||
|
||||
/** 财务类别 */
|
||||
/**
|
||||
* 财务类别
|
||||
*/
|
||||
@Dict(dictCode = "fin_type_code")
|
||||
private String typeCode;
|
||||
private String typeCode_dictText;
|
||||
|
||||
/** 单次最小用药频次 */
|
||||
/**
|
||||
* 单次最小用药频次
|
||||
*/
|
||||
private String minRateCode;
|
||||
|
||||
/** 单次最大用药频次 */
|
||||
/**
|
||||
* 单次最大用药频次
|
||||
*/
|
||||
private String maxRateCode;
|
||||
|
||||
/** 药品状态 */
|
||||
/**
|
||||
* 药品状态
|
||||
*/
|
||||
private Integer statusEnum;
|
||||
private String statusEnum_enumText;
|
||||
|
||||
/** 拆分属性 */
|
||||
/**
|
||||
* 拆分属性
|
||||
*/
|
||||
private Integer partAttributeEnum;
|
||||
|
||||
/** 贯标国家编码 */
|
||||
/**
|
||||
* 贯标国家编码
|
||||
*/
|
||||
private String nationalDrugCode;
|
||||
|
||||
/** 是否抗生素 */
|
||||
/**
|
||||
* 是否抗生素
|
||||
*/
|
||||
private Integer antibioticFlag;
|
||||
|
||||
/** 是否自制 */
|
||||
/**
|
||||
* 是否自制
|
||||
*/
|
||||
private Integer selfFlag;
|
||||
|
||||
/** DDD值 */
|
||||
/**
|
||||
* DDD值
|
||||
*/
|
||||
private String dddCode;
|
||||
|
||||
/** DDD单位 */
|
||||
/**
|
||||
* DDD单位
|
||||
*/
|
||||
private String dddUnitCode;
|
||||
|
||||
/** 用量限定 */
|
||||
/**
|
||||
* 用量限定
|
||||
*/
|
||||
private BigDecimal usageLimit;
|
||||
|
||||
/** 抗生素分类 */
|
||||
/**
|
||||
* 抗生素分类
|
||||
*/
|
||||
@Dict(dictCode = "antibiotic_type_code")
|
||||
private String antibioticCode;
|
||||
private String antibioticCode_dictText;
|
||||
|
||||
/** 权限限制 */
|
||||
/**
|
||||
* 权限限制
|
||||
*/
|
||||
private Integer restrictedEnum;
|
||||
|
||||
/** 基药标识 */
|
||||
/**
|
||||
* 基药标识
|
||||
*/
|
||||
private Integer basicFlag;
|
||||
|
||||
/** 住院临时医嘱拆分属性 */
|
||||
/**
|
||||
* 住院临时医嘱拆分属性
|
||||
*/
|
||||
private Integer thoPartAttributeEnum;
|
||||
|
||||
/** 最小库存警戒数量(常规单位) */
|
||||
/**
|
||||
* 最小库存警戒数量(常规单位)
|
||||
*/
|
||||
private BigDecimal itemMinQuantity;
|
||||
|
||||
/** 最大库存警戒数量(常规单位) */
|
||||
/**
|
||||
* 最大库存警戒数量(常规单位)
|
||||
*/
|
||||
private BigDecimal itemMaxQuantity;
|
||||
|
||||
/** 剂量单位换算比 */
|
||||
/**
|
||||
* 剂量单位换算比
|
||||
*/
|
||||
private BigDecimal unitConversionRatio;
|
||||
|
||||
/** 医保等级 */
|
||||
/**
|
||||
* 医保等级
|
||||
*/
|
||||
private Integer chrgitmLv;
|
||||
|
||||
/** 处方标志 */
|
||||
/**
|
||||
* 处方标志
|
||||
*/
|
||||
private Integer rxFlag;
|
||||
|
||||
/**
|
||||
|
||||
@@ -89,8 +89,8 @@ public class DepartmentIssuanceOrderServiceImpl implements IDepartmentIssuanceOr
|
||||
@Override
|
||||
public R<?> getDetailPage(String busNo, Integer pageNo, Integer pageSize) {
|
||||
|
||||
Page<DepartmentDetailDto> issuanceOrderDtoDetailPage =
|
||||
departmentCommonMapper.getDetailPage(new Page<>(pageNo, pageSize), busNo);
|
||||
Page<DepartmentDetailDto> issuanceOrderDtoDetailPage
|
||||
= departmentCommonMapper.getDetailPage(new Page<>(pageNo, pageSize), busNo);
|
||||
|
||||
issuanceOrderDtoDetailPage.getRecords().forEach(e -> {
|
||||
// 单据分类
|
||||
@@ -119,15 +119,14 @@ public class DepartmentIssuanceOrderServiceImpl implements IDepartmentIssuanceOr
|
||||
* @param dispenseIdList 耗材发放id
|
||||
* @return 操作结果
|
||||
*/
|
||||
|
||||
@Override
|
||||
public boolean addOrEditIssuanceOrder(List<Long> dispenseIdList) {
|
||||
|
||||
// 获取单据号
|
||||
String busNo = this.getBusNo();
|
||||
// 获取更表所需信息
|
||||
List<DepartmentDetailDto> detailDto =
|
||||
departmentIssuanceOrderMapper.getInfo(dispenseIdList, DispenseStatus.COMPLETED.getValue());
|
||||
List<DepartmentDetailDto> detailDto
|
||||
= departmentIssuanceOrderMapper.getInfo(dispenseIdList, DispenseStatus.COMPLETED.getValue());
|
||||
|
||||
List<SupplyRequest> supplyRequestList = new ArrayList<>();
|
||||
SupplyRequest supplyRequest;
|
||||
@@ -136,24 +135,24 @@ public class DepartmentIssuanceOrderServiceImpl implements IDepartmentIssuanceOr
|
||||
for (DepartmentDetailDto item : detailDto) {
|
||||
// 供应申请
|
||||
supplyRequest = new SupplyRequest().setBusNo(busNo).setTypeEnum(SupplyType.DISPENSING_ORDER.getValue())
|
||||
.setStatusEnum(SupplyStatus.AGREE.getValue()).setCategoryEnum(item.getCategoryEnum())
|
||||
.setItemTable(CommonConstants.TableName.ADM_DEVICE_DEFINITION).setItemId(item.getItemId())
|
||||
.setUnitCode(item.getUnitCode()).setItemQuantity(item.getItemQuantity())
|
||||
.setLotNumber(item.getLotNumber()).setSourceTypeEnum(LocationForm.CABINET.getValue())
|
||||
.setSourceLocationId(item.getSourceLocationId()).setPurposeTypeEnum(LocationForm.DEPARTMENT.getValue())
|
||||
.setPurposeLocationId(item.getPurposeLocationId()).setApplicantId(item.getApplicantId())
|
||||
.setApplyTime(item.getApplyTime()).setApproverId(item.getApproverId())
|
||||
.setApprovalTime(item.getApprovalTime());
|
||||
.setStatusEnum(SupplyStatus.AGREE.getValue()).setCategoryEnum(item.getCategoryEnum())
|
||||
.setItemTable(CommonConstants.TableName.ADM_DEVICE_DEFINITION).setItemId(item.getItemId())
|
||||
.setUnitCode(item.getUnitCode()).setItemQuantity(item.getItemQuantity())
|
||||
.setLotNumber(item.getLotNumber()).setSourceTypeEnum(LocationForm.CABINET.getValue())
|
||||
.setSourceLocationId(item.getSourceLocationId()).setPurposeTypeEnum(LocationForm.DEPARTMENT.getValue())
|
||||
.setPurposeLocationId(item.getPurposeLocationId()).setApplicantId(item.getApplicantId())
|
||||
.setApplyTime(item.getApplyTime()).setApproverId(item.getApproverId())
|
||||
.setApprovalTime(item.getApprovalTime());
|
||||
supplyRequestList.add(supplyRequest);
|
||||
// 供应发放
|
||||
supplyDelivery = new SupplyDelivery().setRequestId(supplyRequest.getId())
|
||||
.setStatusEnum(DispenseStatus.COMPLETED.getValue()).setTypeEnum(supplyRequest.getTypeEnum())
|
||||
.setItemTable(supplyRequest.getItemTable()).setItemId(supplyRequest.getItemId())
|
||||
.setBasedOnTable(CommonConstants.TableName.WOR_DEVICE_DISPENSE).setBasedOnIds(item.getDispenseIds())
|
||||
.setUnitCode(supplyRequest.getUnitCode()).setQuantity(supplyRequest.getItemQuantity())
|
||||
.setLotNumber(supplyRequest.getLotNumber()).setPractitionerId(supplyRequest.getApplicantId())
|
||||
.setOccurrenceTime(supplyRequest.getApprovalTime()).setReceiverId(supplyRequest.getPurposeLocationId())
|
||||
.setReceiveTime(supplyRequest.getApprovalTime());
|
||||
.setStatusEnum(DispenseStatus.COMPLETED.getValue()).setTypeEnum(supplyRequest.getTypeEnum())
|
||||
.setItemTable(supplyRequest.getItemTable()).setItemId(supplyRequest.getItemId())
|
||||
.setBasedOnTable(CommonConstants.TableName.WOR_DEVICE_DISPENSE).setBasedOnIds(item.getDispenseIds())
|
||||
.setUnitCode(supplyRequest.getUnitCode()).setQuantity(supplyRequest.getItemQuantity())
|
||||
.setLotNumber(supplyRequest.getLotNumber()).setPractitionerId(supplyRequest.getApplicantId())
|
||||
.setOccurrenceTime(supplyRequest.getApprovalTime()).setReceiverId(supplyRequest.getPurposeLocationId())
|
||||
.setReceiveTime(supplyRequest.getApprovalTime());
|
||||
|
||||
supplyDeliveryList.add(supplyDelivery);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.openhis.web.doctorstation.appservice;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.template.domain.DoctorPhrase;
|
||||
|
||||
public interface IDoctorPhraseAppService {
|
||||
R<?> getDoctorPhraseList();
|
||||
|
||||
R<?> searchDoctorPhraseList(String phraseName ,Integer phraseType);
|
||||
|
||||
R<?> addDoctorPhrase(DoctorPhrase doctorPhrase);
|
||||
|
||||
R<?> updateDoctorPhrase(DoctorPhrase doctorPhrase);
|
||||
|
||||
R<?> deleteDoctorPhrase(Integer doctorPhraseId);
|
||||
}
|
||||
@@ -30,8 +30,8 @@ public interface IDoctorStationAdviceAppService {
|
||||
* @return 医嘱信息
|
||||
*/
|
||||
IPage<AdviceBaseDto> getAdviceBaseInfo(AdviceBaseDto adviceBaseDto, String searchKey, Long locationId,
|
||||
List<Long> adviceDefinitionIdParamList, Long organizationId, Integer pageNo, Integer pageSize,
|
||||
Integer pricingFlag, List<Integer> adviceTypes, String orderPricing);
|
||||
List<Long> adviceDefinitionIdParamList, Long organizationId, Integer pageNo, Integer pageSize,
|
||||
Integer pricingFlag, List<Integer> adviceTypes, String orderPricing);
|
||||
|
||||
/**
|
||||
* 查询医嘱绑定信息
|
||||
|
||||
@@ -53,6 +53,14 @@ public interface IDoctorStationMainAppService {
|
||||
*/
|
||||
R<?> completeEncounter(Long encounterId);
|
||||
|
||||
/**
|
||||
* 取消完成
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 结果
|
||||
*/
|
||||
R<?> cancelEncounter(Long encounterId);
|
||||
|
||||
/**
|
||||
* 查询处方号列表信息
|
||||
*
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.openhis.web.doctorstation.appservice.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.template.domain.DoctorPhrase;
|
||||
import com.openhis.template.service.IDoctorPhraseService;
|
||||
import com.openhis.web.doctorstation.appservice.IDoctorPhraseAppService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class DoctorPhraesAppServiceImpl implements IDoctorPhraseAppService {
|
||||
|
||||
@Resource
|
||||
private IDoctorPhraseService doctorPhraseService;
|
||||
|
||||
@Override
|
||||
public R<?> getDoctorPhraseList() {
|
||||
List<DoctorPhrase> list = doctorPhraseService.list();
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> searchDoctorPhraseList(String phraseName,Integer phraseType) {
|
||||
LambdaQueryWrapper<DoctorPhrase> wrapper = new LambdaQueryWrapper<>();
|
||||
if (phraseName !=null && ObjectUtil.isNotEmpty(phraseName)) {
|
||||
wrapper.like(DoctorPhrase::getPhraseName, phraseName);
|
||||
}
|
||||
if (phraseType !=null && ObjectUtil.isNotEmpty(phraseType)) {
|
||||
wrapper.eq(DoctorPhrase::getPhraseType, phraseType);
|
||||
}
|
||||
//2.查询
|
||||
List<DoctorPhrase> list = doctorPhraseService.list(wrapper);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> addDoctorPhrase(DoctorPhrase doctorPhrase) {
|
||||
//1.数据校验
|
||||
if(ObjectUtil.isEmpty(doctorPhrase)){
|
||||
return R.fail("医生常用语不能为空");
|
||||
}
|
||||
//2.名称唯一性校验
|
||||
LambdaUpdateWrapper<DoctorPhrase> wrapper = new LambdaUpdateWrapper<>();
|
||||
wrapper.eq(DoctorPhrase::getPhraseName, doctorPhrase.getPhraseName());
|
||||
DoctorPhrase one = doctorPhraseService.getOne(wrapper);
|
||||
if(ObjectUtil.isNotEmpty(one)){
|
||||
return R.fail("该名称已经存在");
|
||||
}
|
||||
//3.新增
|
||||
boolean save = doctorPhraseService.save(doctorPhrase);
|
||||
System.out.println(save);
|
||||
return R.ok(save);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> updateDoctorPhrase(DoctorPhrase doctorPhrase) {
|
||||
//1.数据校验
|
||||
if(ObjectUtil.isEmpty(doctorPhrase)){
|
||||
return R.fail("医生常用语不能为空");
|
||||
}
|
||||
//2.更新
|
||||
boolean updateById = doctorPhraseService.updateById(doctorPhrase);
|
||||
return R.ok(updateById);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> deleteDoctorPhrase(Integer doctorPhraseId) {
|
||||
//1.数据校验
|
||||
if(doctorPhraseId == null){
|
||||
return R.fail("ID不能为空");
|
||||
}
|
||||
//2.删除
|
||||
boolean removeById = doctorPhraseService.removeById(doctorPhraseId);
|
||||
return R.ok(removeById);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,13 +1,5 @@
|
||||
package com.openhis.web.doctorstation.appservice.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
@@ -45,8 +37,13 @@ import com.openhis.workflow.service.IActivityDefinitionService;
|
||||
import com.openhis.workflow.service.IDeviceDispenseService;
|
||||
import com.openhis.workflow.service.IDeviceRequestService;
|
||||
import com.openhis.workflow.service.IServiceRequestService;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 医生站-医嘱/处方 应用实现类
|
||||
@@ -75,7 +72,6 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
|
||||
// @Resource
|
||||
// IOrganizationLocationService iOrganizationLocationService;
|
||||
|
||||
@Resource
|
||||
IMedicationDispenseService iMedicationDispenseService;
|
||||
|
||||
@@ -93,7 +89,6 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
|
||||
// @Resource
|
||||
// OutpatientRegistrationAppMapper outpatientRegistrationAppMapper;
|
||||
|
||||
@Resource
|
||||
DoctorStationSendApplyUtil doctorStationSendApplyUtil;
|
||||
|
||||
@@ -114,8 +109,8 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
*/
|
||||
@Override
|
||||
public IPage<AdviceBaseDto> getAdviceBaseInfo(AdviceBaseDto adviceBaseDto, String searchKey, Long locationId,
|
||||
List<Long> adviceDefinitionIdParamList, Long organizationId, Integer pageNo, Integer pageSize,
|
||||
Integer pricingFlag, List<Integer> adviceTypes, String orderPricing) {
|
||||
List<Long> adviceDefinitionIdParamList, Long organizationId, Integer pageNo, Integer pageSize,
|
||||
Integer pricingFlag, List<Integer> adviceTypes, String orderPricing) {
|
||||
// 设置默认科室 (不取前端传的了)
|
||||
organizationId = SecurityUtils.getLoginUser().getOrgId();
|
||||
|
||||
@@ -127,19 +122,19 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
orderPricingSource = orderPricing;
|
||||
}
|
||||
// 开药时药房允许多选开关
|
||||
String pharmacyMultipleChoiceSwitch =
|
||||
TenantOptionUtil.getOptionContent(TenantOptionDict.PHARMACY_MULTIPLE_CHOICE_SWITCH);
|
||||
String pharmacyMultipleChoiceSwitch
|
||||
= TenantOptionUtil.getOptionContent(TenantOptionDict.PHARMACY_MULTIPLE_CHOICE_SWITCH);
|
||||
// 药房允许多选
|
||||
boolean pharmacyMultipleChoice = Whether.YES.getCode().equals(pharmacyMultipleChoiceSwitch);
|
||||
|
||||
// 构建查询条件
|
||||
QueryWrapper<AdviceBaseDto> queryWrapper = HisQueryUtils.buildQueryWrapper(adviceBaseDto, searchKey,
|
||||
new HashSet<>(Arrays.asList("advice_name", "py_str", "wb_str")), null);
|
||||
new HashSet<>(Arrays.asList("advice_name", "py_str", "wb_str")), null);
|
||||
IPage<AdviceBaseDto> adviceBaseInfo = doctorStationAdviceAppMapper.getAdviceBaseInfo(
|
||||
new Page<>(pageNo, pageSize), PublicationStatus.ACTIVE.getValue(), organizationId,
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, CommonConstants.TableName.ADM_DEVICE_DEFINITION,
|
||||
CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, pricingFlag, adviceDefinitionIdParamList, adviceTypes,
|
||||
queryWrapper);
|
||||
new Page<>(pageNo, pageSize), PublicationStatus.ACTIVE.getValue(), organizationId,
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, CommonConstants.TableName.ADM_DEVICE_DEFINITION,
|
||||
CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, pricingFlag, adviceDefinitionIdParamList, adviceTypes,
|
||||
queryWrapper);
|
||||
List<AdviceBaseDto> adviceBaseDtoList = adviceBaseInfo.getRecords();
|
||||
|
||||
// 如果searchKey不为null,对查询结果进行排序:adviceName以searchKey开头的排在前面
|
||||
@@ -148,30 +143,41 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
}
|
||||
|
||||
// 医嘱定义ID集合
|
||||
List<Long> adviceDefinitionIdList =
|
||||
adviceBaseDtoList.stream().map(AdviceBaseDto::getAdviceDefinitionId).collect(Collectors.toList());
|
||||
List<Long> adviceDefinitionIdList
|
||||
= adviceBaseDtoList.stream().map(AdviceBaseDto::getAdviceDefinitionId).collect(Collectors.toList());
|
||||
// 费用定价主表ID集合
|
||||
List<Long> chargeItemDefinitionIdList =
|
||||
adviceBaseDtoList.stream().map(AdviceBaseDto::getChargeItemDefinitionId).collect(Collectors.toList());
|
||||
List<Long> chargeItemDefinitionIdList
|
||||
= adviceBaseDtoList.stream().map(AdviceBaseDto::getChargeItemDefinitionId).collect(Collectors.toList());
|
||||
// 医嘱库存集合
|
||||
List<AdviceInventoryDto> adviceInventoryList =
|
||||
doctorStationAdviceAppMapper.getAdviceInventory(locationId, adviceDefinitionIdList,
|
||||
CommonConstants.SqlCondition.ABOUT_INVENTORY_TABLE_STR, PublicationStatus.ACTIVE.getValue());
|
||||
List<AdviceInventoryDto> adviceInventoryList
|
||||
= doctorStationAdviceAppMapper.getAdviceInventory(locationId, adviceDefinitionIdList,
|
||||
CommonConstants.SqlCondition.ABOUT_INVENTORY_TABLE_STR, PublicationStatus.ACTIVE.getValue());
|
||||
// 待发放个数信息
|
||||
List<AdviceInventoryDto> adviceDraftInventoryList = doctorStationAdviceAppMapper.getAdviceDraftInventory(
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, CommonConstants.TableName.ADM_DEVICE_DEFINITION,
|
||||
DispenseStatus.DRAFT.getValue(), DispenseStatus.PREPARATION.getValue());
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, CommonConstants.TableName.ADM_DEVICE_DEFINITION,
|
||||
DispenseStatus.DRAFT.getValue(), DispenseStatus.PREPARATION.getValue());
|
||||
// 预减库存
|
||||
List<AdviceInventoryDto> adviceInventory =
|
||||
adviceUtils.subtractInventory(adviceInventoryList, adviceDraftInventoryList);
|
||||
List<AdviceInventoryDto> adviceInventory
|
||||
= adviceUtils.subtractInventory(adviceInventoryList, adviceDraftInventoryList);
|
||||
// 查询取药科室配置
|
||||
List<AdviceInventoryDto> medLocationConfig = doctorStationAdviceAppMapper.getMedLocationConfig(organizationId);
|
||||
// 将配置转为 {categoryCode -> 允许的locationId集合}
|
||||
Map<String, Set<Long>> allowedLocByCategory = new HashMap<>();
|
||||
if (medLocationConfig != null && !medLocationConfig.isEmpty()) {
|
||||
for (AdviceInventoryDto cfg : medLocationConfig) {
|
||||
if (cfg.getCategoryCode() == null || cfg.getLocationId() == null) {
|
||||
continue;
|
||||
}
|
||||
allowedLocByCategory.computeIfAbsent(String.valueOf(cfg.getCategoryCode()), k -> new HashSet<>())
|
||||
.add(cfg.getLocationId());
|
||||
}
|
||||
}
|
||||
// 费用定价子表信息
|
||||
List<AdvicePriceDto> childCharge = doctorStationAdviceAppMapper
|
||||
.getChildCharge(ConditionCode.LOT_NUMBER_PRICE.getCode(), chargeItemDefinitionIdList);
|
||||
.getChildCharge(ConditionCode.LOT_NUMBER_PRICE.getCode(), chargeItemDefinitionIdList);
|
||||
// 费用定价主表信息
|
||||
List<AdvicePriceDto> mainCharge =
|
||||
doctorStationAdviceAppMapper.getMainCharge(chargeItemDefinitionIdList, PublicationStatus.ACTIVE.getValue());
|
||||
List<AdvicePriceDto> mainCharge
|
||||
= doctorStationAdviceAppMapper.getMainCharge(chargeItemDefinitionIdList, PublicationStatus.ACTIVE.getValue());
|
||||
String unitCode = ""; // 包装单位
|
||||
Long chargeItemDefinitionId; // 费用定价主表ID
|
||||
for (AdviceBaseDto baseDto : adviceBaseDtoList) {
|
||||
@@ -179,24 +185,24 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
case CommonConstants.TableName.MED_MEDICATION_DEFINITION: // 药品
|
||||
// 是否皮试
|
||||
baseDto
|
||||
.setSkinTestFlag_enumText(EnumUtils.getInfoByValue(Whether.class, baseDto.getSkinTestFlag()));
|
||||
.setSkinTestFlag_enumText(EnumUtils.getInfoByValue(Whether.class, baseDto.getSkinTestFlag()));
|
||||
// 是否为注射药物
|
||||
baseDto.setInjectFlag_enumText(EnumUtils.getInfoByValue(Whether.class, baseDto.getInjectFlag()));
|
||||
case CommonConstants.TableName.ADM_DEVICE_DEFINITION: // 耗材
|
||||
// 每一条医嘱的库存集合信息 , 包装单位库存前端计算
|
||||
List<AdviceInventoryDto> inventoryList = adviceInventory.stream().filter(e -> baseDto
|
||||
.getAdviceDefinitionId().equals(e.getItemId())
|
||||
&& baseDto.getAdviceTableName().equals(e.getItemTable())
|
||||
&& (pharmacyMultipleChoice
|
||||
.getAdviceDefinitionId().equals(e.getItemId())
|
||||
&& baseDto.getAdviceTableName().equals(e.getItemTable())
|
||||
&& (pharmacyMultipleChoice
|
||||
|| (baseDto.getPositionId() == null || baseDto.getPositionId().equals(e.getLocationId()))))
|
||||
.collect(Collectors.toList());
|
||||
.collect(Collectors.toList());
|
||||
// 库存信息
|
||||
baseDto.setInventoryList(inventoryList);
|
||||
// 设置默认产品批号
|
||||
if (!inventoryList.isEmpty()) {
|
||||
// 库存大于0
|
||||
List<AdviceInventoryDto> hasInventoryList = inventoryList.stream()
|
||||
.filter(e -> e.getQuantity().compareTo(BigDecimal.ZERO) > 0).collect(Collectors.toList());
|
||||
.filter(e -> e.getQuantity().compareTo(BigDecimal.ZERO) > 0).collect(Collectors.toList());
|
||||
if (!hasInventoryList.isEmpty()) {
|
||||
baseDto.setDefaultLotNumber(hasInventoryList.get(0).getLotNumber());
|
||||
}
|
||||
@@ -204,13 +210,13 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
if (!inventoryList.isEmpty() && !medLocationConfig.isEmpty()) {
|
||||
// 第一步:在medLocationConfig中匹配categoryCode
|
||||
AdviceInventoryDto result1 = medLocationConfig.stream()
|
||||
.filter(dto -> baseDto.getCategoryCode().equals(dto.getCategoryCode())).findFirst()
|
||||
.orElse(null);
|
||||
.filter(dto -> baseDto.getCategoryCode().equals(dto.getCategoryCode())).findFirst()
|
||||
.orElse(null);
|
||||
if (result1 != null) {
|
||||
// 第二步:在inventoryList中匹配locationId
|
||||
AdviceInventoryDto result2 = inventoryList.stream()
|
||||
.filter(dto -> result1.getLocationId().equals(dto.getLocationId())).findFirst()
|
||||
.orElse(null);
|
||||
.filter(dto -> result1.getLocationId().equals(dto.getLocationId())).findFirst()
|
||||
.orElse(null);
|
||||
if (result2 != null && result2.getLotNumber() != null) {
|
||||
baseDto.setDefaultLotNumber(result2.getLotNumber());
|
||||
}
|
||||
@@ -226,14 +232,14 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
String finalUnitCode = unitCode;
|
||||
// 从定价子表取价格(适用于批次售卖场景)
|
||||
List<AdvicePriceDto> childPrice = childCharge.stream()
|
||||
.filter(e -> e.getDefinitionId().equals(finalChargeItemDefinitionId)
|
||||
.filter(e -> e.getDefinitionId().equals(finalChargeItemDefinitionId)
|
||||
&& e.getConditionValue().equals(adviceInventoryDto.getLotNumber()))
|
||||
.peek(e -> e.setUnitCode(finalUnitCode)) // 设置 unitCode
|
||||
.collect(Collectors.toList());
|
||||
.peek(e -> e.setUnitCode(finalUnitCode)) // 设置 unitCode
|
||||
.collect(Collectors.toList());
|
||||
// 从定价主表取价格(适用于统一零售价场景)
|
||||
List<AdvicePriceDto> mainPrice = mainCharge.stream()
|
||||
.filter(e -> baseDto.getChargeItemDefinitionId().equals(e.getDefinitionId()))
|
||||
.collect(Collectors.toList());
|
||||
.filter(e -> baseDto.getChargeItemDefinitionId().equals(e.getDefinitionId()))
|
||||
.collect(Collectors.toList());
|
||||
// 按批次售价
|
||||
if (OrderPricingSource.BATCH_SELLING_PRICE.getCode().equals(orderPricingSource)) {
|
||||
priceDtoList.addAll(childPrice);
|
||||
@@ -245,14 +251,14 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
baseDto.setPriceList(priceDtoList);
|
||||
break;
|
||||
case CommonConstants.TableName.WOR_ACTIVITY_DEFINITION: // 诊疗
|
||||
List<AdvicePriceDto> priceList =
|
||||
mainCharge.stream().filter(e -> baseDto.getChargeItemDefinitionId().equals(e.getDefinitionId()))
|
||||
.collect(Collectors.toList());
|
||||
List<AdvicePriceDto> priceList
|
||||
= mainCharge.stream().filter(e -> baseDto.getChargeItemDefinitionId().equals(e.getDefinitionId()))
|
||||
.collect(Collectors.toList());
|
||||
// 价格信息
|
||||
baseDto.setPriceList(priceList);
|
||||
// 活动类型
|
||||
baseDto.setActivityType_enumText(
|
||||
EnumUtils.getInfoByValue(ActivityType.class, baseDto.getActivityType()));
|
||||
EnumUtils.getInfoByValue(ActivityType.class, baseDto.getActivityType()));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -288,22 +294,22 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
List<AdviceSaveDto> adviceSaveList = adviceSaveParam.getAdviceSaveList();
|
||||
// 药品
|
||||
List<AdviceSaveDto> medicineList = adviceSaveList.stream()
|
||||
.filter(e -> ItemType.MEDICINE.getValue().equals(e.getAdviceType())).collect(Collectors.toList());
|
||||
.filter(e -> ItemType.MEDICINE.getValue().equals(e.getAdviceType())).collect(Collectors.toList());
|
||||
// 耗材
|
||||
List<AdviceSaveDto> deviceList = adviceSaveList.stream()
|
||||
.filter(e -> ItemType.DEVICE.getValue().equals(e.getAdviceType())).collect(Collectors.toList());
|
||||
.filter(e -> ItemType.DEVICE.getValue().equals(e.getAdviceType())).collect(Collectors.toList());
|
||||
// 诊疗活动
|
||||
List<AdviceSaveDto> activityList = adviceSaveList.stream()
|
||||
.filter(e -> ItemType.ACTIVITY.getValue().equals(e.getAdviceType())).collect(Collectors.toList());
|
||||
.filter(e -> ItemType.ACTIVITY.getValue().equals(e.getAdviceType())).collect(Collectors.toList());
|
||||
|
||||
/**
|
||||
* 保存时,校验库存
|
||||
*/
|
||||
if (AdviceOpType.SAVE_ADVICE.getCode().equals(adviceOpType)) {
|
||||
List<AdviceSaveDto> medUpdateList =
|
||||
medicineList.stream().filter(e -> e.getRequestId() != null).collect(Collectors.toList());
|
||||
List<AdviceSaveDto> devUpdateList =
|
||||
deviceList.stream().filter(e -> e.getRequestId() != null).collect(Collectors.toList());
|
||||
List<AdviceSaveDto> medUpdateList
|
||||
= medicineList.stream().filter(e -> e.getRequestId() != null).collect(Collectors.toList());
|
||||
List<AdviceSaveDto> devUpdateList
|
||||
= deviceList.stream().filter(e -> e.getRequestId() != null).collect(Collectors.toList());
|
||||
// 编辑时,释放本身占用的库存发放
|
||||
for (AdviceSaveDto adviceSaveDto : medUpdateList) {
|
||||
iMedicationDispenseService.deleteMedicationDispense(adviceSaveDto.getRequestId());
|
||||
@@ -312,8 +318,8 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
iDeviceDispenseService.deleteDeviceDispense(adviceSaveDto.getRequestId());
|
||||
}
|
||||
|
||||
List<AdviceSaveDto> needCheckList =
|
||||
adviceSaveList.stream().filter(e -> !DbOpType.DELETE.getCode().equals(e.getDbOpType())
|
||||
List<AdviceSaveDto> needCheckList
|
||||
= adviceSaveList.stream().filter(e -> !DbOpType.DELETE.getCode().equals(e.getDbOpType())
|
||||
&& !ItemType.ACTIVITY.getValue().equals(e.getAdviceType())).collect(Collectors.toList());
|
||||
// 校验库存
|
||||
String tipRes = adviceUtils.checkInventory(needCheckList);
|
||||
@@ -329,8 +335,8 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
/**
|
||||
* 处理药品请求
|
||||
*/
|
||||
List<String> medRequestIdList =
|
||||
this.handMedication(medicineList, curDate, adviceOpType, organizationId, signCode);
|
||||
List<String> medRequestIdList
|
||||
= this.handMedication(medicineList, curDate, adviceOpType, organizationId, signCode);
|
||||
|
||||
/**
|
||||
* 处理诊疗项目请求
|
||||
@@ -346,26 +352,26 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
if (AdviceOpType.SIGN_ADVICE.getCode().equals(adviceOpType) && !adviceSaveList.isEmpty()) {
|
||||
// 签发的医嘱id集合
|
||||
List<Long> requestIds = adviceSaveList.stream()
|
||||
.filter(e -> !DbOpType.DELETE.getCode().equals(e.getDbOpType()) && e.getRequestId() != null)
|
||||
.collect(Collectors.toList()).stream().map(AdviceSaveDto::getRequestId).collect(Collectors.toList());
|
||||
.filter(e -> !DbOpType.DELETE.getCode().equals(e.getDbOpType()) && e.getRequestId() != null)
|
||||
.collect(Collectors.toList()).stream().map(AdviceSaveDto::getRequestId).collect(Collectors.toList());
|
||||
// 就诊id
|
||||
Long encounterId = adviceSaveList.get(0).getEncounterId();
|
||||
iChargeItemService.update(new LambdaUpdateWrapper<ChargeItem>()
|
||||
.set(ChargeItem::getStatusEnum, ChargeItemStatus.PLANNED.getValue())
|
||||
.eq(ChargeItem::getEncounterId, encounterId)
|
||||
.eq(ChargeItem::getStatusEnum, ChargeItemStatus.DRAFT.getValue())
|
||||
.in(ChargeItem::getServiceId, requestIds));
|
||||
.set(ChargeItem::getStatusEnum, ChargeItemStatus.PLANNED.getValue())
|
||||
.eq(ChargeItem::getEncounterId, encounterId)
|
||||
.eq(ChargeItem::getStatusEnum, ChargeItemStatus.DRAFT.getValue())
|
||||
.in(ChargeItem::getServiceId, requestIds));
|
||||
}
|
||||
|
||||
return R.ok(medRequestIdList,
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"门诊医嘱"}));
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"门诊医嘱"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理药品
|
||||
*/
|
||||
private List<String> handMedication(List<AdviceSaveDto> medicineList, Date curDate, String adviceOpType,
|
||||
Long organizationId, String signCode) {
|
||||
Long organizationId, String signCode) {
|
||||
// 当前登录账号的科室id
|
||||
Long orgId = SecurityUtils.getLoginUser().getOrgId();
|
||||
// 保存操作
|
||||
@@ -377,12 +383,12 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
// 声明费用项
|
||||
ChargeItem chargeItem;
|
||||
// 新增 + 修改
|
||||
List<AdviceSaveDto> insertOrUpdateList =
|
||||
medicineList.stream().filter(e -> (DbOpType.INSERT.getCode().equals(e.getDbOpType())
|
||||
List<AdviceSaveDto> insertOrUpdateList
|
||||
= medicineList.stream().filter(e -> (DbOpType.INSERT.getCode().equals(e.getDbOpType())
|
||||
|| DbOpType.UPDATE.getCode().equals(e.getDbOpType()))).collect(Collectors.toList());
|
||||
// 删除
|
||||
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()) {
|
||||
@@ -401,12 +407,12 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
iMedicationDispenseService.deleteMedicationDispense(adviceSaveDto.getRequestId());
|
||||
// 删除费用项
|
||||
iChargeItemService.deleteByServiceTableAndId(CommonConstants.TableName.MED_MEDICATION_REQUEST,
|
||||
adviceSaveDto.getRequestId());
|
||||
adviceSaveDto.getRequestId());
|
||||
// 删除基于这个药品生成的需要执行的诊疗请求
|
||||
iServiceRequestService.remove(
|
||||
new LambdaQueryWrapper<ServiceRequest>().eq(ServiceRequest::getBasedOnId, adviceSaveDto.getRequestId())
|
||||
.isNotNull(ServiceRequest::getBasedOnTable)
|
||||
.eq(ServiceRequest::getStatusEnum, RequestStatus.COMPLETED.getValue()));
|
||||
new LambdaQueryWrapper<ServiceRequest>().eq(ServiceRequest::getBasedOnId, adviceSaveDto.getRequestId())
|
||||
.isNotNull(ServiceRequest::getBasedOnTable)
|
||||
.eq(ServiceRequest::getStatusEnum, RequestStatus.COMPLETED.getValue()));
|
||||
}
|
||||
// 签发时
|
||||
if (is_sign) {
|
||||
@@ -466,8 +472,8 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
}
|
||||
if (is_save) {
|
||||
// 处理药品发放
|
||||
Long dispenseId =
|
||||
iMedicationDispenseService.handleMedicationDispense(medicationRequest, adviceSaveDto.getDbOpType());
|
||||
Long dispenseId
|
||||
= iMedicationDispenseService.handleMedicationDispense(medicationRequest, adviceSaveDto.getDbOpType());
|
||||
|
||||
// 保存药品费用项
|
||||
chargeItem = new ChargeItem();
|
||||
@@ -519,12 +525,12 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
// 声明费用项
|
||||
ChargeItem chargeItem;
|
||||
// 新增 + 修改
|
||||
List<AdviceSaveDto> insertOrUpdateList =
|
||||
deviceList.stream().filter(e -> (DbOpType.INSERT.getCode().equals(e.getDbOpType())
|
||||
List<AdviceSaveDto> insertOrUpdateList
|
||||
= deviceList.stream().filter(e -> (DbOpType.INSERT.getCode().equals(e.getDbOpType())
|
||||
|| DbOpType.UPDATE.getCode().equals(e.getDbOpType()))).collect(Collectors.toList());
|
||||
// 删除
|
||||
List<AdviceSaveDto> deleteList = deviceList.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()) {
|
||||
@@ -543,7 +549,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
iDeviceDispenseService.deleteDeviceDispense(adviceSaveDto.getRequestId());
|
||||
// 删除费用项
|
||||
iChargeItemService.deleteByServiceTableAndId(CommonConstants.TableName.WOR_DEVICE_REQUEST,
|
||||
adviceSaveDto.getRequestId());
|
||||
adviceSaveDto.getRequestId());
|
||||
}
|
||||
|
||||
for (AdviceSaveDto adviceSaveDto : insertOrUpdateList) {
|
||||
@@ -579,8 +585,8 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
iDeviceRequestService.saveOrUpdate(deviceRequest);
|
||||
if (is_save) {
|
||||
// 处理耗材发放
|
||||
Long dispenseId =
|
||||
iDeviceDispenseService.handleDeviceDispense(deviceRequest, adviceSaveDto.getDbOpType());
|
||||
Long dispenseId
|
||||
= iDeviceDispenseService.handleDeviceDispense(deviceRequest, adviceSaveDto.getDbOpType());
|
||||
|
||||
// 保存耗材费用项
|
||||
chargeItem = new ChargeItem();
|
||||
@@ -619,7 +625,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
* 处理诊疗
|
||||
*/
|
||||
private void handService(List<AdviceSaveDto> activityList, Date curDate, String adviceOpType, Long organizationId,
|
||||
String signCode) {
|
||||
String signCode) {
|
||||
// 当前登录账号的科室id
|
||||
Long orgId = SecurityUtils.getLoginUser().getOrgId();
|
||||
// 保存操作
|
||||
@@ -630,12 +636,12 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
// 声明费用项
|
||||
ChargeItem chargeItem;
|
||||
// 新增 + 修改
|
||||
List<AdviceSaveDto> insertOrUpdateList =
|
||||
activityList.stream().filter(e -> (DbOpType.INSERT.getCode().equals(e.getDbOpType())
|
||||
List<AdviceSaveDto> insertOrUpdateList
|
||||
= activityList.stream().filter(e -> (DbOpType.INSERT.getCode().equals(e.getDbOpType())
|
||||
|| DbOpType.UPDATE.getCode().equals(e.getDbOpType()))).collect(Collectors.toList());
|
||||
// 删除
|
||||
List<AdviceSaveDto> deleteList = activityList.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()) {
|
||||
@@ -651,10 +657,10 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
for (AdviceSaveDto adviceSaveDto : deleteList) {
|
||||
iServiceRequestService.removeById(adviceSaveDto.getRequestId());// 删除诊疗
|
||||
iServiceRequestService.remove(
|
||||
new LambdaQueryWrapper<ServiceRequest>().eq(ServiceRequest::getParentId, adviceSaveDto.getRequestId()));// 删除诊疗套餐对应的子项
|
||||
new LambdaQueryWrapper<ServiceRequest>().eq(ServiceRequest::getParentId, adviceSaveDto.getRequestId()));// 删除诊疗套餐对应的子项
|
||||
// 删除费用项
|
||||
iChargeItemService.deleteByServiceTableAndId(CommonConstants.TableName.WOR_SERVICE_REQUEST,
|
||||
adviceSaveDto.getRequestId());
|
||||
adviceSaveDto.getRequestId());
|
||||
}
|
||||
|
||||
for (AdviceSaveDto adviceSaveDto : insertOrUpdateList) {
|
||||
@@ -725,8 +731,8 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
|
||||
// 第一次保存时,处理诊疗套餐的子项信息
|
||||
if (adviceSaveDto.getRequestId() == null) {
|
||||
ActivityDefinition activityDefinition =
|
||||
iActivityDefinitionService.getById(adviceSaveDto.getAdviceDefinitionId());
|
||||
ActivityDefinition activityDefinition
|
||||
= iActivityDefinitionService.getById(adviceSaveDto.getAdviceDefinitionId());
|
||||
String childrenJson = activityDefinition.getChildrenJson();
|
||||
if (childrenJson != null) {
|
||||
// 诊疗子项参数类
|
||||
@@ -749,18 +755,18 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
adviceSaveDto.setRequestId(serviceRequest.getId());
|
||||
try {
|
||||
// 查询诊疗定义
|
||||
ActivityDefinition activityDefinition =
|
||||
iActivityDefinitionService.getById(adviceSaveDto.getAdviceDefinitionId());
|
||||
ActivityDefinition activityDefinition
|
||||
= iActivityDefinitionService.getById(adviceSaveDto.getAdviceDefinitionId());
|
||||
if (activityDefinition != null) {
|
||||
// 检验 或 检查
|
||||
if (ActivityType.PROOF.getValue().equals(activityDefinition.getTypeEnum())
|
||||
|| ActivityType.TEST.getValue().equals(activityDefinition.getTypeEnum())) {
|
||||
|| ActivityType.TEST.getValue().equals(activityDefinition.getTypeEnum())) {
|
||||
doctorStationSendApplyUtil.sendCrossSystemApply(adviceSaveDto, organizationId, curDate);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
if (!Whether.YES.getCode()
|
||||
.equals(TenantOptionUtil.getOptionContent(TenantOptionDict.LIS_PACS_ERROR_IGNORE))) {
|
||||
.equals(TenantOptionUtil.getOptionContent(TenantOptionDict.LIS_PACS_ERROR_IGNORE))) {
|
||||
throw e;
|
||||
}
|
||||
log.error(e.getMessage(), e);
|
||||
@@ -781,22 +787,22 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||
// 医嘱请求数据
|
||||
List<RequestBaseDto> requestBaseInfo = doctorStationAdviceAppMapper.getRequestBaseInfo(encounterId, null,
|
||||
CommonConstants.TableName.MED_MEDICATION_REQUEST, CommonConstants.TableName.WOR_DEVICE_REQUEST,
|
||||
CommonConstants.TableName.WOR_SERVICE_REQUEST, practitionerId, Whether.NO.getCode(),
|
||||
GenerateSource.DOCTOR_PRESCRIPTION.getValue());
|
||||
CommonConstants.TableName.MED_MEDICATION_REQUEST, CommonConstants.TableName.WOR_DEVICE_REQUEST,
|
||||
CommonConstants.TableName.WOR_SERVICE_REQUEST, practitionerId, Whether.NO.getCode(),
|
||||
GenerateSource.DOCTOR_PRESCRIPTION.getValue());
|
||||
for (RequestBaseDto requestBaseDto : requestBaseInfo) {
|
||||
// 请求状态
|
||||
requestBaseDto
|
||||
.setStatusEnum_enumText(EnumUtils.getInfoByValue(RequestStatus.class, requestBaseDto.getStatusEnum()));
|
||||
.setStatusEnum_enumText(EnumUtils.getInfoByValue(RequestStatus.class, requestBaseDto.getStatusEnum()));
|
||||
// 是否皮试
|
||||
requestBaseDto
|
||||
.setSkinTestFlag_enumText(EnumUtils.getInfoByValue(Whether.class, requestBaseDto.getSkinTestFlag()));
|
||||
.setSkinTestFlag_enumText(EnumUtils.getInfoByValue(Whether.class, requestBaseDto.getSkinTestFlag()));
|
||||
// 是否为注射药物
|
||||
requestBaseDto
|
||||
.setInjectFlag_enumText(EnumUtils.getInfoByValue(Whether.class, requestBaseDto.getInjectFlag()));
|
||||
.setInjectFlag_enumText(EnumUtils.getInfoByValue(Whether.class, requestBaseDto.getInjectFlag()));
|
||||
// 收费状态
|
||||
requestBaseDto.setChargeStatus_enumText(
|
||||
EnumUtils.getInfoByValue(ChargeItemStatus.class, requestBaseDto.getChargeStatus()));
|
||||
EnumUtils.getInfoByValue(ChargeItemStatus.class, requestBaseDto.getChargeStatus()));
|
||||
}
|
||||
return R.ok(requestBaseInfo);
|
||||
}
|
||||
@@ -825,9 +831,12 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
|
||||
chargeItemList.forEach(item -> {
|
||||
switch (item.getServiceTable()) {
|
||||
case CommonConstants.TableName.MED_MEDICATION_REQUEST -> medReqIdList.add(item.getServiceId());
|
||||
case CommonConstants.TableName.WOR_DEVICE_REQUEST -> devReqIdList.add(item.getServiceId());
|
||||
case CommonConstants.TableName.WOR_SERVICE_REQUEST -> serReqIdList.add(item.getServiceId());
|
||||
case CommonConstants.TableName.MED_MEDICATION_REQUEST ->
|
||||
medReqIdList.add(item.getServiceId());
|
||||
case CommonConstants.TableName.WOR_DEVICE_REQUEST ->
|
||||
devReqIdList.add(item.getServiceId());
|
||||
case CommonConstants.TableName.WOR_SERVICE_REQUEST ->
|
||||
serReqIdList.add(item.getServiceId());
|
||||
}
|
||||
});
|
||||
List<Long> chargeItemIdList = chargeItemList.stream().map(ChargeItem::getId).collect(Collectors.toList());
|
||||
@@ -864,22 +873,22 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||
// 医嘱请求数据
|
||||
List<RequestBaseDto> requestBaseInfo = doctorStationAdviceAppMapper.getRequestBaseInfo(encounterId, patientId,
|
||||
CommonConstants.TableName.MED_MEDICATION_REQUEST, CommonConstants.TableName.WOR_DEVICE_REQUEST,
|
||||
CommonConstants.TableName.WOR_SERVICE_REQUEST, practitionerId, Whether.YES.getCode(),
|
||||
GenerateSource.DOCTOR_PRESCRIPTION.getValue());
|
||||
CommonConstants.TableName.MED_MEDICATION_REQUEST, CommonConstants.TableName.WOR_DEVICE_REQUEST,
|
||||
CommonConstants.TableName.WOR_SERVICE_REQUEST, practitionerId, Whether.YES.getCode(),
|
||||
GenerateSource.DOCTOR_PRESCRIPTION.getValue());
|
||||
for (RequestBaseDto requestBaseDto : requestBaseInfo) {
|
||||
// 请求状态
|
||||
requestBaseDto
|
||||
.setStatusEnum_enumText(EnumUtils.getInfoByValue(RequestStatus.class, requestBaseDto.getStatusEnum()));
|
||||
.setStatusEnum_enumText(EnumUtils.getInfoByValue(RequestStatus.class, requestBaseDto.getStatusEnum()));
|
||||
// 是否皮试
|
||||
requestBaseDto
|
||||
.setSkinTestFlag_enumText(EnumUtils.getInfoByValue(Whether.class, requestBaseDto.getSkinTestFlag()));
|
||||
.setSkinTestFlag_enumText(EnumUtils.getInfoByValue(Whether.class, requestBaseDto.getSkinTestFlag()));
|
||||
// 是否为注射药物
|
||||
requestBaseDto
|
||||
.setInjectFlag_enumText(EnumUtils.getInfoByValue(Whether.class, requestBaseDto.getInjectFlag()));
|
||||
.setInjectFlag_enumText(EnumUtils.getInfoByValue(Whether.class, requestBaseDto.getInjectFlag()));
|
||||
// 收费状态
|
||||
requestBaseDto.setChargeStatus_enumText(
|
||||
EnumUtils.getInfoByValue(ChargeItemStatus.class, requestBaseDto.getChargeStatus()));
|
||||
EnumUtils.getInfoByValue(ChargeItemStatus.class, requestBaseDto.getChargeStatus()));
|
||||
}
|
||||
return R.ok(requestBaseInfo);
|
||||
}
|
||||
@@ -894,7 +903,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
public void updateGroupId(UpdateGroupIdParam updateGroupIdParam) {
|
||||
List<UpdateGroupDto> groupList = updateGroupIdParam.getGroupList();
|
||||
List<Long> idsToSetNull = groupList.stream().filter(dto -> dto.getGroupId() == null)
|
||||
.map(UpdateGroupDto::getRequestId).collect(Collectors.toList());
|
||||
.map(UpdateGroupDto::getRequestId).collect(Collectors.toList());
|
||||
|
||||
if (!idsToSetNull.isEmpty()) {
|
||||
// 创建更新条件
|
||||
@@ -907,8 +916,8 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
|
||||
// 处理非null的情况
|
||||
List<MedicationRequest> medicationRequestList = groupList.stream().filter(dto -> dto.getGroupId() != null)
|
||||
.map(dto -> new MedicationRequest().setId(dto.getRequestId()).setGroupId(dto.getGroupId()))
|
||||
.collect(Collectors.toList());
|
||||
.map(dto -> new MedicationRequest().setId(dto.getRequestId()).setGroupId(dto.getGroupId()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if (!medicationRequestList.isEmpty()) {
|
||||
iMedicationRequestService.saveOrUpdateBatch(medicationRequestList);
|
||||
@@ -936,7 +945,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
@Override
|
||||
public R<?> getProofAndTestHistory(Long patientId, Long adviceDefinitionId) {
|
||||
return R.ok(doctorStationAdviceAppMapper.getProofAndTestHistory(patientId, adviceDefinitionId,
|
||||
RequestStatus.COMPLETED.getValue()));
|
||||
RequestStatus.COMPLETED.getValue()));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -953,7 +962,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
throw new ServiceException("租户配置项【LIS查看报告地址】未配置");
|
||||
}
|
||||
List<ProofAndTestResultDto> proofResult = doctorStationAdviceAppMapper.getProofAndTestResult(encounterId,
|
||||
RequestStatus.DRAFT.getValue(), ActivityType.PROOF.getValue());
|
||||
RequestStatus.DRAFT.getValue(), ActivityType.PROOF.getValue());
|
||||
for (ProofAndTestResultDto proofAndTestResultDto : proofResult) {
|
||||
proofAndTestResultDto.setRequestUrl(lisReportUrl.concat(proofAndTestResultDto.getBusNo()));
|
||||
}
|
||||
@@ -975,7 +984,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
throw new ServiceException("租户配置项【PACS查看报告地址】未配置");
|
||||
}
|
||||
List<ProofAndTestResultDto> testResult = doctorStationAdviceAppMapper.getProofAndTestResult(encounterId,
|
||||
RequestStatus.DRAFT.getValue(), ActivityType.TEST.getValue());
|
||||
RequestStatus.DRAFT.getValue(), ActivityType.TEST.getValue());
|
||||
for (ProofAndTestResultDto proofAndTestResultDto : testResult) {
|
||||
proofAndTestResultDto.setRequestUrl(pacsReportUrl.concat(proofAndTestResultDto.getBusNo()));
|
||||
}
|
||||
@@ -983,7 +992,8 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据searchKey对医嘱列表进行排序:adviceName以searchKey(汉字)开头的排在前面 | pyStr以searchKey(字母)开头的排在前面
|
||||
* 根据searchKey对医嘱列表进行排序:adviceName以searchKey(汉字)开头的排在前面 |
|
||||
* pyStr以searchKey(字母)开头的排在前面
|
||||
*
|
||||
* @param adviceList 医嘱列表
|
||||
* @param searchKey 搜索关键字
|
||||
@@ -998,10 +1008,10 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
|
||||
adviceList.sort((a, b) -> {
|
||||
// 根据searchKey类型选择不同的字段
|
||||
String aValue =
|
||||
isPinyinSearch ? (a.getPyStr() != null ? a.getPyStr() : a.getAdviceName()) : a.getAdviceName();
|
||||
String bValue =
|
||||
isPinyinSearch ? (b.getPyStr() != null ? b.getPyStr() : b.getAdviceName()) : b.getAdviceName();
|
||||
String aValue
|
||||
= isPinyinSearch ? (a.getPyStr() != null ? a.getPyStr() : a.getAdviceName()) : a.getAdviceName();
|
||||
String bValue
|
||||
= isPinyinSearch ? (b.getPyStr() != null ? b.getPyStr() : b.getAdviceName()) : b.getAdviceName();
|
||||
|
||||
// 处理可能的null值
|
||||
if (aValue == null && bValue == null) {
|
||||
|
||||
@@ -99,12 +99,12 @@ public class DoctorStationChineseMedicalAppServiceImpl implements IDoctorStation
|
||||
// 中医诊断
|
||||
conditionDefinition.setSourceEnum(ConditionDefinitionSource.TRADITIONAL_CHINESE_MEDICINE_DIAGNOSIS.getValue());
|
||||
QueryWrapper<ConditionDefinition> queryWrapper = HisQueryUtils.buildQueryWrapper(conditionDefinition, searchKey,
|
||||
new HashSet<>(Arrays.asList("name", "py_str", "wb_str")), null);
|
||||
new HashSet<>(Arrays.asList("name", "py_str", "wb_str")), null);
|
||||
// 设置排序
|
||||
queryWrapper.orderByDesc("update_time");
|
||||
// 诊断信息
|
||||
Page<ConditionDefinitionMetadata> conditionDefinitionMetadataPage = HisPageUtils
|
||||
.selectPage(conditionDefinitionMapper, queryWrapper, pageNo, pageSize, ConditionDefinitionMetadata.class);
|
||||
.selectPage(conditionDefinitionMapper, queryWrapper, pageNo, pageSize, ConditionDefinitionMetadata.class);
|
||||
conditionDefinitionMetadataPage.getRecords().forEach(e -> {
|
||||
// 所属分类
|
||||
e.setSourceEnum_enumText(EnumUtils.getInfoByValue(ConditionDefinitionSource.class, e.getSourceEnum()));
|
||||
@@ -134,14 +134,14 @@ public class DoctorStationChineseMedicalAppServiceImpl implements IDoctorStation
|
||||
conditionDefinition.setStatusEnum(PublicationStatus.ACTIVE.getValue());
|
||||
// 中医证候
|
||||
conditionDefinition
|
||||
.setSourceEnum(ConditionDefinitionSource.TRADITIONAL_CHINESE_MEDICINE_SYNDROME_CATALOG.getValue());
|
||||
.setSourceEnum(ConditionDefinitionSource.TRADITIONAL_CHINESE_MEDICINE_SYNDROME_CATALOG.getValue());
|
||||
QueryWrapper<ConditionDefinition> queryWrapper = HisQueryUtils.buildQueryWrapper(conditionDefinition, searchKey,
|
||||
new HashSet<>(Arrays.asList("name", "py_str", "wb_str")), null);
|
||||
new HashSet<>(Arrays.asList("name", "py_str", "wb_str")), null);
|
||||
// 设置排序
|
||||
queryWrapper.orderByDesc("update_time");
|
||||
// 诊断信息
|
||||
Page<ConditionDefinitionMetadata> conditionDefinitionMetadataPage = HisPageUtils
|
||||
.selectPage(conditionDefinitionMapper, queryWrapper, pageNo, pageSize, ConditionDefinitionMetadata.class);
|
||||
.selectPage(conditionDefinitionMapper, queryWrapper, pageNo, pageSize, ConditionDefinitionMetadata.class);
|
||||
conditionDefinitionMetadataPage.getRecords().forEach(e -> {
|
||||
// 所属分类
|
||||
e.setSourceEnum_enumText(EnumUtils.getInfoByValue(ConditionDefinitionSource.class, e.getSourceEnum()));
|
||||
@@ -192,12 +192,12 @@ public class DoctorStationChineseMedicalAppServiceImpl implements IDoctorStation
|
||||
List<EncounterDiagnosis> diagnosisList = iEncounterDiagnosisService.getDiagnosisList(encounterId);
|
||||
List<EncounterDiagnosis> newdiagnosisList = new ArrayList<>();
|
||||
|
||||
newdiagnosisList =
|
||||
diagnosisList.stream().filter(diagno -> diagno.getDeleteFlag().equals("0") && diagno.getDiagSrtNo() != null)
|
||||
.collect(Collectors.toList());
|
||||
newdiagnosisList
|
||||
= diagnosisList.stream().filter(diagno -> diagno.getDeleteFlag().equals("0") && diagno.getDiagSrtNo() != null)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
newdiagnosisList = newdiagnosisList.stream().sorted((d1, d2) -> d2.getDiagSrtNo().compareTo(d1.getDiagSrtNo())) // 降序
|
||||
.collect(Collectors.toList());
|
||||
.collect(Collectors.toList());
|
||||
if (newdiagnosisList == null || newdiagnosisList.size() == 0) {
|
||||
startNo = 1;
|
||||
} else {
|
||||
@@ -231,7 +231,7 @@ public class DoctorStationChineseMedicalAppServiceImpl implements IDoctorStation
|
||||
}
|
||||
|
||||
}
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"中医诊断"}));
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"中医诊断"}));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -277,7 +277,7 @@ public class DoctorStationChineseMedicalAppServiceImpl implements IDoctorStation
|
||||
|
||||
}
|
||||
}
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"中医诊断"}));
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"中医诊断"}));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -290,17 +290,17 @@ public class DoctorStationChineseMedicalAppServiceImpl implements IDoctorStation
|
||||
public R<?> getTcmEncounterDiagnosis(Long encounterId) {
|
||||
HashMap<String, Object> resultMap = new HashMap<>();
|
||||
// 中医就诊诊断信息
|
||||
List<DiagnosisQueryDto> tcmEncounterDiagnosis =
|
||||
doctorStationChineseMedicalAppMapper.getTcmEncounterDiagnosis(encounterId);
|
||||
List<DiagnosisQueryDto> tcmEncounterDiagnosis
|
||||
= doctorStationChineseMedicalAppMapper.getTcmEncounterDiagnosis(encounterId);
|
||||
// 病
|
||||
List<DiagnosisQueryDto> illness = tcmEncounterDiagnosis.stream().filter(
|
||||
e -> ConditionDefinitionSource.TRADITIONAL_CHINESE_MEDICINE_DIAGNOSIS.getValue().equals(e.getSourceEnum()))
|
||||
.collect(Collectors.toList());
|
||||
e -> ConditionDefinitionSource.TRADITIONAL_CHINESE_MEDICINE_DIAGNOSIS.getValue().equals(e.getSourceEnum()))
|
||||
.collect(Collectors.toList());
|
||||
// 症
|
||||
List<DiagnosisQueryDto> symptom = tcmEncounterDiagnosis.stream()
|
||||
.filter(e -> ConditionDefinitionSource.TRADITIONAL_CHINESE_MEDICINE_SYNDROME_CATALOG.getValue()
|
||||
.filter(e -> ConditionDefinitionSource.TRADITIONAL_CHINESE_MEDICINE_SYNDROME_CATALOG.getValue()
|
||||
.equals(e.getSourceEnum()))
|
||||
.collect(Collectors.toList());
|
||||
.collect(Collectors.toList());
|
||||
resultMap.put("illness", illness);
|
||||
resultMap.put("symptom", symptom);
|
||||
return R.ok(resultMap);
|
||||
@@ -321,12 +321,12 @@ public class DoctorStationChineseMedicalAppServiceImpl implements IDoctorStation
|
||||
*/
|
||||
@Override
|
||||
public IPage<AdviceBaseDto> getTcmAdviceBaseInfo(AdviceBaseDto adviceBaseDto, String searchKey, Long locationId,
|
||||
List<Long> adviceDefinitionIdParamList, Long organizationId, Integer pageNo, Integer pageSize,
|
||||
Integer pricingFlag) {
|
||||
List<Long> adviceDefinitionIdParamList, Long organizationId, Integer pageNo, Integer pageSize,
|
||||
Integer pricingFlag) {
|
||||
adviceBaseDto.setAdviceType(1); // 医嘱类型为药品
|
||||
adviceBaseDto.setCategoryCode(MedCategoryCode.CHINESE_HERBAL_MEDICINE.getValue());// 中草药
|
||||
return iDoctorStationAdviceAppService.getAdviceBaseInfo(adviceBaseDto, searchKey, locationId,
|
||||
adviceDefinitionIdParamList, organizationId, pageNo, pageSize, pricingFlag, List.of(1, 2, 3), null);
|
||||
adviceDefinitionIdParamList, organizationId, pageNo, pageSize, pricingFlag, List.of(1, 2, 3), null);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -343,7 +343,7 @@ public class DoctorStationChineseMedicalAppServiceImpl implements IDoctorStation
|
||||
if (AdviceOpType.SAVE_ADVICE.getCode().equals(adviceOpType)) {
|
||||
// 保存时——中医处方去掉不修改的药方
|
||||
medicineList = medicineList.stream().filter(e -> e.getAdviceDefinitionId() != null)
|
||||
.collect(Collectors.toUnmodifiableList());
|
||||
.collect(Collectors.toUnmodifiableList());
|
||||
}
|
||||
// 保存操作
|
||||
boolean is_save = AdviceOpType.SAVE_ADVICE.getCode().equals(adviceOpType);
|
||||
@@ -358,18 +358,18 @@ public class DoctorStationChineseMedicalAppServiceImpl implements IDoctorStation
|
||||
// 是否代煎
|
||||
Integer sufferingFlag = adviceSaveParam.getSufferingFlag();
|
||||
// 中药代煎定义id
|
||||
Long sufferingDefinitionId =
|
||||
iActivityDefinitionService.getAppointActivityDefinitionId(CommonConstants.BusinessName.SUFFERING_TCM);
|
||||
Long sufferingDefinitionId
|
||||
= iActivityDefinitionService.getAppointActivityDefinitionId(CommonConstants.BusinessName.SUFFERING_TCM);
|
||||
// 保存时,校验库存
|
||||
if (is_save) {
|
||||
List<AdviceSaveDto> medUpdateList =
|
||||
medicineList.stream().filter(e -> e.getRequestId() != null).collect(Collectors.toList());
|
||||
List<AdviceSaveDto> medUpdateList
|
||||
= medicineList.stream().filter(e -> e.getRequestId() != null).collect(Collectors.toList());
|
||||
// 编辑时,释放本身占用的库存发放
|
||||
for (AdviceSaveDto adviceSaveDto : medUpdateList) {
|
||||
iMedicationDispenseService.deleteMedicationDispense(adviceSaveDto.getRequestId());
|
||||
}
|
||||
List<AdviceSaveDto> needCheckList = medicineList.stream()
|
||||
.filter(e -> !DbOpType.DELETE.getCode().equals(e.getDbOpType())).collect(Collectors.toList());
|
||||
.filter(e -> !DbOpType.DELETE.getCode().equals(e.getDbOpType())).collect(Collectors.toList());
|
||||
// 校验库存
|
||||
String tipRes = adviceUtils.checkInventory(needCheckList);
|
||||
if (tipRes != null) {
|
||||
@@ -381,40 +381,40 @@ public class DoctorStationChineseMedicalAppServiceImpl implements IDoctorStation
|
||||
// 费用项
|
||||
ChargeItem chargeItem;
|
||||
// 新增 + 修改
|
||||
List<AdviceSaveDto> insertOrUpdateList =
|
||||
medicineList.stream().filter(e -> (DbOpType.INSERT.getCode().equals(e.getDbOpType())
|
||||
List<AdviceSaveDto> insertOrUpdateList
|
||||
= medicineList.stream().filter(e -> (DbOpType.INSERT.getCode().equals(e.getDbOpType())
|
||||
|| DbOpType.UPDATE.getCode().equals(e.getDbOpType()))).collect(Collectors.toList());
|
||||
// 删除
|
||||
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());
|
||||
for (AdviceSaveDto adviceSaveDto : deleteList) {
|
||||
iMedicationRequestService.removeById(adviceSaveDto.getRequestId());
|
||||
// 删除已经产生的药品发放信息
|
||||
iMedicationDispenseService.deleteMedicationDispense(adviceSaveDto.getRequestId());
|
||||
// 删除费用项
|
||||
iChargeItemService.deleteByServiceTableAndId(CommonConstants.TableName.MED_MEDICATION_REQUEST,
|
||||
adviceSaveDto.getRequestId());
|
||||
adviceSaveDto.getRequestId());
|
||||
// 删除代煎费
|
||||
iChargeItemService.remove(new LambdaQueryWrapper<ChargeItem>()
|
||||
.eq(ChargeItem::getPrescriptionNo, adviceSaveDto.getPrescriptionNo())
|
||||
.eq(ChargeItem::getProductId, sufferingDefinitionId));
|
||||
.eq(ChargeItem::getPrescriptionNo, adviceSaveDto.getPrescriptionNo())
|
||||
.eq(ChargeItem::getProductId, sufferingDefinitionId));
|
||||
|
||||
}
|
||||
|
||||
if (is_sign) {
|
||||
// 按groupId分组
|
||||
Map<Long, List<AdviceSaveDto>> groupMap =
|
||||
insertOrUpdateList.stream().collect(Collectors.groupingBy(AdviceSaveDto::getGroupId));
|
||||
Map<Long, List<AdviceSaveDto>> groupMap
|
||||
= insertOrUpdateList.stream().collect(Collectors.groupingBy(AdviceSaveDto::getGroupId));
|
||||
// 为每个分组生成唯一的处方号
|
||||
groupMap.forEach((groupId, groupList) -> {
|
||||
// 先查询当前groupId是否已经被签发生成过处方号
|
||||
List<MedicationRequest> list = iMedicationRequestService
|
||||
.list(new LambdaQueryWrapper<MedicationRequest>().eq(MedicationRequest::getGroupId, groupId));
|
||||
.list(new LambdaQueryWrapper<MedicationRequest>().eq(MedicationRequest::getGroupId, groupId));
|
||||
if (!list.isEmpty() && StringUtils.isNotEmpty(list.get(0).getPrescriptionNo())) {
|
||||
groupList.forEach(dto -> dto.setPrescriptionNo(list.get(0).getPrescriptionNo()));
|
||||
} else {
|
||||
String prescriptionNo =
|
||||
assignSeqUtil.getSeq(AssignSeqEnum.PRESCRIPTION_CHINESE_HERBAL_MEDICINE.getPrefix(), 8);
|
||||
String prescriptionNo
|
||||
= assignSeqUtil.getSeq(AssignSeqEnum.PRESCRIPTION_CHINESE_HERBAL_MEDICINE.getPrefix(), 8);
|
||||
groupList.forEach(dto -> dto.setPrescriptionNo(prescriptionNo));
|
||||
}
|
||||
});
|
||||
@@ -467,8 +467,8 @@ public class DoctorStationChineseMedicalAppServiceImpl implements IDoctorStation
|
||||
iMedicationRequestService.saveOrUpdate(medicationRequest);
|
||||
if (is_save) {
|
||||
// 处理药品发放
|
||||
Long dispenseId =
|
||||
iMedicationDispenseService.handleMedicationDispense(medicationRequest, adviceSaveDto.getDbOpType());
|
||||
Long dispenseId
|
||||
= iMedicationDispenseService.handleMedicationDispense(medicationRequest, adviceSaveDto.getDbOpType());
|
||||
|
||||
// 保存药品费用项
|
||||
chargeItem = new ChargeItem();
|
||||
@@ -529,11 +529,11 @@ public class DoctorStationChineseMedicalAppServiceImpl implements IDoctorStation
|
||||
|
||||
// 先删除中药代煎的账单
|
||||
iChargeItemService.remove(new LambdaQueryWrapper<ChargeItem>()
|
||||
.eq(ChargeItem::getPrescriptionNo, prescriptionNo).eq(ChargeItem::getProductId, sufferingDefinitionId));
|
||||
.eq(ChargeItem::getPrescriptionNo, prescriptionNo).eq(ChargeItem::getProductId, sufferingDefinitionId));
|
||||
|
||||
// 对应的诊疗医嘱信息
|
||||
AdviceBaseDto activityAdviceBaseDto = iDoctorStationAdviceAppService.getAdviceBaseInfo(adviceBaseDto, null,
|
||||
null, null, organizationId, 1, 1, Whether.NO.getValue(), List.of(3), null).getRecords().get(0);
|
||||
null, null, organizationId, 1, 1, Whether.NO.getValue(), List.of(3), null).getRecords().get(0);
|
||||
if (activityAdviceBaseDto != null) {
|
||||
// 费用定价
|
||||
AdvicePriceDto advicePriceDto = activityAdviceBaseDto.getPriceList().get(0);
|
||||
@@ -571,23 +571,23 @@ public class DoctorStationChineseMedicalAppServiceImpl implements IDoctorStation
|
||||
} else if (Whether.NO.getValue().equals(sufferingFlag)) {
|
||||
// 删除中药代煎的账单
|
||||
iChargeItemService.remove(new LambdaQueryWrapper<ChargeItem>()
|
||||
.eq(ChargeItem::getPrescriptionNo, prescriptionNo).eq(ChargeItem::getProductId, sufferingDefinitionId));
|
||||
.eq(ChargeItem::getPrescriptionNo, prescriptionNo).eq(ChargeItem::getProductId, sufferingDefinitionId));
|
||||
}
|
||||
|
||||
// 签发时,把草稿状态的账单更新为待收费[中医]
|
||||
if (AdviceOpType.SIGN_ADVICE.getCode().equals(adviceOpType) && !medicineList.isEmpty()) {
|
||||
// 签发的医嘱id集合
|
||||
List<Long> requestIds = medicineList.stream()
|
||||
.filter(e -> !DbOpType.DELETE.getCode().equals(e.getDbOpType()) && e.getRequestId() != null)
|
||||
.collect(Collectors.toList()).stream().map(AdviceSaveDto::getRequestId).collect(Collectors.toList());
|
||||
.filter(e -> !DbOpType.DELETE.getCode().equals(e.getDbOpType()) && e.getRequestId() != null)
|
||||
.collect(Collectors.toList()).stream().map(AdviceSaveDto::getRequestId).collect(Collectors.toList());
|
||||
iChargeItemService.update(new LambdaUpdateWrapper<ChargeItem>()
|
||||
.set(ChargeItem::getStatusEnum, ChargeItemStatus.PLANNED.getValue())
|
||||
.eq(ChargeItem::getEncounterId, encounterId)
|
||||
.eq(ChargeItem::getStatusEnum, ChargeItemStatus.DRAFT.getValue())
|
||||
.in(ChargeItem::getServiceId, requestIds));
|
||||
.set(ChargeItem::getStatusEnum, ChargeItemStatus.PLANNED.getValue())
|
||||
.eq(ChargeItem::getEncounterId, encounterId)
|
||||
.eq(ChargeItem::getStatusEnum, ChargeItemStatus.DRAFT.getValue())
|
||||
.in(ChargeItem::getServiceId, requestIds));
|
||||
}
|
||||
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"门诊中医医嘱"}));
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"门诊中医医嘱"}));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -601,16 +601,16 @@ public class DoctorStationChineseMedicalAppServiceImpl implements IDoctorStation
|
||||
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||
// 医嘱请求数据
|
||||
List<RequestBaseDto> requestBaseInfo = doctorStationChineseMedicalAppMapper.getTcmRequestBaseInfo(encounterId,
|
||||
null, CommonConstants.TableName.MED_MEDICATION_REQUEST, CommonConstants.TableName.WOR_DEVICE_REQUEST,
|
||||
CommonConstants.TableName.WOR_SERVICE_REQUEST, practitionerId, Whether.NO.getCode(),
|
||||
GenerateSource.DOCTOR_PRESCRIPTION.getValue());
|
||||
null, CommonConstants.TableName.MED_MEDICATION_REQUEST, CommonConstants.TableName.WOR_DEVICE_REQUEST,
|
||||
CommonConstants.TableName.WOR_SERVICE_REQUEST, practitionerId, Whether.NO.getCode(),
|
||||
GenerateSource.DOCTOR_PRESCRIPTION.getValue());
|
||||
for (RequestBaseDto requestBaseDto : requestBaseInfo) {
|
||||
// 请求状态
|
||||
requestBaseDto
|
||||
.setStatusEnum_enumText(EnumUtils.getInfoByValue(RequestStatus.class, requestBaseDto.getStatusEnum()));
|
||||
.setStatusEnum_enumText(EnumUtils.getInfoByValue(RequestStatus.class, requestBaseDto.getStatusEnum()));
|
||||
// 收费状态
|
||||
requestBaseDto.setChargeStatus_enumText(
|
||||
EnumUtils.getInfoByValue(ChargeItemStatus.class, requestBaseDto.getChargeStatus()));
|
||||
EnumUtils.getInfoByValue(ChargeItemStatus.class, requestBaseDto.getChargeStatus()));
|
||||
}
|
||||
return R.ok(requestBaseInfo);
|
||||
}
|
||||
@@ -628,16 +628,16 @@ public class DoctorStationChineseMedicalAppServiceImpl implements IDoctorStation
|
||||
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||
// 医嘱请求数据
|
||||
List<RequestBaseDto> requestBaseInfo = doctorStationChineseMedicalAppMapper.getTcmRequestHistoryInfo(
|
||||
encounterId, patientId, CommonConstants.TableName.MED_MEDICATION_REQUEST,
|
||||
CommonConstants.TableName.WOR_DEVICE_REQUEST, CommonConstants.TableName.WOR_SERVICE_REQUEST, practitionerId,
|
||||
Whether.YES.getCode(), GenerateSource.DOCTOR_PRESCRIPTION.getValue());
|
||||
encounterId, patientId, CommonConstants.TableName.MED_MEDICATION_REQUEST,
|
||||
CommonConstants.TableName.WOR_DEVICE_REQUEST, CommonConstants.TableName.WOR_SERVICE_REQUEST, practitionerId,
|
||||
Whether.YES.getCode(), GenerateSource.DOCTOR_PRESCRIPTION.getValue());
|
||||
for (RequestBaseDto requestBaseDto : requestBaseInfo) {
|
||||
// 请求状态
|
||||
requestBaseDto
|
||||
.setStatusEnum_enumText(EnumUtils.getInfoByValue(RequestStatus.class, requestBaseDto.getStatusEnum()));
|
||||
.setStatusEnum_enumText(EnumUtils.getInfoByValue(RequestStatus.class, requestBaseDto.getStatusEnum()));
|
||||
// 收费状态
|
||||
requestBaseDto.setChargeStatus_enumText(
|
||||
EnumUtils.getInfoByValue(ChargeItemStatus.class, requestBaseDto.getChargeStatus()));
|
||||
EnumUtils.getInfoByValue(ChargeItemStatus.class, requestBaseDto.getChargeStatus()));
|
||||
}
|
||||
return R.ok(requestBaseInfo);
|
||||
}
|
||||
@@ -661,8 +661,8 @@ public class DoctorStationChineseMedicalAppServiceImpl implements IDoctorStation
|
||||
for (Long conditionId : conditionIds) {
|
||||
iConditionService.removeById(conditionId);
|
||||
iEncounterDiagnosisService.remove(
|
||||
new LambdaQueryWrapper<EncounterDiagnosis>().eq(EncounterDiagnosis::getConditionId, conditionId));
|
||||
new LambdaQueryWrapper<EncounterDiagnosis>().eq(EncounterDiagnosis::getConditionId, conditionId));
|
||||
}
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00005, new Object[] {"就诊诊断信息"}));
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00005, new Object[]{"就诊诊断信息"}));
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user