6 Commits

352 changed files with 12283 additions and 33222 deletions

View File

@@ -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 BootJava 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。
- **集成点 & 外部依赖**:
- 数据库PostgreSQLREADME 建议 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 包说明)展开,请告诉我要增强哪一节。

6
.gitignore vendored
View File

@@ -57,8 +57,4 @@
# 忽略设计书 # 忽略设计书
PostgreSQL/openHis_DB设计书.xlsx PostgreSQL/openHis_DB设计书.xlsx
public.sql public.sql
发版记录/2025-11-12/~$发版日志.docx
发版记录/2025-11-12/~$S-管理系统-调价管理.docx
发版记录/2025-11-12/发版日志.docx
.gitignore

View File

@@ -4,11 +4,11 @@
![天天开源](https://open.tntlinking.com/assets/logo-b-BzFUYaRU.png) ![天天开源](https://open.tntlinking.com/assets/logo-b-BzFUYaRU.png)
天天开源致⼒于打造中国应⽤管理 软件开源⽣态⾯向医疗、企业、教育三⼤⾏业信息化需求提供优质的开源软件产品与解决⽅案。平台现已发布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⽉新致开源品牌更新为天天开源我们始终秉持开源、专业、协作的理念致⼒于为医疗、教育、中⼩企业等⾏业提供优质的开源解决⽅案。
了解我们ahttps://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

View File

@@ -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();
}
}
}

View File

@@ -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;

View File

@@ -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();
}
}
}

View File

@@ -25,11 +25,6 @@
<artifactId>spring-boot-devtools</artifactId> <artifactId>spring-boot-devtools</artifactId>
<optional>true</optional> <!-- 表示依赖不会传递 --> <optional>true</optional> <!-- 表示依赖不会传递 -->
</dependency> </dependency>
<!-- lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<!-- swagger3--> <!-- swagger3-->
<dependency> <dependency>
@@ -71,13 +66,45 @@
<groupId>com.core</groupId> <groupId>com.core</groupId>
<artifactId>core-flowable</artifactId> <artifactId>core-flowable</artifactId>
</dependency> </dependency>
<!-- 通用工具-->
<dependency>
<groupId>com.core</groupId>
<artifactId>core-common</artifactId>
</dependency>
</dependencies> </dependencies>
<!-- <build>-->
<!-- <plugins>-->
<!-- <plugin>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-maven-plugin</artifactId>-->
<!-- <version>2.5.15</version>-->
<!-- <configuration>-->
<!-- <fork>true</fork> &lt;!&ndash; 如果没有该配置devtools不会生效 &ndash;&gt;-->
<!-- </configuration>-->
<!-- <executions>-->
<!-- <execution>-->
<!-- <goals>-->
<!-- <goal>repackage</goal>-->
<!-- </goals>-->
<!-- </execution>-->
<!-- </executions>-->
<!-- </plugin>-->
<!-- <plugin>-->
<!-- <groupId>org.apache.maven.plugins</groupId>-->
<!-- <artifactId>maven-war-plugin</artifactId>-->
<!-- <version>3.1.0</version>-->
<!-- <configuration>-->
<!-- <failOnMissingWebXml>false</failOnMissingWebXml>-->
<!-- <warName>${project.artifactId}</warName>-->
<!-- </configuration>-->
<!-- </plugin>-->
<!-- <plugin>-->
<!-- <groupId>org.apache.maven.plugins</groupId>-->
<!-- <artifactId>maven-compiler-plugin</artifactId>-->
<!-- <configuration>-->
<!-- <source>8</source>-->
<!-- <target>8</target>-->
<!-- </configuration>-->
<!-- </plugin>-->
<!-- </plugins>-->
<!-- <finalName>${project.artifactId}</finalName>-->
<!-- </build>-->
</project> </project>

View File

@@ -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();

View File

@@ -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"})

View File

@@ -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();// 表名

View File

@@ -24,10 +24,6 @@
<artifactId>core-common</artifactId> <artifactId>core-common</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency> <dependency>
<groupId>io.swagger</groupId> <groupId>io.swagger</groupId>
@@ -39,11 +35,6 @@
<groupId>org.postgresql</groupId> <groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId> <artifactId>postgresql</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>compile</scope>
</dependency>
</dependencies> </dependencies>

View File

@@ -66,6 +66,4 @@ public class SysTenantOption implements Serializable {
@TableField(fill = FieldFill.UPDATE) @TableField(fill = FieldFill.UPDATE)
private Date updateTime; private Date updateTime;
} }

View File

@@ -84,14 +84,6 @@ public interface SysMenuMapper {
*/ */
public SysMenu selectMenuById(Long menuId); public SysMenu selectMenuById(Long menuId);
/**
* 根据路径Path查询信息
*
* @param path 路径
* @return 菜单信息
*/
public SysMenu selectMenuByPath(String path);
/** /**
* 是否存在菜单子节点 * 是否存在菜单子节点
* *

View File

@@ -3,7 +3,6 @@ package com.core.system.service.impl;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.core.common.core.domain.R;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -267,11 +266,6 @@ public class SysMenuServiceImpl implements ISysMenuService {
*/ */
@Override @Override
public int insertMenu(SysMenu menu) { public int insertMenu(SysMenu menu) {
//路径Path唯一性判断
SysMenu sysMenu = menuMapper.selectMenuByPath(menu.getPath());
if (sysMenu != null){
return -1;
}
return menuMapper.insertMenu(menu); return menuMapper.insertMenu(menu);
} }
@@ -283,16 +277,6 @@ public class SysMenuServiceImpl implements ISysMenuService {
*/ */
@Override @Override
public int updateMenu(SysMenu menu) { public int updateMenu(SysMenu menu) {
//路径Path唯一性判断
String path = menu.getPath();
if (StringUtils.isNotBlank(path)) {
SysMenu sysMenu = menuMapper.selectMenuByPath(menu.getPath());
// 先判断sysMenu是否不为null再比较menuId
if (sysMenu != null && !menu.getMenuId().equals(sysMenu.getMenuId())) {
return -1; // 路由地址已存在
}
}
// 执行更新
return menuMapper.updateMenu(menu); return menuMapper.updateMenu(menu);
} }

View File

@@ -174,11 +174,6 @@
and rm.role_id = #{roleId} and rm.role_id = #{roleId}
</select> </select>
<select id="selectMenuByPath" parameterType="String" resultMap="SysMenuResult">
<include refid="selectMenuVo"/>
where path = #{path}
</select>
<select id="selectMenuById" parameterType="Long" resultMap="SysMenuResult"> <select id="selectMenuById" parameterType="Long" resultMap="SysMenuResult">
<include refid="selectMenuVo"/> <include refid="selectMenuVo"/>
where menu_id = #{menuId} where menu_id = #{menuId}

View File

@@ -16,17 +16,6 @@
</description> </description>
<dependencies> <dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<!-- Spring 配置 --> <!-- Spring 配置 -->
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
@@ -67,10 +56,10 @@
<artifactId>httpclient</artifactId> <artifactId>httpclient</artifactId>
</dependency> </dependency>
<!-- rabbitMQ --> <!-- rabbitMQ -->
<!-- <dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId> <artifactId>spring-boot-starter-amqp</artifactId>
</dependency> --> </dependency>
</dependencies> </dependencies>

View File

@@ -17,7 +17,7 @@ import com.openhis.web.ybmanage.config.YbServiceConfig;
/** /**
* 启动程序 * 启动程序
* *
* @author system 1 * @author system
*/ */
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}, scanBasePackages = {"com.core", "com.openhis"}) @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}, scanBasePackages = {"com.core", "com.openhis"})
@EnableConfigurationProperties(YbServiceConfig.class) @EnableConfigurationProperties(YbServiceConfig.class)

View File

@@ -16,7 +16,7 @@ import org.springframework.stereotype.Component;
@Component @Component
@ConfigurationProperties(prefix = "http") @ConfigurationProperties(prefix = "http")
@PropertySource(value = {"classpath:http.yml"}) @PropertySource(value = {"classpath:http.yml"})
public class HttpConfig { public class HttpConfig {
private String appId; private String appId;
private String key; private String key;
private String url; private String url;

View File

@@ -1,45 +0,0 @@
package com.openhis.web.appointmentmanage.appservice;
import com.core.common.core.domain.R;
import com.openhis.appointmentmanage.domain.ClinicRoom;
public interface IClinicRoomAppService {
/**
* 分页查询诊室列表
* @param pageNum 页码
* @param pageSize 每页条数
* @param orgName 卫生机构名称
* @param roomName 诊室名称
* @return 分页查询结果
*/
R<?> selectClinicRoomPage(Integer pageNum, Integer pageSize, String orgName, String roomName);
/**
* 查询诊室详情
* @param id 诊室ID
* @return 诊室详情
*/
R<?> selectClinicRoomById(Long id);
/**
* 新增诊室
* @param clinicRoom 诊室信息
* @return 新增结果
*/
R<?> insertClinicRoom(ClinicRoom clinicRoom);
/**
* 更新诊室
* @param clinicRoom 诊室信息
* @return 更新结果
*/
R<?> updateClinicRoom(ClinicRoom clinicRoom);
/**
* 删除诊室
* @param id 诊室ID
* @return 删除结果
*/
R<?> deleteClinicRoomById(Long id);
}

View File

@@ -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);
}

View File

@@ -1,13 +0,0 @@
package com.openhis.web.appointmentmanage.appservice;
import com.core.common.core.domain.R;
import com.openhis.appointmentmanage.domain.DoctorSchedule;
public interface IDoctorScheduleAppService {
R<?> getDoctorScheduleList();
R<?> addDoctorSchedule(DoctorSchedule doctorSchedule);
R<?> removeDoctorSchedule(Integer doctorScheduleId);
}

View File

@@ -1,8 +0,0 @@
package com.openhis.web.appointmentmanage.appservice;
import com.core.common.core.domain.R;
import com.openhis.web.appointmentmanage.dto.SchedulePoolDto;
public interface ISchedulePoolAppService {
R<?> addSchedulePool(SchedulePoolDto schedulePoolDto);
}

View File

@@ -1,4 +0,0 @@
package com.openhis.web.appointmentmanage.appservice;
public interface IScheduleSlotAppService {
}

View File

@@ -1,121 +0,0 @@
package com.openhis.web.appointmentmanage.appservice.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.core.common.core.domain.R;
import com.openhis.appointmentmanage.domain.ClinicRoom;
import com.openhis.appointmentmanage.service.IClinicRoomService;
import com.openhis.web.appointmentmanage.appservice.IClinicRoomAppService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service
public class ClinicRoomAppServiceImpl implements IClinicRoomAppService {
@Resource
private IClinicRoomService clinicRoomService;
@Override
public R<?> selectClinicRoomPage(Integer pageNum, Integer pageSize, String orgName, String roomName) {
// 构建查询条件
ClinicRoom clinicRoom = new ClinicRoom();
if (orgName != null && ObjectUtil.isNotEmpty(orgName)) {
clinicRoom.setOrgName(orgName);
}
if (roomName != null && ObjectUtil.isNotEmpty(roomName)) {
clinicRoom.setRoomName(roomName);
}
// 分页查询
Page<ClinicRoom> page = new Page<>(pageNum, pageSize);
Page<ClinicRoom> result = clinicRoomService.selectClinicRoomPage(page, clinicRoom);
return R.ok(result);
}
@Override
public R<?> selectClinicRoomById(Long id) {
ClinicRoom clinicRoom = clinicRoomService.selectClinicRoomById(id);
if (clinicRoom == null) {
return R.fail(404, "诊室不存在");
}
return R.ok(clinicRoom);
}
@Override
public R<?> insertClinicRoom(ClinicRoom clinicRoom) {
// 数据校验
if (ObjectUtil.isEmpty(clinicRoom.getRoomName())) {
return R.fail(400, "诊室名称不能为空");
}
if (ObjectUtil.isEmpty(clinicRoom.getDepartment())) {
return R.fail(400, "科室名称不能为空");
}
if (clinicRoom.getRoomName().length() > 50) {
return R.fail(400, "诊室名称长度不能超过50个字符");
}
if (clinicRoom.getRemarks() != null && clinicRoom.getRemarks().length() > 500) {
return R.fail(400, "备注长度不能超过500个字符");
}
// 新增诊室
int result = clinicRoomService.insertClinicRoom(clinicRoom);
if (result > 0) {
return R.ok(null, "新增成功");
} else {
return R.fail("新增失败");
}
}
@Override
public R<?> updateClinicRoom(ClinicRoom clinicRoom) {
// 数据校验
if (ObjectUtil.isEmpty(clinicRoom.getId())) {
return R.fail(400, "诊室ID不能为空");
}
if (ObjectUtil.isEmpty(clinicRoom.getRoomName())) {
return R.fail(400, "诊室名称不能为空");
}
if (ObjectUtil.isEmpty(clinicRoom.getDepartment())) {
return R.fail(400, "科室名称不能为空");
}
if (clinicRoom.getRoomName().length() > 50) {
return R.fail(400, "诊室名称长度不能超过50个字符");
}
if (clinicRoom.getRemarks() != null && clinicRoom.getRemarks().length() > 500) {
return R.fail(400, "备注长度不能超过500个字符");
}
// 检查诊室是否存在
ClinicRoom existingClinicRoom = clinicRoomService.selectClinicRoomById(clinicRoom.getId());
if (existingClinicRoom == null) {
return R.fail(404, "诊室不存在");
}
// 更新诊室
int result = clinicRoomService.updateClinicRoom(clinicRoom);
if (result > 0) {
return R.ok(null, "修改成功");
} else {
return R.fail("修改失败");
}
}
@Override
public R<?> deleteClinicRoomById(Long id) {
// 检查诊室是否存在
ClinicRoom existingClinicRoom = clinicRoomService.selectClinicRoomById(id);
if (existingClinicRoom == null) {
return R.fail(404, "诊室不存在");
}
// 删除诊室
int result = clinicRoomService.deleteClinicRoomById(id);
if (result > 0) {
return R.ok(null, "删除成功");
} else {
return R.fail("删除失败");
}
}
}

