diff --git a/tcm/src/main/java/com/ccsens/tcm/bean/dto/PatientDto.java b/tcm/src/main/java/com/ccsens/tcm/bean/dto/PatientDto.java index 2eb66960..66371261 100644 --- a/tcm/src/main/java/com/ccsens/tcm/bean/dto/PatientDto.java +++ b/tcm/src/main/java/com/ccsens/tcm/bean/dto/PatientDto.java @@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import sun.awt.ConstrainableGraphics; +import javax.validation.constraints.NotNull; import java.util.Date; import java.util.List; @@ -42,6 +43,7 @@ public class PatientDto { private Long testQuestionsId; @ApiModelProperty("内容") private String contents; + @NotNull @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @ApiModelProperty("诊断时间") private Date timeSlot; diff --git a/tcm/src/main/java/com/ccsens/tcm/bean/po/PatientRecord.java b/tcm/src/main/java/com/ccsens/tcm/bean/po/PatientRecord.java index 08334c78..3b6645c0 100644 --- a/tcm/src/main/java/com/ccsens/tcm/bean/po/PatientRecord.java +++ b/tcm/src/main/java/com/ccsens/tcm/bean/po/PatientRecord.java @@ -3,7 +3,7 @@ package com.ccsens.tcm.bean.po; import java.io.Serializable; import java.util.Date; -public class patientRecord implements Serializable { +public class PatientRecord implements Serializable { private Long id; private Long patientId; diff --git a/tcm/src/main/java/com/ccsens/tcm/bean/po/PatientRecordExample.java b/tcm/src/main/java/com/ccsens/tcm/bean/po/PatientRecordExample.java index 040b35cb..7e94183f 100644 --- a/tcm/src/main/java/com/ccsens/tcm/bean/po/PatientRecordExample.java +++ b/tcm/src/main/java/com/ccsens/tcm/bean/po/PatientRecordExample.java @@ -4,14 +4,14 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; -public class patientRecordExample { +public class PatientRecordExample { protected String orderByClause; protected boolean distinct; protected List oredCriteria; - public patientRecordExample() { + public PatientRecordExample() { oredCriteria = new ArrayList(); } diff --git a/tcm/src/main/java/com/ccsens/tcm/persist/mapper/PatientRecordMapper.java b/tcm/src/main/java/com/ccsens/tcm/persist/mapper/PatientRecordMapper.java index 986419f8..b440ffb7 100644 --- a/tcm/src/main/java/com/ccsens/tcm/persist/mapper/PatientRecordMapper.java +++ b/tcm/src/main/java/com/ccsens/tcm/persist/mapper/PatientRecordMapper.java @@ -1,30 +1,30 @@ package com.ccsens.tcm.persist.mapper; -import com.ccsens.tcm.bean.po.patientRecord; -import com.ccsens.tcm.bean.po.patientRecordExample; +import com.ccsens.tcm.bean.po.PatientRecord; +import com.ccsens.tcm.bean.po.PatientRecordExample; import java.util.List; import org.apache.ibatis.annotations.Param; -public interface patientRecordMapper { - long countByExample(patientRecordExample example); +public interface PatientRecordMapper { + long countByExample(PatientRecordExample example); - int deleteByExample(patientRecordExample example); + int deleteByExample(PatientRecordExample example); int deleteByPrimaryKey(Long id); - int insert(patientRecord record); + int insert(PatientRecord record); - int insertSelective(patientRecord record); + int insertSelective(PatientRecord record); - List selectByExample(patientRecordExample example); + List selectByExample(PatientRecordExample example); - patientRecord selectByPrimaryKey(Long id); + PatientRecord selectByPrimaryKey(Long id); - int updateByExampleSelective(@Param("record") patientRecord record, @Param("example") patientRecordExample example); + int updateByExampleSelective(@Param("record") PatientRecord record, @Param("example") PatientRecordExample example); - int updateByExample(@Param("record") patientRecord record, @Param("example") patientRecordExample example); + int updateByExample(@Param("record") PatientRecord record, @Param("example") PatientRecordExample example); - int updateByPrimaryKeySelective(patientRecord record); + int updateByPrimaryKeySelective(PatientRecord record); - int updateByPrimaryKey(patientRecord record); + int updateByPrimaryKey(PatientRecord record); } \ No newline at end of file diff --git a/tcm/src/main/java/com/ccsens/tcm/service/PatientService.java b/tcm/src/main/java/com/ccsens/tcm/service/PatientService.java index 5243def3..2a7f961f 100644 --- a/tcm/src/main/java/com/ccsens/tcm/service/PatientService.java +++ b/tcm/src/main/java/com/ccsens/tcm/service/PatientService.java @@ -3,6 +3,7 @@ package com.ccsens.tcm.service; import cn.hutool.core.lang.Snowflake; import com.ccsens.tcm.bean.dto.PatientDto; import com.ccsens.tcm.bean.po.PatientInformation; +import com.ccsens.tcm.bean.po.ReportCode; import com.ccsens.tcm.persist.mapper.PatientInformationMapper; import com.ccsens.tcm.persist.mapper.ReportCodeMapper; import com.ccsens.util.RedisUtil; @@ -37,12 +38,19 @@ public class PatientService implements IPatientService { @Override public void saveCaseMes(PatientDto.saveCaseMes param, Long userId) { - Integer.parseInt((String) redisUtil.get("disease_time")); + //获取发病时间id + Integer onsetTime=Integer.parseInt((String) redisUtil.get("disease_time")); if(param.getList().size()>0) { for (int i = 0; i < param.getList().size(); i++) { //先查询试题id - reportCodeMapper.selectByPrimaryKey(param.getList().get(i).getTestQuestionsId()); - + ReportCode reportCode = reportCodeMapper.selectByPrimaryKey(param.getList().get(i).getTestQuestionsId()); + if(reportCode.getReportType()==(byte)0){ + //试题只需要记录一次的 + }else if(reportCode.getReportType()==(byte)1){ + //试题只需要记录3次的 + }else if(reportCode.getReportType()==(byte)2){ + //试题需要记录两次的 + } } diff --git a/tcm/src/main/resources/mapper_raw/PatientRecordMapper.xml b/tcm/src/main/resources/mapper_raw/PatientRecordMapper.xml index 6acc2872..2552d580 100644 --- a/tcm/src/main/resources/mapper_raw/PatientRecordMapper.xml +++ b/tcm/src/main/resources/mapper_raw/PatientRecordMapper.xml @@ -1,7 +1,7 @@ - - + + @@ -75,7 +75,7 @@ id, patient_id, test_questions_id, contents, user_id, collect_time, time_slot, created_at, update_at, rec_status - select distinct @@ -99,13 +99,13 @@ delete from t_patient_record where id = #{id,jdbcType=BIGINT} - + delete from t_patient_record - + SELECT LAST_INSERT_ID() @@ -118,7 +118,7 @@ #{createdAt,jdbcType=TIMESTAMP}, #{updateAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT} ) - + SELECT LAST_INSERT_ID() @@ -182,7 +182,7 @@ - select count(*) from t_patient_record @@ -242,7 +242,7 @@ - + update t_patient_record @@ -275,7 +275,7 @@ where id = #{id,jdbcType=BIGINT} - + update t_patient_record set patient_id = #{patientId,jdbcType=BIGINT}, test_questions_id = #{testQuestionsId,jdbcType=BIGINT},