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:
profiles:
active: test
include: util-test,common
active: dev
include: util-dev,common

4
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:废弃")

20
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);
}

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

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

Loading…
Cancel
Save