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/controller/PushIntegrationController.java | 6 +- Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/DockingSystemConfigDTO.java | 1 Source/ExampleIntegratedPushCalled/src/main/java/com/vci/ubcs/example/controller/TestCalledIntegrationController.java | 9 +++ Source/UBCS/ubcs-service-api/ubcs-applyjtcodeservice-api/src/main/java/com/vci/ubcs/code/applyjtcodeservice/feign/IMdmInterJtClient.java | 5 + Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java | 4 - Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeDuckingSyncServiceImpl.java | 4 Source/ExampleIntegratedPushCalled/src/main/java/com/vci/ubcs/example/controller/MyServiceTest.java | 7 -- Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/UniversalInterfaceI.java | 1 Source/ExampleIntegratedPushCalled/src/main/java/com/vci/ubcs/example/util/WsClientUtil.java | 61 ++++++++++++++++++++ Source/ExampleIntegratedPushCalled/src/main/java/com/vci/ubcs/example/service/impl/CalledIntegrationServiceImpl.java | 61 +++++++++++++++++++- 10 files changed, 138 insertions(+), 21 deletions(-) diff --git a/Source/ExampleIntegratedPushCalled/src/main/java/com/vci/ubcs/example/controller/MyServiceTest.java b/Source/ExampleIntegratedPushCalled/src/main/java/com/vci/ubcs/example/controller/MyServiceTest.java index 274f185..d7d28ec 100644 --- a/Source/ExampleIntegratedPushCalled/src/main/java/com/vci/ubcs/example/controller/MyServiceTest.java +++ b/Source/ExampleIntegratedPushCalled/src/main/java/com/vci/ubcs/example/controller/MyServiceTest.java @@ -1,15 +1,10 @@ package com.vci.ubcs.example.controller; -import com.alibaba.fastjson.JSONObject; -import com.vci.ubcs.example.util.HttpUtils; import lombok.AllArgsConstructor; -import org.springframework.util.LinkedMultiValueMap; -import org.springframework.util.MultiValueMap; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import java.util.ArrayList; /** * @author ludc @@ -25,7 +20,7 @@ /*MultiValueMap<String, String> params = new LinkedMultiValueMap<>(); params.add("dataType","json"); -// params.add("dataString","data:{object:[{\"classCodde\":\"RENYUAN\",\"itemid\":\"19986015\",\"code\":\"698021151\",\"library\":\"RENYUAN\",\"pro\":[{\"filedName\":\"sfz\",\"outName\":\"韬唤璇乗",\"filedValue\":\"\"}]}]}"); + //params.add("dataString","data:{object:[{\"classCodde\":\"RENYUAN\",\"itemid\":\"19986015\",\"code\":\"698021151\",\"library\":\"RENYUAN\",\"pro\":[{\"filedName\":\"sfz\",\"outName\":\"韬唤璇乗",\"filedValue\":\"\"}]}]}"); NodeJosnDTO nodeJosnDTO = new NodeJosnDTO(); NodedataDTO nodeDataDTO = new NodedataDTO(); NodeObjectDTO nodeObjectDTO = new NodeObjectDTO(); diff --git a/Source/ExampleIntegratedPushCalled/src/main/java/com/vci/ubcs/example/controller/PushIntegrationController.java b/Source/ExampleIntegratedPushCalled/src/main/java/com/vci/ubcs/example/controller/PushIntegrationController.java index fb2630c..e8ab239 100644 --- a/Source/ExampleIntegratedPushCalled/src/main/java/com/vci/ubcs/example/controller/PushIntegrationController.java +++ b/Source/ExampleIntegratedPushCalled/src/main/java/com/vci/ubcs/example/controller/PushIntegrationController.java @@ -17,10 +17,10 @@ import java.util.List; /** - * 缂栫爜璧勬簮绠$悊绯荤粺缁熶竴鎺ㄩ�� - * UBCS缂栫爜璧勬簮绠$悊绯荤粺瀵癸紝 + * 缂栫爜璧勬簮绠$悊绯荤粺瀵瑰叾浠栫郴缁熺殑缁熶竴鎺ㄩ�侊紝琚皟鏂瑰畾涔夋柟寮� + * UBCS缂栫爜璧勬簮绠$悊绯荤粺瀵� * 鍏朵粬闆嗘垚鐨勭郴缁熻繘琛屾帹閫佺殑锛� - * 鎺ㄩ�佹斁api瀹氫箟绀轰緥 + * 鎺ュ彈鎺ㄩ�佺殑api瀹氫箟绀轰緥 * @author ludc * @date 2024/2/27 20:31 */ diff --git a/Source/ExampleIntegratedPushCalled/src/main/java/com/vci/ubcs/example/controller/TestCalledIntegrationController.java b/Source/ExampleIntegratedPushCalled/src/main/java/com/vci/ubcs/example/controller/TestCalledIntegrationController.java index fdec40a..940dee1 100644 --- a/Source/ExampleIntegratedPushCalled/src/main/java/com/vci/ubcs/example/controller/TestCalledIntegrationController.java +++ b/Source/ExampleIntegratedPushCalled/src/main/java/com/vci/ubcs/example/controller/TestCalledIntegrationController.java @@ -1,9 +1,18 @@ package com.vci.ubcs.example.controller; +import lombok.AllArgsConstructor; +import org.springframework.web.bind.annotation.RestController; + /** * 娴嬭瘯璋冪敤缂栫爜绯荤粺浠g爜绀轰緥鐨刟pi瀹氫箟 * @author ludc * @date 2024/2/27 20:34 */ +@AllArgsConstructor +@RestController("/pushIntegration") public class TestCalledIntegrationController { + + + + } 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<>(); + + } } diff --git a/Source/ExampleIntegratedPushCalled/src/main/java/com/vci/ubcs/example/util/WsClientUtil.java b/Source/ExampleIntegratedPushCalled/src/main/java/com/vci/ubcs/example/util/WsClientUtil.java new file mode 100644 index 0000000..9557d73 --- /dev/null +++ b/Source/ExampleIntegratedPushCalled/src/main/java/com/vci/ubcs/example/util/WsClientUtil.java @@ -0,0 +1,61 @@ +package com.vci.ubcs.example.util; + +import org.apache.axiom.om.OMAbstractFactory; +import org.apache.axiom.om.OMElement; +import org.apache.axiom.om.OMFactory; +import org.apache.axiom.om.OMNamespace; +import org.apache.axiom.soap.SOAP11Constants; +import org.apache.axis2.Constants; +import org.apache.axis2.addressing.EndpointReference; +import org.apache.axis2.client.Options; +import org.apache.axis2.client.ServiceClient; +import org.springframework.util.StringUtils; + +public class WsClientUtil { + + /** + * axis2璋冪敤瀹㈡埛绔� + * + * @param url 璇锋眰鏈嶅姟鍦板潃 + * @param nameSpace 鍛藉悕绌洪棿 + * @param method 鏂规硶鍚� + * @param tarName 鍙傛暟鍚嶇О + * @param xmlData 璇锋眰鎶ユ枃 + * @param timeOutInMilliSeconds 瓒呮椂鏃堕棿 + * @return String 绫诲瀷鐨勫搷搴旀姤鎭� + */ + public static String sendMsg(String url, String nameSpace,String soapAction, String method, String tarName, String xmlData, long timeOutInMilliSeconds) throws Exception { + ServiceClient serviceClient = new ServiceClient(); + Options option = new Options(); + option.setSoapVersionURI(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI); + option.setTransportInProtocol(Constants.TRANSPORT_HTTP); + + // 鍊间负targetNamespace+methodName + if(StringUtils.isEmpty(soapAction)){ + soapAction = nameSpace+method; + } + option.setAction(soapAction); + + EndpointReference epfs = new EndpointReference(url); + option.setTo(epfs); + serviceClient.setOptions(option); + + OMFactory fac = OMAbstractFactory.getOMFactory(); + OMNamespace namespaceOM = fac.createOMNamespace(nameSpace, ""); + OMElement element = fac.createOMElement(method, namespaceOM); + OMElement theCityCode = fac.createOMElement(tarName, namespaceOM); + theCityCode.setText(xmlData); + element.addChild(theCityCode); +// OMElement theUserID = fac.createOMElement("theUserID ", namespace); +// theUserID.setText(""); +// element.addChild(theUserID); + + OMElement resultOM = serviceClient.sendReceive(element); + + String result = resultOM.getFirstElement().getText(); + System.out.println(result); + + return result; + } + +} diff --git a/Source/UBCS/ubcs-service-api/ubcs-applyjtcodeservice-api/src/main/java/com/vci/ubcs/code/applyjtcodeservice/feign/IMdmInterJtClient.java b/Source/UBCS/ubcs-service-api/ubcs-applyjtcodeservice-api/src/main/java/com/vci/ubcs/code/applyjtcodeservice/feign/IMdmInterJtClient.java index ddf5d0c..41c3786 100644 --- a/Source/UBCS/ubcs-service-api/ubcs-applyjtcodeservice-api/src/main/java/com/vci/ubcs/code/applyjtcodeservice/feign/IMdmInterJtClient.java +++ b/Source/UBCS/ubcs-service-api/ubcs-applyjtcodeservice-api/src/main/java/com/vci/ubcs/code/applyjtcodeservice/feign/IMdmInterJtClient.java @@ -8,6 +8,7 @@ import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; import java.util.List; @@ -60,8 +61,8 @@ * @param dockingResultVO * @return 杩斿洖瀛樺偍鏄惁鎴愬姛淇℃伅 */ - @GetMapping(RETURNGROUPCODE) - public R getApplyGroupCode( @RequestParam("dockingResultVO") DockingReturnStoreVO dockingResultVO); + @PostMapping(RETURNGROUPCODE) + public R getApplyGroupCode( @RequestBody DockingReturnStoreVO dockingResultVO); /*** * 涓绘暟鎹ā鍨嬭鍥惧彂甯� diff --git a/Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/DockingSystemConfigDTO.java b/Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/DockingSystemConfigDTO.java index 0b29d3b..181afc6 100644 --- a/Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/DockingSystemConfigDTO.java +++ b/Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/DockingSystemConfigDTO.java @@ -22,7 +22,6 @@ */ private static final long serialVersionUID = 4615707120053955466L; - /** * 璁よ瘉鏂瑰紡 */ diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/UniversalInterfaceI.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/UniversalInterfaceI.java index f04be73..fc2d124 100644 --- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/UniversalInterfaceI.java +++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/UniversalInterfaceI.java @@ -18,6 +18,7 @@ @WebService(targetNamespace = "http://code.ubcs.vci.com/",name = "universalInterface") public interface UniversalInterfaceI { + /** * 缁熶竴鐢宠缂栫爜鎺ュ彛 * diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeDuckingSyncServiceImpl.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeDuckingSyncServiceImpl.java index 7a3ca89..0c617d2 100644 --- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeDuckingSyncServiceImpl.java +++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeDuckingSyncServiceImpl.java @@ -118,7 +118,7 @@ @Value("${erp.item.bearer:bearer: Bearer 7fc32939-0a59-da71-a6e6-6b0d37b53e8a}") private String ERPXHDHAUTH; - @Value("${erp.item.url:http://127.0.0.1:8080/api/pp/pp/v1.0}") + @Value("${erp.item.url:http://127.0.0.1/api/pp/pp/ext/extend/v1.0}") private String ERPXHDHURL; @Value("${erp.item.tenant:10000}") @@ -321,7 +321,7 @@ headers.add("X-ECC-Current-Tenant",ERPXHDHTENANT); headers.add("Accept-Language","zh-CHS"); headers.add("Content-Type",MediaType.APPLICATION_JSON.toString()); - String res = HttpUtils.request(ERPXHDHURL+"/getppModelByElem",paramString,headers, HttpMethod.POST,MediaType.APPLICATION_JSON); + String res = HttpUtils.request(ERPXHDHURL+"/getppModelByElemNew",paramString,headers, HttpMethod.POST,MediaType.APPLICATION_JSON); // String res= mdmSearchItemCodeProvider.getppModelByElem(searchItemParam); SearchItemVO searchItemVO = JSONObject.toJavaObject(JSONObject.parseObject(res), SearchItemVO.class); if (searchItemVO != null) { diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java index 7605d5f..6e778e8 100644 --- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java +++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java @@ -2186,7 +2186,6 @@ } } - /** * 澶勭悊鏃堕棿鏍煎紡 * @@ -2213,7 +2212,6 @@ }); } } - /** * 澶勭悊鏋氫妇鐨勫唴瀹癸紝濡傛灉涓嶅湪鏋氫妇涓紝浼氳繑鍥炲師鏈殑鍊� @@ -3007,7 +3005,7 @@ conditionMap = new HashMap<>(); } pageHelper.addDefaultDesc("createTime"); -// pageHelper.addDefaultDesc("id"); + // pageHelper.addDefaultDesc("id"); if (!classifyService.checkHasChild(codeClassifyOid)) { conditionMap.put("t." + CODE_CLASSIFY_OID_FIELD, codeClassifyOid); } else { -- Gitblit v1.9.3