Commit 7aaaac35 authored by 吴江's avatar 吴江

Merge branch 'develop_unit_register' into 'developer'

Develop unit register See merge request !12
parents 30f6378c d4c1a1af
......@@ -13,12 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.connection.RedisConnection;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.PathVariable;
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.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
......@@ -394,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));
}
}
......@@ -23,4 +23,6 @@ public interface IDataDictionaryService {
public List<DataDictionary> getByType(String type);
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
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>();
wrapper.eq(DataDictionary::getIsDelete, false);
wrapper.eq(DataDictionary::getType, type);
......@@ -165,4 +166,12 @@ public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, Da
}
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);
}
}
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>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-data-accessapi</artifactId>
<version>1.0.0</version>
<name>amos-boot-data-accessapi</name>
<url>http://maven.apache.org</url>
<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.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;
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.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.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;
/**
* 附件表 服务实现类
*
* @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.List;
import java.util.Map;
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.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.TaLicenseBaseInfo;
/**
* 附件表 服务实现类
*
* @author duanwei
* @date 2022-08-17
*/
@Service
public class TaLicenseBaseInfoServiceImpl
extends BaseService<TaLicenseBaseInfoModel, TaLicenseBaseInfo, TaLicenseBaseInfoMapper> {
/**
*
* 新增许可信息-许可基本信息表
*
* @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");
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();
csoftDataTzsbJbxxListParam.setStaTime(startTime);
// 开始日期
csoftDataTzsbJbxxListParam.setEndTime(endTime);
// 结束日期
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);
}
} 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.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
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.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.TaLicenseDetailInfo;
/**
* 附件表 服务实现类
*
* @author duanwei
* @date 2022-08-17
*/
@Service
public class TaLicenseDetailInfoServiceImpl extends BaseService<TaLicenseDetailInfoModel, TaLicenseDetailInfo, TaLicenseDetailInfoMapper> {
/**
*
* 新增许可信息-许可详细信息表
*
* @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");
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();
csoftDataTzsbXKxxListParam.setStaTime(startTime);
// 开始日期
csoftDataTzsbXKxxListParam.setEndTime(endTime);
// 结束日期
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);
}
} 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
##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
spring.application.name=AMOS-API-OPENAPI
spring.application.name=AMOS-API-OPENAPI-WJ
server.servlet.context-path=/openapi
server.port=11001
# jdbc_config
......@@ -18,8 +18,8 @@ spring.datasource.hikari.connection-test-query=SELECT 1
# REDIS (RedisProperties)
spring.redis.database=1
spring.redis.host=113.134.211.174
spring.redis.port=6379
spring.redis.host=36.46.151.113
spring.redis.port=16379
spring.redis.password=yeejoin@2020
spring.redis.lettuce.pool.max-active=200
spring.redis.lettuce.pool.max-wait=-1
......@@ -28,7 +28,7 @@ spring.redis.lettuce.pool.min-idle=0
spring.redis.expire.time=300
#注册中心地址
eureka.client.service-url.defaultZone =http://113.134.211.174:10001/eureka/
eureka.client.service-url.defaultZone =http://36.46.151.113:10001/eureka/
eureka.instance.prefer-ip-address=true
management.endpoint.health.show-details=always
management.endpoints.web.exposure.include=*
......
......@@ -19,5 +19,6 @@
<modules>
<module>amos-boot-data-common</module>
<module>amos-boot-data-openapi</module>
<module>amos-boot-data-accessapi</module>
</modules>
</project>
......@@ -50,4 +50,18 @@ public interface IRegUnitInfoService {
* @return 是否成功
*/
Boolean unitLogOut(String unitCode);
/**
* 校验是否已经存在相同的账号
* @param userName 账号
* @return true 已存在相同账号,不能注册 false 不存在账号,可以注册
*/
Boolean checkRepeatAccount(String userName);
/**
* 手机号重复校验
* @param phoneNo 手机号
* @return true 已存在不能注册 false 不存在可以注册
*/
Boolean checkRepeatPhone(String phoneNo);
}
......@@ -20,22 +20,22 @@
produce.factory_num,
CONCAT(use1.province,'/',use1.city,'/',use1.county)AS area,
use1.address
FROM tzs_jg_supervise_info supervise
FROM tz_jg_supervise_info supervise
LEFT JOIN
tzs_jg_use_info use1 ON use1.sequence_code =
tz_jg_use_info use1 ON use1.sequence_code =
supervise.sequence_code
LEFT JOIN tzs_jg_maintenance_info maintenance ON
LEFT JOIN tz_jg_maintenance_info maintenance ON
maintenance.sequence_code
= supervise.sequence_code
LEFT JOIN
tzs_jg_registration_info registration ON
tz_jg_registration_info registration ON
registration.sequence_code =
supervise.sequence_code
LEFT JOIN tzs_jg_other_info other ON
LEFT JOIN tz_jg_other_info other ON
other.sequence_code =
supervise.sequence_code
LEFT JOIN
tzs_jg_produce_info produce ON produce.sequence_code =
tz_jg_produce_info produce ON produce.sequence_code =
supervise.sequence_code
<where>
<if
......
......@@ -132,4 +132,37 @@ public class TzBaseEnterpriseInfoServiceImpl
return tzBaseEnterpriseInfoDto;
}
@Override
public List<EquEnterDto> getInfoByUseUnit(String userUnit) {
return tzBaseEnterpriseInfoMapper.getInfoByUseUnit(userUnit);
}
@Override
public TzBaseEnterpriseInfoDto selectByUseUnit(String useUnit) {
TzBaseEnterpriseInfoDto tzBaseEnterpriseInfoDto = new TzBaseEnterpriseInfoDto();
TzBaseEnterpriseInfo tzBaseEnterpriseInfo = tzBaseEnterpriseInfoMapper.selectByUseUnit(useUnit);
if (tzBaseEnterpriseInfo != null) {
BeanUtils.copyProperties(tzBaseEnterpriseInfo, tzBaseEnterpriseInfoDto);
}
// 许可信息
List<BaseUnitLicence> unitLicences = baseUnitLicenceService.list(new LambdaQueryWrapper<BaseUnitLicence>()
.eq(BaseUnitLicence::getUnitCode, tzBaseEnterpriseInfo.getUseCode()));
List<BaseUnitLicenceDto> unitLicenceDtos = new ArrayList<BaseUnitLicenceDto>();
for (BaseUnitLicence baseUnitLicence : unitLicences) {
BaseUnitLicenceDto baseUnitLicenceDto = new BaseUnitLicenceDto();
BeanUtils.copyProperties(baseUnitLicence, baseUnitLicenceDto);
unitLicenceDtos.add(baseUnitLicenceDto);
}
tzBaseEnterpriseInfoDto.setUnitLicences(unitLicenceDtos);
// 工商信息
RegUnitIc regUnitIc = regUnitIcService.getOne(
new LambdaQueryWrapper<RegUnitIc>().eq(RegUnitIc::getUnitCode, tzBaseEnterpriseInfo.getUseCode()));
RegUnitIcDto regUnitIcDto = new RegUnitIcDto();
if (regUnitIc != null) {
BeanUtils.copyProperties(regUnitIc, regUnitIcDto);
}
tzBaseEnterpriseInfoDto.setRegUnitIcDto(regUnitIcDto);
return tzBaseEnterpriseInfoDto;
}
}
......@@ -96,7 +96,11 @@ public class RegUnitInfoController extends BaseController {
throw new BadRequest("手机号不能为空");
}
Boolean isReg = (Boolean) Privilege.authClient.mobileVerify(tel).getResult();
if(isReg){
if (isReg) {
throw new RuntimeException("该手机号已注册!");
}
Boolean isExist = iRegUnitInfoService.checkRepeatPhone(tel);
if (isExist) {
throw new RuntimeException("该手机号已注册!");
}
Boolean flag;
......@@ -151,12 +155,13 @@ public class RegUnitInfoController extends BaseController {
@GetMapping(value = "/{userName}/hasExistUser")
@ApiOperation(httpMethod = "GET", value = "判断用户是否存在", notes = "判断用户是否存在")
public ResponseModel<Boolean> hasExistUser(@PathVariable(value = "userName") String userName) {
boolean flag = false;
// 1.先看平台是否已经存在相同用户名用户
AgencyUserModel user = Privilege.agencyUserClient.queryByUserName(userName).getResult();
if (user != null) {
flag = true;
return ResponseHelper.buildResponse(false);
}
return ResponseHelper.buildResponse(flag);
// 2.再校验本地是否,有其他企业注册过
return ResponseHelper.buildResponse(iRegUnitInfoService.checkRepeatAccount(userName));
}
......
......@@ -118,12 +118,12 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
Bean.copyExistPropertis(model.getRegUnitIc(), regUnitIc);
regUnitIcService.saveOrUpdate(regUnitIc);
// 3.调用平台进行创建单位、用户信息,同步用户信息
if (UnitReviewStateEnum.NO_NEED_REVIEW.getCode().equals(model.getState())) {
// if (UnitReviewStateEnum.NO_NEED_REVIEW.getCode().equals(model.getState())) {
// 3.1 创建企业信息
this.createBaseEnterpriseInfo(model);
// 3.2 自动创建:调用平台进行创建单位、用户信息
this.createCompanyAndUser(regUnitInfo);
}
// }
// 4.插入注册单位基本信息表:tz_flc_reg_unit_info
this.save(regUnitInfo);
// 5.组织返回数据
......@@ -281,6 +281,16 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
return Boolean.TRUE;
}
@Override
public Boolean checkRepeatAccount(String userName) {
return this.count(new LambdaQueryWrapper<RegUnitInfo>().eq(RegUnitInfo::getAdminLoginName,userName)) > 0;
}
@Override
public Boolean checkRepeatPhone(String phoneNo) {
return this.count(new LambdaQueryWrapper<RegUnitInfo>().eq(RegUnitInfo::getAdminTel,phoneNo)) > 0;
}
private CompanyModel dealChildCompany(CompanyModel cm) {
cm.setChildren(this.getFilterChild(cm.getChildren() != null ? cm.getChildren() : new ArrayList()));
cm.getChildren().stream().filter(n -> {
......
spring.application.name=TZS
spring.application.name=TZS-WJ
server.servlet.context-path=/tzs
server.port=11000
spring.profiles.active=dev
spring.profiles.active=dev2
spring.jackson.time-zone=GMT+8
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
......
......@@ -718,5 +718,12 @@
REPLACE INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES ('1202', '1202', '充装单位', 'zslx', NULL, NULL, NULL, NULL, NULL, b'0', '1');
</sql>
</changeSet>
<changeSet author="suhuiguang" id="1660546840856-12">
<comment>设备品种字典维护</comment>
<sql>
DELETE FROM `cb_data_dictionary` where type = 'sbpz';
REPLACE INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES ('1600', '1000', '移动式压力容器气瓶充装', 'sbpz', NULL, NULL, NULL, NULL, NULL, b'0', '1');
</sql>
</changeSet>
</databaseChangeLog>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.amosframework.boot</groupId>
......@@ -11,7 +13,7 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.11.RELEASE</version>
<relativePath/>
<relativePath />
</parent>
<properties>
......@@ -286,17 +288,9 @@
</dependencies>
</dependencyManagement>
<repositories>
<!--<repository>
<id>Releases</id>
<name>Releases</name>
<url>http://4v059425e3.zicp.vip:13535/nexus/content/repositories/releases/</url>
</repository>
<repository>
<id>Snapshots</id>
<name>Snapshots</name>
<url>http://4v059425e3.zicp.vip:13535/nexus/content/repositories/snapshots/</url>
</repository>
-->
<!--<repository> <id>Releases</id> <name>Releases</name> <url>http://4v059425e3.zicp.vip:13535/nexus/content/repositories/releases/</url>
</repository> <repository> <id>Snapshots</id> <name>Snapshots</name> <url>http://4v059425e3.zicp.vip:13535/nexus/content/repositories/snapshots/</url>
</repository> -->
<repository>
<id>Releases</id>
<name>Releases</name>
......@@ -313,6 +307,12 @@
<name>Snapshots</name>
<url>http://36.46.149.14:8081/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>thirdparty</id>
<name>thirdparty</name>
<url>http://36.46.149.14:8081/nexus/content/repositories/thirdparty/</url>
</repository>
</repositories>
<modules>
......@@ -329,8 +329,8 @@
<module>amos-boot-core</module>
<module>amos-boot-utils</module>
<module>amos-boot-system-latentdanger</module>
<module>amos-boot-system-ccs</module>
<module>amos-boot-data</module>
<module>amos-boot-system-precontrol</module>
</modules>
<module>amos-boot-system-ccs</module>
<module>amos-boot-data</module>
<module>amos-boot-system-precontrol</module>
</modules>
</project>
\ No newline at end of file
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