|  | @ -1,6 +1,7 @@
 | 
	
		
			
				|  |  | package com.yihu.jw.hospital.endpoint.hospital;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | import com.alibaba.fastjson.JSONObject;
 | 
	
		
			
				|  |  | import com.sun.media.jfxmedia.logging.Logger;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.base.doctor.BaseDoctorBackgroundDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.hospital.family.service.PatientMemberDictService;
 | 
	
		
			
				|  |  | import com.yihu.jw.hospital.family.service.WlyyFamilyMemberService;
 | 
	
	
		
			
				|  | @ -9,12 +10,15 @@ import com.yihu.jw.restmodel.web.Envelop;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.web.MixEnvelop;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
 | 
	
		
			
				|  |  | import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
 | 
	
		
			
				|  |  | import com.yihu.jw.sms.service.YkyySMSService;
 | 
	
		
			
				|  |  | import com.yihu.jw.sms.service.ZhongShanSMSService;
 | 
	
		
			
				|  |  | import com.yihu.jw.sms.util.ykyy.vo.ResultMsg;
 | 
	
		
			
				|  |  | import io.swagger.annotations.Api;
 | 
	
		
			
				|  |  | import io.swagger.annotations.ApiOperation;
 | 
	
		
			
				|  |  | import io.swagger.annotations.ApiParam;
 | 
	
		
			
				|  |  | import net.sf.json.JSONArray;
 | 
	
		
			
				|  |  | import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  | import org.springframework.beans.factory.annotation.Value;
 | 
	
		
			
				|  |  | import org.springframework.data.redis.core.RedisTemplate;
 | 
	
		
			
				|  |  | import org.springframework.http.HttpStatus;
 | 
	
		
			
				|  |  | import org.springframework.http.ResponseEntity;
 | 
	
	
		
			
				|  | @ -39,9 +43,13 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  |     private EntranceService entranceService;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private RedisTemplate redisTemplate;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private YkyySMSService ykyySMSService;
 | 
	
		
			
				|  |  |     private final String KEY_SUFFIX = ":code";
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private ZhongShanSMSService zhongShanSMSService;
 | 
	
		
			
				|  |  |     @Value("${wechat.id}")
 | 
	
		
			
				|  |  |     private String wxId;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @ApiOperation("获取家人关系")
 | 
	
		
			
				|  |  |     @PostMapping(value = BaseHospitalRequestMapping.WlyyFamilyMember.findRelationDict)
 | 
	
	
		
			
				|  | @ -81,22 +89,43 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  |             //发送短信获取验证码
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         String captcha = this.getCodeNumber();
 | 
	
		
			
				|  |  |         int result = 1;
 | 
	
		
			
				|  |  |         if (jsonArray.size() > 0) {
 | 
	
		
			
				|  |  |             result = zhongShanSMSService.ZhongShangSendSMS(username, "您好,您当前操作的验证码是:" + captcha + ",2分钟内有效。");
 | 
	
		
			
				|  |  |         } else {
 | 
	
		
			
				|  |  |             result = 2;
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         if (0 == result) {
 | 
	
		
			
				|  |  |             this.store(client_id, username, captcha, 120);
 | 
	
		
			
				|  |  |             mixEnvelop.setMessage("验证码发送成功");
 | 
	
		
			
				|  |  |         } else if (2 == result) {
 | 
	
		
			
				|  |  |             mixEnvelop.setStatus(408);
 | 
	
		
			
				|  |  |             mixEnvelop.setMessage("您所添加的家属无就诊记录,无法发送验证码");
 | 
	
		
			
				|  |  |         } else {
 | 
	
		
			
				|  |  |             mixEnvelop.setMessage("验证码发送失败");
 | 
	
		
			
				|  |  |             mixEnvelop.setStatus(500);
 | 
	
		
			
				|  |  |         if("xm_ykyy_wx".equalsIgnoreCase(wxId)){
 | 
	
		
			
				|  |  |             System.out.println("发送眼科验证码开始");
 | 
	
		
			
				|  |  |             ResultMsg result= null;
 | 
	
		
			
				|  |  |             if (jsonArray.size() > 0) {
 | 
	
		
			
				|  |  |                 result = ykyySMSService.ykyySendSMS(username, "您好,您的此次操作的验证码是:" + captcha + ",2分钟内有效。");
 | 
	
		
			
				|  |  |                 if (result.isSuccess()){
 | 
	
		
			
				|  |  |                     this.store(client_id, username, captcha, 120);
 | 
	
		
			
				|  |  |                     mixEnvelop.setMessage("验证码发送成功");
 | 
	
		
			
				|  |  |                 } else {
 | 
	
		
			
				|  |  |                     mixEnvelop.setMessage("验证码发送失败");
 | 
	
		
			
				|  |  |                     mixEnvelop.setStatus(500);
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |             }else {
 | 
	
		
			
				|  |  |                 mixEnvelop.setStatus(408);
 | 
	
		
			
				|  |  |                 mixEnvelop.setMessage("您所添加的家属无就诊记录,无法发送验证码");
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         }else {
 | 
	
		
			
				|  |  |             System.out.println("发送中山验证码开始");
 | 
	
		
			
				|  |  |             int result = 1;
 | 
	
		
			
				|  |  |             if (jsonArray.size() > 0) {
 | 
	
		
			
				|  |  |                 result = zhongShanSMSService.ZhongShangSendSMS(username, "您好,您当前操作的验证码是:" + captcha + ",2分钟内有效。");
 | 
	
		
			
				|  |  |             } else {
 | 
	
		
			
				|  |  |                 result = 2;
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             if (0 == result) {
 | 
	
		
			
				|  |  |                 this.store(client_id, username, captcha, 120);
 | 
	
		
			
				|  |  |                 mixEnvelop.setMessage("验证码发送成功");
 | 
	
		
			
				|  |  |             } else if (2 == result) {
 | 
	
		
			
				|  |  |                 mixEnvelop.setStatus(408);
 | 
	
		
			
				|  |  |                 mixEnvelop.setMessage("您所添加的家属无就诊记录,无法发送验证码");
 | 
	
		
			
				|  |  |             } else {
 | 
	
		
			
				|  |  |                 mixEnvelop.setMessage("验证码发送失败");
 | 
	
		
			
				|  |  |                 mixEnvelop.setStatus(500);
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         return mixEnvelop;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
	
		
			
				|  | @ -199,7 +228,7 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  |     @ApiOperation("获取单个亲属信息")
 | 
	
		
			
				|  |  |     @PostMapping(value = BaseHospitalRequestMapping.WlyyFamilyMember.findSingleMember)
 | 
	
		
			
				|  |  |     public Envelop findSingleMember(@ApiParam(name = "id", value = "id", required = false)
 | 
	
		
			
				|  |  |                                     @RequestParam(value = "id", required = false) String id) {
 | 
	
		
			
				|  |  |                                     @RequestParam(value = "id", required = false) String id) throws ParseException {
 | 
	
		
			
				|  |  |         return success(wlyyFamilyMemberService.findMemberById(id));
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | }
 |