From 59e2283a10aee45e6a98e34b432ba345095116db Mon Sep 17 00:00:00 2001 From: wujian <14790700720@163.com> Date: 星期三, 10 七月 2024 16:36:42 +0800 Subject: [PATCH] add 选瓦 --- jcdm-main/src/main/java/com/jcdm/main/webservice/service/ReceivingServices.java | 34 +++++++++++++++++++++++++++++++--- 1 files changed, 31 insertions(+), 3 deletions(-) diff --git a/jcdm-main/src/main/java/com/jcdm/main/webservice/service/ReceivingServices.java b/jcdm-main/src/main/java/com/jcdm/main/webservice/service/ReceivingServices.java index 3064159..4230b84 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/webservice/service/ReceivingServices.java +++ b/jcdm-main/src/main/java/com/jcdm/main/webservice/service/ReceivingServices.java @@ -36,14 +36,14 @@ // private static IOmProductionOrdeInfoService omProductionOrdeInfoService; private static IOmProductionOrdeInfoService omProductionOrdeInfoService = BeanUtils.getBean(IOmProductionOrdeInfoService.class); - public static final String ProductionPlanInformationUrl = "http://podqapp.cfmoto.com.cn:50200/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_MES&receiverParty=&receiverService=&interface=SI_ZPP_CF_MES_005_SYN_OUT&interfaceNamespace=http://cfmoto.com/xi/MES"; + public static final String ProductionPlanInformationUrl = "http://podqapp.cfmoto.com.cn:50100/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_MES&receiverParty=&receiverService=&interface=SI_ZPP_CF_MES_005_SYN_OUT&interfaceNamespace=http://cfmoto.com/xi/MES"; public static void main(String[] args) throws Exception { // getInterfaceInformationXml(ProductionPlanInformationUrl,getProductionPlanInformationXml("A0055577")); // test1(); -// String serviceUrl = "http://podqapp.cfmoto.com.cn:50200/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_MES&receiverParty=&receiverService=&interface=SI_ZPP_CF_MES_005_SYN_OUT&interfaceNamespace=http://cfmoto.com/xi/MES"; -// String serviceUrl = "http://podqapp.cfmoto.com.cn:50200/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_MES&receiverParty=&receiverService=&interface=SI_ZPP_CF_BC_001_SYN_OUT&interfaceNamespace=http://cfmoto.com/xi/MES"; +// String serviceUrl = "http://podqapp.cfmoto.com.cn:50100/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_MES&receiverParty=&receiverService=&interface=SI_ZPP_CF_MES_005_SYN_OUT&interfaceNamespace=http://cfmoto.com/xi/MES"; +// String serviceUrl = "http://podqapp.cfmoto.com.cn:50100/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_MES&receiverParty=&receiverService=&interface=SI_ZPP_CF_BC_001_SYN_OUT&interfaceNamespace=http://cfmoto.com/xi/MES"; //// String content = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:urn=\"urn:sap-com:document:sap:rfc:functions\">\n" + //// " <soapenv:Header/>\n" + //// " <soapenv:Body>\n" + @@ -210,6 +210,34 @@ .getAsJsonObject("ET_DATA"); return etData.toString(); } + /** + * 鏂瑰紡--璐� + * 浣跨敤hutool宸ュ叿鍖呬腑鐨勫伐鍏疯浆鍖� + * @param xmlStr + * @return + */ + public static String xmlToJSON1(String xmlStr){ + String status = ""; + if(xmlStr.contains("EV_MESSAGE")){ + JSONObject jsonObject1 = cn.hutool.json.XML.toJSONObject(xmlStr, true); + + ObjectMapper objectMapper = new ObjectMapper(); + JsonNode rootNode = null; + try { + rootNode = objectMapper.readTree(String.valueOf(jsonObject1)); + } catch (JsonProcessingException e) { + throw new RuntimeException(e); + } + String evStatus = rootNode + .path("SOAP:Envelope") + .path("SOAP:Body") + .path("n0:ZPP_BC_001.Response") + .path("EV_MESSAGE") + .asText(); + status = evStatus; + } + return status; + } /** * 鏂瑰紡--璐� -- Gitblit v1.9.3