|  | @ -90,30 +90,31 @@ public class PatientEndpoint extends EnvelopRestEndpoint {
 | 
												
													
														
															|  |     @ApiOperation("居民注册接口")
 |  |     @ApiOperation("居民注册接口")
 | 
												
													
														
															|  |     @RequestMapping(value = BaseRequestMapping.BasePatient.Regist, method = RequestMethod.POST)
 |  |     @RequestMapping(value = BaseRequestMapping.BasePatient.Regist, method = RequestMethod.POST)
 | 
												
													
														
															|  |     @ResponseBody
 |  |     @ResponseBody
 | 
												
													
														
															|  |     public Envelop regist(@ApiParam(value = "手机号", name = "mobile") @RequestParam(required = true)String mobile ,
 |  | 
 | 
												
													
														
															|  | 
 |  |     public Envelop regist(@ApiParam(value = "手机号", name = "mobile") @RequestParam(required = true) String mobile,
 | 
												
													
														
															|  |                           @ApiParam(value = "验证码", name = "captcha") @RequestParam(value = "captcha", required = true) String captcha,
 |  |                           @ApiParam(value = "验证码", name = "captcha") @RequestParam(value = "captcha", required = true) String captcha,
 | 
												
													
														
															|  |                           @ApiParam(value = "微信openId", name = "openid") @RequestParam(value = "openid", required = false) String openid,
 |  |                           @ApiParam(value = "微信openId", name = "openid") @RequestParam(value = "openid", required = false) String openid,
 | 
												
													
														
															|  |                           @ApiParam(value = "密码", name = "password") @RequestParam(value = "password", required = false) String password) {
 |  |                           @ApiParam(value = "密码", name = "password") @RequestParam(value = "password", required = false) String password) {
 | 
												
													
														
															|  |         Envelop envelop = new Envelop();
 |  |         Envelop envelop = new Envelop();
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |         boolean b = CommonUtils.isMobile(mobile);
 |  |         boolean b = CommonUtils.isMobile(mobile);
 | 
												
													
														
															|  |         if(!b){
 |  | 
 | 
												
													
														
															|  | 
 |  |         if (!b) {
 | 
												
													
														
															|  |             envelop.setMessage("手机号码格式不正确");
 |  |             envelop.setMessage("手机号码格式不正确");
 | 
												
													
														
															|  |             envelop.setStatus(-1);
 |  |             envelop.setStatus(-1);
 | 
												
													
														
															|  |             return envelop;
 |  |             return envelop;
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |         //验证手机是否被注册
 |  |         //验证手机是否被注册
 | 
												
													
														
															|  |         List<BasePatientDO> list = basePatientDao.findByMobileAndDel(mobile,"1");
 |  | 
 | 
												
													
														
															|  |         if(list!=null && list.size()> 0){
 |  | 
 | 
												
													
														
															|  | 
 |  |         List<BasePatientDO> list = basePatientDao.findByMobileAndDel(mobile, "1");
 | 
												
													
														
															|  | 
 |  |         if (list != null && list.size() > 0) {
 | 
												
													
														
															|  |             envelop.setMessage("该手机号已经注册!");
 |  |             envelop.setMessage("该手机号已经注册!");
 | 
												
													
														
															|  |         Map<String, Object> result = patientService.regis(mobile, captcha, password, openid);
 |  | 
 | 
												
													
														
															|  |         if("-1".equals(result.get("code"))){
 |  | 
 | 
												
													
														
															|  |             envelop.setStatus(-1);
 |  | 
 | 
												
													
														
															|  |             envelop.setMessage(result.get("message")+"");
 |  | 
 | 
												
													
														
															|  |         }else{
 |  | 
 | 
												
													
														
															|  |             envelop.setStatus(200);
 |  | 
 | 
												
													
														
															|  |             envelop.setMessage(result.get("message")+"");
 |  | 
 | 
												
													
														
															|  | 
 |  |             Map<String, Object> result = patientService.regis(mobile, captcha, password, openid);
 | 
												
													
														
															|  | 
 |  |             if ("-1".equals(result.get("code"))) {
 | 
												
													
														
															|  | 
 |  |                 envelop.setStatus(-1);
 | 
												
													
														
															|  | 
 |  |                 envelop.setMessage(result.get("message") + "");
 | 
												
													
														
															|  | 
 |  |             } else {
 | 
												
													
														
															|  | 
 |  |                 envelop.setStatus(200);
 | 
												
													
														
															|  | 
 |  |                 envelop.setMessage(result.get("message") + "");
 | 
												
													
														
															|  | 
 |  |             }
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
													
														
															|  |         return envelop;
 |  |         return envelop;
 | 
												
													
														
															|  |     }
 |  |     }
 | 
												
											
												
													
														
															|  | @ -136,21 +137,21 @@ public class PatientEndpoint extends EnvelopRestEndpoint {
 | 
												
													
														
															|  |         Envelop envelop = new Envelop();
 |  |         Envelop envelop = new Envelop();
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |         boolean b = CommonUtils.isMobile(mobile);
 |  |         boolean b = CommonUtils.isMobile(mobile);
 | 
												
													
														
															|  |         if(!b){
 |  | 
 | 
												
													
														
															|  | 
 |  |         if (!b) {
 | 
												
													
														
															|  |             envelop.setMessage("手机号码格式不正确");
 |  |             envelop.setMessage("手机号码格式不正确");
 | 
												
													
														
															|  |             envelop.setStatus(-1);
 |  |             envelop.setStatus(-1);
 | 
												
													
														
															|  |             return envelop;
 |  |             return envelop;
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |         //验证手机是否被注册
 |  |         //验证手机是否被注册
 | 
												
													
														
															|  |         List<BasePatientDO> list = basePatientDao.findByMobileAndDel(mobile,"1");
 |  | 
 | 
												
													
														
															|  |         if(CollectionUtils.isEmpty(list)){
 |  | 
 | 
												
													
														
															|  | 
 |  |         List<BasePatientDO> list = basePatientDao.findByMobileAndDel(mobile, "1");
 | 
												
													
														
															|  | 
 |  |         if (CollectionUtils.isEmpty(list)) {
 | 
												
													
														
															|  |             envelop.setMessage("该手机未注册");
 |  |             envelop.setMessage("该手机未注册");
 | 
												
													
														
															|  |             envelop.setStatus(-1);
 |  |             envelop.setStatus(-1);
 | 
												
													
														
															|  |             return envelop;
 |  |             return envelop;
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |         if(list.size()> 1){
 |  | 
 | 
												
													
														
															|  | 
 |  |         if (list.size() > 1) {
 | 
												
													
														
															|  |             envelop.setMessage("该手机号存在多个账号,请联系管理员");
 |  |             envelop.setMessage("该手机号存在多个账号,请联系管理员");
 | 
												
													
														
															|  |             envelop.setStatus(-1);
 |  |             envelop.setStatus(-1);
 | 
												
													
														
															|  |             return envelop;
 |  |             return envelop;
 | 
												
											
												
													
														
															|  | @ -158,7 +159,7 @@ public class PatientEndpoint extends EnvelopRestEndpoint {
 | 
												
													
														
															|  |         BasePatientDO p = list.get(0);
 |  |         BasePatientDO p = list.get(0);
 | 
												
													
														
															|  |         //用于判断是否登陆成功,若登陆成功,且openId不为空,则更新openId
 |  |         //用于判断是否登陆成功,若登陆成功,且openId不为空,则更新openId
 | 
												
													
														
															|  |         boolean isLogin = false;
 |  |         boolean isLogin = false;
 | 
												
													
														
															|  |         if(org.apache.commons.lang3.StringUtils.isNotBlank(password)){
 |  | 
 | 
												
													
														
															|  | 
 |  |         if (org.apache.commons.lang3.StringUtils.isNotBlank(password)) {
 | 
												
													
														
															|  |             password = rsaService.decryptString(password);
 |  |             password = rsaService.decryptString(password);
 | 
												
													
														
															|  |             password = org.apache.commons.lang3.StringUtils.reverse(password);
 |  |             password = org.apache.commons.lang3.StringUtils.reverse(password);
 | 
												
													
														
															|  |             //生成MD5
 |  |             //生成MD5
 | 
												
											
												
													
														
															|  | @ -166,7 +167,7 @@ public class PatientEndpoint extends EnvelopRestEndpoint {
 | 
												
													
														
															|  |             if (loginPassword.equals(p.getPassword())) {
 |  |             if (loginPassword.equals(p.getPassword())) {
 | 
												
													
														
															|  |                 //使用密码登录成功
 |  |                 //使用密码登录成功
 | 
												
													
														
															|  |                 isLogin = true;
 |  |                 isLogin = true;
 | 
												
													
														
															|  |             }else{
 |  | 
 | 
												
													
														
															|  | 
 |  |             } else {
 | 
												
													
														
															|  |                 //使用密码登录失败
 |  |                 //使用密码登录失败
 | 
												
													
														
															|  |                 envelop.setMessage("密码错误");
 |  |                 envelop.setMessage("密码错误");
 | 
												
													
														
															|  |                 envelop.setStatus(-1);
 |  |                 envelop.setStatus(-1);
 | 
												
											
												
													
														
															|  | @ -175,15 +176,15 @@ public class PatientEndpoint extends EnvelopRestEndpoint {
 | 
												
													
														
															|  |         } else {
 |  |         } else {
 | 
												
													
														
															|  |             //验证码登陆
 |  |             //验证码登陆
 | 
												
													
														
															|  |             int res = baseSmsService.check(mobile, 4, captcha);
 |  |             int res = baseSmsService.check(mobile, 4, captcha);
 | 
												
													
														
															|  |             if(-2 == res){
 |  | 
 | 
												
													
														
															|  | 
 |  |             if (-2 == res) {
 | 
												
													
														
															|  |                 envelop.setMessage("验证码已过期!");
 |  |                 envelop.setMessage("验证码已过期!");
 | 
												
													
														
															|  |                 envelop.setStatus(-1);
 |  |                 envelop.setStatus(-1);
 | 
												
													
														
															|  |                 return envelop;
 |  |                 return envelop;
 | 
												
													
														
															|  |             }else if(-1 == res){
 |  | 
 | 
												
													
														
															|  | 
 |  |             } else if (-1 == res) {
 | 
												
													
														
															|  |                 envelop.setMessage("请输入正确的验证码!");
 |  |                 envelop.setMessage("请输入正确的验证码!");
 | 
												
													
														
															|  |                 envelop.setStatus(-1);
 |  |                 envelop.setStatus(-1);
 | 
												
													
														
															|  |                 return envelop;
 |  |                 return envelop;
 | 
												
													
														
															|  |             }else if(0 == res) {
 |  | 
 | 
												
													
														
															|  | 
 |  |             } else if (0 == res) {
 | 
												
													
														
															|  |                 envelop.setMessage("验证码无效!");
 |  |                 envelop.setMessage("验证码无效!");
 | 
												
													
														
															|  |                 envelop.setStatus(-1);
 |  |                 envelop.setStatus(-1);
 | 
												
													
														
															|  |                 return envelop;
 |  |                 return envelop;
 | 
												
											
												
													
														
															|  | @ -192,10 +193,10 @@ public class PatientEndpoint extends EnvelopRestEndpoint {
 | 
												
													
														
															|  |                 isLogin = true;
 |  |                 isLogin = true;
 | 
												
													
														
															|  |             }
 |  |             }
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
													
														
															|  |         if(isLogin){
 |  | 
 | 
												
													
														
															|  |             if(StringUtils.isNotBlank(openId) && !"undefined".equals(openId)){
 |  | 
 | 
												
													
														
															|  | 
 |  |         if (isLogin) {
 | 
												
													
														
															|  | 
 |  |             if (StringUtils.isNotBlank(openId) && !"undefined".equals(openId)) {
 | 
												
													
														
															|  |                 //更新openId
 |  |                 //更新openId
 | 
												
													
														
															|  |                 if(!openId.equals(p.getOpenid())){
 |  | 
 | 
												
													
														
															|  | 
 |  |                 if (!openId.equals(p.getOpenid())) {
 | 
												
													
														
															|  |                     patientService.updateOpenId(p.getId(), openId);
 |  |                     patientService.updateOpenId(p.getId(), openId);
 | 
												
													
														
															|  |                 }
 |  |                 }
 | 
												
													
														
															|  |             }
 |  |             }
 | 
												
											
												
													
														
															|  | @ -219,10 +220,10 @@ public class PatientEndpoint extends EnvelopRestEndpoint {
 | 
												
													
														
															|  |     public Envelop create(
 |  |     public Envelop create(
 | 
												
													
														
															|  |             @ApiParam(name = "jsonData", value = "Json数据", required = true)
 |  |             @ApiParam(name = "jsonData", value = "Json数据", required = true)
 | 
												
													
														
															|  |             @RequestParam String jsonData) throws Exception {
 |  |             @RequestParam String jsonData) throws Exception {
 | 
												
													
														
															|  |        String msg = patientService.createPatient(jsonData);
 |  | 
 | 
												
													
														
															|  |        if(!StringUtils.equalsIgnoreCase(ConstantUtils.SUCCESS,msg)){
 |  | 
 | 
												
													
														
															|  |            return success(msg);
 |  | 
 | 
												
													
														
															|  |        }
 |  | 
 | 
												
													
														
															|  | 
 |  |         String msg = patientService.createPatient(jsonData);
 | 
												
													
														
															|  | 
 |  |         if (!StringUtils.equalsIgnoreCase(ConstantUtils.SUCCESS, msg)) {
 | 
												
													
														
															|  | 
 |  |             return success(msg);
 | 
												
													
														
															|  | 
 |  |         }
 | 
												
													
														
															|  |         return failed(msg);
 |  |         return failed(msg);
 | 
												
													
														
															|  |     }
 |  |     }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
											
												
													
														
															|  | @ -241,7 +242,7 @@ public class PatientEndpoint extends EnvelopRestEndpoint {
 | 
												
													
														
															|  |             @ApiParam(name = "jsonData", value = "Json数据", required = true)
 |  |             @ApiParam(name = "jsonData", value = "Json数据", required = true)
 | 
												
													
														
															|  |             @RequestParam String jsonData) throws Exception {
 |  |             @RequestParam String jsonData) throws Exception {
 | 
												
													
														
															|  |         String msg = patientService.updatePatient(jsonData);
 |  |         String msg = patientService.updatePatient(jsonData);
 | 
												
													
														
															|  |         if(!StringUtils.equalsIgnoreCase(ConstantUtils.SUCCESS,msg)){
 |  | 
 | 
												
													
														
															|  | 
 |  |         if (!StringUtils.equalsIgnoreCase(ConstantUtils.SUCCESS, msg)) {
 | 
												
													
														
															|  |             return failed(msg);
 |  |             return failed(msg);
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
													
														
															|  |         return success(msg);
 |  |         return success(msg);
 | 
												
											
												
													
														
															|  | @ -297,7 +298,7 @@ public class PatientEndpoint extends EnvelopRestEndpoint {
 | 
												
													
														
															|  |     @ApiOperation(value = "判断身份证是否被占用,false-未占用,true-已占用")
 |  |     @ApiOperation(value = "判断身份证是否被占用,false-未占用,true-已占用")
 | 
												
													
														
															|  |     public Envelop idcardOccupied(@ApiParam(name = "id", value = "居民标识", required = true) @RequestParam String id,
 |  |     public Envelop idcardOccupied(@ApiParam(name = "id", value = "居民标识", required = true) @RequestParam String id,
 | 
												
													
														
															|  |                                   @ApiParam(name = "idcard", value = "居民身份证号", required = true) @RequestParam String idcard) throws Exception {
 |  |                                   @ApiParam(name = "idcard", value = "居民身份证号", required = true) @RequestParam String idcard) throws Exception {
 | 
												
													
														
															|  |         return success(patientService.existsByIdcard(idcard,id));
 |  | 
 | 
												
													
														
															|  | 
 |  |         return success(patientService.existsByIdcard(idcard, id));
 | 
												
													
														
															|  |     }
 |  |     }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |     @PostMapping(value = BaseRequestMapping.BasePatient.completeInfo)
 |  |     @PostMapping(value = BaseRequestMapping.BasePatient.completeInfo)
 |