ludc
2023-05-18 4b7c60c51ea5e8f137c0c64eddabd90538bb2859
以及发布webservice接口功能搭建,将通通用接口移植过来
已修改4个文件
121 ■■■■ 文件已修改
Source/UBCS/ubcs-service/ubcs-code/pom.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/UniversalInterfaceImpl.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-webservice/pom.xml 74 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-webservice/src/main/java/com/vci/ubcs/webservice/config/VciCxfPublishConfig.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-code/pom.xml
@@ -61,6 +61,11 @@
            <version>3.0.1.RELEASE</version>
            <scope>compile</scope>
        </dependency>
    <!--    <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>-->
    </dependencies>
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/UniversalInterfaceImpl.java
@@ -25,14 +25,10 @@
import com.vci.ubcs.webservice.annotation.VciWebservice;
import com.vci.ubcs.webservice.config.AttributeMapConfig;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import javax.jws.WebService;
import java.util.*;
import java.util.stream.Collectors;
@@ -45,11 +41,6 @@
@Slf4j
@VciWebservice(path = "/universalInterface")
public class UniversalInterfaceImpl<IDockingLogeServiceing> implements UniversalInterfaceI {
    /**
     * 日志
     */
    private Logger logger = LoggerFactory.getLogger(getClass());
    @Autowired(required = false)
    private AttributeMapConfig attributeMapConfig;
@@ -101,8 +92,8 @@
            msg="成功";
            objerrorCode="0";
            objerrorMsg="成功";
            logger.info("申请编码的数据参数:->"+data);
            logger.info("申请编码的数据类型:->"+dataType);
            log.info("申请编码的数据参数:->"+data);
            log.info("申请编码的数据类型:->"+dataType);
            String systemId="";
            List<XMLResultClassfyVO> resultClassfyVOList = new ArrayList<>();
            try {
@@ -141,13 +132,13 @@
                String finalSystemId = systemId;
                classVOList.stream().forEach(classVO -> {
                    logger.info("参数:分类COde:" + classVO.getClassCode());
                    log.info("参数:分类COde:" + classVO.getClassCode());
                    LinkedList<XMLResultDataObjectDetailDO> resultDataObjectDetailDOs = new LinkedList<>();
                    //获取分类信息
                    try {
                        String libray = classVO.getLibrary();
                        CodeClassifyVO codeClassifyVO = getClassfy(classVO);
                        logger.info("end:分类查询完毕");
                        log.info("end:分类查询完毕");
                        //获取分类模板信息
                        if(codeClassifyVO==null || StringUtils.isBlank(codeClassifyVO.getOid())){
                            objerrorCode="100";
@@ -158,18 +149,18 @@
                            objerrorCode="1";
                            throw  new  Throwable ("根据传输的分类,未获取MDM系统中对应模板");
                        }
                        logger.info("end:模板查询完毕");
                        log.info("end:模板查询完毕");
                        ApplyDatasVO applyDatasVO = classVO.getObjects();
                        DataObjectVO dataObjectVO = new DataObjectVO();
                        List<CodeClassifyTemplateAttrVO> attrVOS = templateVO.getAttributes().stream().filter(s -> !DEFAULT_SYNC_ATTR_LIST.contains(s.getId()) && VciBaseUtil.getBoolean(s.getFormDisplayFlag())
                        ).collect(Collectors.toList());
                        this.getConfigDatas(finalSystemId, libray, applyDatasVO, attrVOS, dataObjectVO);
                        logger.info("end:数据组织完毕");
                        log.info("end:数据组织完毕");
                        //规则的主键需要去获取
                        CodeClassifyFullInfoBO classifyFullInfo = classifyService.getClassifyFullInfo(codeClassifyVO.getOid());
                        if(classifyFullInfo==null ||classifyFullInfo.getCurrentClassifyVO()==null || StringUtils.isBlank(classifyFullInfo.getCurrentClassifyVO().getOid())){
                            objerrorCode="1";
                            logger.info("classifyFullInfo:"+"根据传输的分类,未获取分类相关信息");
                            log.info("classifyFullInfo:"+"根据传输的分类,未获取分类相关信息");
                            throw  new  Throwable ("根据传输的分类,未获取分类相关信息");
                        }
                        CodeRuleVO ruleVO = engineService.getCodeRuleByClassifyFullInfo(classifyFullInfo);
@@ -177,14 +168,14 @@
                            objerrorCode="102";
                            throw  new  Throwable ("根据传输的分类,未获取MDM系统中对应规则");
                        }
                        logger.info("end:规则获取完毕");
                        log.info("end:规则获取完毕");
                        List<CodeOrderSecDTO> codeOrderSecDTOList = getRuleCodeOrderSecDTOs(classVO.getSections().getSection(), ruleVO);
                        logger.info("end:码段获取完毕");
                        log.info("end:码段获取完毕");
                        CodeOrderDTO orderDTO = new CodeOrderDTO();
                        orderDTO.setCodeClassifyOid(codeClassifyVO.getOid());//分类主键
                        orderDTO.setSecDTOList(codeOrderSecDTOList);//分类码段
                        //mdmIOService.batchSyncApplyCode(orderDTO, dataObjectVO, resultDataObjectDetailDOs);
                        logger.info("end:申请获取完毕");
                        log.info("end:申请获取完毕");
                    } catch (Throwable e) {
                        XMLResultDataObjectDetailDO xmlResultDataObjectDetailDO=new XMLResultDataObjectDetailDO();
                        xmlResultDataObjectDetailDO.setCode("");
@@ -239,7 +230,7 @@
                    e.printStackTrace();
                }
            }
            logger.info("返回参数:"+resultStr);
            log.info("返回参数:"+resultStr);
            return resultStr;
        }
@@ -338,13 +329,13 @@
            if (!sectype.equals(CodeSecTypeEnum.CODE_SERIAL_SEC.getValue())) {
                String name = codeBasicSecVO.getName();
                String sectypeText = codeBasicSecVO.getSecTypeText();
                logger.info("码段名称:"+name);
                logger.info("描述:"+sectypeText);
                log.info("码段名称:"+name);
                log.info("描述:"+sectypeText);
                CodeOrderSecDTO CodeOrderSecDTO = new CodeOrderSecDTO();
                if (sectionVOMap.containsKey(name)) {
                    CodeOrderSecDTO.setSecOid(codeBasicSecVO.getOid());
                    String sectypeValue = sectionVOMap.get(name);
                    logger.info("码段值:"+sectypeValue);
                    log.info("码段值:"+sectypeValue);
                    CodeOrderSecDTO.setSecValue(sectypeValue);
                    codeOrderSecDTOList.add(CodeOrderSecDTO);
                } else {
@@ -475,7 +466,7 @@
            dockingLoge.setInterfaceStatus("false");//接口集成状态
        }
        dockingLogeService.save(dockingLoge);
        logger.info("集成推送数据成功,systemId:"+systemId+",systemname:"+systemName+",operation:"+operation+",param:"+parmaData);
        log.info("集成推送数据成功,systemId:"+systemId+",systemname:"+systemName+",operation:"+operation+",param:"+parmaData);
    }
    /***
Source/UBCS/ubcs-service/ubcs-webservice/pom.xml
@@ -23,60 +23,13 @@
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-logging</artifactId>
                </exclusion>
               <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>javax.validation</groupId>
                    <artifactId>validation-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>javax.validation</groupId>
            <artifactId>validation-api</artifactId>
            <version>2.0.1.Final</version>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <version>2.17.0</version>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.logging.log4j</groupId>
                    <artifactId>log4j-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-api</artifactId>
            <version>2.17.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-slf4j-impl</artifactId>
            <version>2.17.0</version>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.logging.log4j</groupId>
                    <artifactId>log4j-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.logging.log4j</groupId>
                    <artifactId>log4j-core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-jul</artifactId>
            <version>2.17.0</version>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.logging.log4j</groupId>
                    <artifactId>log4j-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.logging.log4j</groupId>
                    <artifactId>log4j-core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
@@ -90,23 +43,12 @@
    <build>
        <plugins>
            <plugin>
                <groupId>com.spotify</groupId>
                <artifactId>dockerfile-maven-plugin</artifactId>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <username>${docker.username}</username>
                    <password>${docker.password}</password>
                    <repository>${docker.registry.url}/${docker.namespace}/${project.artifactId}</repository>
                    <tag>${project.version}</tag>
                    <useMavenSettingsForAuth>true</useMavenSettingsForAuth>
                    <buildArgs>
                        <JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
                    </buildArgs>
                    <skip>false</skip>
                    <skip>true</skip>
                    <finalName>${project.name}</finalName>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
Source/UBCS/ubcs-service/ubcs-webservice/src/main/java/com/vci/ubcs/webservice/config/VciCxfPublishConfig.java
@@ -32,12 +32,15 @@
    private Bus bus;
    /**
     * 发布站点服务
     * @return 站点服务
     */
    @Bean
    public void autoPushCxf(){
        log.info("开始进行自动发布webService接口");
        Map<String, Object> beansWithAnnotation =   ApplicationContextProvider.getApplicationContext().getBeansWithAnnotation(VciWebservice.class);
        if(!CollectionUtils.isEmpty(beansWithAnnotation)){