View File

@@ -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.appointmentmanage.domain.Dept;
import com.openhis.appointmentmanage.service.IDeptService;
import com.openhis.web.appointmentmanage.appservice.IDeptAppService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class DeptAppServiceImpl implements IDeptAppService {
@Resource
private IDeptService deptService;
@Override
public R<?> getDeptList() {
List<Dept> list = deptService.list();
return R.ok(list);
}
@Override
public R<?> searchDept(Integer pageNo, Integer pageSize, String orgName, String deptName) {
LambdaQueryWrapper<Dept> wrapper = new LambdaQueryWrapper<>();
if (orgName != null && ObjectUtil.isNotEmpty(orgName)) {
wrapper.eq(Dept::getOrgName, orgName);
}
if (deptName != null && ObjectUtil.isNotEmpty(deptName)) {
wrapper.eq(Dept::getDeptName, deptName);
}
List<Dept> list = deptService.list(wrapper);
return R.ok(list);
}
}

View File

@@ -1,42 +0,0 @@
package com.openhis.web.appointmentmanage.appservice.impl;
import cn.hutool.core.util.ObjectUtil;
import com.core.common.core.domain.R;
import com.openhis.appointmentmanage.domain.DoctorSchedule;
import com.openhis.appointmentmanage.service.IDoctorScheduleService;
import com.openhis.web.appointmentmanage.appservice.IDoctorScheduleAppService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class DoctorScheduleAppServiceImpl implements IDoctorScheduleAppService {
@Resource
private IDoctorScheduleService doctorScheduleService;
@Override
public R<?> getDoctorScheduleList() {
List<DoctorSchedule> list = doctorScheduleService.list();
return R.ok(list);
}
@Override
public R<?> addDoctorSchedule(DoctorSchedule doctorSchedule) {
if (ObjectUtil.isEmpty(doctorSchedule)) {
return R.fail("医生排班不能为空");
}
boolean save = doctorScheduleService.save(doctorSchedule);
return R.ok(save);
}
@Override
public R<?> removeDoctorSchedule(Integer doctorScheduleId) {
if (doctorScheduleId == null && ObjectUtil.isEmpty(doctorScheduleId)) {
return R.fail("排班id不能为空");
}
boolean remove = doctorScheduleService.removeById(doctorScheduleId);
return R.ok(remove);
}
}

View File

@@ -1,42 +0,0 @@
package com.openhis.web.appointmentmanage.appservice.impl;
import cn.hutool.core.util.ObjectUtil;
import com.core.common.core.domain.R;
import com.openhis.appointmentmanage.domain.SchedulePool;
import com.openhis.appointmentmanage.service.ISchedulePoolService;
import com.openhis.web.appointmentmanage.appservice.ISchedulePoolAppService;
import com.openhis.web.appointmentmanage.dto.SchedulePoolDto;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service
public class SchedulePoolAppServiceImpl implements ISchedulePoolAppService {
@Resource
private ISchedulePoolService schedulePoolService;
@Override
public R<?> addSchedulePool(SchedulePoolDto schedulePoolDto) {
//1.数据检验
if(ObjectUtil.isNull(schedulePoolDto)){
return R.fail("号源不能为空");
}
//2.封装实体
SchedulePool schedulePool = new SchedulePool();
schedulePool.setHospitalId(schedulePoolDto.getHospitalId());
schedulePool.setDeptId(schedulePoolDto.getDeptId());
schedulePool.setDoctorId(schedulePoolDto.getDoctorId());
schedulePool.setDoctorName(schedulePoolDto.getDoctorName());
schedulePool.setScheduleDate(schedulePoolDto.getScheduleDate());
schedulePool.setShift(schedulePoolDto.getShift());
schedulePool.setStartTime(schedulePoolDto.getStartTime());
schedulePool.setEndTime(schedulePoolDto.getEndTime());
schedulePool.setRegType(schedulePoolDto.getRegType());
schedulePool.setFee(schedulePoolDto.getFee());
//3.保存
boolean save = schedulePoolService.save(schedulePool);
return R.ok(save);
}
}

View File

@@ -1,8 +0,0 @@
package com.openhis.web.appointmentmanage.appservice.impl;
import com.openhis.web.appointmentmanage.appservice.IScheduleSlotAppService;
import org.springframework.stereotype.Service;
@Service
public class ScheduleSlotAppServiceImpl implements IScheduleSlotAppService {
}

View File

@@ -1,73 +0,0 @@
package com.openhis.web.appointmentmanage.controller;
import com.core.common.core.domain.R;
import com.openhis.appointmentmanage.domain.ClinicRoom;
import com.openhis.web.appointmentmanage.appservice.IClinicRoomAppService;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@RestController
@RequestMapping("/appoinment/clinic-room")
public class ClinicRoomController {
@Resource
private IClinicRoomAppService clinicRoomAppService;
/**
* 分页查询诊室列表
* @param pageNum 页码
* @param pageSize 每页条数
* @param orgName 卫生机构名称
* @param roomName 诊室名称
* @return 分页查询结果
*/
@GetMapping("/page")
public R<?> selectClinicRoomPage(
@RequestParam(required = true) Integer pageNum,
@RequestParam(required = true) Integer pageSize,
@RequestParam(required = false) String orgName,
@RequestParam(required = false) String roomName) {
return clinicRoomAppService.selectClinicRoomPage(pageNum, pageSize, orgName, roomName);
}
/**
* 查询诊室详情
* @param id 诊室ID
* @return 诊室详情
*/
@GetMapping("/{id}")
public R<?> selectClinicRoomById(@PathVariable Long id) {
return clinicRoomAppService.selectClinicRoomById(id);
}
/**
* 新增诊室
* @param clinicRoom 诊室信息
* @return 新增结果
*/
@PostMapping
public R<?> insertClinicRoom(@RequestBody ClinicRoom clinicRoom) {
return clinicRoomAppService.insertClinicRoom(clinicRoom);
}
/**
* 更新诊室
* @param clinicRoom 诊室信息
* @return 更新结果
*/
@PutMapping
public R<?> updateClinicRoom(@RequestBody ClinicRoom clinicRoom) {
return clinicRoomAppService.updateClinicRoom(clinicRoom);
}
/**
* 删除诊室
* @param id 诊室ID
* @return 删除结果
*/
@DeleteMapping("/{id}")
public R<?> deleteClinicRoomById(@PathVariable Long id) {
return clinicRoomAppService.deleteClinicRoomById(id);
}
}

View File

@@ -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));
}
}

View File

@@ -1,43 +0,0 @@
package com.openhis.web.appointmentmanage.controller;
import com.core.common.core.domain.R;
import com.openhis.appointmentmanage.domain.DoctorSchedule;
import com.openhis.web.appointmentmanage.appservice.IDoctorScheduleAppService;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@RestController
@RequestMapping("/doctor-schedule")
public class DoctorScheduleController {
@Resource
private IDoctorScheduleAppService doctorScheduleAppService;
/*
* 获取医生排班List
*
* */
@GetMapping("/list")
public R<?> getDoctorScheduleList() {
return R.ok(doctorScheduleAppService.getDoctorScheduleList());
}
/*
* 新增医生排班
*
* */
@PostMapping("/add")
public R<?> addDoctorSchedule(@RequestBody DoctorSchedule doctorSchedule) {
return R.ok(doctorScheduleAppService.addDoctorSchedule(doctorSchedule));
}
/*
* 删除医生排班
*
* */
@DeleteMapping("/delete/{doctorScheduleId}")
public R<?> removeDoctorSchedule(@PathVariable Integer doctorScheduleId){
return R.ok(doctorScheduleAppService.removeDoctorSchedule(doctorScheduleId));
}
}

View File

@@ -1,28 +0,0 @@
package com.openhis.web.appointmentmanage.controller;
import com.core.common.core.domain.R;
import com.openhis.appointmentmanage.domain.SchedulePool;
import com.openhis.web.appointmentmanage.appservice.ISchedulePoolAppService;
import com.openhis.web.appointmentmanage.dto.SchedulePoolDto;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
@RestController
@RequestMapping("/schedule-pool")
public class SchedulePoolController {
@Resource
private ISchedulePoolAppService schedulePoolAppService;
/*
* 新增号源
*
* */
public R<?> addSchedulePool(@RequestBody SchedulePoolDto schedulePoolDto) {
return R.ok(schedulePoolAppService.addSchedulePool(schedulePoolDto));
}
}

View File

@@ -1,9 +0,0 @@
package com.openhis.web.appointmentmanage.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/schedule-slot")
public class ScheduleSlotController {
}

View File

@@ -1,104 +0,0 @@
package com.openhis.web.appointmentmanage.dto;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.experimental.Accessors;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
/**
* 号源池Dto
*
* @date 2025-12-12
*/
@Data
public class SchedulePoolDto {
/** id */
private Integer id;
/** 业务编号 */
private String poolCode;
/** 医院ID */
private Integer hospitalId;
/** 科室ID */
private Integer deptId;
/** 医生ID */
private Integer doctorId;
/** 医生姓名 */
private String doctorName;
/** 诊室 */
private String clinicRoom;
/** 出诊日期 */
private LocalDate scheduleDate;
/** 班别 */
private String shift;
/** 开始时间 */
private LocalTime startTime;
/** 结束时间 */
private LocalTime endTime;
/** 总号量 */
private Integer totalQuota;
/** 已约 */
private Integer bookedNum;
/** 铁号数 */
private Integer lockedNum;
/** 剩余号数 */
private Integer availableNum;
/** 号别 */
private String regType;
/** 原价 (元) */
private Double fee;
/** 医保限价 (元) */
private Double insurancePrice;
/** 支持渠道 */
private String supportChannel;
/** 号源状态 */
private Integer status;
/** 停诊原因 */
private String stopReason;
/** 放号时间 */
private LocalDateTime releaseTime;
/** 截止预约时间 */
private LocalDateTime deadlineTime;
/** 乐观锁版本 */
private Integer version;
/** 操作人ID */
private Integer opUserId;
/** 备注 */
private String remark;
/** 排班ID */
private Integer scheduleId;
/** 创建时间 */
private LocalDateTime createTime;
/** 更新时间 */
private LocalDateTime updateTime;
}

View File

@@ -1,7 +0,0 @@
package com.openhis.web.appointmentmanage.mapper;
import org.springframework.stereotype.Repository;
@Repository
public interface DeptAppMapper {
}

View File

@@ -1,7 +0,0 @@
package com.openhis.web.appointmentmanage.mapper;
import org.springframework.stereotype.Repository;
@Repository
public interface DoctorScheduleAppMapper {
}

View File

@@ -1,7 +0,0 @@
package com.openhis.web.appointmentmanage.mapper;
import org.springframework.stereotype.Repository;
@Repository
public interface SchedulePoolAppMapper {
}

View File

