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