|
@ -64,27 +64,48 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
|
|
|
MixEnvelop mixEnvelop = new MixEnvelop();
|
|
|
JSONObject obj = JSONObject.parseObject(jsonData);
|
|
|
String client_id = obj.getString("client_id");
|
|
|
String username = obj.getString("phoneNum");
|
|
|
String phoneNum = obj.getString("phoneNum");
|
|
|
String idCard = obj.getString("idCard");
|
|
|
String familyName = obj.getString("familyName");
|
|
|
//JSONArray jsonArray = entranceService.BS10008(idCard, "", "", "", "", "", false);
|
|
|
JSONArray jsonArray = entranceService.BS10008(idCard, "", "", "", "", "", false);
|
|
|
if(jsonArray!=null&&jsonArray.size()>0){
|
|
|
net.sf.json.JSONObject jsonObject= net.sf.json.JSONObject.fromObject(jsonArray.get(0).toString());
|
|
|
String familyId="";
|
|
|
if (null!=jsonObject.get("Patient_Id")){
|
|
|
String Pat_name = jsonObject.getString("Pat_Name");
|
|
|
if (null!=jsonObject.get("Phone_Number_Business")){
|
|
|
String Next_Of_Kin_Phone = jsonObject.get("Phone_Number_Business").toString();
|
|
|
if(!Next_Of_Kin_Phone.equalsIgnoreCase(phoneNum)){
|
|
|
mixEnvelop.setStatus(408);
|
|
|
mixEnvelop.setMessage("您所添加的家属的电话有误,无法添加");
|
|
|
return mixEnvelop;
|
|
|
}
|
|
|
}
|
|
|
if(!Pat_name.equalsIgnoreCase(familyName)){
|
|
|
mixEnvelop.setStatus(408);
|
|
|
mixEnvelop.setMessage("您所添加的家属的名称有误,无法添加");
|
|
|
return mixEnvelop;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
if (StringUtils.isEmpty(client_id)) {
|
|
|
mixEnvelop.setStatus(468);
|
|
|
mixEnvelop.setMessage("client_id不能为空");
|
|
|
return mixEnvelop;
|
|
|
}
|
|
|
if (StringUtils.isEmpty(username)) {
|
|
|
if (StringUtils.isEmpty(phoneNum)) {
|
|
|
mixEnvelop.setStatus(468);
|
|
|
mixEnvelop.setMessage("username不能为空");
|
|
|
mixEnvelop.setMessage("电话号不能为空");
|
|
|
return mixEnvelop;
|
|
|
}
|
|
|
if (username.length() > 12) {
|
|
|
if (phoneNum.length() > 12) {
|
|
|
mixEnvelop.setStatus(468);
|
|
|
mixEnvelop.setMessage("请输入正确的手机号");
|
|
|
return mixEnvelop;
|
|
|
}
|
|
|
//验证请求间隔超时,防止频繁获取验证码
|
|
|
if (!this.isIntervalTimeout(client_id, username)) {
|
|
|
if (!this.isIntervalTimeout(client_id, phoneNum)) {
|
|
|
throw new IllegalAccessException("SMS request frequency is too fast");
|
|
|
//发送短信获取验证码
|
|
|
}
|
|
@ -92,35 +113,35 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
|
|
|
if("xm_ykyy_wx".equalsIgnoreCase(wxId)){
|
|
|
System.out.println("发送眼科验证码开始");
|
|
|
ResultMsg result= null;
|
|
|
/*if (jsonArray.size() > 0) {*/
|
|
|
result = ykyySMSService.ykyySendSMS(username, "您好,您的此次操作的验证码是:" + captcha + ",2分钟内有效。如非本人操作,请忽略");
|
|
|
if (null!=jsonArray&&jsonArray.size() > 0) {
|
|
|
result = ykyySMSService.ykyySendSMS(phoneNum, "您好,您的此次操作的验证码是:" + captcha + ",2分钟内有效。如非本人操作,请忽略");
|
|
|
if (result.isSuccess()){
|
|
|
this.store(client_id, username, captcha, 120);
|
|
|
this.store(client_id, phoneNum, captcha, 120);
|
|
|
mixEnvelop.setMessage("验证码发送成功");
|
|
|
} else {
|
|
|
mixEnvelop.setMessage("验证码发送失败");
|
|
|
mixEnvelop.setStatus(500);
|
|
|
}
|
|
|
/*}else {
|
|
|
}else {
|
|
|
mixEnvelop.setStatus(408);
|
|
|
mixEnvelop.setMessage("您所添加的家属无就诊记录,无法发送验证码");
|
|
|
}*/
|
|
|
}
|
|
|
|
|
|
}else {
|
|
|
System.out.println("发送中山验证码开始");
|
|
|
int result = 1;
|
|
|
/*if (jsonArray.size() > 0) {*/
|
|
|
result = zhongShanSMSService.ZhongShangSendSMS(username, "您好,您当前操作的验证码是:" + captcha + ",2分钟内有效。如非本人操作,请忽略");
|
|
|
/* } else {
|
|
|
if (null!=jsonArray&&jsonArray.size() > 0) {
|
|
|
result = zhongShanSMSService.ZhongShangSendSMS(phoneNum, "您好,您当前操作的验证码是:" + captcha + ",2分钟内有效。如非本人操作,请忽略");
|
|
|
} else {
|
|
|
result = 2;
|
|
|
}*/
|
|
|
}
|
|
|
if (0 == result) {
|
|
|
this.store(client_id, username, captcha, 120);
|
|
|
this.store(client_id, phoneNum, captcha, 120);
|
|
|
mixEnvelop.setMessage("验证码发送成功");
|
|
|
} /*else if (2 == result) {
|
|
|
} else if (2 == result) {
|
|
|
mixEnvelop.setStatus(408);
|
|
|
mixEnvelop.setMessage("您所添加的家属无就诊记录,无法发送验证码");
|
|
|
}*/ else {
|
|
|
} else {
|
|
|
mixEnvelop.setMessage("验证码发送失败");
|
|
|
mixEnvelop.setStatus(500);
|
|
|
}
|