@@ -1,7 +0,0 @@
package com.openhis.web.appointmentmanage.mapper;
import org.springframework.stereotype.Repository;
@Repository
public interface ScheduleSlotAppMapper {
}

View File

@@ -100,18 +100,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[] {"机构信息查询"}));
} }
/** /**

View File

@@ -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;
} }

View File

@@ -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));
}
}

View File

@@ -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("删除失败");
}
}

View File

@@ -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("删除失败");
}
}

View File

@@ -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;
}
}

View File

@@ -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
*/ */

View File

@@ -82,11 +82,6 @@ public class HealthcareServiceFormData {
@NotBlank(message = "预约要求不能为空") @NotBlank(message = "预约要求不能为空")
private Integer appointmentRequiredFlag; private Integer appointmentRequiredFlag;
/**
* 出诊医生ID
*/
private Long practitionerId;
/** 医保编码 */ /** 医保编码 */
private String ybNo; private String ybNo;

View File

@@ -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());
}
}
}

View File

@@ -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);
}

View File

@@ -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;
}
}

View File

@@ -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;
}

View File

@@ -91,27 +91,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 +119,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;
@@ -278,23 +261,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,

View File

@@ -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;
} }

View File

@@ -56,8 +56,4 @@ public class PatientMetadata {
*/ */
private String firstEnum_enumText; private String firstEnum_enumText;
/**
* 就诊卡号
*/
private String identifierNo;
} }

View File

@@ -81,11 +81,5 @@ public class RefundItemDto {
/** 项目名 */ /** 项目名 */
private String itemName; private String itemName;
/** 费用支付方式编码 */
private String medfeePaymtdCode;
/** 费用类型 */
private String feeType;
} }

View File

@@ -1,29 +0,0 @@
package com.openhis.web.check.appservice;
import com.core.common.core.domain.R;
import com.openhis.check.domain.CheckMethod;
import io.swagger.models.auth.In;
import javax.servlet.http.HttpServletResponse;
/**
* 检查方法Service接口
*
* @author system
* @date 2025-07-22
*/
public interface ICheckMethodAppService{
R<?> getCheckMethodList();
R<?> addCheckMethod(CheckMethod checkMethod);
R<?> updateCheckMethod(CheckMethod checkPart);
R<?> removeCheckMethod(Integer checkMethodId);
R<?> searchCheckMethodList(Integer pageNo, Integer pageSize, String checkType, String name, String packageName);
R<?> exportCheckMethod(String checkType, String name, String packageName, HttpServletResponse response);
}

View File

@@ -1,48 +0,0 @@
package com.openhis.web.check.appservice;
import com.core.common.core.domain.R;
import com.openhis.web.check.dto.CheckPackageDto;
/**
* 检查套餐AppService接口
*
* @author system
* @date 2025-11-26
*/
public interface ICheckPackageAppService {
/**
* 获取检查套餐列表
* @return 检查套餐列表
*/
R<?> getCheckPackageList();
/**
* 根据ID获取检查套餐详情
* @param id 套餐ID
* @return 套餐详情
*/
R<?> getCheckPackageById(Long id);
/**
* 新增检查套餐
* @param checkPackageDto 套餐信息
* @return 新增结果
*/
R<?> addCheckPackage(CheckPackageDto checkPackageDto);
/**
* 更新检查套餐
* @param checkPackageDto 套餐信息
* @return 更新结果
*/
R<?> updateCheckPackage(CheckPackageDto checkPackageDto);
/**
* 删除检查套餐
* @param id 套餐ID
* @return 删除结果
*/
R<?> deleteCheckPackage(Long id);
}

View File

@@ -1,20 +0,0 @@
package com.openhis.web.check.appservice;
import com.core.common.core.domain.R;
import com.openhis.check.domain.CheckPart;
import javax.servlet.http.HttpServletResponse;
public interface ICheckPartAppService {
R<?> getCheckPartList();
R<?> addCheckPart(CheckPart checkPart);
R<?> removeCheckPart(Integer checkPartId);
R<?> updateCheckPart(CheckPart checkPart);
R<?> searchCheckPartList(Integer pageNo, Integer pageSize, String checkType, String name, String packageName);
R<?> exportCheckPart(String checkType, String name, String packageName, HttpServletResponse response);
}

View File

@@ -1,14 +0,0 @@
package com.openhis.web.check.appservice;
import com.core.common.core.domain.R;
import com.openhis.check.domain.LisGroupInfo;
public interface ILisGroupInfoAppService {
R<?> getLisGroupInfoList();
R<?> add(LisGroupInfo lisGroupInfo);
R<?> update(LisGroupInfo lisGroupInfo);
R<?> delete(Integer lisGroupInfoId);
}

View File

@@ -1,129 +0,0 @@
package com.openhis.web.check.appservice.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.core.common.core.domain.R;
import com.openhis.check.domain.CheckMethod;
import com.openhis.check.service.ICheckMethodService;
import com.openhis.web.check.appservice.ICheckMethodAppService;
import com.openhis.web.reportmanage.utils.ExcelFillerUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@Service
@Slf4j
public class CheckMethodAppServiceImpl implements ICheckMethodAppService {
@Resource
private ICheckMethodService checkMethodService;
@Override
public R<?> getCheckMethodList() {
List<CheckMethod> list = checkMethodService.list();
return R.ok(list);
}
@Override
public R<?> searchCheckMethodList(Integer pageNo, Integer pageSize, String checkType, String name, String packageName) {
LambdaQueryWrapper<CheckMethod> wrapper = new LambdaQueryWrapper<>();
if (checkType != null && ObjectUtil.isNotEmpty(checkType)) {
wrapper.eq(CheckMethod::getCheckType, checkType);
}
if (name != null && ObjectUtil.isNotEmpty(name)) {
wrapper.like(CheckMethod::getName, name);
}
if (packageName != null && ObjectUtil.isNotEmpty(packageName)) {
wrapper.eq(CheckMethod::getPackageName, packageName);
}
List<CheckMethod> list = checkMethodService.list(wrapper);
return R.ok(list);
}
@Override
public R<?> addCheckMethod(CheckMethod checkMethod) {
//1.数据校验
if (ObjectUtil.isEmpty(checkMethod.getName())) {
return R.fail("检查方法名称不能为空!");
}
if (ObjectUtil.isEmpty(checkMethod.getCode())) {
return R.fail("检查方法代码不能为空!");
}
if (ObjectUtil.isEmpty(checkMethod.getCheckType())) {
return R.fail("检查方法的检查类型不能为空!");
}
//2.保存
boolean save = checkMethodService.save(checkMethod);
return R.ok(save);
}
@Override
public R<?> updateCheckMethod(CheckMethod checkMethod) {
//1.数据校验
if (ObjectUtil.isEmpty(checkMethod.getName())) {
return R.fail("检查方法名称不能为空!");
}
if (ObjectUtil.isEmpty(checkMethod.getCode())) {
return R.fail("检查方法代码不能为空!");
}
if (ObjectUtil.isEmpty(checkMethod.getCheckType())) {
return R.fail("检查方法的检查类型不能为空!");
}
//2.更新
boolean b = checkMethodService.updateById(checkMethod);
return R.ok(b);
}
@Override
public R<?> removeCheckMethod(Integer checkMethodId) {
boolean remove = checkMethodService.removeById(checkMethodId);
return R.ok(remove);
}
@Override
public R<?> exportCheckMethod(String checkType, String name, String packageName, HttpServletResponse response) {
LambdaQueryWrapper<CheckMethod> wrapper = new LambdaQueryWrapper<>();
if (checkType != null && ObjectUtil.isNotEmpty(checkType)) {
wrapper.eq(CheckMethod::getCheckType, checkType);
}
if (name != null && ObjectUtil.isNotEmpty(name)) {
wrapper.like(CheckMethod::getName, name);
}
if (packageName != null && ObjectUtil.isNotEmpty(packageName)) {
wrapper.eq(CheckMethod::getPackageName, packageName);
}
List<CheckMethod> list = checkMethodService.list(wrapper);
if (list.isEmpty()) {
return R.fail("导出Excel失败,无数据。");
}
try {
// 准备表头key对应实体的字段名
Map<String, String> headers = new LinkedHashMap<>();
headers.put("checkType", "检查类型");
headers.put("code", "方法代码");
headers.put("name", "方法名称");
headers.put("packageName", "套餐名称");
headers.put("exposureNum", "曝光次数");
headers.put("orderNum", "序号");
headers.put("remark", "备注");
// 文件名,只传文字部分
String excelName = "检查方法列表";
// 导出到Excel
ExcelFillerUtil.makeExcelFile(response, list, headers, excelName, null);
} catch (IOException | IllegalAccessException e) {
e.printStackTrace();
return R.fail("导出Excel失败" + e.getMessage());
}
return R.ok(null, "导出Excel成功");
}
}

View File

