Ver código fonte

枚举类和dto创建和修改

G 1 semana atrás
pai
commit
c8b012160b

BIN
logs/2026-01/hdis-2026-01-16-2.log.gz


+ 50 - 0
tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/dto/ClinicDetailDTO.java

@@ -0,0 +1,50 @@
+package cn.tr.module.phototherapy.common.dto;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+import java.util.List;
+
+/**
+ * @ClassName ClinicDetailDTO
+ * @Description 临床详情和治疗记录信息
+ * @Date 2026/1/19 9:41
+ * @Version 1.0.0
+ */
+@Data
+@Schema(description = "临床详情DTO")
+public class ClinicDetailDTO {
+
+    @Schema(description = "患者姓名")
+    private String patientName;
+
+    @Schema(description = "患者年龄")
+    private Integer patientAge;
+
+    @Schema(description = "患者编号")
+    private String patientUniqueId;
+
+    @Schema(description = "患者性别(0女 1男 2未知)")
+    private Integer patientGender;
+
+    @Schema(description = "今日治疗时间(分钟)")
+    private Integer todayTherapyTime;
+
+    @Schema(description = "治疗方案名称")
+    private String planName;
+
+    @Schema(description = "当前阶段类型")
+    private String phaseType;
+
+    @Schema(description = "阶段频率")
+    private String phaseFreq;
+
+    @Schema(description = "阶段建议时长(分钟)")
+    private Integer phaseDurationMin;
+
+    @Schema(description = "上次治疗时间")
+    private LocalDateTime lastTreatmentTime;
+
+}
+

+ 81 - 0
tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/dto/PatientTherapyDetailDTO.java

@@ -0,0 +1,81 @@
+package cn.tr.module.phototherapy.common.dto;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import java.time.LocalDateTime;
+import java.util.List;
+
+/**
+ * 患者治疗详情DTO
+ * 用于封装患者治疗详情页面所需的所有数据
+ *
+ * @author Generated
+ * @date 2026-01-19
+ */
+@Data
+@Schema(description = "患者治疗详情DTO")
+public class PatientTherapyDetailDTO {
+
+    // 患者信息(来自bus_clinic表)
+    @Schema(description = "患者姓名")
+    private String patientName;
+
+    @Schema(description = "患者年龄")
+    private Integer patientAge;
+
+    @Schema(description = "患者性别(0女 1男 2未知)")
+    private Integer patientGender;
+
+    @Schema(description = "患者编号")
+    private String patientUniqueId;
+
+    @Schema(description = "联系电话")
+    private String patientPhone;
+
+    @Schema(description = "详细地址")
+    private String patientAddress;
+
+    @Schema(description = "上次治疗时间")
+    private LocalDateTime lastTreatmentTime;
+
+    @Schema(description = "所属分组")
+    private Integer groupType;
+
+    // 治疗信息(来自bus_therapy_record表统计)
+    @Schema(description = "今日治疗状态")
+    private String therapyStatus;
+
+    @Schema(description = "治疗次数")
+    private Integer therapyCount;
+
+    @Schema(description = "依从性")
+    private Integer compliance;
+
+    @Schema(description = "治疗记录列表")
+    private List<TherapyRecordDetailDTO> therapyRecordList;
+
+
+    // 光疗方案(来自therapy_plan表)
+    @Schema(description = "方案开始时间")
+    private LocalDateTime createTime;
+
+    @Schema(description = "干预期")
+    private String phaseType;
+
+    @Schema(description = "治疗方案")
+    private String therapyPlan;
+
+    @Schema(description = "创建医生")
+    private String planDoctor;
+
+
+    // 设备信息(来自设备表)
+    @Schema(description = "设备编号")
+    private String deviceId;
+
+    @Schema(description = "设备绑定时间")
+    private LocalDateTime bindStartTime;
+
+/*    @Schema(description = "设备解绑时间")
+    private LocalDateTime bindEndTime;*/
+}

+ 29 - 0
tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/dto/TherapyRecordDetailDTO.java

@@ -0,0 +1,29 @@
+package cn.tr.module.phototherapy.common.dto;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.time.LocalDate;
+
+/**
+ * @ClassName TherapyRecordDetailDTO
+ * @Description 治疗记录信息
+ * @Date 2026/1/19 9:53
+ * @Version 1.0.0
+ */
+@Data
+@Schema(description = "治疗记录详情DTO")
+public class TherapyRecordDetailDTO {
+
+    @Schema(description = "治疗日期")
+    private LocalDate therapyDate;
+
+    @Schema(description = "干预期")
+    private String phaseType;
+
+    @Schema(description = "治疗方案")
+    private String therapyPlan;
+
+    @Schema(description = "累计治疗时间(分钟)")
+    private Integer therapyDuration;
+}

+ 20 - 0
tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/dto/TherapyRecordDetailQueryDTO.java

@@ -0,0 +1,20 @@
+package cn.tr.module.phototherapy.common.dto;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotBlank;
+import lombok.Data;
+
+/**
+ * @ClassName TherapyRecordDetailQueryDTO
+ * @Description 治疗信息查询参数
+ * @Date 2026/1/20 8:53
+ * @Version 1.0.0
+ */
+@Data
+@Schema(description = "治疗记录查询参数")
+public class TherapyRecordDetailQueryDTO {
+
+    @Schema(description = "临床ID", required = true)
+    @NotBlank(message = "临床ID不能为空")
+    private String clinicId;
+}

