|  | @ -161,4 +161,37 @@ public class WlyyBusinessService {
 | 
	
		
			
				|  |  | //            return users;
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  | //    }
 | 
	
		
			
				|  |  |     
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 根据居民CODE换取居民请求秘钥
 | 
	
		
			
				|  |  |      * @param patientId
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      * @throws Exception
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public String wlyyGetPatientAccetokenByIdcard(String patientId) throws Exception {
 | 
	
		
			
				|  |  |         
 | 
	
		
			
				|  |  |         String idcard = "";
 | 
	
		
			
				|  |  |         String result = "";
 | 
	
		
			
				|  |  |         BasePatientDO basePatientDO = basePatientDao.findById(patientId);
 | 
	
		
			
				|  |  |         if(basePatientDO != null){
 | 
	
		
			
				|  |  |             idcard = basePatientDO.getIdcard();
 | 
	
		
			
				|  |  |     
 | 
	
		
			
				|  |  |             JSONObject param = new JSONObject();
 | 
	
		
			
				|  |  |             param.put("idCard",idcard);
 | 
	
		
			
				|  |  |             JSONObject rs = wlyyHttpService.sendWlyyMes("wlyyGetPatientAccetokenByIdcard",param);
 | 
	
		
			
				|  |  |             if(rs!=null){
 | 
	
		
			
				|  |  |                 Integer status = rs.getInteger("status");
 | 
	
		
			
				|  |  |                 if(200 == status){
 | 
	
		
			
				|  |  |                     JSONObject data = rs.getJSONObject("data");
 | 
	
		
			
				|  |  |                     result = data.getString("patientCode");
 | 
	
		
			
				|  |  |                 }else{
 | 
	
		
			
				|  |  |                     logger.info(rs.toJSONString());
 | 
	
		
			
				|  |  |                     throw new Exception("请求i健康接口失败");
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         }else {
 | 
	
		
			
				|  |  |             throw new Exception("该居民不存在");
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         return result;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | }
 |