From 0e3cac8d5d9603cdd5ff8935e4054f0018a35ed9 Mon Sep 17 00:00:00 2001
From: wujian <14790700720@163.com>
Date: 星期日, 28 四月 2024 15:08:56 +0800
Subject: [PATCH] change model10

---
 jcdm-main/src/main/java/com/jcdm/main/webservice/service/ReceivingServices.java |   73 +++++++++++++++++++++++++++++-------
 1 files changed, 59 insertions(+), 14 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 af08e28..e0c7c4a 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
@@ -2,6 +2,9 @@
 
 
 import cn.hutool.json.JSONObject;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
 import com.google.gson.Gson;
 import com.google.gson.JsonObject;
 import com.jcdm.main.da.collectionParamConf.service.IDaCollectionParamConfService;
@@ -33,23 +36,35 @@
 //    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: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" +
+////                "      <urn:ZPP_CF_MES_005>\n" +
+////                "         <!--Optional:-->\n" +
+////                "         <IV_WERKS>1000</IV_WERKS>\n" +
+////                "         <!--Optional:-->\n" +
+////                "         <IV_ZSCTZD>A0055577</IV_ZSCTZD>\n" +
+////                "      </urn:ZPP_CF_MES_005>\n" +
+////                "   </soapenv:Body>\n" +
+////                "</soapenv:Envelope>";
 //        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" +
-//                "      <urn:ZPP_CF_MES_005>\n" +
-//                "         <!--Optional:-->\n" +
-//                "         <IV_WERKS>1000</IV_WERKS>\n" +
-//                "         <!--Optional:-->\n" +
-//                "         <IV_ZSCTZD>A0055577</IV_ZSCTZD>\n" +
-//                "      </urn:ZPP_CF_MES_005>\n" +
+//                "      <urn:ZPP_BC_001>\n" +
+//                "         <IV_AUFNR>000010569212</IV_AUFNR>\n" +
+//                "          <IV_VORNR>0010</IV_VORNR>\n" +
+//                "           <IV_LMNGA>1</IV_LMNGA>\n" +
+//                "           <IV_XMNGA>0</IV_XMNGA>   \n" +
+//                "         <IV_STATU>1</IV_STATU>  \n" +
+//                "      </urn:ZPP_BC_001>\n" +
 //                "   </soapenv:Body>\n" +
 //                "</soapenv:Envelope>";
 //        // HttpClient鍙戦�丼OAP璇锋眰
@@ -79,10 +94,10 @@
 //            InputStream is = postMethod.getResponseBodyAsStream();
 //            // 鑾峰彇璇锋眰缁撴灉瀛楃涓�
 //            String result = IOUtils.toString(is);
-//            String jsonStr = xmlToJSON2(result);
-//            Gson gson = new Gson();
-//            // 灏唈son瀛楃涓茶浆鎹㈡垚瀵硅薄
-//            ItemList itemList = gson.fromJson(jsonStr, ItemList.class);
+////            String jsonStr = xmlToJSON2(result);
+////            Gson gson = new Gson();
+////            // 灏唈son瀛楃涓茶浆鎹㈡垚瀵硅薄
+////            ItemList itemList = gson.fromJson(jsonStr, ItemList.class);
 //            System.out.println("杩斿洖缁撴灉:" + result);
 //        } else {
 //            System.out.println("閿欒浠g爜锛�" + status + ":" + postMethod.getResponseBodyAsString());
@@ -105,7 +120,8 @@
             ordeInfo.setProductionNotice(item.getZSCTZD());
             ordeInfo.setTypeZ(item.getFERTH());
             ordeInfo.setCreateUser(item.getZUSER());
-            ordeInfo.setCreateTime(item.getZDATE());
+            //ordeInfo.setCreateTime(item.getZDATE());
+            ordeInfo.setDemandDate(item.getGSTRP());//寮�宸ユ棩鏈�
             omProductionOrdeInfoService.insertOmProductionOrdeInfo(ordeInfo);
         }
     }
@@ -195,4 +211,33 @@
         return etData.toString();
     }
 
+    /**
+     * 鏂瑰紡--璐�
+     * 浣跨敤hutool宸ュ叿鍖呬腑鐨勫伐鍏疯浆鍖�
+     * @param xmlStr
+     * @return
+     */
+    public static String xmlToJSON3(String xmlStr){
+        String status = "";
+        if(xmlStr.contains("EV_STATUS")){
+            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_STATUS")
+                    .asText();
+            status = evStatus;
+        }
+        return status;
+    }
+
 }

--
Gitblit v1.9.3