Commit 0941f6f6 authored by 李成龙's avatar 李成龙

优化特种设备数据对接

parent c6affcf2
...@@ -7,72 +7,13 @@ ...@@ -7,72 +7,13 @@
<version>1.0.0</version> <version>1.0.0</version>
</parent> </parent>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-data-common</artifactId> <artifactId>amos-boot-data-common</artifactId>
<version>1.0.0</version>
<name>amos-boot-data-common</name> <name>amos-boot-data-common</name>
<!-- FIXME change it to the project's website -->
<url>http://www.example.com</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
<dependencies> <dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies> </dependencies>
<build>
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins>
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
</plugin>
<plugin>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.0.0</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project> </project>
...@@ -9,31 +9,46 @@ ...@@ -9,31 +9,46 @@
<version>1.0.0</version> <version>1.0.0</version>
</parent> </parent>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-data-openapi</artifactId> <artifactId>amos-boot-data-openapi</artifactId>
<version>1.0.0</version>
<name>amos-boot-data-openapi</name> <name>amos-boot-data-openapi</name>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>com.amosframework.boot</groupId> <groupId>org.springframework.cloud</groupId>
<artifactId>amos-boot-biz-common</artifactId> <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
<version>${amos-biz-boot.version}</version> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.typroject</groupId> <groupId>org.typroject</groupId>
<artifactId>tyboot-component-event</artifactId> <artifactId>tyboot-core-foundation</artifactId>
<version>${tyboot-version}</version>
</dependency>
<dependency>
<groupId>org.typroject</groupId>
<artifactId>tyboot-core-restful</artifactId>
<version>${tyboot-version}</version> <version>${tyboot-version}</version>
<exclusions> <exclusions>
<exclusion> <exclusion>
<groupId>org.typroject</groupId> <groupId>org.typroject</groupId>
<artifactId>*</artifactId> <artifactId>*</artifactId>
</exclusion> </exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.typroject</groupId>
<artifactId>tyboot-core-auth</artifactId>
<version>${tyboot-version}</version>
<exclusions>
<exclusion> <exclusion>
<groupId>io.springfox</groupId> <groupId>org.typroject</groupId>
<artifactId>springfox-swagger2</artifactId> <artifactId>*</artifactId>
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
...@@ -44,6 +59,17 @@ ...@@ -44,6 +59,17 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.typroject</groupId> <groupId>org.typroject</groupId>
<artifactId>tyboot-component-event</artifactId>
<version>${tyboot-version}</version>
<exclusions>
<exclusion>
<groupId>org.typroject</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.typroject</groupId>
<artifactId>tyboot-component-opendata</artifactId> <artifactId>tyboot-component-opendata</artifactId>
<version>${tyboot-version}</version> <version>${tyboot-version}</version>
<exclusions> <exclusions>
...@@ -53,11 +79,62 @@ ...@@ -53,11 +79,62 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.yeejoin</groupId> <groupId>com.yeejoin</groupId>
<artifactId>amos-feign-systemctl</artifactId> <artifactId>amos-feign-systemctl</artifactId>
<version>${amos.version}</version> <version>${amos.version}</version>
</dependency> </dependency>
<dependency>
<groupId>com.yeejoin</groupId>
<artifactId>amos-component-config</artifactId>
<version>${amos.version}</version>
</dependency>
<dependency>
<groupId>org.typroject</groupId>
<artifactId>tyboot-core-rdbms</artifactId>
<version>${tyboot-version}</version>
<exclusions>
<exclusion>
<groupId>org.typroject</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.typroject</groupId>
<artifactId>tyboot-component-cache</artifactId>
<version>${tyboot-version}</version>
<exclusions>
<exclusion>
<groupId>org.typroject</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-redis</artifactId>
<version>1.4.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>19.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.codehaus.jettison</groupId>
<artifactId>jettison</artifactId>
<version>1.3.7</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
<plugins> <plugins>
......
//package com.yeejoin.amos.api.openapi.aop; package com.yeejoin.amos.api.openapi.aop;
//
//import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
//
//import org.aspectj.lang.JoinPoint; import org.aspectj.lang.JoinPoint;
//import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Aspect;
//import org.aspectj.lang.annotation.Before; import org.aspectj.lang.annotation.Before;
//import org.aspectj.lang.annotation.Pointcut; import org.aspectj.lang.annotation.Pointcut;
//import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.core.annotation.Order; import org.springframework.core.annotation.Order;
//import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
//import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
//import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.RequestContextHolder;
//import org.springframework.web.context.request.ServletRequestAttributes; import org.springframework.web.context.request.ServletRequestAttributes;
//import org.typroject.tyboot.component.cache.Redis; import org.typroject.tyboot.component.cache.Redis;
//import org.typroject.tyboot.core.auth.exception.AuthException; import org.typroject.tyboot.core.auth.exception.AuthException;
//import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
//import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
//
//import com.yeejoin.amos.api.openapi.constant.Constant; import com.yeejoin.amos.api.openapi.constant.Constant;
//import com.yeejoin.amos.api.openapi.face.model.BizTokenModel; import com.yeejoin.amos.api.openapi.face.model.BizTokenModel;
//import com.yeejoin.amos.component.feign.config.TokenOperation; import com.yeejoin.amos.component.feign.config.TokenOperation;
//
//@Aspect @Aspect
//@Component @Component
//@Order(value = 0) @Order(value = 0)
//public class ControllerAop { public class ControllerAop {
//
// @Autowired @Autowired
// private RedisTemplate redisTemplate; private RedisTemplate redisTemplate;
//
// @Pointcut("(execution(public * com.yeejoin.amos.api.openapi.controller..*(..))) ") @Pointcut("(execution(public * com.yeejoin.amos.api.openapi.controller..*(..))) ")
// public void userCache() { public void userCache() {
//
// } }
//
// @Before("userCache()") @Before("userCache()")
// public void doBefore(JoinPoint joinPoint) { public void doBefore(JoinPoint joinPoint) {
// ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
// HttpServletRequest request = attributes.getRequest(); HttpServletRequest request = attributes.getRequest();
// // 不需要添加请求头的接口 // 不需要添加请求头的接口
// String[] url = new String[]{"/api/user/selectInfo", "/api/user/save/curCompany","/openapi/bizToken/applyToken","/openapi/bizToken/getAppId","/lift/upload","/lift/status","/lift/run","/lift/fault","/lift/video/preview"}; String[] url = new String[]{"/api/user/selectInfo", "/api/user/save/curCompany","/openapi/bizToken/applyToken","/openapi/bizToken/getAppId","/lift/upload","/lift/status","/lift/run","/lift/fault","/lift/video/preview"};
// // 获取请求路径 // 获取请求路径
// for(String uri : url) { for(String uri : url) {
// if(request.getRequestURI().indexOf(uri) != -1) { if(request.getRequestURI().indexOf(uri) != -1) {
// return; return;
// } }
// } }
// //TODO tyboot 框架拦截器已缓存数据 //TODO tyboot 框架拦截器已缓存数据
// String token = RequestContext.getToken(); String token = RequestContext.getToken();
// if (ValidationUtil.isEmpty(token)) { if (ValidationUtil.isEmpty(token)) {
// token = request.getParameterMap().get("access_token")[0]; token = request.getParameterMap().get("access_token")[0];
// } }
// if (token != null) { if (token != null) {
// fillRequestContext(token); fillRequestContext(token);
// } }
// boolean validToken = TokenOperation.refresh(token); boolean validToken = TokenOperation.refresh(token);
// if(!validToken) { if(!validToken) {
// throw new AuthException("请求未包含认证信息."); throw new AuthException("请求未包含认证信息.");
// } }
// } }
//
//
// private void fillRequestContext(String token) { private void fillRequestContext(String token) {
// String tokenKey = Redis.genKey(Constant.TOKEN_PREFIX,token); String tokenKey = Redis.genKey(Constant.TOKEN_PREFIX,token);
// BizTokenModel bizTokenModel = (BizTokenModel) redisTemplate.opsForValue().get(tokenKey); BizTokenModel bizTokenModel = (BizTokenModel) redisTemplate.opsForValue().get(tokenKey);
// if(null == bizTokenModel) { if(null == bizTokenModel) {
// throw new AuthException("请求未包含认证信息."); throw new AuthException("请求未包含认证信息.");
// } }
// String product = bizTokenModel.getProduct(); String product = bizTokenModel.getProduct();
// String appKey = bizTokenModel.getAppKey(); String appKey = bizTokenModel.getAppKey();
// RequestContext.setToken(token); RequestContext.setToken(token);
// RequestContext.setProduct(product); RequestContext.setProduct(product);
// RequestContext.setAppKey(appKey); RequestContext.setAppKey(appKey);
// } }
//} }
...@@ -57,7 +57,6 @@ import io.swagger.annotations.ApiOperation; ...@@ -57,7 +57,6 @@ import io.swagger.annotations.ApiOperation;
import net.sf.json.JSONObject; import net.sf.json.JSONObject;
@RestController @RestController
@TycloudResource(module = "openapi", value = "csei")
@RequestMapping(value = "/csei") @RequestMapping(value = "/csei")
@Api(tags = "csei-检验检测数据对接") @Api(tags = "csei-检验检测数据对接")
public class CseiController { public class CseiController {
......
...@@ -48,7 +48,6 @@ import io.swagger.annotations.ApiOperation; ...@@ -48,7 +48,6 @@ import io.swagger.annotations.ApiOperation;
import net.sf.json.JSONObject; import net.sf.json.JSONObject;
@RestController @RestController
@TycloudResource(module = "openapi", value = "cylinder")
@RequestMapping(value = "/cylinder") @RequestMapping(value = "/cylinder")
@Api(tags = "cylinder-气瓶数据对接") @Api(tags = "cylinder-气瓶数据对接")
public class CylinderController { public class CylinderController {
......
...@@ -26,7 +26,6 @@ import io.swagger.annotations.ApiOperation; ...@@ -26,7 +26,6 @@ import io.swagger.annotations.ApiOperation;
import net.sf.json.JSONObject; import net.sf.json.JSONObject;
@RestController @RestController
@TycloudResource(module = "openapi", value = "filestorage")
@RequestMapping(value = "/filestorage") @RequestMapping(value = "/filestorage")
@Api(tags = "filestorage-上传附件数据对接") @Api(tags = "filestorage-上传附件数据对接")
public class FilesController { public class FilesController {
......
...@@ -33,7 +33,6 @@ import net.sf.json.JSONObject; ...@@ -33,7 +33,6 @@ import net.sf.json.JSONObject;
* @version $Id: InspectionController.java, v 0.1 2021年11月8日 下午6:47:54 gwb Exp $ * @version $Id: InspectionController.java, v 0.1 2021年11月8日 下午6:47:54 gwb Exp $
*/ */
@RestController @RestController
@TycloudResource(module = "openapi", value = "inspection")
@RequestMapping(value = "/v1/inspection") @RequestMapping(value = "/v1/inspection")
@Api(tags = "inspection-特种设备检验对接") @Api(tags = "inspection-特种设备检验对接")
public class InspectionController public class InspectionController
......
...@@ -40,7 +40,6 @@ import net.sf.json.JSONObject; ...@@ -40,7 +40,6 @@ import net.sf.json.JSONObject;
* @version $Id: ElevatorStatusController.java, v 0.1 2021年9月28日 上午9:11:38 gwb Exp $ * @version $Id: ElevatorStatusController.java, v 0.1 2021年9月28日 上午9:11:38 gwb Exp $
*/ */
@RestController @RestController
@TycloudResource(module = "openapi", value = "lift")
@RequestMapping(value = "/lift") @RequestMapping(value = "/lift")
@Api(tags = "lift-电梯物联对接") @Api(tags = "lift-电梯物联对接")
public class LiftController public class LiftController
......
...@@ -41,7 +41,6 @@ import net.sf.json.JSONObject; ...@@ -41,7 +41,6 @@ import net.sf.json.JSONObject;
* @version $Id: InspectionController.java, v 0.1 2021年11月8日 下午6:47:54 gwb Exp $ * @version $Id: InspectionController.java, v 0.1 2021年11月8日 下午6:47:54 gwb Exp $
*/ */
@RestController @RestController
@TycloudResource(module = "openapi", value = "bizToken")
@RequestMapping(value = "/bizToken") @RequestMapping(value = "/bizToken")
@Api(tags = "bizToken-企业数据对接票据管理") @Api(tags = "bizToken-企业数据对接票据管理")
public class OpenapiBizTokenController public class OpenapiBizTokenController
......
spring.application.name=AMOS-API-OPENAPI-CYL spring.application.name=AMOS-API-OPENAPI
server.servlet.context-path=/openapicyl server.servlet.context-path=/openapi
server.port=11001 server.port=11001
# jdbc_config # jdbc_config
spring.datasource.url=jdbc:mysql://113.134.211.174:3308/amos_openapi_cylinder?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&serverTimezone=GMT%2B8 spring.datasource.url=jdbc:mysql://113.134.211.174:3308/amos_openapi_cylinder?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&serverTimezone=GMT%2B8
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
</parent> </parent>
<artifactId>amos-boot-data</artifactId> <artifactId>amos-boot-data</artifactId>
<version>1.0.0</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>amos-boot-data</name> <name>amos-boot-data</name>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment