From 78d57f97c00d39ac7d62702ca8fec61669625234 Mon Sep 17 00:00:00 2001 From: guorui Date: Wed, 5 Mar 2025 11:24:10 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=9A=82=E6=97=B6=E6=B3=A8=E6=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../framework/aspectj/TransactionAspect.java | 108 +++++++++--------- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/aspectj/TransactionAspect.java b/openhis-server/core-framework/src/main/java/com/core/framework/aspectj/TransactionAspect.java index a3b17784..f2756927 100644 --- a/openhis-server/core-framework/src/main/java/com/core/framework/aspectj/TransactionAspect.java +++ b/openhis-server/core-framework/src/main/java/com/core/framework/aspectj/TransactionAspect.java @@ -1,54 +1,54 @@ -package com.core.framework.aspectj; - -import org.aspectj.lang.annotation.Aspect; -import org.aspectj.lang.annotation.Before; -import org.aspectj.lang.annotation.AfterReturning; -import org.aspectj.lang.annotation.AfterThrowing; -import org.springframework.stereotype.Component; -import org.springframework.transaction.PlatformTransactionManager; -import org.springframework.transaction.TransactionStatus; -import org.springframework.transaction.support.DefaultTransactionDefinition; - -/** - * 事务处理 - */ -@Aspect -@Component -public class TransactionAspect { - - private final PlatformTransactionManager transactionManager; - private TransactionStatus transactionStatus; - - public TransactionAspect(PlatformTransactionManager transactionManager) { - this.transactionManager = transactionManager; - } - - @Before("@annotation(org.springframework.web.bind.annotation.PostMapping) || " + - "@annotation(org.springframework.web.bind.annotation.GetMapping) || " + - "@annotation(org.springframework.web.bind.annotation.PutMapping) || " + - "@annotation(org.springframework.web.bind.annotation.DeleteMapping)") - public void beginTransaction() { - transactionStatus = transactionManager.getTransaction(new DefaultTransactionDefinition()); - } - - @AfterReturning("@annotation(org.springframework.web.bind.annotation.PostMapping) || " + - "@annotation(org.springframework.web.bind.annotation.GetMapping) || " + - "@annotation(org.springframework.web.bind.annotation.PutMapping) || " + - "@annotation(org.springframework.web.bind.annotation.DeleteMapping)") - public void commitTransaction() { - if (transactionStatus != null && !transactionStatus.isCompleted()) { - transactionManager.commit(transactionStatus); - } - } - - @AfterThrowing(pointcut = "@annotation(org.springframework.web.bind.annotation.PostMapping) || " + - "@annotation(org.springframework.web.bind.annotation.GetMapping) || " + - "@annotation(org.springframework.web.bind.annotation.PutMapping) || " + - "@annotation(org.springframework.web.bind.annotation.DeleteMapping)", - throwing = "ex") - public void rollbackTransaction(Exception ex) { - if (transactionStatus != null && !transactionStatus.isCompleted()) { - transactionManager.rollback(transactionStatus); - } - } -} +// package com.core.framework.aspectj; +// +// import org.aspectj.lang.annotation.Aspect; +// import org.aspectj.lang.annotation.Before; +// import org.aspectj.lang.annotation.AfterReturning; +// import org.aspectj.lang.annotation.AfterThrowing; +// import org.springframework.stereotype.Component; +// import org.springframework.transaction.PlatformTransactionManager; +// import org.springframework.transaction.TransactionStatus; +// import org.springframework.transaction.support.DefaultTransactionDefinition; +// +/// ** +// * 事务处理 +// */ +// @Aspect +// @Component +// public class TransactionAspect { +// +// private final PlatformTransactionManager transactionManager; +// private TransactionStatus transactionStatus; +// +// public TransactionAspect(PlatformTransactionManager transactionManager) { +// this.transactionManager = transactionManager; +// } +// +// @Before("@annotation(org.springframework.web.bind.annotation.PostMapping) || " + +// "@annotation(org.springframework.web.bind.annotation.GetMapping) || " + +// "@annotation(org.springframework.web.bind.annotation.PutMapping) || " + +// "@annotation(org.springframework.web.bind.annotation.DeleteMapping)") +// public void beginTransaction() { +// transactionStatus = transactionManager.getTransaction(new DefaultTransactionDefinition()); +// } +// +// @AfterReturning("@annotation(org.springframework.web.bind.annotation.PostMapping) || " + +// "@annotation(org.springframework.web.bind.annotation.GetMapping) || " + +// "@annotation(org.springframework.web.bind.annotation.PutMapping) || " + +// "@annotation(org.springframework.web.bind.annotation.DeleteMapping)") +// public void commitTransaction() { +// if (transactionStatus != null && !transactionStatus.isCompleted()) { +// transactionManager.commit(transactionStatus); +// } +// } +// +// @AfterThrowing(pointcut = "@annotation(org.springframework.web.bind.annotation.PostMapping) || " + +// "@annotation(org.springframework.web.bind.annotation.GetMapping) || " + +// "@annotation(org.springframework.web.bind.annotation.PutMapping) || " + +// "@annotation(org.springframework.web.bind.annotation.DeleteMapping)", +// throwing = "ex") +// public void rollbackTransaction(Exception ex) { +// if (transactionStatus != null && !transactionStatus.isCompleted()) { +// transactionManager.rollback(transactionStatus); +// } +// } +// } From 6b219fb219b0da6863e324605b600cb85cbced53 Mon Sep 17 00:00:00 2001 From: "Wang.Huan" Date: Wed, 5 Mar 2025 12:20:34 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BA=8B=E5=8A=A1=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/OutpatientRegistrationAddDto.java | 14 -------------- .../service/IPatientService.java | 19 +++++++++++++++---- 2 files changed, 15 insertions(+), 18 deletions(-) delete mode 100644 openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientservice/dto/OutpatientRegistrationAddDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientservice/dto/OutpatientRegistrationAddDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientservice/dto/OutpatientRegistrationAddDto.java deleted file mode 100644 index d00d57eb..00000000 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientservice/dto/OutpatientRegistrationAddDto.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.openhis.web.outpatientservice.dto; - -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * 门诊挂号 新增数据 - */ -@Data -@Accessors(chain = true) -public class OutpatientRegistrationAddDto { - - -} diff --git a/openhis-server/openhis-domain/src/main/java/com/openhis/administration/service/IPatientService.java b/openhis-server/openhis-domain/src/main/java/com/openhis/administration/service/IPatientService.java index c56301c1..71ed94be 100644 --- a/openhis-server/openhis-domain/src/main/java/com/openhis/administration/service/IPatientService.java +++ b/openhis-server/openhis-domain/src/main/java/com/openhis/administration/service/IPatientService.java @@ -1,10 +1,11 @@ package com.openhis.administration.service; -import java.util.Date; - +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; import com.openhis.administration.domain.Patient; +import java.util.Date; + /** * 患者管理Service接口 * @@ -15,7 +16,7 @@ public interface IPatientService extends IService { /** * 从身份证号码中提取生日 - * + * * @param idCard 身份证号 * @return 出生日 */ @@ -27,5 +28,15 @@ public interface IPatientService extends IService { * @param date 字符串日期 * @return 是/否 */ - boolean isFuture(String date); + boolean isFuture(String date); + + /** + * 通过关键字查询患者信息 + * + * @param searchKey 关键字 + * @param pageNo 当前页码 + * @param pageSize 查询条数 + * @return 患者信息 + */ + Page getPatientBySearchKey(String searchKey, Integer pageNo, Integer pageSize); } \ No newline at end of file From 85333551e8475047a2ebdc99aa17c3192adf8fe0 Mon Sep 17 00:00:00 2001 From: "Wang.Huan" Date: Wed, 5 Mar 2025 12:23:42 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BA=8B=E5=8A=A1=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../framework/aspectj/TransactionAspect.java | 113 +++++++++--------- 1 file changed, 59 insertions(+), 54 deletions(-) diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/aspectj/TransactionAspect.java b/openhis-server/core-framework/src/main/java/com/core/framework/aspectj/TransactionAspect.java index f2756927..1a7e711d 100644 --- a/openhis-server/core-framework/src/main/java/com/core/framework/aspectj/TransactionAspect.java +++ b/openhis-server/core-framework/src/main/java/com/core/framework/aspectj/TransactionAspect.java @@ -1,54 +1,59 @@ -// package com.core.framework.aspectj; -// -// import org.aspectj.lang.annotation.Aspect; -// import org.aspectj.lang.annotation.Before; -// import org.aspectj.lang.annotation.AfterReturning; -// import org.aspectj.lang.annotation.AfterThrowing; -// import org.springframework.stereotype.Component; -// import org.springframework.transaction.PlatformTransactionManager; -// import org.springframework.transaction.TransactionStatus; -// import org.springframework.transaction.support.DefaultTransactionDefinition; -// -/// ** -// * 事务处理 -// */ -// @Aspect -// @Component -// public class TransactionAspect { -// -// private final PlatformTransactionManager transactionManager; -// private TransactionStatus transactionStatus; -// -// public TransactionAspect(PlatformTransactionManager transactionManager) { -// this.transactionManager = transactionManager; -// } -// -// @Before("@annotation(org.springframework.web.bind.annotation.PostMapping) || " + -// "@annotation(org.springframework.web.bind.annotation.GetMapping) || " + -// "@annotation(org.springframework.web.bind.annotation.PutMapping) || " + -// "@annotation(org.springframework.web.bind.annotation.DeleteMapping)") -// public void beginTransaction() { -// transactionStatus = transactionManager.getTransaction(new DefaultTransactionDefinition()); -// } -// -// @AfterReturning("@annotation(org.springframework.web.bind.annotation.PostMapping) || " + -// "@annotation(org.springframework.web.bind.annotation.GetMapping) || " + -// "@annotation(org.springframework.web.bind.annotation.PutMapping) || " + -// "@annotation(org.springframework.web.bind.annotation.DeleteMapping)") -// public void commitTransaction() { -// if (transactionStatus != null && !transactionStatus.isCompleted()) { -// transactionManager.commit(transactionStatus); -// } -// } -// -// @AfterThrowing(pointcut = "@annotation(org.springframework.web.bind.annotation.PostMapping) || " + -// "@annotation(org.springframework.web.bind.annotation.GetMapping) || " + -// "@annotation(org.springframework.web.bind.annotation.PutMapping) || " + -// "@annotation(org.springframework.web.bind.annotation.DeleteMapping)", -// throwing = "ex") -// public void rollbackTransaction(Exception ex) { -// if (transactionStatus != null && !transactionStatus.isCompleted()) { -// transactionManager.rollback(transactionStatus); -// } -// } -// } +package com.core.framework.aspectj; + +import org.aspectj.lang.annotation.AfterReturning; +import org.aspectj.lang.annotation.AfterThrowing; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Before; +import org.springframework.stereotype.Component; +import org.springframework.transaction.PlatformTransactionManager; +import org.springframework.transaction.TransactionStatus; +import org.springframework.transaction.support.DefaultTransactionDefinition; + +/** + * 事务处理 + */ +@Aspect +@Component +public class TransactionAspect { + + private final PlatformTransactionManager transactionManager; + private final ThreadLocal transactionStatus = new ThreadLocal<>(); + + public TransactionAspect(PlatformTransactionManager transactionManager) { + this.transactionManager = transactionManager; + } + + @Before("@annotation(org.springframework.web.bind.annotation.PostMapping) || " + + "@annotation(org.springframework.web.bind.annotation.GetMapping) || " + + "@annotation(org.springframework.web.bind.annotation.PutMapping) || " + + "@annotation(org.springframework.web.bind.annotation.DeleteMapping)") + public void beginTransaction() { + TransactionStatus status = transactionManager.getTransaction(new DefaultTransactionDefinition()); + transactionStatus.set(status); + } + + @AfterReturning("@annotation(org.springframework.web.bind.annotation.PostMapping) || " + + "@annotation(org.springframework.web.bind.annotation.GetMapping) || " + + "@annotation(org.springframework.web.bind.annotation.PutMapping) || " + + "@annotation(org.springframework.web.bind.annotation.DeleteMapping)") + public void commitTransaction() { + TransactionStatus status = transactionStatus.get(); + if (status != null && !status.isCompleted()) { + transactionManager.commit(status); + transactionStatus.remove(); // 清除 ThreadLocal 中的状态 + } + } + + @AfterThrowing(pointcut = "@annotation(org.springframework.web.bind.annotation.PostMapping) || " + + "@annotation(org.springframework.web.bind.annotation.GetMapping) || " + + "@annotation(org.springframework.web.bind.annotation.PutMapping) || " + + "@annotation(org.springframework.web.bind.annotation.DeleteMapping)", + throwing = "ex") + public void rollbackTransaction(Exception ex) { + TransactionStatus status = transactionStatus.get(); + if (status != null && !status.isCompleted()) { + transactionManager.rollback(status); + transactionStatus.remove(); // 清除 ThreadLocal 中的状态 + } + } +} \ No newline at end of file From af3cb649883d1bfaa9abf9d647304fbcc21553cd Mon Sep 17 00:00:00 2001 From: liuhongrui Date: Wed, 5 Mar 2025 13:07:33 +0800 Subject: [PATCH 4/4] =?UTF-8?q?ServiceRequest=E8=A1=A8=20=E6=96=B0?= =?UTF-8?q?=E5=8A=A0=E5=AD=97=E6=AE=B5=E6=A0=B8=E5=AF=B9=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/openhis/workflow/domain/ServiceRequest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/domain/ServiceRequest.java b/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/domain/ServiceRequest.java index c7029161..c1fd203e 100644 --- a/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/domain/ServiceRequest.java +++ b/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/domain/ServiceRequest.java @@ -82,6 +82,9 @@ public class ServiceRequest extends HisBaseEntity { /** 执行人 */ private Long performerId; + /** 核对人 */ + private Long performerCheckId; + /** 执行位置 */ private Long locationId;