Compare commits
228 Commits
ff227b40c1
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
| eb2d7302b7 | |||
| eb26f9db34 | |||
| 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 |
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 包说明)展开,请告诉我要增强哪一节。
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
27
add_organization_fields.sql
Normal file
27
add_organization_fields.sql
Normal file
@@ -0,0 +1,27 @@
|
||||
-- 向adm_organization表添加缺失字段的SQL脚本
|
||||
|
||||
-- 添加register_flag字段(对应registerFlag属性)
|
||||
ALTER TABLE "adm_organization"
|
||||
ADD COLUMN "register_flag" int4;
|
||||
|
||||
-- 添加location字段
|
||||
ALTER TABLE "adm_organization"
|
||||
ADD COLUMN "location" varchar(255);
|
||||
|
||||
-- 添加intro字段
|
||||
ALTER TABLE "adm_organization"
|
||||
ADD COLUMN "intro" varchar(1000);
|
||||
|
||||
-- 添加remark字段
|
||||
ALTER TABLE "adm_organization"
|
||||
ADD COLUMN "remark" varchar(1000);
|
||||
|
||||
-- 添加字段注释
|
||||
COMMENT ON COLUMN "adm_organization"."register_flag" IS '挂号标志';
|
||||
COMMENT ON COLUMN "adm_organization"."location" IS '科室位置';
|
||||
COMMENT ON COLUMN "adm_organization"."intro" IS '科室简介';
|
||||
COMMENT ON COLUMN "adm_organization"."remark" IS '备注';
|
||||
|
||||
-- 设置register_flag默认值为0(不允许挂号)
|
||||
ALTER TABLE "adm_organization"
|
||||
ALTER COLUMN "register_flag" SET DEFAULT 0;
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.core.web.util;
|
||||
import com.core.common.core.domain.model.LoginUser;
|
||||
import com.core.common.enums.TenantOptionDict;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.core.common.utils.StringUtils;
|
||||
|
||||
/**
|
||||
* 租户配置工具类
|
||||
@@ -30,7 +31,12 @@ public class TenantOptionUtil {
|
||||
if (loginUser.getOptionMap() == null || loginUser.getOptionMap().isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
return loginUser.getOptionMap().get(optionDict.getCode());
|
||||
// return loginUser.getOptionMap().get(optionDict.getCode());
|
||||
|
||||
// TODO:2025/10/17 李永兴提出的sys_option切换TenantOption临时防止报错方案,最晚2025年11月底删除
|
||||
String newValue = loginUser.getOptionMap().get(optionDict.getCode());
|
||||
String oldValue = loginUser.getOptionJson().getString(optionDict.getCode());
|
||||
return StringUtils.isEmpty(newValue) ? oldValue : newValue;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -142,6 +142,11 @@
|
||||
<artifactId>pinyin4j</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.core.common.enums;
|
||||
|
||||
/**
|
||||
* Desc: 调价类型枚举
|
||||
* @Author raymond
|
||||
* @Date 09:14 2025/10/16
|
||||
* @return
|
||||
**/
|
||||
public enum AdjustPriceEnum {
|
||||
|
||||
MEDICINE(0, "药品"),
|
||||
CONSUMABLES(1, "耗材"),
|
||||
DIAGNOSIS(2, "诊疗"),
|
||||
REGISTER(3, "挂号");
|
||||
|
||||
|
||||
private final Integer code;
|
||||
private final String info;
|
||||
|
||||
AdjustPriceEnum(Integer code, String info) {
|
||||
this.code = code;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getInfo() {
|
||||
return info;
|
||||
}
|
||||
}
|
||||
@@ -6,166 +6,93 @@ package com.core.common.enums;
|
||||
* @author system
|
||||
*/
|
||||
public enum TenantOptionDict {
|
||||
|
||||
/**
|
||||
* 医院名称
|
||||
*/
|
||||
HOSPITAL_NAME("hospitalName", "医院名称", 0),
|
||||
YB_HOSPITAL_NAME("hospitalName", "医保-医院名称", 0),
|
||||
|
||||
/**
|
||||
* 医疗机构等级
|
||||
* 医保-医疗机构等级(3101接口)
|
||||
*/
|
||||
MEDINS_LV("medinsLv", "医疗机构等级", 1),
|
||||
YB_MEDINS_LV("medinsLv", "医保_医疗机构等级", 1),
|
||||
/**
|
||||
* 定点医药机构编号
|
||||
*/
|
||||
FIXMEDINS_CODE("fixmedinsCode", "定点医药机构编号", 2),
|
||||
YB_FIXMEDINS_CODE("fixmedinsCode", "医保_定点医药机构编号", 2),
|
||||
/**
|
||||
* 电子发票appid
|
||||
*/
|
||||
APP_ID("app_id", "电子发票appid", 3),
|
||||
EINVOICE_APP_ID("app_id", "电子发票-appid", 3),
|
||||
|
||||
/**
|
||||
* 电子发票key
|
||||
*/
|
||||
KEY("key", "电子发票key", 4),
|
||||
EINVOICE_KEY("key", "电子发票-key", 4),
|
||||
|
||||
/**
|
||||
* 电子发票url
|
||||
*/
|
||||
URL("url", "电子发票url", 5),
|
||||
EINVOICE_URL("url", "电子发票-url", 5),
|
||||
|
||||
/**
|
||||
* 医保开关
|
||||
*/
|
||||
YB_SWITCH("yb_switch", "医保开关", 6),
|
||||
/**
|
||||
* 客户端私钥
|
||||
*/
|
||||
CLI_PRV_KEY("cliPrvKey", "客户端私钥", 7),
|
||||
/**
|
||||
* 客户端公钥
|
||||
*/
|
||||
CLI_PUB_KEY("cliPubKey", "客户端公钥", 8),
|
||||
/**
|
||||
* 服务端公钥
|
||||
*/
|
||||
SERVER_PUB_KEY("serverPubKey", "服务端公钥", 9),
|
||||
/**
|
||||
* 定点医药机构名称
|
||||
*/
|
||||
FIXMEDINS_NAME("fixmedinsName", "定点医药机构名称", 10),
|
||||
/**
|
||||
* 行政区划
|
||||
*/
|
||||
ADMVS("admvs", "行政区划", 11),
|
||||
/**
|
||||
* 授权范围
|
||||
*/
|
||||
SCOPE("scope", "授权范围", 12),
|
||||
/**
|
||||
* 授权类型
|
||||
*/
|
||||
GRANT_TYPE("grantType", "授权类型", 13),
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
PASSWORD("password", "密码", 14),
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
USERNAME("username", "用户名", 15),
|
||||
/**
|
||||
* 客户端安全码
|
||||
*/
|
||||
CLIENT_SECRET("clientSecret", "客户端安全码", 16),
|
||||
/**
|
||||
* 客户端ID
|
||||
*/
|
||||
CLIENT_ID("clientId", "客户端ID", 17),
|
||||
/**
|
||||
* 生产环境客户端公钥
|
||||
*/
|
||||
PROD_CLI_PUB_KEY("prod_cliPubKey", "生产环境客户端公钥", 18),
|
||||
/**
|
||||
* 生产环境客户端私钥
|
||||
*/
|
||||
PROD_CLI_PRV_KEY("prod_cliPrvKey", "生产环境客户端私钥", 19),
|
||||
/**
|
||||
* 生产环境客户端ID
|
||||
*/
|
||||
PROD_CLIENT_ID("prod_clientId", "生产环境客户端ID", 20),
|
||||
/**
|
||||
* 文件路径
|
||||
*/
|
||||
FILE_PATH("filePath", "文件路径", 21),
|
||||
|
||||
/**
|
||||
* 电子地址
|
||||
*/
|
||||
ELE_ADDRESS("eleAddress", "电子地址", 22),
|
||||
ELE_ADDRESS("eleAddress", "电子处方-请求地址", 22),
|
||||
|
||||
/**
|
||||
* 服务地址
|
||||
*/
|
||||
ADDRESS("address", "服务地址", 23),
|
||||
|
||||
/**
|
||||
* 超时时间
|
||||
*/
|
||||
TIME("time", "超时时间", 24),
|
||||
|
||||
/**
|
||||
* 是否加密
|
||||
*/
|
||||
IS_ENCRYPT("isEncrypt", "是否加密", 25),
|
||||
YB_IS_ENCRYPT("isEncrypt", "医保-是否加密", 25),
|
||||
/**
|
||||
* 医保区划
|
||||
*/
|
||||
INSUPLC_ADMDVS("insuplc_admdvs", "医保区划", 26),
|
||||
YB_INSUPLC_ADMDVS("insuplc_admdvs", "医保-区划", 26),
|
||||
|
||||
/**
|
||||
* 电子处方appId
|
||||
*/
|
||||
PRE_APP_ID("pre_app_id", "电子处方appId", 27),
|
||||
ELE_PRE_APP_ID("pre_app_id", "电子处方-appId", 27),
|
||||
|
||||
/**
|
||||
* 电子处方appSecret
|
||||
*/
|
||||
PRE_APP_SECRET("pre_app_secret", "电子处方appSecret", 28),
|
||||
ELE_PRE_APP_SECRET("pre_app_secret", "电子处方-appSecret", 28),
|
||||
|
||||
/**
|
||||
* 电子处方私钥
|
||||
*/
|
||||
APP_PRVKEY("APP_PRVKEY", "电子处方私钥", 29),
|
||||
ELE_APP_PRVKEY("APP_PRVKEY", "电子处方-私钥", 29),
|
||||
|
||||
/**
|
||||
* 电子处方公钥
|
||||
*/
|
||||
PLAF_PUBKEY("PLAF_PUBKEY", "电子处方公钥", 30),
|
||||
/**
|
||||
* 医保客户端ID
|
||||
*/
|
||||
YB_CLIENT_ID("ybClientId", "医保客户端ID", 31),
|
||||
/**
|
||||
* 医保客户端安全码
|
||||
*/
|
||||
YB_CLIENT_SECRET("ybClientSecret", "医保客户端安全码", 32),
|
||||
/**
|
||||
* 医保用户名
|
||||
*/
|
||||
YB_USERNAME("ybUsername", "医保用户名", 33),
|
||||
/**
|
||||
* 医保密码
|
||||
*/
|
||||
YB_PASSWORD("ybPassword", "医保密码", 34),
|
||||
/**
|
||||
* 医保授权类型
|
||||
*/
|
||||
YB_GRANT_TYPE("ybGrantType", "医保授权类型", 35),
|
||||
/**
|
||||
* 医保授权范围
|
||||
*/
|
||||
YB_SCOPE("ybScope", "医保授权范围", 36),
|
||||
/**
|
||||
* 医保密钥
|
||||
*/
|
||||
YB_CLI_PRV_KEY("ybCliPrvKey", "医保密钥", 37),
|
||||
/**
|
||||
* 医保服务URL
|
||||
*/
|
||||
YB_URL("ybUrl", "医保服务URL", 38),
|
||||
ELE_PLAF_PUBKEY("PLAF_PUBKEY", "电子处方-公钥", 30),
|
||||
|
||||
/**
|
||||
* 医院等级
|
||||
*/
|
||||
HOSPITAL_LV("hospital_lv", "医院等级", 39),
|
||||
EINVOICE_HOSPITAL_LV("hospital_lv", "电子发票-医院等级", 39),
|
||||
|
||||
/**
|
||||
* 无视LIS&PACS报错
|
||||
*/
|
||||
LIS_PACS_ERROR_IGNORE("lisPacsErrorIgnore", "无视LIS&PACS报错", 40),
|
||||
/**
|
||||
* LIS接口地址
|
||||
*/
|
||||
@@ -193,11 +120,11 @@ public enum TenantOptionDict {
|
||||
/**
|
||||
* PACSAppSecret
|
||||
*/
|
||||
INVOICE_URL("invoiceUrl", "电子发票中转服务的路径", 46),
|
||||
INVOICE_FORWARD_URL("invoiceUrl", "电子发票-中转服务的路径", 46),
|
||||
/**
|
||||
* PACSAppSecret
|
||||
*/
|
||||
FORWARD_SWITCH("forwardSwitch", "电子发票中转服务开关", 47),
|
||||
FORWARD_SWITCH("forwardSwitch", "电子发票-中转服务开关", 47),
|
||||
/**
|
||||
* 食源性开关
|
||||
*/
|
||||
@@ -229,7 +156,55 @@ public enum TenantOptionDict {
|
||||
/**
|
||||
* BPC请求URL
|
||||
*/
|
||||
BPC_REQUEST_URL("bpcRequestUrl", "BPC请求URL", 55);
|
||||
BPC_REQUEST_URL("bpcRequestUrl", "BPC请求URL", 55),
|
||||
/**
|
||||
* 电子发票开关
|
||||
*/
|
||||
INVOICE_SWITCH("invoiceSwitch", "电子发票开关 (0:关闭 1:开启)", 56),
|
||||
|
||||
/**
|
||||
* 医嘱定价来源
|
||||
*/
|
||||
ORDER_PRICING_SOURCE("orderPricingSource", "定价来源 batchSellingPrice/retailPrice", 57),
|
||||
|
||||
/**
|
||||
* 三方支付(签到)
|
||||
*/
|
||||
THREE_PART_SIGN_URL("threePartSignUrl", "三方支付GET请求", 58),
|
||||
/**
|
||||
* 三方支付(消费)
|
||||
*/
|
||||
THREE_PART_PAY_URL("threePartPayUrl", "三方支付GET请求", 59),
|
||||
|
||||
/**
|
||||
* 三方支付(退费)
|
||||
*/
|
||||
THREE_PART_RETURN_URL("threePartReturnUrl", "三方支付GET请求", 60),
|
||||
|
||||
/**
|
||||
* 三方支付(隔天退费)
|
||||
*/
|
||||
THREE_PART_NEXT_DAY_RETURN_URL("threePartNextDayReturnUrl", "三方支付GET请求", 61),
|
||||
|
||||
/**
|
||||
* 三方支付路径(支付结果查询)
|
||||
*/
|
||||
THREE_PART_PAY_QUERY_URL("threePartPayQueryUrl", "三方支付GET请求", 62),
|
||||
|
||||
/**
|
||||
* 三方支付路径(退费结果查询)
|
||||
*/
|
||||
THREE_PART_RETURN_QUERY_URL("threePartReturnQueryUrl", "三方支付GET请求", 63),
|
||||
|
||||
/**
|
||||
* 三方支付路径(隔天退费结果查询)
|
||||
*/
|
||||
THREE_PART_NEXT_DAY_RETURN_QUERY_URL("threePartNextDayReturnQueryUrl", "三方支付GET请求", 64),
|
||||
|
||||
/**
|
||||
* 三方支付参数
|
||||
*/
|
||||
THREE_PART_PARAM("threePartParam", "三方支付GET请求", 65);
|
||||
|
||||
private final String code;
|
||||
private final String name;
|
||||
@@ -241,18 +216,6 @@ public enum TenantOptionDict {
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public Integer getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
public static TenantOptionDict getByCode(String code) {
|
||||
if (code == null) {
|
||||
return null;
|
||||
@@ -264,4 +227,16 @@ public enum TenantOptionDict {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public Integer getSort() {
|
||||
return sort;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -55,6 +55,17 @@ public class SecurityUtils {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户昵称
|
||||
**/
|
||||
public static String getNickName() {
|
||||
try {
|
||||
return getLoginUser().getUser().getNickName();
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException("获取用户昵称异常", HttpStatus.UNAUTHORIZED);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户
|
||||
**/
|
||||
|
||||
@@ -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"})
|
||||
|
||||
@@ -6,6 +6,7 @@ import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.data.redis.core.ValueOperations;
|
||||
import org.springframework.data.redis.core.script.DefaultRedisScript;
|
||||
import org.springframework.data.redis.serializer.StringRedisSerializer;
|
||||
|
||||
@@ -45,6 +46,11 @@ public class RedisConfig extends CachingConfigurerSupport {
|
||||
return redisScript;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ValueOperations<Object, Object> valueOperations(RedisTemplate<Object, Object> redisTemplate) {
|
||||
return redisTemplate.opsForValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* 限流脚本
|
||||
*/
|
||||
|
||||
@@ -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();// 表名
|
||||
|
||||
@@ -66,4 +66,6 @@ public class SysTenantOption implements Serializable {
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -16,6 +16,12 @@
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Spring 配置 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
@@ -55,6 +61,11 @@
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
</dependency>
|
||||
<!-- rabbitMQ -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-amqp</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
@@ -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,204 @@
|
||||
package com.openhis.web.adjustprice.appservice;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.adjustprice.dto.AdjustPriceDataVo;
|
||||
import com.openhis.web.adjustprice.dto.AdjustPriceManagerSearchParam;
|
||||
|
||||
/**
|
||||
* Desc: 调价业务接口
|
||||
*
|
||||
* @Author raymond
|
||||
* @Date 08:42 2025/10/16
|
||||
* @return
|
||||
**/
|
||||
public interface IAdjustPriceService {
|
||||
/**
|
||||
* Desc: 保存调价数据
|
||||
*
|
||||
* @param dataVoList 前端数据集合
|
||||
* @Author raymond
|
||||
* @Date 08:57 2025/10/16
|
||||
* @return com.core.common.core.domain.R<?>
|
||||
**/
|
||||
R<?> submitChangePriceData(List<AdjustPriceDataVo> dataVoList);
|
||||
|
||||
/**
|
||||
* Desc: 保存并提交审核调价数据
|
||||
*
|
||||
* @param dataVoList
|
||||
* @Author raymond
|
||||
* @Date 16:22 2025/10/23
|
||||
* @return com.core.common.core.domain.R<?>
|
||||
**/
|
||||
R<?> submitExamineChangePriceData(List<AdjustPriceDataVo> dataVoList);
|
||||
|
||||
/**
|
||||
* Desc: 根据关键词查询 药品|耗材|诊疗 集合的最后价格
|
||||
*
|
||||
* @param searchKey
|
||||
* @Author raymond
|
||||
* @Date 09:32 2025/10/20
|
||||
* @return java.util.List<?>
|
||||
**/
|
||||
R<?> searchKeyWordDataListByMed(String searchKey);
|
||||
|
||||
/**
|
||||
* Desc: 根据关键词查询 药品|耗材|诊疗 集合的最后价格
|
||||
*
|
||||
* @param searchKey
|
||||
* @Author raymond
|
||||
* @Date 09:32 2025/10/20
|
||||
* @return java.util.List<?>
|
||||
**/
|
||||
R<?> searchKeyWordDataListByDevice(String searchKey);
|
||||
|
||||
/**
|
||||
* Desc: 根据关键词查询 药品|耗材|诊疗 集合的最后价格
|
||||
*
|
||||
* @param searchKey
|
||||
* @Author raymond
|
||||
* @Date 09:32 2025/10/20
|
||||
* @return java.util.List<?>
|
||||
**/
|
||||
R<?> searchKeyWordDataListByActivity(String searchKey);
|
||||
|
||||
/**
|
||||
* Desc: 查询提交的改价数据
|
||||
*
|
||||
* @param adjustPriceManagerSearchParam
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param searchKey
|
||||
* @param request
|
||||
* @Author raymond
|
||||
* @Date 23:39 2025/11/1
|
||||
* @return com.core.common.core.domain.R<?>
|
||||
**/
|
||||
R<?> searchChangePriceSubmitDataToPage(AdjustPriceManagerSearchParam adjustPriceManagerSearchParam, Integer pageNo,
|
||||
Integer pageSize, String searchKey, HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* Desc: 根据busNo 查询调价单详情 med
|
||||
*
|
||||
* @param busNo
|
||||
* @Author raymond
|
||||
* @Date 13:15 2025/10/21
|
||||
* @return com.core.common.core.domain.R<?>
|
||||
**/
|
||||
R<?> searchChangePriceDataByMed(String busNo);
|
||||
|
||||
/**
|
||||
* Desc: 根据busNo 查询调价单详情 med
|
||||
*
|
||||
* @param busNo
|
||||
* @Author raymond
|
||||
* @Date 13:15 2025/10/21
|
||||
* @return com.core.common.core.domain.R<?>
|
||||
**/
|
||||
R<?> searchChangePriceDataByDevice(String busNo);
|
||||
|
||||
/**
|
||||
* Desc: 根据busNo 查询调价单详情 Activity
|
||||
*
|
||||
* @param busNo
|
||||
* @Author raymond
|
||||
* @Date 13:15 2025/10/21
|
||||
* @return com.core.common.core.domain.R<?>
|
||||
**/
|
||||
R<?> searchChangePriceDataByActivity(String busNo);
|
||||
|
||||
/**
|
||||
* Desc: 根据busNo 查询调价单详情 Health
|
||||
*
|
||||
* @param busNo
|
||||
* @Author raymond
|
||||
* @Date 13:15 2025/10/21
|
||||
* @return com.core.common.core.domain.R<?>
|
||||
**/
|
||||
R<?> searchChangePriceDataByHealth(String busNo);
|
||||
|
||||
/**
|
||||
* Desc: 修改调价原因 和 价格
|
||||
*
|
||||
* @param busNo
|
||||
* @Author raymond
|
||||
* @Date 15:21 2025/10/21
|
||||
* @return com.core.common.core.domain.R<?>
|
||||
**/
|
||||
R<?> cancelChangePriceData(String busNo);
|
||||
|
||||
/**
|
||||
* Desc: 查询有挂号信息的科室
|
||||
*
|
||||
* @param
|
||||
* @Author raymond
|
||||
* @Date 16:38 2025/10/22
|
||||
* @return com.core.common.core.domain.R<?>
|
||||
**/
|
||||
R<?> searchAllOrgData();
|
||||
|
||||
/**
|
||||
* Desc: 根据科室id 加载挂号数据
|
||||
*
|
||||
* @param orgId
|
||||
* @Author raymond
|
||||
* @Date 16:45 2025/10/22
|
||||
* @return com.core.common.core.domain.R<?>
|
||||
**/
|
||||
R<?> searchHealthData(Long orgId);
|
||||
|
||||
/**
|
||||
* Desc: 根据业务单据号 进行单据提交操作
|
||||
*
|
||||
* @param busNo
|
||||
* @Author raymond
|
||||
* @Date 09:25 2025/10/23
|
||||
* @return com.core.common.core.domain.R<?>
|
||||
**/
|
||||
R<?> updateExamineByApproval(String busNo);
|
||||
|
||||
/**
|
||||
* Desc: 根据药品ID 是否在审核中
|
||||
*
|
||||
* @param itemId
|
||||
* @Author raymond
|
||||
* @Date 17:48 2025/11/3
|
||||
* @return com.core.common.core.domain.R<?>
|
||||
**/
|
||||
R<?> checkMedApprovalExist(Long itemId);
|
||||
|
||||
/**
|
||||
* Desc: 根据耗材ID 是否在审核中
|
||||
*
|
||||
* @param itemId
|
||||
* @Author raymond
|
||||
* @Date 17:48 2025/11/3
|
||||
* @return com.core.common.core.domain.R<?>
|
||||
**/
|
||||
R<?> checkDeviceApprovalExist(Long itemId);
|
||||
|
||||
/**
|
||||
* Desc: 根据诊疗ID 是否在审核中
|
||||
*
|
||||
* @param itemId
|
||||
* @Author raymond
|
||||
* @Date 17:48 2025/11/3
|
||||
* @return com.core.common.core.domain.R<?>
|
||||
**/
|
||||
R<?> checkActivityApprovalExist(Long itemId);
|
||||
|
||||
/**
|
||||
* Desc: 根据挂号ID 是否在审核中
|
||||
*
|
||||
* @param itemId
|
||||
* @Author raymond
|
||||
* @Date 17:48 2025/11/3
|
||||
* @return com.core.common.core.domain.R<?>
|
||||
**/
|
||||
R<?> checkHealthApprovalExist(Long itemId);
|
||||
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package com.openhis.web.adjustprice.appservice;
|
||||
|
||||
import com.openhis.web.adjustprice.dto.SupplyListDto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Desc:
|
||||
* @Author raymond
|
||||
* @Date 16:09 2025/10/15
|
||||
* @return
|
||||
**/
|
||||
public interface ISupplyService {
|
||||
/**
|
||||
* Desc:
|
||||
* @param
|
||||
* @Author raymond
|
||||
* @Date 17:10 2025/10/15
|
||||
* @return java.util.List<com.openhis.web.paymentmanage.dto.SupplyListDto>
|
||||
**/
|
||||
List<SupplyListDto> searchAllSupplyList();
|
||||
}
|
||||
@@ -0,0 +1,594 @@
|
||||
package com.openhis.web.adjustprice.appservice.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.core.domain.entity.SysDictData;
|
||||
import com.core.common.enums.AdjustPriceEnum;
|
||||
import com.core.common.utils.AssignSeqUtil;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.core.system.service.ISysDictDataService;
|
||||
import com.openhis.administration.domain.ChangePriceRecord;
|
||||
import com.openhis.administration.dto.ChangePriceDataDto;
|
||||
import com.openhis.administration.dto.ChargeItemDefDetailPriceDto;
|
||||
import com.openhis.administration.dto.HealthcareDto;
|
||||
import com.openhis.administration.dto.OrgDataDto;
|
||||
import com.openhis.administration.service.*;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.*;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.common.utils.RedisKeys;
|
||||
import com.openhis.common.utils.RedisUtil;
|
||||
import com.openhis.medication.service.IMedicationService;
|
||||
import com.openhis.web.adjustprice.appservice.IAdjustPriceService;
|
||||
import com.openhis.web.adjustprice.dto.AdjustPriceDataVo;
|
||||
import com.openhis.web.adjustprice.dto.AdjustPriceManagerSearchParam;
|
||||
import com.openhis.web.adjustprice.dto.ChangePricePageDto;
|
||||
import com.openhis.web.adjustprice.mapper.AdjustPriceMapper;
|
||||
import com.openhis.web.inventorymanage.dto.InventorySearchParam;
|
||||
import com.openhis.workflow.dto.ActivityDto;
|
||||
import com.openhis.workflow.dto.AdjustPriceDto;
|
||||
import com.openhis.workflow.service.IActivityDefinitionService;
|
||||
import com.openhis.workflow.service.IInventoryItemService;
|
||||
|
||||
/**
|
||||
* @ClassName AdjustPriceServiceImpl
|
||||
* @Description 调价业务实现
|
||||
* @Author raymond
|
||||
* @Date 2025/10/15 16:10
|
||||
* @Version 1.0
|
||||
**/
|
||||
@Service
|
||||
public class AdjustPriceServiceImpl implements IAdjustPriceService {
|
||||
@Resource
|
||||
private IInventoryItemService inventoryItemService;
|
||||
@Resource
|
||||
private IActivityDefinitionService activityDefinitionService;
|
||||
@Resource
|
||||
private IHealthcareServiceService healthcareServiceService;
|
||||
@Resource
|
||||
private IMedicationService medicationService;
|
||||
@Resource
|
||||
private AdjustPriceMapper adjustPriceMapper;
|
||||
@Resource
|
||||
private IDeviceDefinitionService deviceDefinitionService;
|
||||
@Resource
|
||||
private IOrganizationService organizationService;
|
||||
@Resource
|
||||
private IChargeItemDefinitionService chargeItemDefinitionService;
|
||||
@Resource
|
||||
private IChangePriceRecordService changePriceRecordService;
|
||||
@Resource
|
||||
private ISysDictDataService sysDictDataService;
|
||||
@Resource
|
||||
private AssignSeqUtil assignSeqUtil;
|
||||
@Resource
|
||||
private RedisUtil redisUtil;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public R<?> submitChangePriceData(List<AdjustPriceDataVo> dataVoList) {
|
||||
if (dataVoList.isEmpty()) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.AdjustPrice.M00001, null));
|
||||
}
|
||||
if (dataVoList.stream()
|
||||
.anyMatch(data -> this.redisUtil.hasKey(RedisKeys.getProductsKey(data.getItemId().toString())))) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.AdjustPrice.M00002, null));
|
||||
}
|
||||
//获取数据中的类型
|
||||
Integer categoryType = dataVoList.get(0).getCategoryType();
|
||||
// 单据号
|
||||
String busNo = assignSeqUtil.getSeqByDay(AssignSeqEnum.CHANGE_PRICE_BUZ.getPrefix());
|
||||
// 当前人
|
||||
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||
// 根据表单提交的tab 进入不同的 execute
|
||||
if (AdjustPriceEnum.MEDICINE.getCode().equals(categoryType)
|
||||
|| AdjustPriceEnum.CONSUMABLES.getCode().equals(categoryType)) {
|
||||
//如果是 药品或者是耗材 因为药品和耗材的价格取的是 charge_detail表
|
||||
this.executeChangePriceForMedication(dataVoList, busNo, practitionerId, categoryType);
|
||||
} else if (AdjustPriceEnum.DIAGNOSIS.getCode().equals(categoryType)) {
|
||||
//如果是 如果是 诊疗, 取价格主表
|
||||
this.executeChangePriceForActivity(dataVoList, busNo, practitionerId);
|
||||
} else {
|
||||
//如果是 如果是 挂号, 取价格主表
|
||||
this.executeChangePriceForHealth(dataVoList, busNo, practitionerId);
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> submitExamineChangePriceData(List<AdjustPriceDataVo> dataVoList) {
|
||||
if (dataVoList.isEmpty()) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.AdjustPrice.M00001, null));
|
||||
}
|
||||
if (dataVoList.stream()
|
||||
.anyMatch(data -> this.redisUtil.hasKey(RedisKeys.getProductsKey(data.getItemId().toString())))) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.AdjustPrice.M00002, null));
|
||||
}
|
||||
//获取数据中的类型
|
||||
Integer categoryType = dataVoList.get(0).getCategoryType();
|
||||
// 单据号
|
||||
String busNo = assignSeqUtil.getSeqByDay(AssignSeqEnum.CHANGE_PRICE_BUZ.getPrefix());
|
||||
// 当前人
|
||||
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||
// 根据表单提交的tab 进入不同的 execute
|
||||
if (AdjustPriceEnum.MEDICINE.getCode().equals(categoryType)
|
||||
|| AdjustPriceEnum.CONSUMABLES.getCode().equals(categoryType)) {
|
||||
this.executeChangePriceForMedicationExamine(dataVoList, busNo, practitionerId, categoryType);
|
||||
} else if (AdjustPriceEnum.DIAGNOSIS.getCode().equals(categoryType)) {
|
||||
this.executeChangePriceForActivityExamine(dataVoList, busNo, practitionerId);
|
||||
} else {
|
||||
this.executeChangePriceForHealthExamine(dataVoList, busNo, practitionerId);
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> searchKeyWordDataListByMed(String searchKey) {
|
||||
//如果 searchKey == null 默认返回10条,反则 查询所有
|
||||
return R.ok(this.medicationService.searchMedListByKeyWord(searchKey));
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> searchKeyWordDataListByDevice(String searchKey) {
|
||||
//如果 searchKey == null 默认返回10条,反则 查询所有
|
||||
return R.ok(this.deviceDefinitionService.searchDeviceListByKeyWord(searchKey));
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> searchKeyWordDataListByActivity(String searchKey) {
|
||||
//如果 searchKey == null 默认返回10条,反则 查询所有
|
||||
return R.ok(this.activityDefinitionService.searchActivityListByKeyWord(searchKey));
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> searchChangePriceSubmitDataToPage(AdjustPriceManagerSearchParam adjustPriceManagerSearchParam,
|
||||
Integer pageNo, Integer pageSize, String searchKey, HttpServletRequest request) {
|
||||
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||
HashSet<String> searchFields = new HashSet<>();
|
||||
searchFields.add(CommonConstants.FieldName.BusNo);
|
||||
// 构建查询条件
|
||||
QueryWrapper<InventorySearchParam> queryWrapper =
|
||||
HisQueryUtils.buildQueryWrapper(adjustPriceManagerSearchParam, searchKey, searchFields, request);
|
||||
// 查询入库单据分页列表
|
||||
Page<ChangePricePageDto> changePricePageDtoPage = this.adjustPriceMapper.searchChangePriceDataToPage(
|
||||
new Page<>(pageNo, pageSize), queryWrapper, SupplyType.REQUEST_MEDICATION_CHANGE_PRICE.getValue(),
|
||||
SupplyType.REQUEST_DEVICE_CHANGE_PRICE.getValue(), SupplyType.REQUEST_ACTIVITY_CHANGE_PRICE.getValue(),
|
||||
SupplyType.REQUEST_HEALTH_CHANGE_PRICE.getValue(), practitionerId);
|
||||
changePricePageDtoPage.getRecords().forEach(e -> {
|
||||
e.setStatusEnum_enumText(EnumUtils.getInfoByValue(SupplyStatus.class, e.getStatusEnum()));
|
||||
e.setCategoryEnum_enumText(EnumUtils.getInfoByValue(SupplyType.class, e.getItemCategoryEnum()));
|
||||
});
|
||||
return R.ok(changePricePageDtoPage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> searchChangePriceDataByMed(String busNo) {
|
||||
// 根据 单据号 查询 药品详情
|
||||
List<ChangePriceDataDto> dataList = this.changePriceRecordService.searchMedChangePriceByBusNo(busNo,
|
||||
SupplyType.REQUEST_MEDICATION_CHANGE_PRICE.getValue(), null);
|
||||
// 获取 药品的单位
|
||||
for (ChangePriceDataDto changePriceDataDto : dataList) {
|
||||
SysDictData sysDictData =
|
||||
sysDictDataService.selectDictInfo(CommonConstants.FieldName.UnitCode, changePriceDataDto.getUnitCode());
|
||||
changePriceDataDto.setLabel(sysDictData.getDictLabel());
|
||||
}
|
||||
return R.ok(dataList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> searchChangePriceDataByDevice(String busNo) {
|
||||
//根据 单据号 耗材调价单详情
|
||||
return R.ok(this.changePriceRecordService.searchDeviceChangePriceByBusNo(busNo,
|
||||
SupplyType.REQUEST_DEVICE_CHANGE_PRICE.getValue(), null));
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> searchChangePriceDataByActivity(String busNo) {
|
||||
//根据 单据号 查询 诊疗调价单详情
|
||||
return R.ok(this.changePriceRecordService.searchActivityChangePriceByBusNo(busNo,
|
||||
SupplyType.REQUEST_ACTIVITY_CHANGE_PRICE.getValue(), null));
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> searchChangePriceDataByHealth(String busNo) {
|
||||
//根据 单据号 挂号调价单详情
|
||||
return R.ok(this.changePriceRecordService.searchHealthChangePriceByBusNo(busNo,
|
||||
SupplyType.REQUEST_HEALTH_CHANGE_PRICE.getValue(), null));
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> cancelChangePriceData(String busNo) {
|
||||
//根据 单据号查询出 当前所有请求调价的数据集
|
||||
List<ChangePriceRecord> changePriceRecordList =
|
||||
this.changePriceRecordService.searchChangePriceDataForBusNo(busNo);
|
||||
//循环数据集合,将状态修改为 无效状态
|
||||
for (ChangePriceRecord data : changePriceRecordList) {
|
||||
ChangePriceRecord changePriceRecord = this.changePriceRecordService.getById(data.getId());
|
||||
changePriceRecord.setStatusEnum(SupplyStatus.EXPIRED_INVALIDATED.getValue());
|
||||
this.changePriceRecordService.updateById(changePriceRecord);
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> searchAllOrgData() {
|
||||
//查询所有科室
|
||||
List<OrgDataDto> orgDataList = this.organizationService.searchOrgDataByHealth();
|
||||
return R.ok(orgDataList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> searchHealthData(Long orgId) {
|
||||
//根据科室ID 查询所有号源
|
||||
return R.ok(this.healthcareServiceService.searchAllHeathData(orgId,PublicationStatus.ACTIVE.getValue()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> updateExamineByApproval(String busNo) {
|
||||
//根据调价单编号 查询 分组后的 数据
|
||||
List<ChangePriceRecord> changePriceRecordList =
|
||||
this.changePriceRecordService.searchChangePriceDataGroupByBusNo(busNo);
|
||||
if (!changePriceRecordList.isEmpty()) {
|
||||
// 循环将数据进行填充
|
||||
for (ChangePriceRecord data : changePriceRecordList) {
|
||||
//提交 审批时,查看是否有正在审核中的 货品数据 。根据 货品ID 从redis中查询
|
||||
if (this.redisUtil.hasKey(RedisKeys.getProductsKey(data.getItemId().toString()))) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.AdjustPrice.M00002, null));
|
||||
}
|
||||
//如果不存在,向redis中插入 药品信息 = 给当前 货品上锁 。审批通过或驳回后 释放
|
||||
this.redisUtil.set(RedisKeys.getProductsKey(data.getItemId().toString()), data.getItemId());
|
||||
}
|
||||
//根据 busNo 修改调价单状态
|
||||
this.changePriceRecordService.submitApproval(busNo);
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> checkMedApprovalExist(Long itemId) {
|
||||
//添加 货品调价时,先查询 当前货品是否在 审核中,如果在,不允许改价。
|
||||
return this.changePriceRecordService.searchMedChangePriceByItemId(itemId,
|
||||
SupplyType.REQUEST_MEDICATION_CHANGE_PRICE.getValue(), SupplyStatus.APPROVAL.getValue()).isEmpty() ? R.ok()
|
||||
: R.fail(MessageUtils.createMessage(PromptMsgConstant.AdjustPrice.M00002, null));
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> checkDeviceApprovalExist(Long itemId) {
|
||||
//添加 货品调价时,先查询 当前货品是否在 审核中,如果在,不允许改价。
|
||||
return this.changePriceRecordService.searchDeviceChangePriceByItemId(itemId,
|
||||
SupplyType.REQUEST_DEVICE_CHANGE_PRICE.getValue(), SupplyStatus.APPROVAL.getValue()).isEmpty() ? R.ok()
|
||||
: R.fail(MessageUtils.createMessage(PromptMsgConstant.AdjustPrice.M00002, null));
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> checkActivityApprovalExist(Long itemId) {
|
||||
//添加 货品调价时,先查询 当前货品是否在 审核中,如果在,不允许改价。
|
||||
return this.changePriceRecordService.searchActivityChangePriceByItemId(itemId,
|
||||
SupplyType.REQUEST_ACTIVITY_CHANGE_PRICE.getValue(), SupplyStatus.APPROVAL.getValue()).isEmpty() ? R.ok()
|
||||
: R.fail(MessageUtils.createMessage(PromptMsgConstant.AdjustPrice.M00002, null));
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> checkHealthApprovalExist(Long itemId) {
|
||||
//添加 货品调价时,先查询 当前货品是否在 审核中,如果在,不允许改价。
|
||||
return this.changePriceRecordService.searchHealthChangePriceByItemId(itemId,
|
||||
SupplyType.REQUEST_HEALTH_CHANGE_PRICE.getValue(), SupplyStatus.APPROVAL.getValue()).isEmpty() ? R.ok()
|
||||
: R.fail(MessageUtils.createMessage(PromptMsgConstant.AdjustPrice.M00002, null));
|
||||
}
|
||||
|
||||
public boolean executeChangePriceForMedication(List<AdjustPriceDataVo> dataVoList, String busNo,
|
||||
Long practitionerId, Integer categoryType) {
|
||||
// 有库存的药品或耗材集合
|
||||
List<AdjustPriceDataVo> resultList = new LinkedList<>();
|
||||
// 从map中将表单集合取出
|
||||
Map<Long, AdjustPriceDataVo> dataVoMap = this.executeMap(dataVoList);
|
||||
//根据表单中的id数组 加载库存集合
|
||||
List<AdjustPriceDto> inventoryItemList =
|
||||
this.inventoryItemService.searchResultDataList(this.executeItemIds(dataVoList));
|
||||
for (AdjustPriceDto data : inventoryItemList) {
|
||||
AdjustPriceDataVo dataVo = new AdjustPriceDataVo();
|
||||
dataVo.setTotalQuantity(data.getTotalCount());
|
||||
dataVo.setItemTable(data.getItemTable());
|
||||
dataVo.setItemId(data.getItemId());
|
||||
dataVo.setNewBuyingPrice(dataVoMap.get(data.getItemId()).getNewBuyingPrice());
|
||||
dataVo.setNewRetailPrice(dataVoMap.get(data.getItemId()).getNewRetailPrice());
|
||||
dataVo.setReason(dataVoMap.get(data.getItemId()).getReason());
|
||||
dataVo.setUnitCode(dataVoMap.get(data.getItemId()).getUnitCode());
|
||||
dataVo.setLotNumber(data.getLotNumber());
|
||||
dataVo.setLocationId(data.getLocationId());
|
||||
resultList.add(dataVo);
|
||||
}
|
||||
//填充 ChangePriceRecord 对象,返回list进行批量添加
|
||||
List<ChangePriceRecord> changePriceRecords =
|
||||
this.executeChangePriceData(busNo, practitionerId, resultList, SupplyStatus.PENDING_APPROVAL.getValue(),
|
||||
AdjustPriceEnum.MEDICINE.getCode().equals(categoryType)
|
||||
? SupplyType.REQUEST_MEDICATION_CHANGE_PRICE.getValue()
|
||||
: SupplyType.REQUEST_DEVICE_CHANGE_PRICE.getValue());
|
||||
return this.changePriceRecordService.saveOrUpdateBatch(changePriceRecords);
|
||||
}
|
||||
|
||||
public boolean executeChangePriceForMedicationExamine(List<AdjustPriceDataVo> dataVoList, String busNo,
|
||||
Long practitionerId, Integer categoryType) {
|
||||
// 有库存的药品或耗材集合
|
||||
List<AdjustPriceDataVo> resultList = new LinkedList<>();
|
||||
Map<Long, AdjustPriceDataVo> dataVoMap = this.executeMap(dataVoList);
|
||||
List<AdjustPriceDto> inventoryItemList =
|
||||
this.inventoryItemService.searchResultDataList(this.executeItemIds(dataVoList));
|
||||
for (AdjustPriceDto data : inventoryItemList) {
|
||||
AdjustPriceDataVo dataVo = new AdjustPriceDataVo();
|
||||
dataVo.setTotalQuantity(data.getTotalCount());
|
||||
dataVo.setItemTable(data.getItemTable());
|
||||
dataVo.setItemId(data.getItemId());
|
||||
dataVo.setNewBuyingPrice(dataVoMap.get(data.getItemId()).getNewBuyingPrice());
|
||||
dataVo.setNewRetailPrice(dataVoMap.get(data.getItemId()).getNewRetailPrice());
|
||||
dataVo.setReason(dataVoMap.get(data.getItemId()).getReason());
|
||||
dataVo.setUnitCode(dataVoMap.get(data.getItemId()).getUnitCode());
|
||||
dataVo.setLotNumber(data.getLotNumber());
|
||||
dataVo.setLocationId(data.getLocationId());
|
||||
resultList.add(dataVo);
|
||||
this.redisUtil.set(RedisKeys.getProductsKey(data.getItemId().toString()), data.getItemId());
|
||||
}
|
||||
//填充 ChangePriceRecord 对象,返回list进行批量添加
|
||||
List<ChangePriceRecord> changePriceRecords =
|
||||
this.executeChangePriceData(busNo, practitionerId, resultList, SupplyStatus.APPROVAL.getValue(),
|
||||
AdjustPriceEnum.MEDICINE.getCode().equals(categoryType)
|
||||
? SupplyType.REQUEST_MEDICATION_CHANGE_PRICE.getValue()
|
||||
: SupplyType.REQUEST_DEVICE_CHANGE_PRICE.getValue());
|
||||
return this.changePriceRecordService.saveOrUpdateBatch(changePriceRecords);
|
||||
}
|
||||
|
||||
public boolean executeChangePriceForActivity(List<AdjustPriceDataVo> dataVoList, String busNo,
|
||||
Long practitionerId) {
|
||||
List<ActivityDto> dataDtoList =
|
||||
this.activityDefinitionService.searchActivityDefinitionByIds(this.executeItemIds(dataVoList));
|
||||
Map<Long, AdjustPriceDataVo> dataVoMap = this.executeMap(dataVoList);
|
||||
List<AdjustPriceDataVo> resultList = new LinkedList<>();
|
||||
for (ActivityDto data : dataDtoList) {
|
||||
AdjustPriceDataVo dataVo = new AdjustPriceDataVo();
|
||||
dataVo.setItemTable(CommonConstants.TableName.WOR_ACTIVITY_DEFINITION);
|
||||
dataVo.setName(data.getName());
|
||||
dataVo.setItemId(data.getItemId());
|
||||
dataVo.setNewBuyingPrice(dataVoMap.get(data.getItemId()).getNewBuyingPrice());
|
||||
dataVo.setNewRetailPrice(dataVoMap.get(data.getItemId()).getNewRetailPrice());
|
||||
dataVo.setReason(dataVoMap.get(data.getItemId()).getReason());
|
||||
dataVo.setLotNumber(dataVoMap.get(data.getItemId()).getLotNumber());
|
||||
resultList.add(dataVo);
|
||||
}
|
||||
//填充 ChangePriceRecord 对象,返回list进行批量添加
|
||||
List<ChangePriceRecord> changePriceRecords = this.executeChangePriceData(busNo, practitionerId, resultList,
|
||||
SupplyStatus.PENDING_APPROVAL.getValue(), SupplyType.REQUEST_ACTIVITY_CHANGE_PRICE.getValue());
|
||||
return this.changePriceRecordService.saveOrUpdateBatch(changePriceRecords);
|
||||
}
|
||||
|
||||
/**
|
||||
* Desc: 处理申请 诊疗改价业务申请
|
||||
*
|
||||
* @param dataVoList
|
||||
* @Author raymond
|
||||
* @Date 11:19 2025/10/18
|
||||
* @return boolean
|
||||
**/
|
||||
public boolean executeChangePriceForActivityExamine(List<AdjustPriceDataVo> dataVoList, String busNo,
|
||||
Long practitionerId) {
|
||||
List<ActivityDto> dataDtoList =
|
||||
this.activityDefinitionService.searchActivityDefinitionByIds(this.executeItemIds(dataVoList));
|
||||
Map<Long, AdjustPriceDataVo> dataVoMap = this.executeMap(dataVoList);
|
||||
List<AdjustPriceDataVo> resultList = new LinkedList<>();
|
||||
for (ActivityDto data : dataDtoList) {
|
||||
AdjustPriceDataVo dataVo = new AdjustPriceDataVo();
|
||||
dataVo.setItemTable(CommonConstants.TableName.WOR_ACTIVITY_DEFINITION);
|
||||
dataVo.setName(data.getName());
|
||||
dataVo.setItemId(data.getItemId());
|
||||
dataVo.setNewBuyingPrice(dataVoMap.get(data.getItemId()).getNewBuyingPrice());
|
||||
dataVo.setNewRetailPrice(dataVoMap.get(data.getItemId()).getNewRetailPrice());
|
||||
dataVo.setReason(dataVoMap.get(data.getItemId()).getReason());
|
||||
dataVo.setLotNumber(dataVoMap.get(data.getItemId()).getLotNumber());
|
||||
resultList.add(dataVo);
|
||||
this.redisUtil.set(RedisKeys.getProductsKey(data.getItemId().toString()), data.getItemId());
|
||||
}
|
||||
//填充 ChangePriceRecord 对象,返回list进行批量添加
|
||||
List<ChangePriceRecord> changePriceRecords = this.executeChangePriceData(busNo, practitionerId, resultList,
|
||||
SupplyStatus.APPROVAL.getValue(), SupplyType.REQUEST_ACTIVITY_CHANGE_PRICE.getValue());
|
||||
return this.changePriceRecordService.saveOrUpdateBatch(changePriceRecords);
|
||||
}
|
||||
|
||||
/**
|
||||
* Desc: 处理申请 挂号改价业务
|
||||
*
|
||||
* @param dataVoList
|
||||
* @Author raymond
|
||||
* @Date 11:20 2025/10/18
|
||||
* @return boolean
|
||||
**/
|
||||
public boolean executeChangePriceForHealth(List<AdjustPriceDataVo> dataVoList, String busNo, Long practitionerId) {
|
||||
List<HealthcareDto> dataDtoList =
|
||||
this.healthcareServiceService.searchHealthByIds(this.executeItemIds(dataVoList));
|
||||
List<AdjustPriceDataVo> resultList = new LinkedList<>();
|
||||
Map<Long, AdjustPriceDataVo> dataVoMap = this.executeMap(dataVoList);
|
||||
for (HealthcareDto data : dataDtoList) {
|
||||
AdjustPriceDataVo dataVo = new AdjustPriceDataVo();
|
||||
dataVo.setItemTable(CommonConstants.TableName.ADM_HEALTHCARE_SERVICE);
|
||||
dataVo.setItemId(data.getItemId());
|
||||
dataVo.setName(data.getName());
|
||||
dataVo.setNewBuyingPrice(dataVoMap.get(data.getItemId()).getNewBuyingPrice());
|
||||
dataVo.setNewRetailPrice(dataVoMap.get(data.getItemId()).getNewRetailPrice());
|
||||
dataVo.setReason(dataVoMap.get(data.getItemId()).getReason());
|
||||
dataVo.setLotNumber(dataVoMap.get(data.getItemId()).getLotNumber());
|
||||
resultList.add(dataVo);
|
||||
}
|
||||
//填充 ChangePriceRecord 对象,返回list进行批量添加 supply_request表共享了 审核状态和 category 枚举
|
||||
List<ChangePriceRecord> changePriceRecords = this.executeChangePriceData(busNo, practitionerId, resultList,
|
||||
SupplyStatus.PENDING_APPROVAL.getValue(), SupplyType.REQUEST_HEALTH_CHANGE_PRICE.getValue());
|
||||
return this.changePriceRecordService.saveOrUpdateBatch(changePriceRecords);
|
||||
}
|
||||
|
||||
/**
|
||||
* Desc: 处理申请 挂号改价业务
|
||||
*
|
||||
* @param dataVoList
|
||||
* @Author raymond
|
||||
* @Date 11:20 2025/10/18
|
||||
* @return boolean
|
||||
**/
|
||||
public boolean executeChangePriceForHealthExamine(List<AdjustPriceDataVo> dataVoList, String busNo,
|
||||
Long practitionerId) {
|
||||
List<HealthcareDto> dataDtoList =
|
||||
this.healthcareServiceService.searchHealthByIds(this.executeItemIds(dataVoList));
|
||||
List<AdjustPriceDataVo> resultList = new LinkedList<>();
|
||||
Map<Long, AdjustPriceDataVo> dataVoMap = this.executeMap(dataVoList);
|
||||
for (HealthcareDto data : dataDtoList) {
|
||||
AdjustPriceDataVo dataVo = new AdjustPriceDataVo();
|
||||
dataVo.setItemTable(CommonConstants.TableName.ADM_HEALTHCARE_SERVICE);
|
||||
dataVo.setItemId(data.getItemId());
|
||||
dataVo.setName(data.getName());
|
||||
dataVo.setNewBuyingPrice(dataVoMap.get(data.getItemId()).getNewBuyingPrice());
|
||||
dataVo.setNewRetailPrice(dataVoMap.get(data.getItemId()).getNewRetailPrice());
|
||||
dataVo.setReason(dataVoMap.get(data.getItemId()).getReason());
|
||||
dataVo.setLotNumber(dataVoMap.get(data.getItemId()).getLotNumber());
|
||||
resultList.add(dataVo);
|
||||
this.redisUtil.set(RedisKeys.getProductsKey(data.getItemId().toString()), data.getItemId());
|
||||
}
|
||||
//填充 ChangePriceRecord 对象,返回list进行批量添加 supply_request表共享了 审核状态和 category 枚举
|
||||
List<ChangePriceRecord> changePriceRecords = this.executeChangePriceData(busNo, practitionerId, resultList,
|
||||
SupplyStatus.APPROVAL.getValue(), SupplyType.REQUEST_HEALTH_CHANGE_PRICE.getValue());
|
||||
return this.changePriceRecordService.saveOrUpdateBatch(changePriceRecords);
|
||||
}
|
||||
|
||||
/**
|
||||
* Desc: 封装对象数据
|
||||
*
|
||||
* @param busNo
|
||||
* @param curUserId
|
||||
* @param itemList
|
||||
* @Author raymond
|
||||
* @Date 09:35 2025/10/18
|
||||
* @return java.util.List<com.openhis.workflow.domain.ChangePriceRecord>
|
||||
**/
|
||||
public List<ChangePriceRecord> executeChangePriceData(String busNo, Long curUserId,
|
||||
List<AdjustPriceDataVo> itemList, Integer statusEnum, Integer categoryEnum) {
|
||||
List<ChangePriceRecord> srList = new LinkedList<>();
|
||||
for (AdjustPriceDataVo dataVo : itemList) {
|
||||
ChangePriceRecord cpr = new ChangePriceRecord();
|
||||
//如果是 药品调价
|
||||
if (SupplyType.REQUEST_MEDICATION_CHANGE_PRICE.getValue().equals(categoryEnum)) {
|
||||
// 获取当前进货价
|
||||
ChargeItemDefDetailPriceDto buyingPriceDto = this.chargeItemDefinitionService
|
||||
.getMedPriceByParam(ConditionCode.LOT_NUMBER_COST.getCode(), dataVo.getItemId());
|
||||
// 获取当前零售价
|
||||
ChargeItemDefDetailPriceDto retailPriceDto = this.chargeItemDefinitionService
|
||||
.getMedPriceByParam(ConditionCode.LOT_NUMBER_PRICE.getCode(), dataVo.getItemId());
|
||||
if (buyingPriceDto != null || retailPriceDto != null) {
|
||||
// 库存 以最小单位存储,以货品最小单位进行计算
|
||||
BigDecimal partPercent =
|
||||
dataVo.getTotalQuantity().divide(buyingPriceDto.getPartPercent(), 6, RoundingMode.HALF_UP);
|
||||
//进货价盈负差
|
||||
BigDecimal buyingDiffPrice =
|
||||
dataVo.getNewBuyingPrice().subtract(buyingPriceDto.getPrice()).multiply(partPercent);
|
||||
// 零售价盈负差
|
||||
BigDecimal retailDiffPrice =
|
||||
dataVo.getNewRetailPrice().subtract(retailPriceDto.getPrice()).multiply(partPercent);
|
||||
//填充 change_price_record表数据
|
||||
cpr.setNewBuyingPrice(dataVo.getNewBuyingPrice()).setNewRetailPrice(dataVo.getNewRetailPrice())
|
||||
.setItemQuantity(dataVo.getTotalQuantity()).setItemId(dataVo.getItemId())
|
||||
.setItemTable(dataVo.getItemTable()).setReason(dataVo.getReason()).setBusNo(busNo)
|
||||
.setApplicantId(curUserId).setStatusEnum(statusEnum).setItemCategoryEnum(categoryEnum)
|
||||
.setLotNumber(dataVo.getLotNumber()).setUnitCode(dataVo.getUnitCode())
|
||||
.setOriginBuyingPrice(buyingPriceDto.getPrice()).setOriginRetailPrice(retailPriceDto.getPrice())
|
||||
.setDifferenceBuyingPrice(buyingDiffPrice).setDifferenceRetailPrice(retailDiffPrice)
|
||||
.setApplicantTime(SupplyStatus.APPROVAL.getValue().equals(statusEnum) ? new Date() : null);
|
||||
srList.add(cpr);
|
||||
} //如果是 耗材调价
|
||||
} else if (SupplyType.REQUEST_DEVICE_CHANGE_PRICE.getValue().equals(categoryEnum)) {
|
||||
// 获取当前进货价
|
||||
ChargeItemDefDetailPriceDto buyingPriceDto = this.chargeItemDefinitionService
|
||||
.getDevicePriceByParam(ConditionCode.LOT_NUMBER_COST.getCode(), dataVo.getItemId());
|
||||
// 获取当前零售价
|
||||
ChargeItemDefDetailPriceDto retailPriceDto = this.chargeItemDefinitionService
|
||||
.getDevicePriceByParam(ConditionCode.LOT_NUMBER_PRICE.getCode(), dataVo.getItemId());
|
||||
if (buyingPriceDto != null || retailPriceDto != null) {
|
||||
// 库存 以最小单位存储,以货品最小单位进行计算
|
||||
BigDecimal partPercent =
|
||||
dataVo.getTotalQuantity().divide(buyingPriceDto.getPartPercent(), 6, RoundingMode.HALF_UP);
|
||||
//进货价盈负差
|
||||
BigDecimal buyingDiffPrice =
|
||||
dataVo.getNewBuyingPrice().subtract(buyingPriceDto.getPrice()).multiply(partPercent);
|
||||
// 零售价盈负差
|
||||
BigDecimal retailDiffPrice =
|
||||
dataVo.getNewRetailPrice().subtract(retailPriceDto.getPrice()).multiply(partPercent);
|
||||
//填充 change_price_record表数据
|
||||
cpr.setNewBuyingPrice(dataVo.getNewBuyingPrice()).setNewRetailPrice(dataVo.getNewRetailPrice())
|
||||
.setItemQuantity(dataVo.getTotalQuantity()).setItemId(dataVo.getItemId()).setLocationId(dataVo.getLocationId())
|
||||
.setItemTable(dataVo.getItemTable()).setReason(dataVo.getReason()).setBusNo(busNo)
|
||||
.setApplicantId(curUserId).setStatusEnum(statusEnum).setItemCategoryEnum(categoryEnum)
|
||||
.setLotNumber(dataVo.getLotNumber()).setUnitCode(dataVo.getUnitCode())
|
||||
.setOriginBuyingPrice(buyingPriceDto.getPrice()).setOriginRetailPrice(retailPriceDto.getPrice())
|
||||
.setDifferenceBuyingPrice(buyingDiffPrice).setDifferenceRetailPrice(retailDiffPrice)
|
||||
.setApplicantTime(SupplyStatus.APPROVAL.getValue().equals(statusEnum) ? new Date() : null);
|
||||
srList.add(cpr);
|
||||
}
|
||||
} else {//如果是 诊疗或者挂号调价,诊疗和耗材 没有库存
|
||||
ChargeItemDefDetailPriceDto retailPriceDto = this.chargeItemDefinitionService
|
||||
.getProductPrice(PublicationStatus.ACTIVE.getValue(), dataVo.getItemId());
|
||||
if (retailPriceDto != null) {
|
||||
//新价格 - 原价格
|
||||
BigDecimal retailDiffPrice = dataVo.getNewRetailPrice().subtract(retailPriceDto.getPrice());
|
||||
//填充 change_price_record表数据
|
||||
cpr.setNewBuyingPrice(dataVo.getNewBuyingPrice()).setNewRetailPrice(dataVo.getNewRetailPrice())
|
||||
.setItemQuantity(dataVo.getTotalQuantity()).setItemId(dataVo.getItemId())
|
||||
.setItemTable(dataVo.getItemTable()).setReason(dataVo.getReason()).setBusNo(busNo)
|
||||
.setApplicantId(curUserId).setStatusEnum(statusEnum).setItemCategoryEnum(categoryEnum)
|
||||
.setLotNumber(dataVo.getLotNumber()).setUnitCode(dataVo.getUnitCode())
|
||||
.setOriginRetailPrice(retailPriceDto.getPrice()).setDifferenceRetailPrice(retailDiffPrice)
|
||||
.setApplicantTime(SupplyStatus.APPROVAL.getValue().equals(statusEnum) ? new Date() : null);
|
||||
srList.add(cpr);
|
||||
}
|
||||
}
|
||||
}
|
||||
return srList;
|
||||
}
|
||||
|
||||
/**
|
||||
* Desc: 封装获取药品和耗材的id数组
|
||||
*
|
||||
* @param dataVoList
|
||||
* @Author raymond
|
||||
* @Date 08:03 2025/10/18
|
||||
* @return java.util.List<java.lang.Long>
|
||||
**/
|
||||
public List<Long> executeItemIds(List<AdjustPriceDataVo> dataVoList) {
|
||||
List<Long> itemIds = new LinkedList<>();
|
||||
for (AdjustPriceDataVo data : dataVoList) {
|
||||
itemIds.add(data.getItemId());
|
||||
}
|
||||
return itemIds;
|
||||
}
|
||||
/**
|
||||
* Desc: 存储表单数据
|
||||
* @param dataVoList
|
||||
* @Author raymond
|
||||
* @Date 10:28 2025/11/5
|
||||
* @return java.util.Map<java.lang.Long,com.openhis.web.adjustprice.dto.AdjustPriceDataVo>
|
||||
**/
|
||||
public Map<Long, AdjustPriceDataVo> executeMap(List<AdjustPriceDataVo> dataVoList) {
|
||||
Map<Long, AdjustPriceDataVo> map = new ConcurrentHashMap<>();
|
||||
for (AdjustPriceDataVo data : dataVoList) {
|
||||
map.put(data.getItemId(), data);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package com.openhis.web.adjustprice.appservice.impl;
|
||||
|
||||
import com.openhis.web.adjustprice.appservice.ISupplyService;
|
||||
import com.openhis.web.adjustprice.dto.SupplyListDto;
|
||||
import com.openhis.web.adjustprice.mapper.SupplyMapper;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName ChangePriceImpl
|
||||
* @Description TODO
|
||||
* @Author raymond
|
||||
* @Date 2025/10/15 16:10
|
||||
* @Version 1.0
|
||||
**/
|
||||
@Component
|
||||
public class SupplyServiceImpl implements ISupplyService {
|
||||
|
||||
@Resource
|
||||
private SupplyMapper supplyMapper;
|
||||
|
||||
@Override
|
||||
public List<SupplyListDto> searchAllSupplyList() {
|
||||
return this.supplyMapper.searchAllSupplyList();
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,15 @@
|
||||
package com.openhis.web.adjustprice.controller;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.enums.TenantOptionDict;
|
||||
import com.core.web.util.TenantOptionUtil;
|
||||
import com.openhis.common.enums.OrderPricingSource;
|
||||
import com.openhis.web.adjustprice.appservice.IAdjustPriceService;
|
||||
import com.openhis.web.adjustprice.dto.AdjustPriceDataVo;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.adjustprice.appservice.ISupplyService;
|
||||
import com.openhis.web.datadictionary.dto.MedicationSearchParam;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName ChargePriceController
|
||||
@@ -19,94 +21,163 @@ import com.openhis.web.datadictionary.dto.MedicationSearchParam;
|
||||
@RestController
|
||||
@RequestMapping("/change/price")
|
||||
public class ChangePriceController {
|
||||
|
||||
@Resource
|
||||
private ISupplyService supplyService;
|
||||
private IAdjustPriceService adjustPriceService;
|
||||
|
||||
/**
|
||||
* Desc: 查询所有供应商集合
|
||||
*
|
||||
* Desc: 根据关键词搜索数据
|
||||
*
|
||||
* @param
|
||||
* @Author raymond
|
||||
* @Date 16:55 2025/10/15
|
||||
* @return com.core.common.core.domain.R<?>
|
||||
* @Author raymond
|
||||
* @Date 09:26 2025/10/20
|
||||
**/
|
||||
@GetMapping(value = "searchAllSupply")
|
||||
public R<?> searchAllSupply() {
|
||||
return R.ok(this.supplyService.searchAllSupplyList());
|
||||
@PostMapping(value = "searchKeyWordDataListByMed")
|
||||
public R<?> searchKeyWordDataListByMed(@RequestParam(name = "searchKey", required = false) String searchKey) {
|
||||
return R.ok(this.adjustPriceService.searchKeyWordDataListByMed(searchKey));
|
||||
}
|
||||
|
||||
/**
|
||||
* Desc: 根据关键词搜索数据
|
||||
*
|
||||
* @param
|
||||
* @return com.core.common.core.domain.R<?>
|
||||
* @Author raymond
|
||||
* @Date 09:26 2025/10/20
|
||||
**/
|
||||
@PostMapping(value = "searchKeyWordDataListByDevice")
|
||||
public R<?> searchKeyWordDataListByDevice(@RequestParam(name = "searchKey", required = false) String searchKey) {
|
||||
return R.ok(this.adjustPriceService.searchKeyWordDataListByDevice(searchKey));
|
||||
}
|
||||
|
||||
/**
|
||||
* Desc: 根据关键词搜索数据
|
||||
*
|
||||
* @param
|
||||
* @return com.core.common.core.domain.R<?>
|
||||
* @Author raymond
|
||||
* @Date 09:26 2025/10/20
|
||||
**/
|
||||
@PostMapping(value = "searchKeyWordDataListByActivity")
|
||||
public R<?> searchKeyWordDataListByActivity(@RequestParam(name = "searchKey", required = false) String searchKey) {
|
||||
return R.ok(this.adjustPriceService.searchKeyWordDataListByActivity(searchKey));
|
||||
}
|
||||
|
||||
/**
|
||||
* Desc: 查询所有 有挂号信息的科室
|
||||
*
|
||||
* @param
|
||||
* @return com.core.common.core.domain.R<?>
|
||||
* @Author raymond
|
||||
* @Date 08:38 2025/10/22
|
||||
**/
|
||||
@PostMapping(value = "searchAllOrgData")
|
||||
public R<?> searchAllOrgData() {
|
||||
return this.adjustPriceService.searchAllOrgData();
|
||||
}
|
||||
|
||||
/**
|
||||
* Desc: 根据科室id 加载 挂号信息
|
||||
*
|
||||
* @param orgId
|
||||
* @return com.core.common.core.domain.R<?>
|
||||
* @Author raymond
|
||||
* @Date 16:46 2025/10/22
|
||||
**/
|
||||
@PostMapping(value = "searchHealthData")
|
||||
public R<?> searchHealthData(@RequestParam Long orgId) {
|
||||
return this.adjustPriceService.searchHealthData(orgId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Desc: 保存 改价数据
|
||||
*
|
||||
* @return com.core.common.core.domain.R<?>
|
||||
* @Author raymond
|
||||
* @Date 08:47 2025/10/15
|
||||
**/
|
||||
@PostMapping(value = "commitChangePriceData")
|
||||
public R<?> commitChangePriceData(@RequestBody List<AdjustPriceDataVo> dataVoList) {
|
||||
return adjustPriceService.submitChangePriceData(dataVoList);
|
||||
}
|
||||
|
||||
/**
|
||||
* Desc: 根据供应商和药品名称加载要修改的药品数据
|
||||
*
|
||||
*
|
||||
* @return com.core.common.core.domain.R<?>
|
||||
* @Author raymond
|
||||
* @Date 08:47 2025/10/15
|
||||
* @return com.core.common.core.domain.R<?>
|
||||
**/
|
||||
@PostMapping(value = "searchMedicineListToPage")
|
||||
public R<?> searchMedicineListToPage() {
|
||||
return R.ok();
|
||||
@PostMapping(value = "submitExamineChangePriceData")
|
||||
public R<?> submitExamineChangePriceData(@RequestBody List<AdjustPriceDataVo> dataVoList) {
|
||||
return adjustPriceService.submitExamineChangePriceData(dataVoList);
|
||||
}
|
||||
|
||||
/**
|
||||
* Desc:
|
||||
*
|
||||
* @param medicationSearchParam
|
||||
* @param searchKey
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param request
|
||||
* @Author raymond
|
||||
* @Date 13:41 2025/10/15
|
||||
* Desc: 根据货品ID 查询是否有审核中的药品数据
|
||||
*
|
||||
* @param itemId
|
||||
* @return com.core.common.core.domain.R<?>
|
||||
* @Author raymond
|
||||
* @Date 17:32 2025/11/3
|
||||
**/
|
||||
@PostMapping(value = "searchConsumablesListToPage")
|
||||
public R<?> searchConsumablesListToPage(MedicationSearchParam medicationSearchParam,
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
return null;
|
||||
@PostMapping(value = "checkMedApprovalExist")
|
||||
public R<?> checkMedApprovalExist(@RequestParam Long itemId) {
|
||||
return this.adjustPriceService.checkMedApprovalExist(itemId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Desc:
|
||||
*
|
||||
* @param medicationSearchParam
|
||||
* @param searchKey
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param request
|
||||
* @Author raymond
|
||||
* @Date 13:41 2025/10/15
|
||||
* Desc: 根据货品ID 查询是否有审核中的药品数据
|
||||
*
|
||||
* @param itemId
|
||||
* @return com.core.common.core.domain.R<?>
|
||||
* @Author raymond
|
||||
* @Date 17:32 2025/11/3
|
||||
**/
|
||||
@PostMapping(value = "searchDiagnosisListToPage")
|
||||
public R<?> searchDiagnosisListToPage(MedicationSearchParam medicationSearchParam,
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
return null;
|
||||
@PostMapping(value = "checkDeviceApprovalExist")
|
||||
public R<?> checkDeviceApprovalExist(@RequestParam Long itemId) {
|
||||
return this.adjustPriceService.checkDeviceApprovalExist(itemId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Desc:
|
||||
*
|
||||
* @param medicationSearchParam
|
||||
* @param searchKey
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param request
|
||||
* @Author raymond
|
||||
* @Date 13:41 2025/10/15
|
||||
* Desc: 根据货品ID 查询是否有审核中的药品数据
|
||||
*
|
||||
* @param itemId
|
||||
* @return com.core.common.core.domain.R<?>
|
||||
* @Author raymond
|
||||
* @Date 17:32 2025/11/3
|
||||
**/
|
||||
@PostMapping(value = "searchHealthCareListToPage")
|
||||
public R<?> searchRegisterListToPage(MedicationSearchParam medicationSearchParam,
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
@PostMapping(value = "checkActivityApprovalExist")
|
||||
public R<?> checkActivityApprovalExist(@RequestParam Long itemId) {
|
||||
return this.adjustPriceService.checkActivityApprovalExist(itemId);
|
||||
}
|
||||
|
||||
return null;
|
||||
/**
|
||||
* Desc: 根据货品ID 查询是否有审核中的药品数据
|
||||
*
|
||||
* @param itemId
|
||||
* @return com.core.common.core.domain.R<?>
|
||||
* @Author raymond
|
||||
* @Date 17:32 2025/11/3
|
||||
**/
|
||||
@PostMapping(value = "checkHealthApprovalExist")
|
||||
public R<?> checkHealthApprovalExist(@RequestParam Long itemId) {
|
||||
return this.adjustPriceService.checkHealthApprovalExist(itemId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Desc: 查询调价控制开关状态接口
|
||||
*
|
||||
* @return true:统一零售价 , false:按批次号售卖
|
||||
**/
|
||||
@GetMapping(value = "getAdjustPriceSwitchState")
|
||||
public R<?> getAdjustPriceSwitchState() {
|
||||
// 医嘱定价来源
|
||||
String orderPricingSource = TenantOptionUtil.getOptionContent(TenantOptionDict.ORDER_PRICING_SOURCE);
|
||||
if (OrderPricingSource.RETAIL_PRICE.getCode().equals(orderPricingSource)) {
|
||||
return R.ok(true);
|
||||
}
|
||||
return R.ok(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,153 @@
|
||||
package com.openhis.web.adjustprice.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.StringUtils;
|
||||
import com.openhis.web.adjustprice.appservice.IAdjustPriceService;
|
||||
import com.openhis.web.adjustprice.dto.AdjustPriceDataVo;
|
||||
import com.openhis.web.adjustprice.dto.AdjustPriceManagerSearchParam;
|
||||
|
||||
/**
|
||||
* @ClassName ChangePriceListPageController
|
||||
* @Description TODO
|
||||
* @Author raymond
|
||||
* @Date 2025/10/23 15:16
|
||||
* @Version 1.0
|
||||
**/
|
||||
@RestController
|
||||
@RequestMapping("/change/price/list")
|
||||
public class ChangePriceDataListPageController {
|
||||
|
||||
@Resource
|
||||
private IAdjustPriceService adjustPriceService;
|
||||
|
||||
/**
|
||||
* Desc: 查询 调价管理列表页面 分页查询当前人 提交的调价单
|
||||
*
|
||||
* @param adjustPriceManagerSearchParam
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param searchKey
|
||||
* @param request
|
||||
* @Author raymond
|
||||
* @Date 15:47 2025/10/23
|
||||
* @return com.core.common.core.domain.R<?>
|
||||
**/
|
||||
@GetMapping(value = "getPage")
|
||||
public R<?> getPage(AdjustPriceManagerSearchParam adjustPriceManagerSearchParam,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
@RequestParam(name = "searchKey", required = false) String searchKey, HttpServletRequest request) {
|
||||
return this.adjustPriceService.searchChangePriceSubmitDataToPage(adjustPriceManagerSearchParam, pageNo,
|
||||
pageSize, searchKey, request);
|
||||
}
|
||||
|
||||
/**
|
||||
* Desc: 根据单据号 进行提交审核操作
|
||||
*
|
||||
* @param busNo
|
||||
* @Author raymond
|
||||
* @Date 09:38 2025/10/23
|
||||
* @return com.core.common.core.domain.R<?>
|
||||
**/
|
||||
@PostMapping(value = "updateStatusByApproval")
|
||||
public R<?> updateStatusByApproval(@RequestParam String busNo) {
|
||||
return this.adjustPriceService.updateExamineByApproval(busNo);
|
||||
}
|
||||
|
||||
/**
|
||||
* Desc: 作废 调价单数据
|
||||
*
|
||||
* @param busNo
|
||||
* @Author raymond
|
||||
* @Date 14:47 2025/10/21
|
||||
* @return com.core.common.core.domain.R<?>
|
||||
**/
|
||||
@PostMapping(value = "cancelChangePriceData")
|
||||
public R<?> cancelChangePriceData(@RequestParam String busNo) {
|
||||
return this.adjustPriceService.cancelChangePriceData(busNo);
|
||||
}
|
||||
|
||||
/**
|
||||
* Desc: 根据供应商和药品名称加载要修改的药品数据
|
||||
*
|
||||
*
|
||||
* @Author raymond
|
||||
* @Date 08:47 2025/10/15
|
||||
* @return com.core.common.core.domain.R<?>
|
||||
**/
|
||||
@PostMapping(value = "submitChangePriceData")
|
||||
public R<?> submitChangePriceData(@RequestBody List<AdjustPriceDataVo> dataVoList) {
|
||||
return adjustPriceService.submitChangePriceData(dataVoList);
|
||||
}
|
||||
|
||||
/**
|
||||
* Desc: 根据 单据号 药品调价单 查询详情
|
||||
*
|
||||
* @param busNo
|
||||
* @Author raymond
|
||||
* @Date 12:01 2025/10/21
|
||||
* @return com.core.common.core.domain.R<?>
|
||||
**/
|
||||
@PostMapping(value = "searchChangePriceDataByMed")
|
||||
public R<?> searchChangePriceDataByMed(@RequestParam String busNo) {
|
||||
if (StringUtils.isEmpty(busNo)) {
|
||||
return R.fail();
|
||||
}
|
||||
return this.adjustPriceService.searchChangePriceDataByMed(busNo);
|
||||
}
|
||||
|
||||
/**
|
||||
* Desc: 根据 单据号 耗材调价单 查询详情
|
||||
*
|
||||
* @param busNo
|
||||
* @Author raymond
|
||||
* @Date 12:01 2025/10/21
|
||||
* @return com.core.common.core.domain.R<?>
|
||||
**/
|
||||
@PostMapping(value = "searchChangePriceDataByDevice")
|
||||
public R<?> searchChangePriceDataByDevice(@RequestParam String busNo) {
|
||||
if (StringUtils.isEmpty(busNo)) {
|
||||
return R.fail();
|
||||
}
|
||||
return this.adjustPriceService.searchChangePriceDataByDevice(busNo);
|
||||
}
|
||||
|
||||
/**
|
||||
* Desc: 根据 单据号 诊疗调价单 查询详情
|
||||
*
|
||||
* @param busNo
|
||||
* @Author raymond
|
||||
* @Date 12:01 2025/10/21
|
||||
* @return com.core.common.core.domain.R<?>
|
||||
**/
|
||||
@PostMapping(value = "searchChangePriceDataByActivity")
|
||||
public R<?> searchChangePriceDataByActivity(@RequestParam String busNo) {
|
||||
if (StringUtils.isEmpty(busNo)) {
|
||||
return R.fail();
|
||||
}
|
||||
return this.adjustPriceService.searchChangePriceDataByActivity(busNo);
|
||||
}
|
||||
|
||||
/**
|
||||
* Desc: 根据 单据号 挂号调价单 查询详情
|
||||
*
|
||||
* @param busNo
|
||||
* @Author raymond
|
||||
* @Date 12:01 2025/10/21
|
||||
* @return com.core.common.core.domain.R<?>
|
||||
**/
|
||||
@PostMapping(value = "searchChangePriceDataByHealth")
|
||||
public R<?> searchChangePriceDataByHealth(@RequestParam String busNo) {
|
||||
if (StringUtils.isEmpty(busNo)) {
|
||||
return R.fail();
|
||||
}
|
||||
return this.adjustPriceService.searchChangePriceDataByHealth(busNo);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.openhis.web.adjustprice.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ClassName AdjustPriceDataVo
|
||||
* @Description TODO
|
||||
* @Author raymond
|
||||
* @Date 2025/10/16 08:31
|
||||
* @Version 1.0
|
||||
**/
|
||||
@Data
|
||||
public class AdjustPriceDataVo {
|
||||
/**
|
||||
* 表ID
|
||||
*/
|
||||
private Long itemId;
|
||||
/**
|
||||
* 分类 0、药品;1、耗材;2、诊疗;3、挂号
|
||||
*/
|
||||
private Integer categoryType;
|
||||
/**
|
||||
* 改价原因
|
||||
*/
|
||||
private String reason;
|
||||
/**
|
||||
* 新进货价
|
||||
*/
|
||||
private BigDecimal newBuyingPrice;
|
||||
/**
|
||||
* 新售价
|
||||
*/
|
||||
private BigDecimal newRetailPrice;
|
||||
/**
|
||||
* 经手人
|
||||
*/
|
||||
private Long practitionerId;
|
||||
/**
|
||||
* 每个批次影响数量
|
||||
*/
|
||||
private BigDecimal quantity;
|
||||
/**
|
||||
* 总数量
|
||||
*/
|
||||
private BigDecimal totalQuantity;
|
||||
/**
|
||||
* 表名
|
||||
*/
|
||||
private String itemTable;
|
||||
/**
|
||||
* 单据号
|
||||
*/
|
||||
private String busNo;
|
||||
|
||||
private String name;
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
private String lotNumber;
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unitCode;
|
||||
/**
|
||||
* 位置
|
||||
*/
|
||||
private Long locationId;
|
||||
|
||||
private BigDecimal finalTotalQuantity;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.openhis.web.adjustprice.dto;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* @ClassName AdjustPriceManagerSearchParam
|
||||
* @Description 改价管理 查询条件
|
||||
* @Author raymond
|
||||
* @Date 2025/10/24 16:23
|
||||
* @Version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AdjustPriceManagerSearchParam {
|
||||
|
||||
/** 审核状态 */
|
||||
private Integer statusEnum;
|
||||
|
||||
/** 单据类型 */
|
||||
private Integer itemCategoryEnum;
|
||||
/**
|
||||
* 单据时间
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date applicantTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package com.openhis.web.adjustprice.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ClassName ChangePricePageDto
|
||||
* @Description TODO
|
||||
* @Author raymond
|
||||
* @Date 2025/10/31 17:35
|
||||
* @Version 1.0
|
||||
**/
|
||||
@Data
|
||||
public class ChangePriceDataDto {
|
||||
|
||||
/** 批次号 */
|
||||
private String originLotNumber;
|
||||
|
||||
/** 改价申请人id */
|
||||
private Long applicantId;
|
||||
|
||||
/** 目标枚举 药品、耗材、诊疗、挂号 */
|
||||
private Integer itemCategoryEnum;
|
||||
private String itemCategoryEnum_Text;
|
||||
|
||||
/** 药品ID、耗材ID、诊疗ID、挂号ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long itemId;
|
||||
/**
|
||||
* 获取名称
|
||||
*/
|
||||
private String itemName;
|
||||
/** 原进货价 */
|
||||
private BigDecimal originBuyingPrice;
|
||||
|
||||
/** 原零售价价格 */
|
||||
private BigDecimal originRetailPrice;
|
||||
|
||||
/** 当前品库存量 */
|
||||
private BigDecimal itemQuantity;
|
||||
|
||||
/** 当前业务批次号 */
|
||||
private String busNo;
|
||||
|
||||
/** 改价申请时间 */
|
||||
private Date applicantTime;
|
||||
|
||||
/** 新进货价 */
|
||||
private BigDecimal newBuyingPrice;
|
||||
|
||||
/** 新零售价 */
|
||||
private BigDecimal newRetailPrice;
|
||||
|
||||
/** 物品计量单位 */
|
||||
private String unitCode;
|
||||
|
||||
/** 审批状态 */
|
||||
private Integer statusEnum;
|
||||
private Integer statusEnum_Text;
|
||||
|
||||
/** 批次号 */
|
||||
private String lotNumber;
|
||||
|
||||
/** 条件理由 */
|
||||
private String reason;
|
||||
|
||||
/** 零售价盈负差*/
|
||||
private BigDecimal differenceRetailPrice;
|
||||
/**进货价盈负差*/
|
||||
private BigDecimal differenceBuyingPrice;
|
||||
/**
|
||||
* 科室名称
|
||||
*/
|
||||
private String orgName;
|
||||
/**
|
||||
* 价格主表ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long chargeId;
|
||||
/**
|
||||
* 调价表ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long changePriceRecordId;
|
||||
|
||||
private String label;
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
private String totalVolume;
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.openhis.web.adjustprice.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.openhis.common.annotation.Dict;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ClassName ChangePricePageDto
|
||||
* @Description 改价业务分页dto
|
||||
* @Author raymond
|
||||
* @Date 2025/11/1 22:53
|
||||
* @Version 1.0
|
||||
**/
|
||||
@Data
|
||||
public class ChangePricePageDto {
|
||||
|
||||
/** 单据号 */
|
||||
private String busNo;
|
||||
|
||||
/** 状态 */
|
||||
private Integer statusEnum;
|
||||
private String statusEnum_enumText;
|
||||
|
||||
/** 审批人 */
|
||||
@Dict(dictCode = "id", dictText = "name", dictTable = "adm_practitioner")
|
||||
private Long approverId;
|
||||
private String approverId_dictText;
|
||||
|
||||
/** 审批时间 */
|
||||
private Date approvalTime;
|
||||
|
||||
/** 申请人 */
|
||||
@Dict(dictCode = "id", dictText = "name", dictTable = "adm_practitioner")
|
||||
private Long applicantId;
|
||||
private String applicantId_dictText;
|
||||
|
||||
/** 申请时间 */
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date applicantTime;
|
||||
|
||||
/** 制单日期 */
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
/** 备注 */
|
||||
private String reason;
|
||||
|
||||
/**
|
||||
* 24、药品
|
||||
*/
|
||||
private Integer itemCategoryEnum;
|
||||
private String categoryEnum_enumText;
|
||||
|
||||
private BigDecimal originRetailPrice;
|
||||
private BigDecimal originBuyingPrice;
|
||||
private BigDecimal newBuyingPrice;
|
||||
private BigDecimal newRetailPrice;
|
||||
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package com.openhis.web.adjustprice.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ClassName SupplyListDto
|
||||
* @Description TODO
|
||||
* @Author raymond
|
||||
* @Date 2025/10/15 16:56
|
||||
* @Version 1.0
|
||||
**/
|
||||
@Data
|
||||
public class SupplyListDto {
|
||||
/**
|
||||
* 供应商ID
|
||||
*/
|
||||
private Long supplyId;
|
||||
/**
|
||||
* 供应商名称
|
||||
*/
|
||||
private String supplyName;
|
||||
}
|
||||
@@ -0,0 +1,155 @@
|
||||
package com.openhis.web.adjustprice.mapper;
|
||||
|
||||
import com.openhis.web.adjustprice.dto.ChangePriceDataDto;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.openhis.web.adjustprice.dto.ChangePricePageDto;
|
||||
import com.openhis.web.inventorymanage.dto.InventorySearchParam;
|
||||
import com.openhis.web.inventorymanage.dto.ReceiptPageDto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Desc:
|
||||
*
|
||||
* @Author raymond
|
||||
* @Date 14:37 2025/10/15
|
||||
* @return
|
||||
**/
|
||||
@Component
|
||||
public interface AdjustPriceMapper {
|
||||
/**
|
||||
* Desc: 查询单据审批分页列表
|
||||
*
|
||||
* @param page
|
||||
* @param queryWrapper
|
||||
* @param medTypeEnum
|
||||
* @param deviceTypeEnum
|
||||
* @param activityTypeEnum
|
||||
* @param healthTypeEnum
|
||||
* @Author raymond
|
||||
* @Date 16:01 2025/10/24
|
||||
* @return com.baomidou.mybatisplus.extension.plugins.pagination.Page<com.openhis.web.inventorymanage.dto.ReceiptPageDto>
|
||||
**/
|
||||
Page<ReceiptPageDto> selectInventoryReceiptPage(@Param("page") Page<ReceiptPageDto> page,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<InventorySearchParam> queryWrapper,
|
||||
@Param("medTypeEnum") Integer medTypeEnum, @Param("deviceTypeEnum") Integer deviceTypeEnum,
|
||||
@Param("activityTypeEnum") Integer activityTypeEnum, @Param("healthTypeEnum") Integer healthTypeEnum);
|
||||
|
||||
/**
|
||||
* Desc: 根据当前人 ID 查询提交的调价申请记录
|
||||
*
|
||||
* @param page
|
||||
* @param queryWrapper
|
||||
* @param medCategory
|
||||
* @param deviceCategory
|
||||
* @param activityCategory
|
||||
* @param healthCategory
|
||||
* @param applicantId
|
||||
* @Author raymond
|
||||
* @Date 00:59 2025/11/2
|
||||
* @return com.baomidou.mybatisplus.extension.plugins.pagination.Page<com.openhis.web.adjustprice.dto.ChangePricePageDto>
|
||||
**/
|
||||
Page<ChangePricePageDto> searchChangePriceDataToPage(@Param("page") Page<ReceiptPageDto> page,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<InventorySearchParam> queryWrapper,
|
||||
@Param("medCategory") Integer medCategory, @Param("deviceCategory") Integer deviceCategory,
|
||||
@Param("activityCategory") Integer activityCategory, @Param("healthCategory") Integer healthCategory,
|
||||
@Param("applicantId") Long applicantId);
|
||||
|
||||
/**
|
||||
* Desc: 根据条件 查询 药品调价单
|
||||
* @param busNo
|
||||
* @param categoryEnum
|
||||
* @param statusEnum
|
||||
* @Author raymond
|
||||
* @Date 09:46 2025/11/2
|
||||
* @return java.util.List<com.openhis.administration.dto.ChangePriceDataDto>
|
||||
**/
|
||||
List<ChangePriceDataDto> searchMedChangePriceByBusNo(@Param("busNo") String busNo, @Param("categoryEnum") Integer categoryEnum, @Param("statusEnum") Integer statusEnum);
|
||||
/**
|
||||
* Desc: 根据条件 查询 药品调价单
|
||||
* @param itemId
|
||||
* @param categoryEnum
|
||||
* @param statusEnum
|
||||
* @Author raymond
|
||||
* @Date 07:34 2025/11/4
|
||||
* @return java.util.List<com.openhis.administration.dto.ChangePriceDataDto>
|
||||
**/
|
||||
List<ChangePriceDataDto> searchMedChangePriceByItemId(@Param("itemId") Long itemId,@Param("categoryEnum") Integer categoryEnum,@Param("statusEnum") Integer statusEnum);
|
||||
/**
|
||||
* Desc: 根据条件 查询 耗材调价单
|
||||
* @param busNo
|
||||
* @param categoryEnum
|
||||
* @param statusEnum
|
||||
* @Author raymond
|
||||
* @Date 09:46 2025/11/2
|
||||
* @return java.util.List<com.openhis.administration.dto.ChangePriceDataDto>
|
||||
**/
|
||||
List<ChangePriceDataDto> searchDeviceChangePriceByBusNo(@Param("busNo") String busNo,@Param("categoryEnum") Integer categoryEnum,@Param("statusEnum") Integer statusEnum);
|
||||
/**
|
||||
* Desc: 根据条件 查询 耗材调价单
|
||||
* @param itemId
|
||||
* @param categoryEnum
|
||||
* @param statusEnum
|
||||
* @Author raymond
|
||||
* @Date 07:33 2025/11/4
|
||||
* @return java.util.List<com.openhis.administration.dto.ChangePriceDataDto>
|
||||
**/
|
||||
List<ChangePriceDataDto> searchDeviceChangePriceByItemId(@Param("itemId") Long itemId,@Param("categoryEnum") Integer categoryEnum,@Param("statusEnum") Integer statusEnum);
|
||||
|
||||
/**
|
||||
* Desc: 根据条件 查询 诊疗调价单
|
||||
* @param busNo
|
||||
* @param categoryEnum
|
||||
* @param statusEnum
|
||||
* @Author raymond
|
||||
* @Date 09:46 2025/11/2
|
||||
* @return java.util.List<com.openhis.administration.dto.ChangePriceDataDto>
|
||||
**/
|
||||
List<ChangePriceDataDto> searchActivityChangePriceByBusNo(@Param("busNo") String busNo,@Param("categoryEnum") Integer categoryEnum,@Param("statusEnum") Integer statusEnum);
|
||||
/**
|
||||
* Desc: 根据条件 查询 诊疗调价单
|
||||
* @param itemId
|
||||
* @param categoryEnum
|
||||
* @param statusEnum
|
||||
* @Author raymond
|
||||
* @Date 07:32 2025/11/4
|
||||
* @return java.util.List<com.openhis.administration.dto.ChangePriceDataDto>
|
||||
**/
|
||||
List<ChangePriceDataDto> searchActivityChangePriceByItemId(@Param("itemId") Long itemId,@Param("categoryEnum") Integer categoryEnum,@Param("statusEnum") Integer statusEnum);
|
||||
|
||||
/**
|
||||
* Desc: 根据条件 查询 挂号调价单
|
||||
* @param busNo
|
||||
* @param categoryEnum
|
||||
* @param statusEnum
|
||||
* @Author raymond
|
||||
* @Date 09:46 2025/11/2
|
||||
* @return java.util.List<com.openhis.administration.dto.ChangePriceDataDto>
|
||||
**/
|
||||
List<ChangePriceDataDto> searchHealthChangePriceByBusNo(@Param("busNo") String busNo,@Param("categoryEnum") Integer categoryEnum,@Param("statusEnum") Integer statusEnum);
|
||||
/**
|
||||
* Desc: 根据条件 查询 挂号调价单
|
||||
* @param itemId
|
||||
* @param categoryEnum
|
||||
* @param statusEnum
|
||||
* @Author raymond
|
||||
* @Date 07:31 2025/11/4
|
||||
* @return java.util.List<com.openhis.administration.dto.ChangePriceDataDto>
|
||||
**/
|
||||
List<ChangePriceDataDto> searchHealthChangePriceByItemId(@Param("itemId") Long itemId,@Param("categoryEnum") Integer categoryEnum,@Param("statusEnum") Integer statusEnum);
|
||||
/**
|
||||
* Desc: 根据条件 查询 审批单 审核中的数据
|
||||
* @param busNo
|
||||
* @param statusEnum
|
||||
* @Author raymond
|
||||
* @Date 10:36 2025/11/2
|
||||
* @return java.util.List<com.openhis.administration.dto.ChangePriceDataDto>
|
||||
**/
|
||||
List<ChangePriceDataDto> searchChangePriceRecordDataByBusNo(@Param("busNo") String busNo,@Param("statusEnum") Integer statusEnum);
|
||||
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package com.openhis.web.adjustprice.mapper;
|
||||
|
||||
import com.openhis.web.adjustprice.dto.SupplyListDto;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Desc:
|
||||
* @Author raymond
|
||||
* @Date 14:37 2025/10/15
|
||||
* @return
|
||||
**/
|
||||
@Component
|
||||
public interface SupplyMapper {
|
||||
/**
|
||||
* Desc:
|
||||
* @param
|
||||
* @Author raymond
|
||||
* @Date 17:10 2025/10/15
|
||||
* @return java.util.List<com.openhis.web.paymentmanage.dto.SupplyListDto>
|
||||
**/
|
||||
List<SupplyListDto> searchAllSupplyList();
|
||||
|
||||
}
|
||||
@@ -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,11 @@
|
||||
package com.openhis.web.appointmentmanage.appservice;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.administration.domain.DoctorSchedule;
|
||||
|
||||
public interface IDoctorScheduleAppService {
|
||||
|
||||
R<?> addDoctorSchedule(DoctorSchedule doctorSchedule);
|
||||
|
||||
R<?> removeDoctorSchedule(Integer doctorScheduleId);
|
||||
}
|
||||
@@ -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.administration.domain.Dept;
|
||||
import com.openhis.administration.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,35 @@
|
||||
package com.openhis.web.appointmentmanage.appservice.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.administration.domain.DoctorSchedule;
|
||||
import com.openhis.administration.service.IDoctorScheduleService;
|
||||
import com.openhis.web.appointmentmanage.appservice.IDoctorScheduleAppService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@Service
|
||||
public class DoctorScheduleAppServiceImpl implements IDoctorScheduleAppService {
|
||||
@Resource
|
||||
private IDoctorScheduleService doctorScheduleService;
|
||||
|
||||
|
||||
@Override
|
||||
public R<?> addDoctorSchedule(DoctorSchedule doctorSchedule) {
|
||||
if (ObjectUtil.isEmpty(doctorSchedule)) {
|
||||
return R.fail("医生排班不能为空");
|
||||
}
|
||||
boolean save = doctorScheduleService.save(doctorSchedule);
|
||||
return R.ok(save);
|
||||
}
|
||||
|
||||
@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,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,35 @@
|
||||
package com.openhis.web.appointmentmanage.controller;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.administration.domain.DoctorSchedule;
|
||||
import com.openhis.web.appointmentmanage.appservice.IDoctorScheduleAppService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.websocket.server.PathParam;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/doctor-schedule")
|
||||
public class DoctorScheduleController {
|
||||
@Resource
|
||||
private IDoctorScheduleAppService doctorScheduleAppService;
|
||||
|
||||
/*
|
||||
* 新增医生排班
|
||||
*
|
||||
* */
|
||||
@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,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 {
|
||||
}
|
||||
@@ -100,7 +100,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[] {"机构信息查询"}));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,6 +6,9 @@ import java.util.stream.Collectors;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.utils.DateTimeUtils;
|
||||
import com.openhis.workflow.mapper.ActivityDefinitionMapper;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -46,6 +49,9 @@ public class OrganizationLocationAppServiceImpl implements IOrganizationLocation
|
||||
@Autowired
|
||||
private IOrganizationLocationService organizationLocationService;
|
||||
|
||||
@Autowired
|
||||
private ActivityDefinitionMapper activityDefinitionMapper;
|
||||
|
||||
/**
|
||||
* 机构位置关系初始化
|
||||
*
|
||||
@@ -126,6 +132,25 @@ public class OrganizationLocationAppServiceImpl implements IOrganizationLocation
|
||||
OrganizationLocation orgLoc = new OrganizationLocation();
|
||||
BeanUtils.copyProperties(orgLocQueryDto, orgLoc);
|
||||
|
||||
Long activityDefinitionId = orgLoc.getActivityDefinitionId();
|
||||
String activityName = activityDefinitionId != null ? activityDefinitionMapper.selectById(activityDefinitionId).getName() : "";
|
||||
|
||||
List<OrganizationLocation> organizationLocationList =
|
||||
organizationLocationService.getOrgLocListByOrgIdAndActivityDefinitionId(orgLoc.getActivityDefinitionId());
|
||||
organizationLocationList = (orgLoc.getId() != null)
|
||||
? organizationLocationList.stream().filter(item -> !orgLoc.getId().equals(item.getId())).toList()
|
||||
: organizationLocationList;
|
||||
|
||||
if (!organizationLocationList.isEmpty())
|
||||
for (OrganizationLocation organizationLocation : organizationLocationList)
|
||||
if (DateTimeUtils.isOverlap(organizationLocation.getStartTime(), organizationLocation.getEndTime(),
|
||||
orgLoc.getStartTime(), orgLoc.getEndTime())) {
|
||||
String organizationName =
|
||||
organizationService.getById(organizationLocation.getOrganizationId()).getName();
|
||||
return R.fail("当前诊疗:" + activityName + CommonConstants.Common.DASH + orgLoc.getStartTime()
|
||||
+ CommonConstants.Common.DASH + orgLoc.getEndTime() + "与" + organizationName + "时间冲突");
|
||||
}
|
||||
|
||||
if (orgLocQueryDto.getId() != null) {
|
||||
// 更新机构位置信息
|
||||
organizationLocationService.updateById(orgLoc);
|
||||
|
||||
@@ -7,7 +7,6 @@ import java.util.stream.Collectors;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import com.openhis.common.enums.AdministrativeGender;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
@@ -15,6 +14,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.AssignSeqUtil;
|
||||
import com.core.common.utils.ChineseConvertUtils;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
@@ -29,6 +29,8 @@ import com.openhis.administration.service.IPractitionerRoleService;
|
||||
import com.openhis.administration.service.IPractitionerService;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.AccountStatus;
|
||||
import com.openhis.common.enums.AdministrativeGender;
|
||||
import com.openhis.common.enums.AssignSeqEnum;
|
||||
import com.openhis.common.enums.PractitionerRoles;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.web.basedatamanage.appservice.IPractitionerAppService;
|
||||
@@ -59,6 +61,9 @@ public class PractitionerAppServiceImpl implements IPractitionerAppService {
|
||||
@Resource
|
||||
ISysTenantService sysTenantService;
|
||||
|
||||
@Resource
|
||||
private AssignSeqUtil assignSeqUtil;
|
||||
|
||||
/**
|
||||
* 新增用户及参与者
|
||||
*
|
||||
@@ -108,8 +113,9 @@ public class PractitionerAppServiceImpl implements IPractitionerAppService {
|
||||
// 新增 adm_practitioner
|
||||
Practitioner practitioner = new Practitioner();
|
||||
practitioner.setActiveFlag(AccountStatus.ACTIVE.getValue()); // 活动标记
|
||||
practitioner.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.PRACTITIONER_NO.getPrefix(), 8)); // 编号
|
||||
practitioner.setName(nickName); // 姓名
|
||||
practitioner.setGenderEnum(sex==null? AdministrativeGender.UNKNOWN.getValue() : Integer.parseInt(sex)); // 性别
|
||||
practitioner.setGenderEnum(sex == null ? AdministrativeGender.UNKNOWN.getValue() : Integer.parseInt(sex)); // 性别
|
||||
practitioner.setBirthDate(userAndPractitionerDto.getBirthDate()); // 出生日期
|
||||
practitioner.setPhone(phonenumber); // 电话
|
||||
practitioner.setAddress(userAndPractitionerDto.getAddress()); // 地址
|
||||
@@ -306,7 +312,7 @@ public class PractitionerAppServiceImpl implements IPractitionerAppService {
|
||||
Practitioner practitioner = new Practitioner();
|
||||
practitioner.setId(practitionerId);
|
||||
practitioner.setName(nickName); // 姓名
|
||||
practitioner.setGenderEnum(sex==null? AdministrativeGender.UNKNOWN.getValue() : Integer.parseInt(sex)); // 性别
|
||||
practitioner.setGenderEnum(sex == null ? AdministrativeGender.UNKNOWN.getValue() : Integer.parseInt(sex)); // 性别
|
||||
practitioner.setBirthDate(userAndPractitionerDto.getBirthDate()); // 出生日期
|
||||
practitioner.setPhone(phonenumber); // 电话
|
||||
practitioner.setAddress(userAndPractitionerDto.getAddress()); // 地址
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,6 @@ import java.util.stream.Stream;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.openhis.yb.service.YbManager;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -21,6 +20,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.AssignSeqUtil;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.core.common.utils.StringUtils;
|
||||
@@ -32,12 +32,14 @@ import com.openhis.administration.service.IHealthcareServiceService;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.AccountStatus;
|
||||
import com.openhis.common.enums.AssignSeqEnum;
|
||||
import com.openhis.common.enums.PublicationStatus;
|
||||
import com.openhis.common.enums.Whether;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.web.basicservice.dto.*;
|
||||
import com.openhis.web.basicservice.mapper.HealthcareServiceBizMapper;
|
||||
import com.openhis.yb.service.YbManager;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -58,6 +60,8 @@ public class HealthcareServiceController {
|
||||
|
||||
private final YbManager ybService;
|
||||
|
||||
private final AssignSeqUtil assignSeqUtil;
|
||||
|
||||
/**
|
||||
* 服务管理基础数据初始化
|
||||
*/
|
||||
@@ -92,6 +96,7 @@ public class HealthcareServiceController {
|
||||
// 服务管理-新增
|
||||
HealthcareService healthcareService = new HealthcareService();
|
||||
BeanUtils.copyProperties(healthcareServiceFormData, healthcareService);
|
||||
// healthcareService.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.HEALTHCARE_SERVICE_NO.getPrefix(), 8));
|
||||
HealthcareService healthcareServiceAfterAdd = iHealthcareServiceService.addHealthcareService(healthcareService);
|
||||
// 同时保存费用定价
|
||||
ChargeItemDefinition chargeItemDefinition = new ChargeItemDefinition();
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -3,14 +3,14 @@
|
||||
*/
|
||||
package com.openhis.web.chargemanage.appservice;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.chargemanage.dto.EncounterPatientPageParam;
|
||||
import com.openhis.web.chargemanage.dto.EncounterPatientPrescriptionDto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 门诊收费 service
|
||||
*
|
||||
@@ -62,4 +62,20 @@ public interface IOutpatientChargeAppService {
|
||||
* @return 初始化信息
|
||||
*/
|
||||
R<?> outpatientChargeInit();
|
||||
|
||||
/**
|
||||
* 学生医保转自费
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 结果
|
||||
*/
|
||||
R<?> changeToStudentSelfPay(Long encounterId);
|
||||
|
||||
/**
|
||||
* 学生自费转学生医保
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 结果
|
||||
*/
|
||||
R<?> changeToStudentYbPay(Long encounterId);
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ public class InpatientChargeAppServiceImpl implements IInpatientChargeAppService
|
||||
encounterPatientPageParam, searchKey,
|
||||
new HashSet<>(Arrays.asList(CommonConstants.FieldName.PatientWbStr, CommonConstants.FieldName.PatientPyStr,
|
||||
CommonConstants.FieldName.PatientName, CommonConstants.FieldName.PatientBusNo,
|
||||
CommonConstants.FieldName.EncounterBusNo, CommonConstants.FieldName.idCard)),
|
||||
CommonConstants.FieldName.EncounterBusNo, CommonConstants.FieldName.IdCard)),
|
||||
request);
|
||||
// 就诊患者分页列表
|
||||
Page<EncounterPatientPageDto> encounterPatientPage = inpatientChargeAppMapper
|
||||
|
||||
@@ -88,7 +88,7 @@ public class OutpatientChargeAppServiceImpl implements IOutpatientChargeAppServi
|
||||
encounterPatientPageParam, searchKey,
|
||||
new HashSet<>(Arrays.asList(CommonConstants.FieldName.PatientWbStr, CommonConstants.FieldName.PatientPyStr,
|
||||
CommonConstants.FieldName.PatientName, CommonConstants.FieldName.PatientBusNo,
|
||||
CommonConstants.FieldName.EncounterBusNo, CommonConstants.FieldName.idCard)),
|
||||
CommonConstants.FieldName.EncounterBusNo, CommonConstants.FieldName.IdCard)),
|
||||
request);
|
||||
// 就诊患者分页列表
|
||||
Page<EncounterPatientPageDto> encounterPatientPage = outpatientChargeAppMapper
|
||||
@@ -126,6 +126,7 @@ public class OutpatientChargeAppServiceImpl implements IOutpatientChargeAppServi
|
||||
});
|
||||
return prescriptionDtoList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 医保转自费
|
||||
*
|
||||
@@ -167,4 +168,46 @@ public class OutpatientChargeAppServiceImpl implements IOutpatientChargeAppServi
|
||||
}
|
||||
return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 学生医保转学生自费
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> changeToStudentSelfPay(Long encounterId) {
|
||||
// 获取就诊患者的学生自费账户id
|
||||
Long accountId = accountService.getStudentSelfAccount(encounterId);
|
||||
if (accountId == null) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00008, new Object[] {"医保账户"}));
|
||||
}
|
||||
// 自费转医保
|
||||
boolean result = chargeItemService.updateAccountType(encounterId, accountId);
|
||||
if (!result) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00009, null));
|
||||
}
|
||||
return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 学生自费转学生医保
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> changeToStudentYbPay(Long encounterId) {
|
||||
// 获取就诊患者的学生医保账户id
|
||||
Long accountId = accountService.getStudentYbAccount(encounterId);
|
||||
if (accountId == null) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00008, new Object[] {"医保账户"}));
|
||||
}
|
||||
// 自费转医保
|
||||
boolean result = chargeItemService.updateAccountType(encounterId, accountId);
|
||||
if (!result) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00009, null));
|
||||
}
|
||||
return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,15 +4,12 @@
|
||||
package com.openhis.web.chargemanage.appservice.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
@@ -55,23 +52,23 @@ import com.openhis.workflow.service.IServiceRequestService;
|
||||
@Service
|
||||
public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppService {
|
||||
|
||||
@Autowired
|
||||
@Resource
|
||||
private OutpatientRefundAppMapper outpatientRefundAppMapper;
|
||||
@Autowired
|
||||
@Resource
|
||||
private IPaymentReconciliationService paymentReconciliationService;
|
||||
@Autowired
|
||||
@Resource
|
||||
private IChargeItemService chargeItemService;
|
||||
@Autowired
|
||||
@Resource
|
||||
private IMedicationDispenseService medicationDispenseService;
|
||||
@Autowired
|
||||
@Resource
|
||||
private IDeviceDispenseService deviceDispenseService;
|
||||
@Autowired
|
||||
@Resource
|
||||
private IServiceRequestService serviceRequestService;
|
||||
@Autowired
|
||||
@Resource
|
||||
private IMedicationRequestService medicationRequestService;
|
||||
@Autowired
|
||||
@Resource
|
||||
private IDeviceRequestService deviceRequestService;
|
||||
@Autowired
|
||||
@Resource
|
||||
private AssignSeqUtil assignSeqUtil;
|
||||
|
||||
/**
|
||||
@@ -110,8 +107,8 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi
|
||||
PaymentStatus.REFUND_PART.getValue(), PaymentStatus.REFUND_ALL.getValue());
|
||||
|
||||
// 获取付款id集合
|
||||
List<Long> paymentIdList =
|
||||
encounterPatientPaymentList.stream().map(EncounterPatientPaymentDto::getId).collect(Collectors.toList());
|
||||
List<Long> paymentIdList = encounterPatientPaymentList.stream().map(EncounterPatientPaymentDto::getPaymentId)
|
||||
.collect(Collectors.toList());
|
||||
if (paymentIdList.isEmpty()) {
|
||||
return R.ok(null);
|
||||
}
|
||||
@@ -131,7 +128,7 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi
|
||||
e.setServiceStatus_enumText(EnumUtils.getInfoByValue(RequestStatus.class, e.getServiceStatus()));
|
||||
|
||||
});
|
||||
|
||||
refundItemList.sort(Comparator.comparing(RefundItemDto::getPaymentId));
|
||||
return R.ok(refundItemList);
|
||||
}
|
||||
|
||||
@@ -162,22 +159,22 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi
|
||||
CommonConstants.TableName.MED_MEDICATION_REQUEST, CommonConstants.TableName.WOR_SERVICE_REQUEST,
|
||||
CommonConstants.TableName.WOR_DEVICE_REQUEST, CommonConstants.Common.THREE);
|
||||
|
||||
for (RefundItemDto creatdDto : creatChargeItemList) {
|
||||
for (RefundItemDto createDto : creatChargeItemList) {
|
||||
|
||||
// 未退费用项,生成新的请求,发放,费用项
|
||||
if (CommonConstants.TableName.MED_MEDICATION_REQUEST.equals(creatdDto.getServiceTable())) {
|
||||
if (CommonConstants.TableName.MED_MEDICATION_REQUEST.equals(createDto.getServiceTable())) {
|
||||
// 药品请求查询
|
||||
MedicationRequest medicationRequest = medicationRequestService.getById(creatdDto.getRequestId());
|
||||
MedicationRequest medicationRequest = medicationRequestService.getById(createDto.getRequestId());
|
||||
// 生成新的药品请求
|
||||
medicationRequest.setId(null); // 药品请求id
|
||||
medicationRequest
|
||||
.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.MEDICATION_RES_NO.getPrefix(), 4)); // 药品请求编码
|
||||
medicationRequest.setPrescriptionNo(String.valueOf("C" + creatdDto.getPrescriptionNo())); // 处方号
|
||||
medicationRequest.setPrescriptionNo(String.valueOf("C" + createDto.getPrescriptionNo())); // 处方号
|
||||
medicationRequestService.save(medicationRequest);
|
||||
|
||||
// 药品发放查询
|
||||
MedicationDispense medicationDispense =
|
||||
medicationDispenseService.getById(creatdDto.getDispenseId());
|
||||
medicationDispenseService.getById(createDto.getDispenseId());
|
||||
// 生成新的药品发放
|
||||
medicationDispense.setId(null); // 药品发放id
|
||||
medicationDispense
|
||||
@@ -186,26 +183,26 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi
|
||||
medicationDispenseService.save(medicationDispense);
|
||||
|
||||
// 费用项查询
|
||||
ChargeItem chargeItem = chargeItemService.getById(creatdDto.getChargeItemId());
|
||||
ChargeItem chargeItem = chargeItemService.getById(createDto.getChargeItemId());
|
||||
// 生成新的费用项
|
||||
chargeItem.setRefundId(chargeItem.getId());// 退费id
|
||||
chargeItem.setId(null); // 费用项id
|
||||
chargeItem.setBusNo(AssignSeqEnum.CHARGE_ITEM_NO.getPrefix().concat(medicationRequest.getBusNo())); // 编码
|
||||
chargeItem.setPrescriptionNo(String.valueOf("C" + creatdDto.getPrescriptionNo())); // 处方号
|
||||
chargeItem.setPrescriptionNo(String.valueOf("C" + createDto.getPrescriptionNo())); // 处方号
|
||||
chargeItem.setServiceId(medicationRequest.getId()); // 医疗服务ID
|
||||
chargeItem.setStatusEnum(ChargeItemStatus.PLANNED.getValue());// 收费单状态:待收费
|
||||
chargeItemService.save(chargeItem);
|
||||
|
||||
} else if (CommonConstants.TableName.WOR_SERVICE_REQUEST.equals(creatdDto.getServiceTable())) {
|
||||
} else if (CommonConstants.TableName.WOR_SERVICE_REQUEST.equals(createDto.getServiceTable())) {
|
||||
// 服务请求查询
|
||||
ServiceRequest serviceRequest = serviceRequestService.getById(creatdDto.getRequestId());
|
||||
ServiceRequest serviceRequest = serviceRequestService.getById(createDto.getRequestId());
|
||||
// 生成新的服务请求
|
||||
serviceRequest.setId(null); // 服务请求id
|
||||
serviceRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.SERVICE_RES_NO.getPrefix(), 4)); // 服务请求编码
|
||||
serviceRequestService.save(serviceRequest);
|
||||
|
||||
// 费用项查询
|
||||
ChargeItem chargeItem = chargeItemService.getById(creatdDto.getChargeItemId());
|
||||
ChargeItem chargeItem = chargeItemService.getById(createDto.getChargeItemId());
|
||||
// 生成新的费用项
|
||||
chargeItem.setRefundId(chargeItem.getId());// 退费id
|
||||
chargeItem.setId(null); // 费用项id
|
||||
@@ -214,16 +211,16 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi
|
||||
chargeItem.setStatusEnum(ChargeItemStatus.PLANNED.getValue());// 收费单状态:待收费
|
||||
chargeItemService.save(chargeItem);
|
||||
|
||||
} else if (CommonConstants.TableName.WOR_DEVICE_REQUEST.equals(creatdDto.getServiceTable())) {
|
||||
} else if (CommonConstants.TableName.WOR_DEVICE_REQUEST.equals(createDto.getServiceTable())) {
|
||||
// 耗材请求查询
|
||||
DeviceRequest deviceRequest = deviceRequestService.getById(creatdDto.getRequestId());
|
||||
DeviceRequest deviceRequest = deviceRequestService.getById(createDto.getRequestId());
|
||||
// 生成新的耗材请求
|
||||
deviceRequest.setId(null); // 耗材请求id
|
||||
deviceRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEVICE_RES_NO.getPrefix(), 4)); // 耗材请求编码
|
||||
deviceRequestService.save(deviceRequest);
|
||||
|
||||
// 耗材发放查询
|
||||
DeviceDispense deviceDispense = deviceDispenseService.getById(creatdDto.getDispenseId());
|
||||
DeviceDispense deviceDispense = deviceDispenseService.getById(createDto.getDispenseId());
|
||||
// 生成新的耗材发放
|
||||
deviceDispense.setId(null); // 耗材id
|
||||
deviceDispense.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEVICE_DIS_NO.getPrefix(), 4)); // 器材发放id
|
||||
@@ -231,7 +228,7 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi
|
||||
deviceDispenseService.save(deviceDispense);
|
||||
|
||||
// 费用项查询
|
||||
ChargeItem chargeItem = chargeItemService.getById(creatdDto.getChargeItemId());
|
||||
ChargeItem chargeItem = chargeItemService.getById(createDto.getChargeItemId());
|
||||
// 生成新的费用项
|
||||
chargeItem.setRefundId(chargeItem.getId());// 退费id
|
||||
chargeItem.setId(null); // 费用项id
|
||||
@@ -372,7 +369,7 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi
|
||||
encounterPatientPageParam, searchKey,
|
||||
new HashSet<>(Arrays.asList(CommonConstants.FieldName.PatientWbStr, CommonConstants.FieldName.PatientPyStr,
|
||||
CommonConstants.FieldName.PatientName, CommonConstants.FieldName.PatientBusNo,
|
||||
CommonConstants.FieldName.EncounterBusNo, CommonConstants.FieldName.idCard)),
|
||||
CommonConstants.FieldName.EncounterBusNo, CommonConstants.FieldName.IdCard)),
|
||||
request);
|
||||
// 就诊患者分页列表
|
||||
Page<EncounterPatientPageDto> encounterPatientPage = outpatientRefundAppMapper.selectBilledEncounterPatientPage(
|
||||
|
||||
@@ -91,17 +91,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,10 +130,11 @@ public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistra
|
||||
e.setFirstEnum_enumText(patientIdList.contains(e.getId()) ? EncounterType.FOLLOW_UP.getInfo()
|
||||
: EncounterType.INITIAL.getInfo());
|
||||
// 患者标识
|
||||
PatientIdentifier patientIdentifier = patientIdentifierService
|
||||
.getOne(new LambdaQueryWrapper<PatientIdentifier>().eq(PatientIdentifier::getPatientId, e.getId()));
|
||||
if (patientIdentifier != null) {
|
||||
e.setIdentifierNo(patientIdentifier.getIdentifierNo());
|
||||
List<PatientIdentifier> patientIdentifiers = patientIdentifierService
|
||||
.list(new LambdaQueryWrapper<PatientIdentifier>().eq(PatientIdentifier::getPatientId, e.getId()));
|
||||
if (patientIdentifiers != null && !patientIdentifiers.isEmpty()) {
|
||||
// 取第一个标识号,如果需要可以根据业务需求选择其他逻辑
|
||||
e.setIdentifierNo(patientIdentifiers.get(0).getIdentifierNo());
|
||||
}
|
||||
|
||||
});
|
||||
@@ -267,9 +278,27 @@ 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(), ParticipantType.ADMITTER.getCode(),
|
||||
queryWrapper, ChargeItemContext.REGISTER.getValue(), PaymentStatus.SUCCESS.getValue());
|
||||
new Page<>(pageNo, pageSize), EncounterClass.AMB.getValue(), EncounterStatus.IN_PROGRESS.getValue(),
|
||||
ParticipantType.ADMITTER.getCode(), ParticipantType.REGISTRATION_DOCTOR.getCode(), queryWrapper,
|
||||
ChargeItemContext.REGISTER.getValue(), PaymentStatus.SUCCESS.getValue());
|
||||
currentDayEncounter.getRecords().forEach(e -> {
|
||||
// 性别
|
||||
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
*/
|
||||
package com.openhis.web.chargemanage.controller;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -27,7 +28,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@AllArgsConstructor
|
||||
public class OutpatientChargeController {
|
||||
|
||||
@Autowired
|
||||
@Resource
|
||||
private IOutpatientChargeAppService outpatientChargeAppService;
|
||||
|
||||
/**
|
||||
@@ -91,4 +92,26 @@ public class OutpatientChargeController {
|
||||
public R<?> changeToMedicalInsurance(@RequestParam Long encounterId) {
|
||||
return outpatientChargeAppService.changeToMedicalInsurance(encounterId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 医保转自费
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PutMapping("/student-self-pay")
|
||||
public R<?> changeToStudentSelfPay(@RequestParam Long encounterId) {
|
||||
return outpatientChargeAppService.changeToStudentSelfPay(encounterId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 自费转医保
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PutMapping("/student-yb-pay")
|
||||
public R<?> changeToStudentYbPay(@RequestParam Long encounterId) {
|
||||
return outpatientChargeAppService.changeToStudentYbPay(encounterId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ package com.openhis.web.chargemanage.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -30,7 +31,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@AllArgsConstructor
|
||||
public class OutpatientRefundController {
|
||||
|
||||
@Autowired
|
||||
@Resource
|
||||
private IOutpatientRefundAppService outpatientRefundAppService;
|
||||
|
||||
/**
|
||||
|
||||
@@ -130,5 +130,44 @@ public class CurrentDayEncounterDto {
|
||||
* 生日
|
||||
*/
|
||||
private Date birthDate;
|
||||
/**
|
||||
* 电话
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 退号日期/时间
|
||||
*/
|
||||
private Date returnDate;
|
||||
|
||||
/**
|
||||
* 退号原因
|
||||
*/
|
||||
private String returnReason;
|
||||
|
||||
/**
|
||||
* 退号操作人
|
||||
*/
|
||||
private String operatorName;
|
||||
|
||||
/**
|
||||
* 退号操作工号(用户账号)
|
||||
*/
|
||||
private String operatorId;
|
||||
|
||||
/**
|
||||
* 退款金额
|
||||
*/
|
||||
private BigDecimal refundAmount;
|
||||
|
||||
/**
|
||||
* 合同编码(费用性质代码)
|
||||
*/
|
||||
private String contractNo;
|
||||
|
||||
/**
|
||||
* 退款方式(多个支付方式用逗号分隔)
|
||||
*/
|
||||
private String refundMethod;
|
||||
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ package com.openhis.web.chargemanage.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
@@ -29,7 +28,7 @@ public class EncounterPatientPaymentDto {
|
||||
/** ID */
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
private Long paymentId;
|
||||
|
||||
/** 就诊ID */
|
||||
private Long encounterId;
|
||||
|
||||
@@ -92,7 +92,17 @@ public class EncounterPatientPrescriptionDto {
|
||||
@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;
|
||||
|
||||
@@ -109,4 +119,8 @@ public class EncounterPatientPrescriptionDto {
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long serviceId;
|
||||
|
||||
/** 付款id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long paymentId;
|
||||
|
||||
}
|
||||
|
||||
@@ -81,5 +81,11 @@ public class RefundItemDto {
|
||||
|
||||
/** 项目名 */
|
||||
private String itemName;
|
||||
|
||||
/** 费用支付方式编码 */
|
||||
private String medfeePaymtdCode;
|
||||
|
||||
/** 费用类型 */
|
||||
private String feeType;
|
||||
|
||||
}
|
||||
|
||||
@@ -36,14 +36,17 @@ public interface OutpatientRegistrationAppMapper {
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param classEnum 就诊类型
|
||||
* @param participantType 参与者类型
|
||||
* @param statusEnum 门诊就诊状态 | 在诊
|
||||
* @param participantType1 参与者类型 | 接诊医生
|
||||
* @param participantType2 参与者类型 | 挂号医生
|
||||
* @param queryWrapper 查询条件
|
||||
* @param register 收费项目类型:挂号
|
||||
* @param paymentStatus 支付状态:成功
|
||||
* @return 当日就诊数据
|
||||
*/
|
||||
IPage<CurrentDayEncounterDto> getCurrentDayEncounter(@Param("page") Page<CurrentDayEncounterDto> page,
|
||||
@Param("classEnum") Integer classEnum, @Param("participantType") String participantType,
|
||||
@Param("classEnum") Integer classEnum, @Param("statusEnum") Integer statusEnum,
|
||||
@Param("participantType1") String participantType1, @Param("participantType2") String participantType2,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<CurrentDayEncounterDto> queryWrapper,
|
||||
@Param("register") Integer register, @Param("paymentStatus") Integer paymentStatus);
|
||||
|
||||
|
||||
@@ -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 {
|
||||
}
|
||||
@@ -166,4 +166,26 @@ public interface ICommonService {
|
||||
* @return 医嘱打印单
|
||||
*/
|
||||
R<?> getAdvicePrintInfo(List<Long> requestIds, String isPrescription);
|
||||
|
||||
/**
|
||||
* 查询参与者签名
|
||||
*
|
||||
* @param practitionerId 参与者id
|
||||
* @return 参与者签名
|
||||
*/
|
||||
R<?> getPractitionerSignature(Long practitionerId);
|
||||
|
||||
/**
|
||||
* 查询所有供应商
|
||||
*
|
||||
* @return 供应商
|
||||
*/
|
||||
R<?> getSupplierList();
|
||||
|
||||
/**
|
||||
* 查询所有诊疗项目
|
||||
*
|
||||
* @return 诊疗项目
|
||||
*/
|
||||
R<?> getActivityDefinition();
|
||||
}
|
||||
|
||||
@@ -8,6 +8,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;
|
||||
@@ -21,11 +22,13 @@ import com.core.common.utils.StringUtils;
|
||||
import com.core.common.utils.bean.BeanUtils;
|
||||
import com.openhis.administration.domain.Location;
|
||||
import com.openhis.administration.domain.Organization;
|
||||
import com.openhis.administration.domain.Supplier;
|
||||
import com.openhis.administration.domain.TraceNoManage;
|
||||
import com.openhis.administration.mapper.TraceNoManageMapper;
|
||||
import com.openhis.administration.service.ILocationService;
|
||||
import com.openhis.administration.service.IOrganizationService;
|
||||
import com.openhis.administration.service.IPractitionerRoleService;
|
||||
import com.openhis.administration.service.ISupplierService;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.enums.*;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
@@ -64,11 +67,14 @@ public class CommonServiceImpl implements ICommonService {
|
||||
private IOrganizationService organizationService;
|
||||
|
||||
@Resource
|
||||
private IInventoryItemService iInventoryItemService;
|
||||
private IInventoryItemService inventoryItemService;
|
||||
|
||||
@Resource
|
||||
private ContractMapper contractMapper;
|
||||
|
||||
@Resource
|
||||
private ISupplierService supplierService;
|
||||
|
||||
/**
|
||||
* 获取药房列表
|
||||
*
|
||||
@@ -78,6 +84,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) {
|
||||
@@ -85,6 +92,8 @@ public class CommonServiceImpl implements ICommonService {
|
||||
BeanUtils.copyProperties(location, locationDto);
|
||||
locationDtoList.add(locationDto);
|
||||
}
|
||||
|
||||
|
||||
return locationDtoList;
|
||||
}
|
||||
|
||||
@@ -278,11 +287,10 @@ public class CommonServiceImpl implements ICommonService {
|
||||
|
||||
// 医保编码和生产厂家校验
|
||||
for (LocationInventoryDto dto : locationInventoryDtoList) {
|
||||
if (StringUtils.isNotEmpty(dto.getYbNo()) && StringUtils.isEmpty(dto.getManufacturer())) {
|
||||
if (StringUtils.isNotEmpty(dto.getYbNo()) && StringUtils.isEmpty(dto.getManufacturerText())) {
|
||||
return R.fail("生产厂家不能为空,请到药品目录维护");
|
||||
}
|
||||
}
|
||||
|
||||
return R.ok(locationInventoryDtoList);
|
||||
}
|
||||
|
||||
@@ -318,7 +326,7 @@ public class CommonServiceImpl implements ICommonService {
|
||||
for (String traceNo : traceNoList) {
|
||||
if (traceNo != null && !StringUtils.isEmpty(traceNo)) {
|
||||
// 数据源更改
|
||||
InventoryItem inventoryItem = iInventoryItemService.getOne(
|
||||
InventoryItem inventoryItem = inventoryItemService.getOne(
|
||||
new LambdaQueryWrapper<InventoryItem>().like(InventoryItem::getTraceNo, traceNo).last("LIMIT 1"));
|
||||
if (inventoryItem != null) {
|
||||
String itemId = inventoryItem.getItemId().toString();
|
||||
@@ -491,4 +499,37 @@ public class CommonServiceImpl implements ICommonService {
|
||||
return R.ok(advicePrintInfoDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询参与者签名
|
||||
*
|
||||
* @param practitionerId 参与者id
|
||||
* @return 参与者签名
|
||||
*/
|
||||
@Override
|
||||
public R<?> getPractitionerSignature(Long practitionerId) {
|
||||
return R.ok(commonAppMapper.getPractitionerSignature(practitionerId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有供应商
|
||||
*
|
||||
* @return 供应商
|
||||
*/
|
||||
@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())));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有诊疗项目
|
||||
*
|
||||
* @return 诊疗项目
|
||||
*/
|
||||
@Override
|
||||
public R<?> getActivityDefinition() {
|
||||
return R.ok(commonAppMapper.getActivityDefinition(PublicationStatus.ACTIVE.getValue()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,8 +7,6 @@ import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import com.openhis.common.enums.Whether;
|
||||
import com.openhis.web.common.dto.AdvicePrintInfoDto;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
@@ -91,7 +89,7 @@ public class CommonAppController {
|
||||
/**
|
||||
* 病区列表
|
||||
*
|
||||
* @return 病区列表
|
||||
* @return 病区列表
|
||||
*/
|
||||
@GetMapping(value = "/ward-list")
|
||||
public R<?> getWardList(@RequestParam(value = "orgId", required = false) Long orgId) {
|
||||
@@ -105,7 +103,7 @@ public class CommonAppController {
|
||||
*/
|
||||
@GetMapping(value = "/department-list")
|
||||
public R<?> getDepartmentList() {
|
||||
return commonService.getDepartmentList();
|
||||
return commonService.getDepartmentList();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -221,7 +219,38 @@ public class CommonAppController {
|
||||
*/
|
||||
@GetMapping("/advice-print")
|
||||
public R<?> getAdvicePrintInfo(@RequestParam(value = "requestIds") List<Long> requestIds, String isPrescription) {
|
||||
return commonService.getAdvicePrintInfo(requestIds,isPrescription);
|
||||
return commonService.getAdvicePrintInfo(requestIds, isPrescription);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询参与者签名
|
||||
*
|
||||
* @param practitionerId 参与者id
|
||||
* @return 参与者签名
|
||||
*/
|
||||
@GetMapping(value = "/practitioner-signature")
|
||||
public R<?> getPractitionerSignature(@RequestParam(value = "practitionerId") Long practitionerId) {
|
||||
return commonService.getPractitionerSignature(practitionerId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有供应商
|
||||
*
|
||||
* @return 供应商
|
||||
*/
|
||||
@GetMapping(value = "/supplier")
|
||||
public R<?> getSupplierList() {
|
||||
return commonService.getSupplierList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有诊疗项目
|
||||
*
|
||||
* @return 诊疗项目
|
||||
*/
|
||||
@GetMapping(value = "/activity-definition")
|
||||
public R<?> getActivityDefinition() {
|
||||
return commonService.getActivityDefinition();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.common.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 诊疗项目dto
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-04-01
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ActivityDefinitionDto {
|
||||
|
||||
/** 项目定义ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long activityDefinitionId;
|
||||
|
||||
/** 项目名称 */
|
||||
private String activityDefinitionName;
|
||||
|
||||
}
|
||||
@@ -87,7 +87,7 @@ public class InventoryItemDto {
|
||||
/**
|
||||
* 生产厂家
|
||||
*/
|
||||
private String manufacturer;
|
||||
private String manufacturerText;
|
||||
|
||||
/**
|
||||
* 项目对应表名
|
||||
|
||||
@@ -75,6 +75,6 @@ public class LocationInventoryDto {
|
||||
private String ybNo;
|
||||
|
||||
/** 生产厂家 */
|
||||
private String manufacturer;
|
||||
private String manufacturerText;
|
||||
|
||||
}
|
||||
|
||||
@@ -26,24 +26,13 @@ public class PerformInfoDto {
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long requestId;
|
||||
|
||||
/** 住院id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterId;
|
||||
|
||||
/** 发放id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long dispenseId;
|
||||
|
||||
/** 执行id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long procedureId;
|
||||
|
||||
/** 请求所在表 */
|
||||
private String requestTable;
|
||||
|
||||
/** 执行时间列表 */
|
||||
private List<String> executeTimes;
|
||||
|
||||
/** 执行位置 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long locationId;
|
||||
@@ -51,10 +40,4 @@ public class PerformInfoDto {
|
||||
/** 分组id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long groupId;
|
||||
|
||||
/** 执行开始时间 */
|
||||
private Date exeStartTime;
|
||||
|
||||
/** 执行结束时间 */
|
||||
private Date exeEndTime;
|
||||
}
|
||||
|
||||
@@ -88,4 +88,20 @@ public interface CommonAppMapper {
|
||||
* @return 处置打印信息
|
||||
*/
|
||||
AdvicePrintInfoDto selectTreatmentPrintInfo(@Param("requestIds") List<Long> requestIds);
|
||||
|
||||
/**
|
||||
* 查询参与者签名
|
||||
*
|
||||
* @param practitionerId 参与者id
|
||||
* @return 参与者签名
|
||||
*/
|
||||
String getPractitionerSignature(@Param("practitionerId") Long practitionerId);
|
||||
|
||||
/**
|
||||
* 查询所有诊疗项目
|
||||
*
|
||||
* @param statusEnum 启用状态
|
||||
* @return 诊疗项目
|
||||
*/
|
||||
List<ActivityDefinitionDto> getActivityDefinition(@Param("statusEnum") Integer statusEnum);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.openhis.web.datadictionary.appservice;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.datadictionary.dto.ICDCodeAddDto;
|
||||
import com.openhis.web.datadictionary.dto.ICDCodeUpdateDto;
|
||||
|
||||
public interface ICDCodeService {
|
||||
/**
|
||||
* 分页查询icd10编码
|
||||
*
|
||||
* @param searchKey
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
R<?> getICDCodePage(String searchKey, Integer pageNo, Integer pageSize);
|
||||
|
||||
/**
|
||||
* 新增icd10编码
|
||||
* @param icdCodeAddDto
|
||||
* @return
|
||||
*/
|
||||
R<?> addICDInformation(ICDCodeAddDto icdCodeAddDto);
|
||||
|
||||
/**
|
||||
* 删除icd10编码
|
||||
* @param glNo
|
||||
* @return
|
||||
*/
|
||||
R<?> deleteICDInformation(String glNo);
|
||||
|
||||
/**
|
||||
* 修改icd10编码
|
||||
* @param icdCodeUpdateDto
|
||||
* @return
|
||||
*/
|
||||
R<?> saveOrUpdateICDInformation(ICDCodeUpdateDto icdCodeUpdateDto);
|
||||
}
|
||||
@@ -95,4 +95,12 @@ public interface IDeviceManageAppService {
|
||||
* @param response 响应
|
||||
*/
|
||||
void importTemplate(HttpServletResponse response);
|
||||
|
||||
/**
|
||||
* 校验耗材是否可以编辑
|
||||
*
|
||||
* @param deviceId 耗材ID
|
||||
* @return 校验结果
|
||||
*/
|
||||
R<?> validateDeviceEdit(Long deviceId);
|
||||
}
|
||||
|
||||
@@ -92,4 +92,12 @@ public interface IDiagTreatMAppService {
|
||||
* @param response 响应
|
||||
*/
|
||||
void importTemplate(HttpServletResponse response);
|
||||
|
||||
/**
|
||||
* 校验诊疗项目是否可以编辑
|
||||
*
|
||||
* @param activityId 诊疗ID
|
||||
* @return 校验结果
|
||||
*/
|
||||
R<?> validateActivityEdit(Long activityId);
|
||||
}
|
||||
@@ -97,4 +97,12 @@ public interface IMedicationManageAppService {
|
||||
* @param response 响应
|
||||
*/
|
||||
void importTemplate(HttpServletResponse response);
|
||||
|
||||
/**
|
||||
* 校验药品是否可以编辑
|
||||
*
|
||||
* @param medicationId 药品ID
|
||||
* @return 校验结果
|
||||
*/
|
||||
R<?> validateMedicationEdit(Long medicationId);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user