Explorar el Código

检验逻辑完善

chengyao hace 4 años
padre
commit
149db6dc91

+ 92 - 19
src/main/java/com/diagbot/dto/ExamineInfoDTO.java

@@ -1,11 +1,7 @@
 package com.diagbot.dto;
-
 import com.fasterxml.jackson.annotation.JsonIgnore;
-import io.swagger.annotations.ApiModelProperty;
 import lombok.Getter;
 import lombok.Setter;
-
-import javax.validation.constraints.NotBlank;
 import java.util.Date;
 
 /**
@@ -13,8 +9,7 @@ import java.util.Date;
  * @author: cy
  * @time: 2020/9/07 15:00
  */
-@Getter
-@Setter
+
 public class ExamineInfoDTO {
     /**
      * 医院id
@@ -36,28 +31,19 @@ public class ExamineInfoDTO {
      */
     private String examineItemName;
 
-    /**
-     * 检查时间
-     */
-    @JsonIgnore
-    private String cTime;
+
 
     /**
      * 返回检查时间
      */
-    private Date checkTime;
+    private Date cTime;
+
 
-    /**
-     * 报告时间
-     */
-    @JsonIgnore
-    private String rTime;
 
     /**
      * 返回报告时间
      */
-    private Date repTime;
-
+    private Date rTime;
 
     /**
      * 开单医生
@@ -74,4 +60,91 @@ public class ExamineInfoDTO {
      */
     @JsonIgnore
     private String info;
+
+    public Long getHospitalId() {
+        return hospitalId;
+    }
+
+    public void setHospitalId(Long hospitalId) {
+        this.hospitalId = hospitalId;
+    }
+
+    public String getBehospitalCode() {
+        return behospitalCode;
+    }
+
+    public void setBehospitalCode(String behospitalCode) {
+        this.behospitalCode = behospitalCode;
+    }
+
+    public String getExamineItemType() {
+        return examineItemType;
+    }
+
+    public void setExamineItemType(String examineItemType) {
+        this.examineItemType = examineItemType;
+    }
+
+    public String getExamineItemName() {
+        return examineItemName;
+    }
+
+    public void setExamineItemName(String examineItemName) {
+        this.examineItemName = examineItemName;
+    }
+
+    public Date getcTime() {
+        return cTime;
+    }
+
+    public void setcTime(Date cTime) {
+        this.cTime = cTime;
+    }
+
+    public Date getrTime() {
+        return rTime;
+    }
+
+    public void setrTime(Date rTime) {
+        this.rTime = rTime;
+    }
+
+    public String getDoctorName() {
+        return doctorName;
+    }
+
+    public void setDoctorName(String doctorName) {
+        this.doctorName = doctorName;
+    }
+
+    public String getRepNo() {
+        return repNo;
+    }
+
+    public void setRepNo(String repNo) {
+        this.repNo = repNo;
+    }
+
+    public String getInfo() {
+        return info;
+    }
+
+    public void setInfo(String info) {
+        this.info = info;
+    }
+
+    @Override
+    public String toString() {
+        return "ExamineInfoDTO{" +
+                "hospitalId=" + hospitalId +
+                ", behospitalCode='" + behospitalCode + '\'' +
+                ", examineItemType='" + examineItemType + '\'' +
+                ", examineItemName='" + examineItemName + '\'' +
+                ", cTime=" + cTime +
+                ", rTime=" + rTime +
+                ", doctorName='" + doctorName + '\'' +
+                ", repNo='" + repNo + '\'' +
+                ", info='" + info + '\'' +
+                '}';
+    }
 }

+ 2 - 13
src/main/java/com/diagbot/dto/ExamineSonInfoDTO.java

