Browse Source

切换分支

recovery
zhizhi wu 4 years ago
parent
commit
69f3fefa78
  1. 4
      tall/src/main/resources/application.yml
  2. 4
      tcm/src/main/java/com/ccsens/tcm/bean/dto/PatientDto.java
  3. 20
      tcm/src/main/java/com/ccsens/tcm/service/PatientService.java
  4. 4
      tcm/src/main/resources/application.yml

4
tall/src/main/resources/application.yml

@ -1,5 +1,5 @@
spring: spring:
profiles: profiles:
active: test active: dev
include: util-test,common include: util-dev,common

4
tcm/src/main/java/com/ccsens/tcm/bean/dto/PatientDto.java

@ -20,8 +20,8 @@ public class PatientDto {
@Data @Data
@ApiModel("保存患者基本信息") @ApiModel("保存患者基本信息")
public static class SavePatient { public static class SavePatient {
@ApiModelProperty("住院号") // @ApiModelProperty("住院号")
private String hospitalization; // private String hospitalization;
@ApiModelProperty("对照组id") @ApiModelProperty("对照组id")
private Long inpatientId; private Long inpatientId;
@ApiModelProperty("录入状态:0:新建 1:数据搜集中 2数据搜集完成 3数据搜集超时 4:废弃") @ApiModelProperty("录入状态:0:新建 1:数据搜集中 2数据搜集完成 3数据搜集超时 4:废弃")

20
tcm/src/main/java/com/ccsens/tcm/service/PatientService.java

@ -73,16 +73,22 @@ public class PatientService implements IPatientService {
@Override @Override
public void savePatient(PatientDto.SavePatient param, Long userId) { public void savePatient(PatientDto.SavePatient param, Long userId) {
PatientInformationExample patientInformationExample=new PatientInformationExample(); // PatientInformationExample patientInformationExample=new PatientInformationExample();
patientInformationExample.createCriteria().andHospitalizationEqualTo(param.getHospitalization()).andRecStatusEqualTo((byte)0); // patientInformationExample.createCriteria().andHospitalizationEqualTo(param.getHospitalization()).andRecStatusEqualTo((byte)0);
long l = patientInformationMapper.countByExample(patientInformationExample); // long l = patientInformationMapper.countByExample(patientInformationExample);
if(l>0){ // if(l>0){
throw new BaseException(CodeEnum.ZHUYUANIDCHONGFU); // throw new BaseException(CodeEnum.ZHUYUANIDCHONGFU);
} // }
param.setHospitalId(selUserIdToHosId(userId).getId()); Hospital hospital = selUserIdToHosId(userId);
param.setHospitalId(hospital.getId());
PatientInformation patientInformation=new PatientInformation(); PatientInformation patientInformation=new PatientInformation();
BeanUtils.copyProperties(param,patientInformation); BeanUtils.copyProperties(param,patientInformation);
patientInformation.setId(snowflake.nextId()); patientInformation.setId(snowflake.nextId());
// 生成编号
String num = hospital.getCode() + "";
patientInformation.setHospitalization(num);
patientInformationMapper.insertSelective(patientInformation); patientInformationMapper.insertSelective(patientInformation);
} }

4
tcm/src/main/resources/application.yml

@ -1,5 +1,5 @@
spring: spring:
profiles: profiles:
active: green active: dev
include: common, util-green include: common, util-dev

Loading…
Cancel
Save