From 4b7c60c51ea5e8f137c0c64eddabd90538bb2859 Mon Sep 17 00:00:00 2001 From: ludc <pUXmgxCf6A> Date: 星期四, 18 五月 2023 12:05:09 +0800 Subject: [PATCH] 以及发布webservice接口功能搭建,将通通用接口移植过来 --- Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/UniversalInterfaceImpl.java | 39 +++++-------- Source/UBCS/ubcs-service/ubcs-webservice/pom.xml | 74 ++---------------------- Source/UBCS/ubcs-service/ubcs-code/pom.xml | 5 + Source/UBCS/ubcs-service/ubcs-webservice/src/main/java/com/vci/ubcs/webservice/config/VciCxfPublishConfig.java | 3 + 4 files changed, 31 insertions(+), 90 deletions(-) diff --git a/Source/UBCS/ubcs-service/ubcs-code/pom.xml b/Source/UBCS/ubcs-service/ubcs-code/pom.xml index 0f0edc2..63525fd 100644 --- a/Source/UBCS/ubcs-service/ubcs-code/pom.xml +++ b/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> diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/UniversalInterfaceImpl.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/UniversalInterfaceImpl.java index 7ee87d7..b94025b 100644 --- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/UniversalInterfaceImpl.java +++ b/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("鍙傛暟锛氬垎绫籆Ode:" + classVO.getClassCode()); + log.info("鍙傛暟锛氬垎绫籆Ode:" + 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 ("鏍规嵁浼犺緭鐨勫垎绫伙紝鏈幏鍙朚DM绯荤粺涓搴旀ā鏉�"); } - 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 ("鏍规嵁浼犺緭鐨勫垎绫伙紝鏈幏鍙朚DM绯荤粺涓搴旇鍒�"); } - 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); } /*** diff --git a/Source/UBCS/ubcs-service/ubcs-webservice/pom.xml b/Source/UBCS/ubcs-service/ubcs-webservice/pom.xml index 44f2496..fa73841 100644 --- a/Source/UBCS/ubcs-service/ubcs-webservice/pom.xml +++ b/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> diff --git a/Source/UBCS/ubcs-service/ubcs-webservice/src/main/java/com/vci/ubcs/webservice/config/VciCxfPublishConfig.java b/Source/UBCS/ubcs-service/ubcs-webservice/src/main/java/com/vci/ubcs/webservice/config/VciCxfPublishConfig.java index 0825566..9fa68ec 100644 --- a/Source/UBCS/ubcs-service/ubcs-webservice/src/main/java/com/vci/ubcs/webservice/config/VciCxfPublishConfig.java +++ b/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("寮�濮嬭繘琛岃嚜鍔ㄥ彂甯僿ebService鎺ュ彛"); Map<String, Object> beansWithAnnotation = ApplicationContextProvider.getApplicationContext().getBeansWithAnnotation(VciWebservice.class); if(!CollectionUtils.isEmpty(beansWithAnnotation)){ -- Gitblit v1.9.3