From 69f3fefa78219f08a59103b48903101aaa121c8a Mon Sep 17 00:00:00 2001 From: zhizhi wu <2377881365@qq.com> Date: Wed, 14 Apr 2021 14:39:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=87=E6=8D=A2=E5=88=86=E6=94=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tall/src/main/resources/application.yml | 4 ++-- .../com/ccsens/tcm/bean/dto/PatientDto.java | 4 ++-- .../ccsens/tcm/service/PatientService.java | 20 ++++++++++++------- tcm/src/main/resources/application.yml | 4 ++-- 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/tall/src/main/resources/application.yml b/tall/src/main/resources/application.yml index ebc544af..b5408a3a 100644 --- a/tall/src/main/resources/application.yml +++ b/tall/src/main/resources/application.yml @@ -1,5 +1,5 @@ spring: profiles: - active: test - include: util-test,common + active: dev + include: util-dev,common 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 e530909d..2e67898d 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 @@ -20,8 +20,8 @@ public class PatientDto { @Data @ApiModel("保存患者基本信息") public static class SavePatient { - @ApiModelProperty("住院号") - private String hospitalization; +// @ApiModelProperty("住院号") +// private String hospitalization; @ApiModelProperty("对照组id") private Long inpatientId; @ApiModelProperty("录入状态:0:新建 1:数据搜集中 2数据搜集完成 3数据搜集超时 4:废弃") 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 12e990f1..f435e2a9 100644 --- a/tcm/src/main/java/com/ccsens/tcm/service/PatientService.java +++ b/tcm/src/main/java/com/ccsens/tcm/service/PatientService.java @@ -73,16 +73,22 @@ public class PatientService implements IPatientService { @Override public void savePatient(PatientDto.SavePatient param, Long userId) { - PatientInformationExample patientInformationExample=new PatientInformationExample(); - patientInformationExample.createCriteria().andHospitalizationEqualTo(param.getHospitalization()).andRecStatusEqualTo((byte)0); - long l = patientInformationMapper.countByExample(patientInformationExample); - if(l>0){ - throw new BaseException(CodeEnum.ZHUYUANIDCHONGFU); - } - param.setHospitalId(selUserIdToHosId(userId).getId()); +// PatientInformationExample patientInformationExample=new PatientInformationExample(); +// patientInformationExample.createCriteria().andHospitalizationEqualTo(param.getHospitalization()).andRecStatusEqualTo((byte)0); +// long l = patientInformationMapper.countByExample(patientInformationExample); +// if(l>0){ +// throw new BaseException(CodeEnum.ZHUYUANIDCHONGFU); +// } + Hospital hospital = selUserIdToHosId(userId); + + + param.setHospitalId(hospital.getId()); PatientInformation patientInformation=new PatientInformation(); BeanUtils.copyProperties(param,patientInformation); patientInformation.setId(snowflake.nextId()); + // 生成编号 + String num = hospital.getCode() + ""; + patientInformation.setHospitalization(num); patientInformationMapper.insertSelective(patientInformation); } diff --git a/tcm/src/main/resources/application.yml b/tcm/src/main/resources/application.yml index 33b76558..4ecd13fd 100644 --- a/tcm/src/main/resources/application.yml +++ b/tcm/src/main/resources/application.yml @@ -1,5 +1,5 @@ spring: profiles: - active: green - include: common, util-green + active: dev + include: common, util-dev