From 30f93a0f5615515df2bfe1fdbbadab0308ca0471 Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期三, 13 三月 2024 21:50:16 +0800
Subject: [PATCH] 集成相关更改

---
 Source/ExampleIntegratedPushCalled/src/main/java/com/vci/ubcs/example/service/impl/CalledIntegrationServiceImpl.java |   61 ++++++++++++++++++++++++++++--
 1 files changed, 57 insertions(+), 4 deletions(-)

diff --git a/Source/ExampleIntegratedPushCalled/src/main/java/com/vci/ubcs/example/service/impl/CalledIntegrationServiceImpl.java b/Source/ExampleIntegratedPushCalled/src/main/java/com/vci/ubcs/example/service/impl/CalledIntegrationServiceImpl.java
index 2f5feda..48c593a 100644
--- a/Source/ExampleIntegratedPushCalled/src/main/java/com/vci/ubcs/example/service/impl/CalledIntegrationServiceImpl.java
+++ b/Source/ExampleIntegratedPushCalled/src/main/java/com/vci/ubcs/example/service/impl/CalledIntegrationServiceImpl.java
@@ -1,7 +1,12 @@
 package com.vci.ubcs.example.service.impl;
 
 import com.vci.ubcs.example.service.ICalledIntegrationService;
+import com.vci.ubcs.example.util.HttpUtils;
+import com.vci.ubcs.example.util.WsClientUtil;
+import org.springframework.http.MediaType;
 import org.springframework.stereotype.Service;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
 
 /**
  * 缁熶竴鐢宠鎺ュ彛锛歎BCS缂栫爜璧勬簮绠$悊绯荤粺锛岃鍏朵粬闆嗘垚鐨勭郴缁熺殑閫氱敤鎺ュ彛璋冪敤绀轰緥
@@ -12,19 +17,67 @@
 public class CalledIntegrationServiceImpl implements ICalledIntegrationService {
 
     /**
-     * 缂栫爜绯荤粺锛岀粺涓�鐢宠鎺ュ彛璋冪敤
+     * 缁熶竴鐢宠鎺ュ彛URL
+     */
+    private String UNIAPPLYURL = "http://localhost/ubcs-code/applyCode";
+
+    /**
+     * 鏍囧噯鐢宠鎺ュ彛URL
+     */
+    private String UNIAPPLYBZURL = "http://localhost/ubcs-code/applyCodeBZ";
+
+    /**
+     * 瀵圭紪鐮佺郴缁熺殑缁熶竴鐢宠鎺ュ彛璋冪敤锛宺est鏂瑰紡
      */
     @Override
     public void sendApplyCodeByRest() {
-
-
+        // 缁勭粐鏁版嵁
+        MultiValueMap<String, String> params = new LinkedMultiValueMap<>();
+        params.add("dataType","json");
+        //params.add("dataType","xml");鏍规嵁闇�姹傝嚜琛岄�夋嫨
+        params.add("dataString","");//鏍规嵁闇�姹傝嚜琛岀粍缁噅son鏍煎紡鎴栬�厁ml鏍煎紡鐨勬暟鎹�
+        // 鏄痻ml鏃剁殑鏍煎紡绀轰緥锛�
+        /*<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+            <data systemId="PDM">
+            <user ip="localhost" trueName="pwdfree" userName="pwdfree"/>
+            <classifys>
+            <classify classCode="1045" fullclsfNamePath="" library="10">
+            <sections>
+            <section name="鍒嗙被" value="1045"/>
+            </sections>
+            <objects>
+            <object code="" creator="pwdfree" id="MP.100001" operate="create" status="Released">
+            <prop key="partclassification" text="鍒嗙被" value="1045"/>
+            <prop key="c6e_partClass" text="Part鍒嗙被" value="姣涘澂"/>
+            <prop key="c6e_drawingNo" text="鍥惧彿" value="1000021"/>
+            <prop key="c6e_material" text="鏉愭枡鐗屽彿" value="XXX"/>
+            <prop key="c6e_blankStandard" text="姣涘澂鏍囧噯" value="G235"/>
+            <prop key="c6e_materialStandard" text="鎶�鏈爣鍑�" value="AAAA"/>
+            </object>
+            </objects>
+            </classify>
+            </classifys>
+            </data>
+         */
+        // 鏄痡son鏃剁殑鏍煎紡绀轰緥
+        params.add(
+                "dataString",
+                "\"data\": { \"classifys\": { \"classify\": [ { \"classCode\": \"1025\", \"fullclsfNamePath\": \"\", \"library\": \"10\", \"sections\": { \"section\": [ { \"name\": \"鍒嗙被鍙穃", \"value\": \"1025\" }, { \"name\": \"椤哄簭鍙穃", \"value\": \"\" } ] }, \"obejects\": { \"obeject\": [ { \"code\": \"\", \"id\": \"\", \"status\": \"Released\", \"operate\": \"create\", \"creator\": \"0000\", \"prop\": [ { \"key\": \"name\", \"text\": \"鍚嶇О\", \"value\": \"\" } ] } ] } } ], \"systemId\": \"ERP\", \"user\": { \"ip\": \"127.0.0.1\", \"trueName\": \"00000\", \"userName\": \"test\" } } } "
+        );
+        MultiValueMap<String, String> headers = new LinkedMultiValueMap<>();
+        String res = HttpUtils.post(UNIAPPLYURL,params,headers);
     }
 
     /**
-     * 缂栫爜绯荤粺锛岀粺涓�鐢宠鎺ュ彛,鐢╓ebService鏂瑰紡璋冪敤
+     * 瀵圭紪鐮佺郴缁熺粺涓�鐢宠鎺ュ彛璋冪敤,WebService鏂瑰紡
      */
     @Override
     public void sendApplyCodeByWebService() {
+        MultiValueMap<String, String> params = new LinkedMultiValueMap<>();
+        params.add("dataType","json");
+        MultiValueMap<String, String> headers = new LinkedMultiValueMap<>();
+
+
 
     }
 }

--
Gitblit v1.9.3