@ -94,7 +94,14 @@ public class PatientService implements IPatientService {
*/
@Override
public Hospital selUserIdToHosId(Long userId) {
Doctor doctor = doctorMapper.selectByPrimaryKey(userId);
Doctor doctor=null;
DoctorExample doctorExample=new DoctorExample();
doctorExample.createCriteria().andUserIdEqualTo(userId).andRecStatusEqualTo((byte)0);
List<Doctor> doctors = doctorMapper.selectByExample(doctorExample);
if(doctors.size()!=1){
throw new BaseException(CodeEnum.MEIYOUGAIYISHENG);
}
doctor=doctors.get(0);
return hospitalMapper.selectByPrimaryKey(doctor.getHospitalId());
@ -184,6 +184,7 @@ public enum CodeEnum {
QUANTITYERROR(153,"住院号和患者id不对应",true),
NOT_HOSPITAL(154,"未找到医院信息",true),
ZHUYUANIDCHONGFU(155,"住院号重复",true),
MEIYOUGAIYISHENG(156,"该医生信息查询不正确",true),
;