Преглед на файлове

移除LocalDateTime修改为Date

zhouzeyu преди 1 седмица
родител
ревизия
606ba282d0
променени са 15 файла, в които са добавени 97 реда и са изтрити 90 реда
  1. 3 3
      tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/dto/BusClinicDTO.java
  2. 1 1
      tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/dto/BusDeviceAlarmQueryDTO.java
  3. 2 1
      tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/dto/ClinicDetailDTO.java
  4. 5 4
      tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/dto/PatientTherapyDetailDTO.java
  5. 2 1
      tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/dto/TherapyRecordDetailDTO.java
  6. 4 0
      tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/mapper/BusTherapyRecordMapper.java
  7. 0 50
      tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/mapper/TherapyRecordConvertMapper.java
  8. 4 3
      tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/po/BusClinicPO.java
  9. 4 3
      tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/po/BusDeviceHistoryPO.java
  10. 0 9
      tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/service/impl/BusClinicServiceImpl.java
  11. 1 10
      tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/service/impl/BusTherapyRecordServiceImpl.java
  12. 4 3
      tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/vo/PatientTherapyDetailVO.java
  13. 64 0
      tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/vo/PatientTherapyRecordVO.java
  14. 2 1
      tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/vo/TherapyRecordDetailVO.java
  15. 1 1
      tr-test/src/main/resources/application.yml

+ 3 - 3
tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/dto/BusClinicDTO.java