@@ -26,27 +26,16 @@ public class ExamineSonInfoDTO {
      */
     private String examineItemResult;
 
-    /**
-     * 检查时间
-     */
-    @JsonIgnore
-    private String cTime;
-
     /**
      * 返回检查时间
      */
-    private Date checkTime;
+    private Date cTime;
 
-    /**
-     * 报告时间
-     */
-    @JsonIgnore
-    private String rTime;
 
     /**
      * 返回报告时间
      */
-    private Date repTime;
+    private Date rTime;
 
     /**
      * 开单医生

+ 2 - 1
src/main/java/com/diagbot/facade/MedLisInfoFacade.java

@@ -16,6 +16,7 @@ import org.springframework.stereotype.Component;
 import com.diagbot.dto.DoctorAdviceDTO;
 import org.springframework.stereotype.Component;
 
+import java.text.ParseException;
 import java.text.SimpleDateFormat;
 
 /**
@@ -59,7 +60,7 @@ public class MedLisInfoFacade extends MedLisInfoServiceImpl {
      * @return
      */
 
-    public IPage<ExamineSonInfoDTO> getExamineSonPage(ExamineSonInfoVO examineSonInfoVO) {
+    public IPage<ExamineSonInfoDTO> getExamineSonPage(ExamineSonInfoVO examineSonInfoVO)  {
 //        examineSonInfoVO.setHospitalId(Long.valueOf(SysUserUtils.getCurrentHospitalID()));
         examineSonInfoVO.setHospitalId(2l);
         return this.getExamineSonInfo(examineSonInfoVO);

+ 3 - 23
src/main/java/com/diagbot/service/impl/MedLisInfoServiceImpl.java

@@ -35,7 +35,7 @@ import java.util.Set;
 public class MedLisInfoServiceImpl extends ServiceImpl<MedLisInfoMapper, MedLisInfo> implements MedLisInfoService {
 
 
-    public IPage<ExamineInfoDTO> getExamineInfo(ExamineInfoVO examineInfoVO) throws ParseException {
+    public IPage<ExamineInfoDTO> getExamineInfo(ExamineInfoVO examineInfoVO){
 
         List<String> infos = this.baseMapper.getInfo(examineInfoVO.getHospitalId(), examineInfoVO.getBehospitalCode());
 
@@ -58,33 +58,13 @@ public class MedLisInfoServiceImpl extends ServiceImpl<MedLisInfoMapper, MedLisI
         }
 
         IPage<ExamineInfoDTO> page = this.baseMapper.getExamineInfo(examineInfoVO, infoSet);
-        List<ExamineInfoDTO> records = page.getRecords();
-        for (ExamineInfoDTO record : records) {
-            timeMethod(record,null,record.getCTime(),record.getRTime());
-        }
         return page;
     }
 
-    public IPage<ExamineSonInfoDTO> getExamineSonInfo(ExamineSonInfoVO examineSonInfoVO) throws ParseException {
+    public IPage<ExamineSonInfoDTO> getExamineSonInfo(ExamineSonInfoVO examineSonInfoVO) {
         IPage<ExamineSonInfoDTO> page = this.baseMapper.getExamineSonInfo(examineSonInfoVO);
-        List<ExamineSonInfoDTO> records = page.getRecords();
-        for (ExamineSonInfoDTO record : records) {
-            timeMethod(null,record,record.getCTime(),record.getRTime());
-        }
         return page;
     }
 
-    public void timeMethod(ExamineInfoDTO recordInfo,ExamineSonInfoDTO record,String cTime, String rTime) throws ParseException {
-        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-        Date cTimeDate = simpleDateFormat.parse(cTime);
-        Date rTimeDate = simpleDateFormat.parse(rTime);
-        if(null == recordInfo){
-            record.setCheckTime(cTimeDate);
-            record.setRepTime(rTimeDate);
-        }
-        if(null == record){
-            recordInfo.setCheckTime(cTimeDate);
-            recordInfo.setRepTime(rTimeDate);
-        }
-    }
+
 }

+ 4 - 4
src/main/resources/mapper/MedLisInfoMapper.xml

@@ -32,8 +32,8 @@
         t1.rep_name as examineItemName,
         t1.rep_type_name as examineItemType,
         CONCAT( t1.rep_name, '(',DATE_FORMAT( t1.check_date,'%Y-%m-%d'),')')as info,
-        t1.rep_date as rTime,
-        t1.check_date as cTime,
+        DATE_FORMAT( t1.rep_date, '%Y-%m-%d %h:%i:%s' ) as rTime,
+        DATE_FORMAT( t1.check_date, '%Y-%m-%d %h:%i:%s' ) as cTime,
         t1.apply_doctor as doctorName,
         t1.hospital_id as hospitalId,
         t1.behospital_code as behospitalCode
@@ -109,8 +109,8 @@
         SELECT
         t2.item_name AS examineItemName,
         CONCAT( t2.result, t2.unit ) AS examineItemResult,
-        t1.rep_date AS rTime,
-        t1.check_date AS cTime,
+        DATE_FORMAT( t1.rep_date, '%Y-%m-%d %h:%i:%s' ) as rTime,
+        DATE_FORMAT( t1.check_date, '%Y-%m-%d %h:%i:%s' ) as cTime,
         t1.apply_doctor AS doctorName
         FROM
         med_lis_info t1,