|
@ -822,6 +822,44 @@ public class PatientController extends WeixinBaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 居民手机号变更
|
|
|
*
|
|
|
* @param mobile 新手机号
|
|
|
* @param captcha 验证码
|
|
|
* @param type 1:变更手机号 2:绑定手机号
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/mobileUpdate", method = RequestMethod.POST)
|
|
|
@ResponseBody
|
|
|
@ApiOperation("居民手机号变更")
|
|
|
public String changePatientMobile2(String mobile, String captcha, int type) {
|
|
|
try {
|
|
|
if (StringUtils.isEmpty(mobile)) {
|
|
|
return error(-1, "请填写新手机号码");
|
|
|
}
|
|
|
if (StringUtils.isEmpty(captcha)) {
|
|
|
return error(-1, "请输入验证码");
|
|
|
}
|
|
|
|
|
|
int smsCheck = smsService.check(mobile, type, captcha);
|
|
|
if (smsCheck != 1) {
|
|
|
return error(-1, "验证码错误");
|
|
|
}
|
|
|
// int result = patientInfoService.changeMobile(getUID(), mobile, captcha, type);
|
|
|
int result = patientInfoService.changeMobile(getRepUID(), mobile, captcha, type);
|
|
|
if (result == -1) {
|
|
|
return error(-1, "居民信息查找失败");
|
|
|
} else if (result == 1) {
|
|
|
return write(200, "手机号更新成功");
|
|
|
} else {
|
|
|
return write(-1, "手机号更新失败");
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
return error(-1, "手机号更新失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 手机号是否注册
|
|
|
*
|