@@ -40,7 +40,7 @@ public class BusClinicDTO extends BaseDTO  {
 
     @Schema(description = "患者上次治疗时间")
     @NotNull(message = "患者上次治疗时间不能为空", groups = {Update.class, Insert.class})
-    private LocalDateTime lastTreatmentTime;
+    private Date lastTreatmentTime;
 
     @Schema(description = "关联治疗方案表(当前阶段)")
     @NotBlank(message = "关联治疗方案表(当前阶段)不能为空", groups = {Update.class, Insert.class})
@@ -75,10 +75,10 @@ public class BusClinicDTO extends BaseDTO  {
 
     @Schema(description = "设备与患者的绑定开始时间")
     @NotBlank(message = "设备与患者的绑定开始时间不能为空", groups = {Update.class, Insert.class})
-    private LocalDateTime bindStartTime;
+    private Date bindStartTime;
 
     @Schema(description = "设备与患者的绑定结束时间")
-    private LocalDateTime bindEndTime;
+    private Date bindEndTime;
 
     @Schema(description = "是否当前绑定(1=当前绑定,0=历史绑定)")
     @NotNull(message = "是否当前绑定不能为空", groups = {Update.class, Insert.class})

+ 1 - 1
tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/dto/BusDeviceAlarmQueryDTO.java

@@ -47,6 +47,6 @@ public class BusDeviceAlarmQueryDTO  implements Serializable{
     private String tenantId;
 
     @Schema(description = "报警时间")
-    private LocalDateTime alarmTime;
+    private Date alarmTime;
 
 }

+ 2 - 1
tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/dto/ClinicDetailDTO.java

@@ -4,6 +4,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 
 import java.time.LocalDateTime;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -44,7 +45,7 @@ public class ClinicDetailDTO {
     private Integer phaseDurationMin;
 
     @Schema(description = "上次治疗时间")
-    private LocalDateTime lastTreatmentTime;
+    private Date lastTreatmentTime;
 
 }
 

+ 5 - 4
tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/dto/PatientTherapyDetailDTO.java

@@ -3,6 +3,7 @@ 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.Date;
 import java.util.List;
 
 /**
@@ -36,7 +37,7 @@ public class PatientTherapyDetailDTO {
     private String patientAddress;
 
     @Schema(description = "上次治疗时间")
-    private LocalDateTime lastTreatmentTime;
+    private Date lastTreatmentTime;
 
     @Schema(description = "所属分组")
     private Integer groupType;
@@ -57,7 +58,7 @@ public class PatientTherapyDetailDTO {
 
     // 光疗方案(来自therapy_plan表)
     @Schema(description = "方案开始时间")
-    private LocalDateTime startTime;
+    private Date startTime;
 
     @Schema(description = "干预期")
     private String phaseType;
@@ -74,8 +75,8 @@ public class PatientTherapyDetailDTO {
     private String deviceId;
 
     @Schema(description = "设备绑定时间")
-    private LocalDateTime bindStartTime;
+    private Date bindStartTime;
 
 /*    @Schema(description = "设备解绑时间")
-    private LocalDateTime bindEndTime;*/
+    private Date bindEndTime;*/
 }

+ 2 - 1
tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/dto/TherapyRecordDetailDTO.java

@@ -6,6 +6,7 @@ import lombok.Data;
 
 import java.time.LocalDate;
 import java.time.LocalDateTime;
+import java.util.Date;
 
 /**
  * @ClassName TherapyRecordDetailDTO
@@ -19,7 +20,7 @@ public class TherapyRecordDetailDTO {
 
     @Schema(description = "治疗日期")
     @JsonFormat(pattern = "yyyy-MM-dd")
-    private LocalDate therapyDate;
+    private Date therapyDate;
 
     @Schema(description = "干预期")
     private String phaseType;

+ 4 - 0
tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/mapper/BusTherapyRecordMapper.java

@@ -1,7 +1,9 @@
 package cn.tr.module.phototherapy.common.mapper;
 
+import cn.tr.module.phototherapy.common.dto.TherapyRecordDetailDTO;
 import cn.tr.module.phototherapy.common.po.BusTherapyRecordPO;
 import cn.tr.module.phototherapy.common.dto.BusTherapyRecordDTO;
+import cn.tr.module.phototherapy.common.vo.TherapyRecordDetailVO;
 import org.mapstruct.Mapper;
 import org.mapstruct.factory.Mappers;
 
@@ -24,4 +26,6 @@ public interface BusTherapyRecordMapper {
     List<BusTherapyRecordDTO> convertDtoList(List<BusTherapyRecordPO> source);
 
     List<BusTherapyRecordPO> convertPOList(List<BusTherapyRecordDTO> source);
+
+    List<TherapyRecordDetailDTO> toTherapyRecordDetailDTOList(List<TherapyRecordDetailVO> results);
 }

+ 0 - 50
tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/mapper/TherapyRecordConvertMapper.java

@@ -1,50 +0,0 @@
-package cn.tr.module.phototherapy.common.mapper;
-
-import cn.tr.module.phototherapy.common.dto.TherapyRecordDetailDTO;
-
-import cn.tr.module.phototherapy.common.vo.TherapyRecordDetailVO;
-import org.mapstruct.Mapper;
-import org.mapstruct.Mapping;
-import org.mapstruct.Named;
-
-
-import java.time.LocalDate;
-import java.time.LocalDateTime;
-import java.util.List;
-
-/**
- * @ClassName TherapyRecordConvertMapper
- * @Description 患者治疗记录转换映射器
- * @Date 2026/1/21 9:20
- * @Version 1.0.0
- */
-@Mapper(componentModel = "spring")
-public interface TherapyRecordConvertMapper {
-
-    @Mapping(target = "therapyDate", source = "therapyStartTime", qualifiedByName = "localDateTimeToDate")
-    @Mapping(target = "phaseType", source = "phaseType")
-    @Mapping(target = "therapyDuration", source = "therapyDuration")
-    @Mapping(target = "therapyPlan", expression = "java(buildTherapyPlan(source.getPhaseFreq(), source.getPhaseDurationMin()))")
-    TherapyRecordDetailDTO toTherapyRecordDetailDTO(TherapyRecordDetailVO source);
-
-    List<TherapyRecordDetailDTO> toTherapyRecordDetailDTOList(List<TherapyRecordDetailVO> source);
-
-    @Named("localDateTimeToDate")
-    default LocalDate localDateTimeToDate(LocalDateTime dateTime) {
-        return dateTime != null ? dateTime.toLocalDate() : null;
-    }
-
-    default String buildTherapyPlan(String phaseFreq, Integer phaseDurationMin) {
-        StringBuilder therapyPlan = new StringBuilder();
-        if (phaseFreq != null && !phaseFreq.trim().isEmpty()) {
-            therapyPlan.append(phaseFreq);
-        }
-        if (phaseDurationMin != null) {
-            if (therapyPlan.length() > 0) {
-                therapyPlan.append("; ");
-            }
-            therapyPlan.append("每次").append(phaseDurationMin).append("min");
-        }
-        return therapyPlan.length() > 0 ? therapyPlan.toString() : "";
-    }
-}

+ 4 - 3
tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/po/BusClinicPO.java

@@ -11,6 +11,7 @@ import lombok.EqualsAndHashCode;
 import lombok.ToString;
 
 import java.time.LocalDateTime;
+import java.util.Date;
 
 /**
  * 临床表实体
@@ -40,7 +41,7 @@ public class BusClinicPO extends TenantPO {
     /** 患者上次治疗时间 */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @Schema(description = "患者上次治疗时间")
-    private LocalDateTime lastTreatmentTime;
+    private Date lastTreatmentTime;
 
     /** 关联治疗方案表(当前阶段) */
     @Schema(description = "关联治疗方案表(当前阶段)")
@@ -82,12 +83,12 @@ public class BusClinicPO extends TenantPO {
     /** 设备与患者的绑定开始时间 */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @Schema(description = "设备与患者的绑定开始时间")
-    private LocalDateTime  bindStartTime;
+    private Date bindStartTime;
 
     /** 设备与患者的绑定结束时间 */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @Schema(description = "设备与患者的绑定结束时间")
-    private LocalDateTime bindEndTime;
+    private Date bindEndTime;
 
     /** 是否当前绑定(1=当前绑定,0=历史绑定)*/
     @Schema(description = "是否当前绑定(1=当前绑定,0=历史绑定)")

+ 4 - 3
tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/po/BusDeviceHistoryPO.java

@@ -11,6 +11,7 @@ import lombok.EqualsAndHashCode;
 import lombok.ToString;
 
 import java.time.LocalDateTime;
+import java.util.Date;
 
 /**
  * 设备历史实体
@@ -52,12 +53,12 @@ public class BusDeviceHistoryPO extends TenantPO {
     /** 光疗开始时间 */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @Schema(description = "光疗开始时间")
-    private LocalDateTime therapyStartTime;
+    private Date therapyStartTime;
 
     /** 光疗结束时间 */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @Schema(description = "光疗结束时间")
-    private LocalDateTime therapyEndTime;
+    private Date therapyEndTime;
 
     /** 治疗时长 */
     @Schema(description = "治疗时长")
@@ -66,7 +67,7 @@ public class BusDeviceHistoryPO extends TenantPO {
     /** 设备上传数据时间 */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @Schema(description = "设备上传数据时间")
-    private LocalDateTime uploadTime;
+    private Date uploadTime;
 
     /** 设备运行状态(0关机 1开机 2治疗中) */
     @Schema(description = "设备运行状态(0关机 1开机 2治疗中)")

+ 0 - 9
tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/service/impl/BusClinicServiceImpl.java

@@ -1,12 +1,6 @@
 package cn.tr.module.phototherapy.common.service.impl;
 
 import cn.tr.module.phototherapy.common.dto.PatientTherapyDetailDTO;
-import cn.tr.module.phototherapy.common.enums.IsCurrentBindEnum;
-import cn.tr.module.phototherapy.common.enums.TherapyStatusEnum;
-import cn.tr.module.phototherapy.common.po.BusTherapyPlanPO;
-import cn.tr.module.phototherapy.common.po.BusTherapyRecordPO;
-import cn.tr.module.phototherapy.common.repository.BusTherapyPlanRepository;
-import cn.tr.module.phototherapy.common.repository.BusTherapyRecordRepository;
 import cn.tr.module.phototherapy.common.vo.PatientTherapyDetailVO;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import jakarta.annotation.Resource;
@@ -20,9 +14,6 @@ import cn.tr.module.phototherapy.common.repository.BusClinicRepository;
 import cn.tr.module.phototherapy.common.po.BusClinicPO;
 import cn.tr.module.phototherapy.common.dto.BusClinicDTO;
 import cn.tr.module.phototherapy.common.dto.BusClinicQueryDTO;
-
-import java.time.LocalDate;
-import java.time.ZoneId;
 import java.util.*;
 import cn.tr.module.phototherapy.common.service.IBusClinicService;
 import cn.tr.module.phototherapy.common.mapper.BusClinicMapper;

+ 1 - 10
tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/service/impl/BusTherapyRecordServiceImpl.java

@@ -2,15 +2,9 @@ package cn.tr.module.phototherapy.common.service.impl;
 
 import cn.tr.module.phototherapy.common.dto.TherapyRecordDetailDTO;
 import cn.tr.module.phototherapy.common.handle.TimeRangeHandler;
-import cn.tr.module.phototherapy.common.mapper.TherapyRecordConvertMapper;
-import cn.tr.module.phototherapy.common.po.BusTherapyPlanPO;
-import cn.tr.module.phototherapy.common.repository.BusClinicRepository;
-import cn.tr.module.phototherapy.common.repository.BusTherapyPlanRepository;
 import cn.tr.module.phototherapy.common.utils.QueryParamUtil;
 import cn.tr.module.phototherapy.common.vo.TherapyRecordDetailVO;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.springframework.beans.factory.annotation.Autowired;
-import cn.tr.module.phototherapy.common.po.BusClinicPO;
 import org.springframework.stereotype.Service;
 import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.util.ObjectUtil;
@@ -24,7 +18,6 @@ import cn.tr.module.phototherapy.common.dto.BusTherapyRecordQueryDTO;
 
 import java.time.LocalDate;
 import java.time.LocalDateTime;
-import java.time.LocalTime;
 import java.util.*;
 import cn.tr.module.phototherapy.common.service.IBusTherapyRecordService;
 import cn.tr.module.phototherapy.common.mapper.BusTherapyRecordMapper;
@@ -43,8 +36,6 @@ public class BusTherapyRecordServiceImpl extends ServiceImpl<BusTherapyRecordRep
     @Resource
     private BusTherapyRecordRepository therapyRecordRepository;
 
-    @Resource
-    private TherapyRecordConvertMapper therapyRecordConvertMapper;
 
     /**
     * 根据条件查询治疗记录
@@ -142,6 +133,6 @@ public class BusTherapyRecordServiceImpl extends ServiceImpl<BusTherapyRecordRep
         List<TherapyRecordDetailVO> results = therapyRecordRepository.selectTherapyRecordWithPlan(clinicId, startDateTime, endDateTime);
 
         // 使用 Mapper 转换为 DTO
-        return therapyRecordConvertMapper.toTherapyRecordDetailDTOList(results);
+        return BusTherapyRecordMapper.INSTANCE.toTherapyRecordDetailDTOList(results);
     }
 }

+ 4 - 3
tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/vo/PatientTherapyDetailVO.java

@@ -4,6 +4,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 
 import java.time.LocalDateTime;
+import java.util.Date;
 
 /**
  * @ClassName PatientTherapyDetailVO
@@ -36,7 +37,7 @@ public class PatientTherapyDetailVO {
     private String patientAddress;
 
     @Schema(description = "最后治疗时间")
-    private LocalDateTime lastTreatmentTime;
+    private Date lastTreatmentTime;
 
     @Schema(description = "分组类型")
     private Integer groupType;
@@ -48,7 +49,7 @@ public class PatientTherapyDetailVO {
     private Integer therapyStatus;
 
     @Schema(description = "开始时间")
-    private LocalDateTime startTime;
+    private Date startTime;
 
     @Schema(description = "干预期")
     private String phaseType;
@@ -69,5 +70,5 @@ public class PatientTherapyDetailVO {
     private String deviceId;
 
     @Schema(description = "绑定开始时间")
-    private LocalDateTime bindStartTime;
+    private Date bindStartTime;
 }

+ 64 - 0
tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/vo/PatientTherapyRecordVO.java

@@ -0,0 +1,64 @@
+package cn.tr.module.phototherapy.common.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.util.Date;
+
+
+/**
+ * 治疗记录视图对象
+ *
+ * @Date 2026/1/121 9:14
+ */
+
+@Data
+@Schema(description = "患者列表对象")
+public class PatientTherapyRecordVO {
+
+    /** 患者唯一标识 */
+    @Schema(description = "患者唯一标识")
+    private String patientUniqueId;
+
+    /** 患者姓名 */
+    @Schema(description = "患者姓名")
+    private String patientName;
+
+    /** 患者年龄 */
+    @Schema(description = "患者年龄")
+    private Integer patientAge;
+
+    /** 患者联系电话 */
+    @Schema(description = "患者联系电话")
+    private String patientPhone;
+
+    /** 患者上次治疗时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Schema(description = "患者上次治疗时间")
+    private Date lastTreatmentTime;
+
+    /** 阶段类型 */
+    @Schema(description = "阶段类型")
+    private String phaseType;
+
+    /** 阶段目标次数 */
+    @Schema(description = "阶段目标次数")
+    private Integer phaseTargetTimes;
+
+    /** 阶段频率(如每日1次/隔日1次/每周3次) */
+    @Schema(description = "阶段频率(如每日1次/隔日1次/每周3次)")
+    private String phaseFreq;
+
+
+    @Schema(description = "治疗方案")
+    private String therapyPlanDesc;
+
+    /** 方案状态(0启用 1等待启用 2终止) */
+    @Schema(description = "方案状态(0启用 1等待启用 2终止)")
+    private Integer planStatus;
+
+    @Schema(description = "设备id")
+    private String deviceId;
+
+}

+ 2 - 1
tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/vo/TherapyRecordDetailVO.java

@@ -5,6 +5,7 @@ import lombok.Data;
 
 import java.time.LocalDate;
 import java.time.LocalDateTime;
+import java.util.Date;
 
 
 /**
@@ -18,7 +19,7 @@ import java.time.LocalDateTime;
 public class TherapyRecordDetailVO {
 
     @Schema(description = "治疗开始时间")
-    private LocalDateTime therapyStartTime;
+    private Date therapyStartTime;
 
     @Schema(description = "治疗时长")
     private Integer therapyDuration;

+ 1 - 1
tr-test/src/main/resources/application.yml

@@ -76,7 +76,7 @@ mybatis-plus:
   mapper-locations: classpath*:com/gitee/sunchenbin/mybatis/actable/mapping/*/*.xml,classpath*:mapper/*/*.xml
   configuration:
     log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl
-    #log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+#    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
   global-config:
     db-config:
       logic-delete-value: 1