Commit 9c4ad64d by 林冲

初始化项目

0 parents
Showing 56 changed files with 4333 additions and 0 deletions
FROM registry.cn-hangzhou.aliyuncs.com/dockerhub_mirror/java:21-anolis
WORKDIR /gps-upms-biz
ARG JAR_FILE=target/gsc-upms-biz.jar
COPY ${JAR_FILE} app.jar
EXPOSE 4000
ENV TZ=Asia/Shanghai JAVA_OPTS="-Xms128m -Xmx256m -Djava.security.egd=file:/dev/./urandom"
CMD sleep 60; java $JAVA_OPTS -jar app.jar
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2020 gsc4cloud Authors. All Rights Reserved.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
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>
<parent>
<groupId>com.gsc4cloud</groupId>
<artifactId>gsc</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>gsc-vcp-web-facade</artifactId>
<packaging>jar</packaging>
<description>gsc 二手车web模块</description>
<dependencies>
<!-- pom.xml 中添加 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.redisson</groupId>
<artifactId>redisson-spring-boot-starter</artifactId>
</dependency>
<!--二手车feign、entity等-->
<dependency>
<groupId>com.gsc4cloud</groupId>
<artifactId>gsc-vcp-api</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<!--feign 调用-->
<dependency>
<groupId>com.gsc4cloud</groupId>
<artifactId>gsc-common-feign</artifactId>
</dependency>
<!--接口文档-->
<dependency>
<groupId>com.gsc4cloud</groupId>
<artifactId>gsc-common-swagger</artifactId>
</dependency>
<!--注册中心客户端-->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<!--配置中心客户端-->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
<!--xss 过滤-->
<dependency>
<groupId>com.gsc4cloud</groupId>
<artifactId>gsc-common-xss</artifactId>
</dependency>
<!--undertow容器-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
</dependencies>
<profiles>
<profile>
<id>boot</id>
</profile>
<profile>
<id>cloud</id>
<activation>
<!-- 默认环境 -->
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<build>
<!-- 关闭测试用例-->
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
<!-- Maven 编译插件,配置 MapStruct 和 Lombok 注解处理器 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<source>17</source>
<target>17</target>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.30</version>
</path>
<path>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>1.5.2.Final</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<excludes>
<exclude>**/*.xlsx</exclude>
<exclude>**/*.xls</exclude>
</excludes>
</resource>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
<includes>
<include>**/*.xlsx</include>
<include>**/*.xls</include>
</includes>
</resource>
</resources>
</build>
</project>
# 广联GSC(glsk spring cloud)开发规范
## 一、技术栈选型约束
| 层级 | 技术组件 | 版本要求 | 说明 |
|-------|----------------------|------------------------------|--------------------------------------------|
| 基础环境 | JDK | openJDK 17 | 统一JDK版本,避免因版本差异导致的兼容性问题 |
| | Spring Boot | 3.5.x | 遵循LTS版本,兼容Spring Cloud Alibaba 2025.0.x及以上 |
| | Spring Cloud Alibaba | 2025.0.x | 提供注册中心、配置中心等核心能力 |
| 注册与配置 | Nacos | 3.0.x | 作为注册中心(服务发现)和配置中心(动态配置) |
| 内部通信 | Feign | Spring Cloud OpenFeign 4.3.x | 声明式HTTP客户端 |
| 数据存储 | Druid | 1.2.x | 数据库连接池,提供监控、慢SQL分析能力 |
| ORM | MyBatis-Plus | 3.5.x | 基于MyBatis扩展,简化CRUD操作 |
| 日志 | Logback | 1.5.x | 统一日志框架,输出结构化日志(JSON格式) |
| 消息中间件 | RabbitMQ | RabbitMQ 3.7.x | 异步解耦,支持事务消息 |
| 数据库 | MySQL | MySQL 8.0+ | 关系型数据库 |
| 缓存 | Redis | spring data redis 3.5.x | 分布式缓存 |
| | Redisson | | redis分布式操作开源客户端 |
| 工具包 | hutool | 5.8.38 | |
| 文件上传 | 阿里云OSS | | 使用广联的alioss封装组件 |
## 二、部署方案
### 1. 广联OPS集成打包部署(推荐)
由运维将项目集成至OPS打包部署和版本管理
### 2. 使用docker进行打包部署
此脚手架支持docker打包部署
### 3. 快速开始参考
[开发]快速开始·语雀
## 三、开发规范
### 1. 代码分层及项目结构规范
#### 1.1 对外API facade项目结构
#### 1.2 服务层biz项目结构
### 2. 接口设计规范
#### 2.1 协议与格式
- 内部服务调用:HTTP/REST(Feign)
- 入参/出参:RESTful风格
#### 2.2 接口命名
- 根据id详情查询:`项目名.模块名.功能.detail.by.id`
- 根据参数列表分页查询:`项目名.模块名.功能.page.by.condition`
- 根据参数列表查询:`项目名.模块名.功能.list.by.condition`
- 保存:`项目名.模块名.功能.save`
- 根据id更新:`项目名.模块名.功能.update.by.id`
示例:
```
# admin项目,sys模块,dict功能,根据id查询详情
admin.sys.dict.detail.by.id
```
### 3. Feign客户端规范
```java
@FeignClient(
name = "user-service", // 必填,服务名
contextId = "userApiClient", // 必填,客户端唯一标识
path = "/api/v1" // 可选,接口统一前缀
)
public interface UserApiClient {
// 接口方法
}
```
### 4. MyBatis-Plus规范
#### CRUD操作:
```java
// 正确示例:查询有效订单(status=1)
QueryWrapper<Order> queryWrapper=new QueryWrapper<>();
queryWrapper.eq("status",1).orderByDesc("create_time");
List<Order> orders=orderMapper.selectList(queryWrapper);
```
### 5. 依赖管理规范
- 禁止循环依赖
- 版本统一通过gps parent管理
## 四、组件使用及配置模板
### 1. 应用配置
#### 本地配置:`application.yml`
#### Nacos配置中心配置:
- 网关配置:`gsc-gateway-dev.yml`
- 后台项目配置:`gsc-upms-biz-dev.yml`
- 对接前端项目配置:`gsc-upms-biz-dev.yml`
### 2. Nacos服务注册发现配置
开发Nacos地址:
`http://192.168.3.102:8868/nacos/`
账密:`nacos/nacos`
### 3. 数据库及Druid连接池配置
```yaml
spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
druid:
url: jdbc:mysql://192.168.3.227:3306/dj_smartcarlife?useSSL=false&serverTimezone=Asia/Shanghai&characterEncoding=utf8
username: dev_admin
password: 1f7e1ed2
driver-class-name: com.mysql.cj.jdbc.Driver
initial-size: 5
min-idle: 5
max-active: 20
max-wait: 60000
stat-view-servlet:
enabled: true
url-pattern: /druid/*
login-username: admin
login-password: admin@123
```
### 4. Redis及Redisson配置
```yaml
spring:
data:
redis:
host: 192.168.3.226
port: 6379
database: 0
timeout: 30000
redisson:
config:
singleServerConfig:
idleConnectionTimeout: 10000
connectTimeout: 5000
timeout: 3000
```
### 5. XXL-JOB配置
```yaml
xxl:
job:
admin:
addresses: http://192.168.1.124:8080/xxl-job-admin
accessToken: default_token
timeout: 3
executor:
appname: @artifactId@-executor
address: http://192.168.1.207:9999,http://192.168.1.124:9999
port: 9999
logpath: /data/applogs/项目名/jobhandler
logretentiondays: 30
```
### 6. RabbitMQ配置
```java
// 高可靠性最佳实践
public void sendWithFullReliability(String exchange,String routingKey,String content){
rabbitTemplate.setConfirmCallback((correlation,ack,reason)->{
if(!ack){
log.error("Message nacked: {}",reason);
}
});
rabbitTemplate.convertAndSend(exchange,routingKey,content,message->{
MessageProperties props=message.getMessageProperties();
props.setDeliveryMode(MessageDeliveryMode.PERSISTENT);
props.setHeader("retryCount",0);
props.setExpiration("600000"); // 10分钟后过期
return message;
});
}
```
### 7. 阿里云OSS配置
```yaml
gsc:
alioss:
enabled: true
bucket-pool:
jinrong-huidan-test:
enable-intranet: true
access-key-id: LTAI5*************F2fk4e
access-key-secret: iYJdlgs6*************Ck83d5C
endpoint: oss-cn-shenzhen.aliyuncs.com
region: cn-shenzhen
```
### 8. 雪花算法配置
```yaml
gsc:
common:
snowflake:
enabled: true
```
### 9. 分布式锁配置
```xml
<dependency>
<groupId>com.gsc4cloud</groupId>
<artifactId>gsc-common-lock</artifactId>
<version>1.0.0</version>
</dependency>
```
## 五、示例代码
### 阿里云OSS上传示例
```java
@Autowired
private AliOssUploadClient aliOssUploadClient;
@Test
public void testAliOssUploadFile(){
String objectName="testdev/wKgFDWcZuYWAS1VBAAvF0oY4U7A75.webp";
String filePath="D:\\test\\bhg-图片\\wKgFDWcZuYWAS1VBAAvF0oY4U7A75.webp";
String bucketName="jinrong-huidan-test";
File file=new File(filePath);
String fileUrl=aliOssUploadClient.uploadFileSimple(bucketName,objectName,file,null);
System.out.println(fileUrl);
}
```
### 雪花ID生成示例
```java
@Autowired
private SnowflakeWorker snowflakeWorker;
@Test
public void testSnowflake(){
long currentId=snowflakeWorker.nextId();
System.out.println(currentId);
}
```
\ No newline at end of file \ No newline at end of file
/*
*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the gsc4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*
*/
package com.gsc4cloud.gsc.facade.vpcweb;
import com.gsc4cloud.gsc.common.feign.annotation.EnableGscFeignClients;
import com.gsc4cloud.gsc.common.swagger.annotation.EnableGscDoc;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
/**
* 用户统一管理系统
*
* @author
* @date 2025/05/30
*/
@EnableGscDoc(value = "gsc-vcp-web-facade")
@EnableGscFeignClients
@EnableDiscoveryClient
@SpringBootApplication
@EnableAspectJAutoProxy
public class VpcWebFacadeMain {
public static void main(String[] args) {
SpringApplication.run(VpcWebFacadeMain.class, args);
}
}
package com.gsc4cloud.gsc.facade.vpcweb.anotation;
import java.lang.annotation.*;
/**
* 需要兼容ropsession的地方添加此注解
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface RopSession {
}
package com.gsc4cloud.gsc.facade.vpcweb.config;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.core.env.Environment;
import org.springframework.core.task.TaskExecutor;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
@Slf4j
@Configuration
public class BeanConfig {
@Autowired
private Environment env;
@Bean
@Primary
public TaskExecutor taskExecutor(){
ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor();
taskExecutor.setCorePoolSize(env.getProperty("taskExecutor.corePoolSize", Integer.class, 100));
taskExecutor.setMaxPoolSize(env.getProperty("taskExecutor.maxPoolSize", Integer.class, 200));
taskExecutor.setQueueCapacity(env.getProperty("taskExecutor.queueCapacity", Integer.class, 10002));
taskExecutor.setKeepAliveSeconds(env.getProperty("taskExecutor.keepAliveSeconds", Integer.class, 300));
return taskExecutor;
}
}
package com.gsc4cloud.gsc.facade.vpcweb.config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.cloud.context.environment.EnvironmentChangeEvent;
import org.springframework.context.event.EventListener;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
import java.util.Set;
/**
* @Description todo
* @Author yelq
* @Date 2025/10/10-17:59
* @Version 1.0
*/
@RefreshScope // 关键注解
@Component
public class EnvRefreshHandler {
private final Environment env; // 注入Environment
public EnvRefreshHandler(Environment env) {
this.env = env;
}
@EventListener
public void handleEnvChange(EnvironmentChangeEvent event) {
// 获取变更的配置key集合
Set<String> changedKeys = event.getKeys();
changedKeys.forEach(key -> {
String newValue = env.getProperty(key);
System.out.println("配置已更新: " + key + " -> " + newValue);
// 这里可以执行业务逻辑,如重建数据库连接等
});
}
}
package com.gsc4cloud.gsc.facade.vpcweb.config;
import com.gsc4cloud.gsc.facade.vpcweb.interceptor.OpenFeignInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class FeignConfig {
@Bean
public OpenFeignInterceptor openFeignInterceptor() {
return new OpenFeignInterceptor();
}
}
\ No newline at end of file \ No newline at end of file
package com.gsc4cloud.gsc.facade.vpcweb.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.filter.CommonsRequestLoggingFilter;
/**
* @Description 日志打印配置
* @Author yelq
* @Date 2025/9/25-18:44
* @Version 1.0
*/
@Configuration
public class FilterConfig {
@Bean
public CommonsRequestLoggingFilter logFilter() {
CommonsRequestLoggingFilter filter = new CommonsRequestLoggingFilter();
filter.setIncludeQueryString(true);
filter.setIncludePayload(true);
filter.setMaxPayloadLength(300); // 设置最大打印body长度
filter.setIncludeHeaders(true);
filter.setAfterMessagePrefix("请求信息: ");
return filter;
}
}
package com.gsc4cloud.gsc.facade.vpcweb.config;
import lombok.Data;
import lombok.ToString;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
/**
* @Description rop api 配置
* @Author yelq
* @Date 2025/7/28-19:09
* @Version 1.0
*/
@ToString
@Data
@Configuration
@ConfigurationProperties(prefix = "rop.api")
public class RopApiConfig {
private String appKey;
private String secret;
private String url;
private String contextPath;
private String method;
}
package com.gsc4cloud.gsc.facade.vpcweb.config;
import io.swagger.v3.oas.models.parameters.Parameter;
import org.springdoc.core.customizers.OpenApiCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class SwaggerConfig {
@Bean
public OpenApiCustomizer openApiCustomizer() {
return openApi -> {
// 添加全局请求头 X-Mock
Parameter mockHeader = new Parameter()
.in("header") // 类型:header
.name("SessionId") // 名称
.description("登录的SessionId")
.required(false); // 是否必填 值
openApi.getPaths().values().forEach(pathItem -> {
pathItem.readOperations().forEach(operation -> {
operation.addParametersItem(mockHeader);
});
});
};
}
}
\ No newline at end of file \ No newline at end of file
package com.gsc4cloud.gsc.facade.vpcweb.config;
import com.gsc4cloud.gsc.facade.vpcweb.interceptor.SessionInterceptor;
import com.gsc4cloud.gsc.facade.vpcweb.interceptor.TraceInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/**
* @Description web session拦截器配置
* @Author yelq
* @Date 2025/7/28-15:37
* @Version 1.0
*/
@Configuration
public class WebConfig implements WebMvcConfigurer {
@Autowired
private SessionInterceptor sessionInterceptor;
@Autowired
private TraceInterceptor traceInterceptor;
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(traceInterceptor)
.addPathPatterns("/**");
registry.addInterceptor(sessionInterceptor)
.addPathPatterns("/**") // 拦截所有路径
/*.excludePathPatterns("/login", "/error")*/; // 排除不需要拦截的路径
}
}
package com.gsc4cloud.gsc.facade.vpcweb.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gsc4cloud.gsc.common.core.util.R;
import com.gsc4cloud.gsc.facade.vpcweb.anotation.RopSession;
import com.gsc4cloud.gsc.facade.vpcweb.config.RopApiConfig;
import com.gsc4cloud.gsc.facade.vpcweb.request.DemoRequest;
import com.gsc4cloud.gsc.vpc.api.feign.DemoFeignService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Arrays;
@RefreshScope
@Slf4j
@RequestMapping("/test")
@RestController
@Tag(name = "测试接口", description = "测试接口")
public class TestController {
@Autowired
private DemoFeignService demoFeignService;
@Autowired
private Environment environment;
@Autowired
private RopApiConfig ropApiConfig;
@Value("${addparam:测试}")
private String abc;
@PostMapping("/env/refresh")
@Operation(summary = "配置刷新测试")
public R refreshTest(@RequestBody DemoRequest request) {
log.info("request:{}", request);
log.info("ropApiConfig:{}", ropApiConfig.toString());
String property = environment.getProperty(request.getStr());
System.out.println(this.abc);
return R.ok(property);
}
@RopSession
@PostMapping("/session/test")
@Operation(summary = "分页测试")
public R sessionTest(@RequestBody DemoRequest request) {
log.info("request:{}", request);
return R.ok(request);
}
@PostMapping("/page/test")
@Operation(summary = "分页测试")
public R<IPage> getPage(@RequestBody DemoRequest request) {
log.info("request:{}", request);
IPage pageResp = new Page(request.getCurrent(), request.getSize());
DemoRequest request1 = new DemoRequest();
DemoRequest request2 = new DemoRequest();
DemoRequest request3 = new DemoRequest();
pageResp.setRecords(Arrays.asList(request1, request2, request3));
pageResp.setTotal(pageResp.getRecords().size());
return R.ok(pageResp);
}
@PostMapping("/param/test")
@Operation(summary = "传参测试")
public R getParam(@RequestBody DemoRequest request) {
log.info("request:{}", request);
return R.ok(request);
}
@PostMapping("/post/demo01")
@Operation(summary = "传参测试feign调用")
public R getParam1(@RequestBody com.gsc4cloud.gsc.vpc.api.req.DemoRequest request) {
log.info("request:{}", request);
return R.ok(demoFeignService.demo(request));
}
@RopSession
@PostMapping("/param/test1")
@Operation(summary = "带可选参数的接口",description = "演示如何让用户可选输入参数",
parameters = {
@Parameter(
name = "sessionId",
description = "sessionId 参数(可选)",
example = "123456",
in = ParameterIn.QUERY,
required = false
)
}
)
public R getParam1(@RequestBody DemoRequest request) {
log.info("request:{}", request);
return R.ok(request);
}
}
package com.gsc4cloud.gsc.facade.vpcweb.controller.car;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gsc4cloud.gsc.common.core.util.R;
import com.gsc4cloud.gsc.facade.vpcweb.anotation.RopSession;
import com.gsc4cloud.gsc.facade.vpcweb.service.car.CarManagementService;
import com.gsc4cloud.gsc.facade.vpcweb.vo.car.CarManageInfoDetailVO;
import com.gsc4cloud.gsc.facade.vpcweb.vo.car.CarManageInfoLogVO;
import com.gsc4cloud.gsc.facade.vpcweb.vo.car.CarManageInfoPageVO;
import com.gsc4cloud.gsc.vpc.api.req.PageRequest;
import com.gsc4cloud.gsc.vpc.api.req.web.car.CarManageInfoEditRequest;
import com.gsc4cloud.gsc.vpc.api.req.web.car.CarManageInfoPageRequest;
import com.gsc4cloud.gsc.vpc.api.req.web.car.CarManageInfoRequest;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @Author: zhangfk
* @Date: 2025/9/18
*/
@RestController
@RequestMapping("/carManagement")
@Tag(name = "车辆管理")
@Slf4j
public class CarManagementController {
@Resource
private CarManagementService carManagementService;
/**
* 车辆管理分页
*/
@Operation(summary = "车辆管理分页")
@PostMapping("/carManagementPage")
public R<Page<CarManageInfoPageVO>> carManagementPage(@RequestBody PageRequest<CarManageInfoPageRequest> request) {
log.info("请求参数{}", JSONObject.toJSONString(request));
try {
return carManagementService.carManagementPage(request);
} catch (Exception e) {
e.printStackTrace();
log.error("车辆管理分页", e);
return R.failed(e.getMessage());
}
}
/**
* 车辆详情信息
*/
@Operation(summary = "车辆详情信息")
@PostMapping("/details")
public R<CarManageInfoDetailVO> details(@RequestBody CarManageInfoRequest request) {
log.info("请求参数{}", JSONObject.toJSONString(request));
try {
return carManagementService.details(request);
} catch (Exception e) {
e.printStackTrace();
log.error("车辆详情信息", e);
return R.failed(e.getMessage());
}
}
/**
* 状态变更
*/
@Operation(summary = "状态变更")
@RopSession
@PostMapping("/edit")
public R<Boolean> edit(@RequestBody CarManageInfoEditRequest request) {
log.info("请求参数{}", JSONObject.toJSONString(request));
try {
return carManagementService.edit(request);
} catch (Exception e) {
e.printStackTrace();
log.error("状态变更", e);
return R.failed(e.getMessage());
}
}
/**
* 车辆管理日志
*/
@Operation(summary = "车辆管理日志")
@PostMapping("/carManagementLog")
public R<List<CarManageInfoLogVO>> carManagementLog(@RequestBody CarManageInfoRequest request) {
log.info("请求参数{}", JSONObject.toJSONString(request));
try {
return carManagementService.carManagementLog(request);
} catch (Exception e) {
e.printStackTrace();
log.error("车辆管理日志", e);
return R.failed(e.getMessage());
}
}
/**
* 导出车辆管理信息
*/
@Operation(summary = "导出excel")
@RopSession
@PostMapping("/exportCarManageInfoAsync")
R<String> exportCarManageInfoAsync(@RequestBody CarManageInfoPageRequest request) {
log.info("请求参数{}", JSONObject.toJSONString(request));
try {
return carManagementService.exportCarManageInfoAsync(request);
} catch (Exception e) {
e.printStackTrace();
log.error("导出excel", e);
return R.failed(e.getMessage());
}
}
/**
* 异步导出评估单车辆图片信息
*/
@PostMapping("/exportCarManageInfoImageZipAsync")
R<String> exportCarManageInfoImageZipAsync(@RequestBody CarManageInfoRequest request) {
log.info("请求参数{}", JSONObject.toJSONString(request));
try {
return carManagementService.exportCarManageInfoImageZipAsync(request);
} catch (Exception e) {
e.printStackTrace();
log.error("异步导出评估单车辆图片信息", e);
return R.failed(e.getMessage());
}
}
}
package com.gsc4cloud.gsc.facade.vpcweb.controller.configs;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gsc4cloud.gsc.common.core.util.R;
import com.gsc4cloud.gsc.facade.vpcweb.anotation.RopSession;
import com.gsc4cloud.gsc.facade.vpcweb.service.configs.SunlightInspiresConfigService;
import com.gsc4cloud.gsc.facade.vpcweb.vo.configs.SunlightInspiresConfigLogPageVO;
import com.gsc4cloud.gsc.facade.vpcweb.vo.configs.SunlightInspiresConfigPageVO;
import com.gsc4cloud.gsc.facade.vpcweb.vo.configs.SunlightInspiresConfigVO;
import com.gsc4cloud.gsc.vpc.api.req.PageRequest;
import com.gsc4cloud.gsc.vpc.api.req.web.configs.SunlightInspiresConfigPageRequest;
import com.gsc4cloud.gsc.vpc.api.req.web.configs.SunlightInspiresConfigRequest;
import com.gsc4cloud.gsc.vpc.api.validation.AddGroup;
import com.gsc4cloud.gsc.vpc.api.validation.DeleteGroup;
import com.gsc4cloud.gsc.vpc.api.validation.UpdateGroup;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @Author: linyj
* @Date: 2025/9/20
*/
@RestController
@RequestMapping("/sunlightInspiresConfig")
@Tag(name = "阳光激励配置管理")
public class SunlightInspiresConfigController {
@Resource
private SunlightInspiresConfigService sunlightInspiresConfigService;
/**
* 阳光激励配置分页
*/
@Operation(summary = "阳光激励配置分页")
@RopSession
@PostMapping("/page")
public R<Page<SunlightInspiresConfigPageVO>> page(@RequestBody PageRequest<SunlightInspiresConfigPageRequest> request) {
return sunlightInspiresConfigService.page(request);
}
/**
* 阳光激励配置导出
*/
@Operation(summary = "阳光激励配置导出")
@RopSession
@PostMapping("/export")
public R<String> export(@RequestBody PageRequest<SunlightInspiresConfigPageRequest> request) {
return sunlightInspiresConfigService.export(request);
}
/**
* 阳光激励配置详情信息
*/
@Operation(summary = "阳光激励配置详情信息")
@RopSession
@PostMapping("/details")
public R<SunlightInspiresConfigVO> details(@RequestBody SunlightInspiresConfigRequest request) {
return sunlightInspiresConfigService.details(request);
}
/**
* 阳光激励配置新增
*/
@Operation(summary = "阳光激励配置新增")
@RopSession
@PostMapping("/create")
public R<Boolean> create(@RequestBody @Validated(AddGroup.class) SunlightInspiresConfigRequest request) {
return sunlightInspiresConfigService.create(request);
}
/**
* 阳光激励配置变更
*/
@Operation(summary = "阳光激励配置变更")
@RopSession
@PostMapping("/edit")
public R<Boolean> edit(@RequestBody @Validated(UpdateGroup.class) SunlightInspiresConfigRequest request) {
return sunlightInspiresConfigService.edit(request);
}
/**
* 阳光激励配置删除
*/
@Operation(summary = "阳光激励配置删除")
@RopSession
@PostMapping("/delete")
public R<Boolean> delete(@RequestBody @Validated(DeleteGroup.class) SunlightInspiresConfigRequest request) {
return sunlightInspiresConfigService.delete(request);
}
/**
* 阳光激励配置日志
*/
@Operation(summary = "阳光激励配置日志")
@RopSession
@PostMapping("/log/page")
public R<Page<SunlightInspiresConfigLogPageVO>> logPage(@RequestBody PageRequest<SunlightInspiresConfigRequest> request) {
return sunlightInspiresConfigService.logPage(request);
}
}
package com.gsc4cloud.gsc.facade.vpcweb.controller.evaorder;
import com.gsc4cloud.gsc.common.core.util.R;
import com.gsc4cloud.gsc.vpc.api.dto.miniapp.reqdto.car.BusinessPerDataQuery;
import com.gsc4cloud.gsc.vpc.api.dto.miniapp.resdto.car.UsedCarBusinessDataDTO;
import com.gsc4cloud.gsc.vpc.api.dto.web.reqdto.DataBoardRequest;
import com.gsc4cloud.gsc.vpc.api.dto.web.reqdto.DataQSRequest;
import com.gsc4cloud.gsc.vpc.api.dto.web.resdto.DataBoardTendencyResponse;
import com.gsc4cloud.gsc.vpc.api.feign.miniapp.car.CarManageInfoRemote;
import com.gsc4cloud.gsc.vpc.api.feign.web.evalorder.DataBoardRemote;
import com.gsc4cloud.gsc.vpc.api.util.DateUtils;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import java.util.Arrays;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 二手车数据看板
*
* @author xiehx
*/
@Tag(name = "二手车数据看板")
@RestController
@RequestMapping("/dataBoard")
public class DataBoardController {
@Autowired
private DataBoardRemote dataBoardRemote;
@Autowired
private CarManageInfoRemote carManageInfoRemote;
@Operation(summary = "指标统计")
@PostMapping("/index")
public R<UsedCarBusinessDataDTO> index(@RequestBody @Validated DataBoardRequest request) {
// 根据dateType,生产开始和结束日期
Integer dateType = request.getDateType();
// 1.今日 2.昨日 3.本月 4.上月 5.自定义
switch (dateType) {
case 1: // 今日
request.setStartDate(DateUtils.getCurrentDate());
request.setEndDate(DateUtils.getCurrentDate());
request.setType(1);
break;
case 2: // 昨日
request.setStartDate(DateUtils.getYesterday());
request.setEndDate(DateUtils.getYesterday());
request.setType(1);
break;
case 3: // 本月
request.setStartDate(DateUtils.getCurrentMonthStart());
request.setEndDate(DateUtils.getCurrentMonthEnd());
request.setType(3);
break;
case 4: // 上月
request.setStartDate(DateUtils.getLastMonthStart());
request.setEndDate(DateUtils.getLastMonthEnd());
request.setType(3);
break;
case 5: // 自定义
// 不处理,使用前端传入的 startDate 和 endDate
request.setType(1);
break;
default:
throw new IllegalArgumentException("无效的 dateType: " + dateType);
}
BusinessPerDataQuery queryParams = BusinessPerDataQuery.builder()
.startTime(request.getStartDate())
.endTime(request.getEndDate())
.type(request.getType())
.build();
if (request.getMerchantNos() != null) {
queryParams.setMerchantNos(Arrays.asList(request.getMerchantNos()));
}
return carManageInfoRemote.getUsedCarBusinessData(
queryParams);
}
@Operation(summary = "评估量趋势")
@PostMapping("/evaluation")
public R<List<DataBoardTendencyResponse>> evaluation(@RequestBody @Validated DataQSRequest request) {
return dataBoardRemote.evaluation(request);
}
@Operation(summary = "成交量趋势")
@PostMapping("/deal")
public R<List<DataBoardTendencyResponse>> deal(@RequestBody @Validated DataQSRequest request) {
return dataBoardRemote.deal(request);
}
}
package com.gsc4cloud.gsc.facade.vpcweb.controller.evaorder;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gsc4cloud.gsc.common.core.util.R;
import com.gsc4cloud.gsc.facade.vpcweb.anotation.RopSession;
import com.gsc4cloud.gsc.facade.vpcweb.service.evalorder.EvalOrderManageService;
import com.gsc4cloud.gsc.vpc.api.dto.entitydto.evalorder.EvalPriceHistoryDTO;
import com.gsc4cloud.gsc.vpc.api.dto.pad.resdto.evalorder.EvalOrderPageResDTO;
import com.gsc4cloud.gsc.vpc.api.dto.web.resdto.evalorder.EvalOrderDetailResDTO;
import com.gsc4cloud.gsc.vpc.api.req.PageRequest;
import com.gsc4cloud.gsc.vpc.api.req.pad.evalorder.EvalOrderPageRequest;
import com.gsc4cloud.gsc.vpc.api.req.web.evalorder.*;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@RequestMapping("/evalOrderManage")
@Tag(name = "评估订单管理")
public class EvaOrderManageController {
@Autowired
private EvalOrderManageService evalOrderManageService;
@RopSession
@PostMapping("/getEvalOrderList")
@Operation(summary = "评估单列表")
public R<Page<EvalOrderPageResDTO>> evalOrderListPageByCondition(@RequestBody PageRequest<EvalOrderPageRequest> request) {
return evalOrderManageService.page(request);
}
@RopSession
@PostMapping("/getEvalOrderDetail")
@Operation(summary = "评估单详情")
public R<EvalOrderDetailResDTO> evalOrderDetailByNo(@RequestBody EvalOrderDetailRequest request) {
return evalOrderManageService.evalOrderDetail(request);
}
@RopSession
@PostMapping("/getEvalOrderPriceHistory")
@Operation(summary = "评估单动态")
public R<List<EvalPriceHistoryDTO>> evalOrderPriceHistoryByCondition(@RequestBody EvalOrderPriceHistoryRequest request) {
return evalOrderManageService.evalOrderPriceHistoryByCondition(request);
}
@RopSession
@PostMapping("/exportEvalOrderAsync")
@Operation(summary = "评估单异步导出")
public R<String> exportEvalOrderAsync(@RequestBody EvalOrderPageRequest request) {
return evalOrderManageService.exportEvalOrderAsync(request);
}
@RopSession
@PostMapping("/exportEvalOrderImageZipAsync")
@Operation(summary = "评估单车辆图片压缩包异步导出")
public R<String> exportEvalOrderImageZipAsync(@RequestBody EvalOrderImageExportRequest request) {
return evalOrderManageService.exportEvalOrderImageZipAsync(request);
}
@RopSession
@PostMapping("/evaluate")
@Operation(summary = "评估车辆")
public R<Boolean> evaluate(@RequestBody @Validated EvalOrderQuoteRequest request) {
return evalOrderManageService.evaluate(request);
}
}
package com.gsc4cloud.gsc.facade.vpcweb.controller.evaorder;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gsc4cloud.gsc.common.core.util.R;
import com.gsc4cloud.gsc.facade.vpcweb.anotation.RopSession;
import com.gsc4cloud.gsc.facade.vpcweb.service.evalorder.EvalElectronicContractService;
import com.gsc4cloud.gsc.vpc.api.dto.entitydto.evalorder.EvalElectronicContractDTO;
import com.gsc4cloud.gsc.vpc.api.dto.web.reqdto.evalorder.EvalElectronicContractDetailReq;
import com.gsc4cloud.gsc.vpc.api.dto.web.reqdto.evalorder.EvalElectronicContractDownloadReq;
import com.gsc4cloud.gsc.vpc.api.dto.web.reqdto.evalorder.EvalElectronicContractEditReq;
import com.gsc4cloud.gsc.vpc.api.dto.web.reqdto.evalorder.EvalElectronicContractPageReq;
import com.gsc4cloud.gsc.vpc.api.req.PageRequest;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 评估单关联电子合同
*
* @author 谢海旭
*/
@Tag(name = "评估单关联电子合同")
@RestController
@Slf4j
@RequestMapping("/evalElectronicContract")
public class EvalElectronicContractController {
@Autowired
private EvalElectronicContractService evalElectronicContractService;
@Operation(summary = "合同分页列表")
@PostMapping("/page")
public R<Page<EvalElectronicContractDTO>> page(@RequestBody PageRequest<EvalElectronicContractPageReq> request) {
EvalElectronicContractDTO evalElectronicContractDTO =new EvalElectronicContractDTO();
BeanUtils.copyProperties(request.getT(), evalElectronicContractDTO);
log.info("合同分页列表参数:{}", JSONObject.toJSONString(request));
PageRequest<EvalElectronicContractDTO> param = new PageRequest<>(request.getCurrentPage(), request.getPageSize());
param.setT(evalElectronicContractDTO);
return evalElectronicContractService.webCustomPage(param);
}
@Operation(summary = "合同详情")
@RopSession
@PostMapping("/detail")
public R<EvalElectronicContractDTO> detail(@RequestBody EvalElectronicContractDetailReq request) {
EvalElectronicContractDTO evalElectronicContractDTO =new EvalElectronicContractDTO();
evalElectronicContractDTO.setId(request.getId());
return evalElectronicContractService.detail(evalElectronicContractDTO);
}
@Operation(summary = "编辑合同备注")
@PostMapping("/editDescription")
@RopSession
public R<EvalElectronicContractDTO> editDescription(@RequestBody EvalElectronicContractEditReq request) {
EvalElectronicContractDTO evalElectronicContractDTO =new EvalElectronicContractDTO();
BeanUtils.copyProperties(request, evalElectronicContractDTO);
return evalElectronicContractService.editDescription(evalElectronicContractDTO);
}
@Operation(summary = "合同下载")
@PostMapping("/getContractFileUrl")
@RopSession
public R<String> getContractFileUrl(@RequestBody EvalElectronicContractDownloadReq request) {
EvalElectronicContractDTO evalElectronicContractDTO =new EvalElectronicContractDTO();
BeanUtils.copyProperties(request, evalElectronicContractDTO);
return evalElectronicContractService.getContractFileUrl(evalElectronicContractDTO);
}
@RopSession
@PostMapping("/exportElectronicContractAsync")
@Operation(summary = "合同管理异步导出")
public R<String> exportElectronicContractAsync(@RequestBody EvalElectronicContractPageReq request) {
return evalElectronicContractService.exportElectronicContractAsync(request);
}
@RopSession
@PostMapping("/reExecuteContractSigned")
@Operation(summary = "重新执行签署完成的合同业务逻辑")
public R<Void> reExecuteContractSigned(@RequestBody String param) {
log.info("resumeOperations param:{}", param);
return evalElectronicContractService.reExecuteContractSigned(param);
}
}
package com.gsc4cloud.gsc.facade.vpcweb.convert;
import com.gsc4cloud.gsc.facade.vpcweb.vo.car.CarManageInfoDetailVO;
import com.gsc4cloud.gsc.vpc.api.dto.entitydto.car.CarManageInfoDetailDTO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
@Mapper
public interface CarManageInfoDetailConvert {
CarManageInfoDetailConvert INSTANCE = Mappers.getMapper(CarManageInfoDetailConvert.class);
CarManageInfoDetailVO toCarManageInfoDetailVO(CarManageInfoDetailDTO source);
}
package com.gsc4cloud.gsc.facade.vpcweb.convert;
import com.gsc4cloud.gsc.facade.vpcweb.vo.car.CarManageInfoLogVO;
import com.gsc4cloud.gsc.vpc.api.dto.entitydto.car.CarManageInfoLogDTO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import java.util.List;
@Mapper
public interface CarManageInfoLogConvert {
CarManageInfoLogConvert INSTANCE = Mappers.getMapper(CarManageInfoLogConvert.class);
List<CarManageInfoLogVO> toCarManageInfoLogVO(List<CarManageInfoLogDTO> source);
}
package com.gsc4cloud.gsc.facade.vpcweb.convert;
import com.gsc4cloud.gsc.facade.vpcweb.vo.car.CarManageInfoPageVO;
import com.gsc4cloud.gsc.vpc.api.dto.car.CarManageInfoPageDTO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
@Mapper
public interface CarManageInfoPageConvert {
CarManageInfoPageConvert INSTANCE = Mappers.getMapper(CarManageInfoPageConvert.class);
CarManageInfoPageVO toCarManageInfoPageVO(CarManageInfoPageDTO source);
}
package com.gsc4cloud.gsc.facade.vpcweb.convert;
import com.gsc4cloud.gsc.facade.vpcweb.vo.configs.SunlightInspiresConfigPageVO;
import com.gsc4cloud.gsc.facade.vpcweb.vo.configs.SunlightInspiresConfigVO;
import com.gsc4cloud.gsc.vpc.api.dto.entitydto.configs.SunlightInspiresConfigDTO;
import com.gsc4cloud.gsc.vpc.api.req.PageRequest;
import com.gsc4cloud.gsc.vpc.api.req.web.configs.SunlightInspiresConfigPageRequest;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
@Mapper
public interface SunlightInspiresConfigPageConvert {
SunlightInspiresConfigPageConvert INSTANCE = Mappers.getMapper(SunlightInspiresConfigPageConvert.class);
PageRequest<SunlightInspiresConfigPageVO> toSunlightInspiresConfigPageVO(PageRequest<SunlightInspiresConfigPageRequest> source);
SunlightInspiresConfigPageVO toSunlightInspiresConfigPageVO(SunlightInspiresConfigDTO source);
SunlightInspiresConfigVO toSunlightInspiresConfigVO(SunlightInspiresConfigDTO source);
}
package com.gsc4cloud.gsc.facade.vpcweb.convert;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gsc4cloud.gsc.facade.vpcweb.vo.configs.SunlightInspiresConfigLogPageVO;
import com.gsc4cloud.gsc.vpc.api.dto.entitydto.configs.SunlightInspiresConfigLogDTO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
@Mapper
public interface SunlightInspiresConfigPageLogConvert {
SunlightInspiresConfigPageLogConvert INSTANCE = Mappers.getMapper(SunlightInspiresConfigPageLogConvert.class);
Page<SunlightInspiresConfigLogPageVO> toPageVo(Page<SunlightInspiresConfigLogDTO> source);
}
package com.gsc4cloud.gsc.facade.vpcweb.handler;
import cn.hutool.core.util.CharsetUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.extra.spring.SpringUtil;
import cn.hutool.json.JSONUtil;
import com.gsc4cloud.gsc.common.core.util.R;
import com.gsc4cloud.gsc.vpc.api.enums.ErrorCodeEnum;
import com.gsc4cloud.gsc.vpc.api.exception.BusinessException;
import com.gsc4cloud.gsc.vpc.api.util.ExceptionPushRequest;
import com.gsc4cloud.gsc.vpc.api.util.ExceptionWeComRobotUtil;
import feign.FeignException;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.MDC;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.core.annotation.Order;
import org.springframework.core.env.Environment;
import org.springframework.core.task.TaskExecutor;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.BindException;
import org.springframework.validation.BindingResult;
import org.springframework.validation.ObjectError;
import org.springframework.web.HttpMediaTypeNotSupportedException;
import org.springframework.web.HttpRequestMethodNotSupportedException;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.util.ContentCachingRequestWrapper;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
/**
* @Description 本地全局异常处理类(集成TraceId版本)
* @Author yelq
* @Date 2025/9/19-20:47
* @Version 1.0
*/
@Order(9999)
@RestControllerAdvice
@Slf4j
@RefreshScope
public class GlobalExceptionHandler {
@Resource
private TaskExecutor taskExecutor;
@Value("${exceptionPushUrl: https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=3445fe68-7daa-46e2-a497-3e094313077f}")
private String EXCEPTION_PUSH_URL;
@Value("${pushExceptionFlag: true}")
private Boolean pushExceptionFlag;
@Value("${excludeExceptions:}")
private List<String> excludeExceptionList;
@Resource
private Environment environment;
private static final String LOCAL_DEBUG = "localDebug";
public GlobalExceptionHandler() {
}
/**
* 处理业务异常
*/
@ExceptionHandler(BusinessException.class)
public ResponseEntity<R<?>> handleBusinessException(BusinessException e) {
log.error("业务异常: code={}, message={}", e.getCode(), e.getMessage(), e);
return ResponseEntity
.status(HttpStatus.OK)
.body(R.restResult(null, e.getCode(), e.getMessage()));
}
/**
* 参数校验异常统一处理
*/
@ExceptionHandler({MethodArgumentNotValidException.class, BindException.class})
public ResponseEntity<R<?>> handleValidationException(Exception e) {
BindingResult bindingResult = null;
if (e instanceof MethodArgumentNotValidException) {
bindingResult = ((MethodArgumentNotValidException) e).getBindingResult();
} else if (e instanceof BindException) {
bindingResult = ((BindException) e).getBindingResult();
}
String message = Optional.ofNullable(bindingResult)
.map(result -> result.getAllErrors().stream()
.map(ObjectError::getDefaultMessage)
.collect(Collectors.joining("; ")))
.orElse("参数校验失败");
log.error("参数校验异常: {}", message, e);
return ResponseEntity
.status(HttpStatus.OK)
.body(R.restResult(null, ErrorCodeEnum.PARAM_INVALID.getCode(), message));
}
/**
* 处理请求方法不支持异常
*/
@ExceptionHandler(HttpRequestMethodNotSupportedException.class)
public ResponseEntity<R<?>> handleHttpRequestMethodNotSupportedException(
HttpRequestMethodNotSupportedException e) {
log.error("请求方法不支持: {}", e.getMessage(), e);
return ResponseEntity
.status(HttpStatus.METHOD_NOT_ALLOWED)
.body(R.restResult(null, 405, "请求方法不支持"));
}
/**
* 处理媒体类型不支持异常
*/
@ExceptionHandler(HttpMediaTypeNotSupportedException.class)
public ResponseEntity<R<?>> handleHttpMediaTypeNotSupportedException(
HttpMediaTypeNotSupportedException e) {
log.error("媒体类型不支持: {}", e.getMessage(), e);
return ResponseEntity
.status(HttpStatus.UNSUPPORTED_MEDIA_TYPE)
.body(R.restResult(null, 415, "媒体类型不支持"));
}
/**
* 处理Feign客户端异常
*/
@ExceptionHandler(FeignException.class)
public ResponseEntity<R<?>> handleFeignException(FeignException e) {
log.error("Feign客户端异常: status={}, message={}", e.status(), e.getMessage(), e);
return ResponseEntity
.status(HttpStatus.OK)
.body(R.restResult(null, ErrorCodeEnum.FEIGN_ERROR.getCode(), "服务调用失败: " + e.getMessage()));
}
/**
* 处理其他所有异常
*/
@ExceptionHandler(Exception.class)
public ResponseEntity<R<?>> handleException(Exception e, HttpServletRequest request) {
log.error("系统异常: ", e);
ResponseEntity<R<?>> body = ResponseEntity
.status(HttpStatus.OK)
.body(R.restResult(null, ErrorCodeEnum.SYSTEM_ERROR.getCode(), ErrorCodeEnum.SYSTEM_ERROR.getMessage()));
if (!pushExceptionFlag || StrUtil.isNotBlank(environment.getProperty(LOCAL_DEBUG))) {
return body;
}
String typeName = e.getClass().getTypeName();
// 可以在nacos进行配置哪些异常不发送信息 哪些异常发送信息
// 判断异常类型是否在list中
if (ObjectUtil.isNotEmpty(excludeExceptionList) && excludeExceptionList.contains(typeName)) {
return body;
}
ExceptionPushRequest exceptionPushRequest = new ExceptionPushRequest();
exceptionPushRequest.setEnvironment(SpringUtil.getActiveProfile());
exceptionPushRequest.setExceptionType(typeName);
exceptionPushRequest.setServerName(SpringUtil.getApplicationName());
String location = StrUtil.EMPTY;
String stackMessage = StrUtil.EMPTY;
for (StackTraceElement element : e.getStackTrace()) {
if (StrUtil.startWith(element.getClassName(), "com.gsc4cloud")) {
location = location.concat(element.toString()) + "\n";
}
stackMessage = stackMessage.concat(element.toString()) + "\n";
}
exceptionPushRequest.setLocation(location);
exceptionPushRequest.setStackMessage(stackMessage);
if (request instanceof ContentCachingRequestWrapper wrapper) {
String param = StrUtil.str(wrapper.getContentAsByteArray(), CharsetUtil.UTF_8);
exceptionPushRequest.setParam(JSONUtil.toJsonStr(param));
}
exceptionPushRequest.setUrl(request.getRequestURL().toString());
exceptionPushRequest.setAggregationService(request.getHeader("Aggregation-Service"));
exceptionPushRequest.setTraceId(MDC.get("traceId"));
// 异步发送信息
taskExecutor.execute(() -> ExceptionWeComRobotUtil.sendMarkdownMessage(EXCEPTION_PUSH_URL, exceptionPushRequest));
return body;
}
}
\ No newline at end of file \ No newline at end of file
package com.gsc4cloud.gsc.facade.vpcweb.interceptor;
import cn.hutool.core.util.StrUtil;
import feign.RequestInterceptor;
import feign.RequestTemplate;
import feign.Target;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.MDC;
import org.springframework.core.env.Environment;
import java.util.Objects;
@Slf4j
public class OpenFeignInterceptor implements RequestInterceptor {
@Resource
private Environment environment;
private static final String TRACE_HEADER = "X-Trace-Id";
private static final String LOCAL_DEBUG = "localDebug";
@Override
public void apply(RequestTemplate requestTemplate) {
try {
// 传递上下文信息
// UserContextDTO userInfo = UserContext.getContext();
// if (isInValidUser(userInfo)) {
// userInfo = new UserContextDTO();
// userInfo.setId(SystemDefault.SYSTEM_USER_ID);
// userInfo.setAccountName(SystemDefault.SYSTEM_USER_ACCOUNT);
// userInfo.setRealName(SystemDefault.SYSTEM_REAL_NAME);
// }
// String baseCodeUser = Base64.getEncoder().encodeToString(JSONObject.toJSONString(userInfo).getBytes());
// requestTemplate.header(SystemDefault.REQUEST_ID, MDC.get(SystemDefault.TRACE_ID));
// requestTemplate.header(SystemDefault.SYSTEM_USER_INFO, baseCodeUser);
String traceId = MDC.get("traceId");
if (StrUtil.isNotBlank(traceId)) {
requestTemplate.header(TRACE_HEADER, traceId);
}
// 拦截Feign请求url
String enableLocalhost = environment.getProperty(LOCAL_DEBUG);
if (Objects.isNull(enableLocalhost)) {
return;
}
Target<?> target = requestTemplate.feignTarget();
String targetName = target.name();
String targetUrl = target.url();
String newUrl = targetUrl.replace(targetName, targetName + "-" + enableLocalhost);
requestTemplate.target(newUrl);
} catch (Exception exception) {
log.error("requestTemplate.header error: ", exception);
}
}
// private boolean isInValidUser(UserContextDTO userInfo) {
// return userInfo == null || StringUtils.isEmpty(userInfo.getAccountName()) || userInfo.getId() == null;
// }
}
\ No newline at end of file \ No newline at end of file
package com.gsc4cloud.gsc.facade.vpcweb.interceptor;
import com.gsc4cloud.gsc.facade.vpcweb.anotation.RopSession;
import com.gsc4cloud.gsc.facade.vpcweb.manager.RopManager;
import com.gsc4cloud.gsc.facade.vpcweb.utils.ThreadLocalCache;
import com.gsc4cloud.gsc.vpc.api.enums.ErrorCodeEnum;
import com.gsc4cloud.gsc.vpc.api.exception.BusinessException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.HandlerInterceptor;
import java.lang.reflect.Method;
/**
* @Description session 拦截器
* @Author yelq
* @Date 2025/7/28-15:35
* @Version 1.0
*/
@Slf4j
@Component
public class SessionInterceptor implements HandlerInterceptor {
@Autowired
private RopManager ropManager;
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
String path = request.getRequestURI();
// 忽略swagger
if (path.startsWith("/swagger-ui") || path.contains("/v3/api-docs") || path.startsWith("/doc.html")) {
return true;
}
if (!(handler instanceof HandlerMethod)) {
return true;
}
HandlerMethod handlerMethod = (HandlerMethod) handler;
Method method = handlerMethod.getMethod();
// 1. 检查方法上是否有特定注解
if (!method.isAnnotationPresent(RopSession.class)) {
// 没有RopSession,则跳过token验证
return true;
}
// 从请求参数中获取sessionId
String sessionId = request.getParameter("sessionId");
if (sessionId == null || sessionId.isEmpty()) {
String sessionId1 = request.getHeader("SessionId");
if (sessionId1 != null && !sessionId1.isEmpty()) {
sessionId = sessionId1;
}else {
// 如果没有sessionId参数,直接放行(或者可以根据需求返回错误)
throw new BusinessException(ErrorCodeEnum.SESSION_NOT_EXIST);
}
}
ropManager.saveLoginInfo(sessionId);
// 无论是否找到用户信息,都继续执行后续流程
return true;
}
@Override
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
// 请求结束后清除ThreadLocal中的用户信息,防止内存泄漏
try {
ThreadLocalCache.removeLoginInfo();
ThreadLocalCache.removeLoginAccountInfo();
log.info("ThreadLocal用户信息已清除");
} catch (Exception e) {
log.warn("清除ThreadLocal用户信息时发生异常", e);
}
}
}
package com.gsc4cloud.gsc.facade.vpcweb.interceptor;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.slf4j.MDC;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor;
@Component
public class TraceInterceptor implements HandlerInterceptor {
private static final String TRACE_HEADER = "X-Trace-Id";
private static final String TRACE_ID = "traceId";
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
// 从请求头获取TraceId,如果没有则生成新的
String traceId = request.getHeader(TRACE_HEADER);
if (StrUtil.isBlank(traceId)) {
traceId = IdUtil.simpleUUID();
MDC.put(TRACE_ID, traceId);
}
// 设置到上下文和响应头
response.setHeader(TRACE_HEADER, traceId);
return true;
}
@Override
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) {
// 请求完成后清理上下文
MDC.remove(TRACE_ID);
}
}
\ No newline at end of file \ No newline at end of file
package com.gsc4cloud.gsc.facade.vpcweb.manager;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.gsc4cloud.gsc.facade.vpcweb.config.RopApiConfig;
import com.gsc4cloud.gsc.facade.vpcweb.response.rop.*;
import com.gsc4cloud.gsc.facade.vpcweb.utils.GLRopApiUtils;
import com.gsc4cloud.gsc.facade.vpcweb.utils.ThreadLocalCache;
import com.gsc4cloud.gsc.vpc.api.enums.ErrorCodeEnum;
import com.gsc4cloud.gsc.vpc.api.exception.BusinessException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
/**
* @Description ROP 接口调用管理类
* @Author yelq
* @Date 2025/7/28-19:24
* @Version 1.0
*/
@Component
@Slf4j
public class RopManager {
@Autowired
private RopApiConfig ropApiConfig;
public void saveLoginInfo(String sessionId) throws Exception {
if (ropApiConfig.getContextPath() == null || ropApiConfig.getContextPath().isEmpty())
throw new Exception("缺少必要的rop配置");
if ("rop-dj-car-boutique".equals(ropApiConfig.getContextPath())){
ropDjCarBoutiqueHandler(sessionId);
return;
}
if ("rop-dj-smartcarlife".equals(ropApiConfig.getContextPath())){
ropDjSmartCarLifeHandler(sessionId);
return;
}
}
private void ropDjSmartCarLifeHandler(String sessionId) throws Exception {
//请求地址,区分环境
String url = ropApiConfig.getUrl();
String appKey = ropApiConfig.getAppKey();
String secret = ropApiConfig.getSecret();
//项目名称
String contextPath = ropApiConfig.getContextPath();
// 默认拼装路径
url = url.concat(contextPath).concat("/router");
MultiValueMap<String, String> params = new LinkedMultiValueMap<String, String>(4);
// 版本号,必填,默认1.0.0
params.add("v", "1.0.0");
// 接口名称,必填
params.add("method", ropApiConfig.getMethod());
// 参数,根据接口添加
params.add("sessionId", sessionId);
// post请求
RopResponse<Object> post = GLRopApiUtils.post(url, params, RopResponse.class, appKey, secret);
if (post.getData() != null) {
String data = JSON.toJSONString(post.getData());
// json字符串转换对象
UserInfoResponse loginObj = JSONObject.parseObject(data, UserInfoResponse.class);
if (loginObj != null && loginObj.getLoginAccount() != null ) {
LoginAccountResponse loginUserInfo = loginObj.getLoginAccount();
// 存储到当前线程
log.info("登录成功,用户信息为:" + JSONObject.toJSONString(loginUserInfo));
ThreadLocalCache.setLoginAccountInfo(loginUserInfo);
}
} else {
throw new BusinessException(ErrorCodeEnum.SESSION_INVALID);
}
}
private void ropDjCarBoutiqueHandler(String sessionId) throws Exception {
//请求地址,区分环境
String url = ropApiConfig.getUrl();
String appKey = ropApiConfig.getAppKey();
String secret = ropApiConfig.getSecret();
//项目名称
String contextPath = ropApiConfig.getContextPath();
// 默认拼装路径
url = url.concat(contextPath).concat("/router");
MultiValueMap<String, String> params = new LinkedMultiValueMap<String, String>(4);
// 版本号,必填,默认1.0.0
params.add("v", "1.0.0");
// 接口名称,必填
params.add("method", ropApiConfig.getMethod());
// 参数,根据接口添加
params.add("sessionId", sessionId);
// post请求
RopResponse<Object> post = GLRopApiUtils.post(url, params, RopResponse.class, appKey, secret);
if (post.getData() != null) {
String data = JSON.toJSONString(post.getData());
// json字符串转换对象
LoginObjResponse loginObj = JSONObject.parseObject(data, LoginObjResponse.class);
if (loginObj != null && loginObj.getLoginUserInfoList() != null && !loginObj.getLoginUserInfoList().isEmpty()) {
LoginUserInfoResponse loginUserInfo = loginObj.getLoginUserInfoList().get(0);
// 存储到当前线程
ThreadLocalCache.setLoginInfo(loginUserInfo);
}
} else {
throw new Exception("用户信息获取失败: " + post.getMessage());
}
}
}
package com.gsc4cloud.gsc.facade.vpcweb.request;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import java.io.Serializable;
import java.util.Date;
/**
* 评估单车辆基本信息表
*
* @author zhangfk
*/
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
@Data
public class CarManageInfoPageRequest implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 车牌号
*/
private String licensePlate;
/**
* 车架号
*/
private String vin;
/**
* 车型名称
*/
private String carTypeName;
/**
* 上牌开始时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date listingStartDate;
/**
* 上牌结束时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date listingEndDate;
/**
* 上牌城市
*/
private String listingCity;
/**
* 使用性质
*/
private String usageType;
/**
* 所有人性质
*/
private String ownerType;
/**
* 是否事故:1-是/0-否
*/
private Integer hasAccident;
/**
* 车辆创建人
*/
private String carCreator;
/**
* 车辆状态:0-库存中 1-已出售 2-待售 3-已预定 4-已交付 5-待排卖 6-拍卖中 7-已退库 默认:0-库存中
*/
private Integer carStatus;
/**
* 原车主姓名
*/
private String originalOwner;
/**
* 原车主联系方式
*/
private String ownerContact;
/**
* 保管人
*/
private String custodian;
/**
* 创建时间开始时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createdStartDate;
/**
* 创建时间结束时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createdEndDate;
}
package com.gsc4cloud.gsc.facade.vpcweb.request;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 车辆管理信息表
*
* @author zhangfk
*/
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
@Data
public class CarManageInfoRequest implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
/**
* 评估单编号
*/
private String evalOrderNo;
/**
* 车辆状态:0-库存中 1-已出售 2-待售 3-已预定 4-已交付 5-待排卖 6-拍卖中 7-已退库 默认:0-库存中
*/
private Integer carStatus;
/**
* 车辆创建人
*/
private String carCreator;
/**
* 保管地
*/
private String storageLocation;
/**
* 保管人
*/
private String custodian;
/**
* 代保管合同
*/
private String custodyContract;
/**
* 交车确认书
*/
private String deliveryConfirmation;
/**
* 补充协议
*/
private String supplementaryAgreement;
/**
* 收车价
*/
private BigDecimal purchasePrice;
/**
* 收车时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date purchaseTime;
/**
* 卖出价
*/
private BigDecimal sellingPrice;
/**
* 卖出时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date sellingTime;
/**
* 卖出方
*/
private String seller;
/**
* 车辆卖出备注
*/
private String sellingNotes;
/**
* 车牌号
*/
private String licensePlate;
/**
* 车架号
*/
private String vin;
/**
* 上牌时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date listingDate;
/**
* 上牌城市
*/
private String listingCity;
/**
* 表显里程
*/
private String mileage;
/**
* 使用性质
*/
private String usageType;
/**
* 所有人性质
*/
private String ownerType;
/**
* 天窗
*/
private String sunroof;
/**
* 是否事故:1-是/0-否
*/
private Integer hasAccident;
/**
* 车辆来源门店
*/
private String sourceStore;
/**
* 车辆创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime;
/**
* 原车主姓名
*/
private String originalOwner;
/**
* 原车主联系方式
*/
private String ownerContact;
/**
* 交强险到期日
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date insuranceExpiry;
/**
* 年审到期日
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date inspectionExpiry;
/**
* 新车指导价
*/
private BigDecimal msrp;
/**
* 车辆生产日期
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date productionDate;
/**
* 车辆图片,json存储(参考eval_image_info的字段存储)
*/
private String carImages;
/**
* 证件资料,json存储(参考eval_image_info的字段存储)
*/
private String documents;
/**
* 车辆备注
*/
private String vehicleNotes;
/**
* 发动机号
*/
private String engineNumber;
/**
* 车型id
*/
private Integer carTypeId;
/**
* 车型名称
*/
private String carTypeName;
/**
* 钥匙编码
*/
private String keyCode;
/**
* 钥匙数
*/
private Integer keyCount;
/**
* 过户次数
*/
private Integer transfersNumber;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createdDate;
/**
* 修改人
*/
private String updatedBy;
/**
* 修改时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date updatedDate;
/**
* 删除标识:N未删除,D已删除
*/
private String deletedFlag;
}
package com.gsc4cloud.gsc.facade.vpcweb.request;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import java.util.List;
/**
* @Description 请求示例参数
* @Author yelq
* @Date 2025/7/28-16:18
* @Version 1.0
*/
@Data
@ToString
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "Demo请求参数")
public class DemoRequest {
@Schema(description = "当前页码", example = "1")
private long current = 1;
@Schema(description = "每页数量", example = "1")
private long size = 10;
@Schema(description = "ID")
private Long id;
@Schema(description = "字符串")
private String str;
@Schema(description = "布尔")
private Boolean aBoolean;
@Schema(description = "字符串列表")
private List<String> objs;
@Schema(description = "dog对象列表")
private List<dog> dogs;
@Schema(description = "dog对象")
private dog dog;
@Data
public static class dog {
@Schema(description = "名称")
private String name;
@Schema(description = "年龄")
private Integer age;
}
}
package com.gsc4cloud.gsc.facade.vpcweb.response.rop;
import lombok.Data;
import lombok.ToString;
import java.util.List;
@Data
@ToString
public class LoginAccountResponse {
// (notes = "登录类型2.员工 1.商户")
private Integer userType;
// (notes = "用户名")
private String loginAccout;
// (notes = "姓名")
private String userName;
// (notes = "商户名称")
private String merchantName;
// (notes = "商户账号层级")
private Integer accountLevel;
// (notes = "商户账号状态")
private Integer status;
// (notes = "商户号")
private Integer merchantNo;
// (notes = "渠道类型")
private String channelType;
// (notes = "商户模式 1.集团版 2.门店版")
private Integer merchantModel;
// (notes = "账号唯一id")
private String uuid;
// (notes = "头像")
private String staffAvatar;
// (notes = "是否超管(1:是否,0:否)")
private Integer isAdmin;
private String createdTime;
private List<String> merchantAccountList;
// (notes = "登录角色 3-区域运营 4-广联销售")
private Integer loginRole;
// (notes = "广联数科下角色名称")
private String roleName;
//notes = "手机号")
private String phone;
}
package com.gsc4cloud.gsc.facade.vpcweb.response.rop;
import lombok.Data;
import lombok.ToString;
import java.util.List;
/**
* @Description rop登录用户返回参数
* @Author yelq
* @Date 2025/7/28-16:28
* @Version 1.0
*/
@ToString
@Data
public class LoginObjResponse {
private String sessionId;
private String noSignInUuid;
private Boolean needSelectAccount;
private List<LoginUserInfoResponse> loginUserInfoList;
}
package com.gsc4cloud.gsc.facade.vpcweb.response.rop;
import lombok.Data;
import lombok.ToString;
import org.springframework.beans.BeanUtils;
import java.io.Serializable;
import java.util.List;
/**
* 禁止改动(确实需要改动的与周海宝确认两边同步修改)
* @Title: LoginUserInfoResponse.java
* @Description:
* @author zhoulm
* @date 2024年8月2日 17:42:37
*/
@Data
@ToString
public class LoginUserInfoResponse implements Serializable{
/**
*
*/
private static final long serialVersionUID = -3576264570350286128L;
// name = "accountName", notes = "登录账号", dataType = "string", required = true, example = "")
private String accountName;
// name = "merchantId", notes = "商户号", dataType = "int", required = true, example = "")
private Integer merchantId;
// notes = "账号类型(4门店,3片区(市级经销商),2大区(省级经销商),1总部(工厂))", dataType = "int", required = true, example = "")
private Integer accountLevel;
// notes = "用户类型(1:商户,2员工)", dataType = "int", required = true, example = "")
private Integer userType;
// name = "phone", notes = "手机号", dataType = "string", required = true, example = "")
private String phone;
/** 员工姓名**/
// name = "name", notes = "员工姓名", dataType = "string", required = true, example = "")
private String name;
// name = "duty", notes = "职务", dataType = "string", required = true, example = "")
private String duty;
/** 商户名称**/
// name = "merchantName", notes = "商户名称", dataType = "string", required = true, example = "")
private String merchantName;
// name="channelType", notes = "渠道类型", dataType = "int", example = "")
private Integer channelType;
/**是否超级管理员**/
private Boolean isSuper;
// notes = "账号ID")
private String uuid;
// name="createdDate", notes = "创建时间", dataType = "Date", example = "")
private String createdDate;
/**
* 用户数据权限商户ID
*/
private List<Integer> permissionMerchantIds;
/** 子登录信息**/
private LoginUserInfoResponse subLoginUser;
private List<String> merchantAccountList;
/** 登录角色**/
// name="loginRole", notes = "登录角色 1-超管 2-商户管理员 3-区域督导 4-驻店人员 5-广联销售 6-飞行督导 7-技师", example = "")
private Integer loginRole;
// notes = "选择的4S店商户号")
private Integer shopMerchantId;
// notes = "选择的4S店商户名称")
private String shopMerchantName;
// notes = "选择的业务场景")
private Byte sceneType;
// notes = "在当前选择的4S下的登录角色 3-区域督导 4-驻店人员", example = "")
private Integer loginRoleOnSelectMerchant;
// notes = "业务id(员工或者商户)")
private Integer bussinessId;
public LoginUserInfoResponse clone(){
LoginUserInfoResponse r = new LoginUserInfoResponse();
BeanUtils.copyProperties(this, r);
return r;
}
}
package com.gsc4cloud.gsc.facade.vpcweb.response.rop;
import lombok.Data;
/**
* @Description ROP通用返回参数
* @Author yelq
* @Date 2025/7/28-16:12
* @Version 1.0
*/
@Data
public class RopResponse<T> {
private String code;
private String errId;
private String message;
private T data;
}
package com.gsc4cloud.gsc.facade.vpcweb.response.rop;
import lombok.Data;
import java.io.Serializable;
/**
* @Title: UserInfoResponse.java
* @Description: 用户个人信息返回实体
* @author caiym
* @date 2020年11月11日 11:07
* @version V1.0.0
* @Company: didihu.com.cn
* @Copyright Copyright (c) 2020
*/
@Data
public class UserInfoResponse implements Serializable {
private static final long serialVersionUID = -4845569468798367039L;
// (notes = "登录信息")
private LoginAccountResponse loginAccount;
}
package com.gsc4cloud.gsc.facade.vpcweb.service.car;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gsc4cloud.gsc.common.core.util.R;
import com.gsc4cloud.gsc.facade.vpcweb.convert.CarManageInfoDetailConvert;
import com.gsc4cloud.gsc.facade.vpcweb.convert.CarManageInfoLogConvert;
import com.gsc4cloud.gsc.facade.vpcweb.convert.CarManageInfoPageConvert;
import com.gsc4cloud.gsc.facade.vpcweb.response.rop.LoginAccountResponse;
import com.gsc4cloud.gsc.facade.vpcweb.utils.ThreadLocalCache;
import com.gsc4cloud.gsc.facade.vpcweb.vo.car.CarManageInfoDetailVO;
import com.gsc4cloud.gsc.facade.vpcweb.vo.car.CarManageInfoLogVO;
import com.gsc4cloud.gsc.facade.vpcweb.vo.car.CarManageInfoPageVO;
import com.gsc4cloud.gsc.vpc.api.dto.car.CarManageInfoPageDTO;
import com.gsc4cloud.gsc.vpc.api.dto.entitydto.car.CarManageInfoDetailDTO;
import com.gsc4cloud.gsc.vpc.api.dto.entitydto.car.CarManageInfoLogDTO;
import com.gsc4cloud.gsc.vpc.api.feign.web.car.CarManagementRemote;
import com.gsc4cloud.gsc.vpc.api.req.PageRequest;
import com.gsc4cloud.gsc.vpc.api.req.web.car.CarManageInfoEditRequest;
import com.gsc4cloud.gsc.vpc.api.req.web.car.CarManageInfoPageRequest;
import com.gsc4cloud.gsc.vpc.api.req.web.car.CarManageInfoRequest;
import com.gsc4cloud.gsc.vpc.api.util.CommonUtils;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @Author: zhangfk
* @Date: 2025/9/18
*/
@Slf4j
@Service
public class CarManagementService {
@Resource
private CarManagementRemote carManagementRemote;
@Resource
private Environment env;
public R<Page<CarManageInfoPageVO>> carManagementPage(PageRequest<CarManageInfoPageRequest> request) {
R<Page<CarManageInfoPageDTO>> result = carManagementRemote.carManagementPage(request);
return CommonUtils.convertPageResponse(result, CarManageInfoPageConvert.INSTANCE::toCarManageInfoPageVO);
}
public R<CarManageInfoDetailVO> details(CarManageInfoRequest request) {
R<CarManageInfoDetailDTO> result = carManagementRemote.details(request);
return CommonUtils.convertResponse(result, CarManageInfoDetailConvert.INSTANCE::toCarManageInfoDetailVO);
}
public R<Boolean> edit(CarManageInfoEditRequest request) {
LoginAccountResponse loginAccountInfo = ThreadLocalCache.getLoginAccountInfo();
request.setOperator(loginAccountInfo.getUserName());
return carManagementRemote.edit(request);
}
public R<List<CarManageInfoLogVO>> carManagementLog(CarManageInfoRequest request) {
R<List<CarManageInfoLogDTO>> result = carManagementRemote.carManagementLog(request);
return CommonUtils.convertResponse(result, CarManageInfoLogConvert.INSTANCE::toCarManageInfoLogVO);
}
public R<String> exportCarManageInfoAsync(CarManageInfoPageRequest request) {
PageRequest<CarManageInfoPageRequest> param = new PageRequest<>(1,
env.getProperty("gsc.vpc.web.export.max.page.size", Integer.class, 10000));
request.setOperator(ThreadLocalCache.getLoginAccountInfo().getLoginAccout());
String idsStr = request.getIdsStr();
if (StrUtil.isNotBlank(idsStr)) {
request.setIds(StrUtil.split(idsStr, ",").stream().map(Integer::parseInt).toList());
}
param.setT(request);
return carManagementRemote.exportCarManageInfoAsync(param);
}
public R<String> exportCarManageInfoImageZipAsync(CarManageInfoRequest request) {
return carManagementRemote.exportCarManageInfoImageZipAsync(request);
}
}
package com.gsc4cloud.gsc.facade.vpcweb.service.configs;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gsc4cloud.gsc.common.core.util.R;
import com.gsc4cloud.gsc.facade.vpcweb.convert.SunlightInspiresConfigPageConvert;
import com.gsc4cloud.gsc.facade.vpcweb.convert.SunlightInspiresConfigPageLogConvert;
import com.gsc4cloud.gsc.facade.vpcweb.response.rop.LoginAccountResponse;
import com.gsc4cloud.gsc.facade.vpcweb.utils.ThreadLocalCache;
import com.gsc4cloud.gsc.facade.vpcweb.vo.configs.SunlightInspiresConfigLogPageVO;
import com.gsc4cloud.gsc.facade.vpcweb.vo.configs.SunlightInspiresConfigPageVO;
import com.gsc4cloud.gsc.facade.vpcweb.vo.configs.SunlightInspiresConfigVO;
import com.gsc4cloud.gsc.vpc.api.dto.entitydto.configs.SunlightInspiresConfigDTO;
import com.gsc4cloud.gsc.vpc.api.dto.entitydto.configs.SunlightInspiresConfigLogDTO;
import com.gsc4cloud.gsc.vpc.api.feign.web.configs.SunlightInspiresConfigRemote;
import com.gsc4cloud.gsc.vpc.api.req.PageRequest;
import com.gsc4cloud.gsc.vpc.api.req.web.configs.SunlightInspiresConfigPageRequest;
import com.gsc4cloud.gsc.vpc.api.req.web.configs.SunlightInspiresConfigRequest;
import com.gsc4cloud.gsc.vpc.api.util.CommonUtils;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service;
import java.util.Objects;
import java.util.Optional;
/**
* @Author: zhangfk
* @Date: 2025/9/18
*/
@Slf4j
@Service
public class SunlightInspiresConfigService {
@Resource
private SunlightInspiresConfigRemote sunlightInspiresConfigRemote;
@Resource
private Environment env;
public R<Page<SunlightInspiresConfigPageVO>> page(PageRequest<SunlightInspiresConfigPageRequest> request) {
R<Page<SunlightInspiresConfigDTO>> result = sunlightInspiresConfigRemote.page(request);
return CommonUtils.convertPageResponse(result, SunlightInspiresConfigPageConvert.INSTANCE::toSunlightInspiresConfigPageVO);
}
public R<String> export(PageRequest<SunlightInspiresConfigPageRequest> request) {
Integer pageSize = env.getProperty("gsc.vpc.web.export.max.page.size", Integer.class, 10000);
request.setPageSize(pageSize);
SunlightInspiresConfigPageRequest t = Objects.isNull(request.getT()) ? new SunlightInspiresConfigPageRequest() : request.getT();
t.setUpdatedBy(Optional.ofNullable(ThreadLocalCache.getLoginAccountInfo()).map(LoginAccountResponse::getUserName).orElse(""));
request.setT(t);
return sunlightInspiresConfigRemote.export(request);
}
public R<SunlightInspiresConfigVO> details(SunlightInspiresConfigRequest request) {
R<SunlightInspiresConfigDTO> result = sunlightInspiresConfigRemote.details(request);
return CommonUtils.convertResponse(result, SunlightInspiresConfigPageConvert.INSTANCE::toSunlightInspiresConfigVO);
}
public R<Boolean> create(SunlightInspiresConfigRequest request) {
return sunlightInspiresConfigRemote.create(request);
}
public R<Boolean> edit(SunlightInspiresConfigRequest request) {
return sunlightInspiresConfigRemote.edit(request);
}
public R<Boolean> delete(SunlightInspiresConfigRequest request) {
return sunlightInspiresConfigRemote.delete(request);
}
public R<Page<SunlightInspiresConfigLogPageVO>> logPage(PageRequest<SunlightInspiresConfigRequest> request) {
R<Page<SunlightInspiresConfigLogDTO>> result = sunlightInspiresConfigRemote.logPage(request);
return CommonUtils.convertResponse(result, SunlightInspiresConfigPageLogConvert.INSTANCE::toPageVo);
}
}
package com.gsc4cloud.gsc.facade.vpcweb.service.evalorder;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gsc4cloud.gsc.common.core.util.R;
import com.gsc4cloud.gsc.facade.vpcweb.utils.ThreadLocalCache;
import com.gsc4cloud.gsc.vpc.api.dto.entitydto.evalorder.EvalElectronicContractDTO;
import com.gsc4cloud.gsc.vpc.api.dto.web.reqdto.evalorder.EvalElectronicContractPageReq;
import com.gsc4cloud.gsc.vpc.api.feign.web.evalorder.EvalElectronicContractRemote;
import com.gsc4cloud.gsc.vpc.api.req.PageRequest;
import com.gsc4cloud.gsc.vpc.api.req.web.evalorder.EvalOrderListPageRequest;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service;
import java.util.Arrays;
@Service
public class EvalElectronicContractService {
@Autowired
private EvalElectronicContractRemote evalElectronicContractRemote;
@Autowired
private Environment env;
public R<Page<EvalElectronicContractDTO>> webCustomPage(PageRequest<EvalElectronicContractDTO> request) {
return evalElectronicContractRemote.webCustomPage(request);
}
public R<EvalElectronicContractDTO> detail(EvalElectronicContractDTO request) {
request.setUpdatedBy(ThreadLocalCache.getLoginAccountInfo().getLoginAccout());
return evalElectronicContractRemote.detail(request);
}
public R<EvalElectronicContractDTO> editDescription(EvalElectronicContractDTO request) {
request.setUpdatedBy(ThreadLocalCache.getLoginAccountInfo().getLoginAccout());
return evalElectronicContractRemote.editDescription(request);
}
public R<String> getContractFileUrl(EvalElectronicContractDTO request) {
request.setUpdatedBy(ThreadLocalCache.getLoginAccountInfo().getLoginAccout());
return evalElectronicContractRemote.getContractFileUrl(request);
}
public R<String> exportElectronicContractAsync(EvalElectronicContractPageReq request) {
PageRequest<EvalElectronicContractPageReq> param = new PageRequest<>(1,
env.getProperty("gsc.vpc.web.export.max.page.size",Integer.class, 10000));
if (StringUtils.isNotBlank(request.getIdsStr())) {
request.setIds(Arrays.stream(request.getIdsStr().split(",")).map(Integer::parseInt).toList());
}
request.setUpdatedBy(ThreadLocalCache.getLoginAccountInfo().getLoginAccout());
param.setT(request);
return evalElectronicContractRemote.exportElectronicContractAsync(param);
}
public R<Void> reExecuteContractSigned(String param) {
return evalElectronicContractRemote.reExecuteContractSigned(param);
}
}
package com.gsc4cloud.gsc.facade.vpcweb.service.evalorder;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gsc4cloud.gsc.common.core.util.R;
import com.gsc4cloud.gsc.facade.vpcweb.response.rop.LoginAccountResponse;
import com.gsc4cloud.gsc.facade.vpcweb.utils.ThreadLocalCache;
import com.gsc4cloud.gsc.vpc.api.dto.entitydto.evalorder.*;
import com.gsc4cloud.gsc.vpc.api.dto.pad.resdto.evalorder.EvalOrderPageResDTO;
import com.gsc4cloud.gsc.vpc.api.dto.web.resdto.evalorder.EvalOrderDetailResDTO;
import com.gsc4cloud.gsc.vpc.api.feign.web.evalorder.EvalOrderManageRemote;
import com.gsc4cloud.gsc.vpc.api.req.PageRequest;
import com.gsc4cloud.gsc.vpc.api.req.pad.evalorder.EvalOrderPageRequest;
import com.gsc4cloud.gsc.vpc.api.req.web.evalorder.EvalOrderDetailRequest;
import com.gsc4cloud.gsc.vpc.api.req.web.evalorder.EvalOrderImageExportRequest;
import com.gsc4cloud.gsc.vpc.api.req.web.evalorder.EvalOrderPriceHistoryRequest;
import com.gsc4cloud.gsc.vpc.api.req.web.evalorder.EvalOrderQuoteRequest;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Service
public class EvalOrderManageService {
@Autowired
private EvalOrderManageRemote evalOrderManageRemote;
@Autowired
private Environment env;
public R<Boolean> evaluate(EvalOrderQuoteRequest request) {
LoginAccountResponse accountInfo = ThreadLocalCache.getLoginAccountInfo();
request.setOperator(accountInfo.getUserName());
request.setOperatorPhone(accountInfo.getPhone());
return evalOrderManageRemote.evaluate(request);
}
public R<String> exportEvalOrderAsync(EvalOrderPageRequest request) {
PageRequest<EvalOrderPageRequest> param = new PageRequest<>(1,
env.getProperty("gsc.vpc.web.export.max.page.size", Integer.class, 10000));
request.setUpdatedBy(ThreadLocalCache.getLoginAccountInfo().getLoginAccout());
if (StringUtils.isNotBlank(request.getIdsStr())) {
request.setIds(Arrays.stream(request.getIdsStr().split(",")).map(Integer::parseInt).toList());
}
param.setT(request);
return evalOrderManageRemote.exportEvalOrderAsync(param);
}
public R<String> exportEvalOrderImageZipAsync(EvalOrderImageExportRequest request) {
request.setUpdatedBy(ThreadLocalCache.getLoginAccountInfo().getLoginAccout());
return evalOrderManageRemote.exportEvalOrderImageZipAsync(request);
}
public R<Page<EvalOrderPageResDTO>> page(PageRequest<EvalOrderPageRequest> request) {
return evalOrderManageRemote.page(request);
}
public R<List<EvalPriceHistoryDTO>> evalOrderPriceHistoryByCondition(EvalOrderPriceHistoryRequest request) {
return evalOrderManageRemote.evalOrderPriceHistoryByCondition(request);
}
public R<EvalOrderDetailResDTO> evalOrderDetail(EvalOrderDetailRequest request) {
R<EvalOrderDTO> evalOrderDTOR = evalOrderManageRemote.detail(request);
EvalOrderDTO evalOrderDTO = evalOrderDTOR.getData();
if (evalOrderDTO == null) {
return R.ok(new EvalOrderDetailResDTO());
}
EvalOrderDetailResDTO evalOrderDetailResDTO = new EvalOrderDetailResDTO();
//封装车辆信息
buildCarInfo(evalOrderDTO, evalOrderDetailResDTO);
//封装评估单信息
buildEvalOrderInfo(evalOrderDetailResDTO, evalOrderDTO);
return R.ok(evalOrderDetailResDTO);
}
/**
* 构建评估单信息
*
* @param evalOrderDetailResDTO
* @param evalOrderDTO
*/
private static void buildEvalOrderInfo(EvalOrderDetailResDTO evalOrderDetailResDTO, EvalOrderDTO evalOrderDTO) {
evalOrderDetailResDTO.setEvalOrderNo(evalOrderDTO.getEvalOrderNo());
evalOrderDetailResDTO.setSellerMerchantName(evalOrderDTO.getSellerMerchantName());
evalOrderDetailResDTO.setSellerName(evalOrderDTO.getSellerName());
evalOrderDetailResDTO.setConversionName(evalOrderDTO.getConversionName());
evalOrderDetailResDTO.setStatus(evalOrderDTO.getStatus());
evalOrderDetailResDTO.setEvalOrderTime(evalOrderDTO.getCreatedDate());
evalOrderDetailResDTO.setEvalPrice(evalOrderDTO.getEvalPrice());
evalOrderDetailResDTO.setEvalOpinion(evalOrderDTO.getEvalOpinion());
}
/**
* 构建车辆信息
*
* @param evalOrderDTO
* @param evalOrderDetailResDTO
*/
private static void buildCarInfo(EvalOrderDTO evalOrderDTO, EvalOrderDetailResDTO evalOrderDetailResDTO) {
//车辆基本信息
EvalCarBaseDTO evalCarBaseDTO = evalOrderDTO.getEvalCarBaseDTO();
//车辆证件信息
EvalCarLicenseDTO evalCarLicenseDTO = evalOrderDTO.getEvalCarLicenseDTO();
//车辆图片信息
List<EvalImageInfoDTO> imageListDTO = evalOrderDTO.getImageListDTO();
//封装车辆基本信息
if (evalCarBaseDTO != null) {
BeanUtils.copyProperties(evalCarBaseDTO, evalOrderDetailResDTO);
}
//封装车辆证件信息
if (imageListDTO != null) {
Map<Integer, List<String>> urlMap = imageListDTO.stream()
.collect(Collectors.groupingBy(
EvalImageInfoDTO::getFileType,
Collectors.mapping(EvalImageInfoDTO::getFileUrl, Collectors.toList())));
evalOrderDetailResDTO.setCarImageUrls(urlMap.getOrDefault(1, Collections.emptyList()));
evalOrderDetailResDTO.setDocumentUrls(urlMap.getOrDefault(2, Collections.emptyList()));
evalOrderDetailResDTO.setCarVideoUrls(urlMap.getOrDefault(3, Collections.emptyList()));
evalOrderDetailResDTO.setOtherImageUrls(urlMap.getOrDefault(4, Collections.emptyList()));
}
//封装车辆牌证信息
if (evalCarLicenseDTO != null) {
evalOrderDetailResDTO.setPreviousOwnerName(evalCarLicenseDTO.getPreviousOwnerName());
evalOrderDetailResDTO.setPreviousOwnerPhone(evalCarLicenseDTO.getPreviousOwnerPhone());
}
}
}
package com.gsc4cloud.gsc.facade.vpcweb.utils;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;
import java.io.IOException;
import java.security.GeneralSecurityException;
import java.security.MessageDigest;
import java.util.*;
/**
* @Description 请求广联接口的工具类
* @Author
* @Date 2025/7/1-16:54
* @Version 1.0
*/
public class GLRopApiUtils {
public static <T> T post(String url, MultiValueMap<String, String> paramsMap, Class<T> responseType, String appKey, String secret) throws Exception {
MultiValueMap<String, String> params = getSysParams(appKey);
params.putAll(paramsMap);
for (Map.Entry<String, String> entry : params.toSingleValueMap().entrySet()) {
if (entry.getValue() == null || entry.getValue().isEmpty()) {
params.remove(entry.getKey());
}
}
String sign = sign(params.toSingleValueMap(), secret);
params.add("sign", sign);
return new RestTemplate().postForObject(url, params, responseType);
}
protected static MultiValueMap<String, String> getSysParams(String appKey) {
MultiValueMap<String, String> params = new LinkedMultiValueMap<String, String>(16);
params.add("appKey", appKey);
params.add("format", "json");
params.add("locale", "zh_CN");
return params;
}
public static String sign(Map<String, String> paramValues, String secret) {
try {
StringBuilder sb = new StringBuilder();
List<String> paramNames = new ArrayList(paramValues.size());
paramNames.addAll(paramValues.keySet());
Iterator var5;
String paramName;
Collections.sort(paramNames);
sb.append(secret);
var5 = paramNames.iterator();
while (var5.hasNext()) {
paramName = (String) var5.next();
sb.append(paramName).append((String) paramValues.get(paramName));
}
sb.append(secret);
byte[] sha1Digest = getSHA1Digest(sb.toString());
return byte2hex(sha1Digest);
} catch (IOException var7) {
throw new RuntimeException(var7);
}
}
private static byte[] getSHA1Digest(String data) throws IOException {
byte[] bytes = null;
try {
MessageDigest md = MessageDigest.getInstance("SHA-1");
bytes = md.digest(data.getBytes("UTF-8"));
return bytes;
} catch (GeneralSecurityException var3) {
throw new IOException(var3);
}
}
private static String byte2hex(byte[] bytes) {
StringBuilder sign = new StringBuilder();
for (int i = 0; i < bytes.length; ++i) {
String hex = Integer.toHexString(bytes[i] & 255);
if (hex.length() == 1) {
sign.append("0");
}
sign.append(hex.toUpperCase());
}
return sign.toString();
}
}
package com.gsc4cloud.gsc.facade.vpcweb.utils;
import com.gsc4cloud.gsc.facade.vpcweb.response.rop.LoginAccountResponse;
import com.gsc4cloud.gsc.facade.vpcweb.response.rop.LoginUserInfoResponse;
public class ThreadLocalCache {
// rop-dj-car-boutique
private static ThreadLocal<LoginUserInfoResponse> loginInfoCache = new ThreadLocal<LoginUserInfoResponse>();
// rop-dj-smartcarlife
private static ThreadLocal<LoginAccountResponse> LoginAccountInfoCache = new ThreadLocal<LoginAccountResponse>();
public static void setLoginAccountInfo(LoginAccountResponse loginAccountInfo) {
LoginAccountInfoCache.set(loginAccountInfo);
}
public static LoginAccountResponse getLoginAccountInfo() {
return LoginAccountInfoCache.get();
}
public static void removeLoginAccountInfo() {
LoginAccountInfoCache.remove();
}
public static void setLoginInfo(LoginUserInfoResponse loginInfo) {
loginInfoCache.set(loginInfo);
}
public static LoginUserInfoResponse getLoginInfo() {
return loginInfoCache.get();
}
public static void removeLoginInfo() {
loginInfoCache.remove();
}
}
package com.gsc4cloud.gsc.facade.vpcweb.vo.car;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.gsc4cloud.gsc.vpc.api.dto.entitydto.evalorder.EvalImageInfoDTO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* 车辆管理信息表(详情展示用 VO)
*
* @author zhangfk
*/
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
@Data
public class CarManageInfoDetailVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
@TableId(value = "id", type = IdType.AUTO)
@Schema(description = "主键ID,自增")
private Integer id;
/**
* 评估单编号
*/
@Schema(description = "关联的评估单编号")
private String evalOrderNo;
/**
* 车辆状态:0-库存中 1-已出售 2-待售 3-已预定 4-已交付 5-待排卖 6-拍卖中 7-已退库 默认:0-库存中
*/
@Schema(description = "车辆状态:0-库存中,1-已出售,2-待售,3-已预定,4-已交付,5-待排卖,6-拍卖中,7-已退库")
private Integer carStatus;
/**
* 车辆创建人
*/
@Schema(description = "车辆信息创建人账号或姓名")
private String carCreator;
/**
* 保管地
*/
@Schema(description = "车辆当前物理保管地点")
private String storageLocation;
/**
* 保管人
*/
@Schema(description = "当前车辆保管责任人")
private String custodian;
/**
* 代保管合同
*/
@Schema(description = "代保管合同文件路径或编号")
private String custodyContract;
/**
* 交车确认书
*/
@Schema(description = "交车确认书文件路径或编号")
private String deliveryConfirmation;
/**
* 补充协议
*/
@Schema(description = "补充协议文件路径或编号")
private String supplementaryAgreement;
/**
* 收车价
*/
@Schema(description = "收车价格,单位:元")
private BigDecimal purchasePrice;
/**
* 收车时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@Schema(description = "收车时间,格式:yyyy-MM-dd HH:mm:ss")
private Date purchaseTime;
/**
* 卖出价
*/
@Schema(description = "卖出价格,单位:元")
private BigDecimal sellingPrice;
/**
* 卖出时间
*/
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@Schema(description = "卖出时间,格式:yyyy-MM-dd")
private Date sellingTime;
/**
* 卖出方
*/
@Schema(description = "车辆卖出方名称或公司")
private String seller;
/**
* 车辆卖出备注
*/
@Schema(description = "车辆卖出时的备注信息")
private String sellingNotes;
/**
* 车牌号
*/
@Schema(description = "车辆牌照号码")
private String licensePlate;
/**
* 车架号
*/
@Schema(description = "车辆识别码 VIN")
private String vin;
/**
* 上牌时间
*/
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@Schema(description = "车辆首次上牌时间,格式:yyyy-MM-dd")
private Date listingDate;
/**
* 上牌城市
*/
@Schema(description = "车辆上牌所在城市")
private String listingCity;
/**
* 表显里程
*/
@Schema(description = "仪表盘显示行驶里程,单位:公里")
private String mileage;
/**
* 使用性质
*/
@Schema(description = "车辆使用性质,如:非营运、营运、租赁等")
private String usageType;
/**
* 所有人性质
*/
@Schema(description = "车辆所有人性质,如:个人、企业")
private String ownerType;
/**
* 天窗
*/
@Schema(description = "是否带天窗,如:有/无/全景")
private String sunroof;
/**
* 是否事故:1-是/0-否
*/
@Schema(description = "是否为事故车:1-是,0-否")
private Integer hasAccident;
/**
* 车辆来源门店
*/
@Schema(description = "车辆来源的门店或渠道Id")
private Integer sourceStore;
/**
* 车辆来源门店名称
*/
@Schema(description = "车辆来源门店名称")
private String sourceStoreName;
/**
* 车辆创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@Schema(description = "车辆记录创建时间,格式:yyyy-MM-dd HH:mm:ss")
private Date createTime;
/**
* 原车主姓名
*/
@Schema(description = "原车主姓名")
private String originalOwner;
/**
* 原车主联系方式
*/
@Schema(description = "原车主联系电话或邮箱")
private String ownerContact;
/**
* 交强险到期日
*/
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@Schema(description = "交强险保险到期时间,格式:yyyy-MM-dd")
private Date insuranceExpiry;
/**
* 年审到期日
*/
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@Schema(description = "车辆年审到期时间,格式:yyyy-MM-dd")
private Date inspectionExpiry;
/**
* 新车指导价
*/
@Schema(description = "厂商新车指导价,单位:元")
private BigDecimal msrp;
/**
* 车辆生产日期
*/
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@Schema(description = "车辆出厂生产日期,格式:yyyy-MM-dd")
private Date productionDate;
/**
* 车辆图片,json存储(参考eval_image_info的字段存储)
*/
@Schema(description = "车辆图片信息,JSON 格式存储,结构参考 eval_image_info 表")
private String carImages;
/**
* 证件资料,json存储(参考eval_image_info的字段存储)
*/
@Schema(description = "车辆相关证件资料,JSON 格式存储,结构参考 eval_image_info 表")
private String documents;
/**
* 车辆图片List
*/
@Schema(description = "车辆图片信息List")
private List<EvalImageInfoDTO> carImageList;
/**
* 证件资料List
*/
@Schema(description = "车辆相关证件资料List")
private List<EvalImageInfoDTO> documentList;
/**
* 车辆备注
*/
@Schema(description = "车辆其他备注信息")
private String vehicleNotes;
/**
* 发动机号
*/
@Schema(description = "车辆发动机编号")
private String engineNumber;
/**
* 车系id
*/
@Schema(description = "车系id")
private Integer carSeriesId;
/**
* 车系名字
*/
@Schema(description = "车系名字")
private String carSeriesName;
/**
* 车型id
*/
@Schema(description = "车型分类ID,关联车型表")
private Integer carTypeId;
/**
* 车型名称
*/
@Schema(description = "车型名称,如:奥迪A6L 2020款")
private String carTypeName;
/**
* 钥匙编码
*/
@Schema(description = "车辆钥匙唯一编码")
private String keyCode;
/**
* 钥匙数
*/
@Schema(description = "随车钥匙数量")
private Integer keyCount;
/**
* 过户次数
*/
@Schema(description = "车辆历史过户次数")
private Integer transfersNumber;
/**
* 创建人
*/
@Schema(description = "记录创建人账号")
private String createdBy;
/**
* 创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@Schema(description = "记录创建时间,格式:yyyy-MM-dd HH:mm:ss")
private Date createdDate;
/**
* 修改人
*/
@Schema(description = "记录最后修改人账号")
private String updatedBy;
/**
* 修改时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@Schema(description = "记录最后修改时间,格式:yyyy-MM-dd HH:mm:ss")
private Date updatedDate;
/**
* 删除标识:N未删除,D已删除
*/
@Schema(description = "逻辑删除标识:N-未删除,D-已删除")
private String deletedFlag;
}
\ No newline at end of file \ No newline at end of file
package com.gsc4cloud.gsc.facade.vpcweb.vo.car;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import java.io.Serializable;
import java.util.Date;
/**
* 车辆管理信息操作日志表
*
* @author zhangfk
*/
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
@Data
public class CarManageInfoLogVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
@Schema(description = "操作日志主键ID")
private Integer id;
/**
* 车辆管理信息ID
*/
@Schema(description = "车辆管理信息ID")
private Integer carCarManageInfoId;
/**
* 评估单编号
*/
@Schema(description = "关联的评估单编号")
private String evalOrderNo;
/**
* 操作项类型 1-修改保管地 2-修改卖出价 3-修改卖出方 4-修改车辆卖出备注 5-修改车辆备注 6-修改车辆状态
*/
@Schema(description = "操作类型:1-修改保管地,2-修改卖出价,3-修改卖出方,4-修改车辆卖出备注,5-修改车辆备注,6-修改车辆状态")
private Integer opType;
/**
* 创建人
*/
@Schema(description = "日志记录创建人账号")
private String createdBy;
/**
* 创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@Schema(description = "日志创建时间,格式:yyyy-MM-dd HH:mm:ss")
private Date createdDate;
/**
* 修改人
*/
@Schema(description = "日志最后修改人账号")
private String updatedBy;
/**
* 修改时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@Schema(description = "日志最后修改时间,格式:yyyy-MM-dd HH:mm:ss")
private Date updatedDate;
/**
* 删除标识:N未删除,D已删除
*/
@Schema(description = "逻辑删除标识:N-未删除,D-已删除")
private String deletedFlag;
}
\ No newline at end of file \ No newline at end of file
package com.gsc4cloud.gsc.facade.vpcweb.vo.car;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 车辆管理信息表(分页展示用 VO)
*
* @author zhangfk
*/
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
@Data
public class CarManageInfoPageVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
@Schema(description = "主键ID")
private Integer id;
/**
* 车辆照片 取车辆照片左前45度
*/
@Schema(description = "车辆照片,取车辆照片左前45度")
private String carPhoto;
/**
* 评估单编号
*/
@Schema(description = "关联的评估单编号")
private String evalOrderNo;
/**
* 车辆状态:0-库存中 1-已出售 2-待售 3-已预定 4-已交付 5-待排卖 6-拍卖中 7-已退库 默认:0-库存中
*/
@Schema(description = "车辆状态:0-库存中,1-已出售,2-待售,3-已预定,4-已交付,5-待排卖,6-拍卖中,7-已退库")
private Integer carStatus;
/**
* 车辆创建人
*/
@Schema(description = "车辆信息创建人账号或姓名")
private String carCreator;
/**
* 保管地
*/
@Schema(description = "车辆当前物理保管地点")
private String storageLocation;
/**
* 保管人
*/
@Schema(description = "当前车辆保管责任人")
private String custodian;
/**
* 代保管合同
*/
@Schema(description = "代保管合同文件路径或编号")
private String custodyContract;
/**
* 交车确认书
*/
@Schema(description = "交车确认书文件路径或编号")
private String deliveryConfirmation;
/**
* 收车价
*/
@Schema(description = "收车价格,单位:元")
private BigDecimal purchasePrice;
/**
* 收车时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@Schema(description = "收车时间,格式:yyyy-MM-dd HH:mm:ss")
private Date purchaseTime;
/**
* 卖出价
*/
@Schema(description = "卖出价格,单位:元")
private BigDecimal sellingPrice;
/**
* 卖出时间
*/
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@Schema(description = "卖出时间,格式:yyyy-MM-dd")
private Date sellingTime;
/**
* 卖出方
*/
@Schema(description = "车辆卖出方名称或公司")
private String seller;
/**
* 车辆卖出备注
*/
@Schema(description = "车辆卖出时的备注信息")
private String sellingNotes;
/**
* 车牌号
*/
@Schema(description = "车辆牌照号码")
private String licensePlate;
/**
* 车架号
*/
@Schema(description = "车辆识别码 VIN")
private String vin;
/**
* 发动机号
*/
@Schema(description = "车辆发动机编号")
private String engineNumber;
/**
* 车系id
*/
@Schema(description = "车系id")
private Integer carSeriesId;
/**
* 车系名字
*/
@Schema(description = "车系名字")
private String carSeriesName;
/**
* 车型id
*/
@Schema(description = "车型分类ID,关联车型表")
private Integer carTypeId;
/**
* 车型名称
*/
@Schema(description = "车型名称,如:奥迪A6L 2020款")
private String carTypeName;
/**
* 上牌时间
*/
@TableField(value = "listing_date")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@Schema(description = "车辆首次上牌时间,格式:yyyy-MM-dd")
private Date listingDate;
/**
* 上牌城市
*/
@Schema(description = "车辆上牌所在城市")
private String listingCity;
/**
* 表显里程
*/
@Schema(description = "仪表盘显示行驶里程,单位:公里")
private String mileage;
/**
* 使用性质
*/
@Schema(description = "车辆使用性质,如:非营运、营运、租赁等")
private String usageType;
/**
* 所有人性质
*/
@Schema(description = "车辆所有人性质,如:个人、企业")
private String ownerType;
/**
* 天窗
*/
@Schema(description = "是否带天窗,如:有/无/全景")
private String sunroof;
/**
* 是否事故:1-是/0-否
*/
@Schema(description = "是否为事故车:1-是,0-否")
private Integer hasAccident;
/**
* 车辆来源门店
*/
@Schema(description = "车辆来源的门店或渠道Id")
private Integer sourceStore;
/**
* 车辆来源门店名称
*/
@Schema(description = "车辆来源的门店或渠道名称")
private String sourceStoreName;
/**
* 车辆创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@Schema(description = "车辆记录创建时间,格式:yyyy-MM-dd HH:mm:ss")
private Date createTime;
/**
* 原车主姓名
*/
@Schema(description = "原车主姓名")
private String originalOwner;
/**
* 原车主联系方式
*/
@Schema(description = "原车主联系电话或邮箱")
private String ownerContact;
/**
* 交强险到期日
*/
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@Schema(description = "交强险保险到期时间,格式:yyyy-MM-dd")
private Date insuranceExpiry;
/**
* 年审到期日
*/
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@Schema(description = "车辆年审到期时间,格式:yyyy-MM-dd")
private Date inspectionExpiry;
/**
* 新车指导价
*/
@Schema(description = "厂商新车指导价,单位:元")
private BigDecimal msrp;
/**
* 车辆生产日期
*/
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@Schema(description = "车辆出厂生产日期,格式:yyyy-MM-dd")
private Date productionDate;
/**
* 车辆图片,json存储(参考eval_image_info的字段存储)
*/
@Schema(description = "车辆图片信息,JSON 格式存储,结构参考 eval_image_info 表")
private String carImages;
/**
* 证件资料,json存储(参考eval_image_info的字段存储)
*/
@Schema(description = "车辆相关证件资料,JSON 格式存储,结构参考 eval_image_info 表")
private String documents;
/**
* 车辆备注
*/
@Schema(description = "车辆其他备注信息")
private String vehicleNotes;
/**
* 钥匙编码
*/
@Schema(description = "车辆钥匙唯一编码")
private String keyCode;
/**
* 钥匙数
*/
@Schema(description = "随车钥匙数量")
private Integer keyCount;
/**
* 过户次数
*/
@Schema(description = "车辆历史过户次数")
private Integer transfersNumber;
/**
* 创建人
*/
@Schema(description = "记录创建人账号")
private String createdBy;
/**
* 创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@Schema(description = "记录创建时间,格式:yyyy-MM-dd HH:mm:ss")
private Date createdDate;
/**
* 修改人
*/
@Schema(description = "记录最后修改人账号")
private String updatedBy;
/**
* 修改时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@Schema(description = "记录最后修改时间,格式:yyyy-MM-dd HH:mm:ss")
private Date updatedDate;
/**
* 删除标识:N未删除,D已删除
*/
@Schema(description = "逻辑删除标识:N-未删除,D-已删除")
private String deletedFlag;
}
\ No newline at end of file \ No newline at end of file
package com.gsc4cloud.gsc.facade.vpcweb.vo.configs;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
@Data
@Schema(description = "阳光激励配置操作日志视图对象")
public class SunlightInspiresConfigLogPageVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
@Schema(description = "主键id")
private Integer id;
/**
* 阳光激励配置主键id
*/
@Schema(description = "阳光激励配置主键id")
private Integer sunlightInspiresConfigId;
/**
* 操作项类型:1-新增 2-修改
*/
@Schema(description = "操作项类型:1-新增 2-修改")
private Integer opType;
/**
* 创建人
*/
@Schema(description = "创建人")
private String createdBy;
/**
* 创建时间
*/
@Schema(description = "创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createdDate;
/**
* 修改人
*/
@Schema(description = "修改人")
private String updatedBy;
/**
* 修改时间
*/
@Schema(description = "修改时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date updatedDate;
/**
* 删除标识:N未删除,D已删除
*/
@Schema(description = "删除标识:N未删除,D已删除")
private String deletedFlag;
}
package com.gsc4cloud.gsc.facade.vpcweb.vo.configs;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
@Data
@Schema(description = "阳光激励配置视图对象")
public class SunlightInspiresConfigPageVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
@Schema(description = "主键id")
private Integer id;
/**
* 销售商户号(园区店)
*/
@Schema(description = "销售商户号(园区店)")
private Integer sellerMerchantId;
/**
* 销售(园区店)商户名称
*/
@Schema(description = "销售(园区店)商户名称")
private String sellerMerchantName;
/**
* 车辆类型:1-置换车 2-报废车
*/
@Schema(description = "车辆类型:1-置换车 2-报废车")
private Integer carType;
/**
* 阳光激励价格(单位:元)
*/
@Schema(description = "阳光激励价格(单位:元)")
private BigDecimal sunlightInspiresPrice;
/**
* 创建人
*/
@Schema(description = "创建人")
private String createdBy;
/**
* 创建时间
*/
@Schema(description = "创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createdDate;
/**
* 修改人
*/
@Schema(description = "修改人")
private String updatedBy;
/**
* 修改时间
*/
@Schema(description = "修改时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date updatedDate;
/**
* 删除标识:N未删除,D已删除
*/
@Schema(description = "删除标识:N未删除,D已删除")
private String deletedFlag;
}
package com.gsc4cloud.gsc.facade.vpcweb.vo.configs;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
@Data
public class SunlightInspiresConfigVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
@Schema(description = "主键id")
private Integer id;
/**
* 销售商户号(园区店)
*/
@Schema(description = "销售商户号(园区店)")
private Integer sellerMerchantId;
/**
* 销售(园区店)商户名称
*/
@Schema(description = "销售(园区店)商户名称")
private String sellerMerchantName;
/**
* 车辆类型:1-置换车 2-报废车
*/
@Schema(description = "车辆类型:1-置换车 2-报废车")
private Integer carType;
/**
* 阳光激励价格(单位:元)
*/
@Schema(description = "阳光激励价格(单位:元)")
private BigDecimal sunlightInspiresPrice;
/**
* 创建人
*/
@Schema(description = "创建人")
private String createdBy;
/**
* 创建时间
*/
@Schema(description = "创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createdDate;
/**
* 修改人
*/
@Schema(description = "修改人")
private String updatedBy;
/**
* 修改时间
*/
@Schema(description = "修改时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date updatedDate;
/**
* 删除标识:N未删除,D已删除
*/
@Schema(description = "删除标识:N未删除,D已删除")
private String deletedFlag;
}
server:
# 服务端口
port: 4008
spring:
application:
# 应用名称,取pom文件中的artifactId
name: @artifactId@
cloud:
nacos:
# nacos用户名,取pom文件中的nacos.username(父级的com.gsc4cloud:gsc下有默认定义)
username: @nacos.username@
# nacos密码,取pom文件中的nacos.password(父级的com.gsc4cloud:gsc下有默认定义)
password: @nacos.password@
# nacos注册中心
discovery:
# 命名空间id(必须使用命名空间id)
# namespace: b4196e36-e204-4e07-8612-f51b17401d6e
# 分组
group: DEFAULT_GROUP
# nacos服务地址,配置文件中的NACOS_HOST和NACOS_PORT
server-addr: nacos3.beta.glsx.com:8848
# 启用监控功能
watch:
enabled: true
# 设置监控间隔为1000毫秒(即1秒)
watch-delay: 1000
config:
# 命名空间(必须使用命名空间id)
# namespace: b4196e36-e204-4e07-8612-f51b17401d6e
# 分组
group: DEFAULT_GROUP
# nacos配置服务地址,配置文件中的NACOS_HOST和NACOS_PORT
server-addr: ${spring.cloud.nacos.discovery.server-addr}
# 配置文件
config:
# 配置文件导入
import:
- nacos:${spring.application.name}-${spring.profiles.active}.yml
# 日志配置
logging:
config: classpath:logback-spring.xml
file:
path: /data/java_log/jetty/${spring.application.name}
level:
root: info
server:
# 服务端口
port: 4008
spring:
application:
# 应用名称,取pom文件中的artifactId
name: @artifactId@
cloud:
nacos:
# nacos用户名,取pom文件中的nacos.username(父级的com.gsc4cloud:gsc下有默认定义)
username: @nacos.username@
# nacos密码,取pom文件中的nacos.password(父级的com.gsc4cloud:gsc下有默认定义)
password: @nacos.password@
# nacos注册中心
discovery:
# 命名空间id(必须使用命名空间id)
namespace: b4196e36-e204-4e07-8612-f51b17401d6e
# 分组
group: DEFAULT_GROUP
# nacos服务地址,配置文件中的NACOS_HOST和NACOS_PORT
server-addr: ${NACOS_HOST:192.168.3.102}:${NACOS_PORT:8868}
# 启用监控功能
watch:
enabled: true
# 设置监控间隔为1000毫秒(即1秒)
watch-delay: 1000
config:
# 命名空间(必须使用命名空间id)
namespace: b4196e36-e204-4e07-8612-f51b17401d6e
# 分组
group: DEFAULT_GROUP
# nacos配置服务地址,配置文件中的NACOS_HOST和NACOS_PORT
server-addr: ${spring.cloud.nacos.discovery.server-addr}
# 配置文件
config:
# 配置文件导入
import:
- nacos:${spring.application.name}-${spring.profiles.active}.yml
# 日志配置
logging:
config: classpath:logback-spring.xml
file:
path: /data/java_log/jetty/${spring.application.name}
level:
root: info
server:
# 服务端口
port: 4008
spring:
application:
# 应用名称,取pom文件中的artifactId
name: @artifactId@
cloud:
nacos:
# nacos用户名,取pom文件中的nacos.username(父级的com.gsc4cloud:gsc下有默认定义)
username: gsc-biz-user
# nacos密码,取pom文件中的nacos.password(父级的com.gsc4cloud:gsc下有默认定义)
password: WEqj#2weGlsx123d_@#2!0f2
# nacos注册中心
discovery:
# 命名空间id(必须使用命名空间id)
# namespace: b4196e36-e204-4e07-8612-f51b17401d6e
# 分组
group: DEFAULT_GROUP
# nacos服务地址,配置文件中的NACOS_HOST和NACOS_PORT
server-addr: nacos3.release.glsx.com:8838
# 启用监控功能
watch:
enabled: true
# 设置监控间隔为1000毫秒(即1秒)
watch-delay: 1000
config:
# 命名空间(必须使用命名空间id)
# namespace: b4196e36-e204-4e07-8612-f51b17401d6e
# 分组
group: DEFAULT_GROUP
# nacos配置服务地址,配置文件中的NACOS_HOST和NACOS_PORT
server-addr: ${spring.cloud.nacos.discovery.server-addr}
# 配置文件
config:
# 配置文件导入
import:
- nacos:${spring.application.name}-${spring.profiles.active}.yml
# 日志配置
logging:
config: classpath:logback-spring.xml
file:
path: /data/java_log/jetty/${spring.application.name}
level:
root: info
server:
# 服务端口
port: 4008
spring:
application:
# 应用名称,取pom文件中的artifactId
name: @artifactId@
cloud:
nacos:
# nacos用户名,取pom文件中的nacos.username(父级的com.gsc4cloud:gsc下有默认定义)
username: @nacos.username@
# nacos密码,取pom文件中的nacos.password(父级的com.gsc4cloud:gsc下有默认定义)
password: @nacos.password@
# nacos注册中心
discovery:
# 命名空间id(必须使用命名空间id)
# namespace: b4196e36-e204-4e07-8612-f51b17401d6e
# 分组
group: DEFAULT_GROUP
# nacos服务地址,配置文件中的NACOS_HOST和NACOS_PORT
server-addr: nacos3.test.glsx.com:8848
# 启用监控功能
watch:
enabled: true
# 设置监控间隔为1000毫秒(即1秒)
watch-delay: 1000
config:
# 命名空间(必须使用命名空间id)
# namespace: b4196e36-e204-4e07-8612-f51b17401d6e
# 分组
group: DEFAULT_GROUP
# nacos配置服务地址,配置文件中的NACOS_HOST和NACOS_PORT
server-addr: ${spring.cloud.nacos.discovery.server-addr}
# 配置文件
config:
# 配置文件导入
import:
- nacos:${spring.application.name}-${spring.profiles.active}.yml
# 日志配置
logging:
config: classpath:logback-spring.xml
file:
path: /data/java_log/jetty/${spring.application.name}
level:
root: info
spring:
profiles:
# 环境标识:dev、test、beta、release
active: dev
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false" scan="false">
<property name="log.path" value="/data/java_log/jetty/${artifactId}"/>
<property name="LOG_LEVEL" value="${logging.level:-INFO}" />
<!-- 彩色日志格式 -->
<property name="CONSOLE_LOG_PATTERN"
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%t]){faint} %clr([%X{traceId}]){red} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
<property name="FILE_LOG_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [${project.artifactId}] [%X{traceId}] [%thread] %-5level [%logger{36}.%method %line] - %msg%n"/>
<!-- 彩色日志依赖的渲染类 -->
<conversionRule conversionWord="clr" class="org.springframework.boot.logging.logback.ColorConverter"/>
<conversionRule conversionWord="wex"
class="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/>
<conversionRule conversionWord="wEx"
class="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/>
<!-- Console log output -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
</encoder>
</appender>
<!-- 错误日志 -->
<appender name="error" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/error.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<maxFileSize>50MB</maxFileSize>
<maxHistory>30</maxHistory>
<totalSizeCap>10GB</totalSizeCap>
</rollingPolicy>
<encoder>
<pattern>${FILE_LOG_PATTERN}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>ERROR</level>
</filter>
</appender>
<!-- 普通日志 -->
<appender name="info" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/${artifactId}.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${log.path}/${artifactId}.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<maxFileSize>50MB</maxFileSize>
<maxHistory>30</maxHistory>
<totalSizeCap>10GB</totalSizeCap>
</rollingPolicy>
<encoder>
<pattern>${FILE_LOG_PATTERN}</pattern>
</encoder>
</appender>
<!-- nacos 心跳 INFO 屏蔽 -->
<logger name="com.alibaba.nacos" level="OFF">
<appender-ref ref="error"/>
</logger>
<logger name="org.springframework.web.filter.CommonsRequestLoggingFilter" level="DEBUG"/>
<root level="${LOG_LEVEL}">
<appender-ref ref="console"/>
<appender-ref ref="info"/>
<appender-ref ref="error"/>
</root>
</configuration>
\ No newline at end of file \ No newline at end of file
server:
port: 4002
spring:
data:
redis:
host: 192.168.3.226
port: 6379
# 用户名密码如果没有配置,配置项注释掉
# username:
# password:
database: 0
timeout: 30000
connectTimeout: 30000
redisson:
config:
singleServerConfig:
idleConnectionTimeout: 10000
connectTimeout: 5000
timeout: 3000
database: 0
# swagger 配置
swagger:
enabled: true
title: ${spring.application.name} Swagger API
gateway: http://${GATEWAY-HOST:127.0.0.1}:${GATEWAY-PORT:9999}
token-url: ${swagger.gateway}/auth/oauth2/token
scope: server
# rop 配置
rop:
api:
appkey: 48e5e13229b82c1b4e6e8c96151f0637
secret: c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b
url: https://dj.dev.glsx.com.cn/
contextPath: rop-dj-smartcarlife
method: dj.api.user.info
package com.gsc4cloud.gsc.facade.vpcpad.service;
import com.gsc4cloud.gsc.facade.vpcweb.VpcWebFacadeMain;
import org.junit.jupiter.api.Test;
import org.redisson.Redisson;
import org.redisson.api.RBucket;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.core.env.Environment;
import java.util.concurrent.TimeUnit;
/**
* @author zhoulm
* @version V1.0
* @Title: BaseServiceTest.java
* @Description:
* @date 2018年1月6日 下午1:23:03
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2015
*/
@SpringBootTest(classes = VpcWebFacadeMain.class)
public class BaseServiceTest {
@Autowired
private Redisson redisson;
@Autowired
private Environment environment;
@Test
public void Test() throws Exception {
RBucket<String> weiruizhifu = redisson.getBucket("weiruizhifu");
weiruizhifu.set("test",5, TimeUnit.SECONDS);
System.out.println(weiruizhifu.get());
// while ( true){
// System.out.println(weiruizhifu.get());
// Thread.sleep(1000);
// }
// System.out.println("test");
// System.out.println(environment.getProperty());
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!