Commit f62714cc authored by maoying's avatar maoying

合并developer分支代码

parents 96ef2e25 7837219a
...@@ -5,4 +5,5 @@ target/ ...@@ -5,4 +5,5 @@ target/
.project .project
/org.eclipse /org.eclipse
.settings .settings
*.factorypath
log/ log/
...@@ -13,12 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -13,12 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.connection.RedisConnection; import org.springframework.data.redis.connection.RedisConnection;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
...@@ -202,7 +197,26 @@ public class DataDictionaryController extends BaseController { ...@@ -202,7 +197,26 @@ public class DataDictionaryController extends BaseController {
} }
} }
@TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/dataDictionaryIdFillMenu", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据字典类型查询字典,id为SequenceNbr", notes = "根据字典类型查询字典,id为SequenceNbr")
public ResponseModel<Object> getDictionaryWithTreeFillId(@RequestParam String type) throws Exception {
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", type);
queryWrapper.orderByAsc("sort_num");
if (redisUtils.hasKey(RedisKey.DATA_DICTIONARY_CODE + type + "_ID")) {
Object obj = redisUtils.get(RedisKey.DATA_DICTIONARY_CODE + type + "_ID");
return ResponseHelper.buildResponse(obj);
} else {
Collection<DataDictionary> list = iDataDictionaryService.list(queryWrapper);
List<Menu> menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getSequenceNbr", 2, "getName",
"getParent", null,"getCode");
redisUtils.set(RedisKey.DATA_DICTIONARY_CODE + type + "_ID", JSON.toJSON(menus), time);
return ResponseHelper.buildResponse(menus);
}
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/dataDictionary", method = RequestMethod.GET) @RequestMapping(value = "/dataDictionary", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据字典类型查询字典2", notes = "根据字典类型查询字典2") @ApiOperation(httpMethod = "GET", value = "根据字典类型查询字典2", notes = "根据字典类型查询字典2")
public ResponseModel<Object> getDictionary(@RequestParam String type) throws Exception { public ResponseModel<Object> getDictionary(@RequestParam String type) throws Exception {
...@@ -224,6 +238,7 @@ public class DataDictionaryController extends BaseController { ...@@ -224,6 +238,7 @@ public class DataDictionaryController extends BaseController {
} }
} }
@TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/gwmcDataDictionary/FireChemical/{type}", method = RequestMethod.GET) @RequestMapping(value = "/gwmcDataDictionary/FireChemical/{type}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据字典类型查询危险品字典", notes = "根据字典类型查询危险品字典") @ApiOperation(httpMethod = "GET", value = "根据字典类型查询危险品字典", notes = "根据字典类型查询危险品字典")
...@@ -374,4 +389,14 @@ public class DataDictionaryController extends BaseController { ...@@ -374,4 +389,14 @@ public class DataDictionaryController extends BaseController {
} }
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@GetMapping(value = "/child-list")
@ApiOperation(httpMethod = "GET", value = "根据字典类型type和desc查询字典列表", notes = "根据字典类型type和desc查询字典列表")
public ResponseModel<List<DataDictionary>> getChildList(@RequestParam(value = "type") String type,
@RequestParam(value = "group") String group
){
return ResponseHelper.buildResponse(iDataDictionaryService.getChildList(type,group));
}
} }
...@@ -40,9 +40,11 @@ public class DataDictionary extends BaseEntity { ...@@ -40,9 +40,11 @@ public class DataDictionary extends BaseEntity {
@ApiModelProperty(value = "类型说明") @ApiModelProperty(value = "类型说明")
private String typeDesc; private String typeDesc;
//新加排序字段
@ApiModelProperty(value = "排序字段") @ApiModelProperty(value = "排序字段")
private int sortNum; private int sortNum;
@ApiModelProperty(value = "扩展字段")
private String extend;
@ApiModelProperty(value = "对应消防专家的数量,仅适应与消防资源专家领域树结构的展示") @ApiModelProperty(value = "对应消防专家的数量,仅适应与消防资源专家领域树结构的展示")
@TableField(exist = false) @TableField(exist = false)
......
...@@ -23,4 +23,6 @@ public interface IDataDictionaryService { ...@@ -23,4 +23,6 @@ public interface IDataDictionaryService {
public List<DataDictionary> getByType(String type); public List<DataDictionary> getByType(String type);
public List<DataDictionary> getAllChildNodes(String type,Long parent) throws Exception; public List<DataDictionary> getAllChildNodes(String type,Long parent) throws Exception;
List<DataDictionary> getChildList(String type, String group);
} }
...@@ -156,7 +156,8 @@ public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, Da ...@@ -156,7 +156,8 @@ public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, Da
return list; return list;
} }
public List<DataDictionary> getAllChildNodes(String type,Long parent) throws Exception { @Override
public List<DataDictionary> getAllChildNodes(String type, Long parent) throws Exception {
LambdaQueryWrapper<DataDictionary> wrapper = new LambdaQueryWrapper<DataDictionary>(); LambdaQueryWrapper<DataDictionary> wrapper = new LambdaQueryWrapper<DataDictionary>();
wrapper.eq(DataDictionary::getIsDelete, false); wrapper.eq(DataDictionary::getIsDelete, false);
wrapper.eq(DataDictionary::getType, type); wrapper.eq(DataDictionary::getType, type);
...@@ -165,4 +166,12 @@ public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, Da ...@@ -165,4 +166,12 @@ public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, Da
} }
return this.baseMapper.selectList(wrapper); return this.baseMapper.selectList(wrapper);
} }
@Override
public List<DataDictionary> getChildList(String type, String group) {
LambdaQueryWrapper<DataDictionary> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(DataDictionary::getType,type);
wrapper.eq(DataDictionary::getTypeDesc,group);
return this.list(wrapper);
}
} }
package com.yeejoin.amos.boot.biz.common.utils;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.google.common.base.Strings;
/**
* @Author: xl
* @Description: json快速取值
* @Date: 2022/5/12 11:11
*/
public class JsonValueUtils {
public static Object getValueByKey(Object originObject, String startKey,
String targetKeyExpression) {
if (Strings.isNullOrEmpty(startKey)) {
return originObject;
}
if (originObject instanceof JSONObject) {
return getValueFromJSONObjectByKey((JSONObject) originObject, startKey,
targetKeyExpression);
}
if (originObject instanceof JSONArray) {
return getValueFromJSONArrayByKey((JSONArray) originObject, startKey,
targetKeyExpression);
}
return null;
}
private static String getNextKey(String startKey, String targetKeyExpression) {
if (Strings.isNullOrEmpty(targetKeyExpression)) {
return null;
}
String[] keys = targetKeyExpression.split("\\.");
for (int i = 0; i < keys.length; i++) {
if (keys[i].equals(startKey) && (i < keys.length - 1)) {
return keys[i + 1];
}
}
return null;
}
private static Object getValueFromJSONArrayByKey(JSONArray originObject,
String startKey,
String targetKeyExpression) {
try {
Integer integer = Integer.valueOf(startKey);
JSONObject jsonObject = originObject.getJSONObject(integer);
Object targetObject = getValueFromJSONObjectByKey(jsonObject, getNextKey(startKey, targetKeyExpression),
targetKeyExpression);
if (targetObject != null) {
return targetObject;
}
} catch (NumberFormatException e) {
e.printStackTrace();
}
return null;
}
private static Object getValueFromJSONObjectByKey(JSONObject originObject,
String startKey,
String targetKeyExpression) {
Object object = originObject.get(startKey);
return object != null
? getValueByKey(object, getNextKey(startKey, targetKeyExpression),
targetKeyExpression)
: null;
}
public static void main(String[] args) {
String a = "{\"agencyCode\":\"jcs\",\"agencyUserType\":\"NORMAL\",\"appCodes\":[\"AMOS_ADMIN\",\"studio_normalapp_3144441\",\"studio_normalapp_3157169\",\"studio_normalapp_3168830\",\"studio_normalapp_3206513\",\"studio_normalapp_3230377\"],\"companyDepartments\":{},\"companys\":[{\"agencyCode\":\"jcs\",\"companyName\":\"咸阳机场\",\"companyOrgCode\":49,\"level\":\"headquarter\",\"orgCode\":\"49\",\"parentId\":0,\"sequenceNbr\":1397143494413381633}],\"createTime\":1625058001000,\"lockStatus\":\"UNLOCK\",\"orgNames\":\"咸阳机场(admin\\\\idx_report_data\\\\idx_report_audit\\\\Safety_Supervision_Instruct_Report\\\\Safety_Supervision_Rectify_Report\\\\Safety_Supervision_Rectify_Affirm)\",\"orgRoleName\":{1397143494413381633:\"咸阳机场(admin\\\\idx_report_data\\\\idx_report_audit\\\\Safety_Supervision_Instruct_Report\\\\Safety_Supervision_Rectify_Report\\\\Safety_Supervision_Rectify_Affirm)\"},\"orgRoleSeqs\":{1397143494413381633:[1397143493910065153,1484425579646689281,1484425839416713217,1536242867071119362,1536243072738816002,1536243348623355905]},\"orgRoles\":{1397143494413381633:[{\"agencyCode\":\"jcs\",\"roleDesc\":\"admin\",\"roleName\":\"admin\",\"roleType\":\"admin\",\"sequenceNbr\":1397143493910065153},{\"agencyCode\":\"jcs\",\"roleDesc\":\"指标系统-数据填报\",\"roleName\":\"idx_report_data\",\"roleType\":\"admin\",\"sequenceNbr\":1484425579646689281},{\"agencyCode\":\"jcs\",\"roleDesc\":\"指标系统-数据审核\",\"roleName\":\"idx_report_audit\",\"roleType\":\"admin\",\"sequenceNbr\":1484425839416713217},{\"agencyCode\":\"jcs\",\"roleDesc\":\"安全监察-填报指令书\",\"roleName\":\"Safety_Supervision_Instruct_Report\",\"roleType\":\"admin\",\"sequenceNbr\":1536242867071119362},{\"agencyCode\":\"jcs\",\"roleDesc\":\"安全监察-企业整改\",\"roleName\":\"Safety_Supervision_Rectify_Report\",\"roleType\":\"admin\",\"sequenceNbr\":1536243072738816002},{\"agencyCode\":\"jcs\",\"roleDesc\":\"安全监察-整改确认\",\"roleName\":\"Safety_Supervision_Rectify_Affirm\",\"roleType\":\"admin\",\"sequenceNbr\":1536243348623355905}]},\"password\":\"1CABE8C68B956573D0709013FD61CA5F\",\"passwordReset\":false,\"realName\":\"邢磊\",\"sequenceNbr\":1410417876975759361,\"userId\":\"3187681\",\"userName\":\"jcs_xl\"}";
System.out.println(getValueByKey(JSONObject.parse(a), "companys", "companys.0.sequenceNbr"));
}
}
This diff is collapsed.
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-data</artifactId>
<version>1.0.0</version>
</parent>
<artifactId>amos-boot-data-accessapi</artifactId>
<name>amos-boot-data-accessapi</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.typroject</groupId>
<artifactId>tyboot-core-foundation</artifactId>
<version>${tyboot-version}</version>
</dependency>
<dependency>
<groupId>org.typroject</groupId>
<artifactId>tyboot-core-restful</artifactId>
<version>${tyboot-version}</version>
<exclusions>
<exclusion>
<groupId>org.typroject</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.typroject</groupId>
<artifactId>tyboot-core-auth</artifactId>
<version>${tyboot-version}</version>
<exclusions>
<exclusion>
<groupId>org.typroject</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.typroject</groupId>
<artifactId>tyboot-component-emq</artifactId>
<version>${tyboot-version}</version>
</dependency>
<dependency>
<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>
<version>${tyboot-version}</version>
<exclusions>
<exclusion>
<groupId>org.typroject</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.yeejoin</groupId>
<artifactId>amos-feign-systemctl</artifactId>
<version>${amos.version}</version>
</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>
<dependency>
<groupId>fakepath</groupId>
<artifactId>license-sdk</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
package com.yeejoin.amos;
import java.net.InetAddress;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.typroject.tyboot.core.restful.exception.GlobalExceptionHandler;
import com.yeejoin.amos.api.openapi.face.service.TaAccessConfigServiceImpl;
/**
*
* <pre>
*
* </pre>
*
* @author gwb
* @version $Id: OpenapiApplication.java, v 0.1 2021年9月27日 下午3:29:30 gwb Exp $
*/
@SpringBootApplication
@EnableTransactionManagement
@EnableConfigurationProperties
@ServletComponentScan
@EnableDiscoveryClient
@EnableFeignClients
@EnableAsync
@EnableEurekaClient
@EnableScheduling
@MapperScan(value = { "org.typroject.tyboot.*.*.face.orm.dao", "com.yeejoin.amos.api.*.face.orm.dao",
"org.typroject.tyboot.face.*.orm.dao*", "com.yeejoin.amos.boot.biz.common.dao.mapper" })
@ComponentScan({ "org.typroject", "com.yeejoin.amos" })
public class AccessapiApplication {
@Autowired
private TaAccessConfigServiceImpl taAccessConfigServiceImpl;
private static final Logger logger = LogManager.getLogger(AccessapiApplication.class);
public static void main(String[] args) throws Exception {
// //license授权验证
// System.setProperty("root.path",ClassPathUtil.getPath()+"/config");
// log.info("(license.bat)url:" + ClassPathUtil.getPath()+"/config");
// A.v();
// 服务启动
ConfigurableApplicationContext context = SpringApplication.run(AccessapiApplication.class, args);
GlobalExceptionHandler.setAlwaysOk(true);
Environment env = context.getEnvironment();
String ip = InetAddress.getLocalHost().getHostAddress();
String port = env.getProperty("server.port");
String path = env.getProperty("server.servlet.context-path");
logger.info("\n----------------------------------------------------------\n\t"
+ "Application Amos-Biz-Boot is running! Access URLs:\n\t" + "Swagger文档: \thttp://" + ip + ":" + port
+ path + "/doc.html\n" + "----------------------------------------------------------");
}
@Bean
public void initAccessConfig() {
taAccessConfigServiceImpl.refreshConfig();
taAccessConfigServiceImpl.startTask();
}
}
package com.yeejoin.amos.api.common.restful.utils;
import org.springframework.http.HttpStatus;
public class ResponseHelper
{
public static <T> ResponseModel<T> buildResponse(T t) {
ResponseModel<T> response = new ResponseModel<>();
response.setResult(t);
response.setMessage("ok");
response.setStatus(HttpStatus.OK.value());
return response;
}
}
package com.yeejoin.amos.api.common.restful.utils;
import java.io.Serializable;
/**
*
* <pre>
* 返回封装对象
* </pre>
*
* @author gwb
* @version $Id: CommonResponse.java, v 0.1 2021年9月28日 下午4:37:40 gwb Exp $
*/
public class ResponseModel<T> implements Serializable {
/**
* <pre>
*
* </pre>
*/
private static final long serialVersionUID = 2969089929549147825L;
/**
* 响应数据
*/
private T result ;
/**
* 状态码
*/
private int status;
/**
* 提示信息
*/
private String message = "";
public ResponseModel(){
}
public T getResult()
{
return result;
}
public void setResult(T result)
{
this.result = result;
}
public int getStatus()
{
return status;
}
public void setStatus(int status)
{
this.status = status;
}
public String getMessage()
{
return message;
}
public void setMessage(String message)
{
this.message = message;
}
@Override
public String toString()
{
return "CommonResponse [status=" + status + ", result=" + result + ", message=" + message + "]";
}
}
package com.yeejoin.amos.api.openapi.aop;
import com.yeejoin.amos.component.feign.config.TokenOperation;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.Order;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.typroject.tyboot.component.cache.Redis;
import org.typroject.tyboot.core.auth.exception.AuthException;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import com.yeejoin.amos.api.openapi.constant.Constant;
import com.yeejoin.amos.api.openapi.face.model.BizTokenModel;
import javax.servlet.http.HttpServletRequest;
@Aspect
@Component
@Order(value = 0)
public class ControllerAop {
@Autowired
private RedisTemplate redisTemplate;
@Pointcut("(execution(public * com.yeejoin.amos.api.openapi.controller..*(..))) ")
public void userCache() {
}
@Before("userCache()")
public void doBefore(JoinPoint joinPoint) {
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
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","/cylinderPage/serviceProvider",
"/cylinderPage/getTableInfo","/cylinderPage/initCylinderNum"
,"/license/saveLinceseBaseInfo","/license/saveLinceseDetailInfo","refreshConfig"};
// 获取请求路径
for(String uri : url) {
if(request.getRequestURI().indexOf(uri) != -1) {
return;
}
}
//TODO tyboot 框架拦截器已缓存数据
String token = RequestContext.getToken();
if (ValidationUtil.isEmpty(token)) {
token = request.getParameterMap().get("access_token")[0];
}
// if (token != null) {
// fillRequestContext(token);
// }
// boolean validToken = TokenOperation.refresh(token);
// if(!validToken) {
// throw new AuthException("请求未包含认证信息.");
// }
}
private void fillRequestContext(String token) {
String tokenKey = Redis.genKey(Constant.TOKEN_PREFIX,token);
BizTokenModel bizTokenModel = (BizTokenModel) redisTemplate.opsForValue().get(tokenKey);
if(null == bizTokenModel) {
throw new AuthException("请求未包含认证信息.");
}
String product = bizTokenModel.getProduct();
String appKey = bizTokenModel.getAppKey();
RequestContext.setToken(token);
RequestContext.setProduct(product);
RequestContext.setAppKey(appKey);
}
}
package com.yeejoin.amos.api.openapi.constant;
public class Constant {
public static final String TOKEN_PREFIX = "OPENAPI_";
public static final String SECRETKEY = "tzs";
}
package com.yeejoin.amos.api.openapi.controller;
import com.yeejoin.amos.api.common.restful.utils.ResponseHelper;
import com.yeejoin.amos.api.common.restful.utils.ResponseModel;
import com.yeejoin.amos.api.openapi.face.orm.entity.TaAccessConfig;
import com.yeejoin.amos.api.openapi.face.service.TaAccessConfigServiceImpl;
import com.yeejoin.amos.api.openapi.face.service.TaBusinessServiceImpl;
import com.yeejoin.amos.api.openapi.face.service.TaLicenseBaseInfoServiceImpl;
import com.yeejoin.amos.api.openapi.face.service.TaLicenseDetailInfoServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.component.event.RestEventTrigger;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping(value = "/business")
@Api(tags = "许可数据对接")
public class BusinessController {
@Autowired
private TaAccessConfigServiceImpl taAccessConfigService;
@Autowired
private TaBusinessServiceImpl taBusinessService;
@Autowired
private TaLicenseDetailInfoServiceImpl taLicenseDetailInfoService;
@Autowired
private TaLicenseBaseInfoServiceImpl taLicenseBaseInfoService;
/**
* 新增许可信息-接入配置表
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@RequestMapping(value = "/saveAccessConfig", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "新增许可信息-接入配置表", notes = "新增许可信息-接入配置表")
@RestEventTrigger(value = "openapiLogEventHandler")
public ResponseModel<String> saveTaAccessConfig (@RequestBody List<TaAccessConfig> produceInfo) throws Exception
{
return ResponseHelper.buildResponse(taAccessConfigService.saveAccessConfig(produceInfo));
}
/**
* 新增许可信息-许可基本信息表
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@RequestMapping(value = "/saveLinceseBaseInfo", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "新增许可信息-许可基本信息表", notes = "新增许可信息-许可基本信息表")
@RestEventTrigger(value = "openapiLogEventHandler")
public ResponseModel<String> saveTaLicenseBaseInfo() throws Exception {
taLicenseBaseInfoService.syncLicenseData();
return ResponseHelper.buildResponse("");
}
/**
* 新增许可信息-许可详细信息表
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@RequestMapping(value = "/saveLinceseDetailInfo", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "新增许可信息-许可详细信息表", notes = "新增许可信息-许可详细信息表")
@RestEventTrigger(value = "openapiLogEventHandler")
public ResponseModel<String> saveTaLicenseDetailInfo()
throws Exception {
taLicenseDetailInfoService.syncLicenseData();
return ResponseHelper.buildResponse("");
}
/**
* 新增许可信息-许可详细信息表
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@RequestMapping(value = "/refreshConfig", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "更新配置", notes = "更新配置")
@RestEventTrigger(value = "openapiLogEventHandler")
public ResponseModel<String> refreshConfig()
throws Exception {
taAccessConfigService.refreshConfig();
return ResponseHelper.buildResponse("");
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = true)
@RequestMapping(value = "/getData", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "获取map", notes = "获取map")
@RestEventTrigger(value = "openapiLogEventHandler")
public ResponseModel<Map<String, Object>> getData(String code) throws Exception {
return ResponseHelper.buildResponse(taBusinessService.getData(code));
}
}
package com.yeejoin.amos.api.openapi.controller;
import com.yeejoin.amos.api.common.restful.utils.ResponseHelper;
import com.yeejoin.amos.api.common.restful.utils.ResponseModel;
import com.yeejoin.amos.api.openapi.face.orm.entity.TaAccessConfig;
import com.yeejoin.amos.api.openapi.face.orm.entity.TaLicenseBaseInfo;
import com.yeejoin.amos.api.openapi.face.orm.entity.TaLicenseDetailInfo;
import com.yeejoin.amos.api.openapi.face.service.TaAccessConfigServiceImpl;
import com.yeejoin.amos.api.openapi.face.service.TaLicenseBaseInfoServiceImpl;
import com.yeejoin.amos.api.openapi.face.service.TaLicenseDetailInfoServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.component.event.RestEventTrigger;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import java.util.List;
@RestController
@RequestMapping(value = "/license")
@Api(tags = "许可数据对接")
public class LicenseController {
@Autowired
private TaAccessConfigServiceImpl taAccessConfigService;
@Autowired
private TaLicenseDetailInfoServiceImpl taLicenseDetailInfoService;
@Autowired
private TaLicenseBaseInfoServiceImpl taLicenseBaseInfoService;
// /**
// * 新增许可信息-接入配置表
// * @return
// */
// @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
// @RequestMapping(value = "/saveAccessConfig", method = RequestMethod.POST)
// @ApiOperation(httpMethod = "POST", value = "新增许可信息-接入配置表", notes = "新增许可信息-接入配置表")
// @RestEventTrigger(value = "openapiLogEventHandler")
// public ResponseModel<String> saveTaAccessConfig (@RequestBody List<TaAccessConfig> produceInfo) throws Exception
// {
// return ResponseHelper.buildResponse(taAccessConfigService.saveAccessConfig(produceInfo));
// }
/**
* 新增许可信息-许可基本信息表
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@RequestMapping(value = "/saveLinceseBaseInfo", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "新增许可信息-许可基本信息表", notes = "新增许可信息-许可基本信息表")
@RestEventTrigger(value = "openapiLogEventHandler")
public ResponseModel<String> saveTaLicenseBaseInfo() throws Exception {
taLicenseBaseInfoService.syncLicenseData();
return ResponseHelper.buildResponse("");
}
/**
* 新增许可信息-许可详细信息表
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@RequestMapping(value = "/saveLinceseDetailInfo", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "新增许可信息-许可详细信息表", notes = "新增许可信息-许可详细信息表")
@RestEventTrigger(value = "openapiLogEventHandler")
public ResponseModel<String> saveTaLicenseDetailInfo()
throws Exception {
taLicenseDetailInfoService.syncLicenseData();
return ResponseHelper.buildResponse("");
}
/**
* 新增许可信息-许可详细信息表
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@RequestMapping(value = "/refreshConfig", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "更新配置", notes = "更新配置")
@RestEventTrigger(value = "openapiLogEventHandler")
public ResponseModel<String> refreshConfig()
throws Exception {
taAccessConfigService.refreshConfig();
return ResponseHelper.buildResponse("");
}
}
package com.yeejoin.amos.api.openapi.controller.event;
import com.fasterxml.jackson.databind.ObjectMapper;
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.OpenapiLogModel;
import com.yeejoin.amos.api.openapi.face.service.OpenapiLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
import org.typroject.tyboot.component.cache.Redis;
import org.typroject.tyboot.component.event.RestEvent;
import org.typroject.tyboot.component.event.RestEventHandler;
/**
*
* <pre>
* 第三方API对接日志处理
* </pre>
*
* @author gwb
* @version $Id: OpenapiLogEventHandler.java, v 0.1 2021年11月10日 下午5:38:32 gwb Exp $
*/
@Component("openapiLogEventHandler")
public class OpenapiLogEventHandler extends RestEventHandler {
static ObjectMapper objectMapper = new ObjectMapper();
@Autowired
private RedisTemplate redisTemplate;
@Autowired
private OpenapiLogService openapiLogService;
@Override
protected void handleEvent(RestEvent restEvent) throws Exception {
OpenapiLogModel openapiLogModel = new OpenapiLogModel();
openapiLogModel.setMethodLabel(restEvent.getMethodLabel());
openapiLogModel.setMethodName(restEvent.getMethodName());
openapiLogModel.setParams(objectMapper.writeValueAsString(restEvent.getParams()));
openapiLogModel.setResult(objectMapper.writeValueAsString(restEvent.getSource()));
openapiLogModel.setRemoteIp(restEvent.getRequestContextModel().getRequestIP());
String token = restEvent.getRequestContextModel().getToken();
openapiLogModel.setToken(token);
openapiLogModel.setTraceId(restEvent.getRequestContextModel().getTraceId());
openapiLogModel.setAgencyCode(restEvent.getRequestContextModel().getAgencyCode());
openapiLogModel.setAppCode(restEvent.getRequestContextModel().getAppKey());
String tokenKey = Redis.genKey(Constant.TOKEN_PREFIX,token);
BizTokenModel bizTokenModel = (BizTokenModel) redisTemplate.opsForValue().get(tokenKey);
openapiLogModel.setAppId(bizTokenModel.getAppId());
openapiLogService.createWithModel(openapiLogModel);
}
}
package com.yeejoin.amos.api.openapi.face.model;
import lombok.Data;
import java.io.Serializable;
@Data
public class BizTokenModel implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
/**
* 登录令牌
*/
private String token;
/**
* 应用编号
*/
private String appKey;
/**
* 客户端标识
*/
private String product;
/**
* 所属机构
*/
private String agencyCode;
/**
* 应用用户票据,唯一标识
*/
private String appId;
/**
* 对接公司编码
*/
private String apiCompanyCode;
}
package com.yeejoin.amos.api.openapi.face.model;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
/**
*
* <pre>
*
* </pre>
*
* @author gwb
* @version $Id: OpenapiLogModel.java, v 0.1 2021年11月10日 下午5:53:46 gwb Exp $
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class OpenapiLogModel extends BaseModel {
private static final long serialVersionUID = 1L;
private String remoteIp;
private String result;
private String methodName;
private String methodLabel;
private String params;
private String traceId;
private String token;
private String resultStatus;//操作结果状态
private String userRealName;// 操作人真实姓名
private String userName;// 操作人用户名
/**
* 所属项目编号
*/
private String agencyCode;
private String appCode;
/**
* 应用用户票据,唯一标识
*/
private String appId;
}
package com.yeejoin.amos.api.openapi.face.model;
import java.util.Date;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
/**
* 接入信息表Model
*
* @author duanwei
* @date 2022-08-17
*/
@Data
public class TaAccessConfigModel extends BaseModel {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
/**
* id
*/
private Long sequenceNbr;
@ApiModelProperty(value = "业务类型")
/**
* 业务类型
*/
private String bizType;
@ApiModelProperty(value = "键")
/**
* 键
*/
private String key;
@ApiModelProperty(value = "值")
/**
* 值
*/
private String value;
@ApiModelProperty(value = "描述")
/**
* 描述
*/
private String description;
@ApiModelProperty(value = "创建时间")
/**
* 创建时间
*/
private Date recDate;
}
package com.yeejoin.amos.api.openapi.face.model;
import java.util.Date;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
/**
* 许可基本信息表Model
*
* @author duanwei
* @date 2022-08-17
*/
@Data
public class TaLicenseBaseInfoModel extends BaseModel {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
/**
* id
*/
private Long id;
@ApiModelProperty(value = "国家")
/**
* 国家
*/
private String country;
@ApiModelProperty(value = "省")
/**
* 省
*/
private String province;
@ApiModelProperty(value = "市")
/**
* 市
*/
private String city;
@ApiModelProperty(value = "区")
/**
* 区
*/
private String district;
@ApiModelProperty(value = "单位名称")
/**
* 单位名称
*/
private String unitName;
@ApiModelProperty(value = "单位代码")
/**
* 单位代码
*/
private String unitCode;
@ApiModelProperty(value = "注册地址")
/**
* 注册地址
*/
private String regAddress;
@ApiModelProperty(value = "证件地址")
/**
* 证件地址
*/
private String licAddress;
@ApiModelProperty(value = "证件类型")
/**
* 证件类型
*/
private String certType;
@ApiModelProperty(value = "证件许可项目")
/**
* 证件许可项目
*/
private String certItem;
@ApiModelProperty(value = "证件编号")
/**
* 证件编号
*/
private String certNo;
@ApiModelProperty(value = "有效截止日期")
/**
* 有效截止日期
*/
private Date expiryDate;
@ApiModelProperty(value = "发证日期")
/**
* 发证日期
*/
private Date issueDate;
@ApiModelProperty(value = "发证机关")
/**
* 发证机关
*/
private String approvedOrga;
@ApiModelProperty(value = "变更日期")
/**
* 变更日期
*/
private Date changeDate;
@ApiModelProperty(value = "许可方式")
/**
* 许可方式
*/
private String applyType;
@ApiModelProperty(value = "许可评审方式")
/**
* 许可评审方式
*/
private String appraisalType;
@ApiModelProperty(value = "备注")
/**
* 备注
*/
private String remark;
@ApiModelProperty(value = "数据入库时间")
/**
* 数据入库时间
*/
private Date recordDate;
@ApiModelProperty(value = "同步时间")
/**
* 同步时间
*/
private Date syncDate;
@ApiModelProperty(value = "同步状态(0-新增 1-更新 2-删除)")
/**
* 同步状态(0-新增 1-更新 2-删除)
*/
private Integer syncState;
}
package com.yeejoin.amos.api.openapi.face.model;
import java.util.Date;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
/**
* 许可详细信息表Model
*
* @author duanwei
* @date 2022-08-17
*/
@Data
public class TaLicenseDetailInfoModel extends BaseModel {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
/**
* id
*/
private Long id;
@ApiModelProperty(value = "base_info表id")
/**
* base_info表id
*/
private String basicInfoSequenceNbr;
@ApiModelProperty(value = "单位统一社会信用代码")
/**
* 单位统一社会信用代码
*/
private String unitCode;
@ApiModelProperty(value = "证书编号")
/**
* 证书编号
*/
private String certNo;
@ApiModelProperty(value = "许可项目")
/**
* 许可项目
*/
private String itemName;
@ApiModelProperty(value = "许可子项目")
/**
* 许可子项目
*/
private String subItem;
@ApiModelProperty(value = "许可参数")
/**
* 许可参数
*/
private String parameter;
@ApiModelProperty(value = "备注")
/**
* 备注
*/
private String remark;
@ApiModelProperty(value = "固定检验地址")
/**
* 固定检验地址
*/
private String itemAddress;
@ApiModelProperty(value = "数据入库时间")
/**
* 数据入库时间
*/
private Date recordDate;
@ApiModelProperty(value = "同步时间")
/**
* 同步时间
*/
private Date syncDate;
@ApiModelProperty(value = "同步状态(0-新增 1-更新 2-删除)")
/**
* 同步状态(0-新增 1-更新 2-删除)
*/
private Integer syncState;
}
package com.yeejoin.amos.api.openapi.face.orm.dao;
public interface DataDictionaryMapper {
String getData(String code);
}
package com.yeejoin.amos.api.openapi.face.orm.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.api.openapi.face.orm.entity.OpenapiLog;
/**
*
* <pre>
* Mapper 接口
* </pre>
*
* @author gwb
* @version $Id: OpenapiLogMapper.java, v 0.1 2021年11月10日 下午5:54:19 gwb Exp $
*/
public interface OpenapiLogMapper extends BaseMapper<OpenapiLog> {
}
\ No newline at end of file
package com.yeejoin.amos.api.openapi.face.orm.dao;
import com.yeejoin.amos.api.openapi.face.orm.entity.TaAccessConfig;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 附件表 Mapper 接口
*
* @author duanwei
* @date 2022-08-17
*/
public interface TaAccessConfigMapper extends BaseMapper<TaAccessConfig> {
}
package com.yeejoin.amos.api.openapi.face.orm.dao;
import com.yeejoin.amos.api.openapi.face.orm.entity.TaLicenseBaseInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 附件表 Mapper 接口
*
* @author duanwei
* @date 2022-08-17
*/
public interface TaLicenseBaseInfoMapper extends BaseMapper<TaLicenseBaseInfo> {
}
package com.yeejoin.amos.api.openapi.face.orm.dao;
import com.yeejoin.amos.api.openapi.face.orm.entity.TaLicenseDetailInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 附件表 Mapper 接口
*
* @author duanwei
* @date 2022-08-17
*/
public interface TaLicenseDetailInfoMapper extends BaseMapper<TaLicenseDetailInfo> {
}
package com.yeejoin.amos.api.openapi.face.orm.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
/**
*
* <pre>
*
* </pre>
*
* @author gwb
* @version $Id: OpenapiLog.java, v 0.1 2021年11月10日 下午5:53:15 gwb Exp $
*/
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("iot_openapi_log")
public class OpenapiLog extends BaseEntity {
private static final long serialVersionUID = 7799473276203462503L;
@TableField("REMOTE_IP")
private String remoteIp;
@TableField("RESULT")
private String result;
@TableField("METHOD_NAME")
private String methodName;
@TableField("METHOD_LABEL")
private String methodLabel;
@TableField("PARAMS")
private String params;
@TableField("TRACE_ID")
private String traceId;
@TableField("TOKEN")
private String token;
@TableField("AGENCY_CODE")
private String agencyCode;
@TableField("APP_CODE")
private String appCode;
/**
* 应用用户票据,唯一标识
*/
@TableField("APP_ID")
private String appId;
}
package com.yeejoin.amos.api.openapi.face.orm.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
/**
* 接入信息表
*
* @author duanwei
* @date 2022-08-17
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("ta_access_config")
@ApiModel(value="TaAccessConfig对象", description="接入信息表")
public class TaAccessConfig extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "业务类型")
private String bizType;
@ApiModelProperty(value = "键")
private String bizKey;
@ApiModelProperty(value = "值")
private String bizValue;
@ApiModelProperty(value = "描述")
private String description;
}
package com.yeejoin.amos.api.openapi.face.orm.entity;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
/**
* 许可基本信息表
*
* @author duanwei
* @date 2022-08-17
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="TaLicenseBaseInfo对象", description="许可基本信息表")
public class TaLicenseBaseInfo extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
private String id;
@ApiModelProperty(value = "国家")
private String country;
@ApiModelProperty(value = "省")
private String province;
@ApiModelProperty(value = "市")
private String city;
@ApiModelProperty(value = "区")
private String district;
@ApiModelProperty(value = "单位名称")
private String unitName;
@ApiModelProperty(value = "单位代码")
private String unitCode;
@ApiModelProperty(value = "注册地址")
private String regAddress;
@ApiModelProperty(value = "证件地址")
private String licAddress;
@ApiModelProperty(value = "证件类型")
private String certType;
@ApiModelProperty(value = "证件许可项目")
private String certItem;
@ApiModelProperty(value = "证件编号")
private String certNo;
@ApiModelProperty(value = "有效截止日期")
private Date expiryDate;
@ApiModelProperty(value = "发证日期")
private Date issueDate;
@ApiModelProperty(value = "发证机关")
private String approvedOrgan;
@ApiModelProperty(value = "变更日期")
private Date changeDate;
@ApiModelProperty(value = "许可方式")
private String applyType;
@ApiModelProperty(value = "许可评审方式")
private String appraisalType;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "数据入库时间")
private Date recordDate;
@ApiModelProperty(value = "同步时间")
private Date syncDate;
@ApiModelProperty(value = "同步状态(0-新增 1-更新 2-删除)")
private Integer syncState;
}
package com.yeejoin.amos.api.openapi.face.orm.entity;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
/**
* 许可详细信息表
*
* @author duanwei
* @date 2022-08-17
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="TaLicenseDetailInfo对象", description="许可详细信息表")
public class TaLicenseDetailInfo extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
private String id;
@ApiModelProperty(value = "base_info表id")
private String basicInfoId;
@ApiModelProperty(value = "单位统一社会信用代码")
private String unitCode;
@ApiModelProperty(value = "证书编号")
private String certNo;
@ApiModelProperty(value = "许可项目")
private String itemName;
@ApiModelProperty(value = "许可子项目")
private String subItem;
@ApiModelProperty(value = "许可参数")
private String parameter;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "固定检验地址")
private String itemAddress;
@ApiModelProperty(value = "数据入库时间")
private Date recordDate;
@ApiModelProperty(value = "同步时间")
private Date syncDate;
@ApiModelProperty(value = "同步状态(0-新增 1-更新 2-删除)")
private Integer syncState;
}
package com.yeejoin.amos.api.openapi.face.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yeejoin.amos.api.openapi.face.model.OpenapiLogModel;
import com.yeejoin.amos.api.openapi.face.orm.dao.OpenapiLogMapper;
import com.yeejoin.amos.api.openapi.face.orm.entity.OpenapiLog;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.springframework.stereotype.Component;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.annotation.Condition;
import org.typroject.tyboot.core.rdbms.annotation.Operator;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
*
* <pre>
* 服务类
* </pre>
*
* @author gwb
* @version $Id: OpenapiLogService.java, v 0.1 2021年11月10日 下午5:55:31 gwb Exp $
*/
@Component
public class OpenapiLogService extends BaseService<OpenapiLogModel, OpenapiLog, OpenapiLogMapper> {
private ObjectMapper objectMapper = new ObjectMapper();
/**
* 分页查询
*/
@SuppressWarnings("unchecked")
public Page<OpenapiLogModel> queryForOpenserviceOperateLogPage(Page page, String agencyCode, @Condition(Operator.like) String methodLabel) throws Exception {
Page<OpenapiLogModel> openserviceOperateLogModelPage = this.queryForPage(page, "CREATE_TIME", false,agencyCode, methodLabel);
List<OpenapiLogModel> openserviceOperateLogModelList = openserviceOperateLogModelPage.getRecords();
Map<String, AgencyUserModel> userMap = new HashMap<String, AgencyUserModel>();
for (OpenapiLogModel openserviceOperateLogModel : openserviceOperateLogModelList)
{
//填充操作人信息
AgencyUserModel agencyUserModel = userMap.get(openserviceOperateLogModel.getRecUserId());
if (ValidationUtil.isEmpty(agencyUserModel))
{
openserviceOperateLogModel.setUserName(openserviceOperateLogModel.getRecUserId());
openserviceOperateLogModel.setUserRealName(openserviceOperateLogModel.getRecUserId());
FeignClientResult<AgencyUserModel> responseModel = Privilege.agencyUserClient.queryByUserId(openserviceOperateLogModel.getRecUserId());
AgencyUserModel userModel = responseModel.getResult();
if (!ValidationUtil.isEmpty(userModel))
{
userMap.put(openserviceOperateLogModel.getRecUserId(), userModel);
openserviceOperateLogModel.setUserName(userModel.getUserName());
openserviceOperateLogModel.setUserRealName(userModel.getRealName());
}
}else
{
openserviceOperateLogModel.setUserName(agencyUserModel.getUserName());
openserviceOperateLogModel.setUserRealName(agencyUserModel.getRealName());
}
//填充操作状态
String result = openserviceOperateLogModel.getResult();
Map<String, Object> mapJson = objectMapper.readValue(result,Map.class);
String status = mapJson.get("status").toString();
if (status.equals("200"))
{
openserviceOperateLogModel.setResultStatus("成功");
}else
{
openserviceOperateLogModel.setResultStatus("失败");
}
}
openserviceOperateLogModelPage.setRecords(openserviceOperateLogModelList);
return openserviceOperateLogModelPage;
}
/**
* 列表查询 示例
*/
public List<OpenapiLogModel> queryForOpenserviceOperateLogList(String agencyCode) throws Exception {
return this.queryForList("", false, agencyCode);
}
}
package com.yeejoin.amos.api.openapi.face.service;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
import org.springframework.scheduling.support.CronTrigger;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.api.openapi.face.model.TaAccessConfigModel;
import com.yeejoin.amos.api.openapi.face.orm.dao.TaAccessConfigMapper;
import com.yeejoin.amos.api.openapi.face.orm.entity.TaAccessConfig;
import com.yeejoin.amos.openapi.enums.TaAccessConfigBizeEnum;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
/**
* 附件表 服务实现类
*
* @author duanwei
* @date 2022-08-17
*/
@Service
public class TaAccessConfigServiceImpl extends BaseService<TaAccessConfigModel, TaAccessConfig, TaAccessConfigMapper> {
static Map<String, String> licenseConfig = new HashMap<String, String>();
@Autowired
private TaLicenseDetailInfoServiceImpl taLicenseDetailInfoService;
@Autowired
private TaLicenseBaseInfoServiceImpl taLicenseBaseInfoService;
/**
*
* 新增许可信息-接入配置表
*
* @param model 接入配置实体类集合
* @return 成功返回“OK”
*/
@Transactional(rollbackFor = { Exception.class })
public String saveAccessConfig(List<TaAccessConfig> model) {
// TODO Auto-generated method stub
if (ValidationUtil.isEmpty(model)) {
throw new BadRequest("接入配置表信息为空.");
}
for (TaAccessConfig models : model) {
// checkModel(models);
models.setRecDate(new Date());
// models.setAppId(getAppId());
}
this.saveBatch(model);
return "OK";
}
public void refreshConfig() {
licenseConfig.clear();
List<TaAccessConfig> list = this.list(new LambdaQueryWrapper<TaAccessConfig>().eq(TaAccessConfig::getBizType,
TaAccessConfigBizeEnum.LICENSE.getAttribute()));
for (TaAccessConfig ta : list) {
licenseConfig.put(ta.getBizKey(), ta.getBizValue());
}
}
public void startTask() {
String cron = licenseConfig.get("cron");
// 创建带线程池的调度器
ThreadPoolTaskScheduler taskScheduler = new ThreadPoolTaskScheduler();
// 手动初始化
taskScheduler.initialize();
// 设置线程池
taskScheduler.setPoolSize(30);
System.out.println(taskScheduler);
taskScheduler.schedule(new Runnable() {
@Override
public void run() {
try {
taLicenseDetailInfoService.syncLicenseData();
taLicenseBaseInfoService.syncLicenseData();
} catch (Exception e) {
e.printStackTrace();
}
}
}, new CronTrigger(cron));// 这串字符串是cron表达式 代表每隔5秒执行一次
}
}
package com.yeejoin.amos.api.openapi.face.service;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.csoft.sdk.domain.CsoftDataApiXixianGetzhutiinfoParam;
import com.csoft.sdk.domain.request.CsoftDataApiXixianGetzhutiinfoRequest ;
import com.csoft.sdk.domain.response.CsoftDataApiXixianGetzhutiinfoResponse;
import com.yeejoin.amos.api.openapi.face.orm.dao.DataDictionaryMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.csoft.sdk.client.CsoftDefaultSdkClient;
import com.csoft.sdk.domain.App;
import com.csoft.sdk.domain.CsoftDataTzsbJbxxListParam;
import com.yeejoin.amos.api.openapi.face.model.TaAccessConfigModel;
import com.yeejoin.amos.api.openapi.face.orm.dao.TaAccessConfigMapper;
import com.yeejoin.amos.api.openapi.face.orm.entity.TaAccessConfig;
import com.yeejoin.amos.api.openapi.face.orm.entity.TaLicenseBaseInfo;
/**
* 附件表 服务实现类
*
* @author duanwei
* @date 2022-08-17
*/
@Service
public class TaBusinessServiceImpl extends BaseService<TaAccessConfigModel, TaAccessConfig, TaAccessConfigMapper> {
@Autowired
private DataDictionaryMapper dataDictionaryMapper;
public Map<String, Object> getData(String code) throws Exception {
Map<String, String> map = TaAccessConfigServiceImpl.licenseConfig;
String appId = map.get("appId");
String appKey = map.get("appKey");
String appSecret = map.get("appSecret");
String server = map.get("server");
App app = App.of(appId, appKey, appSecret, server);
CsoftDefaultSdkClient client = CsoftDefaultSdkClient.of(app);
// 3.设置参数,发送请求,并处理结果
CsoftDataApiXixianGetzhutiinfoParam csoftDataApiXixianParam = new CsoftDataApiXixianGetzhutiinfoParam();
csoftDataApiXixianParam.setUniscid(code);
CsoftDataApiXixianGetzhutiinfoRequest request = new CsoftDataApiXixianGetzhutiinfoRequest(csoftDataApiXixianParam);
CsoftDataApiXixianGetzhutiinfoResponse response = client.execute(request);
Map<String, Object> result = new HashMap<>();
// 4.返回校验
if (response.isSuccess()) {
System.out.println("成功:" + response.getData());
System.out.println(response.getResult());
JSONObject jsonObject = JSONObject.parseObject(response.getData());
JSONObject data = jsonObject.getJSONObject("data");
//分割字符串 根据详细地址分割出 省/市/区、街道地址、小区地址
String address = data.getString("dom");
String area = address.substring(0,address.indexOf("区")+1);
String street = address.substring(area.length()).substring(0,address.substring(area.length()).indexOf("号")+1);
String community = address.substring(area.length()+street.length());
String industry = getIndustry(data.getString("hydm"));
//所属行业
result.put("industry", industry);
//注册地址 省/市/区
result.put("area", area);
//注册地址 街道地址
result.put("street", street);
//注册地址 小区地址
result.put("community", community);
//注册地址 详细地址
result.put("address", data.get("dom"));
//登记机关
result.put("registration_authority", data.get("regorg"));
//核准时间
result.put("approval_time", data.get("hzrq"));
//经营状态
result.put("operating_status", data.get("opstate"));
//统一社会信用代码
result.put("creditCode",data.get("uniscid"));
//企业名称
result.put("unitName",data.get("entname"));
//经营范围
result.put("businessScope",data.get("opscope"));
//注册资金(数字,万元)
result.put("regcap",data.get("regcap"));
//成立日期
result.put("estdate",data.get("estdate"));
//营业期限(yyyy-mm-dd)
result.put("operatingPeriod",data.get("yyqx"));
//生产经营地址
result.put("oploc",data.get("oploc"));
//登记注册类型中文描述
result.put("enttype",data.get("enttype"));
//法定代表人姓名
result.put("legalPeople",data.get("lerep"));
//行业小类编码
result.put("",data.get("hydm"));
} else {
System.out.println("失败:" + response.getErrorMsg());
System.out.println("失败:" + response.getErrorCode());
throw new Exception(response.getErrorMsg());
}
return result;
}
public String getIndustry(String code){
return dataDictionaryMapper.getData(code.substring(0,2));
}
}
package com.yeejoin.amos.api.openapi.face.service;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.csoft.sdk.client.CsoftDefaultSdkClient;
import com.csoft.sdk.domain.App;
import com.csoft.sdk.domain.CsoftDataTzsbJbxxListParam;
import com.csoft.sdk.domain.request.CsoftDataTzsbJbxxListRequest;
import com.csoft.sdk.domain.response.CsoftDataTzsbJbxxListResponse;
import com.yeejoin.amos.api.openapi.face.model.TaLicenseBaseInfoModel;
import com.yeejoin.amos.api.openapi.face.orm.dao.TaLicenseBaseInfoMapper;
import com.yeejoin.amos.api.openapi.face.orm.entity.TaAccessConfig;
import com.yeejoin.amos.api.openapi.face.orm.entity.TaLicenseBaseInfo;
/**
* 附件表 服务实现类
*
* @author duanwei
* @date 2022-08-17
*/
@Service
public class TaLicenseBaseInfoServiceImpl
extends BaseService<TaLicenseBaseInfoModel, TaLicenseBaseInfo, TaLicenseBaseInfoMapper> {
@Autowired
TaAccessConfigServiceImpl taAccessConfigServiceImpl;
/**
*
* 新增许可信息-许可基本信息表
*
* @param model 许可基本信息实体类集合
* @return 成功返回“OK”
*/
@Transactional(rollbackFor = { Exception.class })
public String saveLicenseBaseInfo(List<TaLicenseBaseInfo> model) {
// TODO Auto-generated method stub
if (ValidationUtil.isEmpty(model)) {
throw new BadRequest("接入配置表信息为空.");
}
for (TaLicenseBaseInfo models : model) {
// checkModel(models);
models.setRecDate(new Date());
// models.setAppId(getAppId());
}
this.saveBatch(model);
return "OK";
}
public void syncLicenseData() throws Exception {
Map<String, String> map = TaAccessConfigServiceImpl.licenseConfig;
String appId = map.get("appId");
String appKey = map.get("appKey");
String appSecret = map.get("appSecret");
String server = map.get("server");
String startTime = map.get("startTime");
int isAll = Integer.valueOf(map.get("isAllBase"));
// String endTime = map.get("endTime");
App app = App.of(appId, appKey, appSecret, server);
int current = 1;
int size = Integer.valueOf(map.get("pageSize"));
// 2.初始化请求客户端
CsoftDefaultSdkClient client = CsoftDefaultSdkClient.of(app);
// 3.设置参数,发送请求,并处理结果
CsoftDataTzsbJbxxListParam csoftDataTzsbJbxxListParam = new CsoftDataTzsbJbxxListParam();
if (isAll == 0) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// 开始日期
csoftDataTzsbJbxxListParam.setStaTime(startTime);
// 结束日期
csoftDataTzsbJbxxListParam.setEndTime(sdf.format(new Date()));
} else {
SimpleDateFormat sdfsta = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
SimpleDateFormat sdfend = new SimpleDateFormat("yyyy-MM-dd 23:59:59");
// 开始日期
csoftDataTzsbJbxxListParam.setStaTime(sdfsta.format(new Date()));
// 结束日期
csoftDataTzsbJbxxListParam.setEndTime(sdfend.format(new Date()));
}
csoftDataTzsbJbxxListParam.setPageSize(size); // 每 页记录数
csoftDataTzsbJbxxListParam.setCurrentPage(current); // 当前页码
CsoftDataTzsbJbxxListRequest request = new CsoftDataTzsbJbxxListRequest(csoftDataTzsbJbxxListParam);
CsoftDataTzsbJbxxListResponse response = client.execute(request);
// 4.返回校验
if (response.isSuccess()) {
System.out.println("成功:" + response.getData());
System.out.println(response.getResult());
JSONObject jsonObject = JSONObject.parseObject(response.getData());
JSONObject data = jsonObject.getJSONObject("data");
JSONArray jsonArray = data.getJSONArray("objList");
List<TaLicenseBaseInfo> list = new ArrayList<TaLicenseBaseInfo>();
for (Object obj : jsonArray) {
String jsonString = JSONObject.toJSONString(obj);
TaLicenseBaseInfo taLicenseBaseInfo = JSONObject.parseObject(jsonString, TaLicenseBaseInfo.class);
taLicenseBaseInfo.setSyncDate(new Date());
taLicenseBaseInfo.setSyncState(0);
TaLicenseBaseInfo oldTaLicenseBaseInfo = this.getOne(new LambdaQueryWrapper<TaLicenseBaseInfo>()
.eq(TaLicenseBaseInfo::getId, taLicenseBaseInfo.getId()));
if (oldTaLicenseBaseInfo != null) {
taLicenseBaseInfo.setSequenceNbr(oldTaLicenseBaseInfo.getSequenceNbr());
}
list.add(taLicenseBaseInfo);
}
this.saveOrUpdateBatch(list);
while (data.getInteger("totalNum") > current * size) {
csoftDataTzsbJbxxListParam.setCurrentPage(++current);
saveData(client, csoftDataTzsbJbxxListParam);
}
if (isAll == 0) {
taAccessConfigServiceImpl
.update(new LambdaUpdateWrapper<TaAccessConfig>().eq(TaAccessConfig::getBizType, "license")
.eq(TaAccessConfig::getBizKey, "isAllBase").set(TaAccessConfig::getBizValue, 1));
}
} else {
System.out.println("失败:" + response.getErrorMsg());
System.out.println("失败:" + response.getErrorCode());
throw new Exception(response.getErrorMsg());
}
}
private void saveData(CsoftDefaultSdkClient client, CsoftDataTzsbJbxxListParam csoftDataTzsbJbxxListParam)
throws Exception {
// 2.初始化请求客户端
CsoftDataTzsbJbxxListRequest request = new CsoftDataTzsbJbxxListRequest(csoftDataTzsbJbxxListParam);
CsoftDataTzsbJbxxListResponse response = client.execute(request);
// 4.返回校验
if (response.isSuccess()) {
System.out.println("成功:" + response.getData());
System.out.println(response.getResult());
JSONObject jsonObject = JSONObject.parseObject(response.getData());
JSONObject data = jsonObject.getJSONObject("data");
JSONArray jsonArray = data.getJSONArray("objList");
List<TaLicenseBaseInfo> list = new ArrayList<TaLicenseBaseInfo>();
for (Object obj : jsonArray) {
String jsonString = JSONObject.toJSONString(obj);
TaLicenseBaseInfo taLicenseBaseInfo = JSONObject.parseObject(jsonString, TaLicenseBaseInfo.class);
taLicenseBaseInfo.setSyncDate(new Date());
taLicenseBaseInfo.setSyncState(0);
TaLicenseBaseInfo oldTaLicenseBaseInfo = this.getOne(new LambdaQueryWrapper<TaLicenseBaseInfo>()
.eq(TaLicenseBaseInfo::getId, taLicenseBaseInfo.getId()));
if (oldTaLicenseBaseInfo != null) {
taLicenseBaseInfo.setSequenceNbr(oldTaLicenseBaseInfo.getSequenceNbr());
}
list.add(taLicenseBaseInfo);
}
this.saveOrUpdateBatch(list);
} else {
System.out.println("失败:current:" + csoftDataTzsbJbxxListParam.getCurrentPage());
System.out.println("失败:" + response.getErrorMsg());
System.out.println("失败:" + response.getErrorCode());
throw new Exception(response.getErrorMsg());
}
}
}
package com.yeejoin.amos.api.openapi.face.service;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.csoft.sdk.client.CsoftDefaultSdkClient;
import com.csoft.sdk.domain.App;
import com.csoft.sdk.domain.CsoftDataTzsbXkxxListParam;
import com.csoft.sdk.domain.request.CsoftDataTzsbXkxxListRequest;
import com.csoft.sdk.domain.response.CsoftDataTzsbXkxxListResponse;
import com.yeejoin.amos.api.openapi.face.model.TaLicenseDetailInfoModel;
import com.yeejoin.amos.api.openapi.face.orm.dao.TaLicenseDetailInfoMapper;
import com.yeejoin.amos.api.openapi.face.orm.entity.TaAccessConfig;
import com.yeejoin.amos.api.openapi.face.orm.entity.TaLicenseDetailInfo;
/**
* 附件表 服务实现类
*
* @author duanwei
* @date 2022-08-17
*/
@Service
public class TaLicenseDetailInfoServiceImpl extends BaseService<TaLicenseDetailInfoModel, TaLicenseDetailInfo, TaLicenseDetailInfoMapper> {
@Autowired
TaAccessConfigServiceImpl taAccessConfigServiceImpl;
/**
*
* 新增许可信息-许可详细信息表
*
* @param model 许可详细信息实体类集合
* @return 成功返回“OK”
*/
@Transactional(rollbackFor= {Exception.class})
public String saveLicenseDetailInfo(List<TaLicenseDetailInfo> model) {
//TODO Auto-generated method stub
if (ValidationUtil.isEmpty(model)) {
throw new BadRequest("接入配置表信息为空.");
}
for (TaLicenseDetailInfo models : model) {
// checkModel(models);
models.setRecDate(new Date());
// models.setAppId(getAppId());
}
this.saveBatch(model);
return "OK";
}
public void syncLicenseData() throws Exception {
Map<String, String> map = TaAccessConfigServiceImpl.licenseConfig;
String appId = map.get("appId");
String appKey = map.get("appKey");
String appSecret = map.get("appSecret");
String server = map.get("server");
String startTime = map.get("startTime");
//String endTime = map.get("endTime");
int isAll = Integer.valueOf(map.get("isAllDetail"));
App app = App.of(appId, appKey, appSecret, server);
int current = 1;
int size = Integer.valueOf(map.get("pageSize"));
// 2.初始化请求客户端
CsoftDefaultSdkClient client = CsoftDefaultSdkClient.of(app);
// 3.设置参数,发送请求,并处理结果
CsoftDataTzsbXkxxListParam csoftDataTzsbXKxxListParam = new CsoftDataTzsbXkxxListParam();
if (isAll == 0) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// 开始日期
csoftDataTzsbXKxxListParam.setStaTime(startTime);
// 结束日期
csoftDataTzsbXKxxListParam.setEndTime(sdf.format(new Date()));
} else {
SimpleDateFormat sdfsta = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
SimpleDateFormat sdfend = new SimpleDateFormat("yyyy-MM-dd 23:59:59");
// 开始日期
csoftDataTzsbXKxxListParam.setStaTime(sdfsta.format(new Date()));
// 结束日期
csoftDataTzsbXKxxListParam.setEndTime(sdfend.format(new Date()));
}
csoftDataTzsbXKxxListParam.setPageSize(size); // 每 页记录数
csoftDataTzsbXKxxListParam.setCurrentPage(current); // 当前页码
CsoftDataTzsbXkxxListRequest request = new CsoftDataTzsbXkxxListRequest(csoftDataTzsbXKxxListParam);
CsoftDataTzsbXkxxListResponse response = client.execute(request);
// 4.返回校验
if (response.isSuccess()) {
System.out.println("成功:" + response.getData());
System.out.println(response.getResult());
JSONObject jsonObject = JSONObject.parseObject(response.getData());
JSONObject data = jsonObject.getJSONObject("data");
JSONArray jsonArray = data.getJSONArray("objList");
List<TaLicenseDetailInfo> list = new ArrayList<TaLicenseDetailInfo>();
for (Object obj : jsonArray) {
String jsonString = JSONObject.toJSONString(obj);
TaLicenseDetailInfo taLicenseDetailInfo = JSONObject.parseObject(jsonString, TaLicenseDetailInfo.class);
taLicenseDetailInfo.setSyncDate(new Date());
taLicenseDetailInfo.setSyncState(0);
TaLicenseDetailInfo oldTaLicenseDetailInfo = this.getOne(new LambdaQueryWrapper<TaLicenseDetailInfo>()
.eq(TaLicenseDetailInfo::getId, taLicenseDetailInfo.getId()));
if (oldTaLicenseDetailInfo != null) {
taLicenseDetailInfo.setSequenceNbr(oldTaLicenseDetailInfo.getSequenceNbr());
}
list.add(taLicenseDetailInfo);
}
this.saveOrUpdateBatch(list);
while (data.getInteger("totalNum") > current * size) {
csoftDataTzsbXKxxListParam.setCurrentPage(++current);
saveData(client, csoftDataTzsbXKxxListParam);
}
if (isAll == 0) {
taAccessConfigServiceImpl
.update(new LambdaUpdateWrapper<TaAccessConfig>().eq(TaAccessConfig::getBizType, "license")
.eq(TaAccessConfig::getBizKey, "isAllDetail").set(TaAccessConfig::getBizValue, 1));
}
} else {
System.out.println("失败:" + response.getErrorMsg());
System.out.println("失败:" + response.getErrorCode());
throw new Exception(response.getErrorMsg());
}
}
private void saveData(CsoftDefaultSdkClient client, CsoftDataTzsbXkxxListParam csoftDataTzsbXKxxListParam) throws Exception {
// 2.初始化请求客户端
CsoftDataTzsbXkxxListRequest request = new CsoftDataTzsbXkxxListRequest(csoftDataTzsbXKxxListParam);
CsoftDataTzsbXkxxListResponse response = client.execute(request);
// 4.返回校验
if (response.isSuccess()) {
System.out.println("成功:" + response.getData());
System.out.println(response.getResult());
JSONObject jsonObject = JSONObject.parseObject(response.getData());
JSONObject data = jsonObject.getJSONObject("data");
JSONArray jsonArray = data.getJSONArray("objList");
List<TaLicenseDetailInfo> list = new ArrayList<TaLicenseDetailInfo>();
for (Object obj : jsonArray) {
String jsonString = JSONObject.toJSONString(obj);
TaLicenseDetailInfo taLicenseDetailInfo = JSONObject.parseObject(jsonString, TaLicenseDetailInfo.class);
taLicenseDetailInfo.setSyncDate(new Date());
taLicenseDetailInfo.setSyncState(0);
TaLicenseDetailInfo oldTaLicenseDetailInfo = this.getOne(new LambdaQueryWrapper<TaLicenseDetailInfo>()
.eq(TaLicenseDetailInfo::getId, taLicenseDetailInfo.getId()));
if (oldTaLicenseDetailInfo != null) {
taLicenseDetailInfo.setSequenceNbr(oldTaLicenseDetailInfo.getSequenceNbr());
}
list.add(taLicenseDetailInfo);
}
this.saveOrUpdateBatch(list);
} else {
System.out.println("失败:current:" + csoftDataTzsbXKxxListParam.getCurrentPage());
System.out.println("失败:" + response.getErrorMsg());
System.out.println("失败:" + response.getErrorCode());
throw new Exception(response.getErrorMsg());
}
}
}
package com.yeejoin.amos.openapi.enums;
/**
* <pre>
* 监管附件对象属性枚举
* </pre>
*
* @author Zhang Yingbin
*/
public enum TaAccessConfigBizeEnum {
LICENSE("license", "许可信息");
/**
* 属性
*/
private String attribute;
/**
* 对象
*/
private String object;
TaAccessConfigBizeEnum(String attribute, String object) {
this.attribute = attribute;
this.object = object;
}
public String getAttribute() {
return attribute;
}
public void setAttribute(String attribute) {
this.attribute = attribute;
}
public String getObject() {
return object;
}
public void setObject(String object) {
this.object = object;
}
}
spring.application.name=AMOS-API-ACCESSAPI
server.servlet.context-path=/accessapi
server.port=11005
# jdbc_config
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://172.16.10.90:53306/tzs_amos_openapi?allowMultiQueries=true&serverTimezone=GMT%2B8\
&characterEncoding=utf8
spring.datasource.username=root
spring.datasource.password=Yeejoin@2020
spring.datasource.type=com.zaxxer.hikari.HikariDataSource
spring.datasource.hikari.minimum-idle=5
spring.datasource.hikari.maximum-pool-size=15
spring.datasource.hikari.auto-commit=true
spring.datasource.hikari.idle-timeout=30000
spring.datasource.hikari.pool-name=DatebookHikariCP
spring.datasource.hikari.max-lifetime=1800000
spring.datasource.hikari.connection-timeout=30000
spring.datasource.hikari.connection-test-query=SELECT 1
# REDIS (RedisProperties)
spring.redis.database=1
spring.redis.host=172.16.10.90
spring.redis.port=6379
spring.redis.password=yeejoin@2020
spring.redis.lettuce.pool.max-active=200
spring.redis.lettuce.pool.max-wait=-1
spring.redis.lettuce.pool.max-idle=10
spring.redis.lettuce.pool.min-idle=0
spring.redis.expire.time=300
#注册中心地址
eureka.client.service-url.defaultZone =http://172.16.3.99:10001/eureka/
eureka.instance.prefer-ip-address=true
management.endpoint.health.show-details=always
management.endpoints.web.exposure.include=*
eureka.instance.health-check-url=http://localhost:${server.port}${server.servlet.context-path}/actuator/health
eureka.instance.metadata-map.management.context-path=${server.servlet.context-path}/actuator
eureka.instance.status-page-url=http://localhost:${server.port}${server.servlet.context-path}/actuator/info
eureka.instance.metadata-map.management.api-docs=http://localhost:${server.port}${server.servlet.context-path}/swagger-ui.html
eureka.instance.ip-address=localhost
eureka.instance.instance-id=${eureka.instance.ip-address}:${server.port}
##emqx
emqx.clean-session=true
emqx.client-id=${spring.application.name}-${random.int[1024,65536]}
emqx.broker=tcp://172.16.10.90:1883
emqx.user-name=admin
emqx.password=public
##biz custem properties
biz.lxyd.lift.url=http://39.106.181.149:8088/elevatorapi
\ No newline at end of file
spring.application.name=AMOS-API-ACCESSAPI
server.servlet.context-path=/accessapi
server.port=11005
# jdbc_config
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://172.16.10.90:53306/tzs_amos_openapi?allowMultiQueries=true&serverTimezone=GMT%2B8\
&characterEncoding=utf8
spring.datasource.username=root
spring.datasource.password=Yeejoin@2020
spring.datasource.type=com.zaxxer.hikari.HikariDataSource
spring.datasource.hikari.minimum-idle=5
spring.datasource.hikari.maximum-pool-size=15
spring.datasource.hikari.auto-commit=true
spring.datasource.hikari.idle-timeout=30000
spring.datasource.hikari.pool-name=DatebookHikariCP
spring.datasource.hikari.max-lifetime=1800000
spring.datasource.hikari.connection-timeout=30000
spring.datasource.hikari.connection-test-query=SELECT 1
# REDIS (RedisProperties)
spring.redis.database=1
spring.redis.host=172.16.10.90
spring.redis.port=6379
spring.redis.password=yeejoin@2020
spring.redis.lettuce.pool.max-active=200
spring.redis.lettuce.pool.max-wait=-1
spring.redis.lettuce.pool.max-idle=10
spring.redis.lettuce.pool.min-idle=0
spring.redis.expire.time=300
#注册中心地址
eureka.client.service-url.defaultZone =http://172.16.3.99:10001/eureka/
eureka.instance.prefer-ip-address=true
management.endpoint.health.show-details=always
management.endpoints.web.exposure.include=*
eureka.instance.health-check-url=http://localhost:${server.port}${server.servlet.context-path}/actuator/health
eureka.instance.metadata-map.management.context-path=${server.servlet.context-path}/actuator
eureka.instance.status-page-url=http://localhost:${server.port}${server.servlet.context-path}/actuator/info
eureka.instance.metadata-map.management.api-docs=http://localhost:${server.port}${server.servlet.context-path}/swagger-ui.html
##emqx
emqx.clean-session=true
emqx.client-id=${spring.application.name}-${random.int[1024,65536]}
emqx.broker=tcp://172.16.10.90:1883
emqx.user-name=admin
emqx.password=public
##biz custem properties
biz.lxyd.lift.url=http://39.106.181.149:8088/elevatorapi
\ No newline at end of file
spring.profiles.active=dev
server.compression.enabled=true
spring.jackson.dateFormat=yyyy-MM-dd HH:mm:ss
logging.config=classpath:logback-${spring.profiles.active}.xml
#设置文件上传的大小限制
spring.servlet.multipart.maxFileSize=3MB
spring.servlet.multipart.maxRequestSize=3MB
## redis失效时间
redis.cache.failure.time=10800
# mybatis-plus
mybatis-plus.mapper-locations=classpath:mapper/*Mapper.xml
mybatis-plus.type-aliases-super-type=org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity
mybatis-plus.global-config.db-config.id-type=ID_WORKER
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false">
<!--定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路径-->
<property name="LOG_HOME" value="log" />
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
<property name="LOG_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %-50.50logger{50} - %msg [%file:%line] %n" />
<!-- 按照每天生成日志文件 -->
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<!--日志文件输出的文件名-->
<FileNamePattern>${LOG_HOME}/tzs.log.%d{yyyy-MM-dd}.%i.log</FileNamePattern>
<!--日志文件保留天数-->
<MaxHistory>30</MaxHistory>
<!--日志文件大小-->
<MaxFileSize>30mb</MaxFileSize>
</rollingPolicy>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>${LOG_PATTERN}</pattern>
</encoder>
</appender>
<!-- 控制台输出 -->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>${LOG_PATTERN}</pattern>
</encoder>
</appender>
<!-- show parameters for hibernate sql 专为 Hibernate 定制
<logger name="org.hibernate.type.descriptor.sql.BasicBinder" level="TRACE" />
<logger name="org.hibernate.type.descriptor.sql.BasicExtractor" level="DEBUG" />
<logger name="org.hibernate.SQL" level="DEBUG" />
<logger name="org.hibernate.engine.QueryParameters" level="DEBUG" />
<logger name="org.hibernate.engine.query.HQLQueryPlan" level="DEBUG" />
-->
<!--myibatis log configure-->
<logger name="com.apache.ibatis" level="INFO"/>
<logger name="org.mybatis" level="INFO" />
<logger name="java.sql.Connection" level="INFO"/>
<logger name="java.sql.Statement" level="INFO"/>
<logger name="java.sql.PreparedStatement" level="INFO"/>
<logger name="org.springframework" level="INFO"/>
<logger name="com.baomidou.mybatisplus" level="INFO"/>
<logger name="org.apache.activemq" level="INFO"/>
<logger name="org.typroject" level="INFO"/>
<logger name="com.yeejoin" level="INFO"/>
<!-- 日志输出级别 -->
<root level="DEBUG">
<!-- <appender-ref ref="FILE" /> -->
<appender-ref ref="STDOUT" />
</root>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false">
<!--定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路径-->
<property name="LOG_HOME" value="/opt/log/qa" />
<!-- 按照每天生成日志文件 -->
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!--日志文件输出的文件名-->
<FileNamePattern>${LOG_HOME}/accessqa.log.%d{yyyy-MM-dd}.log</FileNamePattern>
<!--日志文件保留天数-->
<MaxHistory>7</MaxHistory>
</rollingPolicy>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
</encoder>
<!--日志文件最大的大小-->
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<MaxFileSize>20mb</MaxFileSize>
</triggeringPolicy>
</appender>
<!--myibatis log configure-->
<logger name="com.apache.ibatis" level="ERROR"/>
<logger name="org.mybatis" level="ERROR" />
<logger name="java.sql.Connection" level="ERROR"/>
<logger name="java.sql.Statement" level="ERROR"/>
<logger name="java.sql.PreparedStatement" level="ERROR"/>
<logger name="com.baomidou.mybatisplus" level="ERROR"/>
<logger name="org.typroject" level="ERROR"/>
<logger name="com.yeejoin" level="ERROR"/>
<logger name="org.springframework" level="INFO"/>
<!-- 日志输出级别 -->
<root level="ERROR">
<appender-ref ref="FILE" />
</root>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.api.openapi.face.orm.dao.DataDictionaryMapper">
<select id="getData" resultType="java.lang.String">
select `name` FROM cb_data_dictionary WHERE code=#{code} and type="IndustryCode"
</select>
</mapper>
package com.yeejoin.amos.api.openapi.aop; package com.yeejoin.amos.api.openapi.aop;
import javax.servlet.http.HttpServletRequest; import com.yeejoin.amos.api.openapi.constant.Constant;
import com.yeejoin.amos.api.openapi.face.model.BizTokenModel;
import com.yeejoin.amos.component.feign.config.TokenOperation;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
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;
...@@ -17,15 +20,13 @@ import org.typroject.tyboot.core.auth.exception.AuthException; ...@@ -17,15 +20,13 @@ 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 javax.servlet.http.HttpServletRequest;
import com.yeejoin.amos.api.openapi.face.model.BizTokenModel;
import com.yeejoin.amos.component.feign.config.TokenOperation;
@Aspect @Aspect
@Component @Component
@Order(value = 0) @Order(value = 0)
public class ControllerAop { public class ControllerAop {
private static final Logger logger = LogManager.getLogger(ControllerAop.class);
@Autowired @Autowired
private RedisTemplate redisTemplate; private RedisTemplate redisTemplate;
...@@ -38,11 +39,13 @@ public class ControllerAop { ...@@ -38,11 +39,13 @@ public class ControllerAop {
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();
logger.info("request>>>",request);
// 不需要添加请求头的接口 // 不需要添加请求头的接口
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","/cylinderPage/serviceProvider","/cylinderPage/getTableInfo","/cylinderPage/initCylinderNum"}; 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","/cylinderPage/serviceProvider","/cylinderPage/getTableInfo","/cylinderPage/initCylinderNum","/openapi/appId/setAppId"};
// 获取请求路径 // 获取请求路径
for(String uri : url) { for(String uri : url) {
if(request.getRequestURI().indexOf(uri) != -1) { if(request.getRequestURI().indexOf(uri) != -1) {
logger.info("uri>>>",uri);
return; return;
} }
} }
......
package com.yeejoin.amos.api.openapi.controller; package com.yeejoin.amos.api.openapi.controller;
import org.apache.logging.log4j.LogManager; import com.yeejoin.amos.api.common.restful.utils.ResponseHelper;
import org.apache.logging.log4j.Logger; import com.yeejoin.amos.api.common.restful.utils.ResponseModel;
import com.yeejoin.amos.api.openapi.constant.Constant; import com.yeejoin.amos.api.openapi.constant.Constant;
import com.yeejoin.amos.feign.privilege.util.DesUtil; import com.yeejoin.amos.feign.privilege.util.DesUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
@RestController
@RequestMapping(value = "/appId")
@Api(tags = "appid-生成appid类")
public class AppIdMain { public class AppIdMain {
private static final Logger logger = LogManager.getLogger(AppIdMain.class); private static final Logger logger = LogManager.getLogger(AppIdMain.class);
public static void main(String[] args) { // public static void main(String[] args) {
String appId = DesUtil.encode("000007", Constant.SECRETKEY); // String appId = DesUtil.encode("000010", Constant.SECRETKEY);
logger.info("appId信息:", appId); // logger.info("appId信息:", appId);
System.out.println("appId信息:" + appId); // System.out.println("appId信息:" + appId);
// }
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "生成AppId")
@GetMapping(value = "/setAppId")
public ResponseModel<String> applyAppId (
@RequestParam String apiCompanyCode) throws Exception
{
logger.info("appId信息:",apiCompanyCode);
String appId = DesUtil.encode(apiCompanyCode, Constant.SECRETKEY);
logger.info("appToken信息:",appId);
return ResponseHelper.buildResponse(appId);
} }
} }
...@@ -73,65 +73,33 @@ public class CylinderController { ...@@ -73,65 +73,33 @@ public class CylinderController {
@ApiOperation(value = "气瓶企业信息") @ApiOperation(value = "气瓶企业信息")
@PostMapping(value = "/unit") @PostMapping(value = "/unit")
@RestEventTrigger(value = "openapiLogEventHandler") @RestEventTrigger(value = "openapiLogEventHandler")
public ResponseModel<String> cylinderUnit(@RequestBody String unitData) throws Exception { public ResponseModel<String> cylinderUnit(@RequestBody List<CylinderUnitModel> unitData) throws Exception {
return ResponseHelper.buildResponse(cylinderUnitService.createCylinderUnit(unitData));
logger.info("气瓶企业信息"+unitData);
JSONObject jsonobject = JSONObject.fromObject(unitData);
Map<String, Class> classMap = new HashMap<String, Class>();
classMap.put("unit", CylinderUnitModel.class);
CylinderUnitModelList cylinderUnitModelList = (CylinderUnitModelList) JSONObject.toBean(jsonobject,
CylinderUnitModelList.class, classMap);
cylinderUnitService.createCylinderUnit(cylinderUnitModelList.getUnit());
return ResponseHelper.buildResponse("");
} }
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "气瓶基础数据") @ApiOperation(value = "气瓶基础数据")
@PostMapping(value = "/info") @PostMapping(value = "/info")
@RestEventTrigger(value = "openapiLogEventHandler") @RestEventTrigger(value = "openapiLogEventHandler")
public ResponseModel<String> cylinderInfo(@RequestBody String infoData) throws Exception { public ResponseModel<String> cylinderInfo(@RequestBody List<CylinderInfoModel> infoData) throws Exception {
return ResponseHelper.buildResponse(cylinderInfoService.createCylinderInfo(infoData));
logger.info("气瓶基础数据"+infoData);
JSONObject jsonobject = JSONObject.fromObject(infoData);
Map<String, Class> classMap = new HashMap<String, Class>();
classMap.put("info", CylinderInfoModel.class);
CylinderInfoModelList cylinderInfoModelList = (CylinderInfoModelList) JSONObject.toBean(jsonobject,
CylinderInfoModelList.class, classMap);
cylinderInfoService.createCylinderInfo(cylinderInfoModelList.getInfo());
return ResponseHelper.buildResponse("");
} }
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "气瓶标签数据") @ApiOperation(value = "气瓶标签数据")
@PostMapping(value = "/tag") @PostMapping(value = "/tag")
@RestEventTrigger(value = "openapiLogEventHandler") @RestEventTrigger(value = "openapiLogEventHandler")
public ResponseModel<String> cylinderTagInfo(@RequestBody String tagData) throws Exception { public ResponseModel<String> cylinderTagInfo(@RequestBody List<CylinderTagsModel> tagData) throws Exception {
return ResponseHelper.buildResponse(cylinderTagsService.createCylinderTag(tagData));
logger.info("气瓶标签数据"+tagData);
JSONObject jsonobject = JSONObject.fromObject(tagData);
Map<String, Class> classMap = new HashMap<String, Class>();
classMap.put("tag", CylinderTagsModel.class);
CylinderTagsModelList cylinderTagsModelList = (CylinderTagsModelList) JSONObject.toBean(jsonobject,
CylinderTagsModelList.class, classMap);
cylinderTagsService.createCylinderTag(cylinderTagsModelList.getTag());
return ResponseHelper.buildResponse("");
} }
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "气瓶检验数据") @ApiOperation(value = "气瓶检验数据")
@PostMapping(value = "/inspection") @PostMapping(value = "/inspection")
@RestEventTrigger(value = "openapiLogEventHandler") @RestEventTrigger(value = "openapiLogEventHandler")
public ResponseModel<String> cylinderInspectionInfo(@RequestBody String inspectionData) throws Exception { public ResponseModel<String> cylinderInspectionInfo(@RequestBody List<CylinderInspectionModel> inspectionData) throws Exception {
return ResponseHelper.buildResponse(cylinderInspectionService.createCylinderInspection(inspectionData));
logger.info("气瓶检验数据"+inspectionData);
JSONObject jsonobject = JSONObject.fromObject(inspectionData);
Map<String, Class> classMap = new HashMap<String, Class>();
classMap.put("inspection", CylinderInspectionModel.class);
CylinderInspectionModelList cylinderInspectionModelList = (CylinderInspectionModelList) JSONObject
.toBean(jsonobject, CylinderInspectionModelList.class, classMap);
cylinderInspectionService.createCylinderInspection(cylinderInspectionModelList.getInspection());
return ResponseHelper.buildResponse("");
} }
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
...@@ -173,15 +141,8 @@ public class CylinderController { ...@@ -173,15 +141,8 @@ public class CylinderController {
@ApiOperation(value = "气瓶充装审核数据") @ApiOperation(value = "气瓶充装审核数据")
@PostMapping(value = "/fillingAudit") @PostMapping(value = "/fillingAudit")
@RestEventTrigger(value = "openapiLogEventHandler") @RestEventTrigger(value = "openapiLogEventHandler")
public ResponseModel<String> cylinderFillingAudit(@RequestBody String fillingAuditData) throws Exception { public ResponseModel<String> cylinderFillingAudit(@RequestBody List<CylinderFillingExamineModel> fillingAuditData) throws Exception {
return ResponseHelper.buildResponse(cylinderFillingExamineService.createCylinderFillingExamine(fillingAuditData));
logger.info("气瓶充装审核数据"+fillingAuditData);
JSONObject jsonobject = JSONObject.fromObject(fillingAuditData);
Map<String, Class> classMap = new HashMap<String, Class>();
classMap.put("fillingAudit", CylinderFillingExamineModel.class);
CylinderFillingExamineModelList cylinderFillingExamineModelList = (CylinderFillingExamineModelList) JSONObject
.toBean(jsonobject, CylinderFillingExamineModelList.class, classMap);
cylinderFillingExamineService.createCylinderFillingExamine(cylinderFillingExamineModelList.getFillingAudit());
return ResponseHelper.buildResponse("");
} }
} }
...@@ -6,29 +6,18 @@ import com.yeejoin.amos.api.common.restful.utils.ResponseModel; ...@@ -6,29 +6,18 @@ import com.yeejoin.amos.api.common.restful.utils.ResponseModel;
import com.yeejoin.amos.api.openapi.face.model.CylinderTableModel; import com.yeejoin.amos.api.openapi.face.model.CylinderTableModel;
import com.yeejoin.amos.api.openapi.face.model.CylinderUnitTree; import com.yeejoin.amos.api.openapi.face.model.CylinderUnitTree;
import com.yeejoin.amos.api.openapi.face.orm.entity.OpenapiBizToken; import com.yeejoin.amos.api.openapi.face.orm.entity.OpenapiBizToken;
import com.yeejoin.amos.api.openapi.face.service.CylinderDateInfoService; import com.yeejoin.amos.api.openapi.face.service.*;
import com.yeejoin.amos.api.openapi.face.service.CylinderFillingCheckService;
import com.yeejoin.amos.api.openapi.face.service.CylinderFillingExamineService;
import com.yeejoin.amos.api.openapi.face.service.CylinderFillingRecordService;
import com.yeejoin.amos.api.openapi.face.service.CylinderFillingService;
import com.yeejoin.amos.api.openapi.face.service.CylinderInfoService;
import com.yeejoin.amos.api.openapi.face.service.CylinderInspectionService;
import com.yeejoin.amos.api.openapi.face.service.CylinderTagsService;
import com.yeejoin.amos.api.openapi.face.service.CylinderUnitService;
import com.yeejoin.amos.api.openapi.face.service.OpenapiBizTokenService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.doc.TycloudResource;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -92,7 +81,7 @@ public class CylinderPageController { ...@@ -92,7 +81,7 @@ public class CylinderPageController {
@RequestParam(value = "startTime",required = false) String startTime, @RequestParam(value = "startTime",required = false) String startTime,
@RequestParam(value = "endTime",required = false) String endTime) { @RequestParam(value = "endTime",required = false) String endTime) {
// 先同步或者更新今日数据 // 先同步或者更新今日数据
cylinderDateInfoService.updateTodayDate(); // cylinderDateInfoService.updateTodayDate();
// 查询数据 // 查询数据
List<CylinderTableModel> result = cylinderDateInfoService.selectTodayDate(serviceName, appId, startTime, endTime); List<CylinderTableModel> result = cylinderDateInfoService.selectTodayDate(serviceName, appId, startTime, endTime);
return ResponseHelper.buildResponse(result); return ResponseHelper.buildResponse(result);
......
package com.yeejoin.amos.api.openapi.controller;
import java.util.Date;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.api.openapi.face.model.EquipmentModel;
import com.yeejoin.amos.api.openapi.face.orm.entity.PageParam;
import com.yeejoin.amos.api.openapi.face.service.EquipmentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
/**
* 特种设备监管controller
*/
@RestController
@Api(tags = "设备Api")
@RequestMapping(value = "/equipment")
public class EquipmentController {
@Autowired
EquipmentService iEquipmentService;
/**
* 查询监管设备列表
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = true)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET", value = "查询监管设备列表", notes = "查询监管设备列表")
public ResponseModel<IPage<EquipmentModel>> page(PageParam pageParam,
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date startTime,
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date endTime) {
return ResponseHelper.buildResponse(iEquipmentService.page(pageParam, startTime, endTime));
}
}
...@@ -10,6 +10,7 @@ import org.springframework.web.bind.annotation.RequestBody; ...@@ -10,6 +10,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.component.event.RestEventTrigger;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
...@@ -51,6 +52,7 @@ public class FilesController { ...@@ -51,6 +52,7 @@ public class FilesController {
JSONObject jsonObj = uploadFile(file,"csei"); JSONObject jsonObj = uploadFile(file,"csei");
return ResponseHelper.buildResponse(jsonObj.toString()); return ResponseHelper.buildResponse(jsonObj.toString());
} }
private JSONObject uploadFile(MultipartFile file,String tag) { private JSONObject uploadFile(MultipartFile file,String tag) {
if (ValidationUtil.isEmpty(file)){ if (ValidationUtil.isEmpty(file)){
throw new BadRequest("参数校验失败."); throw new BadRequest("参数校验失败.");
...@@ -69,4 +71,21 @@ public class FilesController { ...@@ -69,4 +71,21 @@ public class FilesController {
} }
return jsonObj; return jsonObj;
} }
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "上传附件")
@PostMapping("/supma")
public ResponseModel<JSONObject> upload(@RequestBody MultipartFile file){
FeignClientResult<Map<String, String>> date = Systemctl.fileStorageClient.updateCommonFile(file);
JSONObject jsonObj = new JSONObject();
if (date != null) {
Map<String, String> map = date.getResult();
Iterator<String> it = map.keySet().iterator();
String urlString=it.next();
jsonObj.put("fileUrl", urlString);
jsonObj.put("fileName", map.get(urlString));
}
return ResponseHelper.buildResponse(jsonObj);
}
} }
package com.yeejoin.amos.api.openapi.controller;
import com.yeejoin.amos.api.common.restful.utils.ResponseHelper;
import com.yeejoin.amos.api.common.restful.utils.ResponseModel;
import com.yeejoin.amos.api.openapi.face.model.*;
import com.yeejoin.amos.api.openapi.face.orm.entity.*;
import com.yeejoin.amos.api.openapi.face.service.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.component.event.RestEventTrigger;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import java.util.List;
/**
* 监管业务数据对接
*
* @author Zhang Yingbin
*/
@RestController
@RequestMapping(value = "/openapijg/supervise")
@Api(tags = "Supervise-监管业务数据接入")
public class SuperviseController {
@Autowired
private DesignInfoService designInfoService;
@Autowired
private ProduceInfoService produceInfoService;
@Autowired
private ConstructionInfoService constructionInfoService;
@Autowired
private RegistrationInfoService registrationInfoService;
@Autowired
private UseInfoService useInfoService;
@Autowired
private MaintenanceInfoService maintenanceInfoService;
@Autowired
private SuperviseInfoService superviseInfoService;
@Autowired
private OtherInfoService otherInfoService;
@Autowired
private ElevatorTechInfoService evatorTechInfoService;
@Autowired
private EnclosureInfoService enclosureInfoService;
@Autowired
private EnterpriseInfoService enterpriseInfoService;
@Autowired
private StaffBaseInfoService staffBaseInfoService;
@Autowired
private StaffQualifInfoService staffQualifInfoService;
@Autowired
private InspectionInfoService inspectionInfoService;
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "新增设计信息")
@PostMapping(value = "/designInfo")
@RestEventTrigger(value = "openapiLogEventHandler")
public ResponseModel<String> saveDesignInfo (@RequestBody List<DesignInfoModel> designInfo) throws Exception
{
return ResponseHelper.buildResponse(designInfoService.saveDesignInfo(designInfo));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "新增制造信息")
@PostMapping(value = "/produceInfo")
@RestEventTrigger(value = "openapiLogEventHandler")
public ResponseModel<String> saveProduceInfo (@RequestBody List<ProduceInfoModel> produceInfo) throws Exception
{
return ResponseHelper.buildResponse(produceInfoService.saveProduceInfo(produceInfo));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "新增施工信息")
@PostMapping(value = "/constructionInfo")
@RestEventTrigger(value = "openapiLogEventHandler")
public ResponseModel<String> saveConstructionInfo (@RequestBody List<ConstructionInfo> constructionInfo) throws Exception
{
return ResponseHelper.buildResponse(constructionInfoService.saveConstructionInfo(constructionInfo));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "新增注册等级信息")
@PostMapping(value = "/registrationInfo")
@RestEventTrigger(value = "openapiLogEventHandler")
public ResponseModel<String> saveRegistrationInfo (@RequestBody List<RegistrationInfoModel> registrationInfo) throws Exception
{
return ResponseHelper.buildResponse(registrationInfoService.saveRegistrationInfo(registrationInfo));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "新增使用信息")
@PostMapping(value = "/useInfo")
@RestEventTrigger(value = "openapiLogEventHandler")
public ResponseModel<String> saveUseInfo (@RequestBody List<UseInfo> useInfo) throws Exception
{
return ResponseHelper.buildResponse(useInfoService.saveUseInfo(useInfo));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "新增维保单位信息")
@PostMapping(value = "/maintenanceInfo")
@RestEventTrigger(value = "openapiLogEventHandler")
public ResponseModel<String> saveMaintenanceInfo (@RequestBody List<MaintenanceInfoModel> maintenanceInfo) throws Exception
{
return ResponseHelper.buildResponse(maintenanceInfoService.saveMaintenanceInfo(maintenanceInfo));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "新增监督管理信息")
@PostMapping(value = "/superviseInfo")
@RestEventTrigger(value = "openapiLogEventHandler")
public ResponseModel<String> saveSuperviseInfo (@RequestBody List<SuperviseInfo> superviseInfo) throws Exception
{
return ResponseHelper.buildResponse(superviseInfoService.saveSuperviseInfo(superviseInfo));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "新增其他信息")
@PostMapping(value = "/otherInfo")
@RestEventTrigger(value = "openapiLogEventHandler")
public ResponseModel<String> saveOtherInfo (@RequestBody List<OtherInfo> otherInfo) throws Exception
{
return ResponseHelper.buildResponse(otherInfoService.saveOtherInfo(otherInfo));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "新增电梯技术参数")
@PostMapping(value = "/elevatorTechInfo")
@RestEventTrigger(value = "openapiLogEventHandler")
public ResponseModel<String> saveElevatorTechInfo (@RequestBody List<ElevatorTechInfoModel> elevatorTechInfo) throws Exception
{
return ResponseHelper.buildResponse(evatorTechInfoService.saveElevatorTechInfo(elevatorTechInfo));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "新增特种设备附件资料信息")
@PostMapping(value = "/enclosureInfo")
@RestEventTrigger(value = "openapiLogEventHandler")
public ResponseModel<String> saveEnclosureInfo (@RequestBody List<EnclosureInfo> enclosureInfo) throws Exception
{
return ResponseHelper.buildResponse(enclosureInfoService.saveEnclosureInfo(enclosureInfo));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "新增企业数据信息")
@PostMapping(value = "/enterpriseInfo")
@RestEventTrigger(value = "openapiLogEventHandler")
public ResponseModel<String> saveEnterpriseInfo (@RequestBody List<EnterpriseInfoModel> enterpriseInfo) throws Exception
{
return ResponseHelper.buildResponse(enterpriseInfoService.saveEnterpriseInfo(enterpriseInfo));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "新增人员基本信息")
@PostMapping(value = "/staffBaseInfo")
@RestEventTrigger(value = "openapiLogEventHandler")
public ResponseModel<String> saveStaffBaseInfo (@RequestBody List<StaffBaseInfo> staffBaseInfo) throws Exception
{
return ResponseHelper.buildResponse(staffBaseInfoService.saveStaffBaseInfo(staffBaseInfo));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "新增人员资质信息")
@PostMapping(value = "/staffQualifInfo")
@RestEventTrigger(value = "openapiLogEventHandler")
public ResponseModel<String> saveStaffQualifInfo (@RequestBody List<StaffQualifInfoModel> staffQualifInfo) throws Exception
{
return ResponseHelper.buildResponse(staffQualifInfoService.saveStaffQualifInfo(staffQualifInfo));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "特种设备检验信息")
@PostMapping(value = "/inspectionInfo")
@RestEventTrigger(value = "openapiLogEventHandler")
public ResponseModel<String> saveInspectionInfo (@RequestBody List<InspectionInfoModel> inspectionInfo) throws Exception
{
return ResponseHelper.buildResponse(inspectionInfoService.saveInspectionInfo(inspectionInfo));
}
}
package com.yeejoin.amos.api.openapi.enums;
/**
* <pre>
* 监管附件对象属性枚举
* </pre>
*
* @author Zhang Yingbin
*/
public enum JgFileAttributeEnum {
DESIGN_FILE("designFile",JgFileObjectEnum.DESIGN_INFO.getObject()),
DESIGN_CODE("designCode",JgFileObjectEnum.DESIGN_INFO.getObject()),
PRODUCE_STANDARD("produceStandard",JgFileObjectEnum.PRODUCE_INFO.getObject()),
PRODUCT_CERTIFICATE("productCertificate",JgFileObjectEnum.PRODUCE_INFO.getObject()),
IUM_INSTRUCTIONS("iumInstructions",JgFileObjectEnum.PRODUCE_INFO.getObject()),
SUPERVISION_CERT("supervisionCert",JgFileObjectEnum.PRODUCE_INFO.getObject()),
CE_CERT("ceCert",JgFileObjectEnum.PRODUCE_INFO.getObject()),
USE_REGIST_CERTIFICATE("useRegistCertificate",JgFileObjectEnum.REGISTRATION_INFO.getObject()),
REPAIR_INFORM("repairInform",JgFileObjectEnum.MAINTENANCE_INFO.getObject()),
INSPECTION_REPORT("inspectionReport",JgFileObjectEnum.INSPECTION_INFO.getObject()),
BUSINESS_LICENSE("businessLicense",JgFileObjectEnum.ENTERPRISE_INFO.getObject()),
QUALIFICATION_CERT("qualificationCert",JgFileObjectEnum.STAFF_QUALIF_INFO.getObject()),
GOVERNOR_EFFI_REPORT("governorEffiReport",JgFileObjectEnum.ELEVATOR_TECH_INFO.getObject());
/**
* 属性
*/
private String attribute;
/**
* 对象
*/
private String object;
JgFileAttributeEnum(String attribute, String object) {
this.attribute = attribute;
this.object = object;
}
public String getAttribute() {
return attribute;
}
public void setAttribute(String attribute) {
this.attribute = attribute;
}
public String getObject() {
return object;
}
public void setObject(String object) {
this.object = object;
}
}
package com.yeejoin.amos.api.openapi.enums;
/**
* <pre>
* 监管附件对象枚举
* </pre>
*
* @author Zhang Yingbin
*/
public enum JgFileObjectEnum {
DESIGN_INFO("designInf"),
PRODUCE_INFO("produceInfo"),
REGISTRATION_INFO("registrationInfo"),
MAINTENANCE_INFO("maintenanceInfo"),
INSPECTION_INFO("inspectionInfo"),
ENTERPRISE_INFO("enterpriseInfo"),
STAFF_QUALIF_INFO("staffQualifInfo"),
ELEVATOR_TECH_INFO("elevatorTechInfo");
/**
* 对象
*/
private String object;
public String getObject() {
return object;
}
public void setObject(String object) {
this.object = object;
}
JgFileObjectEnum(String object) {
this.object = object;
}
}
package com.yeejoin.amos.api.openapi.face.model;
import java.io.Serializable;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
/**
* 特种设备基本信息-施工信息Vo
*
* @author duanwei
* @date 2022-07-20
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class ConstructionInfoModel extends AbstractBaseModel {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "设备唯一标识码")
/**
* 设备唯一标识码
*/
private String sequenceCode;
@ApiModelProperty(value = "监管系统唯一编码")
/**
* 监管系统唯一编码
*/
private String superviseCode;
@ApiModelProperty(value = "施工类型(安装、改造、移装)")
/**
* 施工类型(安装、改造、移装)
*/
private String constructionType;
@ApiModelProperty(value = "施工单位统一社会信用代码")
/**
* 施工单位统一社会信用代码
*/
private String uscUnitCreditCode;
@ApiModelProperty(value = "施工单位名称")
/**
* 施工单位名称
*/
private String uscUnitName;
@ApiModelProperty(value = "安装/改造/移装告知ID")
/**
* 安装/改造/移装告知ID
*/
private String uscInformId;
@ApiModelProperty(value = "施工时间")
/**
* 施工时间
*/
private Date uscDate;
}
...@@ -2,6 +2,7 @@ package com.yeejoin.amos.api.openapi.face.model; ...@@ -2,6 +2,7 @@ package com.yeejoin.amos.api.openapi.face.model;
import java.util.Date; import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
...@@ -14,9 +15,6 @@ public class CylinderFillingCheckModel extends AbstractBaseModel{ ...@@ -14,9 +15,6 @@ public class CylinderFillingCheckModel extends AbstractBaseModel{
*/ */
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private String fillingCheckId; //充装后复查ID private String fillingCheckId; //充装后复查ID
private String fillingUnitName; //充装企业名称*
private String factoryNum; //出厂编号
private String sequenceCode; //气瓶唯一标识码*
private int withinScope; //充装量在规定范围内* private int withinScope; //充装量在规定范围内*
private int sealedState; //瓶阀及其与瓶口连接的密封良好* private int sealedState; //瓶阀及其与瓶口连接的密封良好*
private int defective; //瓶体未出现鼓包变形或泄露等严重缺陷* private int defective; //瓶体未出现鼓包变形或泄露等严重缺陷*
...@@ -25,5 +23,6 @@ public class CylinderFillingCheckModel extends AbstractBaseModel{ ...@@ -25,5 +23,6 @@ public class CylinderFillingCheckModel extends AbstractBaseModel{
private String compliance; //液化气瓶充装量符合有关规定,充装后逐瓶称重 private String compliance; //液化气瓶充装量符合有关规定,充装后逐瓶称重
private String inspector; //检查人员姓名* private String inspector; //检查人员姓名*
private String inspectionDate; //检查时间* private String inspectionDate; //检查时间*
private String checkResults;
private String nonconformances;
} }
...@@ -14,7 +14,6 @@ public class CylinderFillingExamineModel extends AbstractBaseModel{ ...@@ -14,7 +14,6 @@ public class CylinderFillingExamineModel extends AbstractBaseModel{
*/ */
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private String fillingExamineId; //充装信息审核ID private String fillingExamineId; //充装信息审核ID
private String fillingUnitName; //充装企业名称
private String fillingAuditDate; //报表生成时间 private String fillingAuditDate; //报表生成时间
private String fillingAuditUrl; //充装审核报表附件地址 private String fillingAuditUrl; //充装审核报表附件地址
private String fillingAuditname; //充装审核报表附件名称 private String fillingAuditname; //充装审核报表附件名称
......
...@@ -13,10 +13,11 @@ public class CylinderFillingModel extends AbstractBaseModel{ ...@@ -13,10 +13,11 @@ public class CylinderFillingModel extends AbstractBaseModel{
* *
*/ */
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private String fillingBeforeId; // 充装前检查Id*
private String fillingUnitName; //充装企业名称*
private String factoryNum; //出厂编号
private String sequenceCode; //气瓶唯一标识码* private String sequenceCode; //气瓶唯一标识码*
private String fillingUnitName; //充装企业名称*
private String inspectorUser; //检查人员姓名*
private String inspectionDate; //检查时间*
private String creditCode; //统一社会信用代码
private String isValid; //是否在检验有效期以内,严禁充装超期未检气瓶、非法改装或翻新及报废气瓶 private String isValid; //是否在检验有效期以内,严禁充装超期未检气瓶、非法改装或翻新及报废气瓶
private int same; //警示标签上印有的瓶装气体的名称及化学分子式应与气瓶钢印标志是否一致* private int same; //警示标签上印有的瓶装气体的名称及化学分子式应与气瓶钢印标志是否一致*
private int isRegulations; //气瓶外表面的颜色标志是否符合规定* private int isRegulations; //气瓶外表面的颜色标志是否符合规定*
...@@ -24,7 +25,16 @@ public class CylinderFillingModel extends AbstractBaseModel{ ...@@ -24,7 +25,16 @@ public class CylinderFillingModel extends AbstractBaseModel{
private int haveStillPressure; //气瓶内有无剩余压力* private int haveStillPressure; //气瓶内有无剩余压力*
private int isComplete; //气瓶外表面有无裂纹、严重腐蚀、明显变形及其他严重外部损伤缺陷* private int isComplete; //气瓶外表面有无裂纹、严重腐蚀、明显变形及其他严重外部损伤缺陷*
private int haveSecurityDocuments; //气瓶的安全附件齐全并符合安全要求 private int haveSecurityDocuments; //气瓶的安全附件齐全并符合安全要求
private String inspectorUser; //检查人员姓名* private String fillBeforeItem; // 新投入使用气瓶或经检验后首次投入使用气瓶,充装前应按照规定先置换瓶内空气,并经分析合格后方可充气
private String inspectionDate; //检查时间* private String checkResults; //检查结果
private String nonconformances; //不合格项
/**
* 充装前检查id
*/
private String fillingBeforeId;
} }
...@@ -14,14 +14,16 @@ public class CylinderFillingRecordModel extends AbstractBaseModel{ ...@@ -14,14 +14,16 @@ public class CylinderFillingRecordModel extends AbstractBaseModel{
*/ */
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private String fillingRecordId; //充装记录Id* private String fillingRecordId; //充装记录Id*
private String fillingUnitName; //充装企业名称*
private String factoryNum; //出厂编号
private String sequenceCode; //气瓶唯一标识码*
private String fillingStartTime; //充装开始时间* private String fillingStartTime; //充装开始时间*
private String fillingEndTime; //充装结束时间* private String fillingEndTime; //充装结束时间*
private String fillingUser; //充装人员姓名* private String fillingUser; //充装人员姓名*
private double fillingQuantity; //充装量(Kg)* private double fillingQuantity; //充装量(Kg)*
private double temperature; //室温* private double temperature; //室温*
private int abnormal; //异常情况* private int abnormal; //异常情况*
private String inspectorName;
private String fillingBeforeId;
private String fillingCheckId;
private String fillingExamineId;
} }
...@@ -13,23 +13,32 @@ public class CylinderInfoModel extends AbstractBaseModel{ ...@@ -13,23 +13,32 @@ public class CylinderInfoModel extends AbstractBaseModel{
* *
*/ */
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private String cylinderId; //气瓶基本信息ID private String creditCode;
private String unitName; //产权单位名称 private String unitName;
private String factoryNum; //出厂编号 private String sequenceCode;
private int cylinderStatus; //气瓶状态 private int cylinderVariety;
private int cylinderVariety; //气瓶品种 private String unitInnerCode;
private String qrCode; //二维码编号 private String fillingMedia;
private String electronicLabelCode; //电子标签编号 private String manufacturingUnit;
private String fillingMedium; //充装介质 private String manufacturingDate;
private double pressure; //公称压力(MPa) private String productName;
private double volume; //容积(L) private String factoryNum;
private String manufacturingDate; //制造日期 private Double volume;
private String manufacturingUnit; //制造单位 private String productQualified;
private String license; //气瓶制造许可证 private String proofQuality;
private double cylinderWeight; //气瓶重量(kg) private String supervisionInspec;
private String unitInnerCode; //单位内部编号 private String typeExperiments;
private String inspectionDate; //最近一次检验日期 private int cylinderStatus;
private String nextInspectionDate; //下次检验日期 private String valveManufacturUnit;
private String sequenceCode; //气瓶唯一标识码 private Double nominalWorkPressure;
/**
* 设备品种名称
*/
private String cylinderVarietyName;
/**
* 充装介质名称
*/
private String fillingMediaName;
} }
...@@ -13,12 +13,10 @@ public class CylinderInspectionModel extends AbstractBaseModel{ ...@@ -13,12 +13,10 @@ public class CylinderInspectionModel extends AbstractBaseModel{
* *
*/ */
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private String inspectionId; //检验信息ID
private String inspectionUnit; //检验单位*
private String propertyUnitName; //产权单位名称*
private String factoryNum; //出厂编号
private String sequenceCode; //气瓶唯一标识码* private String sequenceCode; //气瓶唯一标识码*
private String inspectionUnit; //检验单位*
private String inspectionDate; //检验日期* private String inspectionDate; //检验日期*
private String nextInspectionDate; //下次检验日期*
private String inspectionResult; //检验结果* private String inspectionResult; //检验结果*
private String nextInspectionDate; //下次检验日期*
private String scrapQuantity; //不合格报废数量
} }
...@@ -11,10 +11,8 @@ public class CylinderTagsModel extends AbstractBaseModel{ ...@@ -11,10 +11,8 @@ public class CylinderTagsModel extends AbstractBaseModel{
* *
*/ */
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private String tagId; //标签ID*
private String unitName; //产权单位名称*
private String factoryNum; //出厂编号
private String sequenceCode; //气瓶唯一标识码* private String sequenceCode; //气瓶唯一标识码*
private String qrCode; //二维码编号* private String qrCode; //二维码编号*
private String electronicLabelCode; //电子标签编号* private String electronicLabelCode; //电子标签编号*
private String gasCylinderStamp;//气瓶钢印标识
} }
...@@ -16,22 +16,17 @@ public class CylinderUnitModel extends AbstractBaseModel{ ...@@ -16,22 +16,17 @@ public class CylinderUnitModel extends AbstractBaseModel{
private String unitId; //单位ID private String unitId; //单位ID
private String regionCode; //所属区域 private String regionCode; //所属区域
private String unitName; //单位名称 private String unitName; //单位名称
private int unitType; //企业类型
private String creditCode; //统一社会信用代码 private String creditCode; //统一社会信用代码
private String address; //详细地址 private String address; //详细地址
private String unitPerson; //企业负责人 private String unitPerson; //企业负责人
private String personMobilePhone; //企业负责人手机 private String personMobilePhone; //企业负责人手机
private String personTelephone; //企业负责人固定电话 private String personTelephone; //企业负责人固定电话
private String securityAdm;
private String securityAdmPhone;
private String postalCode; //企业邮编 private String postalCode; //企业邮编
private String unitAbbreviation; //企业简称
private String fillingLicense; //充装许可证号 /**
private String fillingPermitDate; //充装许可证有效期 * 所属区域
private String fillingPermScope; //充装许可范围 */
private String inspectionLicense; //检验许可证号 private String regionName;
private String inspectionScope; //检验范围
private String effectiveDate; //检验许可证有效期
private String manufacturingLicense; //制造许可证号
private String manufacturingDate; //制造许可证有效期
private String manufacturingScope; //制造许可范围
private String manufacturingUnitCode; //制造单位代码
} }
package com.yeejoin.amos.api.openapi.face.model;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yeejoin.amos.api.openapi.face.orm.entity.DesignInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
/**
* 特种设备基本信息-设计信息Vo
*
* @author duanwei
* @date 2022-07-20
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class DesignInfoModel extends AbstractBaseModel {
private List designFile;
private List designCode;
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "设备唯一标识码")
/**
* 设备唯一标识码
*/
private String sequenceCode;
@ApiModelProperty(value = "监管系统唯一编码(监管系统对接标识)")
/**
* 监管系统唯一编码(监管系统对接标识)
*/
private String superviseCode;
@ApiModelProperty(value = "设计单位统一社会信用代码")
/**
* 设计单位统一社会信用代码
*/
private String designUnitCreditCode;
@ApiModelProperty(value = "设计单位名称")
/**
* 设计单位名称
*/
private String designUnitName;
@ApiModelProperty(value = "设计许可编号")
/**
* 设计许可编号
*/
private String designLicenseNum;
@ApiModelProperty(value = "设计使用年限")
/**
* 设计使用年限
*/
private Integer designUseDate;
@ApiModelProperty(value = "设计日期")
/**
* 设计日期
*/
private Date designDate;
@ApiModelProperty(value = "总图图号")
/**
* 总图图号
*/
private String drawingDo;
@ApiModelProperty(value = "设计文件鉴定单位")
/**
* 设计文件鉴定单位
*/
private String appraisalUnit;
@ApiModelProperty(value = "设计文件鉴定日期")
/**
* 设计文件鉴定日期
*/
private Date appraisalDate;
}
package com.yeejoin.amos.api.openapi.face.model;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.api.openapi.face.orm.entity.AbstractBaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
import java.util.List;
/**
* 电梯技术参数
*
* @author duanwei
* @date 2022-07-22
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class ElevatorTechInfoModel extends AbstractBaseModel {
private static final long serialVersionUID = 1L;
private List governorEffiReport;
@ApiModelProperty(value = "设备唯一标识码")
private String sequenceCode;
@ApiModelProperty(value = "监管系统唯一编码")
private String superviseCode;
@ApiModelProperty(value = "额定速度")
private String ratedSpeed;
@ApiModelProperty(value = "提升高度")
private String mainLiftingHeight;
@ApiModelProperty(value = "控制方式")
private String controlType;
@ApiModelProperty(value = "层站")
private String layerStation;
@ApiModelProperty(value = "轿厢尺寸")
private String ratedLoad;
@ApiModelProperty(value = "轿厢尺寸")
private String cabin;
@ApiModelProperty(value = "驱动主机型号")
private String driveType;
@ApiModelProperty(value = "驱动主机编号")
private String driveCode;
@ApiModelProperty(value = "驱动主机制造单位")
private String driveProduceUnit;
@ApiModelProperty(value = "驱动主机额定功率")
private String drivePower;
@ApiModelProperty(value = "驱动主机额定转速")
private String driveSpeeds;
@ApiModelProperty(value = "驱动主机减速比")
private String reductionRatio;
@ApiModelProperty(value = "控制柜型号")
private String controlModel;
@ApiModelProperty(value = "控制柜编号")
private String controlCode;
@ApiModelProperty(value = "控制柜制造单位")
private String controlFacUnit;
@ApiModelProperty(value = "悬挂系统悬挂介质种类")
private String susMediumType;
@ApiModelProperty(value = "悬挂系统悬挂介质型号")
private String susMediumModel;
@ApiModelProperty(value = "悬挂系统悬挂介质数量")
private String susMediumQuantity;
@ApiModelProperty(value = "悬挂系统悬挂介质规格")
private String susMediumSpe;
@ApiModelProperty(value = "限速器型号")
private String governorModel;
@ApiModelProperty(value = "限速器编号")
private String governorNum;
@ApiModelProperty(value = "限速器制造单位")
private String governorUnit;
@ApiModelProperty(value = "限速器检验日期")
private Date governorInsDate;
@ApiModelProperty(value = "安全钳型号")
private String safeGearModel;
@ApiModelProperty(value = "安全钳编号")
private String safeGearNum;
@ApiModelProperty(value = "安全钳制造单位")
private String safeGearProdUnit;
@ApiModelProperty(value = "轿厢缓冲器型号")
private String carBufModel;
@ApiModelProperty(value = "轿厢缓冲器编号")
private String carBufNum;
@ApiModelProperty(value = "轿厢缓冲器制造单位")
private String carBufProdUnit;
@ApiModelProperty(value = "对重缓冲器型号")
private String countBufModel;
@ApiModelProperty(value = "对重缓冲器编号")
private String countBufNum;
@ApiModelProperty(value = "对重缓冲器制造单位")
private String countBufProdUnit;
@ApiModelProperty(value = "层门门锁装置型号")
private String landDoorLockModel;
@ApiModelProperty(value = "层门门锁装置编号")
private String landDoorLockNum;
@ApiModelProperty(value = "层门门锁装置制造单位")
private String landDoorLockProdUnit;
@ApiModelProperty(value = "轿门门锁装置型号")
private String carDoorLockModel;
@ApiModelProperty(value = "轿门门锁装置编号")
private String carDoorLockNum;
@ApiModelProperty(value = "轿门门锁装置制造单位")
private String carDoorLockProdUnit;
@ApiModelProperty(value = "上行保护装置型号")
private String upProtectModel;
@ApiModelProperty(value = "上行保护装置编号")
private String upProtectNum;
@ApiModelProperty(value = "上行保护装置制造单位")
private String upProtectProdUnit;
@ApiModelProperty(value = "轿厢意外移动保护装置型号")
private String carAccProtModel;
@ApiModelProperty(value = "轿厢意外移动保护装置编号")
private String carAccProtNum;
@ApiModelProperty(value = "轿厢意外移动保护装置制造单位")
private String carAccProtProdUnit;
}
package com.yeejoin.amos.api.openapi.face.model;
import java.io.Serializable;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
/**
* 特种设备附件资料信息Vo
*
* @author duanwei
* @date 2022-07-20
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class EnclosureInfoModel extends AbstractBaseModel {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "设备资料编号")
/**
* 设备资料编号
*/
private String equDataNo;
@ApiModelProperty(value = "设备唯一标识码")
/**
* 设备唯一标识码
*/
private String sequenceCode;
@ApiModelProperty(value = "监管系统唯一编码")
/**
* 监管系统唯一编码
*/
private String superviseCode;
@ApiModelProperty(value = "设备资料类型")
/**
* 设备资料类型
*/
private String equDataType;
@ApiModelProperty(value = "附件资料格式")
/**
* 附件资料格式
*/
private String enclosureFormat;
@ApiModelProperty(value = "附件资料名称")
/**
* 附件资料名称
*/
private String enclosureName;
@ApiModelProperty(value = "附件资料完整路径")
/**
* 附件资料完整路径
*/
private String enclosureUrl;
}
package com.yeejoin.amos.api.openapi.face.model;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
/**
* 企业数据信息Vo
*
* @author duanwei
* @date 2022-07-20
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class EnterpriseInfoModel extends AbstractBaseModel {
private static final long serialVersionUID = 1L;
private String superviseOrgCode;
private String superviseOrgName;
private List businessLicense;
@ApiModelProperty(value = "使用单位唯一标识")
/**
* 使用单位唯一标识
*/
private String useUnitCode;
@ApiModelProperty(value = "监管系统唯一编码")
/**
* 监管系统唯一编码
*/
private String superviseCode;
@ApiModelProperty(value = "使用单位证件类型")
/**
* 使用单位证件类型
*/
private String useUnitCertificate;
@ApiModelProperty(value = "使用单位代码")
/**
* 使用单位代码
*/
private String useCode;
@ApiModelProperty(value = "使用单位名称")
/**
* 使用单位名称
*/
private String useUnit;
@ApiModelProperty(value = "是否重点监控单位")
/**
* 是否重点监控单位
*/
private String keyUnit;
@ApiModelProperty(value = "重点场所分类")
/**
* 重点场所分类
*/
private String classPlaces;
@ApiModelProperty(value = "单位所在省份名称")
/**
* 单位所在省份名称
*/
private String province;
@ApiModelProperty(value = "单位所在城市名称")
/**
* 单位所在城市名称
*/
private String city;
@ApiModelProperty(value = "单位所在区县名称")
/**
* 单位所在区县名称
*/
private String district;
@ApiModelProperty(value = "单位所在街道名称")
/**
* 单位所在街道名称
*/
private String street;
@ApiModelProperty(value = "单位所在社区名称")
/**
* 单位所在社区名称
*/
private String community;
@ApiModelProperty(value = "单位详细地址")
/**
* 单位详细地址
*/
private String address;
@ApiModelProperty(value = "使用单位法人")
/**
* 使用单位法人
*/
private String legalPerson;
@ApiModelProperty(value = "法人联系电话")
/**
* 法人联系电话
*/
private String legalPhone;
@ApiModelProperty(value = "使用单位联系人")
/**
* 使用单位联系人
*/
private String useContact;
@ApiModelProperty(value = "联系人联系电话")
/**
* 联系人联系电话
*/
private String contactPhone;
@ApiModelProperty(value = "安全管理人员1姓名")
/**
* 安全管理人员1姓名
*/
private String safetyOne;
@ApiModelProperty(value = "安全管理人员1身份证")
/**
* 安全管理人员1身份证
*/
private String safetyOneId;
@ApiModelProperty(value = "安全管理人员1联系电话")
/**
* 安全管理人员1联系电话
*/
private String safetyOnePhone;
@ApiModelProperty(value = "安全管理人员2")
/**
* 安全管理人员2
*/
private String safetyTwo;
@ApiModelProperty(value = "安全管理人员2身份证")
/**
* 安全管理人员2身份证
*/
private String safetyTwoId;
@ApiModelProperty(value = "安全管理人员2联系电话")
/**
* 安全管理人员2联系电话
*/
private String safetyTwoPhone;
@ApiModelProperty(value = "单位地理坐标经度")
/**
* 单位地理坐标经度
*/
private String longitude;
@ApiModelProperty(value = "单位地理坐标纬度")
/**
* 单位地理坐标纬度
*/
private String latitude;
}
package com.yeejoin.amos.api.openapi.face.model;
import java.util.Date;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class EquipmentModel {
@ApiModelProperty(value = "设备唯一标识码")
private Long sequenceNbr;
@ApiModelProperty(value = "使用登记证编号")
private String useRegistrationNumber;
@ApiModelProperty(value = "使用单位名称")
private String useUnit;
@ApiModelProperty(value = "设备种类")
private String equipmentType;
@ApiModelProperty(value = "设备类别")
private String equipmentCategory;
@ApiModelProperty(value = "设备品种")
private String equipmentVariety;
@ApiModelProperty(value = "产品名称")
private String equipmentName;
@ApiModelProperty(value = "设备代码")
private String equipmentCode;
@ApiModelProperty(value = "产品编号")
private String equipmentNumber;
@ApiModelProperty(value = "单位内编号")
private String internalNumber;
@ApiModelProperty(value = "登记机关")
private String registrationOrgan;
@ApiModelProperty(value = "发证日期")
private String registrationDate;
@ApiModelProperty(value = "设备使用地点/使用单位地址")
private String useUnitAddress;
@ApiModelProperty(value = "使用单位统一社会信用代码")
private String useUnitCode;
@ApiModelProperty(value = "使用代为所在地代码")
private String useUnitAreaCode;
@ApiModelProperty(value = "设备使用状态")
private String regStatus;
@ApiModelProperty(value = "设备使用状态变更日期")
private Date useStatusUpdate;
@ApiModelProperty(value = "变更登记")
private String changeStatus;
@ApiModelProperty(value = "变更登记日期")
private Date changeUpdate;
@ApiModelProperty(value = "投入使用日期")
private Date useDate;
@ApiModelProperty(value = "设计单位名称")
private String designUnitName;
@ApiModelProperty(value = "制造单位名称")
private String manUnitName;
@ApiModelProperty(value = "施工单位名称")
private String builderUnitName;
@ApiModelProperty(value = "监督检验机构名称")
private String JDUnitName;
@ApiModelProperty(value = "形式试验机构名称")
private String XSUnitName;
@ApiModelProperty(value = "产权单位名称")
private String CQUnitName;
@ApiModelProperty(value = "产权单位统一社会信用代码")
private String CQUnitCode;
@ApiModelProperty(value = "生产时间")
private Date recordDate;
}
package com.yeejoin.amos.api.openapi.face.model;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
/**
* 特种设备检验信息Vo
*
* @author duanwei
* @date 2022-07-20
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class InspectionInfoModel extends AbstractBaseModel {
private static final long serialVersionUID = 1L;
private List inspectionReport;
@ApiModelProperty(value = "设备唯一标识码")
/**
* 设备唯一标识码
*/
private String sequenceCode;
@ApiModelProperty(value = "监管系统唯一编码")
/**
* 监管系统唯一编码
*/
private String superviseCode;
@ApiModelProperty(value = "设备代码")
/**
* 设备代码
*/
private String equCode;
@ApiModelProperty(value = "检验类型(1法定类监督检验 2法定类定期检验 3非法定类检验 4委托类检验)")
/**
* 检验类型(1法定类监督检验2法定类定期检验3非法定类检验4委托类检验)
*/
private String inspectType;
@ApiModelProperty(value = "检验机构名称")
/**
* 检验机构名称
*/
private String inspectOrgName;
@ApiModelProperty(value = "检验报告ID")
/**
* 检验报告ID
*/
private String inspectReportNum;
@ApiModelProperty(value = "检验人员")
/**
* 检验人员
*/
private String inspectStaff;
@ApiModelProperty(value = "检验日期")
/**
* 检验日期
*/
private Date inspectDate;
@ApiModelProperty(value = "检验结论(合格,复检合格等)")
/**
* 检验结论(合格,复检合格等)
*/
private String inspectConclusion;
@ApiModelProperty(value = "安全状况等级")
/**
* 安全状况等级
*/
private String safetyLevel;
@ApiModelProperty(value = "检验问题备注")
/**
* 检验问题备注
*/
private String problemRemark;
@ApiModelProperty(value = "下次检验日期")
/**
* 下次检验日期
*/
private Date nextInspectDate;
}
package com.yeejoin.amos.api.openapi.face.model;
import java.io.Serializable;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
/**
* 附件表Vo
*
* @author duanwei
* @date 2022-07-20
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class JgFileModel extends AbstractBaseModel {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "附件名")
/**
* 附件名
*/
private String fileName;
@ApiModelProperty(value = "附件url地址")
/**
* 附件url地址
*/
private String fileUrl;
@ApiModelProperty(value = "设备唯一标识码")
/**
* 设备唯一标识码
*/
private String sequenceCode;
@ApiModelProperty(value = "所属对象")
/**
* 所属对象
*/
private String objectType;
@ApiModelProperty(value = "所属属性名 ")
/**
* 所属属性名
*/
private String attributeType;
}
package com.yeejoin.amos.api.openapi.face.model;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
/**
* 特种设备基本信息-维保备案信息Vo
*
* @author duanwei
* @date 2022-07-20
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class MaintenanceInfoModel extends AbstractBaseModel {
private static final long serialVersionUID = 1L;
private List repairInform;
@ApiModelProperty(value = "设备唯一标识码")
/**
* 设备唯一标识码
*/
private String sequenceCode;
@ApiModelProperty(value = "监管系统唯一编码")
/**
* 监管系统唯一编码
*/
private String superviseCode;
@ApiModelProperty(value = "维保单位统一社会信用代码")
/**
* 维保单位统一社会信用代码
*/
private String meUnitCreditCode;
@ApiModelProperty(value = "维保单位名称")
/**
* 维保单位名称
*/
private String meUnitName;
@ApiModelProperty(value = "维保合同备案ID")
/**
* 维保合同备案ID
*/
private String repairInformId;
@ApiModelProperty(value = "维保合同开始日期")
/**
* 维保合同开始日期
*/
private Date informStart;
@ApiModelProperty(value = "维保合同结束日期")
/**
* 维保合同结束日期
*/
private Date informEnd;
@ApiModelProperty(value = "维保负责人姓名")
/**
* 维保负责人姓名
*/
private String meMaster;
@ApiModelProperty(value = "维保负责人身份证号")
/**
* 维保负责人身份证号
*/
private String meMasterId;
@ApiModelProperty(value = "紧急救援电话")
/**
* 紧急救援电话
*/
private String emergencycall;
@ApiModelProperty(value = "维保周期(单位:月)")
/**
* 维保周期(单位:月)
*/
private Integer meCycle;
@ApiModelProperty(value = "大修周期(单位:月)")
/**
* 大修周期(单位:月)
*/
private Integer overhaulCycle;
@ApiModelProperty(value = "24小时维保电话")
/**
* 24小时维保电话
*/
private String me24Telephone;
}
package com.yeejoin.amos.api.openapi.face.model;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
/**
* 特种设备基本信息-其他信息Vo
*
* @author duanwei
* @date 2022-07-20
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class OtherInfoModel extends AbstractBaseModel {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "设备唯一标识码")
/**
* 设备唯一标识码
*/
private String sequenceCode;
@ApiModelProperty(value = "监管系统唯一编码")
/**
* 监管系统唯一编码
*/
private String superviseCode;
@ApiModelProperty(value = "保险机构")
/**
* 保险机构
*/
private String insuranceOrg;
@ApiModelProperty(value = "保险到期日")
/**
* 保险到期日
*/
private Date expiryDate;
@ApiModelProperty(value = "物联网机构(非必填)")
/**
* 物联网机构(非必填)
*/
private String iotOrg;
@ApiModelProperty(value = "物联网接入标志(非必填)")
/**
* 物联网接入标志(非必填)
*/
private String iotSign;
@ApiModelProperty(value = "有无监控(有、无)")
/**
* 有无监控(有、无)
*/
private String isMonitor;
@ApiModelProperty(value = "96333识别码(七位电梯应急救援识别码)")
/**
* 96333识别码(七位电梯应急救援识别码)
*/
private String code96333;
}
package com.yeejoin.amos.api.openapi.face.model;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
import javax.management.loading.PrivateMLet;
/**
* 特种设备基本信息-制造信息Vo
*
* @author duanwei
* @date 2022-07-20
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class ProduceInfoModel extends AbstractBaseModel {
private static final long serialVersionUID = 1L;
private List produceStandard;
private List productCertificate;
private List iumInstructions;
private List supervisionCert;
private List ceCert;
@ApiModelProperty(value = "设备唯一标识码")
/**
* 设备唯一标识码
*/
private String sequenceCode;
@ApiModelProperty(value = "监管系统唯一编码")
/**
* 监管系统唯一编码
*/
private String superviseCode;
@ApiModelProperty(value = "制造单位统一社会信用代码")
/**
* 制造单位统一社会信用代码
*/
private String produceUnitCreditCode;
@ApiModelProperty(value = "制造单位名称")
/**
* 制造单位名称
*/
private String produceUnitName;
@ApiModelProperty(value = "制造许可编号")
/**
* 制造许可编号
*/
private String produceLicenseNum;
@ApiModelProperty(value = "出厂编号")
/**
* 出厂编号
*/
private String factoryNum;
@ApiModelProperty(value = "制造日期")
/**
* 制造日期
*/
private Date produceDate;
@ApiModelProperty(value = "是否进口(是、否)")
/**
* 是否进口(是、否)
*/
private String imported;
@ApiModelProperty(value = "制造国")
/**
* 制造国
*/
private String produceCountry;
@ApiModelProperty(value = "监督检验ID")
/**
* 监督检验ID
*/
private String inspectionId;
@ApiModelProperty(value = "型式试验ID")
/**
* 型式试验ID
*/
private String typeTestId;
}
package com.yeejoin.amos.api.openapi.face.model;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
/**
* 特种设备基本信息-注册登记信息 Vo
*
* @author duanwei
* @date 2022-07-20
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class RegistrationInfoModel extends AbstractBaseModel {
private static final long serialVersionUID = 1L;
private List useRegistCertificate;
@ApiModelProperty(value = "设备唯一标识码")
/**
* 设备唯一标识码
*/
private String sequenceCode;
@ApiModelProperty(value = "监管系统唯一编码")
/**
* 监管系统唯一编码
*/
private String superviseCode;
/**
* 登记机关组织机构代码
*/
@ApiModelProperty(value = "登记机关组织机构代码")
private String organizationCode;
@ApiModelProperty(value = "登记机关名称")
/**
* 登记机关名称
*/
private String organizationName;
@ApiModelProperty(value = "使用登记证编号")
/**
* 使用登记证编号
*/
private String useOrgCode;
@ApiModelProperty(value = "注册状态(已注册 未注册)")
/**
* 注册状态(已注册未注册)
*/
private String registerState;
@ApiModelProperty(value = "使用登记ID")
/**
* 使用登记ID
*/
private String useOrgId;
@ApiModelProperty(value = "设备代码")
/**
* 设备代码
*/
private String equCode;
@ApiModelProperty(value = "设备种类")
/**
* 设备种类
*/
private String equList;
@ApiModelProperty(value = "设备类别")
/**
* 设备类别
*/
private String equCategory;
@ApiModelProperty(value = "设备品种")
/**
* 设备品种
*/
private String equDefine;
@ApiModelProperty(value = "产品名称")
/**
* 产品名称
*/
private String productName;
@ApiModelProperty(value = "品牌名称")
/**
* 品牌名称
*/
private String brandName;
@ApiModelProperty(value = "设备型号")
/**
* 设备型号
*/
private String equType;
@ApiModelProperty(value = "设备总价值(万元)")
/**
* 设备总价值(万元)
*/
private Double equPrice;
}
package com.yeejoin.amos.api.openapi.face.model;
import java.io.Serializable;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
/**
* 人员数据信息-基本信息Vo
*
* @author duanwei
* @date 2022-07-20
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class StaffBaseInfoModel extends AbstractBaseModel {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "作业人员身份号码")
/**
* 作业人员身份号码
*/
private String operatorId;
@ApiModelProperty(value = "作业人员姓名")
/**
* 作业人员姓名
*/
private String operator;
@ApiModelProperty(value = "作业人员证件类型")
/**
* 作业人员证件类型
*/
private String operatorIdType;
@ApiModelProperty(value = "性别")
/**
* 性别
*/
private String gender;
@ApiModelProperty(value = "联系电话")
/**
* 联系电话
*/
private String phone;
@ApiModelProperty(value = "工作单位代码")
/**
* 工作单位代码
*/
private String unitCode;
@ApiModelProperty(value = "工作单位名称")
/**
* 工作单位名称
*/
private String unit;
@ApiModelProperty(value = "聘用时间")
/**
* 聘用时间
*/
private Date employmentDate;
}
package com.yeejoin.amos.api.openapi.face.model;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
/**
* 人员数据信息-资质信息Vo
*
* @author duanwei
* @date 2022-07-20
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class StaffQualifInfoModel extends AbstractBaseModel {
private static final long serialVersionUID = 1L;
private List qualificationCert;
@ApiModelProperty(value = "作业人员身份证号")
/**
* 作业人员身份证号
*/
private String operatorId;
@ApiModelProperty(value = "作业项目名称")
/**
* 作业项目名称
*/
private String operationItem;
@ApiModelProperty(value = "作业项目代号")
/**
* 作业项目代号
*/
private String operationItemCode;
@ApiModelProperty(value = "有效日期")
/**
* 有效日期
*/
private Date effectiveDate;
@ApiModelProperty(value = "发证机关")
/**
* 发证机关
*/
private String issuingAuthor;
}
package com.yeejoin.amos.api.openapi.face.model;
import java.io.Serializable;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
/**
* 特种设备基本信息-监督管理信息Vo
*
* @author duanwei
* @date 2022-07-20
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class SuperviseInfoModel extends AbstractBaseModel {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "设备唯一标识码")
/**
* 设备唯一标识码
*/
private String sequenceCode;
@ApiModelProperty(value = "监管系统唯一编码")
/**
* 监管系统唯一编码
*/
private String superviseCode;
@ApiModelProperty(value = "管辖分局组织机构代码")
/**
* 管辖分局组织机构代码
*/
private String orgBranchCode;
@ApiModelProperty(value = "管辖分局名称")
/**
* 管辖分局名称
*/
private String orgBranchName;
@ApiModelProperty(value = "是否重点监察设备(是、否)")
/**
* 是否重点监察设备(是、否)
*/
private String keyMonitoringEqu;
@ApiModelProperty(value = "是否在人口密集区(是、否)")
/**
* 是否在人口密集区(是、否)
*/
private String denselyPopulatedAreas;
@ApiModelProperty(value = "是否在重要场所(是、否)")
/**
* 是否在重要场所(是、否)
*/
private String importantPlaces;
}
package com.yeejoin.amos.api.openapi.face.model;
import java.io.Serializable;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
/**
* 特种设备基本信息-使用信息Vo
*
* @author duanwei
* @date 2022-07-20
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class UseInfoModel extends AbstractBaseModel {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "设备唯一标识码")
/**
* 设备唯一标识码
*/
private String sequenceCode;
@ApiModelProperty(value = "监管系统唯一编码")
/**
* 监管系统唯一编码
*/
private String superviseCode;
@ApiModelProperty(value = "使用单位统一信用代码")
/**
* 使用单位统一信用代码
*/
private String useUnitCreditCode;
@ApiModelProperty(value = "使用单位名称")
/**
* 使用单位名称
*/
private String useUnitName;
@ApiModelProperty(value = "产权单位统一信用代码")
/**
* 产权单位统一信用代码
*/
private String estateUnitCreditCode;
@ApiModelProperty(value = "产权单位名称")
/**
* 产权单位名称
*/
private String estateUnitName;
@ApiModelProperty(value = "使用状态变更日期")
/**
* 使用状态变更日期
*/
private Date useStateChangeDate;
@ApiModelProperty(value = "变更事项(使用单位名称变更、变更使用单位、改造/移装变更、延期使用变更)")
/**
* 变更事项(使用单位名称变更、变更使用单位、改造/移装变更、延期使用变更)
*/
private String changes;
@ApiModelProperty(value = "使用内部编号")
/**
* 使用内部编号
*/
private String useInnerCode;
@ApiModelProperty(value = "投入使用日期")
/**
* 投入使用日期
*/
private Date useDate;
@ApiModelProperty(value = "经办人")
/**
* 经办人
*/
private String agent;
@ApiModelProperty(value = "设备所在地区代码")
/**
* 设备所在地区代码
*/
private String areaCode;
@ApiModelProperty(value = "设备使用地点_省")
/**
* 设备使用地点_省
*/
private String province;
@ApiModelProperty(value = "设备使用地点_市")
/**
* 设备使用地点_市
*/
private String city;
@ApiModelProperty(value = "设备使用地点_区(县)")
/**
* 设备使用地点_区(县)
*/
private String county;
@ApiModelProperty(value = "设备使用地点_街道(镇)")
/**
* 设备使用地点_街道(镇)
*/
private String street;
@ApiModelProperty(value = "设备详细使用地址")
/**
* 设备详细使用地址
*/
private String address;
@ApiModelProperty(value = "设备地理坐标经度")
/**
* 设备地理坐标经度
*/
private String longitude;
@ApiModelProperty(value = "设备地理坐标纬度")
/**
* 设备地理坐标纬度
*/
private String latitude;
@ApiModelProperty(value = "设备使用场所(住宅小区、商业单位、学校、医院、政府机关、重要公共场所)")
/**
* 设备使用场所(住宅小区、商业单位、学校、医院、政府机关、重要公共场所)
*/
private String usePlace;
@ApiModelProperty(value = "设备主管部门(药监局、经信委、文化委、市政市容委、发改委、水务局、住房建设委、交通局、商务委、旅游局、体育局、住房建设委、园林绿化局、水利局、商务委、卫生局、教育局等)")
/**
* 设备主管部门(药监局、经信委、文化委、市政市容委、发改委、水务局、住房建设委、交通局、商务委、旅游局、体育局、住房建设委、园林绿化局、水利局、商务委、卫生局、教育局等)
*/
private String equManageDt;
@ApiModelProperty(value = "安全管理部门名称")
/**
* 安全管理部门名称
*/
private String safetyManageDt;
@ApiModelProperty(value = "安全管理员")
/**
* 安全管理员
*/
private String safetyManager;
@ApiModelProperty(value = "安全管理员移动电话")
/**
* 安全管理员移动电话
*/
private Long phone;
@ApiModelProperty(value = "设备状态(1在用2停用3报废 4注销5迁出 6拆除 7目录外 8非法设备)")
/**
* 设备状态(1在用2停用3报废 4注销5迁出 6拆除 7目录外 8非法设备)
*/
private String equState;
}
package com.yeejoin.amos.api.openapi.face.orm.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.api.openapi.face.orm.entity.ConstructionInfo;
/**
* 特种设备基本信息-施工信息 Mapper 接口
*
* @author Zhang Yingbin
* @date 2022-07-19
*/
public interface ConstructionInfoMapper extends BaseMapper<ConstructionInfo> {
}
package com.yeejoin.amos.api.openapi.face.orm.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.api.openapi.face.orm.entity.DesignInfo;
/**
* 特种设备基本信息-设计信息 Mapper 接口
*
* @author Zhang Yingbin
* @date 2022-07-19
*/
public interface DesignInfoMapper extends BaseMapper<DesignInfo> {
}
package com.yeejoin.amos.api.openapi.face.orm.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.api.openapi.face.orm.entity.ElevatorTechInfo;
/**
* 电梯技术参数 Mapper 接口
*
* @author Zhang Yingbin
* @date 2022-07-19
*/
public interface ElevatorTechInfoMapper extends BaseMapper<ElevatorTechInfo> {
}
package com.yeejoin.amos.api.openapi.face.orm.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.api.openapi.face.orm.entity.EnclosureInfo;
/**
* 特种设备附件资料信息 Mapper 接口
*
* @author Zhang Yingbin
* @date 2022-07-19
*/
public interface EnclosureInfoMapper extends BaseMapper<EnclosureInfo> {
}
package com.yeejoin.amos.api.openapi.face.orm.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.api.openapi.face.orm.entity.EnterpriseInfo;
/**
* 企业数据信息 Mapper 接口
*
* @author Zhang Yingbin
* @date 2022-07-19
*/
public interface EnterpriseInfoMapper extends BaseMapper<EnterpriseInfo> {
}
package com.yeejoin.amos.api.openapi.face.orm.dao;
import java.util.Date;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.api.openapi.face.model.EquipmentModel;
import com.yeejoin.amos.api.openapi.face.orm.entity.Equipment;
public interface EquipmentMapper extends BaseMapper<Equipment> {
IPage<EquipmentModel> page(Page<EquipmentModel> page, Date startTime,Date endTime);
}
package com.yeejoin.amos.api.openapi.face.orm.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.api.openapi.face.orm.entity.InspectionInfo;
/**
* 特种设备检验信息 Mapper 接口
*
* @author Zhang Yingbin
* @date 2022-07-19
*/
public interface InspectionInfoMapper extends BaseMapper<InspectionInfo> {
}
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
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