Compare commits
14 Commits
b863c14f2b
...
V1.3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec14d2f2c4 | ||
|
|
c0cb659d7a | ||
|
|
151a68d144 | ||
|
|
2f581b34ba | ||
|
|
80a156c146 | ||
|
|
180abe6753 | ||
|
|
9ea7d46df0 | ||
|
|
8cfbb56fb0 | ||
|
|
0c0d812ff9 | ||
|
|
82716b2cdd | ||
|
|
1b04cf670f | ||
|
|
7895f4cecd | ||
|
|
e8d67e6681 | ||
|
|
88535b8e7c |
76
.github/copilot-instructions.md
vendored
76
.github/copilot-instructions.md
vendored
@@ -1,76 +0,0 @@
|
|||||||
# 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 包说明)展开,请告诉我要增强哪一节。
|
|
||||||
68467
20251224init脚本(使用Navicat Premium 17导入).sql
Normal file
68467
20251224init脚本(使用Navicat Premium 17导入).sql
Normal file
File diff suppressed because one or more lines are too long
@@ -4,11 +4,11 @@
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
天天开源致⼒于打造中国应⽤管理 软件开源⽣态,⾯向医疗、企业、教育三⼤⾏业信息化需求,提供优质的开源软件产品与解决⽅案。平台现已发布OpenHIS、OpenCOM、OpenEDU系列开源产品,并持续招募⽣态合作伙伴,期待共同构建开源创新的⾏业协作模式,加速⾏业的数字化进程。
|
天天开源致⼒于打造中国应⽤管理软件开源⽣态,⾯向医疗、企业、教育三⼤⾏业信息化需求,提供优质的开源软件产品与解决⽅案。平台现已发布OpenHIS、OpenCOM、OpenEDU系列开源产品,并持续招募⽣态合作伙伴,期待共同构建开源创新的⾏业协作模式,加速⾏业的数字化进程。
|
||||||
|
|
||||||
天天开源的前⾝是新致开源,最早于2022年6⽉发布开源医疗软件平台OpenHIS.org.cn,于2023年6⽉发布开源企业软件平台OpenCOM.com.cn。2025年7⽉,新致开源品牌更新为天天开源,我们始终秉持开源、专业、协作的理念,致⼒于为医疗、教育、中⼩企业等⾏业提供优质的开源解决⽅案。
|
天天开源的前⾝是新致开源,最早于2022年6⽉发布开源医疗软件平台OpenHIS.org.cn,于2023年6⽉发布开源企业软件平台OpenCOM.com.cn。2025年7⽉,新致开源品牌更新为天天开源,我们始终秉持开源、专业、协作的理念,致⼒于为医疗、教育、中⼩企业等⾏业提供优质的开源解决⽅案。
|
||||||
|
|
||||||
了解我们a:https://open.tntlinking.com/about?site=gitee
|
了解我们:https://open.tntlinking.com/about?site=gitee
|
||||||
|
|
||||||
## 💾【部署包下载】
|
## 💾【部署包下载】
|
||||||
|
|
||||||
@@ -16,10 +16,10 @@
|
|||||||
|
|
||||||
## 📚【支持文档】
|
## 📚【支持文档】
|
||||||
|
|
||||||
技术支持资源:https://open.tntlinking.com/resource/openProductDoc?site=gitee
|
技术支持资源:https://open.tntlinking.com/resource/technicalSupport?site=gitee
|
||||||
(含演示环境、操作手册、部署手册、开发手册、常见问题等)
|
(含演示环境、操作手册、部署手册、开发手册、常见问题等)
|
||||||
|
|
||||||
产品介绍:https://open.tntlinking.com/resource/productPresentation?site=gitee
|
产品介绍:https://open.tntlinking.com/resource/industryKnowledge?site=gitee
|
||||||
|
|
||||||
操作教程:https://open.tntlinking.com/resource/operationTutorial?site=gitee
|
操作教程:https://open.tntlinking.com/resource/operationTutorial?site=gitee
|
||||||
|
|
||||||
|
|||||||
@@ -1,39 +0,0 @@
|
|||||||
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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
-- 向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;
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -36,11 +36,13 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.swagger</groupId>
|
<groupId>io.swagger</groupId>
|
||||||
<artifactId>swagger-models</artifactId>
|
<artifactId>swagger-models</artifactId>
|
||||||
|
<version>1.6.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Mysql驱动包 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.mysql</groupId>
|
<groupId>mysql</groupId>
|
||||||
<artifactId>mysql-connector-j</artifactId>
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 核心模块-->
|
<!-- 核心模块-->
|
||||||
|
|||||||
@@ -77,10 +77,6 @@
|
|||||||
<groupId>com.alibaba.fastjson2</groupId>
|
<groupId>com.alibaba.fastjson2</groupId>
|
||||||
<artifactId>fastjson2</artifactId>
|
<artifactId>fastjson2</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>com.alibaba</groupId>
|
|
||||||
<artifactId>fastjson</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- io常用工具类 -->
|
<!-- io常用工具类 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -140,6 +136,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.belerweb</groupId>
|
<groupId>com.belerweb</groupId>
|
||||||
<artifactId>pinyin4j</artifactId>
|
<artifactId>pinyin4j</artifactId>
|
||||||
|
<version>2.5.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package com.core.common.annotation;
|
||||||
|
|
||||||
|
import java.lang.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Excel额外表头信息注解
|
||||||
|
*
|
||||||
|
* @author swb
|
||||||
|
*/
|
||||||
|
@Target(ElementType.FIELD)
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
@Documented
|
||||||
|
public @interface ExcelExtra {
|
||||||
|
/**
|
||||||
|
* 表头名称
|
||||||
|
*/
|
||||||
|
String name();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日期格式,如:yyyy-MM-dd HH:mm:ss
|
||||||
|
*/
|
||||||
|
String dateFormat() default "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序(越小越靠前)
|
||||||
|
*/
|
||||||
|
int sort() default 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 默认值
|
||||||
|
*/
|
||||||
|
String defaultValue() default "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否导出
|
||||||
|
*/
|
||||||
|
boolean isExport() default true;
|
||||||
|
}
|
||||||
@@ -1,10 +1,13 @@
|
|||||||
package com.openhis.common.enums;
|
package com.core.common.enums;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除标识
|
* 删除标识
|
||||||
*
|
*
|
||||||
* @author system
|
* @author system
|
||||||
*/
|
*/
|
||||||
|
@Getter
|
||||||
public enum DelFlag {
|
public enum DelFlag {
|
||||||
/**
|
/**
|
||||||
* 未删除
|
* 未删除
|
||||||
@@ -25,18 +28,6 @@ public enum DelFlag {
|
|||||||
this.info = info;
|
this.info = info;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCode() {
|
|
||||||
return code;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getInfo() {
|
|
||||||
return info;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getValue() {
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static DelFlag getByValue(Integer value) {
|
public static DelFlag getByValue(Integer value) {
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
return null;
|
return null;
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
package com.core.common.enums;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除标志
|
|
||||||
*
|
|
||||||
* @author system
|
|
||||||
*/
|
|
||||||
public enum DeleteFlag {
|
|
||||||
NOT_DELETED("0", "未删除"), DELETED("1", "已删除");
|
|
||||||
|
|
||||||
private final String code;
|
|
||||||
private final String info;
|
|
||||||
|
|
||||||
DeleteFlag(String code, String info) {
|
|
||||||
this.code = code;
|
|
||||||
this.info = info;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCode() {
|
|
||||||
return code;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getInfo() {
|
|
||||||
return info;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -118,11 +118,11 @@ public enum TenantOptionDict {
|
|||||||
*/
|
*/
|
||||||
PACS_APP_SECRET("pacsAppSecret", "PACSAppSecret", 45),
|
PACS_APP_SECRET("pacsAppSecret", "PACSAppSecret", 45),
|
||||||
/**
|
/**
|
||||||
* PACSAppSecret
|
* 电子发票-中转服务的路径
|
||||||
*/
|
*/
|
||||||
INVOICE_FORWARD_URL("invoiceUrl", "电子发票-中转服务的路径", 46),
|
INVOICE_FORWARD_URL("invoiceUrl", "电子发票-中转服务的路径", 46),
|
||||||
/**
|
/**
|
||||||
* PACSAppSecret
|
* 电子发票-中转服务开关
|
||||||
*/
|
*/
|
||||||
FORWARD_SWITCH("forwardSwitch", "电子发票-中转服务开关", 47),
|
FORWARD_SWITCH("forwardSwitch", "电子发票-中转服务开关", 47),
|
||||||
/**
|
/**
|
||||||
@@ -160,7 +160,7 @@ public enum TenantOptionDict {
|
|||||||
/**
|
/**
|
||||||
* 电子发票开关
|
* 电子发票开关
|
||||||
*/
|
*/
|
||||||
INVOICE_SWITCH("invoiceSwitch", "电子发票开关 (0:关闭 1:开启)", 56),
|
INVOICE_SWITCH("invoiceSwitch", "电子发票开关", 56),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 医嘱定价来源
|
* 医嘱定价来源
|
||||||
@@ -170,41 +170,163 @@ public enum TenantOptionDict {
|
|||||||
/**
|
/**
|
||||||
* 三方支付(签到)
|
* 三方支付(签到)
|
||||||
*/
|
*/
|
||||||
THREE_PART_SIGN_URL("threePartSignUrl", "三方支付GET请求", 58),
|
THREE_PART_SIGN_URL("threePartSignUrl", "三方支付【签到】请求路径", 58),
|
||||||
|
/**
|
||||||
|
* 三方支付(签到)
|
||||||
|
*/
|
||||||
|
THREE_PART_SIGN_STATIC_PARAM("threePartSignStaticParam", "三方支付【签到】固定参数", 59),
|
||||||
|
/**
|
||||||
|
* 三方支付(签到)
|
||||||
|
*/
|
||||||
|
THREE_PART_SIGN_ACTIVE_PARAM("threePartSignActiveParam", "三方支付【签到】可变参数", 60),
|
||||||
|
/**
|
||||||
|
* 三方支付(签到)
|
||||||
|
*/
|
||||||
|
THREE_PART_SIGN_MAPPING_METHOD("threePartSignMappingMethod", "三方支付【签到】请求方式", 61),
|
||||||
/**
|
/**
|
||||||
* 三方支付(消费)
|
* 三方支付(消费)
|
||||||
*/
|
*/
|
||||||
THREE_PART_PAY_URL("threePartPayUrl", "三方支付GET请求", 59),
|
THREE_PART_PAY_URL("threePartPayUrl", "三方支付【消费】请求路径", 62),
|
||||||
|
/**
|
||||||
|
* 三方支付(消费)
|
||||||
|
*/
|
||||||
|
THREE_PART_PAY_STATIC_PARAM("threePartPayStaticParam", "三方支付【消费】固定参数", 63),
|
||||||
|
/**
|
||||||
|
* 三方支付(消费)
|
||||||
|
*/
|
||||||
|
THREE_PART_PAY_ACTIVE_PARAM("threePartPayActiveParam", "三方支付【消费】可变参数", 64),
|
||||||
|
/**
|
||||||
|
* 三方支付(消费)
|
||||||
|
*/
|
||||||
|
THREE_PART_PAY_MAPPING_METHOD("threePartPayMappingMethod", "三方支付【消费】请求方式", 65),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 三方支付(退费)
|
* 三方支付(退费)
|
||||||
*/
|
*/
|
||||||
THREE_PART_RETURN_URL("threePartReturnUrl", "三方支付GET请求", 60),
|
THREE_PART_RETURN_URL("threePartReturnUrl", "三方支付【退费】请求路径", 66),
|
||||||
|
/**
|
||||||
|
* 三方支付(退费)
|
||||||
|
*/
|
||||||
|
THREE_PART_RETURN_STATIC_PARAM("threePartReturnStaticParam", "三方支付【退费】固定参数", 67),
|
||||||
|
/**
|
||||||
|
* 三方支付(退费)
|
||||||
|
*/
|
||||||
|
THREE_PART_RETURN_ACTIVE_PARAM("threePartReturnActiveParam", "三方支付【退费】可变参数", 68),
|
||||||
|
/**
|
||||||
|
* 三方支付(退费)
|
||||||
|
*/
|
||||||
|
THREE_PART_RETURN_MAPPING_METHOD("threePartReturnMappingMethod", "三方支付【退费】请求方式", 69),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 三方支付(隔天退费)
|
* 三方支付(隔天退费)
|
||||||
*/
|
*/
|
||||||
THREE_PART_NEXT_DAY_RETURN_URL("threePartNextDayReturnUrl", "三方支付GET请求", 61),
|
THREE_PART_NEXT_DAY_RETURN_URL("threePartNextDayReturnUrl", "三方支付【隔天退费】请求路径", 70),
|
||||||
|
/**
|
||||||
|
* 三方支付(隔天退费)
|
||||||
|
*/
|
||||||
|
THREE_PART_NEXT_DAY_RETURN_STATIC_PARAM("threePartNextDayReturnStaticParam", "三方支付【隔天退费】固定参数", 71),
|
||||||
|
/**
|
||||||
|
* 三方支付(隔天退费)
|
||||||
|
*/
|
||||||
|
THREE_PART_NEXT_DAY_RETURN_ACTIVE_PARAM("threePartNextDayReturnActiveParam", "三方支付【隔天退费】可变参数", 72),
|
||||||
|
/**
|
||||||
|
* 三方支付(隔天退费)
|
||||||
|
*/
|
||||||
|
THREE_PART_NEXT_DAY_RETURN_MAPPING_METHOD("threePartNextDayReturnMappingMethod", "三方支付【隔天退费】请求方式", 73),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 三方支付路径(支付结果查询)
|
* 三方支付路径(支付结果查询)
|
||||||
*/
|
*/
|
||||||
THREE_PART_PAY_QUERY_URL("threePartPayQueryUrl", "三方支付GET请求", 62),
|
THREE_PART_PAY_QUERY_URL("threePartPayQueryUrl", "三方支付【支付结果查询】请求路径", 74),
|
||||||
|
/**
|
||||||
|
* 三方支付(支付结果查询)
|
||||||
|
*/
|
||||||
|
THREE_PART_PAY_QUERY_STATIC_PARAM("threePartPayQueryStaticParam", "三方支付【支付结果查询】固定参数", 75),
|
||||||
|
/**
|
||||||
|
* 三方支付(支付结果查询)
|
||||||
|
*/
|
||||||
|
THREE_PART_PAY_QUERY_ACTIVE_PARAM("threePartPayQueryActiveParam", "三方支付【支付结果查询】可变参数", 76),
|
||||||
|
/**
|
||||||
|
* 三方支付(支付结果查询)
|
||||||
|
*/
|
||||||
|
THREE_PART_PAY_QUERY_MAPPING_METHOD("threePartPayQueryMappingMethod", "三方支付【支付结果查询】请求方式", 77),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 三方支付路径(退费结果查询)
|
* 三方支付路径(退费结果查询)
|
||||||
*/
|
*/
|
||||||
THREE_PART_RETURN_QUERY_URL("threePartReturnQueryUrl", "三方支付GET请求", 63),
|
THREE_PART_RETURN_QUERY_URL("threePartReturnQueryUrl", "三方支付【退费结果查询】请求路径", 78),
|
||||||
|
/**
|
||||||
|
* 三方支付(退费结果查询)
|
||||||
|
*/
|
||||||
|
THREE_PART_RETURN_QUERY_STATIC_PARAM("threePartReturnQueryStaticParam", "三方支付【退费结果查询】固定参数", 79),
|
||||||
|
/**
|
||||||
|
* 三方支付(退费结果查询)
|
||||||
|
*/
|
||||||
|
THREE_PART_RETURN_QUERY_ACTIVE_PARAM("threePartReturnQueryActiveParam", "三方支付【退费结果查询】可变参数", 80),
|
||||||
|
/**
|
||||||
|
* 三方支付(退费结果查询)
|
||||||
|
*/
|
||||||
|
THREE_PART_RETURN_QUERY_MAPPING_METHOD("threePartReturnQueryMappingMethod", "三方支付【退费结果查询】请求方式", 81),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 三方支付路径(隔天退费结果查询)
|
* 三方支付路径(隔天退费结果查询)
|
||||||
*/
|
*/
|
||||||
THREE_PART_NEXT_DAY_RETURN_QUERY_URL("threePartNextDayReturnQueryUrl", "三方支付GET请求", 64),
|
THREE_PART_NEXT_DAY_RETURN_QUERY_URL("threePartNextDayReturnQueryUrl", "三方支付【隔天退费结果查询】请求路径", 82),
|
||||||
|
/**
|
||||||
|
* 三方支付(隔天退费结果查询)
|
||||||
|
*/
|
||||||
|
THREE_PART_NEXT_DAY_RETURN_QUERY_STATIC_PARAM("threePartNextDayReturnQueryStaticParam", "三方支付【隔天退费结果查询】固定参数", 83),
|
||||||
|
/**
|
||||||
|
* 三方支付(隔天退费结果查询)
|
||||||
|
*/
|
||||||
|
THREE_PART_NEXT_DAY_RETURN_QUERY_ACTIVE_PARAM("threePartNextDayReturnQueryActiveParam", "三方支付【隔天退费结果查询】可变参数", 84),
|
||||||
|
/**
|
||||||
|
* 三方支付(隔天退费结果查询)
|
||||||
|
*/
|
||||||
|
THREE_PART_NEXT_DAY_RETURN_QUERY_MAPPING_METHOD("threePartNextDayReturnQueryMappingMethod", "三方支付【隔天退费结果查询】请求方式",
|
||||||
|
85),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 三方支付参数
|
* 三方支付(签出)
|
||||||
*/
|
*/
|
||||||
THREE_PART_PARAM("threePartParam", "三方支付GET请求", 65);
|
THREE_PART_SIGN_OUT_URL("threePartSignOutUrl", "三方支付【签出】请求路径", 86),
|
||||||
|
/**
|
||||||
|
* 三方支付(签出)
|
||||||
|
*/
|
||||||
|
THREE_PART_SIGN_OUT_STATIC_PARAM("threePartSignOutStaticParam", "三方支付【签出】固定参数", 87),
|
||||||
|
/**
|
||||||
|
* 三方支付(签出)
|
||||||
|
*/
|
||||||
|
THREE_PART_SIGN_OUT_ACTIVE_PARAM("threePartSignOutActiveParam", "三方支付【签出】可变参数", 88),
|
||||||
|
/**
|
||||||
|
* 三方支付(签出)
|
||||||
|
*/
|
||||||
|
THREE_PART_SIGN_OUT_MAPPING_METHOD("threePartSignOutMappingMethod", "三方支付【签出】请求方式", 89),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 三方支付(签出)
|
||||||
|
*/
|
||||||
|
YB_INPATIENT_SETTLEMENT_UP_URL("ybInpatientSetlUp", "选填4101或4101A", 90),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PACS查看报告地址
|
||||||
|
*/
|
||||||
|
PACS_REPORT_URL("pacsReportUrl", "PACS查看报告地址", 91),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* LIS查看报告地址
|
||||||
|
*/
|
||||||
|
LIS_REPORT_URL("lisReportUrl", "LIS查看报告地址", 92),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开药时药房允许多选开关
|
||||||
|
*/
|
||||||
|
PHARMACY_MULTIPLE_CHOICE_SWITCH("pharmacyMultipleChoiceSwitch", "开药时药房允许多选开关", 93),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PEIS服务地址
|
||||||
|
*/
|
||||||
|
PEIS_SERVER_URL("peisServerUrl", "PEIS服务地址", 94);
|
||||||
|
|
||||||
private final String code;
|
private final String code;
|
||||||
private final String name;
|
private final String name;
|
||||||
|
|||||||
@@ -37,10 +37,6 @@ public final class AgeCalculatorUtil {
|
|||||||
* 当前年龄取得(床位列表表示年龄用)
|
* 当前年龄取得(床位列表表示年龄用)
|
||||||
*/
|
*/
|
||||||
public static String getAge(Date date) {
|
public static String getAge(Date date) {
|
||||||
// 添加空值检查
|
|
||||||
if (date == null) {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
// 将 Date 转换为 LocalDateTime
|
// 将 Date 转换为 LocalDateTime
|
||||||
LocalDateTime dateTime = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
|
LocalDateTime dateTime = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
|
||||||
LocalDateTime now = LocalDateTime.now();
|
LocalDateTime now = LocalDateTime.now();
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -80,6 +80,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.googlecode.aviator</groupId>
|
<groupId>com.googlecode.aviator</groupId>
|
||||||
<artifactId>aviator</artifactId>
|
<artifactId>aviator</artifactId>
|
||||||
|
<version>5.3.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|||||||
@@ -22,11 +22,10 @@ import com.core.common.utils.StringUtils;
|
|||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
public class FilterConfig {
|
public class FilterConfig {
|
||||||
// 添加默认值,避免配置不存在时启动失败
|
@Value("${xss.excludes}")
|
||||||
@Value("${xss.excludes:/system/notice}")
|
|
||||||
private String excludes;
|
private String excludes;
|
||||||
|
|
||||||
@Value("${xss.urlPatterns:/system/*,/monitor/*,/tool/*}")
|
@Value("${xss.urlPatterns}")
|
||||||
private String urlPatterns;
|
private String urlPatterns;
|
||||||
|
|
||||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ public class MybatisPlusConfig {
|
|||||||
"med_medication_definition", "med_medication_dispense", "med_medication_request",
|
"med_medication_definition", "med_medication_dispense", "med_medication_request",
|
||||||
"wor_activity_definition", "wor_device_dispense", "wor_device_request", "wor_inventory_item",
|
"wor_activity_definition", "wor_device_dispense", "wor_device_request", "wor_inventory_item",
|
||||||
"wor_service_request", "wor_service_request_detail", "wor_supply_delivery", "wor_supply_request",
|
"wor_service_request", "wor_service_request_detail", "wor_supply_delivery", "wor_supply_request",
|
||||||
"sys_operation_record"));
|
"sys_operation_record","doc_inventory_item_static"));
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean ignoreTable(String tableName) {
|
public boolean ignoreTable(String tableName) {
|
||||||
|
|||||||
@@ -1,9 +1,5 @@
|
|||||||
package com.core.framework.config;
|
package com.core.framework.config;
|
||||||
|
|
||||||
import com.core.framework.config.properties.PermitAllUrlProperties;
|
|
||||||
import com.core.framework.security.filter.JwtAuthenticationTokenFilter;
|
|
||||||
import com.core.framework.security.handle.AuthenticationEntryPointImpl;
|
|
||||||
import com.core.framework.security.handle.LogoutSuccessHandlerImpl;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
@@ -11,7 +7,7 @@ import org.springframework.http.HttpMethod;
|
|||||||
import org.springframework.security.authentication.AuthenticationManager;
|
import org.springframework.security.authentication.AuthenticationManager;
|
||||||
import org.springframework.security.authentication.ProviderManager;
|
import org.springframework.security.authentication.ProviderManager;
|
||||||
import org.springframework.security.authentication.dao.DaoAuthenticationProvider;
|
import org.springframework.security.authentication.dao.DaoAuthenticationProvider;
|
||||||
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
|
import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity;
|
||||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||||
import org.springframework.security.config.http.SessionCreationPolicy;
|
import org.springframework.security.config.http.SessionCreationPolicy;
|
||||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||||
@@ -21,12 +17,17 @@ import org.springframework.security.web.authentication.UsernamePasswordAuthentic
|
|||||||
import org.springframework.security.web.authentication.logout.LogoutFilter;
|
import org.springframework.security.web.authentication.logout.LogoutFilter;
|
||||||
import org.springframework.web.filter.CorsFilter;
|
import org.springframework.web.filter.CorsFilter;
|
||||||
|
|
||||||
|
import com.core.framework.config.properties.PermitAllUrlProperties;
|
||||||
|
import com.core.framework.security.filter.JwtAuthenticationTokenFilter;
|
||||||
|
import com.core.framework.security.handle.AuthenticationEntryPointImpl;
|
||||||
|
import com.core.framework.security.handle.LogoutSuccessHandlerImpl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* spring security配置
|
* spring security配置
|
||||||
*
|
*
|
||||||
* @author system
|
* @author system
|
||||||
*/
|
*/
|
||||||
@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
|
@EnableMethodSecurity(prePostEnabled = true, securedEnabled = true)
|
||||||
@Configuration
|
@Configuration
|
||||||
public class SecurityConfig {
|
public class SecurityConfig {
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import java.util.Optional;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
import com.core.common.enums.DelFlag;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.authentication.AuthenticationManager;
|
import org.springframework.security.authentication.AuthenticationManager;
|
||||||
import org.springframework.security.authentication.BadCredentialsException;
|
import org.springframework.security.authentication.BadCredentialsException;
|
||||||
@@ -23,7 +24,6 @@ import com.core.common.core.domain.entity.SysUser;
|
|||||||
import com.core.common.core.domain.model.LoginUser;
|
import com.core.common.core.domain.model.LoginUser;
|
||||||
import com.core.common.core.domain.model.LoginUserExtend;
|
import com.core.common.core.domain.model.LoginUserExtend;
|
||||||
import com.core.common.core.redis.RedisCache;
|
import com.core.common.core.redis.RedisCache;
|
||||||
import com.core.common.enums.DeleteFlag;
|
|
||||||
import com.core.common.enums.TenantStatus;
|
import com.core.common.enums.TenantStatus;
|
||||||
import com.core.common.exception.ServiceException;
|
import com.core.common.exception.ServiceException;
|
||||||
import com.core.common.exception.user.*;
|
import com.core.common.exception.user.*;
|
||||||
@@ -281,7 +281,7 @@ public class SysLoginService {
|
|||||||
throw new ServiceException("所属医院停用");
|
throw new ServiceException("所属医院停用");
|
||||||
}
|
}
|
||||||
// 租户删除状态校验
|
// 租户删除状态校验
|
||||||
if (DeleteFlag.DELETED.getCode().equals(currentTenant.getDeleteFlag())) {
|
if (DelFlag.YES.getCode().equals(currentTenant.getDeleteFlag())) {
|
||||||
throw new ServiceException("所属医院不存在");
|
throw new ServiceException("所属医院不存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -58,7 +58,6 @@ public class GenController extends BaseController {
|
|||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo genList(GenTable genTable) {
|
public TableDataInfo genList(GenTable genTable) {
|
||||||
startPage();
|
startPage();
|
||||||
|
|
||||||
List<GenTable> list = genTableService.selectGenTableList(genTable);
|
List<GenTable> list = genTableService.selectGenTableList(genTable);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
@@ -252,10 +251,12 @@ public class GenController extends BaseController {
|
|||||||
InputStream is = file.getInputStream();
|
InputStream is = file.getInputStream();
|
||||||
Workbook wb = WorkbookFactory.create(is);
|
Workbook wb = WorkbookFactory.create(is);
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
// 遍历每个sheet页(每个表)
|
// 遍历每个sheet页(每个表)
|
||||||
for (int i = 0; i < wb.getNumberOfSheets(); i++) {
|
for (int i = 0; i < wb.getNumberOfSheets(); i++) {
|
||||||
sb.append("-- ----------------------------------------------------------------------------------\n");
|
sb.append("-- ----------------------------------------------------------------------------------\n");
|
||||||
Sheet st = wb.getSheetAt(i);
|
Sheet st = wb.getSheetAt(i);
|
||||||
|
|
||||||
// 从第一行读取表名表注释
|
// 从第一行读取表名表注释
|
||||||
Row row0 = st.getRow(0);// 表名
|
Row row0 = st.getRow(0);// 表名
|
||||||
String tableName = row0.getCell(4).toString();// 表名
|
String tableName = row0.getCell(4).toString();// 表名
|
||||||
|
|||||||
@@ -52,6 +52,9 @@ public class GenUtils {
|
|||||||
case "yb":
|
case "yb":
|
||||||
genTable.setPackageName(GenConfig.getPackageName() + ".ybcatalog");
|
genTable.setPackageName(GenConfig.getPackageName() + ".ybcatalog");
|
||||||
break;
|
break;
|
||||||
|
case "lab":
|
||||||
|
genTable.setPackageName(GenConfig.getPackageName() + ".lab");
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
genTable.setPackageName(GenConfig.getPackageName() + ".errortable");
|
genTable.setPackageName(GenConfig.getPackageName() + ".errortable");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,4 +7,4 @@ gen:
|
|||||||
# 自动去除表前缀,默认是false
|
# 自动去除表前缀,默认是false
|
||||||
autoRemovePre: true
|
autoRemovePre: true
|
||||||
# 表前缀(生成类名不会包含表前缀,多个用逗号分隔)
|
# 表前缀(生成类名不会包含表前缀,多个用逗号分隔)
|
||||||
tablePrefix: cod_,adm_,cli_,dia_,med_,wor_,fin_,def_,doc_,yb_
|
tablePrefix: cod_,adm_,cli_,dia_,med_,wor_,fin_,def_,doc_,yb_,lab_
|
||||||
@@ -99,14 +99,15 @@
|
|||||||
|
|
||||||
<select id="selectDbTableList" parameterType="map" resultMap="GenTableResult">
|
<select id="selectDbTableList" parameterType="map" resultMap="GenTableResult">
|
||||||
SELECT
|
SELECT
|
||||||
T1.table_name,
|
T1.table_name
|
||||||
T2.description AS table_comment
|
--,
|
||||||
|
--T2.description AS table_comment
|
||||||
-- 移除 create_time,因为它在 information_schema.tables 中通常不存在
|
-- 移除 create_time,因为它在 information_schema.tables 中通常不存在
|
||||||
-- 移除 update_time,因为它在 information_schema.tables 中通常不存在
|
-- 移除 update_time,因为它在 information_schema.tables 中通常不存在
|
||||||
FROM information_schema.tables T1
|
FROM information_schema.tables T1
|
||||||
LEFT JOIN pg_description T2
|
-- LEFT JOIN pg_description T2
|
||||||
ON T2.objsubid = 0
|
-- ON T2.objsubid = 0
|
||||||
AND T2.objoid = T1.table_name::regclass::oid
|
--AND T2.objoid = T1.table_name::regclass::oid
|
||||||
WHERE table_schema = current_schema()
|
WHERE table_schema = current_schema()
|
||||||
AND table_name NOT LIKE 'qrtz\_%'
|
AND table_name NOT LIKE 'qrtz\_%'
|
||||||
AND table_name NOT LIKE 'gen\_%'
|
AND table_name NOT LIKE 'gen\_%'
|
||||||
|
|||||||
@@ -23,11 +23,15 @@
|
|||||||
<groupId>com.core</groupId>
|
<groupId>com.core</groupId>
|
||||||
<artifactId>core-common</artifactId>
|
<artifactId>core-common</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.swagger</groupId>
|
<groupId>io.swagger</groupId>
|
||||||
<artifactId>swagger-annotations</artifactId>
|
<artifactId>swagger-annotations</artifactId>
|
||||||
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- postgresql -->
|
<!-- postgresql -->
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import com.core.common.core.domain.R;
|
|||||||
import com.core.common.core.domain.entity.SysUser;
|
import com.core.common.core.domain.entity.SysUser;
|
||||||
import com.core.common.core.domain.model.LoginUser;
|
import com.core.common.core.domain.model.LoginUser;
|
||||||
import com.core.common.core.redis.RedisCache;
|
import com.core.common.core.redis.RedisCache;
|
||||||
import com.core.common.enums.DeleteFlag;
|
import com.core.common.enums.DelFlag;
|
||||||
import com.core.common.enums.TenantStatus;
|
import com.core.common.enums.TenantStatus;
|
||||||
import com.core.common.utils.SecurityUtils;
|
import com.core.common.utils.SecurityUtils;
|
||||||
import com.core.common.utils.StringUtils;
|
import com.core.common.utils.StringUtils;
|
||||||
@@ -76,7 +76,7 @@ public class SysTenantServiceImpl extends ServiceImpl<SysTenantMapper, SysTenant
|
|||||||
lambdaQueryWrapper.eq(SysTenant::getStatus, status);
|
lambdaQueryWrapper.eq(SysTenant::getStatus, status);
|
||||||
}
|
}
|
||||||
// 未删除
|
// 未删除
|
||||||
lambdaQueryWrapper.eq(SysTenant::getDeleteFlag, DeleteFlag.NOT_DELETED.getCode());
|
lambdaQueryWrapper.eq(SysTenant::getDeleteFlag, DelFlag.NO.getCode());
|
||||||
lambdaQueryWrapper.orderByDesc(SysTenant::getId);
|
lambdaQueryWrapper.orderByDesc(SysTenant::getId);
|
||||||
return R.ok(baseMapper.selectPage(new Page<>(pageNum, pageSize), lambdaQueryWrapper));
|
return R.ok(baseMapper.selectPage(new Page<>(pageNum, pageSize), lambdaQueryWrapper));
|
||||||
}
|
}
|
||||||
@@ -140,7 +140,7 @@ public class SysTenantServiceImpl extends ServiceImpl<SysTenantMapper, SysTenant
|
|||||||
return R.fail("该租户还存在绑定的用户,请确认");
|
return R.fail("该租户还存在绑定的用户,请确认");
|
||||||
}
|
}
|
||||||
baseMapper.update(new SysTenant(), new LambdaUpdateWrapper<SysTenant>()
|
baseMapper.update(new SysTenant(), new LambdaUpdateWrapper<SysTenant>()
|
||||||
.set(SysTenant::getDeleteFlag, DeleteFlag.DELETED.getCode()).in(SysTenant::getId, tenantIdList));
|
.set(SysTenant::getDeleteFlag, DelFlag.YES.getCode()).in(SysTenant::getId, tenantIdList));
|
||||||
}
|
}
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
@@ -209,7 +209,7 @@ public class SysTenantServiceImpl extends ServiceImpl<SysTenantMapper, SysTenant
|
|||||||
if (StringUtils.isNotEmpty(userName)) {
|
if (StringUtils.isNotEmpty(userName)) {
|
||||||
lambdaQueryWrapper.like(SysUser::getUserName, userName);
|
lambdaQueryWrapper.like(SysUser::getUserName, userName);
|
||||||
}
|
}
|
||||||
lambdaQueryWrapper.eq(SysUser::getDeleteFlag, DeleteFlag.NOT_DELETED.getCode());
|
lambdaQueryWrapper.eq(SysUser::getDeleteFlag, DelFlag.NO.getCode());
|
||||||
lambdaQueryWrapper.orderByDesc(SysUser::getUserId);
|
lambdaQueryWrapper.orderByDesc(SysUser::getUserId);
|
||||||
return R.ok(sysUserMapper.selectPage(new Page<>(pageNum, pageSize), lambdaQueryWrapper));
|
return R.ok(sysUserMapper.selectPage(new Page<>(pageNum, pageSize), lambdaQueryWrapper));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,21 +23,18 @@
|
|||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>cn.hutool</groupId>
|
|
||||||
<artifactId>hutool-all</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- 领域-->
|
<!-- 领域-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.openhis</groupId>
|
<groupId>com.openhis</groupId>
|
||||||
<artifactId>openhis-domain</artifactId>
|
<artifactId>openhis-domain</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- liteflow-->
|
<!-- liteflow-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.yomahub</groupId>
|
<groupId>com.yomahub</groupId>
|
||||||
<artifactId>liteflow-spring-boot-starter</artifactId>
|
<artifactId>liteflow-spring-boot-starter</artifactId>
|
||||||
|
<version>2.12.4.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- junit-->
|
<!-- junit-->
|
||||||
@@ -46,10 +43,11 @@
|
|||||||
<artifactId>junit</artifactId>
|
<artifactId>junit</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba.fastjson2</groupId>
|
<groupId>com.alibaba</groupId>
|
||||||
<artifactId>fastjson2</artifactId>
|
<artifactId>fastjson</artifactId>
|
||||||
|
<version>2.0.43</version>
|
||||||
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.httpcomponents</groupId>
|
<groupId>org.apache.httpcomponents</groupId>
|
||||||
@@ -68,6 +66,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
<version>2.5.15</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<fork>true</fork> <!-- 如果没有该配置,devtools不会生效 -->
|
<fork>true</fork> <!-- 如果没有该配置,devtools不会生效 -->
|
||||||
</configuration>
|
</configuration>
|
||||||
@@ -82,12 +81,20 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-war-plugin</artifactId>
|
<artifactId>maven-war-plugin</artifactId>
|
||||||
<version>${maven-war-plugin.version}</version>
|
<version>3.1.0</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<failOnMissingWebXml>false</failOnMissingWebXml>
|
<failOnMissingWebXml>false</failOnMissingWebXml>
|
||||||
<warName>${project.artifactId}</warName>
|
<warName>${project.artifactId}</warName>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<source>17</source>
|
||||||
|
<target>17</target>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
<finalName>${project.artifactId}</finalName>
|
<finalName>${project.artifactId}</finalName>
|
||||||
</build>
|
</build>
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
/*
|
||||||
|
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||||
|
*/
|
||||||
|
package com.openhis.quartz.task;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import com.core.framework.config.TenantContext;
|
||||||
|
import com.openhis.web.inhospitalnursestation.appservice.IEncounterAutoRollAppService;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自动滚方定时任务(每日执行)
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component("AutoRollTask")
|
||||||
|
public class AutoRollTask {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IEncounterAutoRollAppService encounterAutoRollAppService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理费
|
||||||
|
*
|
||||||
|
* @param tenantId 租户id
|
||||||
|
* @param orderPricing 医嘱定价来源 | 定时任务调用时传参
|
||||||
|
*/
|
||||||
|
public void autoRollNursingFee(Integer tenantId, String orderPricing) {
|
||||||
|
// 设置当前线程的租户ID
|
||||||
|
TenantContext.setCurrentTenant(tenantId);
|
||||||
|
// 滚护理费
|
||||||
|
encounterAutoRollAppService.autoRollNursingFee(tenantId, orderPricing);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基础服务费 | 取暖费,床位费 等
|
||||||
|
*
|
||||||
|
* @param tenantId 租户id
|
||||||
|
* @param orderPricing 医嘱定价来源 | 定时任务调用时传参
|
||||||
|
*/
|
||||||
|
public void autoRollBasicService(Integer tenantId, String orderPricing) {
|
||||||
|
// 设置当前线程的租户ID
|
||||||
|
TenantContext.setCurrentTenant(tenantId);
|
||||||
|
// 滚基础服务费
|
||||||
|
encounterAutoRollAppService.autoRollBasicService(tenantId, orderPricing);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,183 @@
|
|||||||
|
/*
|
||||||
|
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||||
|
*/
|
||||||
|
package com.openhis.quartz.task;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.core.common.enums.DelFlag;
|
||||||
|
import com.core.common.utils.AssignSeqUtil;
|
||||||
|
import com.core.common.utils.DateUtils;
|
||||||
|
import com.core.framework.config.TenantContext;
|
||||||
|
import com.openhis.common.enums.AssignSeqEnum;
|
||||||
|
import com.openhis.document.domain.DocInventoryItemStatic;
|
||||||
|
import com.openhis.document.service.IDocInventoryItemStaticService;
|
||||||
|
import com.openhis.web.inventorymanage.appservice.IProductDetailAppService;
|
||||||
|
import com.openhis.web.inventorymanage.dto.ProductDetailPageDto;
|
||||||
|
import com.openhis.web.inventorymanage.dto.ProductDetailSearchParam;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 库存备份定时任务(每日执行)
|
||||||
|
*
|
||||||
|
* @author zwh
|
||||||
|
* @date 2025-11-12
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component("InventoryBackupTask")
|
||||||
|
public class InventoryBackupTask {
|
||||||
|
|
||||||
|
Logger logger = LoggerFactory.getLogger(InventoryBackupTask.class);
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IProductDetailAppService productDetailAppService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IDocInventoryItemStaticService docInventoryItemStaticService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private AssignSeqUtil assignSeqUtil;
|
||||||
|
|
||||||
|
private static final AtomicBoolean isRunning = new AtomicBoolean(false);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 库存备份
|
||||||
|
*
|
||||||
|
* @param tenantId 租户id
|
||||||
|
*/
|
||||||
|
public void inventoryBackup(Integer tenantId) {
|
||||||
|
|
||||||
|
// 添加执行锁,防止重复执行
|
||||||
|
if (!isRunning.compareAndSet(false, true)) {
|
||||||
|
logger.warn("库存备份任务正在执行中,跳过本次执行");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 定时任务指定租户id
|
||||||
|
try {
|
||||||
|
logger.info("库存备份START:{}", DateUtils.getNowDate());
|
||||||
|
// 设置当前线程的租户ID
|
||||||
|
TenantContext.setCurrentTenant(tenantId);
|
||||||
|
String now = DateUtils.dateTime();
|
||||||
|
// 查询当天是否已经执行过一次库存备份
|
||||||
|
List<DocInventoryItemStatic> hisDocInventoryItemStaticList = docInventoryItemStaticService
|
||||||
|
.list(new LambdaQueryWrapper<DocInventoryItemStatic>()
|
||||||
|
.eq(DocInventoryItemStatic::getDeleteFlag, DelFlag.NO.getCode())
|
||||||
|
.eq(DocInventoryItemStatic::getTenantId, tenantId))
|
||||||
|
.stream().filter(item -> item.getBusNo() != null && item.getBusNo().length() >= 11
|
||||||
|
&& now.equals(item.getBusNo().substring(3, 11)))
|
||||||
|
.toList();
|
||||||
|
if (!hisDocInventoryItemStaticList.isEmpty()) {
|
||||||
|
logger.warn("库存备份任务已执行过,跳过本次执行");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 生成备份编号
|
||||||
|
String busNo = assignSeqUtil.getSeqByDay(AssignSeqEnum.AUTO_BACKUP_NO.getPrefix(), 2);
|
||||||
|
// 获取库存商品明细
|
||||||
|
Page<ProductDetailPageDto> productDetailPage = productDetailAppService
|
||||||
|
.getProductDetailPage(new ProductDetailSearchParam(), 1, 9999, null, null).getData();
|
||||||
|
List<DocInventoryItemStatic> docInventoryItemStaticList = new ArrayList<>();
|
||||||
|
if (productDetailPage != null && productDetailPage.getTotal() > 0) {
|
||||||
|
List<ProductDetailPageDto> productDetailList = productDetailPage.getRecords();
|
||||||
|
for (ProductDetailPageDto productDetail : productDetailList) {
|
||||||
|
DocInventoryItemStatic docInventoryItemStatic = new DocInventoryItemStatic();
|
||||||
|
docInventoryItemStatic
|
||||||
|
// 库存状态枚举
|
||||||
|
.setInventoryStatusEnum(productDetail.getInventoryStatusEnum())
|
||||||
|
// 备份编号
|
||||||
|
.setBusNo(busNo)
|
||||||
|
// 库存id
|
||||||
|
.setInventoryId(productDetail.getInventoryId())
|
||||||
|
// 医保等级
|
||||||
|
.setChrgitmLv(productDetail.getChrgitmLv())
|
||||||
|
// 耗材类型
|
||||||
|
.setDevCategoryCode(productDetail.getDevCategoryCode())
|
||||||
|
// 项目id
|
||||||
|
.setItemId(productDetail.getItemId())
|
||||||
|
// 项目名称
|
||||||
|
.setName(productDetail.getItemName())
|
||||||
|
// 项目编号
|
||||||
|
.setItemNo(productDetail.getBusNo())
|
||||||
|
// 药品类别
|
||||||
|
.setMedCategoryCode(productDetail.getMedCategoryCode())
|
||||||
|
// 项目所在表
|
||||||
|
.setItemTable(productDetail.getItemTable())
|
||||||
|
// 所在位置
|
||||||
|
.setLocationId(productDetail.getLocationId())
|
||||||
|
// 位置名称
|
||||||
|
.setLocationName(productDetail.getLocationName())
|
||||||
|
// 所在货位
|
||||||
|
.setLocationStoreId(productDetail.getLocationStoreId())
|
||||||
|
// 货位名称
|
||||||
|
.setLocationStoreName(productDetail.getLocationStoreName())
|
||||||
|
// 厂家
|
||||||
|
.setManufacturerText(productDetail.getManufacturerText())
|
||||||
|
// 最小单位
|
||||||
|
.setMinUnitCode(productDetail.getMinUnitCode())
|
||||||
|
// 拆零比
|
||||||
|
.setPartPercent(productDetail.getPartPercent())
|
||||||
|
// 采购价
|
||||||
|
.setPrice(productDetail.getPurchasePrice())
|
||||||
|
// 生产日期
|
||||||
|
.setProductionDate(productDetail.getProductionDate())
|
||||||
|
// 到期日期
|
||||||
|
.setExpirationDate(productDetail.getExpirationDate())
|
||||||
|
// 库存数量
|
||||||
|
.setQuantity(productDetail.getQuantity())
|
||||||
|
// 销售价
|
||||||
|
.setSalePrice(productDetail.getSalePrice())
|
||||||
|
// 采购总价
|
||||||
|
.setTotalPrice(productDetail.getTotalPurchasePrice())
|
||||||
|
// 销售总价
|
||||||
|
.setTotalSalePrice(productDetail.getTotalSalePrice())
|
||||||
|
// 规格
|
||||||
|
.setTotalVolume(productDetail.getTotalVolume())
|
||||||
|
// 单位
|
||||||
|
.setUnitCode(productDetail.getUnitCode())
|
||||||
|
// 五笔码
|
||||||
|
.setWbStr(productDetail.getWbStr())
|
||||||
|
// 拼音码
|
||||||
|
.setPyStr(productDetail.getPyStr())
|
||||||
|
// 供应商id
|
||||||
|
.setSupplierId(productDetail.getSupplierId())
|
||||||
|
// 供应商名称
|
||||||
|
.setSupplierName(productDetail.getSupplierName())
|
||||||
|
// 剩余过期天数
|
||||||
|
.setRemainingDays(productDetail.getRemainingDays())
|
||||||
|
// 包装数量(整数)
|
||||||
|
.setNumber(productDetail.getNumber())
|
||||||
|
// 包装数量(小数)
|
||||||
|
.setRemainder(productDetail.getRemainder())
|
||||||
|
// 医保码
|
||||||
|
.setYbNo(productDetail.getYbNo())
|
||||||
|
// 批准文号
|
||||||
|
.setApprovalNumber(productDetail.getApprovalNumber())
|
||||||
|
// 批次号
|
||||||
|
.setLotNumber(productDetail.getLotNumber());
|
||||||
|
docInventoryItemStatic.setTenantId(tenantId);
|
||||||
|
docInventoryItemStaticList.add(docInventoryItemStatic);
|
||||||
|
}
|
||||||
|
docInventoryItemStaticService.saveBatch(docInventoryItemStaticList);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("库存备份失败:", e);
|
||||||
|
} finally {
|
||||||
|
// 清除线程局部变量,防止内存泄漏
|
||||||
|
TenantContext.clear();
|
||||||
|
// 释放执行锁
|
||||||
|
isRunning.set(false);
|
||||||
|
logger.info("库存备份END:{}", DateUtils.getNowDate());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
package com.openhis.quartz.task;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
|
||||||
import com.core.common.core.domain.R;
|
|
||||||
import com.core.common.utils.DateUtils;
|
|
||||||
import com.openhis.web.inventorymanage.appservice.IProductStocktakingAppService;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import com.core.common.utils.StringUtils;
|
|
||||||
import com.core.framework.config.TenantContext;
|
|
||||||
import com.openhis.administration.domain.Location;
|
|
||||||
import com.openhis.administration.service.ILocationService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量盘点定时任务
|
|
||||||
*
|
|
||||||
* @author yuxj
|
|
||||||
*/
|
|
||||||
@Component("stocktakingBatchTask")
|
|
||||||
public class StocktakingBatchTask {
|
|
||||||
|
|
||||||
Logger logger = LoggerFactory.getLogger(StocktakingBatchTask.class);
|
|
||||||
@Resource
|
|
||||||
IProductStocktakingAppService productStocktakingAppService;
|
|
||||||
|
|
||||||
public void autoStocktakingBatch(Integer tenantId) {
|
|
||||||
// 定时任务指定租户id,示例
|
|
||||||
try {
|
|
||||||
// 在控制台打印当前时间加执行的功能名
|
|
||||||
System.out.println("执行自动批量盘点START:" + DateUtils.getNowDate());
|
|
||||||
logger.info("执行自动批量盘点START:" + DateUtils.getNowDate());
|
|
||||||
|
|
||||||
// 设置当前线程的租户ID
|
|
||||||
TenantContext.setCurrentTenant(tenantId);
|
|
||||||
//执行自动盘点
|
|
||||||
productStocktakingAppService.autoStocktakingBatch();
|
|
||||||
|
|
||||||
logger.info("执行自动批量盘点END:" + DateUtils.getNowDate());
|
|
||||||
// 在控制台打印当前时间加执行的功能名
|
|
||||||
System.out.println("执行自动批量盘点END:" + DateUtils.getNowDate());
|
|
||||||
} finally {
|
|
||||||
// 清除线程局部变量,防止内存泄漏
|
|
||||||
TenantContext.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.openhis.web.Inspection.appservice;
|
||||||
|
|
||||||
|
import com.core.common.core.domain.R;
|
||||||
|
import com.openhis.administration.domain.Device;
|
||||||
|
import com.openhis.administration.domain.Instrument;
|
||||||
|
import com.openhis.web.Inspection.dto.InstrumentSelParam;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description TODO
|
||||||
|
* @Author
|
||||||
|
* @Date 2025/9/18 15:38
|
||||||
|
*/
|
||||||
|
public interface IInstrumentManageAppService {
|
||||||
|
|
||||||
|
|
||||||
|
R<?> getManageInit();
|
||||||
|
|
||||||
|
|
||||||
|
R<?> getInstrumentPage(InstrumentSelParam InstrumentSelParam, String searchKey, Integer pageNo, Integer pageSize,
|
||||||
|
HttpServletRequest request);
|
||||||
|
|
||||||
|
|
||||||
|
R<?> updateOrAddInstrument(Instrument instrument);
|
||||||
|
|
||||||
|
R<?> getInstrumentOne(Long id);
|
||||||
|
|
||||||
|
R<?> editInstrumentStatus(List<Long> ids, Integer status);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.openhis.web.Inspection.appservice;
|
||||||
|
|
||||||
|
import com.core.common.core.domain.R;
|
||||||
|
import com.openhis.web.Inspection.dto.ReportResultManageDto;
|
||||||
|
import com.openhis.web.Inspection.dto.SampleCollectManageDto;
|
||||||
|
import com.openhis.web.Inspection.dto.SampleCollectStatusRequest;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description TODO
|
||||||
|
* @Author
|
||||||
|
* @Date 2025/10/16 15:36
|
||||||
|
*/
|
||||||
|
public interface ILaboratoryManageAppService {
|
||||||
|
|
||||||
|
R<?> getReportResultList(ReportResultManageDto reportResultManageDto, Integer pageNo, Integer pageSize, String searchKey, HttpServletRequest request);
|
||||||
|
|
||||||
|
|
||||||
|
R<?> getReportById(Long id);
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package com.openhis.web.Inspection.appservice;
|
||||||
|
|
||||||
|
import com.core.common.core.domain.R;
|
||||||
|
import com.openhis.web.Inspection.dto.LisConfigManageDto;
|
||||||
|
import com.openhis.web.datadictionary.dto.DiagnosisTreatmentSelParam;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description TODO
|
||||||
|
* @Author
|
||||||
|
* @Date 2025/9/29 16:00
|
||||||
|
*/
|
||||||
|
public interface ILisConfigManageAppService {
|
||||||
|
|
||||||
|
R<?> getDiseaseTreatmentPage(DiagnosisTreatmentSelParam DiagnosisTreatmentSelParam, String searchKey,
|
||||||
|
Integer pageNo, Integer pageSize, HttpServletRequest request);
|
||||||
|
|
||||||
|
|
||||||
|
R<?> getInfoList(String searchKey,String type);
|
||||||
|
|
||||||
|
R<?> getInfoDetail(Long id);
|
||||||
|
|
||||||
|
R<?> saveAll(LisConfigManageDto manageDto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param patientId 患者id
|
||||||
|
* @param ServiceId 服务id
|
||||||
|
* @param itemId 检验项目id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
R<?>createAll(Long patientId,Long ServiceId, Long itemId);
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.openhis.web.Inspection.appservice;
|
||||||
|
|
||||||
|
import com.core.common.core.domain.R;
|
||||||
|
import com.openhis.administration.domain.ObservationDefinition;
|
||||||
|
import com.openhis.web.Inspection.dto.ObservationDefSelParam;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description TODO
|
||||||
|
* @Author
|
||||||
|
* @Date 2025/9/23 16:32
|
||||||
|
*/
|
||||||
|
public interface IObservationManageAppService {
|
||||||
|
|
||||||
|
R<?> getManageInit();
|
||||||
|
|
||||||
|
|
||||||
|
R<?> getObservationDefPage(ObservationDefSelParam ObservationDefSelParam, String searchKey, Integer pageNo, Integer pageSize,
|
||||||
|
HttpServletRequest request);
|
||||||
|
|
||||||
|
|
||||||
|
R<?> updateOrAddObservationDef(ObservationDefinition Observation);
|
||||||
|
|
||||||
|
R<?> getObservationDefOne(Long id);
|
||||||
|
|
||||||
|
R<?> editObservationDefStatus(List<Long> ids, Integer status);
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.openhis.web.Inspection.appservice;
|
||||||
|
|
||||||
|
import com.core.common.core.domain.R;
|
||||||
|
import com.openhis.web.Inspection.dto.SampleCollectManageDto;
|
||||||
|
import com.openhis.web.Inspection.dto.SampleCollectStatusRequest;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description TODO
|
||||||
|
* @Author
|
||||||
|
* @Date 2025/10/16 15:36
|
||||||
|
*/
|
||||||
|
public interface ISampleCollectAppManageAppService {
|
||||||
|
|
||||||
|
R<?> getSampleCollectList(SampleCollectManageDto sampleCollectManageDto, Integer pageNo, Integer pageSize, String searchKey, HttpServletRequest request);
|
||||||
|
|
||||||
|
|
||||||
|
R<?>updateSampleStatus(SampleCollectStatusRequest statusRequest);
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.openhis.web.Inspection.appservice;
|
||||||
|
|
||||||
|
import com.core.common.core.domain.R;
|
||||||
|
import com.openhis.administration.domain.SpecimenDefinition;
|
||||||
|
import com.openhis.web.Inspection.dto.SpecimenDefSelParam;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description TODO
|
||||||
|
* @Author
|
||||||
|
* @Date 2025/9/9 16:46
|
||||||
|
*/
|
||||||
|
public interface ISpecimenManageAppService {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
R<?> getManageInit();
|
||||||
|
|
||||||
|
|
||||||
|
R<?> getSpecimenPage(SpecimenDefSelParam specimenDefSelParam, String searchKey, Integer pageNo, Integer pageSize,
|
||||||
|
HttpServletRequest request);
|
||||||
|
|
||||||
|
|
||||||
|
R<?> updateOrAddSpecimen(SpecimenDefinition specimenDefinition);
|
||||||
|
|
||||||
|
R<?> getSpecimenOne(Long id);
|
||||||
|
|
||||||
|
R<?> editSpecimenStatus(List<Long> ids,Integer status);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,107 @@
|
|||||||
|
package com.openhis.web.Inspection.appservice.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.core.common.core.domain.R;
|
||||||
|
import com.core.common.utils.MessageUtils;
|
||||||
|
import com.openhis.administration.domain.Instrument;
|
||||||
|
import com.openhis.administration.mapper.InstrumentMapper;
|
||||||
|
import com.openhis.administration.service.IInstrumentService;
|
||||||
|
import com.openhis.common.constant.PromptMsgConstant;
|
||||||
|
import com.openhis.common.enums.InstrumentCategory;
|
||||||
|
import com.openhis.common.enums.PublicationStatus;
|
||||||
|
import com.openhis.common.utils.EnumUtils;
|
||||||
|
import com.openhis.common.utils.HisPageUtils;
|
||||||
|
import com.openhis.common.utils.HisQueryUtils;
|
||||||
|
import com.openhis.web.Inspection.appservice.IInstrumentManageAppService;
|
||||||
|
import com.openhis.web.Inspection.dto.InstrumentManageDto;
|
||||||
|
import com.openhis.web.Inspection.dto.InstrumentManageInitDto;
|
||||||
|
import com.openhis.web.Inspection.dto.InstrumentSelParam;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.concurrent.CopyOnWriteArrayList;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 仪器信息
|
||||||
|
* @Author
|
||||||
|
* @Date 2025/9/18
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class InstrumentManageAppServiceImpl implements IInstrumentManageAppService {
|
||||||
|
|
||||||
|
private final IInstrumentService instrumentService ;
|
||||||
|
private final InstrumentMapper instrumentMapper ;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<?> getManageInit() {
|
||||||
|
InstrumentManageInitDto instrumentManageInitDto = new InstrumentManageInitDto();
|
||||||
|
// 获取状态
|
||||||
|
List<InstrumentManageInitDto.statusEnumOption> statusEnumOptions = Stream.of(PublicationStatus.values())
|
||||||
|
.map(status -> new InstrumentManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
instrumentManageInitDto.setStatusFlagOptions(statusEnumOptions);
|
||||||
|
// 获取仪器种类
|
||||||
|
List<InstrumentManageInitDto.InstrumentType> typeList = Stream.of(com.openhis.common.enums.InstrumentCategory.values())
|
||||||
|
.map(status -> new InstrumentManageInitDto.InstrumentType(status.getValue(), status.getInfo()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
instrumentManageInitDto.setInstrumentTypeList(typeList);
|
||||||
|
// 获取仪器状态
|
||||||
|
List<InstrumentManageInitDto.InstrumentStatusEnumOption> InstrumentStatusEnumOptions = Stream.of(com.openhis.common.enums.InstrumentStatus.values())
|
||||||
|
.map(status -> new InstrumentManageInitDto.InstrumentStatusEnumOption(status.getValue(), status.getInfo()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
instrumentManageInitDto.setInstrumentStatusEnumList(InstrumentStatusEnumOptions);
|
||||||
|
|
||||||
|
return R.ok(instrumentManageInitDto);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<?> getInstrumentPage(InstrumentSelParam InstrumentSelParam, String searchKey, Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
||||||
|
QueryWrapper<Instrument> queryWrapper = HisQueryUtils.buildQueryWrapper(InstrumentSelParam,
|
||||||
|
searchKey, new HashSet<>(Arrays.asList( "instrument_name", "instrument_name")), request);
|
||||||
|
Page<InstrumentManageDto> instrumentPage = HisPageUtils.selectPage(instrumentMapper, queryWrapper, pageNo, pageSize,InstrumentManageDto.class);
|
||||||
|
instrumentPage.getRecords().forEach(instrumentManageDto -> {
|
||||||
|
instrumentManageDto.setInstrumentTypeEnumText(EnumUtils.getInfoByValue(InstrumentCategory.class, instrumentManageDto.getInstrumentTypeEnum())) ;
|
||||||
|
});
|
||||||
|
|
||||||
|
return R.ok(instrumentPage);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<?> updateOrAddInstrument(Instrument instrument) {
|
||||||
|
instrumentService.saveOrUpdate( instrument);
|
||||||
|
return R.ok();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<?> getInstrumentOne(Long id)
|
||||||
|
{
|
||||||
|
Instrument byId = instrumentService.getById(id);
|
||||||
|
InstrumentManageDto dto = new InstrumentManageDto();
|
||||||
|
BeanUtils.copyProperties(byId,dto);
|
||||||
|
return R.ok(dto);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<?> editInstrumentStatus(List<Long> ids, Integer status) {
|
||||||
|
List<Instrument> instrumentList = new CopyOnWriteArrayList<>();
|
||||||
|
for (Long detail : ids) {
|
||||||
|
Instrument instrument = new Instrument();
|
||||||
|
instrument.setId(detail);
|
||||||
|
instrument.setUsageStatusEnum(status);
|
||||||
|
instrumentList.add(instrument);
|
||||||
|
}
|
||||||
|
return instrumentService.updateBatchById(instrumentList) ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"仪器信息"})) : R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
package com.openhis.web.Inspection.appservice.impl;
|
||||||
|
|
||||||
|
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.openhis.common.enums.AdministrativeGender;
|
||||||
|
import com.openhis.common.utils.EnumUtils;
|
||||||
|
import com.openhis.common.utils.HisQueryUtils;
|
||||||
|
import com.openhis.web.Inspection.appservice.ILaboratoryManageAppService;
|
||||||
|
import com.openhis.web.Inspection.dto.ReportResultManageDto;
|
||||||
|
import com.openhis.web.Inspection.mapper.LisReportMapper;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 样本采集
|
||||||
|
* @Author
|
||||||
|
* @Date 2025/10/16
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class LaboratoryManageAppService implements ILaboratoryManageAppService {
|
||||||
|
|
||||||
|
private final LisReportMapper reportMapper;
|
||||||
|
@Override
|
||||||
|
public R<?> getReportResultList(ReportResultManageDto reportResultManageDto, Integer pageNo, Integer pageSize, String searchKey, HttpServletRequest request) {
|
||||||
|
QueryWrapper<ReportResultManageDto> queryWrapper =
|
||||||
|
HisQueryUtils.buildQueryWrapper(reportResultManageDto,
|
||||||
|
searchKey, new HashSet<>(Arrays.asList( "patient_name", "charge_name")), request);
|
||||||
|
IPage<ReportResultManageDto> reportResultList = reportMapper.getReportResultList(new Page<>(pageNo, pageSize), queryWrapper);
|
||||||
|
Long total = reportMapper.getReportResultListTotal(new Page<>(pageNo, pageSize), queryWrapper);
|
||||||
|
reportResultList.getRecords().forEach(e -> {
|
||||||
|
// 性别
|
||||||
|
e.setGenderEnumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
|
||||||
|
});
|
||||||
|
if(total == null){
|
||||||
|
//总条数为null
|
||||||
|
total = 0L;
|
||||||
|
}
|
||||||
|
reportResultList.setTotal(total);
|
||||||
|
return R.ok(reportResultList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<?> getReportById(Long id) {
|
||||||
|
//根据id查询所有观测值
|
||||||
|
List<ReportResultManageDto> list = reportMapper.getReportListById(new QueryWrapper<ReportResultManageDto>().eq("id", id));
|
||||||
|
//打印组件配置
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,188 @@
|
|||||||
|
package com.openhis.web.Inspection.appservice.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.core.common.core.domain.R;
|
||||||
|
import com.core.common.utils.SecurityUtils;
|
||||||
|
import com.openhis.administration.domain.Device;
|
||||||
|
import com.openhis.administration.domain.DeviceDefinition;
|
||||||
|
import com.openhis.administration.domain.ObservationDefinition;
|
||||||
|
import com.openhis.administration.domain.SpecimenDefinition;
|
||||||
|
import com.openhis.administration.service.IDeviceDefinitionService;
|
||||||
|
import com.openhis.administration.service.IDeviceService;
|
||||||
|
import com.openhis.administration.service.IObservationDefinitionService;
|
||||||
|
import com.openhis.administration.service.ISpecimenDefinitionService;
|
||||||
|
import com.openhis.common.enums.SpecCollectStatus;
|
||||||
|
import com.openhis.common.utils.HisQueryUtils;
|
||||||
|
import com.openhis.lab.domain.*;
|
||||||
|
import com.openhis.lab.mapper.ActivityDefDeviceDefMapper;
|
||||||
|
import com.openhis.lab.mapper.ActivityDefObservationDefMapper;
|
||||||
|
import com.openhis.lab.mapper.ActivityDefSpecimenDefMapper;
|
||||||
|
import com.openhis.lab.service.IObservationService;
|
||||||
|
import com.openhis.lab.service.ISpecimenService;
|
||||||
|
import com.openhis.web.Inspection.appservice.ILisConfigManageAppService;
|
||||||
|
import com.openhis.web.Inspection.dto.LisConfigManageDto;
|
||||||
|
import com.openhis.web.Inspection.dto.LisConfigManageInitDto;
|
||||||
|
import com.openhis.web.datadictionary.dto.DiagnosisTreatmentDto;
|
||||||
|
import com.openhis.web.datadictionary.dto.DiagnosisTreatmentSelParam;
|
||||||
|
import com.openhis.web.datadictionary.mapper.ActivityDefinitionManageMapper;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.val;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description TODO
|
||||||
|
* @Author
|
||||||
|
* @Date 2025/9/29
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class LisConfigManageAppServiceImpl implements ILisConfigManageAppService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ActivityDefinitionManageMapper activityDefinitionManageMapper;
|
||||||
|
@Resource
|
||||||
|
private ActivityDefDeviceDefMapper activityDefDeviceDefMapper;
|
||||||
|
@Resource
|
||||||
|
private ActivityDefObservationDefMapper activityDefObservationDefMapper;
|
||||||
|
@Resource
|
||||||
|
private ActivityDefSpecimenDefMapper activityDefSpecimenDefMapper;
|
||||||
|
@Resource
|
||||||
|
private IDeviceDefinitionService deviceDefinitionService;
|
||||||
|
@Resource
|
||||||
|
private ISpecimenDefinitionService specimenDefinitionService;
|
||||||
|
@Resource
|
||||||
|
private IObservationDefinitionService observationDefinitionService;
|
||||||
|
@Resource
|
||||||
|
private IObservationService observationService;
|
||||||
|
@Resource
|
||||||
|
private ISpecimenService specimenService;
|
||||||
|
@Resource
|
||||||
|
private IDeviceService deviceService;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<?> getDiseaseTreatmentPage(DiagnosisTreatmentSelParam DiagnosisTreatmentSelParam, String searchKey, Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
||||||
|
// 构建查询条件
|
||||||
|
QueryWrapper<DiagnosisTreatmentDto> queryWrapper = HisQueryUtils.buildQueryWrapper(DiagnosisTreatmentSelParam,
|
||||||
|
searchKey, new HashSet<>(Arrays.asList("bus_no", "name", "py_str", "wb_str")), request);
|
||||||
|
|
||||||
|
// 分页查询
|
||||||
|
IPage<DiagnosisTreatmentDto> diseaseTreatmentPage =
|
||||||
|
activityDefinitionManageMapper.getDiseaseTreatmentPage(new Page<>(pageNo, pageSize), queryWrapper);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return R.ok(diseaseTreatmentPage);
|
||||||
|
}
|
||||||
|
|
||||||
|
public R<?> getInfoList(String searchKey, String type) {
|
||||||
|
LisConfigManageInitDto initDto = new LisConfigManageInitDto();
|
||||||
|
initDto.setDeviceDefs(deviceDefinitionService.list());
|
||||||
|
initDto.setObservationDefs(observationDefinitionService.list());
|
||||||
|
initDto.setSpecimenDefs(specimenDefinitionService.list());
|
||||||
|
if (searchKey == null || searchKey.isEmpty()) {
|
||||||
|
// 如果searchKey为空,则查询所有
|
||||||
|
return switch (type) {
|
||||||
|
case "device" -> R.ok(deviceDefinitionService.list(new QueryWrapper<DeviceDefinition>().eq("status_enum",2)));
|
||||||
|
case "observation" -> R.ok(observationDefinitionService.list(new QueryWrapper<ObservationDefinition>().eq("status_enum",2) ));
|
||||||
|
case "specimen" -> R.ok(specimenDefinitionService.list(new QueryWrapper<SpecimenDefinition>().eq("status_enum",2)));
|
||||||
|
default -> R.ok(initDto);
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
// 如果searchKey不为空,则根据name模糊查询
|
||||||
|
return switch (type) {
|
||||||
|
case "device" ->
|
||||||
|
R.ok(deviceDefinitionService.list((new QueryWrapper<DeviceDefinition>().like("name", searchKey).eq("status_enum",2))));
|
||||||
|
case "observation" ->
|
||||||
|
R.ok(observationDefinitionService.list((new QueryWrapper<ObservationDefinition>().like("name", searchKey).eq("status_enum",2))));
|
||||||
|
case "specimen" ->
|
||||||
|
R.ok(specimenDefinitionService.list((new QueryWrapper<SpecimenDefinition>().like("name", searchKey).eq("status_enum",2))));
|
||||||
|
default -> R.ok();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<?> getInfoDetail(Long id) {
|
||||||
|
LisConfigManageDto manageDto = new LisConfigManageDto();
|
||||||
|
manageDto.setActivityDefDeviceDefs(activityDefDeviceDefMapper.selectList(new QueryWrapper<ActivityDefDeviceDef>().eq("activity_definition_id", id)));
|
||||||
|
manageDto.setActivityDefObservationDefs(activityDefObservationDefMapper.selectList(new QueryWrapper<ActivityDefObservationDef>().eq("activity_definition_id", id)));
|
||||||
|
manageDto.setActivityDefSpecimenDefs(activityDefSpecimenDefMapper.selectList(new QueryWrapper<ActivityDefSpecimenDef>().eq("activity_definition_id", id)));
|
||||||
|
return R.ok(manageDto);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<?> saveAll(LisConfigManageDto manageDto) {
|
||||||
|
//先全部删除项目下详情
|
||||||
|
activityDefDeviceDefMapper.delete(new QueryWrapper<ActivityDefDeviceDef>().eq("activity_definition_id", manageDto.getId()));
|
||||||
|
activityDefObservationDefMapper.delete(new QueryWrapper<ActivityDefObservationDef>().eq("activity_definition_id", manageDto.getId()));
|
||||||
|
activityDefSpecimenDefMapper.delete(new QueryWrapper<ActivityDefSpecimenDef>().eq("activity_definition_id", manageDto.getId()));
|
||||||
|
Integer tenantId = SecurityUtils.getLoginUser().getTenantId();
|
||||||
|
// 根据ID查询【诊疗目录】详情
|
||||||
|
DiagnosisTreatmentDto diseaseTreatmentOne = activityDefinitionManageMapper.getDiseaseTreatmentOne(manageDto.getId(), tenantId);
|
||||||
|
manageDto.getActivityDefDeviceDefs().forEach(activityDefDeviceDef -> {
|
||||||
|
activityDefDeviceDef.setActivityDefinitionId(manageDto.getId());
|
||||||
|
activityDefDeviceDef.setActivityDefinitionName(diseaseTreatmentOne.getName());
|
||||||
|
activityDefDeviceDefMapper.insert(activityDefDeviceDef);
|
||||||
|
});
|
||||||
|
manageDto.getActivityDefObservationDefs().forEach(activityDefObservationDef -> {
|
||||||
|
activityDefObservationDef.setActivityDefinitionId(manageDto.getId());
|
||||||
|
activityDefObservationDef.setActivityDefinitionName(diseaseTreatmentOne.getName());
|
||||||
|
activityDefObservationDefMapper.insert(activityDefObservationDef);
|
||||||
|
});
|
||||||
|
manageDto.getActivityDefSpecimenDefs().forEach(activityDefSpecimenDef -> {
|
||||||
|
activityDefSpecimenDef.setActivityDefinitionId(manageDto.getId());
|
||||||
|
activityDefSpecimenDef.setActivityDefinitionName(diseaseTreatmentOne.getName());
|
||||||
|
activityDefSpecimenDefMapper.insert(activityDefSpecimenDef);
|
||||||
|
});
|
||||||
|
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<?> createAll(Long patientId,Long ServiceId, Long itemId) {
|
||||||
|
// 根据ID查询检查项目详情
|
||||||
|
List<ActivityDefDeviceDef> devices = activityDefDeviceDefMapper.selectList(new QueryWrapper<ActivityDefDeviceDef>().eq("activity_definition_id", itemId));
|
||||||
|
List<ActivityDefObservationDef> observations= activityDefObservationDefMapper.selectList(new QueryWrapper<ActivityDefObservationDef>().eq("activity_definition_id", itemId));
|
||||||
|
List<ActivityDefSpecimenDef> specimens = activityDefSpecimenDefMapper.selectList(new QueryWrapper<ActivityDefSpecimenDef>().eq("activity_definition_id", itemId));
|
||||||
|
devices.forEach(activityDefDeviceDef -> {
|
||||||
|
Device device = new Device();
|
||||||
|
device.setDeviceDefId(activityDefDeviceDef.getDeviceDefinitionId());
|
||||||
|
device.setName(activityDefDeviceDef.getDeviceDefinitionName());
|
||||||
|
//TODO 器材实体待完善,生成器材请求
|
||||||
|
|
||||||
|
});
|
||||||
|
observations.forEach(activityDefObservationDef -> {
|
||||||
|
Observation observation = new Observation();
|
||||||
|
//TODO 初始字段具体观测定义字段待完善
|
||||||
|
observation.setPatientId(patientId);
|
||||||
|
observation.setObservationDefinitionId(activityDefObservationDef.getObservationDefinitionId());
|
||||||
|
observationService.save(observation);
|
||||||
|
});
|
||||||
|
specimens.forEach(activityDefSpecimenDef -> {
|
||||||
|
Specimen specimen = new Specimen();
|
||||||
|
//TODO 初始字段具体标本定义字段待完善
|
||||||
|
specimen.setServiceId(ServiceId);
|
||||||
|
specimen.setSpecimenDefinitionId(activityDefSpecimenDef.getSpecimenDefinitionId());
|
||||||
|
specimen.setPatientId(patientId);
|
||||||
|
specimen.setCollectionStatusEnum(SpecCollectStatus.PENDING.getValue());
|
||||||
|
specimen.setSpecimenUnit(activityDefSpecimenDef.getSpecimenUnit());
|
||||||
|
specimen.setSpecimenVolume(activityDefSpecimenDef.getSpecimenVolume());
|
||||||
|
specimenService.save(specimen);
|
||||||
|
});
|
||||||
|
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,122 @@
|
|||||||
|
package com.openhis.web.Inspection.appservice.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.core.common.core.domain.R;
|
||||||
|
|
||||||
|
import com.core.common.utils.MessageUtils;
|
||||||
|
import com.core.common.utils.bean.BeanUtils;
|
||||||
|
import com.openhis.administration.domain.ObservationDefinition;
|
||||||
|
import com.openhis.administration.mapper.ObservationDefinitionMapper;
|
||||||
|
import com.openhis.administration.service.IInstrumentService;
|
||||||
|
import com.openhis.administration.service.IObservationDefinitionService;
|
||||||
|
import com.openhis.common.constant.PromptMsgConstant;
|
||||||
|
import com.core.common.enums.DelFlag;
|
||||||
|
import com.openhis.common.enums.ObservationType;
|
||||||
|
import com.openhis.common.enums.PublicationStatus;
|
||||||
|
import com.openhis.common.utils.EnumUtils;
|
||||||
|
import com.openhis.common.utils.HisPageUtils;
|
||||||
|
import com.openhis.common.utils.HisQueryUtils;
|
||||||
|
import com.openhis.web.Inspection.appservice.IObservationManageAppService;
|
||||||
|
import com.openhis.web.Inspection.dto.ObservationDefManageDto;
|
||||||
|
import com.openhis.web.Inspection.dto.ObservationDefManageInitDto;
|
||||||
|
import com.openhis.web.Inspection.dto.ObservationDefSelParam;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.concurrent.CopyOnWriteArrayList;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description TODO
|
||||||
|
* @Author
|
||||||
|
* @Date 2025/9/23
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class ObservationManageAppServiceImpl implements IObservationManageAppService
|
||||||
|
{
|
||||||
|
private final ObservationDefinitionMapper observationDefinitionMapper;
|
||||||
|
|
||||||
|
private final IObservationDefinitionService observationDefinitionService;
|
||||||
|
|
||||||
|
private final IInstrumentService instrumentService;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<?> getManageInit() {
|
||||||
|
|
||||||
|
ObservationDefManageInitDto observationDefManageInitDto = new ObservationDefManageInitDto();
|
||||||
|
// 获取状态
|
||||||
|
List<ObservationDefManageInitDto.statusEnumOption> statusEnumOptions = Stream.of(PublicationStatus.values())
|
||||||
|
.map(status -> new ObservationDefManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
observationDefManageInitDto.setStatusFlagOptions(statusEnumOptions);
|
||||||
|
//观测类型
|
||||||
|
List<ObservationDefManageInitDto.ObservationTypeEnumOption> ObservationTypeEnumOptions = Stream.of(com.openhis.common.enums.ObservationType.values())
|
||||||
|
.map(status -> new ObservationDefManageInitDto.ObservationTypeEnumOption(status.getValue(), status.getInfo()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
observationDefManageInitDto.setObservationTypeList(ObservationTypeEnumOptions);
|
||||||
|
//仪器列表
|
||||||
|
List<ObservationDefManageInitDto.InstrumentEnumOption> InstrumentEnumOptions = instrumentService.list().stream()
|
||||||
|
.map(status -> new ObservationDefManageInitDto.InstrumentEnumOption(status.getId(), status.getInstrumentName()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
observationDefManageInitDto.setInstrumentEnumOptionList(InstrumentEnumOptions);
|
||||||
|
return R.ok(observationDefManageInitDto);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<?> getObservationDefPage(ObservationDefSelParam ObservationDefSelParam, String searchKey, Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
||||||
|
|
||||||
|
QueryWrapper<ObservationDefinition> queryWrapper = HisQueryUtils.buildQueryWrapper(ObservationDefSelParam,
|
||||||
|
searchKey, new HashSet<>(Arrays.asList( "name", "code")), request);
|
||||||
|
Page<ObservationDefManageDto> ObservationPage = HisPageUtils.selectPage(observationDefinitionMapper, queryWrapper, pageNo, pageSize, ObservationDefManageDto.class);
|
||||||
|
ObservationPage.getRecords().forEach(item -> {
|
||||||
|
item.setInstrumentId_dictText(instrumentService.getById(item.getInstrumentId()).getInstrumentName());
|
||||||
|
item.setStatusEnumText(EnumUtils.getInfoByValue(PublicationStatus.class, item.getStatusEnum()));
|
||||||
|
item.setObservationTypeEnumText(EnumUtils.getInfoByValue(ObservationType.class, item.getObservationTypeEnum()));
|
||||||
|
});
|
||||||
|
|
||||||
|
return R.ok(ObservationPage);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<?> updateOrAddObservationDef(ObservationDefinition Observation) {
|
||||||
|
Observation.setDeleteFlag(DelFlag.NO.getCode());
|
||||||
|
observationDefinitionService.saveOrUpdate(Observation);
|
||||||
|
return R.ok(" 添加成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<?> getObservationDefOne(Long id) {
|
||||||
|
ObservationDefinition observationDefinition = observationDefinitionService.getById(id);
|
||||||
|
ObservationDefManageDto dto = new ObservationDefManageDto();
|
||||||
|
BeanUtils.copyProperties(observationDefinition,dto);
|
||||||
|
return R.ok(dto);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<?> editObservationDefStatus(List<Long> ids, Integer status) {
|
||||||
|
List<ObservationDefinition> observationDefinitionList = new CopyOnWriteArrayList<>();
|
||||||
|
for (Long detail : ids) {
|
||||||
|
ObservationDefinition observationDefinition = new ObservationDefinition();
|
||||||
|
observationDefinition.setId(detail);
|
||||||
|
observationDefinition.setStatusEnum(status);
|
||||||
|
observationDefinitionList.add(observationDefinition);
|
||||||
|
}
|
||||||
|
return observationDefinitionService.updateBatchById(observationDefinitionList) ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"观测信息"}))
|
||||||
|
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,105 @@
|
|||||||
|
package com.openhis.web.Inspection.appservice.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.core.common.core.domain.R;
|
||||||
|
import com.openhis.common.enums.AdministrativeGender;
|
||||||
|
import com.openhis.common.enums.SpecCollectStatus;
|
||||||
|
import com.openhis.common.utils.EnumUtils;
|
||||||
|
import com.openhis.common.utils.HisQueryUtils;
|
||||||
|
import com.openhis.lab.domain.Specimen;
|
||||||
|
import com.openhis.lab.service.ISpecimenService;
|
||||||
|
import com.openhis.web.Inspection.appservice.ISampleCollectAppManageAppService;
|
||||||
|
import com.openhis.web.Inspection.dto.SampleCollectManageDto;
|
||||||
|
import com.openhis.web.Inspection.dto.SampleCollectStatusRequest;
|
||||||
|
import com.openhis.web.Inspection.mapper.SampleCollectMapper;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 样本采集
|
||||||
|
* @Author
|
||||||
|
* @Date 2025/10/16
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class SampleCollectManageAppService implements ISampleCollectAppManageAppService {
|
||||||
|
|
||||||
|
private final SampleCollectMapper sampleCollectMapper;
|
||||||
|
|
||||||
|
private final ISpecimenService specimenService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<?> getSampleCollectList(SampleCollectManageDto sampleCollectManageDto, Integer pageNo, Integer pageSize, String searchKey, HttpServletRequest request) {
|
||||||
|
QueryWrapper<SampleCollectManageDto> queryWrapper =
|
||||||
|
HisQueryUtils.buildQueryWrapper(sampleCollectManageDto,
|
||||||
|
searchKey, new HashSet<>(Arrays.asList( "patient_name", "charge_name")), request);
|
||||||
|
IPage<SampleCollectManageDto> sampleCollectList = sampleCollectMapper.getSampleCollectList(new Page<>(pageNo, pageSize), queryWrapper);
|
||||||
|
Long total = sampleCollectMapper.getSampleCollectListTotal(new Page<>(pageNo, pageSize), queryWrapper);
|
||||||
|
sampleCollectList.getRecords().forEach(e -> {
|
||||||
|
// 性别
|
||||||
|
e.setGenderEnumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
|
||||||
|
// 采集状态
|
||||||
|
e.setCollectionStatusEnumText(EnumUtils.getInfoByValue(SpecCollectStatus.class, e.getCollectionStatusEnum()));
|
||||||
|
});
|
||||||
|
if(total == null){
|
||||||
|
//总条数为null
|
||||||
|
total = 0L;
|
||||||
|
}
|
||||||
|
sampleCollectList.setTotal(total);
|
||||||
|
return R.ok(sampleCollectList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<?> updateSampleStatus(SampleCollectStatusRequest statusRequest) {
|
||||||
|
// 根据状态类型设置对应的状态值
|
||||||
|
Integer status = switch (statusRequest.getType()) {
|
||||||
|
case "待采集" -> SpecCollectStatus.PENDING.getValue();
|
||||||
|
case "已采集" -> SpecCollectStatus.COLLECTED.getValue();
|
||||||
|
case "已接收" -> SpecCollectStatus.RECEIVED.getValue();
|
||||||
|
default -> 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 批量更新样本状态
|
||||||
|
specimenService.listByIds(statusRequest.getIds()).forEach(specimen -> {
|
||||||
|
Integer currentStatus = specimen.getCollectionStatusEnum(); // 获取当前样本状态
|
||||||
|
// 如果传入状态是已接收,但当前状态是待采集,跳过更新
|
||||||
|
if (Objects.equals(status, SpecCollectStatus.RECEIVED.getValue()) && Objects.equals(currentStatus, SpecCollectStatus.PENDING.getValue())) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 构建更新条件
|
||||||
|
UpdateWrapper<Specimen> updateWrapper = new UpdateWrapper<>();
|
||||||
|
updateWrapper.in("id", statusRequest.getIds()) // 设置批量更新的条件
|
||||||
|
.set("collection_status_enum", status); // 设置更新的状态字段
|
||||||
|
// 如果状态为已采集,且采集日期不为空,跳过采集日期的更新,仅更新状态
|
||||||
|
if (Objects.equals(status, SpecCollectStatus.COLLECTED.getValue())) {
|
||||||
|
if (specimen.getCollectionDate() == null) {
|
||||||
|
// 如果采集日期为空,则设置当前日期
|
||||||
|
updateWrapper.set("collection_date", new Date());
|
||||||
|
}
|
||||||
|
updateWrapper.set("received_date", null);
|
||||||
|
} else if (Objects.equals(status, SpecCollectStatus.PENDING.getValue())) {
|
||||||
|
updateWrapper.set("collection_date", null); // 清空采集日期
|
||||||
|
} else if (Objects.equals(status, SpecCollectStatus.RECEIVED.getValue())) {
|
||||||
|
updateWrapper.set("received_date", new Date());
|
||||||
|
}
|
||||||
|
// 执行更新
|
||||||
|
specimenService.update(updateWrapper);
|
||||||
|
});
|
||||||
|
if (Objects.equals(status, SpecCollectStatus.RECEIVED.getValue())) {
|
||||||
|
// TODO 接收样本后续逻辑
|
||||||
|
System.err.println("接收样本后!!");
|
||||||
|
|
||||||
|
}
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,110 @@
|
|||||||
|
package com.openhis.web.Inspection.appservice.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.core.common.core.domain.R;
|
||||||
|
import com.core.common.utils.MessageUtils;
|
||||||
|
import com.openhis.administration.domain.SpecimenDefinition;
|
||||||
|
import com.openhis.administration.mapper.SpecimenDefinitionMapper;
|
||||||
|
import com.openhis.administration.service.ISpecimenDefinitionService;
|
||||||
|
import com.openhis.common.constant.PromptMsgConstant;
|
||||||
|
import com.openhis.common.enums.PublicationStatus;
|
||||||
|
import com.openhis.common.enums.SpecimenType;
|
||||||
|
import com.openhis.common.utils.EnumUtils;
|
||||||
|
import com.openhis.common.utils.HisPageUtils;
|
||||||
|
import com.openhis.common.utils.HisQueryUtils;
|
||||||
|
import com.openhis.web.Inspection.appservice.ISpecimenManageAppService;
|
||||||
|
import com.openhis.web.Inspection.dto.SpecimenDefManageDto;
|
||||||
|
import com.openhis.web.Inspection.dto.SpecimenDefManageInitDto;
|
||||||
|
import com.openhis.web.Inspection.dto.SpecimenDefSelParam;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.concurrent.CopyOnWriteArrayList;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description
|
||||||
|
* @Author
|
||||||
|
* @Date 2025/9/9
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class SpecimenManageAppServiceImpl implements ISpecimenManageAppService {
|
||||||
|
|
||||||
|
private final SpecimenDefinitionMapper specimenDefinitionMapper;
|
||||||
|
|
||||||
|
private final ISpecimenDefinitionService specimenDefinitionService;
|
||||||
|
@Override
|
||||||
|
public R<?> getManageInit() {
|
||||||
|
SpecimenDefManageInitDto specimenDefManageInitDto = new SpecimenDefManageInitDto();
|
||||||
|
|
||||||
|
// 获取状态
|
||||||
|
List<SpecimenDefManageInitDto.statusEnumOption> statusEnumOptions = Stream.of(PublicationStatus.values())
|
||||||
|
.map(status -> new SpecimenDefManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
specimenDefManageInitDto.setStatusFlagOptions(statusEnumOptions);
|
||||||
|
// 获取录种类
|
||||||
|
List<SpecimenDefManageInitDto.SpecimenType> typeList = Stream.of(SpecimenType.values())
|
||||||
|
.map(status -> new SpecimenDefManageInitDto.SpecimenType(status.getValue(), status.getInfo()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
specimenDefManageInitDto.setSpecimenTypeList(typeList);
|
||||||
|
|
||||||
|
|
||||||
|
return R.ok(specimenDefManageInitDto);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 样本目录查询
|
||||||
|
* @param SpecimenDefSelParam 查询条件
|
||||||
|
* @param searchKey 查询条件-模糊查询
|
||||||
|
* @param pageNo 查询条件
|
||||||
|
* @param pageSize 查询条件
|
||||||
|
* @param request
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public R<?> getSpecimenPage(SpecimenDefSelParam SpecimenDefSelParam, String searchKey, Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
||||||
|
|
||||||
|
QueryWrapper<SpecimenDefinition> queryWrapper = HisQueryUtils.buildQueryWrapper(SpecimenDefSelParam,
|
||||||
|
searchKey, new HashSet<>(Arrays.asList("custom_code", "specimen_name", "py_str", "wb_str")), request);
|
||||||
|
Page<SpecimenDefManageDto> specimenPage = HisPageUtils.selectPage(specimenDefinitionMapper, queryWrapper, pageNo, pageSize, SpecimenDefManageDto.class);
|
||||||
|
specimenPage.getRecords().forEach(specimenDefManageDto -> {
|
||||||
|
specimenDefManageDto.setSpecimenTypeEnumText(EnumUtils.getInfoByValue(SpecimenType.class, specimenDefManageDto.getSpecimenTypeEnum())) ;
|
||||||
|
specimenDefManageDto.setStatusEnumText(EnumUtils.getInfoByValue(PublicationStatus.class, specimenDefManageDto.getStatusEnum()));
|
||||||
|
});
|
||||||
|
return R.ok(specimenPage);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<?> updateOrAddSpecimen(SpecimenDefinition specimenDefinition) {
|
||||||
|
specimenDefinitionService.saveOrUpdate(specimenDefinition);
|
||||||
|
return R.ok(" 添加成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<?> getSpecimenOne(Long id) {
|
||||||
|
SpecimenDefinition specimenDefinition = specimenDefinitionService.getById(id);
|
||||||
|
return R.ok(specimenDefinition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<?> editSpecimenStatus(List<Long> ids, Integer status) {
|
||||||
|
List<SpecimenDefinition> specimenDefinitionList = new CopyOnWriteArrayList<>();
|
||||||
|
for (Long detail : ids) {
|
||||||
|
SpecimenDefinition specimenDefinition = new SpecimenDefinition();
|
||||||
|
specimenDefinition.setId(detail);
|
||||||
|
specimenDefinition.setStatusEnum(status);
|
||||||
|
specimenDefinitionList.add(specimenDefinition);
|
||||||
|
}
|
||||||
|
return specimenDefinitionService.updateBatchById(specimenDefinitionList) ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"样本信息"}))
|
||||||
|
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
package com.openhis.web.Inspection.controller;
|
||||||
|
|
||||||
|
import com.core.common.core.domain.R;
|
||||||
|
import com.openhis.administration.domain.Instrument;
|
||||||
|
import com.core.common.enums.DelFlag;
|
||||||
|
import com.openhis.common.enums.PublicationStatus;
|
||||||
|
import com.openhis.web.Inspection.appservice.IInstrumentManageAppService;
|
||||||
|
import com.openhis.web.Inspection.dto.InstrumentSelParam;
|
||||||
|
import com.openhis.web.Inspection.dto.InstrumentStatusRequest;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 仪器器材信息
|
||||||
|
* @Author
|
||||||
|
* @Date 2025/9/18
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/inspection/instrument")
|
||||||
|
@Slf4j
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class InstrumentController {
|
||||||
|
|
||||||
|
|
||||||
|
private final IInstrumentManageAppService appService;
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/init")
|
||||||
|
public R<?> getDiseaseTreatmentInit() {
|
||||||
|
return appService.getManageInit();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询样本类型分页列表
|
||||||
|
*
|
||||||
|
* @param pageNo 当前页码
|
||||||
|
* @param pageSize 查询条数
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/information-page")
|
||||||
|
public R<?> getInstrumentPage(InstrumentSelParam InstrumentSelParam,
|
||||||
|
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||||
|
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||||
|
return appService.getInstrumentPage(InstrumentSelParam,searchKey, pageNo, pageSize, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/information")
|
||||||
|
public R<?> editInstrument(@Validated @RequestBody Instrument instrument) {
|
||||||
|
instrument.setDeleteFlag(DelFlag.NO.getCode());
|
||||||
|
|
||||||
|
return appService.updateOrAddInstrument(instrument);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/information-one")
|
||||||
|
public R<?> getInstrument(@RequestParam Long id) {
|
||||||
|
return appService.getInstrumentOne(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/information-status")
|
||||||
|
public R<?> updateInstrumentStatus( @RequestBody InstrumentStatusRequest InstrumentStatusRequest ) {
|
||||||
|
//默认停用
|
||||||
|
Integer status = PublicationStatus.RETIRED.getValue();
|
||||||
|
if("启用".equals( InstrumentStatusRequest.getType())){
|
||||||
|
status = PublicationStatus.ACTIVE.getValue();
|
||||||
|
}
|
||||||
|
return appService.editInstrumentStatus(InstrumentStatusRequest.getIds(),status);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package com.openhis.web.Inspection.controller;
|
||||||
|
|
||||||
|
import com.core.common.core.domain.R;
|
||||||
|
import com.openhis.web.Inspection.appservice.ILaboratoryManageAppService;
|
||||||
|
import com.openhis.web.Inspection.dto.ReportResultManageDto;
|
||||||
|
import com.openhis.web.Inspection.dto.SampleCollectManageDto;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 检测中心相关
|
||||||
|
* @Author
|
||||||
|
* @Date 2025/10/24
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/inspection/laboratory")
|
||||||
|
@Slf4j
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class LaboratoryController {
|
||||||
|
private final ILaboratoryManageAppService appService;
|
||||||
|
|
||||||
|
@GetMapping("/information-page")
|
||||||
|
public R<?> getReportResultPage(ReportResultManageDto reportResultManageDto, @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
|
||||||
|
@RequestParam(name = "searchKey", required = false) String searchKey, HttpServletRequest request) {
|
||||||
|
return appService.getReportResultList( reportResultManageDto, pageNo, pageSize, searchKey, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public R<?> getReportById(@PathVariable Long id) {
|
||||||
|
// 调用 ReportService 获取报告数据
|
||||||
|
return appService.getReportById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
package com.openhis.web.Inspection.controller;
|
||||||
|
|
||||||
|
import com.core.common.core.domain.R;
|
||||||
|
import com.openhis.web.Inspection.appservice.ILisConfigManageAppService;
|
||||||
|
import com.openhis.web.Inspection.dto.LisConfigManageDto;
|
||||||
|
import com.openhis.web.datadictionary.dto.DiagnosisTreatmentSelParam;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 检验定义配置
|
||||||
|
* @Author
|
||||||
|
* @Date 2025/9/29
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/inspection/lisConfig")
|
||||||
|
@Slf4j
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class LisConfigController {
|
||||||
|
|
||||||
|
|
||||||
|
private ILisConfigManageAppService lisConfigManageAppService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 获取检验项目列表
|
||||||
|
* @Author
|
||||||
|
* @Date 2025/9/29
|
||||||
|
*/
|
||||||
|
@RequestMapping("/init-page")
|
||||||
|
public R<?> getDiseaseTreatmentList(DiagnosisTreatmentSelParam DiagnosisTreatmentSelParam, String searchKey,
|
||||||
|
Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
||||||
|
return lisConfigManageAppService.getDiseaseTreatmentPage(DiagnosisTreatmentSelParam, searchKey, pageNo, pageSize, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据项目id获取详细
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping ("/info-detail")
|
||||||
|
public R<?> getInfoDetail(Long id) {
|
||||||
|
return lisConfigManageAppService.getInfoDetail(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping ("/init-list")
|
||||||
|
public R<?> getInfoList(String searchKey,String type) {
|
||||||
|
return lisConfigManageAppService.getInfoList(searchKey, type);
|
||||||
|
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 修改检验配置
|
||||||
|
* @param
|
||||||
|
* @param manageDto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/saveAll")
|
||||||
|
public R<?> saveInfo(@RequestBody LisConfigManageDto manageDto) {
|
||||||
|
|
||||||
|
return lisConfigManageAppService.saveAll(manageDto);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
package com.openhis.web.Inspection.controller;
|
||||||
|
|
||||||
|
import com.core.common.core.domain.R;
|
||||||
|
import com.openhis.administration.domain.ObservationDefinition;
|
||||||
|
import com.core.common.enums.DelFlag;
|
||||||
|
import com.openhis.common.enums.PublicationStatus;
|
||||||
|
import com.openhis.web.Inspection.appservice.IObservationManageAppService;
|
||||||
|
import com.openhis.web.Inspection.dto.ObservationDefSelParam;
|
||||||
|
import com.openhis.web.Inspection.dto.ObservationDefStatusRequest;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 仪器器材信息
|
||||||
|
* @Author
|
||||||
|
* @Date 2025/9/18
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/inspection/observation")
|
||||||
|
@Slf4j
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class ObservationDefController {
|
||||||
|
|
||||||
|
|
||||||
|
private final IObservationManageAppService appService;
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/init")
|
||||||
|
public R<?> getTreatmentInit() {
|
||||||
|
return appService.getManageInit();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询样本类型分页列表
|
||||||
|
*
|
||||||
|
* @param pageNo 当前页码
|
||||||
|
* @param pageSize 查询条数
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/information-page")
|
||||||
|
public R<?> getObservationPage(ObservationDefSelParam observationDefSelParam,
|
||||||
|
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||||
|
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||||
|
return appService.getObservationDefPage(observationDefSelParam,searchKey, pageNo, pageSize, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/information")
|
||||||
|
public R<?> editObservation(@Validated @RequestBody ObservationDefinition observation) {
|
||||||
|
observation.setDeleteFlag(DelFlag.NO.getCode());
|
||||||
|
|
||||||
|
return appService.updateOrAddObservationDef(observation);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/information-one")
|
||||||
|
public R<?> getObservation(@RequestParam Long id) {
|
||||||
|
return appService.getObservationDefOne(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/information-status")
|
||||||
|
public R<?> updateObservationStatus( @RequestBody ObservationDefStatusRequest observationDefStatusRequest) {
|
||||||
|
//默认停用
|
||||||
|
Integer status = PublicationStatus.RETIRED.getValue();
|
||||||
|
if("启用".equals( observationDefStatusRequest.getType())){
|
||||||
|
status = PublicationStatus.ACTIVE.getValue();
|
||||||
|
}
|
||||||
|
return appService.editObservationDefStatus(observationDefStatusRequest.getIds(),status);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package com.openhis.web.Inspection.controller;
|
||||||
|
|
||||||
|
import com.core.common.core.domain.R;
|
||||||
|
import com.openhis.common.enums.PublicationStatus;
|
||||||
|
import com.openhis.web.Inspection.appservice.ISampleCollectAppManageAppService;
|
||||||
|
import com.openhis.web.Inspection.dto.SampleCollectManageDto;
|
||||||
|
import com.openhis.web.Inspection.dto.SampleCollectStatusRequest;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 样本采集
|
||||||
|
* @Author
|
||||||
|
* @Date 2025/10/16
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/inspection/collection")
|
||||||
|
@Slf4j
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class SampleCollectController {
|
||||||
|
|
||||||
|
private final ISampleCollectAppManageAppService appService;
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/information-page")
|
||||||
|
public R<?> getSampleCollectPage(SampleCollectManageDto sampleCollectManageDto,@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
|
||||||
|
@RequestParam(name = "searchKey", required = false) String searchKey, HttpServletRequest request) {
|
||||||
|
return appService.getSampleCollectList( sampleCollectManageDto, pageNo, pageSize, searchKey, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/information-status")
|
||||||
|
public R<?> editSampleCollectStatus(@RequestBody SampleCollectStatusRequest statusRequest) {
|
||||||
|
return appService.updateSampleStatus(statusRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
package com.openhis.web.Inspection.controller;
|
||||||
|
|
||||||
|
import com.core.common.core.domain.R;
|
||||||
|
import com.openhis.administration.domain.SpecimenDefinition;
|
||||||
|
import com.core.common.enums.DelFlag;
|
||||||
|
import com.openhis.common.enums.PublicationStatus;
|
||||||
|
import com.openhis.web.Inspection.appservice.ISpecimenManageAppService;
|
||||||
|
import com.openhis.web.Inspection.dto.SpecimenDefSelParam;
|
||||||
|
import com.openhis.web.Inspection.dto.SpecimenDefStatusRequest;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 样本定义相关
|
||||||
|
* @Author
|
||||||
|
* @Date 2025/9/9
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/inspection/specimen")
|
||||||
|
@Slf4j
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class SpecimenDefController {
|
||||||
|
|
||||||
|
private final ISpecimenManageAppService specimenManageAppService;
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/init")
|
||||||
|
public R<?> getDiseaseTreatmentInit() {
|
||||||
|
return specimenManageAppService.getManageInit();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询样本类型分页列表
|
||||||
|
*
|
||||||
|
* @param pageNo 当前页码
|
||||||
|
* @param pageSize 查询条数
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/information-page")
|
||||||
|
public R<?> getSpecimenPage(SpecimenDefSelParam specimenDefSelParam,
|
||||||
|
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||||
|
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||||
|
return specimenManageAppService.getSpecimenPage(specimenDefSelParam,searchKey, pageNo, pageSize, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/information")
|
||||||
|
public R<?> editSpecimen(@Validated @RequestBody SpecimenDefinition specimenDefinition) {
|
||||||
|
specimenDefinition.setStatusEnum( PublicationStatus.ACTIVE.getValue());
|
||||||
|
specimenDefinition.setDeleteFlag(DelFlag.NO.getCode());
|
||||||
|
return specimenManageAppService.updateOrAddSpecimen(specimenDefinition);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/information-one")
|
||||||
|
public R<?> getSpecimen(@RequestParam Long id) {
|
||||||
|
return specimenManageAppService.getSpecimenOne(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/information-status")
|
||||||
|
public R<?> updateSpecimenStatus( @RequestBody SpecimenDefStatusRequest specimenDefStatusRequest) {
|
||||||
|
//默认停用
|
||||||
|
Integer status = PublicationStatus.RETIRED.getValue();
|
||||||
|
if("启用".equals( specimenDefStatusRequest.getType())){
|
||||||
|
status = PublicationStatus.ACTIVE.getValue();
|
||||||
|
}
|
||||||
|
return specimenManageAppService.editSpecimenStatus(specimenDefStatusRequest.getIds(),status);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,108 @@
|
|||||||
|
package com.openhis.web.Inspection.dto;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
|
import com.openhis.common.annotation.Dict;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 分页返回
|
||||||
|
* @Author
|
||||||
|
* @Date 2025/9/17
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class InstrumentManageDto {
|
||||||
|
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 仪器编号,唯一且不能为空 */
|
||||||
|
private String instrumentCode;
|
||||||
|
|
||||||
|
/** 仪器名称,必填项 */
|
||||||
|
private String instrumentName;
|
||||||
|
|
||||||
|
/** 仪器主编号 */
|
||||||
|
private String instrumentMainCode;
|
||||||
|
|
||||||
|
/** 仪器类型,选择项 */
|
||||||
|
private Integer instrumentTypeEnum;
|
||||||
|
private String instrumentTypeEnumText;
|
||||||
|
|
||||||
|
/** 仪器型号 */
|
||||||
|
private String instrumentModel;
|
||||||
|
|
||||||
|
/** 生产厂家 */
|
||||||
|
private String manufacturer;
|
||||||
|
|
||||||
|
/** 仪器序列号 */
|
||||||
|
private String serialNumber;
|
||||||
|
|
||||||
|
/** 购买公司 */
|
||||||
|
private String purchasingCompany;
|
||||||
|
|
||||||
|
/** 联系人员 */
|
||||||
|
private String contactPerson;
|
||||||
|
|
||||||
|
/** 购买日期 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date purchaseDate;
|
||||||
|
|
||||||
|
/** 原价格 */
|
||||||
|
private BigDecimal originalPrice;
|
||||||
|
|
||||||
|
/** 成交价格 */
|
||||||
|
private BigDecimal transactionPrice;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
/** 安装日期 */
|
||||||
|
private Date installationDate;
|
||||||
|
|
||||||
|
/** 安装人员 */
|
||||||
|
private String installationPerson;
|
||||||
|
|
||||||
|
/** 维护人员 */
|
||||||
|
private String maintenancePerson;
|
||||||
|
|
||||||
|
/** 所属科室 */
|
||||||
|
@Dict(dictTable = "adm_organization", dictCode = "id", dictText = "name")
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long orgId;
|
||||||
|
private String orgId_dictText;
|
||||||
|
|
||||||
|
/** 鉴定人员 */
|
||||||
|
private String identificationPerson;
|
||||||
|
|
||||||
|
/** 记录温度 */
|
||||||
|
private String recordedTemperature;
|
||||||
|
|
||||||
|
/** 仪器附件 */
|
||||||
|
private String accessories;
|
||||||
|
|
||||||
|
/** 仪器状态 */
|
||||||
|
private Integer instrumentStatusEnum;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
/** 报损日期 */
|
||||||
|
private Date damageReportDate;
|
||||||
|
|
||||||
|
/** 可复查仪器 是否 */
|
||||||
|
private Integer recheckableInstrumentEnum;
|
||||||
|
|
||||||
|
/** 使用状态,是否 */
|
||||||
|
private Integer usageStatusEnum;
|
||||||
|
|
||||||
|
/** 停用原因 */
|
||||||
|
private String decommissionReason;
|
||||||
|
|
||||||
|
/** 备注 */
|
||||||
|
private String remarks;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
package com.openhis.web.Inspection.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @author
|
||||||
|
* @date
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class InstrumentManageInitDto {
|
||||||
|
private List<statusEnumOption> statusFlagOptions;
|
||||||
|
private List<InstrumentType> InstrumentTypeList;
|
||||||
|
private List<InstrumentStatusEnumOption> InstrumentStatusEnumList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public static class statusEnumOption {
|
||||||
|
private Integer value;
|
||||||
|
private String info;
|
||||||
|
public statusEnumOption(Integer value, String info) {
|
||||||
|
this.value = value;
|
||||||
|
this.info = info;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class InstrumentStatusEnumOption {
|
||||||
|
private Integer value;
|
||||||
|
private String info;
|
||||||
|
public InstrumentStatusEnumOption(Integer value, String info) {
|
||||||
|
this.value = value;
|
||||||
|
this.info = info;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class InstrumentType {
|
||||||
|
private Integer value;
|
||||||
|
private String info;
|
||||||
|
public InstrumentType(Integer value, String info) {
|
||||||
|
this.value = value;
|
||||||
|
this.info = info;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package com.openhis.web.Inspection.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 样本定义分页检索条件
|
||||||
|
*
|
||||||
|
* @author lpt
|
||||||
|
* @date 2025-02-25
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class InstrumentSelParam {
|
||||||
|
|
||||||
|
/** 仪器类型 */
|
||||||
|
private Integer instrumentTypeEnum;
|
||||||
|
|
||||||
|
/** 状态 */
|
||||||
|
private Integer statusEnum;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.openhis.web.Inspection.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description TODO
|
||||||
|
* @Author
|
||||||
|
* @Date 2025/9/18
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class InstrumentStatusRequest {
|
||||||
|
private List<Long> ids;
|
||||||
|
private String type;
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.openhis.web.Inspection.dto;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
|
import com.openhis.lab.domain.ActivityDefDeviceDef;
|
||||||
|
import com.openhis.lab.domain.ActivityDefObservationDef;
|
||||||
|
import com.openhis.lab.domain.ActivityDefSpecimenDef;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description TODO
|
||||||
|
* @Author
|
||||||
|
* @Date 2025/9/30
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class LisConfigManageDto {
|
||||||
|
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
private List<ActivityDefDeviceDef> activityDefDeviceDefs;
|
||||||
|
|
||||||
|
private List<ActivityDefObservationDef> activityDefObservationDefs;
|
||||||
|
|
||||||
|
private List<ActivityDefSpecimenDef> activityDefSpecimenDefs;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.openhis.web.Inspection.dto;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.openhis.administration.domain.DeviceDefinition;
|
||||||
|
import com.openhis.administration.domain.ObservationDefinition;
|
||||||
|
import com.openhis.administration.domain.SpecimenDefinition;
|
||||||
|
import com.openhis.web.datadictionary.dto.DeviceManageDto;
|
||||||
|
import com.openhis.web.datadictionary.dto.DiagnosisTreatmentDto;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description TODO
|
||||||
|
* @Author
|
||||||
|
* @Date 2025/10/10
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class LisConfigManageInitDto {
|
||||||
|
|
||||||
|
private List <DeviceDefinition> deviceDefs;
|
||||||
|
|
||||||
|
private List<ObservationDefinition> observationDefs;
|
||||||
|
|
||||||
|
private List<SpecimenDefinition> specimenDefs;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
package com.openhis.web.Inspection.dto;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
|
import com.openhis.common.annotation.Dict;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 分页返回
|
||||||
|
* @Author
|
||||||
|
* @Date 2025/9/17
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class ObservationDefManageDto {
|
||||||
|
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
|
||||||
|
/** 观测名称,用于标识观测的具体名称 */
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/** 观测代码,用于唯一标识一个观测项 */
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
/** 观测类型,例如:实验室、临床症状等 */
|
||||||
|
private Integer observationTypeEnum;
|
||||||
|
private String observationTypeEnumText;
|
||||||
|
|
||||||
|
/** 参考范围,例如:3.0-6.0 mg/dL,用于指示正常范围 */
|
||||||
|
private String referenceRange;
|
||||||
|
|
||||||
|
@Dict(dictTable = "adm_instrument", dictCode = "id", dictText = "instrument_name")
|
||||||
|
/** 观测仪器id */
|
||||||
|
private Long instrumentId;
|
||||||
|
private String instrumentId_dictText;
|
||||||
|
|
||||||
|
/** 状态 */
|
||||||
|
private Integer statusEnum;
|
||||||
|
private String statusEnumText;
|
||||||
|
|
||||||
|
/** 删除状态) */
|
||||||
|
private String deleteFlag;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
package com.openhis.web.Inspection.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @author
|
||||||
|
* @date
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class ObservationDefManageInitDto {
|
||||||
|
private List<statusEnumOption> statusFlagOptions;
|
||||||
|
private List<ObservationTypeEnumOption> ObservationTypeList;
|
||||||
|
private List<InstrumentEnumOption> instrumentEnumOptionList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public static class statusEnumOption {
|
||||||
|
private Integer value;
|
||||||
|
private String info;
|
||||||
|
public statusEnumOption(Integer value, String info) {
|
||||||
|
this.value = value;
|
||||||
|
this.info = info;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class ObservationTypeEnumOption {
|
||||||
|
private Integer value;
|
||||||
|
private String info;
|
||||||
|
public ObservationTypeEnumOption(Integer value, String info) {
|
||||||
|
this.value = value;
|
||||||
|
this.info = info;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@Data
|
||||||
|
public static class InstrumentEnumOption {
|
||||||
|
private Long value;
|
||||||
|
private String info;
|
||||||
|
public InstrumentEnumOption(Long value, String info) {
|
||||||
|
this.value = value;
|
||||||
|
this.info = info;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package com.openhis.web.Inspection.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 样本定义分页检索条件
|
||||||
|
*
|
||||||
|
* @author lpt
|
||||||
|
* @date 2025-02-25
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class ObservationDefSelParam {
|
||||||
|
|
||||||
|
/** 类型 */
|
||||||
|
private Integer observationTypeEnum;
|
||||||
|
|
||||||
|
/** 状态 */
|
||||||
|
private Integer statusEnum;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.openhis.web.Inspection.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description TODO
|
||||||
|
* @Author
|
||||||
|
* @Date 2025/9/18
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ObservationDefStatusRequest {
|
||||||
|
private List<Long> ids;
|
||||||
|
private String type;
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.openhis.web.Inspection.dto;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description TODO
|
||||||
|
* @Author
|
||||||
|
* @Date 2025/10/17
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ReportResultManageDto {
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long parentId;
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long id;
|
||||||
|
private String patientName; // 患者名称
|
||||||
|
private String chargeName; // 项目名称
|
||||||
|
private String specimenName; // 样本名称
|
||||||
|
private String doctorName; // 开单医生
|
||||||
|
private String observationName;//观测定义名称
|
||||||
|
private String observationResult; // 观测结果
|
||||||
|
private String referenceRange; // 参考范围
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private String observationDate;//观测时间
|
||||||
|
private Integer genderEnum; // 性别
|
||||||
|
private String genderEnumText;// 性别文本
|
||||||
|
private String technicianName;// 检查人员
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private String authoredTime; // 开单时间
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
package com.openhis.web.Inspection.dto;
|
||||||
|
|
||||||
|
import com.core.common.core.domain.entity.SysMenu;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description TODO
|
||||||
|
* @Author
|
||||||
|
* @Date 2025/10/17
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SampleCollectManageDto {
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long parentId;
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long id;
|
||||||
|
private String patientName; // 患者名称
|
||||||
|
private String chargeName; // 项目名称
|
||||||
|
private String specimenName; // 样本名称
|
||||||
|
private String doctorName; // 开单医生
|
||||||
|
|
||||||
|
private Integer specimenVolume; //样本量
|
||||||
|
private String specimenUnit; //样本单位
|
||||||
|
|
||||||
|
private Integer genderEnum; // 性别
|
||||||
|
private String genderEnumText;// 性别文本
|
||||||
|
|
||||||
|
private Integer collectionStatusEnum;//采集状态
|
||||||
|
private String collectionStatusEnumText; // 采集状态文本
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date collectionDate; // 采集时间
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date receivedDate; // 接收时间
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private String authoredTime; // 开单时间
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.openhis.web.Inspection.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description TODO
|
||||||
|
* @Author
|
||||||
|
* @Date 2025/10/23
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SampleCollectStatusRequest {
|
||||||
|
private List<Long> ids;
|
||||||
|
private String type;
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package com.openhis.web.Inspection.dto;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 分页返回
|
||||||
|
* @Author
|
||||||
|
* @Date 2025/9/17
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class SpecimenDefManageDto {
|
||||||
|
/** $column.columnComment */
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 样本类型 */
|
||||||
|
private Integer specimenTypeEnum;
|
||||||
|
private String specimenTypeEnumText;
|
||||||
|
|
||||||
|
/** 样本名称 */
|
||||||
|
private String specimenName;
|
||||||
|
|
||||||
|
/** 自定义码 */
|
||||||
|
private String customCode;
|
||||||
|
|
||||||
|
/** 类型顺序 */
|
||||||
|
private Integer typeOrder;
|
||||||
|
|
||||||
|
/** 外部代码 */
|
||||||
|
private String externalCode;
|
||||||
|
|
||||||
|
/** 序号 */
|
||||||
|
private Integer serialNumber;
|
||||||
|
|
||||||
|
/** 全网型 */
|
||||||
|
private String globalType;
|
||||||
|
|
||||||
|
/** 拼音 */
|
||||||
|
private String pyStr;
|
||||||
|
|
||||||
|
/** 五笔 */
|
||||||
|
private String wbStr;
|
||||||
|
|
||||||
|
/** 样本类 */
|
||||||
|
private String specimenClass;
|
||||||
|
|
||||||
|
/** 扩展类型 */
|
||||||
|
private String extendedType;
|
||||||
|
|
||||||
|
/** WHONET代码 */
|
||||||
|
private String whonetCode;
|
||||||
|
|
||||||
|
|
||||||
|
/** 状态 */
|
||||||
|
private Integer statusEnum;
|
||||||
|
private String statusEnumText;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package com.openhis.web.Inspection.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @author
|
||||||
|
* @date
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class SpecimenDefManageInitDto {
|
||||||
|
private List<statusEnumOption> statusFlagOptions;
|
||||||
|
private List<SpecimenType> SpecimenTypeList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public static class statusEnumOption {
|
||||||
|
private Integer value;
|
||||||
|
private String info;
|
||||||
|
public statusEnumOption(Integer value, String info) {
|
||||||
|
this.value = value;
|
||||||
|
this.info = info;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class SpecimenType {
|
||||||
|
private Integer value;
|
||||||
|
private String info;
|
||||||
|
List<SpecimenType> children = new ArrayList<>();
|
||||||
|
|
||||||
|
public SpecimenType(Integer value, String info) {
|
||||||
|
this.value = value;
|
||||||
|
this.info = info;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package com.openhis.web.Inspection.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 样本定义分页检索条件
|
||||||
|
*
|
||||||
|
* @author lpt
|
||||||
|
* @date 2025-02-25
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class SpecimenDefSelParam {
|
||||||
|
|
||||||
|
/** 样本类型 */
|
||||||
|
private Integer specimenTypeEnum;
|
||||||
|
|
||||||
|
/** 状态 */
|
||||||
|
private Integer statusEnum;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.openhis.web.Inspection.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description TODO
|
||||||
|
* @Author
|
||||||
|
* @Date 2025/9/18
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SpecimenDefStatusRequest {
|
||||||
|
private List<Long> ids;
|
||||||
|
private String type;
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package com.openhis.web.Inspection.mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description TODO
|
||||||
|
* @Author
|
||||||
|
* @Date 2025/10/24 16:40
|
||||||
|
*/
|
||||||
|
public interface GroupRecMapper {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.openhis.web.Inspection.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.openhis.web.Inspection.dto.ReportResultManageDto;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description TODO
|
||||||
|
* @Author
|
||||||
|
* @Date 2025/11/5 9:36
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface LisReportMapper {
|
||||||
|
|
||||||
|
IPage<ReportResultManageDto> getReportResultList(@Param("page") Page<ReportResultManageDto> page, @Param(Constants.WRAPPER) QueryWrapper<ReportResultManageDto> queryWrapper);
|
||||||
|
|
||||||
|
Long getReportResultListTotal (@Param("page")Page<ReportResultManageDto> page, @Param(Constants.WRAPPER) QueryWrapper<ReportResultManageDto> queryWrapper);
|
||||||
|
List<ReportResultManageDto> getReportListById(@Param(Constants.WRAPPER) QueryWrapper<ReportResultManageDto> queryWrapper);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.openhis.web.Inspection.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.openhis.web.Inspection.dto.SampleCollectManageDto;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description TODO
|
||||||
|
* @Author
|
||||||
|
* @Date 2025/10/17 11:27
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface SampleCollectMapper {
|
||||||
|
IPage<SampleCollectManageDto> getSampleCollectList(@Param("page")Page<SampleCollectManageDto> page, @Param(Constants.WRAPPER) QueryWrapper<SampleCollectManageDto> queryWrapper);
|
||||||
|
|
||||||
|
|
||||||
|
Long getSampleCollectListTotal (@Param("page")Page<SampleCollectManageDto> page, @Param(Constants.WRAPPER) QueryWrapper<SampleCollectManageDto> queryWrapper);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
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);
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
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));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
package com.openhis.web.appointmentmanage.mapper;
|
|
||||||
|
|
||||||
import org.springframework.stereotype.Repository;
|
|
||||||
|
|
||||||
@Repository
|
|
||||||
public interface DeptAppMapper {
|
|
||||||
}
|
|
||||||
@@ -18,7 +18,8 @@ public interface IOrganizationAppService {
|
|||||||
* @param request 请求数据
|
* @param request 请求数据
|
||||||
* @return 机构树分页列表
|
* @return 机构树分页列表
|
||||||
*/
|
*/
|
||||||
Page<OrganizationDto> getOrganizationTree(Integer pageNo, Integer pageSize, HttpServletRequest request);
|
Page<OrganizationDto> getOrganizationTree(Integer pageNo, Integer pageSize, String sortField, String sortOrder,
|
||||||
|
HttpServletRequest request);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 机构信息详情
|
* 机构信息详情
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.core.common.core.domain.R;
|
import com.core.common.core.domain.R;
|
||||||
|
import com.core.common.enums.DelFlag;
|
||||||
import com.core.common.utils.*;
|
import com.core.common.utils.*;
|
||||||
import com.openhis.administration.domain.EncounterLocation;
|
import com.openhis.administration.domain.EncounterLocation;
|
||||||
import com.openhis.administration.domain.Location;
|
import com.openhis.administration.domain.Location;
|
||||||
@@ -77,7 +78,9 @@ public class LocationAppServiceImpl implements ILocationAppService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public R<?> enableLocation(List<Long> locationIdList) {
|
public R<?> enableLocation(List<Long> locationIdList) {
|
||||||
List<Location> locationList = locationService.getLocationList(locationIdList);
|
// 根据ID查询停用状态的
|
||||||
|
List<Location> locationList = locationService.getLocationList(locationIdList,
|
||||||
|
Collections.singletonList(LocationStatus.INACTIVE.getValue()));
|
||||||
if (locationIdList != null && !locationIdList.isEmpty()) {
|
if (locationIdList != null && !locationIdList.isEmpty()) {
|
||||||
for (Location location : locationList) {
|
for (Location location : locationList) {
|
||||||
if (LocationForm.HOUSE.getValue().equals(location.getFormEnum())
|
if (LocationForm.HOUSE.getValue().equals(location.getFormEnum())
|
||||||
@@ -117,7 +120,8 @@ public class LocationAppServiceImpl implements ILocationAppService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public R<?> deactivateLocation(List<Long> locationIdList) {
|
public R<?> deactivateLocation(List<Long> locationIdList) {
|
||||||
List<Location> locationList = locationService.getLocationList(locationIdList);
|
List<Location> locationList = locationService.getLocationList(locationIdList,
|
||||||
|
Arrays.asList(LocationStatus.ACTIVE.getValue(), LocationStatus.IDLE.getValue()));
|
||||||
if (locationIdList != null && !locationIdList.isEmpty()) {
|
if (locationIdList != null && !locationIdList.isEmpty()) {
|
||||||
for (Location location : locationList) {
|
for (Location location : locationList) {
|
||||||
if (LocationForm.BED.getValue().equals(location.getFormEnum())) {
|
if (LocationForm.BED.getValue().equals(location.getFormEnum())) {
|
||||||
@@ -231,6 +235,23 @@ public class LocationAppServiceImpl implements ILocationAppService {
|
|||||||
// 启用停用
|
// 启用停用
|
||||||
e.setStatusEnum_enumText(EnumUtils.getInfoByValue(LocationStatus.class, e.getStatusEnum()));
|
e.setStatusEnum_enumText(EnumUtils.getInfoByValue(LocationStatus.class, e.getStatusEnum()));
|
||||||
});
|
});
|
||||||
|
// 如果是查询病房
|
||||||
|
if (LocationForm.HOUSE.getValue().equals(locationPageParam.getFormEnum())) {
|
||||||
|
// 查询疗区
|
||||||
|
LambdaQueryWrapper<Location> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.eq(Location::getFormEnum, LocationForm.WARD.getValue()).eq(Location::getDeleteFlag,
|
||||||
|
DelFlag.NO.getCode());
|
||||||
|
List<Location> list = locationService.list(wrapper);
|
||||||
|
// 根据busNo拼接疗区
|
||||||
|
HashMap<String, String> map = list.stream().collect(Collectors.toMap(Location::getBusNo, Location::getName,
|
||||||
|
(oldValue, newValue) -> newValue, HashMap::new));
|
||||||
|
locationPage.getRecords().forEach(e -> {
|
||||||
|
String[] split = e.getBusNo().split("\\.");
|
||||||
|
if (split.length == 2) {
|
||||||
|
e.setParentName(map.get(split[0]));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
return R.ok(locationPage);
|
return R.ok(locationPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -242,7 +263,16 @@ public class LocationAppServiceImpl implements ILocationAppService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public R<?> addLocation(LocationAddOrEditDto locationAddOrEditDto) {
|
public R<?> addLocation(LocationAddOrEditDto locationAddOrEditDto) {
|
||||||
|
// 不能为空
|
||||||
|
if (StringUtils.isEmpty(locationAddOrEditDto.getName())) {
|
||||||
|
return R.fail(false, "名称不能为空");
|
||||||
|
}
|
||||||
|
// 去除空格
|
||||||
|
String name = locationAddOrEditDto.getName().replaceAll("[ ]", "");
|
||||||
|
// 判断是否存在同名
|
||||||
|
if (locationService.isExistName(name, locationAddOrEditDto.getBusNo(), locationAddOrEditDto.getId())) {
|
||||||
|
return R.fail(false, "【" + name + "】已存在");
|
||||||
|
}
|
||||||
Location location = new Location();
|
Location location = new Location();
|
||||||
BeanUtils.copyProperties(locationAddOrEditDto, location);
|
BeanUtils.copyProperties(locationAddOrEditDto, location);
|
||||||
location.setFormEnum(Integer.valueOf(locationAddOrEditDto.getFormEnum()));
|
location.setFormEnum(Integer.valueOf(locationAddOrEditDto.getFormEnum()));
|
||||||
@@ -278,6 +308,16 @@ public class LocationAppServiceImpl implements ILocationAppService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public R<?> editLocation(LocationAddOrEditDto locationAddOrEditDto) {
|
public R<?> editLocation(LocationAddOrEditDto locationAddOrEditDto) {
|
||||||
|
// 不能为空
|
||||||
|
if (StringUtils.isEmpty(locationAddOrEditDto.getName())) {
|
||||||
|
return R.fail(false, "名称不能为空");
|
||||||
|
}
|
||||||
|
// 去除空格
|
||||||
|
String name = locationAddOrEditDto.getName().replaceAll("[ ]", "");
|
||||||
|
// 判断是否存在同名
|
||||||
|
if (locationService.isExistName(name, locationAddOrEditDto.getBusNo(), locationAddOrEditDto.getId())) {
|
||||||
|
return R.fail(false, "【" + name + "】已存在");
|
||||||
|
}
|
||||||
Location location = new Location();
|
Location location = new Location();
|
||||||
BeanUtils.copyProperties(locationAddOrEditDto, location);
|
BeanUtils.copyProperties(locationAddOrEditDto, location);
|
||||||
// 拼音码
|
// 拼音码
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.openhis.web.basedatamanage.appservice.impl;
|
package com.openhis.web.basedatamanage.appservice.impl;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@@ -9,6 +10,7 @@ import javax.servlet.http.HttpServletRequest;
|
|||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.core.common.core.domain.R;
|
import com.core.common.core.domain.R;
|
||||||
import com.core.common.utils.AssignSeqUtil;
|
import com.core.common.utils.AssignSeqUtil;
|
||||||
@@ -26,6 +28,8 @@ import com.openhis.common.utils.EnumUtils;
|
|||||||
import com.openhis.web.basedatamanage.appservice.IOrganizationAppService;
|
import com.openhis.web.basedatamanage.appservice.IOrganizationAppService;
|
||||||
import com.openhis.web.basedatamanage.dto.OrganizationDto;
|
import com.openhis.web.basedatamanage.dto.OrganizationDto;
|
||||||
|
|
||||||
|
import static com.baomidou.mybatisplus.core.toolkit.StringUtils.camelToUnderline;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class OrganizationAppServiceImpl implements IOrganizationAppService {
|
public class OrganizationAppServiceImpl implements IOrganizationAppService {
|
||||||
|
|
||||||
@@ -36,9 +40,25 @@ public class OrganizationAppServiceImpl implements IOrganizationAppService {
|
|||||||
private AssignSeqUtil assignSeqUtil;
|
private AssignSeqUtil assignSeqUtil;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<OrganizationDto> getOrganizationTree(Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
public Page<OrganizationDto> getOrganizationTree(Integer pageNo, Integer pageSize, String sortField,
|
||||||
|
String sortOrder, HttpServletRequest request) {
|
||||||
// 查询机构列表
|
// 查询机构列表
|
||||||
Page<Organization> page = organizationService.page(new Page<>(pageNo, pageSize));
|
// 创建Page对象
|
||||||
|
Page<Organization> page = new Page<>(pageNo, pageSize);
|
||||||
|
// 处理动态排序(仅当排序字段有效时才添加排序条件)
|
||||||
|
if (sortField != null && !sortField.isEmpty()) {
|
||||||
|
// 校验排序字段是否为Organization实体中的有效字段(防止非法字段)
|
||||||
|
if (isValidField(Organization.class, sortField)) {
|
||||||
|
// 驼峰转下划线处理
|
||||||
|
String underlineField = camelToUnderline(sortField);
|
||||||
|
// 默认为升序,若指定desc则按降序
|
||||||
|
boolean isAsc = sortOrder == null || "asc".equalsIgnoreCase(sortOrder);
|
||||||
|
page.addOrder(isAsc ? OrderItem.asc(underlineField) : OrderItem.desc(underlineField));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 执行分页查询(此时排序条件会被应用)
|
||||||
|
page = organizationService.page(page);
|
||||||
|
|
||||||
List<Organization> organizationList = page.getRecords();
|
List<Organization> organizationList = page.getRecords();
|
||||||
// 将机构列表转为树结构
|
// 将机构列表转为树结构
|
||||||
List<OrganizationDto> orgTree = buildTree(organizationList);
|
List<OrganizationDto> orgTree = buildTree(organizationList);
|
||||||
@@ -100,18 +120,7 @@ public class OrganizationAppServiceImpl implements IOrganizationAppService {
|
|||||||
@Override
|
@Override
|
||||||
public R<?> getOrgInfo(Long orgId) {
|
public R<?> getOrgInfo(Long orgId) {
|
||||||
Organization organization = organizationService.getById(orgId);
|
Organization organization = organizationService.getById(orgId);
|
||||||
if (organization == null) {
|
return R.ok(organization, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"机构信息查询"}));
|
||||||
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[] {"机构信息查询"}));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -199,4 +208,21 @@ public class OrganizationAppServiceImpl implements IOrganizationAppService {
|
|||||||
: R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, new Object[] {"机构信息停用"}));
|
: R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, new Object[] {"机构信息停用"}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验字段是否为指定类中的有效属性
|
||||||
|
*/
|
||||||
|
private boolean isValidField(Class<?> clazz, String fieldName) {
|
||||||
|
if (clazz == null || fieldName == null || fieldName.isEmpty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
// 获取类中所有声明的字段(包括私有)
|
||||||
|
Field field = clazz.getDeclaredField(fieldName);
|
||||||
|
return field != null;
|
||||||
|
} catch (NoSuchFieldException e) {
|
||||||
|
// 字段不存在
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -406,7 +406,8 @@ public class PractitionerAppServiceImpl implements IPractitionerAppService {
|
|||||||
if (1L == userId) {
|
if (1L == userId) {
|
||||||
return R.fail(null, "admin不允许删除");
|
return R.fail(null, "admin不允许删除");
|
||||||
}
|
}
|
||||||
iBizUserService.remove(new LambdaQueryWrapper<BizUser>().eq(BizUser::getUserId, userId));
|
// iBizUserService.remove(new LambdaQueryWrapper<BizUser>().eq(BizUser::getUserId, userId));
|
||||||
|
practitionerAppAppMapper.delUser(userId);
|
||||||
practitionerAppAppMapper.delUserRole(userId);
|
practitionerAppAppMapper.delUserRole(userId);
|
||||||
Practitioner one =
|
Practitioner one =
|
||||||
iPractitionerService.getOne(new LambdaQueryWrapper<Practitioner>().eq(Practitioner::getUserId, userId));
|
iPractitionerService.getOne(new LambdaQueryWrapper<Practitioner>().eq(Practitioner::getUserId, userId));
|
||||||
|
|||||||
@@ -47,8 +47,11 @@ public class OrganizationController {
|
|||||||
*/
|
*/
|
||||||
@GetMapping(value = "/organization")
|
@GetMapping(value = "/organization")
|
||||||
public R<?> getOrganizationPage(@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
public R<?> getOrganizationPage(@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
@RequestParam(value = "pageSize", defaultValue = "100") Integer pageSize, HttpServletRequest request) {
|
@RequestParam(value = "pageSize", defaultValue = "100") Integer pageSize,
|
||||||
Page<OrganizationDto> organizationTree = iOrganizationAppService.getOrganizationTree(pageNo, pageSize, request);
|
@RequestParam(value = "sortField", required = false) String sortField,
|
||||||
|
@RequestParam(value = "sortOrder", required = false) String sortOrder, HttpServletRequest request) {
|
||||||
|
Page<OrganizationDto> organizationTree =
|
||||||
|
iOrganizationAppService.getOrganizationTree(pageNo, pageSize, sortField, sortOrder, request);
|
||||||
return R.ok(organizationTree,
|
return R.ok(organizationTree,
|
||||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00009, new Object[] {"机构信息"}));
|
MessageUtils.createMessage(PromptMsgConstant.Common.M00009, new Object[] {"机构信息"}));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,11 +3,10 @@
|
|||||||
*/
|
*/
|
||||||
package com.openhis.web.basedatamanage.dto;
|
package com.openhis.web.basedatamanage.dto;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
import com.openhis.common.annotation.Dict;
|
import com.openhis.common.annotation.Dict;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
@@ -31,6 +30,9 @@ public class LocationInfoDto {
|
|||||||
/** 名称 */
|
/** 名称 */
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
/** 父名称 */
|
||||||
|
private String parentName;
|
||||||
|
|
||||||
/** 状态编码 */
|
/** 状态编码 */
|
||||||
private Integer statusEnum;
|
private Integer statusEnum;
|
||||||
private String statusEnum_enumText;
|
private String statusEnum_enumText;
|
||||||
@@ -44,7 +46,7 @@ public class LocationInfoDto {
|
|||||||
private String formEnum_enumText;
|
private String formEnum_enumText;
|
||||||
|
|
||||||
/** 机构编码 */
|
/** 机构编码 */
|
||||||
@Dict(dictCode = "id",dictText = "name",dictTable = "adm_organization")
|
@Dict(dictCode = "id", dictText = "name", dictTable = "adm_organization")
|
||||||
@JsonSerialize(using = ToStringSerializer.class)
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
private Long organizationId;
|
private Long organizationId;
|
||||||
private String organizationId_dictText;
|
private String organizationId_dictText;
|
||||||
|
|||||||
@@ -63,4 +63,9 @@ public class OrgLocQueryDto {
|
|||||||
/** 显示顺序 */
|
/** 显示顺序 */
|
||||||
private Integer displayOrder;
|
private Integer displayOrder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目编码 | 药品:1 耗材:2
|
||||||
|
*/
|
||||||
|
private String itemCode;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,16 +60,4 @@ public class OrganizationDto {
|
|||||||
|
|
||||||
/** 子集合 */
|
/** 子集合 */
|
||||||
private List<OrganizationDto> children = new ArrayList<>();
|
private List<OrganizationDto> children = new ArrayList<>();
|
||||||
|
|
||||||
/** 挂号科室标记 */
|
|
||||||
private Integer registerFlag;
|
|
||||||
|
|
||||||
/** 科室位置 */
|
|
||||||
private String location;
|
|
||||||
|
|
||||||
/** 科室简介 */
|
|
||||||
private String intro;
|
|
||||||
|
|
||||||
/** 备注 */
|
|
||||||
private String remark;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,6 +47,13 @@ public interface PractitionerAppAppMapper {
|
|||||||
List<PractitionerOrgAndLocationDto>
|
List<PractitionerOrgAndLocationDto>
|
||||||
getOrgAndLocationDtoList(@Param("practitionerIdList") List<Long> practitionerIdList);
|
getOrgAndLocationDtoList(@Param("practitionerIdList") List<Long> practitionerIdList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 逻辑删除系统用户
|
||||||
|
*
|
||||||
|
* @param userId 系统用户id
|
||||||
|
*/
|
||||||
|
void delUser(@Param("userId") Long userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 物理删除系统用户与角色的关系
|
* 物理删除系统用户与角色的关系
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,53 +0,0 @@
|
|||||||
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));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,88 +0,0 @@
|
|||||||
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("删除失败");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,219 +0,0 @@
|
|||||||
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("删除失败");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
package com.openhis.web.basicmanage.domain;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发票段删除请求类
|
|
||||||
*
|
|
||||||
* @author system
|
|
||||||
* @date 2024-06-19
|
|
||||||
*/
|
|
||||||
public class InvoiceSegmentDeleteRequest implements Serializable {
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
private Long[] ids;
|
|
||||||
|
|
||||||
public Long[] getIds() {
|
|
||||||
return ids;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIds(Long[] ids) {
|
|
||||||
this.ids = ids;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -90,14 +90,6 @@ public class HealthcareServiceDto {
|
|||||||
private Integer appointmentRequiredFlag;
|
private Integer appointmentRequiredFlag;
|
||||||
private String appointmentRequiredFlag_enumText;
|
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
|
* 费用定价ID
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -82,12 +82,12 @@ public class HealthcareServiceFormData {
|
|||||||
@NotBlank(message = "预约要求不能为空")
|
@NotBlank(message = "预约要求不能为空")
|
||||||
private Integer appointmentRequiredFlag;
|
private Integer appointmentRequiredFlag;
|
||||||
|
|
||||||
/**
|
|
||||||
* 出诊医生ID
|
|
||||||
*/
|
|
||||||
private Long practitionerId;
|
|
||||||
|
|
||||||
/** 医保编码 */
|
/** 医保编码 */
|
||||||
private String ybNo;
|
private String ybNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编码
|
||||||
|
*/
|
||||||
|
private String busNo;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
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());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
package com.openhis.web.charge.patientcardrenewal;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 患者换卡服务接口
|
|
||||||
*
|
|
||||||
* @author system
|
|
||||||
* @date 2024-01-01
|
|
||||||
*/
|
|
||||||
public interface PatientCardRenewalService {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 执行患者换卡操作
|
|
||||||
*
|
|
||||||
* @param request 换卡请求参数
|
|
||||||
* @return 是否换卡成功
|
|
||||||
*/
|
|
||||||
boolean renewCard(RenewalRequest request);
|
|
||||||
}
|
|
||||||
@@ -1,73 +0,0 @@
|
|||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
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;
|
|
||||||
}
|
|
||||||
@@ -20,26 +20,32 @@ import com.openhis.web.chargemanage.dto.EncounterPatientPrescriptionDto;
|
|||||||
public interface IInpatientChargeAppService {
|
public interface IInpatientChargeAppService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询就诊患者分页列表
|
* 门诊收费页面初始化
|
||||||
|
*
|
||||||
|
* @return 初始化信息
|
||||||
|
*/
|
||||||
|
R<?> inpatientChargeInit();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询住院患者分页列表
|
||||||
*
|
*
|
||||||
* @param encounterPatientPageParam 查询条件
|
* @param encounterPatientPageParam 查询条件
|
||||||
* @param searchKey 模糊查询关键字
|
* @param searchKey 模糊查询关键字
|
||||||
* @param pageNo 当前页
|
* @param pageNo 当前页
|
||||||
* @param pageSize 每页多少条
|
* @param pageSize 每页多少条
|
||||||
* @param request 请求
|
* @param request 请求
|
||||||
* @return 就诊患者分页列表
|
* @return 住院患者分页列表
|
||||||
*/
|
*/
|
||||||
R<?> getEncounterPatientPage(EncounterPatientPageParam encounterPatientPageParam, String searchKey, Integer pageNo,
|
R<?> getEncounterPatientPage(EncounterPatientPageParam encounterPatientPageParam, String searchKey, Integer pageNo,
|
||||||
Integer pageSize, HttpServletRequest request);
|
Integer pageSize, HttpServletRequest request);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据就诊id查询患者处方列表
|
* 根据就诊id查询患者待结算信息
|
||||||
*
|
*
|
||||||
* @param encounterId 就诊id
|
* @param encounterId 就诊id
|
||||||
* @return 患者处方列表
|
* @return 患者待结算信息
|
||||||
*/
|
*/
|
||||||
List<EncounterPatientPrescriptionDto> getEncounterPatientPrescription(Long encounterId, String startTime,
|
List<EncounterPatientPrescriptionDto> getEncounterPatientPrescription(Long encounterId);
|
||||||
String endTime);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 医保转自费
|
* 医保转自费
|
||||||
@@ -56,11 +62,4 @@ public interface IInpatientChargeAppService {
|
|||||||
* @return 操作结果
|
* @return 操作结果
|
||||||
*/
|
*/
|
||||||
R<?> changeToMedicalInsurance(Long encounterId);
|
R<?> changeToMedicalInsurance(Long encounterId);
|
||||||
|
|
||||||
/**
|
|
||||||
* 门诊收费页面初始化
|
|
||||||
*
|
|
||||||
* @return 初始化信息
|
|
||||||
*/
|
|
||||||
R<?> outpatientChargeInit();
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,6 +40,14 @@ public interface IOutpatientChargeAppService {
|
|||||||
*/
|
*/
|
||||||
List<EncounterPatientPrescriptionDto> getEncounterPatientPrescription(Long encounterId);
|
List<EncounterPatientPrescriptionDto> getEncounterPatientPrescription(Long encounterId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据就诊id查询患者处方列表并新增字段:实收金额、应收金额、优惠金额、折扣率
|
||||||
|
*
|
||||||
|
* @param encounterId 就诊id
|
||||||
|
* @return 患者处方列表
|
||||||
|
*/
|
||||||
|
List<EncounterPatientPrescriptionDto> getEncounterPatientPrescriptionWithPrice(Long encounterId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 医保转自费
|
* 医保转自费
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -3,9 +3,10 @@
|
|||||||
*/
|
*/
|
||||||
package com.openhis.web.chargemanage.appservice.impl;
|
package com.openhis.web.chargemanage.appservice.impl;
|
||||||
|
|
||||||
import java.text.ParseException;
|
import java.util.ArrayList;
|
||||||
import java.text.SimpleDateFormat;
|
import java.util.Arrays;
|
||||||
import java.util.*;
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
@@ -21,10 +22,7 @@ import com.openhis.administration.service.IAccountService;
|
|||||||
import com.openhis.administration.service.IChargeItemService;
|
import com.openhis.administration.service.IChargeItemService;
|
||||||
import com.openhis.common.constant.CommonConstants;
|
import com.openhis.common.constant.CommonConstants;
|
||||||
import com.openhis.common.constant.PromptMsgConstant;
|
import com.openhis.common.constant.PromptMsgConstant;
|
||||||
import com.openhis.common.enums.AdministrativeGender;
|
import com.openhis.common.enums.*;
|
||||||
import com.openhis.common.enums.ChargeItemContext;
|
|
||||||
import com.openhis.common.enums.ChargeItemStatus;
|
|
||||||
import com.openhis.common.enums.EncounterClass;
|
|
||||||
import com.openhis.common.utils.EnumUtils;
|
import com.openhis.common.utils.EnumUtils;
|
||||||
import com.openhis.common.utils.HisQueryUtils;
|
import com.openhis.common.utils.HisQueryUtils;
|
||||||
import com.openhis.web.chargemanage.appservice.IInpatientChargeAppService;
|
import com.openhis.web.chargemanage.appservice.IInpatientChargeAppService;
|
||||||
@@ -51,33 +49,32 @@ public class InpatientChargeAppServiceImpl implements IInpatientChargeAppService
|
|||||||
private IAccountService accountService;
|
private IAccountService accountService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 门诊收费页面初始化
|
* 住院结算页面初始化
|
||||||
*
|
*
|
||||||
* @return 初始化信息
|
* @return 初始化信息
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public R<?> outpatientChargeInit() {
|
public R<?> inpatientChargeInit() {
|
||||||
OutpatientInitDto initDto = new OutpatientInitDto();
|
OutpatientInitDto initDto = new OutpatientInitDto();
|
||||||
List<OutpatientInitDto.chargeItemStatusOption> chargeItemStatusOptions = new ArrayList<>();
|
List<OutpatientInitDto.encounterStatusOption> encounterStatusOptions = new ArrayList<>();
|
||||||
chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.PLANNED.getValue(),
|
encounterStatusOptions
|
||||||
ChargeItemStatus.PLANNED.getInfo()));
|
.add(new OutpatientInitDto.encounterStatusOption(EncounterZyStatus.DISCHARGED_FROM_HOSPITAL.getValue(),
|
||||||
chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.BILLABLE.getValue(),
|
EncounterZyStatus.DISCHARGED_FROM_HOSPITAL.getInfo()));
|
||||||
ChargeItemStatus.BILLABLE.getInfo()));
|
encounterStatusOptions.add(new OutpatientInitDto.encounterStatusOption(
|
||||||
chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.BILLED.getValue(),
|
EncounterZyStatus.ALREADY_SETTLED.getValue(), EncounterZyStatus.ALREADY_SETTLED.getInfo()));
|
||||||
ChargeItemStatus.BILLED.getInfo()));
|
initDto.setEncounterStatusOptions(encounterStatusOptions);
|
||||||
initDto.setChargeItemStatusOptions(chargeItemStatusOptions);
|
|
||||||
return R.ok(initDto);
|
return R.ok(initDto);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询就诊患者分页列表
|
* 查询住院患者分页列表
|
||||||
*
|
*
|
||||||
* @param encounterPatientPageParam 查询条件
|
* @param encounterPatientPageParam 查询条件
|
||||||
* @param searchKey 模糊查询关键字
|
* @param searchKey 模糊查询关键字
|
||||||
* @param pageNo 当前页
|
* @param pageNo 当前页
|
||||||
* @param pageSize 每页多少条
|
* @param pageSize 每页多少条
|
||||||
* @param request 请求
|
* @param request 请求
|
||||||
* @return 就诊患者分页列表
|
* @return 住院患者分页列表
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public R<?> getEncounterPatientPage(EncounterPatientPageParam encounterPatientPageParam, String searchKey,
|
public R<?> getEncounterPatientPage(EncounterPatientPageParam encounterPatientPageParam, String searchKey,
|
||||||
@@ -90,14 +87,17 @@ public class InpatientChargeAppServiceImpl implements IInpatientChargeAppService
|
|||||||
CommonConstants.FieldName.EncounterBusNo, CommonConstants.FieldName.IdCard)),
|
CommonConstants.FieldName.EncounterBusNo, CommonConstants.FieldName.IdCard)),
|
||||||
request);
|
request);
|
||||||
// 就诊患者分页列表
|
// 就诊患者分页列表
|
||||||
Page<EncounterPatientPageDto> encounterPatientPage = inpatientChargeAppMapper
|
Page<EncounterPatientPageDto> encounterPatientPage = inpatientChargeAppMapper.selectEncounterPatientPage(
|
||||||
.selectEncounterPatientPage(EncounterClass.IMP.getValue(), new Page<>(pageNo, pageSize), queryWrapper);
|
EncounterClass.IMP.getValue(), EncounterZyStatus.DISCHARGED_FROM_HOSPITAL.getValue(),
|
||||||
|
EncounterZyStatus.ALREADY_SETTLED.getValue(), ChargeItemStatus.BILLABLE.getValue(),
|
||||||
|
ChargeItemStatus.BILLED.getValue(), ChargeItemStatus.REFUNDED.getValue(),
|
||||||
|
AccountType.PERSONAL_CASH_ACCOUNT.getCode(), new Page<>(pageNo, pageSize), queryWrapper);
|
||||||
|
|
||||||
encounterPatientPage.getRecords().forEach(e -> {
|
encounterPatientPage.getRecords().forEach(e -> {
|
||||||
// 性别枚举
|
// 性别枚举
|
||||||
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
|
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
|
||||||
// 收费状态枚举
|
// 住院状态
|
||||||
e.setStatusEnum_enumText(EnumUtils.getInfoByValue(ChargeItemStatus.class, e.getStatusEnum()));
|
e.setEncounterStatus_enumText(EnumUtils.getInfoByValue(EncounterZyStatus.class, e.getEncounterStatus()));
|
||||||
// 计算年龄
|
// 计算年龄
|
||||||
e.setAge(e.getBirthDate() != null ? AgeCalculatorUtil.getAge(e.getBirthDate()) : "");
|
e.setAge(e.getBirthDate() != null ? AgeCalculatorUtil.getAge(e.getBirthDate()) : "");
|
||||||
});
|
});
|
||||||
@@ -105,36 +105,20 @@ public class InpatientChargeAppServiceImpl implements IInpatientChargeAppService
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据就诊id查询患者处方列表
|
* 根据就诊id查询患者待结算信息
|
||||||
*
|
*
|
||||||
* @param encounterId 就诊id
|
* @param encounterId 就诊id
|
||||||
* @return 患者处方列表
|
* @return 患者待结算信息
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<EncounterPatientPrescriptionDto> getEncounterPatientPrescription(Long encounterId, String startTime,
|
public List<EncounterPatientPrescriptionDto> getEncounterPatientPrescription(Long encounterId) {
|
||||||
String endTime) {
|
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
|
|
||||||
|
|
||||||
startTime = startTime + "000000";
|
|
||||||
|
|
||||||
endTime = endTime + "235959";
|
|
||||||
|
|
||||||
Date startDate = null;
|
|
||||||
Date endDate = null;
|
|
||||||
try {
|
|
||||||
startDate = sdf.parse(startTime);
|
|
||||||
endDate = sdf.parse(endTime);
|
|
||||||
} catch (ParseException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
List<EncounterPatientPrescriptionDto> prescriptionDtoList =
|
List<EncounterPatientPrescriptionDto> prescriptionDtoList =
|
||||||
inpatientChargeAppMapper.selectEncounterPatientPrescription(encounterId,
|
inpatientChargeAppMapper.selectEncounterPatientPrescription(encounterId,
|
||||||
ChargeItemContext.ACTIVITY.getValue(), ChargeItemContext.MEDICATION.getValue(),
|
ChargeItemContext.ACTIVITY.getValue(), ChargeItemContext.MEDICATION.getValue(),
|
||||||
ChargeItemContext.DEVICE.getValue(), ChargeItemContext.REGISTER.getValue(),
|
ChargeItemContext.DEVICE.getValue(), ChargeItemContext.REGISTER.getValue(),
|
||||||
ChargeItemStatus.PLANNED.getValue(), ChargeItemStatus.BILLABLE.getValue(),
|
ChargeItemStatus.PLANNED.getValue(), ChargeItemStatus.BILLABLE.getValue(),
|
||||||
ChargeItemStatus.BILLED.getValue(), ChargeItemStatus.REFUNDING.getValue(),
|
ChargeItemStatus.BILLED.getValue(), ChargeItemStatus.REFUNDING.getValue(),
|
||||||
ChargeItemStatus.REFUNDED.getValue(), ChargeItemStatus.PART_REFUND.getValue(), startDate, endDate);
|
ChargeItemStatus.REFUNDED.getValue(), ChargeItemStatus.PART_REFUND.getValue());
|
||||||
prescriptionDtoList.forEach(e -> {
|
prescriptionDtoList.forEach(e -> {
|
||||||
// 收费状态枚举
|
// 收费状态枚举
|
||||||
e.setStatusEnum_enumText(EnumUtils.getInfoByValue(ChargeItemStatus.class, e.getStatusEnum()));
|
e.setStatusEnum_enumText(EnumUtils.getInfoByValue(ChargeItemStatus.class, e.getStatusEnum()));
|
||||||
|
|||||||
@@ -3,6 +3,9 @@
|
|||||||
*/
|
*/
|
||||||
package com.openhis.web.chargemanage.appservice.impl;
|
package com.openhis.web.chargemanage.appservice.impl;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
|
import java.text.DecimalFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
@@ -26,6 +29,7 @@ import com.openhis.common.enums.AdministrativeGender;
|
|||||||
import com.openhis.common.enums.ChargeItemContext;
|
import com.openhis.common.enums.ChargeItemContext;
|
||||||
import com.openhis.common.enums.ChargeItemStatus;
|
import com.openhis.common.enums.ChargeItemStatus;
|
||||||
import com.openhis.common.enums.EncounterClass;
|
import com.openhis.common.enums.EncounterClass;
|
||||||
|
import com.openhis.common.enums.ybenums.YbPayment;
|
||||||
import com.openhis.common.utils.EnumUtils;
|
import com.openhis.common.utils.EnumUtils;
|
||||||
import com.openhis.common.utils.HisQueryUtils;
|
import com.openhis.common.utils.HisQueryUtils;
|
||||||
import com.openhis.web.chargemanage.appservice.IOutpatientChargeAppService;
|
import com.openhis.web.chargemanage.appservice.IOutpatientChargeAppService;
|
||||||
@@ -210,4 +214,66 @@ public class OutpatientChargeAppServiceImpl implements IOutpatientChargeAppServi
|
|||||||
}
|
}
|
||||||
return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null));
|
return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据就诊id查询患者处方列表并新增字段:应收金额,实收金额,优惠金额,折扣率
|
||||||
|
*
|
||||||
|
* @param encounterId 就诊id
|
||||||
|
* @return 患者处方列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<EncounterPatientPrescriptionDto> getEncounterPatientPrescriptionWithPrice(Long encounterId) {
|
||||||
|
List<EncounterPatientPrescriptionDto> prescriptionDtoList = outpatientChargeAppMapper
|
||||||
|
.selectEncounterPatientPrescriptionWithPrice(encounterId, ChargeItemContext.ACTIVITY.getValue(),
|
||||||
|
ChargeItemContext.MEDICATION.getValue(), ChargeItemContext.DEVICE.getValue(),
|
||||||
|
ChargeItemContext.REGISTER.getValue(), ChargeItemStatus.PLANNED.getValue(),
|
||||||
|
ChargeItemStatus.BILLABLE.getValue(), ChargeItemStatus.BILLED.getValue(),
|
||||||
|
ChargeItemStatus.REFUNDING.getValue(), ChargeItemStatus.REFUNDED.getValue(),
|
||||||
|
ChargeItemStatus.PART_REFUND.getValue(), YbPayment.DISCOUNT_PAY.getValue(),
|
||||||
|
YbPayment.SELF_CASH_VALUE.getValue(), YbPayment.SELF_CASH_VX_VALUE.getValue(),
|
||||||
|
YbPayment.SELF_CASH_ALI_VALUE.getValue(), YbPayment.SELF_CASH_UNION_VALUE.getValue());
|
||||||
|
prescriptionDtoList.forEach(e -> {
|
||||||
|
// 应收金额
|
||||||
|
BigDecimal receivableAmount = e.getReceivableAmount();
|
||||||
|
// 实收金额
|
||||||
|
BigDecimal receivedAmount = e.getReceivedAmount();
|
||||||
|
// 计算折扣率
|
||||||
|
BigDecimal discountRate = BigDecimal.ONE;
|
||||||
|
if (receivableAmount.compareTo(BigDecimal.ZERO) > 0 && receivedAmount.compareTo(BigDecimal.ZERO) > 0
|
||||||
|
&& receivableAmount.compareTo(receivedAmount) > 0) {
|
||||||
|
discountRate = receivedAmount.divide(receivableAmount, 2, RoundingMode.HALF_UP);
|
||||||
|
}
|
||||||
|
e.setDiscountRate(this.returnDiscountRate(discountRate));
|
||||||
|
// 收费状态枚举
|
||||||
|
e.setStatusEnum_enumText(EnumUtils.getInfoByValue(ChargeItemStatus.class, e.getStatusEnum()));
|
||||||
|
});
|
||||||
|
return prescriptionDtoList;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 调整折扣率
|
||||||
|
*
|
||||||
|
* @param discountRate 折扣率
|
||||||
|
* @return 调整后的折扣率(0.05的倍数)
|
||||||
|
**/
|
||||||
|
private String returnDiscountRate(BigDecimal discountRate) {
|
||||||
|
BigDecimal compareValue = BigDecimal.valueOf(0.05);
|
||||||
|
BigDecimal remainder = discountRate.remainder(compareValue);
|
||||||
|
DecimalFormat df = new DecimalFormat();
|
||||||
|
df.setMinimumFractionDigits(0);
|
||||||
|
df.setMaximumFractionDigits(2);
|
||||||
|
// 比较余数,若为0则数据为0.05倍数,否则需要再次四舍五入
|
||||||
|
if (remainder.compareTo(BigDecimal.ZERO) == 0) {
|
||||||
|
return df.format(discountRate);
|
||||||
|
} else {
|
||||||
|
// 再次四舍五入
|
||||||
|
BigDecimal reActuarial = BigDecimal.ZERO;
|
||||||
|
if (remainder.compareTo(BigDecimal.valueOf(CommonConstants.UtilMethodConstant.THRESHOLD_VALUE)) > 0) {
|
||||||
|
reActuarial = discountRate.add(compareValue.subtract(remainder));
|
||||||
|
} else {
|
||||||
|
reActuarial = discountRate.subtract(remainder);
|
||||||
|
}
|
||||||
|
return df.format(reActuarial);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ public class OutpatientPricingAppServiceImpl implements IOutpatientPricingAppSer
|
|||||||
public IPage<AdviceBaseDto> getAdviceBaseInfo(AdviceBaseDto adviceBaseDto, String searchKey, Long locationId,
|
public IPage<AdviceBaseDto> getAdviceBaseInfo(AdviceBaseDto adviceBaseDto, String searchKey, Long locationId,
|
||||||
Long organizationId, Integer pageNo, Integer pageSize) {
|
Long organizationId, Integer pageNo, Integer pageSize) {
|
||||||
return iDoctorStationAdviceAppService.getAdviceBaseInfo(adviceBaseDto, searchKey, locationId, null,
|
return iDoctorStationAdviceAppService.getAdviceBaseInfo(adviceBaseDto, searchKey, locationId, null,
|
||||||
organizationId, pageNo, pageSize, Whether.YES.getValue(), List.of(1, 2, 3));
|
organizationId, pageNo, pageSize, Whether.YES.getValue(), List.of(1, 2, 3), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import com.core.common.utils.AgeCalculatorUtil;
|
|||||||
import com.core.common.utils.AssignSeqUtil;
|
import com.core.common.utils.AssignSeqUtil;
|
||||||
import com.core.common.utils.MessageUtils;
|
import com.core.common.utils.MessageUtils;
|
||||||
import com.core.common.utils.SecurityUtils;
|
import com.core.common.utils.SecurityUtils;
|
||||||
|
import com.core.common.utils.bean.BeanUtils;
|
||||||
import com.openhis.administration.domain.ChargeItem;
|
import com.openhis.administration.domain.ChargeItem;
|
||||||
import com.openhis.administration.service.IChargeItemService;
|
import com.openhis.administration.service.IChargeItemService;
|
||||||
import com.openhis.common.constant.CommonConstants;
|
import com.openhis.common.constant.CommonConstants;
|
||||||
@@ -80,8 +81,9 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi
|
|||||||
public R<?> outpatientRefundInit() {
|
public R<?> outpatientRefundInit() {
|
||||||
OutpatientInitDto initDto = new OutpatientInitDto();
|
OutpatientInitDto initDto = new OutpatientInitDto();
|
||||||
List<OutpatientInitDto.chargeItemStatusOption> chargeItemStatusOptions = new ArrayList<>();
|
List<OutpatientInitDto.chargeItemStatusOption> chargeItemStatusOptions = new ArrayList<>();
|
||||||
chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.BILLED.getValue(),
|
// 门诊退费页面去掉已收费状态筛选
|
||||||
ChargeItemStatus.BILLED.getInfo()));
|
// chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.BILLED.getValue(),
|
||||||
|
// ChargeItemStatus.BILLED.getInfo()));
|
||||||
chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.REFUNDING.getValue(),
|
chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.REFUNDING.getValue(),
|
||||||
ChargeItemStatus.REFUNDING.getInfo()));
|
ChargeItemStatus.REFUNDING.getInfo()));
|
||||||
chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.REFUNDED.getValue(),
|
chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.REFUNDED.getValue(),
|
||||||
@@ -122,11 +124,6 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi
|
|||||||
refundItemList.forEach(e -> {
|
refundItemList.forEach(e -> {
|
||||||
// 退费状态
|
// 退费状态
|
||||||
e.setRefundStatus_enumText(EnumUtils.getInfoByValue(ChargeItemStatus.class, e.getRefundStatus()));
|
e.setRefundStatus_enumText(EnumUtils.getInfoByValue(ChargeItemStatus.class, e.getRefundStatus()));
|
||||||
// 发放状态
|
|
||||||
e.setDispenseStatus_enumText(EnumUtils.getInfoByValue(DispenseStatus.class, e.getDispenseStatus()));
|
|
||||||
// 执行状态
|
|
||||||
e.setServiceStatus_enumText(EnumUtils.getInfoByValue(RequestStatus.class, e.getServiceStatus()));
|
|
||||||
|
|
||||||
});
|
});
|
||||||
refundItemList.sort(Comparator.comparing(RefundItemDto::getPaymentId));
|
refundItemList.sort(Comparator.comparing(RefundItemDto::getPaymentId));
|
||||||
return R.ok(refundItemList);
|
return R.ok(refundItemList);
|
||||||
@@ -140,7 +137,6 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public R<?> refundPayment(List<RefundItemParam> refundItemList) {
|
public R<?> refundPayment(List<RefundItemParam> refundItemList) {
|
||||||
|
|
||||||
// 未退费用项,生成新的请求发放费用项
|
// 未退费用项,生成新的请求发放费用项
|
||||||
List<RefundItemParam> creatList = new ArrayList<>();
|
List<RefundItemParam> creatList = new ArrayList<>();
|
||||||
for (RefundItemParam param : refundItemList) {
|
for (RefundItemParam param : refundItemList) {
|
||||||
@@ -149,7 +145,7 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi
|
|||||||
creatList.add(param);
|
creatList.add(param);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// todo 半退逻辑需修改
|
||||||
if (!creatList.isEmpty()) {
|
if (!creatList.isEmpty()) {
|
||||||
// 未退费费用项id集合
|
// 未退费费用项id集合
|
||||||
List<Long> creatChargeItemIdList =
|
List<Long> creatChargeItemIdList =
|
||||||
@@ -245,108 +241,232 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi
|
|||||||
// 退费费用项id集合
|
// 退费费用项id集合
|
||||||
List<Long> chargeItemIdList =
|
List<Long> chargeItemIdList =
|
||||||
refundItemList.stream().map(RefundItemParam::getChargeItemId).collect(Collectors.toList());
|
refundItemList.stream().map(RefundItemParam::getChargeItemId).collect(Collectors.toList());
|
||||||
|
// 服务请求id集合
|
||||||
// 根据费用项id查询费用项请求发放信息
|
List<Long> medReqIdList = new ArrayList<>();
|
||||||
List<RefundItemDto> chargeItemList = outpatientRefundAppMapper.selectRefundItem(chargeItemIdList,
|
List<Long> devReqIdList = new ArrayList<>();
|
||||||
CommonConstants.TableName.MED_MEDICATION_REQUEST, CommonConstants.TableName.WOR_SERVICE_REQUEST,
|
|
||||||
CommonConstants.TableName.WOR_DEVICE_REQUEST, CommonConstants.Common.THREE);
|
|
||||||
|
|
||||||
List<Long> medDisIdList = new ArrayList<>();
|
|
||||||
List<Long> devDisIdList = new ArrayList<>();
|
|
||||||
List<Long> serReqIdList = new ArrayList<>();
|
List<Long> serReqIdList = new ArrayList<>();
|
||||||
|
// 查询退费项目信息
|
||||||
for (RefundItemDto dto : chargeItemList) {
|
List<ChargeItem> chargeItemList = chargeItemService.listByIds(chargeItemIdList);
|
||||||
|
if (chargeItemList != null && !chargeItemList.isEmpty()) {
|
||||||
if (CommonConstants.TableName.MED_MEDICATION_REQUEST.equals(dto.getServiceTable())) {
|
chargeItemList.forEach(item -> {
|
||||||
// 药品需要先退药
|
switch (item.getServiceTable()) {
|
||||||
if (DispenseStatus.COMPLETED.getValue().equals(dto.getDispenseStatus())
|
case CommonConstants.TableName.MED_MEDICATION_REQUEST -> medReqIdList.add(item.getServiceId());
|
||||||
|| DispenseStatus.PART_COMPLETED.getValue().equals(dto.getDispenseStatus())) {
|
case CommonConstants.TableName.WOR_DEVICE_REQUEST -> devReqIdList.add(item.getServiceId());
|
||||||
|
case CommonConstants.TableName.WOR_SERVICE_REQUEST -> serReqIdList.add(item.getServiceId());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 处理退药申请
|
||||||
|
if (!medReqIdList.isEmpty()) {
|
||||||
// 药品请求查询
|
// 药品请求查询
|
||||||
MedicationRequest medicationRequest = medicationRequestService.getById(dto.getRequestId());
|
List<MedicationRequest> medicationRequests = medicationRequestService.listByIds(medReqIdList);
|
||||||
|
// 药品发放查询
|
||||||
|
List<MedicationDispense> medicationDispenses =
|
||||||
|
medicationDispenseService.selectByRequestIdList(medReqIdList);
|
||||||
|
// 根据请求id做map
|
||||||
|
Map<Long, List<MedicationDispense>> medicationDispenseMap =
|
||||||
|
medicationDispenses.stream().collect(Collectors.groupingBy(MedicationDispense::getMedReqId));
|
||||||
|
for (MedicationRequest medicationRequest : medicationRequests) {
|
||||||
|
// 根据请求匹配发放
|
||||||
|
List<MedicationDispense> medicationDispenseList = medicationDispenseMap.get(medicationRequest.getId());
|
||||||
|
// 判断是否是退药流程
|
||||||
|
boolean isRefundFlow = false;
|
||||||
|
if (medicationDispenseList != null) {
|
||||||
|
for (MedicationDispense dispense : medicationDispenseList) {
|
||||||
|
// 先判断是否包含“已完成/部分完成”的药品,这决定了是走“退药流程”还是“取消流程”
|
||||||
|
if (DispenseStatus.COMPLETED.getValue().equals(dispense.getStatusEnum())
|
||||||
|
|| DispenseStatus.PART_COMPLETED.getValue().equals(dispense.getStatusEnum())) {
|
||||||
|
isRefundFlow = true;
|
||||||
|
break; // 只要有一条是完成状态,整个单子即视为走退药流程
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isRefundFlow) {
|
||||||
|
// ==================== 走退药流程 (生成新单据) ====================
|
||||||
|
// 校验是否重复申请
|
||||||
if (medicationRequest.getRefundMedicineId() != null) {
|
if (medicationRequest.getRefundMedicineId() != null) {
|
||||||
throw new ServiceException("已申请退药,请勿重复申请");
|
throw new ServiceException("已申请退药,请勿重复申请");
|
||||||
}
|
}
|
||||||
// 生成药品请求(退药)
|
MedicationRequest newRefundRequest = new MedicationRequest();
|
||||||
medicationRequest.setId(null); // 药品请求id
|
BeanUtils.copyProperties(medicationRequest, newRefundRequest);
|
||||||
medicationRequest
|
newRefundRequest.setId(null); // 清空ID以新增
|
||||||
.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.MEDICATION_RES_NO.getPrefix(), 4)); // 药品请求编码
|
newRefundRequest
|
||||||
medicationRequest.setQuantity(dto.getQuantity().multiply(new BigDecimal("-1"))); // 请求数量
|
.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.MEDICATION_RES_NO.getPrefix(), 4));
|
||||||
medicationRequest.setUnitCode(dto.getUnitCode()); // 请求单位编码
|
newRefundRequest.setQuantity(medicationRequest.getQuantity().multiply(new BigDecimal("-1"))); // 数量取反
|
||||||
medicationRequest.setStatusEnum(RequestStatus.CANCELLED.getValue()); // 请求状态
|
newRefundRequest.setStatusEnum(RequestStatus.CANCELLED.getValue());
|
||||||
medicationRequest.setRefundMedicineId(dto.getRequestId()); // 退药id
|
newRefundRequest.setRefundMedicineId(medicationRequest.getId()); // 关联原ID
|
||||||
medicationRequest.setPrescriptionNo(String.valueOf("T" + dto.getPrescriptionNo()));
|
newRefundRequest.setPrescriptionNo("T" + medicationRequest.getPrescriptionNo());
|
||||||
medicationRequestService.save(medicationRequest);
|
medicationRequestService.save(newRefundRequest);
|
||||||
|
Long newRequestId = newRefundRequest.getId();
|
||||||
|
|
||||||
|
// 再生成对应的负向发药记录,并关联退药请求
|
||||||
|
List<MedicationDispense> newDispensesToSave = new ArrayList<>();
|
||||||
|
for (MedicationDispense originDispense : medicationDispenseList) {
|
||||||
|
// 只处理已完成或部分完成的记录
|
||||||
|
if (DispenseStatus.COMPLETED.getValue().equals(originDispense.getStatusEnum())
|
||||||
|
|| DispenseStatus.PART_COMPLETED.getValue().equals(originDispense.getStatusEnum())) {
|
||||||
|
MedicationDispense refundDispense = new MedicationDispense();
|
||||||
|
BeanUtils.copyProperties(originDispense, refundDispense);
|
||||||
|
refundDispense.setId(null); // ID置空
|
||||||
|
refundDispense.setDispenseQuantity(BigDecimal.ZERO); // 已退数量
|
||||||
|
refundDispense.setMedReqId(newRequestId); // 关联退药请求id
|
||||||
|
refundDispense
|
||||||
|
.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.MEDICATION_DIS_NO.getPrefix(), 4));
|
||||||
|
// 退药状态
|
||||||
|
refundDispense.setStatusEnum(DispenseStatus.PENDING_REFUND.getValue());
|
||||||
|
newDispensesToSave.add(refundDispense);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 批量保存新的发药记录
|
||||||
|
if (!newDispensesToSave.isEmpty()) {
|
||||||
|
medicationDispenseService.saveBatch(newDispensesToSave);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (DispenseStatus.STOPPED.getValue().equals(dto.getDispenseStatus())
|
// ==================== 走直接取消流程 (修改原单据状态) ====================
|
||||||
&& NotPerformedReason.REFUND.getValue().equals(dto.getNotPerformedReason())) {
|
if (medicationDispenseList != null) {
|
||||||
|
List<MedicationDispense> dispensesToUpdate = new ArrayList<>();
|
||||||
|
for (MedicationDispense medicationDispense : medicationDispenseList) {
|
||||||
|
// 检查是否已经是退药状态
|
||||||
|
if (DispenseStatus.STOPPED.getValue().equals(medicationDispense.getStatusEnum())
|
||||||
|
&& NotPerformedReason.REFUND.getValue().equals(medicationDispense.getStatusEnum())) {
|
||||||
throw new ServiceException("已申请退药,请勿重复申请");
|
throw new ServiceException("已申请退药,请勿重复申请");
|
||||||
}
|
}
|
||||||
medDisIdList.add(dto.getDispenseId());
|
// 修改状态
|
||||||
|
medicationDispense.setStatusEnum(DispenseStatus.STOPPED.getValue())
|
||||||
|
.setNotPerformedReasonEnum(NotPerformedReason.REFUND.getValue());
|
||||||
|
dispensesToUpdate.add(medicationDispense);
|
||||||
|
}
|
||||||
|
// 批量更新
|
||||||
|
if (!dispensesToUpdate.isEmpty()) {
|
||||||
|
medicationDispenseService.updateBatchById(dispensesToUpdate);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 处理退耗材申请
|
||||||
|
if (!devReqIdList.isEmpty()) {
|
||||||
|
// 耗材请求查询
|
||||||
|
List<DeviceRequest> deviceRequests = deviceRequestService.listByIds(devReqIdList);
|
||||||
|
// 耗材发放查询
|
||||||
|
List<DeviceDispense> deviceDispenses = deviceDispenseService.selectByRequestIdList(devReqIdList);
|
||||||
|
// 根据请求id做map
|
||||||
|
Map<Long, List<DeviceDispense>> deviceDispenseMap =
|
||||||
|
deviceDispenses.stream().collect(Collectors.groupingBy(DeviceDispense::getDeviceReqId));
|
||||||
|
for (DeviceRequest deviceRequest : deviceRequests) {
|
||||||
|
// 根据请求匹配发放
|
||||||
|
List<DeviceDispense> deviceDispenseList = deviceDispenseMap.get(deviceRequest.getId());
|
||||||
|
// 判断是否是退耗材流程
|
||||||
|
boolean isRefundFlow = false;
|
||||||
|
if (deviceDispenseList != null) {
|
||||||
|
for (DeviceDispense dispense : deviceDispenseList) {
|
||||||
|
// 先判断是否包含“已完成/部分完成”的耗材,这决定了是走“退耗材流程”还是“取消流程”
|
||||||
|
if (DispenseStatus.COMPLETED.getValue().equals(dispense.getStatusEnum())
|
||||||
|
|| DispenseStatus.PART_COMPLETED.getValue().equals(dispense.getStatusEnum())) {
|
||||||
|
isRefundFlow = true;
|
||||||
|
break; // 只要有一条是完成状态,整个单子即视为走退耗材流程
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (CommonConstants.TableName.WOR_SERVICE_REQUEST.equals(dto.getServiceTable())) {
|
if (isRefundFlow) {
|
||||||
|
// ==================== 走退耗材流程 (生成新单据) ====================
|
||||||
|
// 校验是否重复申请
|
||||||
|
if (deviceRequest.getRefundDeviceId() != null) {
|
||||||
|
throw new ServiceException("已申请退耗材,请勿重复申请");
|
||||||
|
}
|
||||||
|
DeviceRequest newRefundRequest = new DeviceRequest();
|
||||||
|
BeanUtils.copyProperties(deviceRequest, newRefundRequest);
|
||||||
|
newRefundRequest.setId(null); // 清空ID以新增
|
||||||
|
newRefundRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEVICE_RES_NO.getPrefix(), 4));
|
||||||
|
newRefundRequest.setQuantity(deviceRequest.getQuantity().multiply(new BigDecimal("-1"))); // 数量取反
|
||||||
|
newRefundRequest.setStatusEnum(RequestStatus.CANCELLED.getValue());
|
||||||
|
newRefundRequest.setRefundDeviceId(deviceRequest.getId()); // 关联原ID
|
||||||
|
newRefundRequest.setPrescriptionNo("T" + deviceRequest.getPrescriptionNo());
|
||||||
|
deviceRequestService.save(newRefundRequest);
|
||||||
|
Long newRequestId = newRefundRequest.getId();
|
||||||
|
|
||||||
|
// 再生成对应的负向发耗材记录,并关联退耗材请求
|
||||||
|
List<DeviceDispense> newDispensesToSave = new ArrayList<>();
|
||||||
|
for (DeviceDispense originDispense : deviceDispenseList) {
|
||||||
|
// 只处理已完成或部分完成的记录
|
||||||
|
if (DispenseStatus.COMPLETED.getValue().equals(originDispense.getStatusEnum())
|
||||||
|
|| DispenseStatus.PART_COMPLETED.getValue().equals(originDispense.getStatusEnum())) {
|
||||||
|
DeviceDispense refundDispense = new DeviceDispense();
|
||||||
|
BeanUtils.copyProperties(originDispense, refundDispense);
|
||||||
|
refundDispense.setId(null); // ID置空
|
||||||
|
refundDispense.setDispenseQuantity(BigDecimal.ZERO); // 已退数量
|
||||||
|
refundDispense.setDeviceReqId(newRequestId); // 关联退耗材请求id
|
||||||
|
refundDispense
|
||||||
|
.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEVICE_DIS_NO.getPrefix(), 4));
|
||||||
|
// 退耗材状态
|
||||||
|
refundDispense.setStatusEnum(DispenseStatus.PENDING_REFUND.getValue());
|
||||||
|
newDispensesToSave.add(refundDispense);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 批量保存新的发耗材记录
|
||||||
|
if (!newDispensesToSave.isEmpty()) {
|
||||||
|
deviceDispenseService.saveBatch(newDispensesToSave);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// ==================== 走直接取消流程 (修改原单据状态) ====================
|
||||||
|
if (deviceDispenseList != null) {
|
||||||
|
List<DeviceDispense> dispensesToUpdate = new ArrayList<>();
|
||||||
|
for (DeviceDispense deviceDispense : deviceDispenseList) {
|
||||||
|
// 检查是否已经是退耗材状态
|
||||||
|
if (DispenseStatus.STOPPED.getValue().equals(deviceDispense.getStatusEnum())
|
||||||
|
&& NotPerformedReason.REFUND.getValue().equals(deviceDispense.getStatusEnum())) {
|
||||||
|
throw new ServiceException("已申请退耗材,请勿重复申请");
|
||||||
|
}
|
||||||
|
// 修改状态
|
||||||
|
deviceDispense.setStatusEnum(DispenseStatus.STOPPED.getValue())
|
||||||
|
.setNotPerformedReasonEnum(NotPerformedReason.REFUND.getValue());
|
||||||
|
dispensesToUpdate.add(deviceDispense);
|
||||||
|
}
|
||||||
|
// 批量更新
|
||||||
|
if (!dispensesToUpdate.isEmpty()) {
|
||||||
|
deviceDispenseService.updateBatchById(dispensesToUpdate);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 处理退诊疗项目申请
|
||||||
|
// 诊疗申请待更新id列表
|
||||||
|
List<Long> serReqUpdateList = new ArrayList<>();
|
||||||
|
if (!serReqIdList.isEmpty()) {
|
||||||
|
// 查询诊疗申请
|
||||||
|
List<ServiceRequest> serviceRequestList = serviceRequestService.listByIds(serReqIdList);
|
||||||
|
for (ServiceRequest serviceRequest : serviceRequestList) {
|
||||||
// 诊疗项目需医技科室同意退费
|
// 诊疗项目需医技科室同意退费
|
||||||
if (RequestStatus.COMPLETED.getValue().equals(dto.getServiceStatus())) {
|
if (RequestStatus.COMPLETED.getValue().equals(serviceRequest.getStatusEnum())) {
|
||||||
// 服务请求查询
|
|
||||||
ServiceRequest serviceRequest = serviceRequestService.getById(dto.getRequestId());
|
|
||||||
if (serviceRequest.getRefundServiceId() != null) {
|
if (serviceRequest.getRefundServiceId() != null) {
|
||||||
throw new ServiceException("已申请退费,请勿重复申请");
|
throw new ServiceException("已申请退费,请勿重复申请");
|
||||||
}
|
}
|
||||||
// 生成服务请求(取消服务)
|
// 生成服务请求(取消服务)
|
||||||
serviceRequest.setId(null); // 服务请求id
|
|
||||||
serviceRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.SERVICE_RES_NO.getPrefix(), 4)); // 服务请求编码
|
serviceRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.SERVICE_RES_NO.getPrefix(), 4)); // 服务请求编码
|
||||||
serviceRequest.setQuantity(dto.getQuantity().multiply(new BigDecimal("-1"))); // 请求数量
|
serviceRequest.setQuantity(serviceRequest.getQuantity().multiply(new BigDecimal("-1"))); // 请求数量
|
||||||
serviceRequest.setUnitCode(dto.getUnitCode()); // 请求单位编码
|
|
||||||
serviceRequest.setStatusEnum(RequestStatus.CANCELLED.getValue()); // 请求状态
|
serviceRequest.setStatusEnum(RequestStatus.CANCELLED.getValue()); // 请求状态
|
||||||
serviceRequest.setRefundServiceId(dto.getRequestId()); // 退药id
|
serviceRequest.setRefundServiceId(serviceRequest.getId());// 退id
|
||||||
|
serviceRequest.setId(null); // 服务请求id
|
||||||
serviceRequestService.save(serviceRequest);
|
serviceRequestService.save(serviceRequest);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (RequestStatus.STOPPED.getValue().equals(dto.getServiceStatus())) {
|
if (RequestStatus.STOPPED.getValue().equals(serviceRequest.getStatusEnum())) {
|
||||||
throw new ServiceException("已申请退费,请勿重复申请");
|
throw new ServiceException("已申请退费,请勿重复申请");
|
||||||
}
|
}
|
||||||
serReqIdList.add(dto.getServiceId());
|
serReqUpdateList.add(serviceRequest.getId());
|
||||||
}
|
|
||||||
|
|
||||||
} else if (CommonConstants.TableName.WOR_DEVICE_REQUEST.equals(dto.getServiceTable())) {
|
|
||||||
// 耗材需要先退药
|
|
||||||
if (DispenseStatus.COMPLETED.getValue().equals(dto.getDispenseStatus())
|
|
||||||
|| DispenseStatus.PART_COMPLETED.getValue().equals(dto.getDispenseStatus())) {
|
|
||||||
// 耗材请求查询
|
|
||||||
DeviceRequest deviceRequest = deviceRequestService.getById(dto.getRequestId());
|
|
||||||
if (deviceRequest.getRefundDeviceId() == null) {
|
|
||||||
// 生成耗材请求(退耗材)
|
|
||||||
deviceRequest.setId(null); // 耗材请求id
|
|
||||||
deviceRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEVICE_RES_NO.getPrefix(), 4)); // 耗材请求编码
|
|
||||||
deviceRequest.setQuantity(dto.getQuantity().multiply(new BigDecimal("-1"))); // 请求数量
|
|
||||||
deviceRequest.setUnitCode(dto.getUnitCode()); // 请求单位编码
|
|
||||||
deviceRequest.setStatusEnum(RequestStatus.CANCELLED.getValue()); // 请求状态
|
|
||||||
deviceRequest.setRefundDeviceId(dto.getRequestId()); // 退药id
|
|
||||||
deviceRequestService.save(deviceRequest);
|
|
||||||
}
|
|
||||||
} else if (!DispenseStatus.STOPPED.getValue().equals(dto.getDispenseStatus())) {
|
|
||||||
devDisIdList.add(dto.getDispenseId());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新收费状态:退费中
|
// 更新收费状态:退费中
|
||||||
chargeItemService.updateRefundChargeStatus(chargeItemIdList);
|
chargeItemService.updateRefundChargeStatus(chargeItemIdList);
|
||||||
|
|
||||||
if (!medDisIdList.isEmpty()) {
|
|
||||||
// 更新未发放药品状态:停止发放,停止原因:退费
|
|
||||||
medicationDispenseService.updateStopDispenseStatus(medDisIdList, NotPerformedReason.REFUND.getValue());
|
|
||||||
}
|
|
||||||
if (!devDisIdList.isEmpty()) {
|
|
||||||
// 更新未发放耗材状态:停止发放,停止原因:退费
|
|
||||||
deviceDispenseService.updateStopDispenseStatus(devDisIdList, NotPerformedReason.REFUND.getValue());
|
|
||||||
}
|
|
||||||
if (!serReqIdList.isEmpty()) {
|
|
||||||
// 更新未执行诊疗状态:停止
|
// 更新未执行诊疗状态:停止
|
||||||
serviceRequestService.updateStopRequestStatus(serReqIdList);
|
if (!serReqUpdateList.isEmpty()) {
|
||||||
|
serviceRequestService.updateStopRequestStatus(serReqUpdateList);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 返回退费成功信息
|
// 返回退费成功信息
|
||||||
return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"门诊退费"}));
|
return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"门诊退费"}));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import java.util.stream.Collectors;
|
|||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
import com.core.common.core.domain.model.LoginUser;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
@@ -91,27 +92,17 @@ public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistra
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Page<PatientMetadata> getPatientMetadataBySearchKey(String searchKey, Integer pageNo, Integer pageSize) {
|
public Page<PatientMetadata> getPatientMetadataBySearchKey(String searchKey, Integer pageNo, Integer pageSize) {
|
||||||
// 构建查询条件,添加phone字段支持手机号搜索
|
// 构建查询条件
|
||||||
QueryWrapper<Patient> queryWrapper = HisQueryUtils.buildQueryWrapper(null, searchKey,
|
QueryWrapper<Patient> queryWrapper = HisQueryUtils.buildQueryWrapper(null, searchKey,
|
||||||
new HashSet<>(Arrays.asList("id_card", "name", "py_str", "wb_str", "phone")), null);
|
new HashSet<>(Arrays.asList("id_card", "name", "py_str", "wb_str")), null);
|
||||||
// 设置排序
|
// 设置排序
|
||||||
queryWrapper.orderByDesc("update_time");
|
queryWrapper.orderByDesc("update_time");
|
||||||
// 通过证件号匹配 patient
|
// 通过证件号匹配 patient
|
||||||
if (StringUtils.isNotEmpty(searchKey)) {
|
if (StringUtils.isNotEmpty(searchKey)) {
|
||||||
List<PatientIdentifier> patientIdentifiers = patientIdentifierService
|
PatientIdentifier patientIdentifier = patientIdentifierService
|
||||||
.list(new LambdaQueryWrapper<PatientIdentifier>().eq(PatientIdentifier::getIdentifierNo, searchKey));
|
.getOne(new LambdaQueryWrapper<PatientIdentifier>().eq(PatientIdentifier::getIdentifierNo, searchKey));
|
||||||
if (patientIdentifiers != null && !patientIdentifiers.isEmpty()) {
|
if (patientIdentifier != null) {
|
||||||
// 如果有多个匹配结果,将它们全部添加到查询条件中
|
queryWrapper.or(q -> q.eq("id", patientIdentifier.getPatientId()));
|
||||||
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));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 患者信息
|
// 患者信息
|
||||||
@@ -129,13 +120,6 @@ public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistra
|
|||||||
// 初复诊
|
// 初复诊
|
||||||
e.setFirstEnum_enumText(patientIdList.contains(e.getId()) ? EncounterType.FOLLOW_UP.getInfo()
|
e.setFirstEnum_enumText(patientIdList.contains(e.getId()) ? EncounterType.FOLLOW_UP.getInfo()
|
||||||
: EncounterType.INITIAL.getInfo());
|
: EncounterType.INITIAL.getInfo());
|
||||||
// 患者标识
|
|
||||||
List<PatientIdentifier> patientIdentifiers = patientIdentifierService
|
|
||||||
.list(new LambdaQueryWrapper<PatientIdentifier>().eq(PatientIdentifier::getPatientId, e.getId()));
|
|
||||||
if (patientIdentifiers != null && !patientIdentifiers.isEmpty()) {
|
|
||||||
// 取第一个标识号,如果需要可以根据业务需求选择其他逻辑
|
|
||||||
e.setIdentifierNo(patientIdentifiers.get(0).getIdentifierNo());
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
});
|
||||||
return patientMetadataPage;
|
return patientMetadataPage;
|
||||||
@@ -228,7 +212,8 @@ public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistra
|
|||||||
|
|
||||||
CancelPaymentDto cancelPaymentDto = new CancelPaymentDto();
|
CancelPaymentDto cancelPaymentDto = new CancelPaymentDto();
|
||||||
BeanUtils.copyProperties(cancelRegPaymentDto, cancelPaymentDto);
|
BeanUtils.copyProperties(cancelRegPaymentDto, cancelPaymentDto);
|
||||||
|
//LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||||
|
//String string1 = SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH);
|
||||||
// 开通医保的处理
|
// 开通医保的处理
|
||||||
if ("1".equals(SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH))
|
if ("1".equals(SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH))
|
||||||
&& account != null && !CommonConstants.BusinessName.DEFAULT_CONTRACT_NO.equals(account.getContractNo())) {
|
&& account != null && !CommonConstants.BusinessName.DEFAULT_CONTRACT_NO.equals(account.getContractNo())) {
|
||||||
@@ -278,23 +263,6 @@ public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistra
|
|||||||
new HashSet<>(Arrays.asList("patient_name", "organization_name", "practitioner_name", "healthcare_name")),
|
new HashSet<>(Arrays.asList("patient_name", "organization_name", "practitioner_name", "healthcare_name")),
|
||||||
request);
|
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(
|
IPage<CurrentDayEncounterDto> currentDayEncounter = outpatientRegistrationAppMapper.getCurrentDayEncounter(
|
||||||
new Page<>(pageNo, pageSize), EncounterClass.AMB.getValue(), EncounterStatus.IN_PROGRESS.getValue(),
|
new Page<>(pageNo, pageSize), EncounterClass.AMB.getValue(), EncounterStatus.IN_PROGRESS.getValue(),
|
||||||
ParticipantType.ADMITTER.getCode(), ParticipantType.REGISTRATION_DOCTOR.getCode(), queryWrapper,
|
ParticipantType.ADMITTER.getCode(), ParticipantType.REGISTRATION_DOCTOR.getCode(), queryWrapper,
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
*/
|
*/
|
||||||
package com.openhis.web.chargemanage.controller;
|
package com.openhis.web.chargemanage.controller;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import com.core.common.core.domain.R;
|
import com.core.common.core.domain.R;
|
||||||
@@ -16,18 +16,18 @@ import lombok.AllArgsConstructor;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 门诊收费 controller
|
* 住院收费 controller
|
||||||
*
|
*
|
||||||
* @author zwh
|
* @author zwh
|
||||||
* @date 2025-03-12
|
* @date 2025-03-12
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/charge-manage/inpa-charge")
|
@RequestMapping("/charge-manage/inpatient-charge")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class InpatientChargeController {
|
public class InpatientChargeController {
|
||||||
|
|
||||||
@Autowired
|
@Resource
|
||||||
private IInpatientChargeAppService inpatientChargeAppService;
|
private IInpatientChargeAppService inpatientChargeAppService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -36,39 +36,38 @@ public class InpatientChargeController {
|
|||||||
* @return 初始化信息
|
* @return 初始化信息
|
||||||
*/
|
*/
|
||||||
@GetMapping(value = "/init")
|
@GetMapping(value = "/init")
|
||||||
public R<?> outpatientChargeInit() {
|
public R<?> inpatientChargeInit() {
|
||||||
return inpatientChargeAppService.outpatientChargeInit();
|
return inpatientChargeAppService.inpatientChargeInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询就诊患者分页列表
|
* 查询住院患者分页列表
|
||||||
*
|
*
|
||||||
* @param encounterPatientPageParam 查询条件
|
* @param encounterPatientPageParam 查询条件
|
||||||
* @param searchKey 模糊查询关键字
|
* @param searchKey 模糊查询关键字
|
||||||
* @param pageNo 当前页
|
* @param pageNo 当前页
|
||||||
* @param pageSize 每页多少条
|
* @param pageSize 每页多少条
|
||||||
* @param request 请求
|
* @param request 请求
|
||||||
* @return 就诊患者分页列表
|
* @return 住院患者分页列表
|
||||||
*/
|
*/
|
||||||
@GetMapping(value = "/encounter-patient-page")
|
@GetMapping(value = "/encounter-patient-page")
|
||||||
public R<?> getEncounterPatientPage(EncounterPatientPageParam encounterPatientPageParam,
|
public R<?> getEncounterPatientPage(EncounterPatientPageParam encounterPatientPageParam,
|
||||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||||
return R.ok(inpatientChargeAppService.getEncounterPatientPage(encounterPatientPageParam, searchKey, pageNo,
|
return inpatientChargeAppService.getEncounterPatientPage(encounterPatientPageParam, searchKey, pageNo, pageSize,
|
||||||
pageSize, request));
|
request);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据就诊id查询患者处方列表
|
* 根据就诊id查询患者待结算信息
|
||||||
*
|
*
|
||||||
* @param encounterId 就诊id
|
* @param encounterId 就诊id
|
||||||
* @return 患者处方列表
|
* @return 患者待结算信息
|
||||||
*/
|
*/
|
||||||
@GetMapping(value = "/patient-prescription")
|
@GetMapping(value = "/patient-prescription")
|
||||||
public R<?> getEncounterPatientPrescription(@RequestParam Long encounterId, @RequestParam String startTime,
|
public R<?> getEncounterPatientPrescription(Long encounterId) {
|
||||||
@RequestParam String endTime) {
|
return R.ok(inpatientChargeAppService.getEncounterPatientPrescription(encounterId));
|
||||||
return R.ok(inpatientChargeAppService.getEncounterPatientPrescription(encounterId, startTime, endTime));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ package com.openhis.web.chargemanage.controller;
|
|||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import com.core.common.core.domain.R;
|
import com.core.common.core.domain.R;
|
||||||
@@ -71,6 +70,17 @@ public class OutpatientChargeController {
|
|||||||
return R.ok(outpatientChargeAppService.getEncounterPatientPrescription(encounterId));
|
return R.ok(outpatientChargeAppService.getEncounterPatientPrescription(encounterId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据就诊id查询患者处方列表并新增字段:实收金额、应收金额、优惠金额、折扣率
|
||||||
|
*
|
||||||
|
* @param encounterId 就诊id
|
||||||
|
* @return 患者处方列表
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "/patient-prescription-with-price")
|
||||||
|
public R<?> getEncounterPatientPrescriptionWithPrice(@RequestParam Long encounterId) {
|
||||||
|
return R.ok(outpatientChargeAppService.getEncounterPatientPrescriptionWithPrice(encounterId));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 医保转自费
|
* 医保转自费
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -135,39 +135,4 @@ public class CurrentDayEncounterDto {
|
|||||||
*/
|
*/
|
||||||
private String phone;
|
private String phone;
|
||||||
|
|
||||||
/**
|
|
||||||
* 退号日期/时间
|
|
||||||
*/
|
|
||||||
private Date returnDate;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 退号原因
|
|
||||||
*/
|
|
||||||
private String returnReason;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 退号操作人
|
|
||||||
*/
|
|
||||||
private String operatorName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 退号操作工号(用户账号)
|
|
||||||
*/
|
|
||||||
private String operatorId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 退款金额
|
|
||||||
*/
|
|
||||||
private BigDecimal refundAmount;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 合同编码(费用性质代码)
|
|
||||||
*/
|
|
||||||
private String contractNo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 退款方式(多个支付方式用逗号分隔)
|
|
||||||
*/
|
|
||||||
private String refundMethod;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user