|  | @ -5,10 +5,12 @@ import java.net.URLEncoder;
 | 
	
		
			
				|  |  | import java.util.*;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | import com.yihu.wlyy.entity.login.LoginLog;
 | 
	
		
			
				|  |  | import com.yihu.wlyy.entity.patient.PatientFamilyMember;
 | 
	
		
			
				|  |  | import com.yihu.wlyy.entity.patient.SocialSecurityInfo;
 | 
	
		
			
				|  |  | import com.yihu.wlyy.logs.BusinessLogs;
 | 
	
		
			
				|  |  | import com.yihu.wlyy.repository.patient.PatientDao;
 | 
	
		
			
				|  |  | import com.yihu.wlyy.repository.patient.SocialSecurityInfoDao;
 | 
	
		
			
				|  |  | import com.yihu.wlyy.service.app.family.FamilyMemberService;
 | 
	
		
			
				|  |  | import com.yihu.wlyy.service.app.family.FamilyService;
 | 
	
		
			
				|  |  | import com.yihu.wlyy.service.common.login.LoginLogService;
 | 
	
		
			
				|  |  | import com.yihu.wlyy.util.HttpUtil;
 | 
	
	
		
			
				|  | @ -56,6 +58,8 @@ public class WechatController extends WeixinBaseController {
 | 
	
		
			
				|  |  |     private FamilyService familyService;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private LoginLogService loginLogService;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private FamilyMemberService familyMemberService;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 患者注册-验证手机号
 | 
	
	
		
			
				|  | @ -150,9 +154,9 @@ public class WechatController extends WeixinBaseController {
 | 
	
		
			
				|  |  |             if (StringUtils.isEmpty(mobile)) {
 | 
	
		
			
				|  |  |                 return error(-1, "手机号不允许为空");
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             if (patientService.findByMobile(mobile) != null) {
 | 
	
		
			
				|  |  |                 return error(-1, "该手机号已被注册");
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             //if (patientService.findByMobile(mobile) != null) {
 | 
	
		
			
				|  |  |             //    return error(-1, "该手机号已被注册");
 | 
	
		
			
				|  |  |             //}
 | 
	
		
			
				|  |  |             // 解密身份证号
 | 
	
		
			
				|  |  |             idcard = RSAUtils.getInstance(patientService).decryptString(idcard);
 | 
	
		
			
				|  |  |             idcard = URLDecoder.decode(idcard, "UTF-8");
 | 
	
	
		
			
				|  | @ -190,8 +194,8 @@ public class WechatController extends WeixinBaseController {
 | 
	
		
			
				|  |  |                     return error(-1, "该身份证已被注册");
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             return write(200, "验证成功");
 | 
	
		
			
				|  |  |             List<Patient> patients = patientService.findByMobile(mobile);
 | 
	
		
			
				|  |  |             return write(200, "验证成功","data",patients);
 | 
	
		
			
				|  |  |         } catch (Exception e) {
 | 
	
		
			
				|  |  |             return error(-1, "验证失败");
 | 
	
		
			
				|  |  |         }
 | 
	
	
		
			
				|  | @ -207,13 +211,14 @@ public class WechatController extends WeixinBaseController {
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     @RequestMapping(value = "regist")
 | 
	
		
			
				|  |  |     @ResponseBody
 | 
	
		
			
				|  |  |     public String regist(String name,
 | 
	
		
			
				|  |  |                          String idcard,
 | 
	
		
			
				|  |  |                          String ssc,
 | 
	
		
			
				|  |  |                          String mobile,
 | 
	
		
			
				|  |  |                          String captcha,
 | 
	
		
			
				|  |  |                          String openid,
 | 
	
		
			
				|  |  |                          String password) {
 | 
	
		
			
				|  |  |     public String regist(@RequestParam(value="name",required = true) String name,
 | 
	
		
			
				|  |  |                          @RequestParam(value="idcard",required = true) String idcard,
 | 
	
		
			
				|  |  |                          @RequestParam(value="ssc",required = true) String ssc,
 | 
	
		
			
				|  |  |                          @RequestParam(value="mobile",required = true) String mobile,
 | 
	
		
			
				|  |  |                          @RequestParam(value="captcha",required = true) String captcha,
 | 
	
		
			
				|  |  |                          @RequestParam(value="openid",required = true) String openid,
 | 
	
		
			
				|  |  |                          @RequestParam(value="password",required = true) String password,
 | 
	
		
			
				|  |  |                          @RequestParam(value="home",required = true) String home) {
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             if (StringUtils.isEmpty(name)) {
 | 
	
		
			
				|  |  |                 return error(-1, "姓名不允许为空!");
 | 
	
	
		
			
				|  | @ -284,7 +289,7 @@ public class WechatController extends WeixinBaseController {
 | 
	
		
			
				|  |  |                 patient = new Patient();
 | 
	
		
			
				|  |  |             } else {
 | 
	
		
			
				|  |  |                 if (!StringUtils.isEmpty(patient.getMobile())) {
 | 
	
		
			
				|  |  |                     return error(-1, "该身份证已被注册!");
 | 
	
		
			
				|  |  |                     return error(-2, "该身份证已被注册!");
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             patient.setName(name);
 | 
	
	
		
			
				|  | @ -307,6 +312,12 @@ public class WechatController extends WeixinBaseController {
 | 
	
		
			
				|  |  |                 try {
 | 
	
		
			
				|  |  |                     Patient p = patientDao.findByIdcard(idcard);
 | 
	
		
			
				|  |  |                     BusinessLogs.info(BusinessLogs.BusinessType.register, p.getCode(), p.getCode(), new JSONObject(p));
 | 
	
		
			
				|  |  |                     if("1".equals(home)){
 | 
	
		
			
				|  |  |                         List<Patient> patients = patientService.findByMobile(mobile);
 | 
	
		
			
				|  |  |                         for(Patient patient1 :patients){
 | 
	
		
			
				|  |  |                             familyMemberService.addMember(p,patient1.getCode());
 | 
	
		
			
				|  |  |                         }
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                 } catch (Exception e) {
 | 
	
		
			
				|  |  |                     e.printStackTrace();
 | 
	
		
			
				|  |  |                 }
 |