From 9cba8fea1242372dd2f837462087f1f336afdb54 Mon Sep 17 00:00:00 2001 From: sindir Date: Mon, 19 Jan 2026 15:43:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=8C=BB=E7=94=9F=E5=B8=B8?= =?UTF-8?q?=E7=94=A8=E8=AF=AD=E7=AE=A1=E7=90=86=E5=8A=9F=E8=83=BD=20###=20?= =?UTF-8?q?=E5=90=8E=E7=AB=AF=E4=BF=AE=E6=94=B9=201.=20=E5=AE=9E=E4=BD=93?= =?UTF-8?q?=E7=B1=BBDoctorPhrase=EF=BC=9A=E5=AD=97=E6=AE=B5/=E6=B3=A8?= =?UTF-8?q?=E8=A7=A3=E8=B0=83=E6=95=B4=202.=20=E6=9E=9A=E4=B8=BE=E5=AE=8C?= =?UTF-8?q?=E5=96=84=EF=BC=9A=E6=96=B0=E5=A2=9EDoctorPhraseAppTypeEnum/Doc?= =?UTF-8?q?torPhraseBizTypeEnum=EF=BC=8C=E7=BB=9F=E4=B8=80=E4=B8=9A?= =?UTF-8?q?=E5=8A=A1=E5=88=86=E7=B1=BB=203.=20=E6=9C=8D=E5=8A=A1=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0=E7=B1=BB=EF=BC=9A=E4=BF=AE=E6=AD=A3=E7=B1=BB=E5=90=8D?= =?UTF-8?q?=E6=8B=BC=E5=86=99=EF=BC=88DoctorPhraesAppS=20=E2=86=92=20Docto?= =?UTF-8?q?rPhraseAppServiceImpl=20###=20=E5=89=8D=E7=AB=AF=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=201.=20=E5=B8=B8=E7=94=A8=E8=AF=AD=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=EF=BC=88doctorphrase/index.vue=EF=BC=89?= =?UTF-8?q?=EF=BC=9A=20=20=20=20=E4=B8=9A=E5=8A=A1=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E7=A1=AC=E7=BC=96=E7=A0=81=E6=9B=BF=E6=8D=A2=E4=B8=BA=E6=9E=9A?= =?UTF-8?q?=E4=B8=BE=EF=BC=88=E4=B8=BB=E8=AF=89/=E7=8E=B0=E7=97=85?= =?UTF-8?q?=E5=8F=B2/=E6=9C=AF=E5=89=8D/=E6=9C=AF=E5=90=8E/=E6=97=A2?= =?UTF-8?q?=E5=BE=80=E5=8F=B2=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...l.java => DoctorPhraseAppServiceImpl.java} | 2 +- .../openhis/template/domain/DoctorPhrase.java | 7 + .../enums/DoctorPhraseBizTypeEnum.java | 40 ++ .../doctorstation/doctorphrase/index.vue | 398 ++++++++---------- 4 files changed, 228 insertions(+), 219 deletions(-) rename openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/{DoctorPhraesAppServiceImpl.java => DoctorPhraseAppServiceImpl.java} (97%) create mode 100644 openhis-server-new/openhis-domain/src/main/java/com/openhis/template/enums/DoctorPhraseBizTypeEnum.java diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorPhraesAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorPhraseAppServiceImpl.java similarity index 97% rename from openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorPhraesAppServiceImpl.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorPhraseAppServiceImpl.java index 0f7e7dd6..a3113190 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorPhraesAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorPhraseAppServiceImpl.java @@ -13,7 +13,7 @@ import javax.annotation.Resource; import java.util.List; @Service -public class DoctorPhraesAppServiceImpl implements IDoctorPhraseAppService { +public class DoctorPhraseAppServiceImpl implements IDoctorPhraseAppService { @Resource private IDoctorPhraseService doctorPhraseService; diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/template/domain/DoctorPhrase.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/template/domain/DoctorPhrase.java index df260baa..0a15e4fe 100644 --- a/openhis-server-new/openhis-domain/src/main/java/com/openhis/template/domain/DoctorPhrase.java +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/template/domain/DoctorPhrase.java @@ -1,12 +1,14 @@ package com.openhis.template.domain; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; +import javax.validation.constraints.NotBlank; import java.time.LocalDateTime; @Data @@ -28,8 +30,13 @@ public class DoctorPhrase { private Integer phraseType; /** 业务分类(主诉/现病史等) */ + @NotBlank(message = "业务分类不能为空") private String phraseCategory; + // 非数据库字段,用于前端展示名称 + @TableField(exist = false) + private String businessTypeName; + /** 模板内容 */ private String phraseContent; diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/template/enums/DoctorPhraseBizTypeEnum.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/template/enums/DoctorPhraseBizTypeEnum.java new file mode 100644 index 00000000..71808efa --- /dev/null +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/template/enums/DoctorPhraseBizTypeEnum.java @@ -0,0 +1,40 @@ +package com.openhis.template.enums; + +// 枚举类不需要任何Lombok注解(@Data/@AllArgsConstructor/@NoArgsConstructor都删掉) +public enum DoctorPhraseBizTypeEnum { + // 1. 枚举项:直接传值(不用code:xxx,直接写字符串) + MAIN_COMPLAINT("MAIN_COMPLAINT", "主诉"), + PRESENT_HISTORY("PRESENT_HISTORY", "现病史"), + PRE_OPERATION("PRE_OPERATION", "术前"), + POST_OPERATION("POST_OPERATION", "术后"), + PAST_HISTORY("PAST_HISTORY", "既往史"); + + // 2. 定义枚举的成员变量(private final 保证不可变) + private final String code; // 数据库存储的编码 + private final String name; // 前端展示的名称 + + // 3. 手动写私有构造器(枚举构造器必须私有,且要给变量赋值) + DoctorPhraseBizTypeEnum(String code, String name) { + this.code = code; + this.name = name; + } + + // 4. 提供getter方法(枚举没有setter,因为枚举项是常量,不能改) + public String getCode() { + return code; + } + + public String getName() { + return name; + } + + // 【可选】添加工具方法:根据code找对应的枚举(前端传code时,后端快速匹配) + public static DoctorPhraseBizTypeEnum getByCode(String code) { + for (DoctorPhraseBizTypeEnum enumObj : values()) { + if (enumObj.getCode().equals(code)) { + return enumObj; + } + } + return null; // 或抛异常:throw new IllegalArgumentException("无效的业务分类编码:" + code); + } +} \ No newline at end of file diff --git a/openhis-ui-vue3/src/views/doctorstation/doctorphrase/index.vue b/openhis-ui-vue3/src/views/doctorstation/doctorphrase/index.vue index 41fb025d..cea611dd 100644 --- a/openhis-ui-vue3/src/views/doctorstation/doctorphrase/index.vue +++ b/openhis-ui-vue3/src/views/doctorstation/doctorphrase/index.vue @@ -7,65 +7,46 @@ - - 查询 - 重置 - 增加 + + + + 查询 + + + 重置 + + + 增加 + @@ -96,37 +69,23 @@