|  | @ -2,7 +2,10 @@ package com.yihu.hos.gateway.util;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | import com.yihu.hos.config.Config;
 | 
	
		
			
				|  |  | import com.yihu.hos.resource.util.httpclient.HttpClientUtil;
 | 
	
		
			
				|  |  | import com.yihu.openplatform.service.AppKeyService;
 | 
	
		
			
				|  |  | import com.yihu.wsgw.api.ServiceBus;
 | 
	
		
			
				|  |  | import net.sf.json.JSONObject;
 | 
	
		
			
				|  |  | import org.apache.axis2.addressing.EndpointReference;
 | 
	
		
			
				|  |  | import org.apache.axis2.client.Options;
 | 
	
		
			
				|  |  | import org.apache.axis2.rpc.client.RPCServiceClient;
 | 
	
	
		
			
				|  | @ -10,6 +13,8 @@ import org.apache.axis2.rpc.client.RPCServiceClient;
 | 
	
		
			
				|  |  | import javax.xml.namespace.QName;
 | 
	
		
			
				|  |  | import java.text.SimpleDateFormat;
 | 
	
		
			
				|  |  | import java.util.Date;
 | 
	
		
			
				|  |  | import java.util.HashMap;
 | 
	
		
			
				|  |  | import java.util.Map;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | /**
 | 
	
		
			
				|  |  |  * Created by Administrator on 2016/4/18.
 | 
	
	
		
			
				|  | @ -98,8 +103,8 @@ public class RPCUtil {
 | 
	
		
			
				|  |  |         //		apiName = "ZEUS.HosHOPWs.QueryUserInfo";
 | 
	
		
			
				|  |  |        //		param = "<Req><TransactionCode>5003</TransactionCode><Data><CardType>1</CardType><CardNo>000021341249</CardNo><Mobile></Mobile><PatientId></PatientId></Data></Req>";
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |        apiName = "ZEUS.HosHOPWs.QueryRegInfo";
 | 
	
		
			
				|  |  |        param = "<Req><TransactionCode>5003</TransactionCode><Data><CardType>1</CardType><CardNo>6001</CardNo><IdCardNo>123123</IdCardNo><OrderId>订单号</OrderId><ClinicCard>就诊卡号</ClinicCard><TimeSlice>就诊时段</TimeSlice><StartTime>就诊日期开始</StartTime><EndTime>就诊日期结束</EndTime><RegFlag>1-预约 2-当天挂号</RegFlag></Data></Req>" ;
 | 
	
		
			
				|  |  |        //apiName = "ZEUS.HosHOPWs.QueryRegInfo";
 | 
	
		
			
				|  |  |        //param = "<Req><TransactionCode>5003</TransactionCode><Data><CardType>1</CardType><CardNo>6001</CardNo><IdCardNo>123123</IdCardNo><OrderId>订单号</OrderId><ClinicCard>就诊卡号</ClinicCard><TimeSlice>就诊时段</TimeSlice><StartTime>就诊日期开始</StartTime><EndTime>就诊日期结束</EndTime><RegFlag>1-预约 2-当天挂号</RegFlag></Data></Req>" ;
 | 
	
		
			
				|  |  |        // param = "<Req><TransactionCode>5003</TransactionCode><Data><StartTime>2016-04-08</StartTime></Data></Req>" ;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         //挂号事件推送
 | 
	
	
		
			
				|  | @ -113,22 +118,51 @@ public class RPCUtil {
 | 
	
		
			
				|  |  |         //		apiName = "ZEUS.HosHOPWs.QueryHospital";
 | 
	
		
			
				|  |  |         //		param = "<Req><TransactionCode></TransactionCode><Data><HosId>944</HosId></Data></Req>";
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             String apiparam = "{\"ChannelId\"=\"100123\"," + "\"ParamType\"=1,"
 | 
	
		
			
				|  |  |                     + "\"Params\"=\"" + param + "\"," + "\"Guid\"=\""
 | 
	
		
			
				|  |  |                     + "00000001111111" + "\"," + "\"V\"=\"3.0.0\","
 | 
	
		
			
				|  |  |                     + "\"OutType\"=1," + "\"HospitalId\"=\"1026333\"}";
 | 
	
		
			
				|  |  |             String result = null;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             try {
 | 
	
		
			
				|  |  |                 result = ServiceBus.getInstance(
 | 
	
		
			
				|  |  |                         "172.18.20.21:2181",
 | 
	
		
			
				|  |  |                        "EsbCloud")
 | 
	
		
			
				|  |  |                         .call(apiName, apiparam);
 | 
	
		
			
				|  |  |             } catch (Exception e) {
 | 
	
		
			
				|  |  |                 // TODO Auto-generated catch block
 | 
	
		
			
				|  |  |                 e.printStackTrace();
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             System.out.println("result=" + result);
 | 
	
		
			
				|  |  |         //处方审阅成功推送
 | 
	
		
			
				|  |  | //        apiName = "ZEUS.HosHOPWs.PushReport";
 | 
	
		
			
				|  |  | //        param = "<Req><TransactionCode></TransactionCode><Data><orgCode>orgCode</orgCode><eventNo>eventNo</eventNo><patientId>patientId</patientId></Data></Req>";
 | 
	
		
			
				|  |  | //
 | 
	
		
			
				|  |  | //
 | 
	
		
			
				|  |  | //        String apiparam = "{\"ChannelId\"=\"100123\"," + "\"ParamType\"=1,"
 | 
	
		
			
				|  |  | //                    + "\"Params\"=\"" + param + "\"," + "\"Guid\"=\""
 | 
	
		
			
				|  |  | //                    + "00000001111111" + "\"," + "\"V\"=\"3.0.0\","
 | 
	
		
			
				|  |  | //                    + "\"OutType\"=1," + "\"HospitalId\"=\"1026333\"}";
 | 
	
		
			
				|  |  | //            String result = null;
 | 
	
		
			
				|  |  | //
 | 
	
		
			
				|  |  | //            try {
 | 
	
		
			
				|  |  | //                result = ServiceBus.getInstance(
 | 
	
		
			
				|  |  | //                        "172.18.20.21:2181",
 | 
	
		
			
				|  |  | //                       "EsbCloud")
 | 
	
		
			
				|  |  | //                        .call(apiName, apiparam);
 | 
	
		
			
				|  |  | //            } catch (Exception e) {
 | 
	
		
			
				|  |  | //                // TODO Auto-generated catch block
 | 
	
		
			
				|  |  | //                e.printStackTrace();
 | 
	
		
			
				|  |  | //            }
 | 
	
		
			
				|  |  | //            System.out.println("result=" + result);
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         AppKeyService.init(null,3);
 | 
	
		
			
				|  |  |         AppKeyService.setDebug(true);
 | 
	
		
			
				|  |  |         HashMap<String, String> paramMap=new HashMap();
 | 
	
		
			
				|  |  |         paramMap.put("type","35");//表示属于咨询的推送
 | 
	
		
			
				|  |  |        // paramMap.put("appId","EsbCloud");//表示属于咨询的推送
 | 
	
		
			
				|  |  |         paramMap.put("timestamp",new Date().getTime()+"");//表示属于咨询的推送
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         JSONObject jsonData=new JSONObject();//构造推送的数据
 | 
	
		
			
				|  |  |         jsonData.put("operation", "1");
 | 
	
		
			
				|  |  |         jsonData.put("uniqueId", "11113");
 | 
	
		
			
				|  |  |         jsonData.put("org_code", "1026333");
 | 
	
		
			
				|  |  |         jsonData.put("event_no", "11113");
 | 
	
		
			
				|  |  |         jsonData.put("patientId", "11113");
 | 
	
		
			
				|  |  |         paramMap.put("data", jsonData.toString());
 | 
	
		
			
				|  |  |         Map result;
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             result = AppKeyService.postToAllThirdParty(paramMap,"EsbCloud");  //paramMap为需要推送的参数,myt为调用者的appId
 | 
	
		
			
				|  |  |             System.out.println(result);
 | 
	
		
			
				|  |  |         } catch (Exception e) {
 | 
	
		
			
				|  |  |             e.printStackTrace();
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | }
 |