|
@ -42,6 +42,7 @@ public class SMSService extends BaseService {
|
|
|
SignFamilyDao signFamilyDao;
|
|
|
@Autowired
|
|
|
DoctorDao doctorDao;
|
|
|
|
|
|
/**
|
|
|
* 发送短信验证码接口
|
|
|
*
|
|
@ -90,7 +91,6 @@ public class SMSService extends BaseService {
|
|
|
// 1微信端注册,2微信端找回密码,3医生端找回密码,4患者登录,5医生登录
|
|
|
if (type == 1) {
|
|
|
// 患者注册
|
|
|
|
|
|
sms.setContent("您的注册验证码为:" + captcha);
|
|
|
} else if (type == 2 || type == 3) {
|
|
|
sms.setContent("您找回密码验证码为:" + captcha);
|
|
@ -117,32 +117,32 @@ public class SMSService extends BaseService {
|
|
|
// 其他验证码
|
|
|
sms.setContent("验证码:" + captcha);
|
|
|
}
|
|
|
if(type==2||type==4||type==10) {//患者
|
|
|
if (type == 2 || type == 4 || type == 10) {//患者
|
|
|
List<Patient> patients = patientDao.findByMobile(mobile);
|
|
|
if(patients!=null&&patients.size()>0){
|
|
|
SignFamily signFamily = signFamilyDao.findByMobile(mobile);
|
|
|
if(signFamily!=null){
|
|
|
sms.setUserType(0);
|
|
|
sms.setUserCode(signFamily.getPatient());
|
|
|
sms.setHospital(signFamily.getHospital());
|
|
|
if (patients != null && patients.size() > 0) {
|
|
|
SignFamily sign= signFamilyDao.findByPatient(code);
|
|
|
sms.setUserType(0);
|
|
|
sms.setUserCode(code);
|
|
|
if(sign!=null){
|
|
|
sms.setHospital(sign.getHospital());
|
|
|
}
|
|
|
}
|
|
|
}else if(type==3||type==5||type==6){//医生
|
|
|
} else if (type == 3 || type == 5 || type == 6) {//医生
|
|
|
Doctor d = doctorDao.findByMobile(mobile);
|
|
|
if(d!=null){
|
|
|
if (d != null) {
|
|
|
sms.setUserType(0);
|
|
|
sms.setUserCode(d.getCode());
|
|
|
sms.setHospital(d.getHospital());
|
|
|
}
|
|
|
}else{//未知
|
|
|
} else {//未知
|
|
|
Doctor d = doctorDao.findByMobile(mobile);
|
|
|
if(d!=null){
|
|
|
if (d != null) {
|
|
|
sms.setUserType(0);
|
|
|
sms.setUserCode(d.getCode());
|
|
|
sms.setHospital(d.getHospital());
|
|
|
}else{
|
|
|
} else {
|
|
|
SignFamily signFamily = signFamilyDao.findByMobile(mobile);
|
|
|
if(signFamily!=null){
|
|
|
if (signFamily != null) {
|
|
|
sms.setUserType(0);
|
|
|
sms.setUserCode(signFamily.getPatient());
|
|
|
sms.setHospital(signFamily.getHospital());
|