@@ -1,206 +0,0 @@
package com.openhis.web.check.appservice.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.core.common.core.domain.R;
import com.openhis.check.domain.CheckPackage;
import com.openhis.check.domain.CheckPackageDetail;
import com.openhis.check.service.ICheckPackageDetailService;
import com.openhis.check.service.ICheckPackageService;
import com.openhis.web.check.appservice.ICheckPackageAppService;
import com.openhis.web.check.dto.CheckPackageDetailDto;
import com.openhis.web.check.dto.CheckPackageDto;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* 检查套餐AppService实现
*
* @author system
* @date 2025-11-26
*/
@Slf4j
@Service
@AllArgsConstructor
public class CheckPackageAppServiceImpl implements ICheckPackageAppService {
private final ICheckPackageService checkPackageService;
private final ICheckPackageDetailService checkPackageDetailService;
@Override
public R<?> getCheckPackageList() {
try {
List<CheckPackage> list = checkPackageService.list();
return R.ok(list);
} catch (Exception e) {
log.error("获取检查套餐列表失败", e);
return R.fail("获取检查套餐列表失败");
}
}
@Override
public R<?> getCheckPackageById(Long id) {
try {
CheckPackage checkPackage = checkPackageService.getById(id);
if (checkPackage == null) {
return R.fail("套餐不存在");
}
// 获取套餐明细
List<CheckPackageDetail> details = checkPackageDetailService.list(
new LambdaQueryWrapper<CheckPackageDetail>()
.eq(CheckPackageDetail::getPackageId, id)
.orderByAsc(CheckPackageDetail::getOrderNum)
);
// 转换为DTO
CheckPackageDto dto = new CheckPackageDto();
BeanUtils.copyProperties(checkPackage, dto);
List<CheckPackageDetailDto> detailDtos = details.stream().map(detail -> {
CheckPackageDetailDto detailDto = new CheckPackageDetailDto();
BeanUtils.copyProperties(detail, detailDto);
return detailDto;
}).collect(Collectors.toList());
dto.setItems(detailDtos);
return R.ok(dto);
} catch (Exception e) {
log.error("获取检查套餐详情失败", e);
return R.fail("获取检查套餐详情失败");
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public R<?> addCheckPackage(CheckPackageDto checkPackageDto) {
try {
// 创建套餐主表数据
CheckPackage checkPackage = new CheckPackage();
BeanUtils.copyProperties(checkPackageDto, checkPackage);
// 设置套餐维护日期为当前系统日期
checkPackage.setMaintainDate(LocalDate.now());
checkPackage.setCreateTime(LocalDateTime.now());
checkPackage.setUpdateTime(LocalDateTime.now());
// 保存套餐主表
boolean saveResult = checkPackageService.save(checkPackage);
if (!saveResult) {
return R.fail("保存套餐失败");
}
// 保存套餐明细
if (checkPackageDto.getItems() != null && !checkPackageDto.getItems().isEmpty()) {
List<CheckPackageDetail> details = new ArrayList<>();
int orderNum = 1;
for (CheckPackageDetailDto detailDto : checkPackageDto.getItems()) {
CheckPackageDetail detail = new CheckPackageDetail();
BeanUtils.copyProperties(detailDto, detail);
detail.setPackageId(checkPackage.getId());
detail.setOrderNum(orderNum++);
detail.setCreateTime(LocalDateTime.now());
detail.setUpdateTime(LocalDateTime.now());
details.add(detail);
}
checkPackageDetailService.saveBatch(details);
}
return R.ok(checkPackage.getId(), "保存成功");
} catch (Exception e) {
log.error("新增检查套餐失败", e);
return R.fail("新增检查套餐失败: " + e.getMessage());
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public R<?> updateCheckPackage(CheckPackageDto checkPackageDto) {
try {
// 检查套餐是否存在
CheckPackage existPackage = checkPackageService.getById(checkPackageDto.getId());
if (existPackage == null) {
return R.fail("套餐不存在");
}
// 更新套餐主表数据
CheckPackage checkPackage = new CheckPackage();
BeanUtils.copyProperties(checkPackageDto, checkPackage);
// 更新套餐维护日期为当前系统日期
checkPackage.setMaintainDate(LocalDate.now());
checkPackage.setUpdateTime(LocalDateTime.now());
boolean updateResult = checkPackageService.updateById(checkPackage);
if (!updateResult) {
return R.fail("更新套餐失败");
}
// 删除原有明细
checkPackageDetailService.remove(
new LambdaQueryWrapper<CheckPackageDetail>()
.eq(CheckPackageDetail::getPackageId, checkPackage.getId())
);
// 保存新的套餐明细
if (checkPackageDto.getItems() != null && !checkPackageDto.getItems().isEmpty()) {
List<CheckPackageDetail> details = new ArrayList<>();
int orderNum = 1;
for (CheckPackageDetailDto detailDto : checkPackageDto.getItems()) {
CheckPackageDetail detail = new CheckPackageDetail();
BeanUtils.copyProperties(detailDto, detail);
detail.setPackageId(checkPackage.getId());
detail.setOrderNum(orderNum++);
detail.setCreateTime(LocalDateTime.now());
detail.setUpdateTime(LocalDateTime.now());
details.add(detail);
}
checkPackageDetailService.saveBatch(details);
}
return R.ok("更新成功");
} catch (Exception e) {
log.error("更新检查套餐失败", e);
return R.fail("更新检查套餐失败: " + e.getMessage());
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public R<?> deleteCheckPackage(Long id) {
try {
// 检查套餐是否存在
CheckPackage existPackage = checkPackageService.getById(id);
if (existPackage == null) {
return R.fail("套餐不存在");
}
// 删除套餐明细
checkPackageDetailService.remove(
new LambdaQueryWrapper<CheckPackageDetail>()
.eq(CheckPackageDetail::getPackageId, id)
);
// 删除套餐主表
boolean deleteResult = checkPackageService.removeById(id);
if (!deleteResult) {
return R.fail("删除套餐失败");
}
return R.ok("删除成功");
} catch (Exception e) {
log.error("删除检查套餐失败", e);
return R.fail("删除检查套餐失败: " + e.getMessage());
}
}
}

View File

@@ -1,109 +0,0 @@
package com.openhis.web.check.appservice.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.core.common.core.domain.R;
import com.openhis.check.domain.CheckPart;
import com.openhis.check.service.ICheckPartService;
import com.openhis.web.check.appservice.ICheckPartAppService;
import com.openhis.web.reportmanage.utils.ExcelFillerUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@Service
@Slf4j
public class CheckPartAppServiceImpl implements ICheckPartAppService {
@Resource
private ICheckPartService checkPartService;
@Override
public R<?> getCheckPartList() {
List<CheckPart> list = checkPartService.list();
return R.ok(list);
}
@Override
public R<?> searchCheckPartList(Integer pageNo, Integer pageSize, String checkType, String name, String packageName) {
LambdaQueryWrapper<CheckPart> wrapper = new LambdaQueryWrapper<>();
if (checkType != null && ObjectUtil.isNotEmpty(checkType)) {
wrapper.eq(CheckPart::getCheckType, checkType);
}
if (name != null && ObjectUtil.isNotEmpty(name)) {
wrapper.like(CheckPart::getName, name);
}
if (packageName != null && ObjectUtil.isNotEmpty(packageName)) {
wrapper.eq(CheckPart::getPackageName, packageName);
}
List<CheckPart> list = checkPartService.list(wrapper);
return R.ok(list);
}
@Override
public R<?> addCheckPart(CheckPart checkPart) {
//数据检验
//保存
boolean save = checkPartService.save(checkPart);
return R.ok(save);
}
@Override
public R<?> removeCheckPart(Integer checkPartId) {
boolean remove = checkPartService.removeById(checkPartId);
return R.ok(remove);
}
@Override
public R<?> updateCheckPart(CheckPart checkPart) {
boolean b = checkPartService.updateById(checkPart);
return R.ok(b);
}
@Override
public R<?> exportCheckPart(String checkType, String name, String packageName, HttpServletResponse response) {
LambdaQueryWrapper<CheckPart> wrapper = new LambdaQueryWrapper<>();
if (checkType != null && ObjectUtil.isNotEmpty(checkType)) {
wrapper.eq(CheckPart::getCheckType, checkType);
}
if (name != null && ObjectUtil.isNotEmpty(name)) {
wrapper.like(CheckPart::getName, name);
}
if (packageName != null && ObjectUtil.isNotEmpty(packageName)) {
wrapper.eq(CheckPart::getPackageName, packageName);
}
List<CheckPart> list = checkPartService.list(wrapper);
if (list.isEmpty()) {
return R.fail("导出Excel失败,无数据。");
}
try {
// 准备表头key对应实体的字段名
Map<String, String> headers = new LinkedHashMap<>();
headers.put("checkType", "检查类型");
headers.put("code", "部位代码");
headers.put("name", "部位名称");
headers.put("packageName", "套餐名称");
headers.put("exposureNum", "曝光次数");
headers.put("price", "金额");
headers.put("number", "序号");
headers.put("serviceScope", "服务范围");
headers.put("subType", "下级医技类型");
headers.put("remark", "备注");
// 文件名,只传文字部分
String excelName = "检查部位列表";
// 导出到Excel
ExcelFillerUtil.makeExcelFile(response, list, headers, excelName, null);
} catch (IOException | IllegalAccessException e) {
e.printStackTrace();
return R.fail("导出Excel失败" + e.getMessage());
}
return R.ok(null, "导出Excel成功");
}
}

View File

@@ -1,48 +0,0 @@
package com.openhis.web.check.appservice.impl;
import cn.hutool.core.util.ObjectUtil;
import com.core.common.core.domain.R;
import com.openhis.check.domain.LisGroupInfo;
import com.openhis.check.service.ILisGroupInfoService;
import com.openhis.web.check.appservice.ILisGroupInfoAppService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
@Slf4j
public class LisGroupInfoAppServiceImpl implements ILisGroupInfoAppService {
@Resource
private ILisGroupInfoService lisGroupInfoService;
@Override
public R<?> getLisGroupInfoList() {
List<LisGroupInfo> list = lisGroupInfoService.list();
return R.ok(list);
}
@Override
public R<?> add(LisGroupInfo lisGroupInfo) {
if (ObjectUtil.isEmpty(lisGroupInfo)) {
return R.fail("信息不能为空");
}
boolean save = lisGroupInfoService.save(lisGroupInfo);
return R.ok(save);
}
@Override
public R<?> update(LisGroupInfo lisGroupInfo) {
if (ObjectUtil.isEmpty(lisGroupInfo)) {
return R.fail("信息不能为空");
}
boolean update = lisGroupInfoService.updateById(lisGroupInfo);
return R.ok( update);
}
@Override
public R<?> delete(Integer lisGroupInfoId) {
boolean b = lisGroupInfoService.removeById(lisGroupInfoId);
return R.ok(b);
}
}

View File

@@ -1,82 +0,0 @@
package com.openhis.web.check.controller;
import com.core.common.core.domain.R;
import com.openhis.check.domain.CheckMethod;
import com.openhis.web.check.appservice.ICheckMethodAppService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
@RestController
@Slf4j
@RequestMapping("/check/method")
public class CheckMethodController {
@Resource
private ICheckMethodAppService checkMethodAppService;
/*
* 获取检查方法
* @Param 此处参数注释有问题,完全是按照需求给的图来注释的
*/
@GetMapping("/list")
public R<?> getCheckMethodList(){
return R.ok(checkMethodAppService.getCheckMethodList());
}
/*
* 条件查询检查方法
* @Para
* */
@GetMapping("/search")
public R<?> searchCheckMethodList(
@RequestParam(required = false) Integer pageNo,
@RequestParam(required = false) Integer pageSize,
@RequestParam(required = false) String checkType,
@RequestParam(required = false) String name,
@RequestParam(required = false) String packageName) {
return R.ok(checkMethodAppService.searchCheckMethodList(pageNo,pageSize,checkType,name,packageName));
}
/*
* 新增检查方法
* @Param
*/
@PostMapping("/add")
public R<?> addCheckMethod(@RequestBody CheckMethod checkMethod){
return R.ok(checkMethodAppService.addCheckMethod(checkMethod));
}
/*
* 删除检查方法
* @Param code代码
*/
@DeleteMapping("/delete/{checkMethodId}")
public R<?> deleteCheckMethod(@PathVariable Integer checkMethodId){
return R.ok(checkMethodAppService.removeCheckMethod(checkMethodId));
}
/*
* 更新检查方法
* @Param
*/
@PutMapping("/update")
public R<?> updateCheckMethod(@RequestBody CheckMethod checkMethod){
return R.ok(checkMethodAppService.updateCheckMethod(checkMethod));
}
/*
* 导出检查方法列表
* @Param
*/
@GetMapping("/export")
public void exportCheckMethod(
@RequestParam(required = false) String checkType,
@RequestParam(required = false) String name,
@RequestParam(required = false) String packageName,
HttpServletResponse response) {
checkMethodAppService.exportCheckMethod(checkType, name, packageName, response);
}
}

View File

@@ -1,80 +0,0 @@
package com.openhis.web.check.controller;
import com.core.common.core.domain.R;
import com.openhis.check.domain.CheckPart;
import com.openhis.web.check.appservice.ICheckPartAppService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
@RestController
@Slf4j
@RequestMapping("/check/part")
public class CheckPartController {
@Resource
private ICheckPartAppService checkPartAppService;
/*
* 获取检查部位
* @Param检查方法 此处参数注释有问题,完全是按照需求给的图来注释的
*/
@GetMapping("/list")
public R<?> getCheckPartList(){
return R.ok(checkPartAppService.getCheckPartList());
}
/*
* 条件搜索检查部位
* @Param
* */
@GetMapping("/search")
public R<?> searchCheckPartList(@RequestParam(required = false) Integer pageNo,
@RequestParam(required = false) Integer pageSize,
@RequestParam(required = false) String checkType,
@RequestParam(required = false) String name,
@RequestParam(required = false) String packageName){
return R.ok(checkPartAppService.searchCheckPartList(pageNo,pageSize,checkType,name,packageName));
}
/*
* 新增检查部位
* @Param
*/
@PostMapping("/add")
public R<?> addCheckPart(@RequestBody CheckPart checkPart){
return R.ok(checkPartAppService.addCheckPart(checkPart));
}
/*
* 删除检查部位
* @Param code代码
*/
@DeleteMapping("/delete/{checkPartId}")
public R<?> deleteCheckPart(@PathVariable Integer checkPartId){
return R.ok(checkPartAppService.removeCheckPart(checkPartId));
}
/*
* 更新检查部位
* @Param
*/
@PutMapping("/update")
public R<?> updateCheckPart(@RequestBody CheckPart checkPart){
return R.ok(checkPartAppService.updateCheckPart(checkPart));
}
/*
* 导出检查部位列表
* @Param
*/
@GetMapping("/export")
public void exportCheckPart(
@RequestParam(required = false) String checkType,
@RequestParam(required = false) String name,
@RequestParam(required = false) String packageName,
HttpServletResponse response) {
checkPartAppService.exportCheckPart(checkType, name, packageName, response);
}
}

View File

@@ -1,186 +0,0 @@
package com.openhis.web.check.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.core.common.core.controller.BaseController;
import com.core.common.core.domain.AjaxResult;
import com.core.common.core.domain.R;
import com.openhis.check.domain.CheckMethod;
import com.openhis.check.domain.CheckPackage;
import com.openhis.check.domain.CheckPart;
import com.openhis.check.domain.CheckType;
import com.openhis.check.service.ICheckMethodService;
import com.openhis.check.service.ICheckPackageService;
import com.openhis.check.service.ICheckPartService;
import com.openhis.check.service.ICheckTypeService;
import com.openhis.web.check.appservice.ICheckPackageAppService;
import com.openhis.web.check.dto.CheckPackageDto;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.time.LocalDate;
import java.util.List;
/**
* 检查类型管理Controller
*
* @author system
* @date 2025-07-22
* @updated 2025-11-26 - 增加套餐设置相关接口
*/
@RestController
@RequestMapping({"/system/check-type", "/system"})
@Slf4j
@AllArgsConstructor
public class CheckTypeController extends BaseController {
private final ICheckTypeService checkTypeService;
private final ICheckMethodService checkMethodService;
private final ICheckPartService checkPartService;
private final ICheckPackageService checkPackageService;
private final ICheckPackageAppService checkPackageAppService;
/**
* 获取检查类型列表
*/
@GetMapping("/list")
public AjaxResult list() {
List<CheckType> list = checkTypeService.list();
return AjaxResult.success(list);
}
/**
* 获取检查方法列表
*/
@GetMapping({"/method/list", "/check-method/list"})
public AjaxResult methodList() {
List<CheckMethod> list = checkMethodService.list();
return AjaxResult.success(list);
}
/**
* 获取检查部位列表
*/
@GetMapping({"/part/list", "/check-part/list"})
public AjaxResult partList() {
List<CheckPart> list = checkPartService.list();
return AjaxResult.success(list);
}
/**
* 获取检查套餐列表(支持分页和筛选)
*/
@GetMapping({"/package/list", "/check-package/list"})
public AjaxResult packageList(
@RequestParam(required = false) Integer pageNo,
@RequestParam(required = false) Integer pageSize,
@RequestParam(required = false) String organization,
@RequestParam(required = false) String packageName,
@RequestParam(required = false) String packageLevel,
@RequestParam(required = false) String packageType,
@RequestParam(required = false) String department,
@RequestParam(required = false) String user,
@RequestParam(required = false) String startDate,
@RequestParam(required = false) String endDate) {
LambdaQueryWrapper<CheckPackage> wrapper = new LambdaQueryWrapper<>();
// 添加筛选条件
if (organization != null && !organization.isEmpty()) {
wrapper.eq(CheckPackage::getOrganization, organization);
}
if (packageName != null && !packageName.isEmpty()) {
wrapper.like(CheckPackage::getPackageName, packageName);
}
if (packageLevel != null && !packageLevel.isEmpty()) {
wrapper.eq(CheckPackage::getPackageLevel, packageLevel);
}
if (packageType != null && !packageType.isEmpty()) {
wrapper.eq(CheckPackage::getPackageType, packageType);
}
if (department != null && !department.isEmpty()) {
wrapper.like(CheckPackage::getDepartment, department);
}
if (user != null && !user.isEmpty()) {
wrapper.like(CheckPackage::getUser, user);
}
if (startDate != null && !startDate.isEmpty()) {
wrapper.ge(CheckPackage::getMaintainDate, LocalDate.parse(startDate));
}
if (endDate != null && !endDate.isEmpty()) {
wrapper.le(CheckPackage::getMaintainDate, LocalDate.parse(endDate));
}
// 按更新时间倒序排列
wrapper.orderByDesc(CheckPackage::getUpdateTime);
// 如果需要分页
if (pageNo != null && pageSize != null) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<CheckPackage> page =
new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(pageNo, pageSize);
com.baomidou.mybatisplus.extension.plugins.pagination.Page<CheckPackage> result =
checkPackageService.page(page, wrapper);
return AjaxResult.success(result);
} else {
List<CheckPackage> list = checkPackageService.list(wrapper);
return AjaxResult.success(list);
}
}
/**
* 新增检查类型
*/
@PostMapping
public AjaxResult add(@RequestBody CheckType checkType) {
return toAjax(checkTypeService.save(checkType));
}
/**
* 修改检查类型
*/
@PutMapping
public AjaxResult edit(@RequestBody CheckType checkType) {
return toAjax(checkTypeService.updateById(checkType));
}
/**
* 删除检查类型
*/
@DeleteMapping("/{checkTypeId}")
public AjaxResult remove(@PathVariable Long checkTypeId) {
return toAjax(checkTypeService.removeById(checkTypeId));
}
/**
* 根据ID获取检查套餐详情
*/
@GetMapping({"/package/{id}", "/check-package/{id}"})
public R<?> getCheckPackageById(@PathVariable Long id) {
return checkPackageAppService.getCheckPackageById(id);
}
/**
* 新增检查套餐
*/
@PostMapping({"/package", "/check-package"})
public R<?> addCheckPackage(@Valid @RequestBody CheckPackageDto checkPackageDto) {
return checkPackageAppService.addCheckPackage(checkPackageDto);
}
/**
* 更新检查套餐
*/
@PutMapping({"/package", "/check-package"})
public R<?> updateCheckPackage(@Valid @RequestBody CheckPackageDto checkPackageDto) {
return checkPackageAppService.updateCheckPackage(checkPackageDto);
}
/**
* 删除检查套餐
*/
@DeleteMapping({"/package/{id}", "/check-package/{id}"})
public R<?> deleteCheckPackage(@PathVariable Long id) {
return checkPackageAppService.deleteCheckPackage(id);
}
}

View File

@@ -1,56 +0,0 @@
package com.openhis.web.check.controller;
import com.core.common.core.domain.R;
import com.openhis.web.check.appservice.ILisGroupInfoAppService;
import org.springframework.web.bind.annotation.*;
import com.openhis.check.domain.LisGroupInfo;
import javax.annotation.Resource;
@RestController
@RequestMapping("/check/lisGroupInfo")
public class LisGroupInfoController {
@Resource
private ILisGroupInfoAppService lisGroupInfoAppService;
/*
*
* 获取Lis分组信息
*
* */
@GetMapping("/list")
public R<?> getLisGroupInfoList(){
return R.ok(lisGroupInfoAppService.getLisGroupInfoList());
}
/*
*
* 新增Lis分组信息
*
* */
@PostMapping("/add")
public R<?> addLisGroupInfo(@RequestBody LisGroupInfo lisGroupInfo){
return R.ok(lisGroupInfoAppService.add(lisGroupInfo));
}
/*
*
* 修改Lis分组信息
*
* */
@PutMapping("/update")
public R<?> updateLisGroupInfo(@RequestBody LisGroupInfo lisGroupInfo){
return R.ok(lisGroupInfoAppService.update(lisGroupInfo));
}
/*
*
* 删除Lis分组信息
*
* */
@DeleteMapping("/{lisGroupInfoId}")
public R<?> deleteLisGroupInfo(@PathVariable Integer lisGroupInfoId){
return R.ok(lisGroupInfoAppService.delete(lisGroupInfoId));
}
}

View File

@@ -1,46 +0,0 @@
package com.openhis.web.check.dto;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.experimental.Accessors;
import java.time.LocalDateTime;
@Data
@Accessors(chain = true)
public class CheckMethodDto {
/**
* 检查方法ID
*/
@TableId(type = IdType.AUTO)
private Long id;
/* 检查类型 */
private String checkType;
/* 方法代码 */
private String code;
/* 方法名称 */
private String name;
/* 套餐名称 */
private String packageName;
/* 曝光次数 */
private Integer exposureNum;
/* 序号 */
private Integer orderNum;
/* 备注 */
private String remark;
/** 创建时间 */
private LocalDateTime createTime;
/** 更新时间 */
private LocalDateTime updateTime;
}

View File

@@ -1,71 +0,0 @@
package com.openhis.web.check.dto;
import lombok.Data;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
/**
* 检查套餐明细DTO
*
* @author system
* @date 2025-11-26
*/
@Data
@Accessors(chain = true)
public class CheckPackageDetailDto {
/** 套餐明细ID */
private Long id;
/** 套餐ID */
private Long packageId;
/** 项目编号 */
private String itemCode;
/** 项目名称/规格 */
@NotBlank(message = "项目名称不能为空")
private String itemName;
/** 检查项目ID(诊疗项目ID) */
private Long checkItemId;
/** 剂量 */
private String dose;
/** 途径 */
private String method;
/** 频次 */
private String frequency;
/** 天数 */
private String days;
/** 数量 */
@NotNull(message = "数量不能为空")
private Integer quantity;
/** 单价 */
@NotNull(message = "单价不能为空")
private BigDecimal unitPrice;
/** 金额 */
private BigDecimal amount;
/** 服务费 */
private BigDecimal serviceCharge;
/** 总金额 */
private BigDecimal total;
/** 产地 */
private String origin;
/** 序号 */
private Integer orderNum;
}

View File

@@ -1,86 +0,0 @@
package com.openhis.web.check.dto;
import lombok.Data;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;
/**
* 检查套餐DTO
*
* @author system
* @date 2025-11-26
*/
@Data
@Accessors(chain = true)
public class CheckPackageDto {
/** 检查套餐ID */
private Long id;
/** 套餐名称 */
@NotBlank(message = "套餐名称不能为空")
private String packageName;
/** 套餐编码 */
private String code;
/** 套餐类别 */
@NotBlank(message = "套餐类别不能为空")
private String packageType;
/** 套餐级别 */
@NotBlank(message = "套餐级别不能为空")
private String packageLevel;
/** 适用科室 */
private String department;
/** 适用用户 */
private String user;
/** 卫生机构 */
private String organization;
/** 套餐金额 */
private BigDecimal packagePrice;
/** 折扣 */
private BigDecimal discount;
/** 制单人 */
private String creator;
/** 是否停用 */
private Integer isDisabled;
/** 显示套餐名 */
private Integer showPackageName;
/** 生成服务费 */
private Integer generateServiceFee;
/** 套餐价格启用状态 */
private Integer packagePriceEnabled;
/** 服务费 */
private BigDecimal serviceFee;
/** 备注 */
private String remark;
/** 描述 */
private String description;
/** 套餐维护日期 */
private LocalDate createDate;
/** 套餐明细列表 */
@NotNull(message = "套餐明细不能为空")
private List<CheckPackageDetailDto> items;
}

View File

@@ -1,41 +0,0 @@
package com.openhis.web.check.dto;
import lombok.Data;
import lombok.experimental.Accessors;
@Data
@Accessors(chain = true)
public class CheckPartDto {
/** 检查部位id */
private Long id;
/** 检查部位名称 */
private String name;
/** 检查部位编码 */
private String code;
/** 检查部位检查类型 */
private String checkType;
/** 曝光次数 */
private Integer exposureNum;
/** 费用套餐 */
private String packageName;
/** 金额 */
private Double price;
/** 序号 */
private Integer number;
/** 服务范围 */
private String serviceScope;
/** 下级医技类型 */
private String subType;
/** 备注 */
private String remark;
}

View File

@@ -1,10 +0,0 @@
package com.openhis.web.check.mapper;
import org.springframework.stereotype.Repository;
@Repository
public interface CheckMethodAppMapper{
}

View File

@@ -1,7 +0,0 @@
package com.openhis.web.check.mapper;
import org.springframework.stereotype.Repository;
@Repository
public interface CheckPartAppMapper {
}

View File

@@ -1,7 +0,0 @@
package com.openhis.web.check.mapper;
import org.springframework.stereotype.Repository;
@Repository
public interface LisGroupInfoAppMapper {
}

View File

@@ -29,7 +29,7 @@ public interface ICommonService {
/** /**
* 药房列表(库房用) * 药房列表(库房用)
* *
* @return 药房列表1 * @return 药房列表
*/ */
List<LocationDto> getInventoryPharmacyList(); List<LocationDto> getInventoryPharmacyList();

View File

@@ -8,7 +8,6 @@ import java.util.stream.Collectors;
import javax.annotation.Resource; import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
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;
@@ -84,7 +83,6 @@ public class CommonServiceImpl implements ICommonService {
public List<LocationDto> getPharmacyList() { public List<LocationDto> getPharmacyList() {
List<Location> pharmacyList = locationService.getPharmacyList(); List<Location> pharmacyList = locationService.getPharmacyList();
List<LocationDto> locationDtoList = new ArrayList<>(); List<LocationDto> locationDtoList = new ArrayList<>();
LocationDto locationDto; LocationDto locationDto;
for (Location location : pharmacyList) { for (Location location : pharmacyList) {
@@ -92,8 +90,6 @@ public class CommonServiceImpl implements ICommonService {
BeanUtils.copyProperties(location, locationDto); BeanUtils.copyProperties(location, locationDto);
locationDtoList.add(locationDto); locationDtoList.add(locationDto);
} }
return locationDtoList; return locationDtoList;
} }

View File

@@ -89,7 +89,7 @@ public class CommonAppController {
/** /**
* 病区列表 * 病区列表
* *
* @return 病区列表 * @return 病区列表
*/ */
@GetMapping(value = "/ward-list") @GetMapping(value = "/ward-list")
public R<?> getWardList(@RequestParam(value = "orgId", required = false) Long orgId) { public R<?> getWardList(@RequestParam(value = "orgId", required = false) Long orgId) {
@@ -103,7 +103,7 @@ public class CommonAppController {
*/ */
@GetMapping(value = "/department-list") @GetMapping(value = "/department-list")
public R<?> getDepartmentList() { public R<?> getDepartmentList() {
return commonService.getDepartmentList(); return commonService.getDepartmentList();
} }
/** /**

View File

@@ -179,7 +179,7 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
// 分页查询 // 分页查询
IPage<DiagnosisTreatmentDto> diseaseTreatmentPage = IPage<DiagnosisTreatmentDto> diseaseTreatmentPage =
activityDefinitionManageMapper.getDiseaseTreatmentPage(new Page<DiagnosisTreatmentDto>(pageNo, pageSize), queryWrapper); activityDefinitionManageMapper.getDiseaseTreatmentPage(new Page<>(pageNo, pageSize), queryWrapper);
diseaseTreatmentPage.getRecords().forEach(e -> { diseaseTreatmentPage.getRecords().forEach(e -> {
// 医保标记枚举类回显赋值 // 医保标记枚举类回显赋值

View File

@@ -1,16 +0,0 @@
package com.openhis.web.doctorstation.appservice;
import com.core.common.core.domain.R;
import com.openhis.template.domain.DoctorPhrase;
public interface IDoctorPhraseAppService {
R<?> getDoctorPhraseList();
R<?> searchDoctorPhraseList(String phraseName ,String phraseType);
R<?> addDoctorPhrase(DoctorPhrase doctorPhrase);
R<?> updateDoctorPhrase(DoctorPhrase doctorPhrase);
R<?> deleteDoctorPhrase(Integer doctorPhraseId);
}

View File

@@ -52,14 +52,6 @@ public interface IDoctorStationMainAppService {
*/ */
R<?> completeEncounter(Long encounterId); R<?> completeEncounter(Long encounterId);
/**
* 取消完成
*
* @param encounterId 就诊id
* @return 结果
*/
R<?> cancelEncounter(Long encounterId);
/** /**
* 查询处方号列表信息 * 查询处方号列表信息
* *

View File

@@ -1,73 +0,0 @@
package com.openhis.web.doctorstation.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.template.domain.DoctorPhrase;
import com.openhis.template.service.IDoctorPhraseService;
import com.openhis.web.doctorstation.appservice.IDoctorPhraseAppService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class DoctorPhraesAppServiceImpl implements IDoctorPhraseAppService {
@Resource
private IDoctorPhraseService doctorPhraseService;
@Override
public R<?> getDoctorPhraseList() {
List<DoctorPhrase> list = doctorPhraseService.list();
return R.ok(list);
}
@Override
public R<?> searchDoctorPhraseList(String phraseName,String phraseType) {
//1.数据校验
if (phraseType == null || phraseType.equals("")) {
return R.fail("模板类型不能为空");
}
//2.查询
LambdaQueryWrapper<DoctorPhrase> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(DoctorPhrase::getPhraseName, phraseName).eq(DoctorPhrase::getPhraseType, phraseType);
List<DoctorPhrase> list = doctorPhraseService.list(wrapper);
return R.ok(list);
}
@Override
public R<?> addDoctorPhrase(DoctorPhrase doctorPhrase) {
//1.数据校验
if(ObjectUtil.isEmpty(doctorPhrase)){
return R.fail("医生常用语不能为空");
}
//2.新增
boolean save = doctorPhraseService.save(doctorPhrase);
return R.ok(save);
}
@Override
public R<?> updateDoctorPhrase(DoctorPhrase doctorPhrase) {
//1.数据校验
if(ObjectUtil.isEmpty(doctorPhrase)){
return R.fail("医生常用语不能为空");
}
//2.更新
boolean updateById = doctorPhraseService.updateById(doctorPhrase);
return R.ok(updateById);
}
@Override
public R<?> deleteDoctorPhrase(Integer doctorPhraseId) {
//1.数据校验
if(doctorPhraseId == null){
return R.fail("ID不能为空");
}
//2.删除
boolean removeById = doctorPhraseService.removeById(doctorPhraseId);
return R.ok(removeById);
}
}

View File

@@ -145,17 +145,6 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
adviceUtils.subtractInventory(adviceInventoryList, adviceDraftInventoryList); adviceUtils.subtractInventory(adviceInventoryList, adviceDraftInventoryList);
// 查询取药科室配置 // 查询取药科室配置
List<AdviceInventoryDto> medLocationConfig = doctorStationAdviceAppMapper.getMedLocationConfig(organizationId); List<AdviceInventoryDto> medLocationConfig = doctorStationAdviceAppMapper.getMedLocationConfig(organizationId);
// 将配置转为 {categoryCode -> 允许的locationId集合}
Map<String, Set<Long>> allowedLocByCategory = new HashMap<>();
if (medLocationConfig != null && !medLocationConfig.isEmpty()) {
for (AdviceInventoryDto cfg : medLocationConfig) {
if (cfg.getCategoryCode() == null || cfg.getLocationId() == null) {
continue;
}
allowedLocByCategory.computeIfAbsent(String.valueOf(cfg.getCategoryCode()), k -> new HashSet<>())
.add(cfg.getLocationId());
}
}
// 费用定价子表信息 // 费用定价子表信息
List<AdvicePriceDto> childCharge = doctorStationAdviceAppMapper List<AdvicePriceDto> childCharge = doctorStationAdviceAppMapper
.getChildCharge(ConditionCode.LOT_NUMBER_PRICE.getCode(), chargeItemDefinitionIdList); .getChildCharge(ConditionCode.LOT_NUMBER_PRICE.getCode(), chargeItemDefinitionIdList);

View File

@@ -1,13 +1,14 @@
package com.openhis.web.doctorstation.appservice.impl; package com.openhis.web.doctorstation.appservice.impl;
import java.util.*; import java.util.Arrays;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import cn.hutool.core.util.ObjectUtil;
import com.openhis.web.doctorstation.appservice.*;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -24,6 +25,7 @@ import com.openhis.administration.service.IEncounterParticipantService;
import com.openhis.common.enums.*; import com.openhis.common.enums.*;
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.doctorstation.appservice.IDoctorStationMainAppService;
import com.openhis.web.doctorstation.dto.PatientInfoDto; import com.openhis.web.doctorstation.dto.PatientInfoDto;
import com.openhis.web.doctorstation.dto.PrescriptionInfoBaseDto; import com.openhis.web.doctorstation.dto.PrescriptionInfoBaseDto;
import com.openhis.web.doctorstation.dto.PrescriptionInfoDetailDto; import com.openhis.web.doctorstation.dto.PrescriptionInfoDetailDto;
@@ -44,17 +46,6 @@ public class DoctorStationMainAppServiceImpl implements IDoctorStationMainAppSer
@Resource @Resource
IEncounterParticipantService iEncounterParticipantService; IEncounterParticipantService iEncounterParticipantService;
@Resource
IDoctorStationAdviceAppService iDoctorStationAdviceAppService;
@Resource
IDoctorStationEmrAppService iDoctorStationEmrAppService;
@Resource
IDoctorStationDiagnosisAppService iDoctorStationDiagnosisAppService;
@Resource
IDoctorStationChineseMedicalAppService iDoctorStationChineseMedicalAppService;
/** /**
* 查询就诊患者信息 * 查询就诊患者信息
* *
@@ -163,45 +154,6 @@ public class DoctorStationMainAppServiceImpl implements IDoctorStationMainAppSer
return update > 0 ? R.ok() : R.fail(); return update > 0 ? R.ok() : R.fail();
} }
/**
* 取消接诊
*
* @param encounterId 就诊id
* @return 结果
*/
@Override
public R<?> cancelEncounter(Long encounterId) {
//1.判断是否已经产生业务,如医生已经开有病历、处方、诊断、检验检查或相关项目已收费、执行等,
//如果有则提示:需要医生删除、作废、退费才能【取消接诊】。
//1.1病历
Object emrDetailResult = iDoctorStationEmrAppService.getEmrDetail(encounterId).getData();
//1.2诊断
Object diagnosisResult = iDoctorStationDiagnosisAppService.getEncounterDiagnosis(encounterId).getData();
//1.3处方
Object adviceResult = iDoctorStationAdviceAppService.getRequestBaseInfo(encounterId).getData();
//1.4中医诊断、处方
Map<?,?> tcmDiagnosisResult = (Map<?,?>) iDoctorStationChineseMedicalAppService.getTcmEncounterDiagnosis(encounterId).getData();
Object symptom = tcmDiagnosisResult.get("symptom");
Object illness = tcmDiagnosisResult.get("illness");
Object tcmPrescriptionResult = iDoctorStationChineseMedicalAppService.getTcmRequestBaseInfo(encounterId).getData();
boolean isEmpty = ObjectUtil.isAllEmpty(emrDetailResult, diagnosisResult, adviceResult, symptom,illness, tcmPrescriptionResult);
if (!isEmpty) {
return R.fail();
}
//2.取消接诊,患者重新回到患者队列待诊中
int update = encounterMapper.update(null,
new LambdaUpdateWrapper<Encounter>().eq(Encounter::getId, encounterId)
.set(Encounter::getStatusEnum, EncounterStatus.PLANNED.getValue())
.set(Encounter::getSubjectStatusEnum, EncounterSubjectStatus.TRIAGED.getValue()));
return update > 0 ? R.ok() : R.fail();
}
/** /**
* 查询处方号列表信息 * 查询处方号列表信息
* *

View File

@@ -1,76 +0,0 @@
package com.openhis.web.doctorstation.controller;
import com.core.common.core.domain.R;
import com.openhis.template.domain.DoctorPhrase;
import com.openhis.web.doctorstation.appservice.IDoctorPhraseAppService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@RestController
@Slf4j
@RequestMapping("/Doctor-phrase")
public class DoctorPhraseController {
@Resource
private IDoctorPhraseAppService doctorPhraseAppService;
/**
* 获取医生常用语List
*
* @return 结果
*/
@GetMapping("/list")
public R<?> getDoctorPhraseList(){
return R.ok(doctorPhraseAppService.getDoctorPhraseList());
}
/**
* 查询医生常用语
*
* @param phraseType 模板级别
* @return 结果
*/
@GetMapping("/search")
public R<?> searchDoctorPhraseList(
@RequestParam(required = false) String phraseType,
@RequestParam(required = false) String phraseName
){
return R.ok(doctorPhraseAppService.searchDoctorPhraseList(phraseName,phraseType));
}
/**
* 新增医生常用语
*
* @param doctorPhrase 医生常用语
* @return 结果
*/
@PostMapping("/add")
public R<?> addDoctorPhrase(@RequestBody DoctorPhrase doctorPhrase){
return R.ok(doctorPhraseAppService.addDoctorPhrase(doctorPhrase));
}
/**
* 更新医生常用语
*
* @param doctorPhrase 医生常用语
* @return 结果
*/
@PostMapping("/update")
public R<?> updateDoctorPhrase(@RequestBody DoctorPhrase doctorPhrase){
return R.ok(doctorPhraseAppService.updateDoctorPhrase(doctorPhrase));
}
/**
* 删除医生常用语
*
* @param DoctorPhraseId 医生常用语ID
* @return 结果
*/
@PostMapping("/delete/{DoctorPhraseId}")
public R<?> deleteDoctorPhrase(@PathVariable Integer DoctorPhraseId){
return R.ok(doctorPhraseAppService.deleteDoctorPhrase(DoctorPhraseId));
}
}

View File

@@ -92,17 +92,6 @@ public class DoctorStationMainController {
return iDoctorStationMainAppService.completeEncounter(encounterId); return iDoctorStationMainAppService.completeEncounter(encounterId);
} }
/**
* 取消接诊
*
* @param encounterId 就诊id
* @return 结果
*/
@GetMapping(value = "/cancel-encounter")
public R<?> cancelEncounter(@RequestParam Long encounterId) {
return iDoctorStationMainAppService.cancelEncounter(encounterId);
}
/** /**
* 查询处方号列表信息 * 查询处方号列表信息
* *

View File

@@ -40,11 +40,6 @@ public class PatientInfoDto {
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
private Long orgId; private Long orgId;
/**
* 科室名称
*/
private String organizationName;
/** /**
* 患者姓名 * 患者姓名
*/ */

View File

@@ -1,7 +0,0 @@
package com.openhis.web.doctorstation.mapper;
import org.springframework.stereotype.Repository;
@Repository
public interface DoctorPhraseAppMapper {
}

View File

@@ -7,8 +7,6 @@ import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
@@ -166,27 +164,6 @@ public class PurchaseInventoryAppServiceImpl implements IPurchaseInventoryAppSer
if (receiptDetailList.isEmpty()) { if (receiptDetailList.isEmpty()) {
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00006, null)); return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00006, null));
} }
// 获取所有供应商ID
Set<Long> supplierIds = receiptDetailList.stream()
.filter(dto -> dto.getSupplierId() != null)
.map(ReceiptDetailDto::getSupplierId)
.collect(Collectors.toSet());
// 查询供应商信息并设置供应商名称
if (!supplierIds.isEmpty()) {
List<Supplier> suppliers = supplierService.listByIds(supplierIds);
Map<Long, String> supplierNameMap = suppliers.stream()
.collect(Collectors.toMap(Supplier::getId, Supplier::getName));
// 设置供应商名称
receiptDetailList.forEach(dto -> {
if (dto.getSupplierId() != null) {
dto.setSupplierName(supplierNameMap.getOrDefault(dto.getSupplierId(), ""));
}
});
}
return R.ok(receiptDetailList); return R.ok(receiptDetailList);
} }
@@ -238,7 +215,7 @@ public class PurchaseInventoryAppServiceImpl implements IPurchaseInventoryAppSer
// 申请时间 // 申请时间
.setApplyTime(DateUtils.getNowDate()); .setApplyTime(DateUtils.getNowDate());
supplyRequestList.add(supplyRequest); supplyRequestList.add(supplyRequest);
} }
// 保存 // 保存
@@ -250,7 +227,7 @@ public class PurchaseInventoryAppServiceImpl implements IPurchaseInventoryAppSer
List<Long> requestIdList = supplyRequestIdList.stream().map(SupplyRequest::getId).collect(Collectors.toList()); List<Long> requestIdList = supplyRequestIdList.stream().map(SupplyRequest::getId).collect(Collectors.toList());
for (Long list : requestIdList) { for (Long list : requestIdList) {
idList.add(list.toString()); idList.add(list.toString());
} }
// 返回请求id // 返回请求id
return R.ok(idList, null); return R.ok(idList, null);

View File

@@ -1,179 +0,0 @@
package com.openhis.web.lab.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.core.common.core.controller.BaseController;
import com.core.common.core.domain.AjaxResult;
import com.openhis.lab.domain.InspectionType;
import com.openhis.lab.service.IInspectionTypeService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.transaction.support.TransactionTemplate;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 检验类型管理Controller
*
* @author system
* @date 2025-12-09
*/
@RestController
@RequestMapping("/system/inspection-type")
@Slf4j
@AllArgsConstructor
public class InspectionTypeController extends BaseController {
private final IInspectionTypeService inspectionTypeService;
private final TransactionTemplate transactionTemplate;
/**
* 获取检验类型列表
*/
@GetMapping("/list")
public AjaxResult list(InspectionType inspectionType) {
// 使用Wrapper构建查询条件确保order字段被正确处理
QueryWrapper<InspectionType> queryWrapper = new QueryWrapper<>(inspectionType);
// 默认只查询有效记录(前端也有过滤逻辑,这里是为了减少数据传输量)
if (inspectionType.getValidFlag() == null) {
queryWrapper.eq("valid_flag", 1);
}
List<InspectionType> list = inspectionTypeService.list(queryWrapper);
log.debug("查询检验类型列表:条件={}, 返回记录数={}", inspectionType, list.size());
return AjaxResult.success(list);
}
/**
* 获取检验类型详细
*/
@GetMapping("/{inspectionTypeId}")
public AjaxResult getInfo(@PathVariable Long inspectionTypeId) {
return AjaxResult.success(inspectionTypeService.getById(inspectionTypeId));
}
/**
* 新增检验类型
*/
@PostMapping
public AjaxResult add(@RequestBody InspectionType inspectionType) {
// 确保新增时ID为null强制使用数据库自增序列
inspectionType.setId(null);
// 去除code字段的前后空格确保唯一性验证准确
if (inspectionType.getCode() != null) {
inspectionType.setCode(inspectionType.getCode().trim());
}
// 验证code字段是否唯一
QueryWrapper<InspectionType> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("code", inspectionType.getCode());
// 查询是否存在相同编码的记录
List<InspectionType> existingRecords = inspectionTypeService.list(queryWrapper);
log.debug("检查编码唯一性code={}, 数据库中存在记录数={}", inspectionType.getCode(), existingRecords.size());
if (!existingRecords.isEmpty()) {
return AjaxResult.error("检验类型编码已存在");
}
// 保存前再次验证
try {
// 使用事务确保一致性
return transactionTemplate.execute(status -> {
// 再次检查,防止并发问题
QueryWrapper<InspectionType> checkWrapper = new QueryWrapper<>();
checkWrapper.eq("code", inspectionType.getCode());
List<InspectionType> finalCheck = inspectionTypeService.list(checkWrapper);
if (!finalCheck.isEmpty()) {
return AjaxResult.error("检验类型编码已存在");
}
boolean result = inspectionTypeService.save(inspectionType);
log.info("新增检验类型成功code={}, name={}", inspectionType.getCode(), inspectionType.getName());
return toAjax(result);
});
} catch (Exception e) {
log.error("新增检验类型失败code={}, 错误信息:{}", inspectionType.getCode(), e.getMessage(), e);
// 捕获唯一性约束冲突异常
if (e.getMessage().contains("uk_inspection_type_code") ||
e.getMessage().contains("duplicate key value") ||
e.getMessage().contains("检验类型编码已存在")) {
return AjaxResult.error("检验类型编码已存在");
}
return AjaxResult.error("保存失败:" + e.getMessage());
}
}
/**
* 修改检验类型
*/
@PutMapping
public AjaxResult edit(@RequestBody InspectionType inspectionType) {
// 去除code字段的前后空格确保唯一性验证准确
if (inspectionType.getCode() != null) {
inspectionType.setCode(inspectionType.getCode().trim());
}
// 验证code字段是否唯一排除自身
QueryWrapper<InspectionType> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("code", inspectionType.getCode())
.ne("id", inspectionType.getId());
if (inspectionTypeService.count(queryWrapper) > 0) {
return AjaxResult.error("检验类型编码已存在");
}
try {
boolean result = inspectionTypeService.updateById(inspectionType);
if (result) {
log.info("修改检验类型成功id={}, code={}, name={}", inspectionType.getId(), inspectionType.getCode(), inspectionType.getName());
}
return toAjax(result);
} catch (Exception e) {
log.error("修改检验类型失败id={}, code={}, 错误信息:{}", inspectionType.getId(), inspectionType.getCode(), e.getMessage(), e);
// 捕获唯一性约束冲突异常
if (e.getMessage().contains("uk_inspection_type_code") ||
e.getMessage().contains("duplicate key value") ||
e.getMessage().contains("检验类型编码已存在")) {
return AjaxResult.error("检验类型编码已存在");
}
return AjaxResult.error("更新失败:" + e.getMessage());
}
}
/**
* 删除检验类型
*/
@DeleteMapping("/{inspectionTypeId}")
public AjaxResult remove(@PathVariable Long inspectionTypeId) {
log.info("删除检验类型ID: {}", inspectionTypeId);
try {
// 检查记录是否存在
InspectionType existing = inspectionTypeService.getById(inspectionTypeId);
log.info("删除前检查记录是否存在: {}", existing != null);
if (existing == null) {
log.warn("删除失败检验类型ID: {} 不存在", inspectionTypeId);
return AjaxResult.error("删除失败: 记录不存在");
}
// 使用MyBatis Plus的removeById方法执行逻辑删除
boolean result = inspectionTypeService.removeById(inspectionTypeId);
log.info("逻辑删除检验类型结果: {}", result);
AjaxResult response = toAjax(result);
log.info("删除响应: {}", response);
return response;
} catch (Exception e) {
log.error("删除检验类型失败ID: {}, 错误: {}", inspectionTypeId, e.getMessage(), e);
return AjaxResult.error("删除失败: " + e.getMessage());
}
}
}

View File

@@ -53,13 +53,4 @@ public interface IPatientInformationService {
*/ */
R<?> addPatient(PatientInformationDto patientInformationDto); R<?> addPatient(PatientInformationDto patientInformationDto);
/**
* 检查患者是否存在
*
* @param name 患者姓名
* @param idCardNo 身份证号
* @return 是否存在
*/
boolean checkPatientExists(String name, String idCardNo);
} }

View File

@@ -128,11 +128,10 @@ public class PatientInformationServiceImpl implements IPatientInformationService
public IPage<PatientInformationDto> getPatientInfo(PatientInfoSearchParam patientInfoSearchParam, String searchKey, public IPage<PatientInformationDto> getPatientInfo(PatientInfoSearchParam patientInfoSearchParam, String searchKey,
Integer pageNo, Integer pageSize, HttpServletRequest request) { Integer pageNo, Integer pageSize, HttpServletRequest request) {
// 构建查询条件 - 添加phone字段到搜索条件中 // 构建查询条件
QueryWrapper<PatientInformationDto> queryWrapper = HisQueryUtils.buildQueryWrapper( QueryWrapper<PatientInformationDto> queryWrapper = HisQueryUtils.buildQueryWrapper(
patientInfoSearchParam, searchKey, new HashSet<>(Arrays.asList(CommonConstants.FieldName.Name, patientInfoSearchParam, searchKey, new HashSet<>(Arrays.asList(CommonConstants.FieldName.Name,
CommonConstants.FieldName.BusNo, CommonConstants.FieldName.PyStr, CommonConstants.FieldName.WbStr, CommonConstants.FieldName.BusNo, CommonConstants.FieldName.PyStr, CommonConstants.FieldName.WbStr)),
CommonConstants.FieldName.Phone)), // 添加phone字段支持手机号搜索
request); request);
IPage<PatientInformationDto> patientInformationPage = IPage<PatientInformationDto> patientInformationPage =
@@ -258,14 +257,4 @@ public class PatientInformationServiceImpl implements IPatientInformationService
: R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00003, new Object[] {"病人信息"})); : R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00003, new Object[] {"病人信息"}));
} }
@Override
public boolean checkPatientExists(String name, String idCardNo) {
QueryWrapper<Patient> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("name", name)
.eq("id_card", idCardNo)
.eq("delete_flag", "0");
return patientService.count(queryWrapper) > 0;
}
} }

