ludc
2024-03-13 30f93a0f5615515df2bfe1fdbbadab0308ca0471
集成相关更改
已修改9个文件
已添加1个文件
159 ■■■■ 文件已修改
Source/ExampleIntegratedPushCalled/src/main/java/com/vci/ubcs/example/controller/MyServiceTest.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ExampleIntegratedPushCalled/src/main/java/com/vci/ubcs/example/controller/PushIntegrationController.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ExampleIntegratedPushCalled/src/main/java/com/vci/ubcs/example/controller/TestCalledIntegrationController.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ExampleIntegratedPushCalled/src/main/java/com/vci/ubcs/example/service/impl/CalledIntegrationServiceImpl.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ExampleIntegratedPushCalled/src/main/java/com/vci/ubcs/example/util/WsClientUtil.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service-api/ubcs-applyjtcodeservice-api/src/main/java/com/vci/ubcs/code/applyjtcodeservice/feign/IMdmInterJtClient.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/DockingSystemConfigDTO.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/UniversalInterfaceI.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeDuckingSyncServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
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();
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
 */
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;
/**
 * æµ‹è¯•调用编码系统代码示例的api定义
 * @author ludc
 * @date 2024/2/27 20:34
 */
@AllArgsConstructor
@RestController("/pushIntegration")
public class TestCalledIntegrationController {
}
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;
/**
 * ç»Ÿä¸€ç”³è¯·æŽ¥å£ï¼šUBCS编码资源管理系统,被其他集成的系统的通用接口调用示例
@@ -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";
    /**
     * å¯¹ç¼–码系统的统一申请接口调用,rest方式
     */
    @Override
    public void sendApplyCodeByRest() {
        // ç»„织数据
        MultiValueMap<String, String> params = new LinkedMultiValueMap<>();
        params.add("dataType","json");
        //params.add("dataType","xml");根据需求自行选择
        params.add("dataString","");//根据需求自行组织json格式或者xml格式的数据
        // æ˜¯xml时的格式示例:
        /*<?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>
         */
        // æ˜¯json时的格式示例
        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);
    }
    /**
     * ç¼–码系统,统一申请接口,用WebService方式调用
     * å¯¹ç¼–码系统统一申请接口调用,WebService方式
     */
    @Override
    public void sendApplyCodeByWebService() {
        MultiValueMap<String, String> params = new LinkedMultiValueMap<>();
        params.add("dataType","json");
        MultiValueMap<String, String> headers = new LinkedMultiValueMap<>();
    }
}
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;
    }
}
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);
    /***
     * ä¸»æ•°æ®æ¨¡åž‹è§†å›¾å‘布
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;
    /**
     * è®¤è¯æ–¹å¼
     */
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 {
    /**
     * ç»Ÿä¸€ç”³è¯·ç¼–码接口
     *
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) {
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 {