| 
					
				 | 
			
			
				@ -137,9 +137,10 @@ public class MyFamilyService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            messageDO.setSenderPhoto(patientDO.getPhoto()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            messageDO.setTitle("家人绑定"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            messageDO.setMsgDigest(""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            messageDO.setMsgContent(""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String msgContent = familyPatient.getName()+",您好!"+patientDO.getName()+"向您发起添加家人申请,添加成功后,对方可使用您的账号,为您处理各类健康服务。"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            messageDO.setMsgContent(msgContent); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            messageDO.setMsgTypeCode("010801"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            messageDO.setMsgTypeName(""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            messageDO.setMsgTypeName("系统消息-添加家人申请"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            messageDO.setPlatform(platform); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            messageDO.setReadState(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            messageDO.setReadonly(0); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -242,7 +243,7 @@ public class MyFamilyService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param status 1、添加家人(默认),2、邀请登录,3、通过,4、拒绝 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Transactional(rollbackFor = Exception.class) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public Map<String,Object> confirmApply(Integer patientApplyLogId,Integer status,Integer isAuthorize)throws Exception{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public Map<String,Object> confirmApply(Integer patientApplyLogId,Integer status,Integer isAuthorize,Integer messageId)throws Exception{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Map<String,Object> map = new HashedMap(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        PatientApplyLog patientApplyLog = patientApplyLogService.findById(patientApplyLogId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        BasePatientDO apply = patientService.findByIdAndDel(patientApplyLog.getCreateUser()); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -253,23 +254,27 @@ public class MyFamilyService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        patientApplyLog.setStatus(status); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        patientApplyLog.setConfirmTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        patientApplyLogService.save(patientApplyLog); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(status==3){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            BasePatientFamilyMemberDO patientFamilyMember = new BasePatientFamilyMemberDO(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            patientFamilyMember.setPatient(patientApplyLog.getCreateUser()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            patientFamilyMember.setFamilyMember(patientApplyLog.getFamilyMemberCode()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            patientFamilyMember.setFamilyRelation(patientApplyLog.getFamilyBindRole()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            patientFamilyMember.setIsAuthorize(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            patientFamilyMember.setDel(1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            patientFamilyMemberService.save(patientFamilyMember); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            BasePatientFamilyMemberDO patientFamilyMember2 = new BasePatientFamilyMemberDO(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            patientFamilyMember2.setPatient(patientApplyLog.getFamilyMemberCode()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            patientFamilyMember2.setFamilyMember(patientApplyLog.getCreateUser()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            BasePatientDO createUser = patientService.findByIdAndDel(patientApplyLog.getCreateUser()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            patientFamilyMember2.setFamilyRelation(familyRelationTrans(patientApplyLog.getFamilyBindRole(),createUser.getSex())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            patientFamilyMember2.setIsAuthorize(isAuthorize); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            patientFamilyMember2.setDel(1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            patientFamilyMemberService.save(patientFamilyMember2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(status==3||status==4){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            BasePatientFamilyMemberDO patientFamilyMemberDO = patientFamilyMemberService.findByPatientAndFamilyMemberAndDel(patientApplyLog.getCreateUser(),patientApplyLog.getFamilyMemberCode()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if(status==3&&patientFamilyMemberDO==null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                BasePatientFamilyMemberDO patientFamilyMember = new BasePatientFamilyMemberDO(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                patientFamilyMember.setPatient(patientApplyLog.getCreateUser()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                patientFamilyMember.setFamilyMember(patientApplyLog.getFamilyMemberCode()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                patientFamilyMember.setFamilyRelation(patientApplyLog.getFamilyBindRole()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                patientFamilyMember.setIsAuthorize(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                patientFamilyMember.setDel(1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                patientFamilyMemberService.save(patientFamilyMember); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                BasePatientFamilyMemberDO patientFamilyMember2 = new BasePatientFamilyMemberDO(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                patientFamilyMember2.setPatient(patientApplyLog.getFamilyMemberCode()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                patientFamilyMember2.setFamilyMember(patientApplyLog.getFamilyMemberName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                BasePatientDO createUser = patientService.findByIdAndDel(patientApplyLog.getCreateUser()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                patientFamilyMember2.setFamilyRelation(familyRelationTrans(patientApplyLog.getFamilyBindRole(),createUser.getSex())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                patientFamilyMember2.setIsAuthorize(isAuthorize); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                patientFamilyMember2.setDel(1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                patientFamilyMemberService.save(patientFamilyMember2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            messageService.updateStatusById(1,messageId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return map; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -509,7 +514,7 @@ public class MyFamilyService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            BasePatientDO patientDO = patientService.findByIdAndDel(patient);//被绑定人 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            BasePatientDO createPatient = patientService.findByIdAndDel(createUser);//绑定人 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            Integer converRole = familyRelationTrans(bindRole,createPatient.getSex());//转换后的角色 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            map.put("messageId",Integer.valueOf(one.get("id")+"")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            map.put("patientApplyLogId",relationData); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            map.put("patientPhoto",patientDO.getPhoto()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            map.put("applyPatientPhoto",createPatient.getPhoto()); 
			 |