View File

@@ -78,16 +78,4 @@ public class PatientInformationController {
.ok(patientInformationService.getPatientInfo(patientInfoSearchParam, searchKey, pageNo, pageSize, request)); .ok(patientInformationService.getPatientInfo(patientInfoSearchParam, searchKey, pageNo, pageSize, request));
} }
/**
* 检查患者是否存在
*
* @param name 患者姓名
* @param idCardNo 身份证号
* @return 是否存在
*/
@GetMapping("/check-exists")
public R<?> checkPatientExists(@RequestParam String name, @RequestParam String idCardNo) {
return R.ok(patientInformationService.checkPatientExists(name, idCardNo));
}
} }

View File

@@ -68,7 +68,7 @@ public class PatientInformationDto {
/** /**
* 死亡时间 * 死亡时间
*/ */
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy/MM/dd HH:mm:ss", timezone = "GMT+8") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
private Date deceasedDate; private Date deceasedDate;
/** /**

View File

@@ -299,7 +299,6 @@ public class IChargeBillServiceImpl implements IChargeBillService {
ChargeItemDefinition chargeItemDefinition = iChargeItemDefinitionService.getById(definitionId); ChargeItemDefinition chargeItemDefinition = iChargeItemDefinitionService.getById(definitionId);
YbMedChrgItmType medChrgItmType = YbMedChrgItmType medChrgItmType =
YbMedChrgItmType.getByCode(Integer.parseInt(chargeItemDefinition.getYbType())); YbMedChrgItmType.getByCode(Integer.parseInt(chargeItemDefinition.getYbType()));

View File

@@ -642,7 +642,7 @@ public class PaymentRecServiceImpl implements IPaymentRecService {
// 全退 // 全退
String ybSettleIds = paymentReconciliation.getYbSettleIds(); String ybSettleIds = paymentReconciliation.getYbSettleIds();
PaymentReconciliation unPaymentReconciliation = normalUnCharge(paymentReconciliation, PaymentRecDetails, null, null); PaymentReconciliation unPaymentReconciliation = normalUnCharge(paymentReconciliation, PaymentRecDetails, null);
if (!StringUtils.isEmpty(ybSettleIds)) { if (!StringUtils.isEmpty(ybSettleIds)) {
// 医保结算信息 // 医保结算信息
List<String> ybSettleIdList = Arrays.asList(ybSettleIds.split(",")); List<String> ybSettleIdList = Arrays.asList(ybSettleIds.split(","));
@@ -779,7 +779,7 @@ public class PaymentRecServiceImpl implements IPaymentRecService {
} }
PaymentReconciliation unPaymentReconciliation = PaymentReconciliation unPaymentReconciliation =
normalUnCharge(paymentReconciliation, paymentRecDetails, cancelPaymentDto.getSetlId(), cancelPaymentDto.getReason()); normalUnCharge(paymentReconciliation, paymentRecDetails, cancelPaymentDto.getSetlId());
return R.ok(unPaymentReconciliation); return R.ok(unPaymentReconciliation);
} }
@@ -844,12 +844,10 @@ public class PaymentRecServiceImpl implements IPaymentRecService {
* *
* @param paymentReconciliation 付款实体 * @param paymentReconciliation 付款实体
* @param paymentRecDetails 付款详情 * @param paymentRecDetails 付款详情
* @param setlIds 医保结算ID
* @param reason 退号/退费原因
* @return 结果 * @return 结果
*/ */
private PaymentReconciliation normalUnCharge(PaymentReconciliation paymentReconciliation, private PaymentReconciliation normalUnCharge(PaymentReconciliation paymentReconciliation,
List<PaymentRecDetail> paymentRecDetails, String setlIds, String reason) { List<PaymentRecDetail> paymentRecDetails, String setlIds) {
// 获取原ID // 获取原ID
Long id = paymentReconciliation.getId(); Long id = paymentReconciliation.getId();
@@ -859,8 +857,7 @@ public class PaymentRecServiceImpl implements IPaymentRecService {
.setEntererId(SecurityUtils.getLoginUser().getPractitionerId()).setBillDate(new Date()) .setEntererId(SecurityUtils.getLoginUser().getPractitionerId()).setBillDate(new Date())
.setTenderedAmount(paymentReconciliation.getTenderedAmount().negate()) .setTenderedAmount(paymentReconciliation.getTenderedAmount().negate())
.setReturnedAmount(paymentReconciliation.getReturnedAmount().negate()) .setReturnedAmount(paymentReconciliation.getReturnedAmount().negate())
.setDisplayAmount(paymentReconciliation.getDisplayAmount().negate()) .setDisplayAmount(paymentReconciliation.getDisplayAmount().negate());
.setRefundReason(reason); // 保存退号/退费原因
if (setlIds != null) { if (setlIds != null) {
paymentReconciliation.setYbSettleIds(setlIds); paymentReconciliation.setYbSettleIds(setlIds);
} }
@@ -2374,7 +2371,7 @@ public class PaymentRecServiceImpl implements IPaymentRecService {
} }
// 全退 // 全退
PaymentReconciliation unPaymentReconciliation = normalUnCharge(paymentReconciliation, paymentRecDetails, null, null); PaymentReconciliation unPaymentReconciliation = normalUnCharge(paymentReconciliation, paymentRecDetails, null);
// 取医保结算数据 // 取医保结算数据
String ybSettleIds = paymentReconciliation.getYbSettleIds(); String ybSettleIds = paymentReconciliation.getYbSettleIds();

View File

@@ -175,7 +175,7 @@ public class PaymentReconciliationController {
/** /**
* 挂号收费(挂号收费先医保挂号,收费成功后再本系统挂号) * 挂号收费(挂号收费先医保挂号,收费成功后再本系统挂号)
* *
* @param outpatientRegistrationSettleParam 挂号信息 * @param outpatientRegistrationAddParam 挂号信息
* @return 操做结果 * @return 操做结果
*/ */
@PostMapping("/reg-pay") @PostMapping("/reg-pay")

View File

@@ -68,11 +68,6 @@ public class InventoryProductReportAppServiceImpl implements IInventoryProductRe
public R<?> getPage(InventoryProductReportSearchParam inventoryProductReportSearchParam, Integer pageNo, public R<?> getPage(InventoryProductReportSearchParam inventoryProductReportSearchParam, Integer pageNo,
Integer pageSize, String searchKey, HttpServletRequest request) { Integer pageSize, String searchKey, HttpServletRequest request) {
// 数据初始化不使用eq条件拼接
// 库存范围
Integer inventoryScope = inventoryProductReportSearchParam.getInventoryScope();
inventoryProductReportSearchParam.setInventoryScope(null);
// 设置模糊查询的字段名 // 设置模糊查询的字段名
HashSet<String> searchFields = new HashSet<>(); HashSet<String> searchFields = new HashSet<>();
searchFields.add(CommonConstants.FieldName.BusNo); searchFields.add(CommonConstants.FieldName.BusNo);
@@ -83,8 +78,7 @@ public class InventoryProductReportAppServiceImpl implements IInventoryProductRe
// 查询库存商品明细分页列表 // 查询库存商品明细分页列表
Page<InventoryProductReportPageDto> productReportPage = inventoryProductReportMapper.selectProductReportPage( Page<InventoryProductReportPageDto> productReportPage = inventoryProductReportMapper.selectProductReportPage(
new Page<>(pageNo, pageSize), queryWrapper, ConditionCode.LOT_NUMBER_COST.getValue().toString(), new Page<>(pageNo, pageSize), queryWrapper, ConditionCode.LOT_NUMBER_COST.getValue().toString());
inventoryScope);
productReportPage.getRecords().forEach(e -> { productReportPage.getRecords().forEach(e -> {
// 药品类型 // 药品类型
@@ -110,11 +104,6 @@ public class InventoryProductReportAppServiceImpl implements IInventoryProductRe
Integer pageSize, String searchKey, HttpServletRequest request, HttpServletResponse response) { Integer pageSize, String searchKey, HttpServletRequest request, HttpServletResponse response) {
pageNo = 1; pageNo = 1;
pageSize = 10000; pageSize = 10000;
// 数据初始化不使用eq条件拼接
// 库存范围
Integer inventoryScope = inventoryProductReportSearchParam.getInventoryScope();
inventoryProductReportSearchParam.setInventoryScope(null);
// 设置模糊查询的字段名 // 设置模糊查询的字段名
HashSet<String> searchFields = new HashSet<>(); HashSet<String> searchFields = new HashSet<>();
searchFields.add(CommonConstants.FieldName.BusNo); searchFields.add(CommonConstants.FieldName.BusNo);
@@ -125,8 +114,7 @@ public class InventoryProductReportAppServiceImpl implements IInventoryProductRe
// 查询库存商品明细分页列表 // 查询库存商品明细分页列表
Page<InventoryProductReportPageDto> productReportPage = inventoryProductReportMapper.selectProductReportPage( Page<InventoryProductReportPageDto> productReportPage = inventoryProductReportMapper.selectProductReportPage(
new Page<>(pageNo, pageSize), queryWrapper, ConditionCode.LOT_NUMBER_COST.getValue().toString(), new Page<>(pageNo, pageSize), queryWrapper, ConditionCode.LOT_NUMBER_COST.getValue().toString());
inventoryScope);
productReportPage.getRecords().forEach(e -> { productReportPage.getRecords().forEach(e -> {
// 药品类型 // 药品类型

View File

@@ -38,10 +38,4 @@ public class InventoryProductReportSearchParam {
/** 供应商 */ /** 供应商 */
private Long supplierId; private Long supplierId;
/** 厂家/产地(供应商名称) */
private String manufacturerText;
/** 仓库ID药房ID */
private Long purposeLocationId;
} }

View File

@@ -27,11 +27,9 @@ public interface InventoryProductReportMapper {
* @param page 分页 * @param page 分页
* @param queryWrapper 查询条件 * @param queryWrapper 查询条件
* @param lotNumber 命中条件枚举类型:产品批号 * @param lotNumber 命中条件枚举类型:产品批号
* @param inventoryScope 库存范围无限制1、数量等于02、数量大于03、数量小于等于204、数量小于等于505
* @return 库存商品明细 * @return 库存商品明细
*/ */
Page<InventoryProductReportPageDto> selectProductReportPage(@Param("page") Page<InventoryProductReportPageDto> page, Page<InventoryProductReportPageDto> selectProductReportPage(@Param("page") Page<InventoryProductReportPageDto> page,
@Param(Constants.WRAPPER) QueryWrapper<InventoryProductReportSearchParam> queryWrapper, @Param(Constants.WRAPPER) QueryWrapper<InventoryProductReportSearchParam> queryWrapper,
@Param("lotNumber") String lotNumber, @Param("lotNumber") String lotNumber);
@Param("inventoryScope") Integer inventoryScope);
} }

View File

@@ -5,32 +5,43 @@ package com.openhis.web.ybmanage.vo;
import java.math.BigDecimal; import java.math.BigDecimal;
import javax.validation.constraints.NotNull;
import lombok.Data; import lombok.Data;
/** /**
* Settlement3202 Result DB mapping entity * 【3201】后台计算结果 DB映射实体
* *
* @author SunJQ * @author SunJQ
* @date 2025-04-15 * @date 2025-04-15
*/ */
@Data @Data
public class Settlement3202VO { public class Settlement3202VO {
/** Medical Fee Sum */ /** 医疗费用总额 */
private BigDecimal medFeeSumAmt; private BigDecimal medFeeSumAmt;
/** Fund Pay Sum */ /** 基金支付总额 */
private BigDecimal fundPaySumAmt; private BigDecimal fundPaySumAmt;
/** Account Pay */ /** 个人账户支付总额 */
private BigDecimal acctPay; private BigDecimal acctPay;
/** Account Gj Pay */ /** 个人账户支付总额 */
private BigDecimal acctGjPay; private BigDecimal acctGjPay;
/** Self Pay Cash */ /** 现金支付总额 */
private BigDecimal selfPayCash; private BigDecimal selfPayCash;
/** Self Pay WeChat */ /** 微信支付总额 */
private BigDecimal selfPayVx; private BigDecimal selfPayVx;
/** Self Pay Alipay */ /** 阿里支付总额 */
private BigDecimal selfPayAli; private BigDecimal selfPayAli;
/** Self Pay Bank Card */ /** 银行卡支付总额 */
private BigDecimal selfPayUnion; private BigDecimal selfPayUnion;
/** Settlement Count */ /** 定点医药机构结算笔数 */
private Integer fixMedInsSetlCnt; private Integer fixMedInsSetlCnt;
} }

View File

@@ -1,95 +0,0 @@
# 数据源配置
spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driverClassName: org.postgresql.Driver
druid:
# 主库数据源
master:
url: jdbc:postgresql://192.168.110.252:15432/postgresql?currentSchema=hisdev&characterEncoding=UTF-8&client_encoding=UTF-8
username: postgresql
password: Jchl1528
# 从库数据源
slave:
# 从数据源开关/默认关闭
enabled:
url:
username:
password:
# 初始连接数
initialSize: 5
# 最小连接池数量
minIdle: 10
# 最大连接池数量
maxActive: 20
# 配置获取连接等待超时的时间
maxWait: 60000
# 配置连接超时时间
connectTimeout: 30000
# 配置网络超时时间
socketTimeout: 60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis: 60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
minEvictableIdleTimeMillis: 300000
# 配置一个连接在池中最大生存的时间,单位是毫秒
maxEvictableIdleTimeMillis: 900000
# 配置检测连接是否有效
validationQuery: SELECT 1 # FROM DUAL
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
webStatFilter:
enabled: true
statViewServlet:
enabled: true
# 设置白名单,不填则允许所有访问
allow:
url-pattern: /druid/*
# 控制台管理用户名和密码
login-username: openhis
login-password: 123456
filter:
stat:
enabled: true
# 慢SQL记录
log-slow-sql: true
slow-sql-millis: 1000
merge-sql: true
wall:
config:
multi-statement-allow: true
# redis 配置
redis:
# 地址
host: 192.168.110.252
# 端口默认为6379
port: 6379
# 数据库索引
database: 1
# 密码
password: Jchl1528
# 连接超时时间
timeout: 10s
lettuce:
pool:
# 连接池中的最小空闲连接
min-idle: 0
# 连接池中的最大空闲连接
max-idle: 8
# 连接池的最大数据库连接数
max-active: 8
# #连接池最大阻塞等待时间(使用负值表示没有限制)
max-wait: -1ms
# 文言
messages:
basename: i18n/general_message/messages
encoding: utf-8
server:
# 服务器的HTTP端口默认为18080
port: 18080
servlet:
# 应用的访问路径
context-path: /openhis

Some files were not shown because too many files have changed in this diff Show More