Kaynağa Gözat

把参数抽取出来

chenweida 9 yıl önce
ebeveyn
işleme
d092c0f97a

+ 1 - 1
Hos-Resource-Rest/src/main/java/com/yihu/hos/config/Config.java

@ -15,5 +15,5 @@ public class Config {
    public static String monogoUrl;
    public static String startCollect;
    public static String port;
    public static String channelId;
}

+ 4 - 16
Hos-Resource-Rest/src/main/java/com/yihu/hos/gateway/control/rpc/impl/ResourceRpcImpl.java

@ -104,14 +104,8 @@ public class ResourceRpcImpl implements IResourceRpc {
    //查询病人基本信息
    private void patientInformation(String cardNo, String cardType, String patientId,String hospitalId) throws Exception {
        String param = "<Req><TransactionCode>1001</TransactionCode>" +
                "<Data>" +
                "<CardType>" + cardType + "</CardType>" +
                "<CardNo>" + cardNo + "</CardNo>" +
                "<PatientId>" + patientId + "</PatientId>" +
                "</Data>" +
                "</Req>";
        String apiparam = "{\"ChannelId\"=\"100123\"," +
        String param = "<Req><TransactionCode>5001</TransactionCode><Data><CardType>" + cardType + "</CardType><CardNo>" + cardNo + "</CardNo><PatientId>" + patientId + "</PatientId></Data></Req>";
        String apiparam = "{\"ChannelId\"=\"\"+Config.channelId+\"\"," +
                "\"ParamType\"=1," +
                "\"Params\"=\"" + param + "\"," +
                "\"Guid\"=\"" + "00000001111111" + "\"," +
@ -155,14 +149,8 @@ public class ResourceRpcImpl implements IResourceRpc {
    private void pushreport(String reportType, String reportId, String cardNo, String cardType, String hospitalId) throws Exception {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
        String data =
                "<Req>" +
                        "<TransactionCode></TransactionCode>" +
                        "<Data>" +
                        "<ReportId>" + reportId + "</ReportId>" +
                        "<ReportType>" + reportType + "</ReportType>" +
                        "</Data>" +
                        "</Req>";
        String apiparam = "{\"ChannelId\"=\"100123\"," +
                "<Req><TransactionCode>5001</TransactionCode><Data><ReportId>" + reportId + "</ReportId><ReportType>" + reportType + "</ReportType></Data></Req>";
        String apiparam = "{\"ChannelId\"=\"\"+Config.channelId+\"\"," +
                "\"ParamType\"=1," +
                "\"Params\"=\"" + data + "\"," +
                "\"Guid\"=\"" + "00000001111111" + "\"," +

+ 9 - 8
Hos-Resource-Rest/src/main/java/com/yihu/hos/gateway/util/RPCUtil.java

@ -19,8 +19,8 @@ public class RPCUtil {
        String SERVER_URL = Config.url;
        String appId = Config.appId;
        return ServiceBus.getInstance(
                "172.18.20.123:8085",
                "EsbCloud").call(apiName, apiparam);
                Config.url,
                Config.appId).call(apiName, apiparam);
    }
    /**
@ -79,16 +79,17 @@ public class RPCUtil {
    }
*/
    /**
     *
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        String apiName="ZEUS.HosHOPWs.GetReportInfo";
        String apiName = "ZEUS.HosHOPWs.GetReportInfo";
        String param = "";
        param = "<Req><TransactionCode>5001</TransactionCode><Data><ReportId>8F5F14C2-FAB8-4CB5-BB91-AECF0EC64E69</ReportId><ReportType>1</ReportType></Data></Req>";
         String apiparam = "{\"ChannelId\"=\"100123\"," +
        apiName = "ZEUS.HosHOPWs.GetReportInfo";
        String param = "<Req><TransactionCode>5001</TransactionCode><Data><ReportId>201405228-A-110B</ReportId><ReportType>0</ReportType></Data></Req>";
        String apiparam = "{\"ChannelId\"=\"" + Config.channelId + "\"," +
                "\"ParamType\"=1," +
                "\"Params\"=\"" + param + "\"," +
                "\"Guid\"=\"" + "00000001111111" + "\"," +
@ -100,12 +101,12 @@ public class RPCUtil {
            result = ServiceBus.getInstance(
                    "172.18.20.21:2181",
                    "EsbCloud").call(apiName, apiparam);
            System.out.println("返回的数据:"+result);
            System.out.println("返回的数据:" + result);
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        System.out.println("result="+result);
        System.out.println("result=" + result);
    }
    /*
    public static void main(String[] args) {

+ 2 - 0
Hos-Resource-Rest/src/main/java/com/yihu/hos/resource/base/App.java

@ -86,8 +86,10 @@ public class App {
        Config.url = prop.getProperty("rpc.url");
        Config.appId = prop.getProperty("rpc.appId");
        Config.port = prop.getProperty("rpc.port");
        Config.port = prop.getProperty("rpc.channelId");
        Config.monogoUrl = prop.getProperty("http.monogourl");
        Config.startCollect = prop.getProperty("http.startCollect");
    }
    /**
     * spring boot 定时任务

+ 2 - 1
Hos-Resource-Rest/src/main/resources/rpc.properties

@ -1,6 +1,7 @@
rpc.port=8081
rpc.url=172.18.20.123:8085
rpc.appId=EsbCloud
rpc.channelId=100123
rpc.port=8081
http.monogourl=http://localhost:8080/datapush/datapush
http.startCollect=http://localhost:8080/crawler/patient