+ 41 - 0
tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/enums/GroupTypeEnum.java

@@ -0,0 +1,41 @@
+package cn.tr.module.phototherapy.common.enums;
+
+import com.baomidou.mybatisplus.annotation.IEnum;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 分组类型枚举
+ */
+@AllArgsConstructor
+@JsonFormat(shape = JsonFormat.Shape.OBJECT)
+public enum GroupTypeEnum implements IEnum<Integer> {
+
+    TREATMENT_GROUP(0, "治疗组"),
+    CONTROL_GROUP(1, "对照组");
+
+    @Getter
+    @Schema(description = "分组类型编码")
+    private Integer value;
+
+    @Getter
+    @Schema(description = "分组类型描述")
+    private String text;
+
+    /**
+     * 根据值获取枚举
+     *
+     * @param value 值
+     * @return 枚举
+     */
+    public static GroupTypeEnum getByValue(Integer value) {
+        for (GroupTypeEnum group : values()) {
+            if (group.value.equals(value)) {
+                return group;
+            }
+        }
+        return null;
+    }
+}

+ 42 - 0
tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/enums/IsCurrentBindEnum.java

@@ -0,0 +1,42 @@
+package cn.tr.module.phototherapy.common.enums;
+
+import com.baomidou.mybatisplus.annotation.IEnum;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 绑定状态枚举
+ */
+@AllArgsConstructor
+@JsonFormat(shape = JsonFormat.Shape.OBJECT)
+public enum IsCurrentBindEnum implements IEnum<Integer> {
+
+    CURRENT_BIND(1, "当前绑定"),
+    HISTORY_BIND(0, "历史绑定");
+
+    @Getter
+    @Schema(description = "绑定状态编码")
+    private Integer value;
+
+    @Getter
+    @Schema(description = "绑定状态描述")
+    private String text;
+
+    /**
+     * 根据值获取枚举
+     *
+     * @param value 值
+     * @return 枚举
+     */
+    public static IsCurrentBindEnum getByValue(Integer value) {
+        for (IsCurrentBindEnum bind : values()) {
+            if (bind.value.equals(value)) {
+                return bind;
+            }
+        }
+        return null;
+    }
+
+}

+ 42 - 0
tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/enums/PatientGenderEnum.java

@@ -0,0 +1,42 @@
+package cn.tr.module.phototherapy.common.enums;
+
+import com.baomidou.mybatisplus.annotation.IEnum;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 患者性别枚举
+ */
+@AllArgsConstructor
+@JsonFormat(shape = JsonFormat.Shape.OBJECT)
+public enum PatientGenderEnum implements IEnum<Integer> {
+
+    FEMALE(0, "女"),
+    MALE(1, "男"),
+    UNKNOWN(2, "未知");
+
+    @Getter
+    @Schema(description = "性别编码")
+    private Integer value;
+
+    @Getter
+    @Schema(description = "性别描述")
+    private String text;
+
+    /**
+     * 根据值获取枚举
+     *
+     * @param value 值
+     * @return 枚举
+     */
+    public static PatientGenderEnum getByValue(Integer value) {
+        for (PatientGenderEnum gender : values()) {
+            if (gender.value.equals(value)) {
+                return gender;
+            }
+        }
+        return null;
+    }
+}

+ 42 - 0
tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/enums/TherapyPlanStatusEnum.java

@@ -0,0 +1,42 @@
+package cn.tr.module.phototherapy.common.enums;
+
+import com.baomidou.mybatisplus.annotation.IEnum;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 治疗方案状态枚举
+ */
+@AllArgsConstructor
+@JsonFormat(shape = JsonFormat.Shape.OBJECT)
+public enum TherapyPlanStatusEnum implements IEnum<Integer> {
+
+    ENABLED(0, "启用"),
+    WAITING(1, "等待启用"),
+    TERMINATED(2, "终止");
+
+    @Getter
+    @Schema(description = "方案状态编码")
+    private Integer value;
+
+    @Getter
+    @Schema(description = "方案状态描述")
+    private String text;
+
+    /**
+     * 根据值获取枚举
+     *
+     * @param value 值
+     * @return 枚举
+     */
+    public static TherapyPlanStatusEnum getByValue(Integer value) {
+        for (TherapyPlanStatusEnum status : values()) {
+            if (status.value.equals(value)) {
+                return status;
+            }
+        }
+        return null;
+    }
+}

+ 42 - 0
tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/enums/TherapyStatusEnum.java

@@ -0,0 +1,42 @@
+package cn.tr.module.phototherapy.common.enums;
+
+import com.baomidou.mybatisplus.annotation.IEnum;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 治疗状态枚举
+ */
+@AllArgsConstructor
+@JsonFormat(shape = JsonFormat.Shape.OBJECT)
+public enum TherapyStatusEnum implements IEnum<Integer> {
+
+    IN_PROGRESS(0, "进行中"),
+    THERAPY_END(1, "治疗结束"),
+    NOT_STARTED(2, "未进行");
+
+    @Getter
+    @Schema(description = "治疗状态编码")
+    private Integer value;
+
+    @Getter
+    @Schema(description = "治疗状态描述")
+    private String text;
+
+    /**
+     * 根据值获取枚举
+     *
+     * @param value 值
+     * @return 枚举
+     */
+    public static TherapyStatusEnum getByValue(Integer value) {
+        for (TherapyStatusEnum status : values()) {
+            if (status.value.equals(value)) {
+                return status;
+            }
+        }
+        return null;
+    }
+}