| 
					
				 | 
			
			
				@ -94,24 +94,7 @@ public class MyFamilyService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        BasePatientDO familyPatient = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        //3、生成申请绑定的记录,二维码 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        PatientApplyLog patientApplyLog = new PatientApplyLog(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        patientApplyLog.setPatientFamilyMemberName(familyPatient.getName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        patientApplyLog.setPatienyFamilyMemberCode(familyPatient.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String scene ="family_"+patient+"_"+familyPatient.getId(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String qrCode = weChatQrcodeService.getQrcode(request,wechatId, scene); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(StringUtils.isEmpty(qrCode)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            throw new Exception("qrCode is null"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        patientApplyLog.setQrCode(qrCode); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Long time = 1000*60*60*Long.valueOf(qrCodeFailurTime); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Long failurTime = (new Date()).getTime()+time; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        patientApplyLog.setFailureTime(new Date(failurTime)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        patientApplyLog.setDel(1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        patientApplyLog.setCreateTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        patientApplyLog.setCreateUser(patient); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        patientApplyLog.setCreateUserName(patientDO.getName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        patientApplyLogService.save(patientApplyLog); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        createFamilyQrCode(request,familyPatient,wechatId,patient); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        //4、发送绑定家人的系统消息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        BaseMessageDO messageDO = new BaseMessageDO(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        messageDO.setSaasId(saasId); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -134,7 +117,36 @@ public class MyFamilyService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        messageService.save(messageDO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 生成绑定家人的二维码 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param request 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param familyPatient 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param wechatId 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param patient 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @throws Exception 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public String createFamilyQrCode(HttpServletRequest request,BasePatientDO familyPatient,String wechatId, String patient) throws Exception{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        BasePatientDO patientDO = patientService.findByIdAndDel(patient); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        PatientApplyLog patientApplyLog = new PatientApplyLog(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        patientApplyLog.setPatientFamilyMemberName(familyPatient.getName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        patientApplyLog.setPatienyFamilyMemberCode(familyPatient.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String scene ="family_"+familyPatient.getId()+"_"+familyPatient.getId(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String qrCode = weChatQrcodeService.getQrcode(request,wechatId, scene); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(StringUtils.isEmpty(qrCode)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            throw new Exception("qrCode is null"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        patientApplyLog.setQrCode(qrCode); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Long time = 1000*60*60*Long.valueOf(qrCodeFailurTime); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Long failurTime = (new Date()).getTime()+time; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        patientApplyLog.setFailureTime(new Date(failurTime)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        patientApplyLog.setDel(1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        patientApplyLog.setCreateTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        patientApplyLog.setCreateUser(familyPatient.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        patientApplyLog.setCreateUserName(patientDO.getName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        patientApplyLogService.save(patientApplyLog); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return qrCode; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 |