Commit bf05f63f by 林冲

初始化项目

0 parents
Showing 71 changed files with 4128 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-pad-facade</artifactId>
<packaging>jar</packaging>
<description>gsc 二手车展业助手模块</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>
<!-- <dependency>-->
<!-- <groupId>org.mapstruct</groupId>-->
<!-- <artifactId>mapstruct</artifactId>-->
<!-- <version>1.5.2.Final</version>-->
<!-- <scope>compile</scope>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.mapstruct</groupId>-->
<!-- <artifactId>mapstruct-processor</artifactId>-->
<!-- <version>1.5.2.Final</version>-->
<!-- <scope>provided</scope>-->
<!-- </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.vpcpad;
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-pad-facade")
@EnableGscFeignClients
@EnableDiscoveryClient
@SpringBootApplication
@EnableAspectJAutoProxy
public class VpcPadFacadeMain {
public static void main(String[] args) {
SpringApplication.run(VpcPadFacadeMain.class, args);
}
}
package com.gsc4cloud.gsc.facade.vpcpad.anotation;
import java.lang.annotation.*;
/**
* 需要兼容ropsession的地方添加此注解
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface RopSession {
}
package com.gsc4cloud.gsc.facade.vpcpad.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.vpcpad.config;
import com.gsc4cloud.gsc.facade.vpcpad.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.vpcpad.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.vpcpad.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.vpcpad.config;
import com.gsc4cloud.gsc.facade.vpcpad.interceptor.SessionInterceptor;
import com.gsc4cloud.gsc.facade.vpcpad.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")*/; // 排除不需要拦截的路径
}
}
\ No newline at end of file \ No newline at end of file
package com.gsc4cloud.gsc.facade.vpcpad.controller.evalorder;
import com.alibaba.fastjson.JSONObject;
import com.gsc4cloud.gsc.common.core.util.R;
import com.gsc4cloud.gsc.facade.vpcpad.anotation.RopSession;
import com.gsc4cloud.gsc.facade.vpcpad.service.evalorder.ApplyPaymentService;
import com.gsc4cloud.gsc.vpc.api.req.pad.evalorder.ApplyPaymentRequest;
import com.gsc4cloud.gsc.vpc.api.req.pad.evalorder.CheckSignAgreementRequest;
import com.gsc4cloud.gsc.vpc.api.req.pad.evalorder.SignAgreementRequest;
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.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: zhangfk
* @Date: 2025/9/18
*/
@Tag(name = "支付申请")
@RestController
@RequestMapping("/applyPayment")
@Slf4j
public class ApplyPaymentController {
@Resource
private ApplyPaymentService applyPaymentService;
/**
* 支付定金申请
*/
@Operation(summary = "支付定金申请")
@RopSession
@PostMapping("/payDepositApplication")
public R<Boolean> payDepositApplication(@RequestBody @Validated ApplyPaymentRequest request) {
log.info("请求参数{}", JSONObject.toJSONString(request));
try {
return applyPaymentService.payDepositApplication(request);
} catch (Exception e) {
e.printStackTrace();
log.error("支付定金申请", e);
return R.failed(e.getMessage());
}
}
/**
* 全款支付/尾款支付 (发oa审批)
*/
@Operation(summary = "发起尾款/全款支付(签署过《代保管协议》发起oa审批)")
@RopSession
@PostMapping("/payFinal")
public R<Boolean> payFinal(@RequestBody SignAgreementRequest request) {
log.info("请求参数{}", JSONObject.toJSONString(request));
try {
return applyPaymentService.payFinal(request);
} catch (Exception e) {
e.printStackTrace();
log.error("全款支付/尾款支付", e);
return R.failed(e.getMessage());
}
}
/**
* 通过评估单编号判断是否签过代保管协议 true
*/
@Operation(summary = "通过评估单编号判断是否签过代保管协议 true-签过 false-未签")
@RopSession
@PostMapping("/checkSignAgreement")
R<Boolean> checkSignAgreement(@RequestBody @Validated CheckSignAgreementRequest request) {
log.info("请求参数{}", JSONObject.toJSONString(request));
try {
return applyPaymentService.checkSignAgreement(request);
} catch (Exception e) {
e.printStackTrace();
log.error("通过评估单编号判断是否签过代保管协议", e);
return R.failed(e.getMessage());
}
}
}
package com.gsc4cloud.gsc.facade.vpcpad.controller.evalorder;
import com.gsc4cloud.gsc.common.core.util.R;
import com.gsc4cloud.gsc.facade.vpcpad.anotation.RopSession;
import com.gsc4cloud.gsc.facade.vpcpad.response.rop.LoginAccountResponse;
import com.gsc4cloud.gsc.facade.vpcpad.response.rop.LoginUserInfoResponse;
import com.gsc4cloud.gsc.facade.vpcpad.utils.ThreadLocalCache;
import com.gsc4cloud.gsc.vpc.api.entity.car.CarDailyReport;
import com.gsc4cloud.gsc.vpc.api.feign.pad.evalorder.CarDailyReportRemote;
import com.gsc4cloud.gsc.vpc.api.req.pad.car.CarDailyReportRequest;
import com.gsc4cloud.gsc.vpc.api.req.pad.cardailyreport.CarDailyReportListRequest;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.apache.xmlbeans.ThreadLocalUtil;
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("/carDailyReport")
public class CarDailyReportController {
@Autowired
private CarDailyReportRemote carDailyReportRemote;
@RopSession
@Operation(summary = "添加二手车驻店日报")
@PostMapping("/add")
public R<CarDailyReport> add(@RequestBody @Validated CarDailyReportRequest request) {
LoginUserInfoResponse loginInfo = ThreadLocalCache.getLoginInfo();
request.setCreatedBy(loginInfo.getName());
request.setStaffUuid(loginInfo.getUuid());
return carDailyReportRemote.add(request);
}
@RopSession
@Operation(summary = "编辑二手车驻店日报")
@PostMapping("/edit")
public R<CarDailyReport> edit(@RequestBody @Validated CarDailyReportRequest request) {
LoginUserInfoResponse loginInfo = ThreadLocalCache.getLoginInfo();
request.setCreatedBy(loginInfo.getName());
request.setStaffUuid(loginInfo.getUuid());
return carDailyReportRemote.edit(request);
}
@RopSession
@Operation(summary = "查询二手车驻店日报列表")
@PostMapping("/list")
public R<List<CarDailyReport>> list(@RequestBody @Validated CarDailyReportListRequest request) {
return carDailyReportRemote.list(request);
}
@RopSession
@Operation(summary = "查询二手车驻店日报详情")
@PostMapping("/detail")
public R<CarDailyReport> detail(@RequestBody @Validated CarDailyReportRequest request) {
LoginUserInfoResponse loginInfo = ThreadLocalCache.getLoginInfo();
request.setCreatedBy(loginInfo.getName());
request.setStaffUuid(loginInfo.getUuid());
return carDailyReportRemote.detail(request);
}
@RopSession
@Operation(summary = "二手车昨日是否填写日报校验")
@PostMapping("/yesterday/check")
public R<Boolean> yesterdayCheck(@RequestBody @Validated CarDailyReportListRequest request){
return carDailyReportRemote.yesterdayCheck(request);
}
}
package com.gsc4cloud.gsc.facade.vpcpad.controller.evalorder;
import com.alibaba.fastjson.JSONObject;
import com.gsc4cloud.gsc.common.core.util.R;
import com.gsc4cloud.gsc.facade.vpcpad.anotation.RopSession;
import com.gsc4cloud.gsc.facade.vpcpad.service.evalorder.ConfirmVehicleDeliveryService;
import com.gsc4cloud.gsc.vpc.api.req.pad.car.CarResubmitRequest;
import com.gsc4cloud.gsc.vpc.api.req.pad.car.ConfirmCarDeliveryRequest;
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.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: zhangfk
* @Date: 2025/9/18
*/
@RestController
@RequestMapping("/confirmVehicleDelivery")
@Tag(name = "确认交车")
@Slf4j
public class ConfirmVehicleDeliveryController {
@Resource
private ConfirmVehicleDeliveryService confirmVehicleDeliveryService;
/**
* 确认交车
*/
@Operation(summary = "确认交车")
@RopSession
@PostMapping("/confirmVehicleDelivery")
public R<Boolean> confirmVehicleDelivery(@RequestBody @Validated ConfirmCarDeliveryRequest request) {
log.info("请求参数{}", JSONObject.toJSONString(request));
try {
return confirmVehicleDeliveryService.confirmVehicleDelivery(request);
} catch (Exception e) {
e.printStackTrace();
log.error("确认交车", e);
return R.failed(e.getMessage());
}
}
/**
* 重新提交 将已驳回的状态回滚到上一个状态
*/
@Operation(summary = "重新提交")
@RopSession
@PostMapping("/reSubmit")
public R<String> reSubmit(@RequestBody @Validated CarResubmitRequest request) {
log.info("请求参数{}", JSONObject.toJSONString(request));
try {
return confirmVehicleDeliveryService.reSubmit(request);
} catch (Exception e) {
e.printStackTrace();
log.error("重新提交", e);
return R.failed(e.getMessage());
}
}
}
package com.gsc4cloud.gsc.facade.vpcpad.controller.evalorder;
import com.alibaba.fastjson.JSONObject;
import com.gsc4cloud.gsc.common.core.util.R;
import com.gsc4cloud.gsc.facade.vpcpad.anotation.RopSession;
import com.gsc4cloud.gsc.facade.vpcpad.service.contract.CustodyAgreementService;
import com.gsc4cloud.gsc.facade.vpcpad.vo.evalorder.CustodyAgreementCustodianVO;
import com.gsc4cloud.gsc.vpc.api.req.pad.contract.AgreementCustodianAddRequest;
import com.gsc4cloud.gsc.vpc.api.req.pad.contract.AgreementCustodianSendRequest;
import com.gsc4cloud.gsc.vpc.api.req.pad.contract.CustodyAgreementCustodianRequest;
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.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: zhangfk
* @Date: 2025/9/18
*/
@Tag(name = "保管人相关接口")
@RestController
@RequestMapping("/custodyAgreement")
@Slf4j
public class CustodyAgreementController {
@Resource
private CustodyAgreementService custodyAgreementService;
/**
* 保管人列表
*/
@Operation(summary = "保管人列表")
@RopSession
@PostMapping("/custodyAgreementList")
public R<List<CustodyAgreementCustodianVO>> custodyAgreementList(@RequestBody CustodyAgreementCustodianRequest request) {
log.info("请求参数{}", JSONObject.toJSONString(request));
try {
return custodyAgreementService.custodyAgreementList(request);
} catch (Exception e) {
e.printStackTrace();
log.error("保管人列表", e);
return R.failed(e.getMessage());
}
}
/**
* 新增保管人
*/
@Operation(summary = "新增保管人")
@RopSession
@PostMapping("/addCustodyAgreement")
public R<Boolean> addCustodyAgreement(@RequestBody @Validated AgreementCustodianAddRequest request) {
log.info("请求参数{}", JSONObject.toJSONString(request));
try {
return custodyAgreementService.addCustodyAgreement(request);
} catch (Exception e) {
e.printStackTrace();
log.error("新增保管人", e);
return R.failed(e.getMessage());
}
}
/**
* 发送代保管协议
*/
@Operation(summary = "发送代保管协议")
@RopSession
@PostMapping("/sendCustodyAgreement")
public R<Boolean> sendCustodyAgreement(@RequestBody @Validated AgreementCustodianSendRequest request) {
log.info("请求参数{}", JSONObject.toJSONString(request));
try {
return custodyAgreementService.sendCustodyAgreement(request);
} catch (Exception e) {
e.printStackTrace();
log.error("发送代保管协议", e);
return R.failed(e.getMessage());
}
}
}
package com.gsc4cloud.gsc.facade.vpcpad.controller.evalorder;
import com.gsc4cloud.gsc.common.core.util.R;
import com.gsc4cloud.gsc.facade.vpcpad.anotation.RopSession;
import com.gsc4cloud.gsc.facade.vpcpad.service.contract.EvalElectronicContractService;
import com.gsc4cloud.gsc.facade.vpcpad.vo.contract.EvalElectronicContractVO;
import com.gsc4cloud.gsc.vpc.api.req.pad.contract.ContractQueryRequest;
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.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;
@Tag(name = "电子合同管理")
@RestController
@RequestMapping("/evalElectronicContract")
public class EvalElectronicContractController {
@Autowired
private EvalElectronicContractService evalElectronicContractService;
@RopSession
@Operation(summary = "查询合同详情")
@PostMapping("/getDetail")
public R<EvalElectronicContractVO> getDetail(@RequestBody ContractQueryRequest request) {
return evalElectronicContractService.getDetail(request);
}
}
package com.gsc4cloud.gsc.facade.vpcpad.controller.evalorder;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gsc4cloud.gsc.common.core.util.R;
import com.gsc4cloud.gsc.facade.vpcpad.anotation.RopSession;
import com.gsc4cloud.gsc.facade.vpcpad.service.evalorder.EvalOrderService;
import com.gsc4cloud.gsc.facade.vpcpad.vo.contract.EvalContractUrlVO;
import com.gsc4cloud.gsc.facade.vpcpad.vo.evalorder.*;
import com.gsc4cloud.gsc.vpc.api.dto.web.resdto.evalorder.SalesAgreementPreviewResDTO;
import com.gsc4cloud.gsc.vpc.api.req.PageRequest;
import com.gsc4cloud.gsc.vpc.api.req.pad.car.CarDailyReportRequest;
import com.gsc4cloud.gsc.vpc.api.req.pad.contract.CancelSaleContractRequest;
import com.gsc4cloud.gsc.vpc.api.req.pad.contract.SignSaleContractRequest;
import com.gsc4cloud.gsc.vpc.api.req.pad.evalorder.*;
import com.gsc4cloud.gsc.vpc.api.req.web.evalorder.SalesAgreementPreviewRequest;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.io.IOException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Map;
@Tag(name = "评估单管理")
@Slf4j
@RestController
@RequestMapping("/evalOrder")
public class EvalOrderController {
@Autowired
private EvalOrderService evalOrderService;
@Autowired
private Environment env;
@Operation(summary = "分页查询")
@PostMapping("/page")
@RopSession
public R<Page<EvalOrderPageVO>> page(@RequestBody @Valid PageRequest<EvalOrderPageRequest> request) {
return evalOrderService.page(request);
}
@Operation(summary = "分页各状态数量")
@PostMapping("/pageCount")
@RopSession
public R<EvalOrderPageCountVO> pageCount(@RequestBody @Valid EvalOrderPageRequest request) {
return evalOrderService.pageCount(request);
}
@Operation(summary = "评估单详情")
@PostMapping("/detail")
@RopSession
public R<EvalOrderDetailVO> detail(@RequestBody @Valid EvalOrderDetailRequest request) {
return evalOrderService.detail(request);
}
@Operation(summary = "评估单详情")
@PostMapping("/simpleDetail")
@RopSession
public R<EvalOrderSimpleDetailVO> simpleDetail(@RequestBody @Valid EvalOrderDetailRequest request) {
return evalOrderService.simpleDetail(request);
}
@Operation(summary = "新建评估单")
@PostMapping("/create")
@RopSession
public R<EvalOrderCreateVO> create(@RequestBody @Valid EvalOrderCreateRequest request) {
return evalOrderService.create(request);
}
@Operation(summary = "编辑评估单")
@PostMapping("/edit")
@RopSession
public R<Boolean> edit(@RequestBody @Valid EvalOrderCreateRequest request) {
return evalOrderService.edit(request);
}
@Operation(summary = "检查车辆是否存在重复评估单")
@PostMapping("/checkRepeat")
@RopSession
public R<EvalOrderRepeatVO> checkRepeat(@RequestBody @Valid EvalOrderCheckRepeatRequest request) {
return evalOrderService.checkRepeat(request);
}
@Operation(summary = "识别行驶证OCR")
@PostMapping("/carLicenseOcr")
@RopSession
public R<CarLicenseOcrVO> carLicenseOcr(@RequestBody @Valid OcrRequest request) {
return evalOrderService.carLicenseOcr(request);
}
@Operation(summary = "车架号自动识别OCR")
@PostMapping("/vinOcr")
@RopSession
public R<CarVinOcrVO> vinOcr(@RequestBody @Valid OcrRequest request) {
return evalOrderService.vinOcr(request);
}
/**
* 驻店人员询问车主意见重新报价
*
* @param request 请求
* @return 操作结果
*/
@Operation(summary = "车主重新报价")
@PostMapping("/ownerReQuote")
@RopSession
public R<Boolean> ownerReQuote(@RequestBody @Valid EvalOrderOwnerQuoteRequest request) {
return evalOrderService.ownerReQuote(request);
}
@PostMapping("/signingSaleContract")
@Operation(summary = "签订买卖合同")
@RopSession
public R<Boolean> signingSaleContract(@RequestBody @Valid SignSaleContractRequest request) {
return evalOrderService.signingSaleContract(request);
}
@PostMapping("/cancelSaleContract")
@Operation(summary = "取消签订买卖合同")
@RopSession
public R<Boolean> cancelSaleContract(@RequestBody @Valid CancelSaleContractRequest request) {
return evalOrderService.cancelSaleContract(request);
}
@Operation(summary = "省市区数据接口", description = "参数如:keyword=广东省&sub_admin=1&extensions_code=1")
@PostMapping("/apiRegion/search")
@RopSession
public R<Object> getRegionInfo(@RequestParam Map<String, String> allParams) {
String url = env.getProperty("map.service.url", String.class);
if (StringUtils.isBlank(url)) {
return R.failed("服务未配置请求地址");
}
try {
CloseableHttpClient httpClient = HttpClients.createDefault();
StringBuilder urlBuilder = new StringBuilder();
urlBuilder.append(url).append("&");
for (Map.Entry<String, String> entry : allParams.entrySet()) {
urlBuilder.append(entry.getKey()).append("=").append(URLEncoder.encode(entry.getValue(), StandardCharsets.UTF_8.name())).append("&");
}
HttpGet request = new HttpGet(urlBuilder.toString());
try (CloseableHttpResponse response = httpClient.execute(request)) {
return R.ok(EntityUtils.toString(response.getEntity()));
}
} catch (IOException e) {
log.error("请求地址" + url + "出错", e);
return R.failed("请求地址出错");
}
}
@Operation(summary = "检查日报填写情况是否正常", description = "日报填写情况不正常不允许操作评估单")
@PostMapping("/dailyCheck")
@RopSession
public R<Boolean> dailyCheck(@RequestBody @Validated CarDailyReportRequest request) {
return evalOrderService.dailyCheck(request);
}
@RopSession
@PostMapping("/salesAgreementPreview")
@Operation(summary = "二手车买卖补充协议预览(暂未生成合同,只是调用E签宝生成预览链接)")
public R<SalesAgreementPreviewResDTO> salesAgreementPreviewByCondition(@RequestBody SalesAgreementPreviewRequest request) {
return evalOrderService.salesAgreementPreviewByCondition(request);
}
@RopSession
@Operation(summary = "获取合同在线访问地址,评估单详情调用(签署中和已签署)")
@PostMapping("/viewOnlineContract")
public R<EvalContractUrlVO> viewOnlineContract(@RequestBody @Valid EvalContractQueryRequest request) {
return evalOrderService.viewOnlineContract(request);
}
}
package com.gsc4cloud.gsc.facade.vpcpad.convert.contract;
import com.gsc4cloud.gsc.facade.vpcpad.vo.evalorder.CustodyAgreementCustodianVO;
import com.gsc4cloud.gsc.vpc.api.dto.entitydto.contract.CustodyAgreementCustodianDTO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import java.util.List;
@Mapper
public interface CustodyAgreementCustodianConvert {
CustodyAgreementCustodianConvert INSTANCE = Mappers.getMapper(CustodyAgreementCustodianConvert.class);
List<CustodyAgreementCustodianVO> toCustodyAgreementCustodianListVO(List<CustodyAgreementCustodianDTO> source);
}
package com.gsc4cloud.gsc.facade.vpcpad.convert.contract;
import com.gsc4cloud.gsc.facade.vpcpad.vo.contract.EvalElectronicContractVO;
import com.gsc4cloud.gsc.vpc.api.dto.entitydto.evalorder.EvalElectronicContractDTO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
@Mapper
public interface EvalElectronicContractConvert {
EvalElectronicContractConvert INSTANCE = Mappers.getMapper(EvalElectronicContractConvert.class);
EvalElectronicContractVO dtoToVO(EvalElectronicContractDTO evalElectronicContractDTO);
}
package com.gsc4cloud.gsc.facade.vpcpad.convert.evalorder;
import com.gsc4cloud.gsc.facade.vpcpad.vo.evalorder.EvalOrderCarVO;
import com.gsc4cloud.gsc.vpc.api.dto.entitydto.evalorder.EvalCarBaseDTO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
@Mapper
public interface EvalCarBaseConvert {
EvalCarBaseConvert INSTANCE = Mappers.getMapper(EvalCarBaseConvert.class);
EvalOrderCarVO toEvalOrderCarVO(EvalCarBaseDTO source);
}
\ No newline at end of file \ No newline at end of file
package com.gsc4cloud.gsc.facade.vpcpad.convert.evalorder;
import com.gsc4cloud.gsc.facade.vpcpad.vo.evalorder.EvalCarLicenseVO;
import com.gsc4cloud.gsc.vpc.api.dto.entitydto.evalorder.EvalCarLicenseDTO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
@Mapper
public interface EvalCarLicenseConvert {
EvalCarLicenseConvert INSTANCE = Mappers.getMapper(EvalCarLicenseConvert.class);
EvalCarLicenseVO toEvalCarLicenseVO(EvalCarLicenseDTO source);
}
\ No newline at end of file \ No newline at end of file
package com.gsc4cloud.gsc.facade.vpcpad.convert.evalorder;
import com.gsc4cloud.gsc.facade.vpcpad.vo.evalorder.EvalImageInfoVO;
import com.gsc4cloud.gsc.vpc.api.dto.entitydto.evalorder.EvalImageInfoDTO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import java.util.List;
@Mapper
public interface EvalImageInfoConvert {
EvalImageInfoConvert INSTANCE = Mappers.getMapper(EvalImageInfoConvert.class);
EvalImageInfoVO toEvalImageInfoVO(EvalImageInfoDTO source);
List<EvalImageInfoVO> toEvalImageInfoVOList(List<EvalImageInfoDTO> source);
}
\ No newline at end of file \ No newline at end of file
package com.gsc4cloud.gsc.facade.vpcpad.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.vpcpad.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.vpcpad.interceptor;
import com.gsc4cloud.gsc.facade.vpcpad.anotation.RopSession;
import com.gsc4cloud.gsc.facade.vpcpad.manager.RopManager;
import com.gsc4cloud.gsc.facade.vpcpad.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
*/
@Component
@Slf4j
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");
log.info("sessionId:{}", sessionId);
if (sessionId == null || sessionId.isEmpty()) {
// 如果没有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.vpcpad.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.vpcpad.manager;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.gsc4cloud.gsc.facade.vpcpad.config.RopApiConfig;
import com.gsc4cloud.gsc.facade.vpcpad.response.rop.*;
import com.gsc4cloud.gsc.facade.vpcpad.utils.GLRopApiUtils;
import com.gsc4cloud.gsc.facade.vpcpad.utils.ThreadLocalCache;
import com.gsc4cloud.gsc.vpc.api.enums.ErrorCodeEnum;
import com.gsc4cloud.gsc.vpc.api.exception.BusinessException;
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
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();
// 存储到当前线程
ThreadLocalCache.setLoginAccountInfo(loginUserInfo);
}
} else {
throw new Exception("用户信息获取失败: " + post.getMessage());
}
}
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 BusinessException(ErrorCodeEnum.SESSION_INVALID);
}
}
}
package com.gsc4cloud.gsc.facade.vpcpad.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;
}
package com.gsc4cloud.gsc.facade.vpcpad.response.rop;
import lombok.Data;
import lombok.ToString;
import java.util.List;
/**
* @Description 登录返回对象
* @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.vpcpad.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.vpcpad.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.vpcpad.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.vpcpad.service.contract;
import com.gsc4cloud.gsc.common.core.util.R;
import com.gsc4cloud.gsc.facade.vpcpad.convert.contract.CustodyAgreementCustodianConvert;
import com.gsc4cloud.gsc.facade.vpcpad.response.rop.LoginUserInfoResponse;
import com.gsc4cloud.gsc.facade.vpcpad.utils.ThreadLocalCache;
import com.gsc4cloud.gsc.facade.vpcpad.vo.evalorder.CustodyAgreementCustodianVO;
import com.gsc4cloud.gsc.vpc.api.dto.entitydto.contract.CustodyAgreementCustodianDTO;
import com.gsc4cloud.gsc.vpc.api.feign.pad.contract.CustodyAgreementRemote;
import com.gsc4cloud.gsc.vpc.api.req.pad.contract.AgreementCustodianAddRequest;
import com.gsc4cloud.gsc.vpc.api.req.pad.contract.AgreementCustodianSendRequest;
import com.gsc4cloud.gsc.vpc.api.req.pad.contract.CustodyAgreementCustodianRequest;
import com.gsc4cloud.gsc.vpc.api.util.CommonUtils;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @Author: zhangfk
* @Date: 2025/9/18
*/
@Slf4j
@Service
public class CustodyAgreementService {
@Resource
private CustodyAgreementRemote custodyAgreementRemote;
public R<List<CustodyAgreementCustodianVO>> custodyAgreementList(CustodyAgreementCustodianRequest request) {
LoginUserInfoResponse loginInfo = ThreadLocalCache.getLoginInfo();
request.setConversionPhone(loginInfo.getPhone());
R<List<CustodyAgreementCustodianDTO>> result = custodyAgreementRemote.custodyAgreementList(request);
return CommonUtils.convertResponse(result, CustodyAgreementCustodianConvert.INSTANCE::toCustodyAgreementCustodianListVO);
}
public R<Boolean> addCustodyAgreement(AgreementCustodianAddRequest request) {
LoginUserInfoResponse loginInfo = ThreadLocalCache.getLoginInfo();
request.setOperator(loginInfo.getName());
request.setConversionUserId(loginInfo.getUuid());
request.setConversionPhone(loginInfo.getPhone());
return custodyAgreementRemote.addCustodyAgreement(request);
}
public R<Boolean> sendCustodyAgreement(AgreementCustodianSendRequest request) {
LoginUserInfoResponse loginInfo = ThreadLocalCache.getLoginInfo();
request.setConversionUserId(loginInfo.getUuid());
request.setOperator(loginInfo.getName());
return custodyAgreementRemote.sendCustodyAgreement(request);
}
}
package com.gsc4cloud.gsc.facade.vpcpad.service.contract;
import com.gsc4cloud.gsc.common.core.util.R;
import com.gsc4cloud.gsc.facade.vpcpad.convert.contract.EvalElectronicContractConvert;
import com.gsc4cloud.gsc.facade.vpcpad.vo.contract.EvalElectronicContractVO;
import com.gsc4cloud.gsc.vpc.api.dto.entitydto.evalorder.EvalElectronicContractDTO;
import com.gsc4cloud.gsc.vpc.api.feign.pad.contract.EvalElectronicContractRemote;
import com.gsc4cloud.gsc.vpc.api.req.pad.contract.ContractQueryRequest;
import com.gsc4cloud.gsc.vpc.api.util.CommonUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class EvalElectronicContractService {
@Autowired
private EvalElectronicContractRemote evalElectronicContractRemote;
public R<EvalElectronicContractVO> getDetail(ContractQueryRequest request) {
R<EvalElectronicContractDTO> result = evalElectronicContractRemote.getDetail(request);
return CommonUtils.convertResponse(result, EvalElectronicContractConvert.INSTANCE::dtoToVO);
}
}
package com.gsc4cloud.gsc.facade.vpcpad.service.evalorder;
import com.gsc4cloud.gsc.common.core.util.R;
import com.gsc4cloud.gsc.facade.vpcpad.response.rop.LoginUserInfoResponse;
import com.gsc4cloud.gsc.facade.vpcpad.utils.ThreadLocalCache;
import com.gsc4cloud.gsc.vpc.api.feign.pad.evalorder.ApplyPaymentRemote;
import com.gsc4cloud.gsc.vpc.api.req.pad.evalorder.ApplyPaymentRequest;
import com.gsc4cloud.gsc.vpc.api.req.pad.evalorder.CheckSignAgreementRequest;
import com.gsc4cloud.gsc.vpc.api.req.pad.evalorder.SignAgreementRequest;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
* @Author: zhangfk
* @Date: 2025/9/18
*/
@Slf4j
@Service
public class ApplyPaymentService {
@Resource
private ApplyPaymentRemote applyPaymentRemote;
public R<Boolean> payDepositApplication(ApplyPaymentRequest request) {
LoginUserInfoResponse loginInfo = ThreadLocalCache.getLoginInfo();
request.setOperator(loginInfo.getName());
return applyPaymentRemote.payDepositApplication(request);
}
public R<Boolean> payFinal(SignAgreementRequest request) {
LoginUserInfoResponse loginInfo = ThreadLocalCache.getLoginInfo();
request.setOperator(loginInfo.getName());
// request.setOperator("666");
return applyPaymentRemote.payFinal(request);
}
public R<Boolean> checkSignAgreement(CheckSignAgreementRequest request) {
return applyPaymentRemote.checkSignAgreement(request);
}
}
package com.gsc4cloud.gsc.facade.vpcpad.service.evalorder;
import com.gsc4cloud.gsc.common.core.util.R;
import com.gsc4cloud.gsc.facade.vpcpad.response.rop.LoginUserInfoResponse;
import com.gsc4cloud.gsc.facade.vpcpad.utils.ThreadLocalCache;
import com.gsc4cloud.gsc.vpc.api.feign.pad.evalorder.ConfirmVehicleDeliveryRemote;
import com.gsc4cloud.gsc.vpc.api.req.pad.car.CarResubmitRequest;
import com.gsc4cloud.gsc.vpc.api.req.pad.car.ConfirmCarDeliveryRequest;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
* @Author: zhangfk
* @Date: 2025/9/18
*/
@Slf4j
@Service
public class ConfirmVehicleDeliveryService {
@Resource
private ConfirmVehicleDeliveryRemote confirmVehicleDeliveryRemote;
public R<Boolean> confirmVehicleDelivery(ConfirmCarDeliveryRequest request) {
LoginUserInfoResponse loginInfo = ThreadLocalCache.getLoginInfo();
request.setOperator(loginInfo.getName());
return confirmVehicleDeliveryRemote.confirmVehicleDelivery(request);
}
public R<String> reSubmit(CarResubmitRequest request) {
LoginUserInfoResponse loginInfo = ThreadLocalCache.getLoginInfo();
request.setOperator(loginInfo.getName());
return confirmVehicleDeliveryRemote.reSubmit(request);
}
}
package com.gsc4cloud.gsc.facade.vpcpad.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.vpcpad.utils;
import java.math.BigDecimal;
import java.math.RoundingMode;
public class NumberUtils {
private static final BigDecimal TEN_THOUSAND = new BigDecimal("10000");
/**
* 将数值格式化为“万”单位展示,保留两位小数,后缀W
* 例如:100000 -> 10.00W
*/
public static String formatAsWan(BigDecimal num) {
if (num == null) {
return "";
}
BigDecimal priceInWan = num.divide(TEN_THOUSAND, 2, RoundingMode.HALF_UP);
return String.format("%.2fW", priceInWan);
}
}
package com.gsc4cloud.gsc.facade.vpcpad.utils;
import com.gsc4cloud.gsc.facade.vpcpad.response.rop.LoginAccountResponse;
import com.gsc4cloud.gsc.facade.vpcpad.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.vpcpad.vo.contract;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.Date;
@Schema(description = "代保管合同视图对象")
@Data
public class CustodyContractVO {
@Schema(description = "合同编号")
private String contractNo;
@Schema(description = "签约时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date signTime;
@Schema(description = "代保管人名字")
private String custodianName;
@Schema(description = "代保管人电话")
private String custodianPhone;
@Schema(description = "代保管人地址")
private String custodianAddress;
}
package com.gsc4cloud.gsc.facade.vpcpad.vo.contract;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Schema(description = "访问合同第三方地址")
@Data
public class EvalContractUrlVO {
@Schema(description = "合同访问地址")
private String contractUrl;
@Schema(description = "合同格式:pdf/html")
private String format;
}
package com.gsc4cloud.gsc.facade.vpcpad.vo.contract;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class EvalElectronicContractVO implements Serializable {
/**
* 评估单编号
*/
@Schema(description = "评估单编号")
private String evalOrderNo;
/**
* 合同编号
*/
@Schema(description = "合同编号")
private String contractNo;
/**
* 合同签约时间
*/
@Schema(description = "合同签约时间")
@TableField(value = "sign_time")
private Date signTime;
/**
* 合同描述
*/
@TableField(value = "description")
private String description;
/**
* 合同附件地址
*/
@TableField(value = "attachment_url")
private String attachmentUrl;
/**
* 合同金额
*/
@TableField(value ="contract_price")
private BigDecimal contractPrice;
/**
* 合同模板id
*/
@TableField(value = "doc_template_id")
private String docTemplateId;
/**
* 合同模板名称
*/
@TableField(value = "doc_template_name")
private String docTemplateName;
/**
* 电子合同类型:1-二手车转让协议 2-车辆代保管协议 3-二手车补充协议 4-车辆交接确认单
*/
@Schema(description = "电子合同类型:1-二手车转让协议 2-车辆代保管协议 3-二手车补充协议 4-车辆交接确认单")
@TableField(value = "electronic_contract_type")
private Integer electronicContractType;
/**
* 电子合同状态:0-草稿 1-签署中 2-完成 3-撤销 5-过期 7-拒签
*/
@Schema(description = "电子合同状态:0-草稿 1-签署中 2-完成 3-撤销 5-过期 7-拒签")
@TableField(value = "electronic_contract_status")
private Integer electronicContractStatus;
/**
* 电子合同字段,json存储(包含字段的类型、字段值)
*/
@TableField(value = "electronic_contract_field")
private String electronicContractField;
/**
* 创建人
*/
@Schema(description = "驻店人员")
@TableField(value = "created_by")
private String createdBy;
/**
* 创建时间
*/
@TableField(value = "created_date")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createdDate;
}
package com.gsc4cloud.gsc.facade.vpcpad.vo.contract;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
@Schema(description = "买卖合同视图对象")
@Data
public class SaleContractVO {
@Schema(description = "合同编号")
private String contractNo;
@Schema(description = "签约时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date signTime;
@Schema(description = "定金金额")
private BigDecimal depositPrice;
@Schema(description = "尾款金额")
private BigDecimal finalPrice;
@Schema(description = "全款金额")
private BigDecimal fullPrice;
@Schema(description = "合同模板名称")
private String docTemplateName;
@Schema(description = "签约车主")
private String partAName;
@Schema(description = "身份证号")
private String idCard;
@Schema(description = "车主身份证正面链接")
private String idCardFrontUrl;
@Schema(description = "车主身份证反面链接")
private String idCardBackUrl;
@Schema(description = "手机号码")
private String phone;
@Schema(description = "地址")
private String address;
@Schema(description = "收款人姓名")
private String payeeName;
@Schema(description = "银行卡号")
private String bankCardNumber;
@Schema(description = "开户行")
private String bankOfDeposit;
@Schema(description = "收款人身份证正面链接")
private String payerIdCardFrontUrl;
@Schema(description = "收款人身份证反面链接")
private String payerIdCardBackUrl;
@Schema(description = "收款人银行卡链接")
private String payerBankCardUrl;
@Schema(description = "机动车登记本")
private String motorBook;
@Schema(description = "购置税完税收据")
private String purchaseReceipt;
@Schema(description = "购车发票")
private String purchaseInvoice;
@Schema(description = "交管12123截图")
private String trafficScreenshot;
@Schema(description = "车钥匙")
private String carKey;
@Schema(description = "车钥匙数量")
private Integer carKeyCount;
@Schema(description = "交强险")
private String trafficInsurance;
@Schema(description = "保险单商业保险卡或卡")
private String insuranceCard;
@Schema(description = "过户授权委托书照片")
private String transferPhoto;
@Schema(description = "其他")
private String other;
@Schema(description = "其他_文字")
private String otherText;
@Schema(description = "交接时间 yyyy-MM-dd HH:mm:ss")
private String handoverTime;
@Schema(description = "交接地点")
private String handoverAddress;
}
package com.gsc4cloud.gsc.facade.vpcpad.vo.evalorder;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* 行驶证OCR识别结果VO
*
* @author system
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "车辆行驶证OCR识别视图对象")
public class CarLicenseOcrVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 车牌号(来自行驶证车牌号码)
*/
@Schema(description = "车牌号")
private String licensePlate;
/**
* 车架号(来自行驶证车辆识别代号)
*/
@Schema(description = "车架号")
private String vin;
/**
* 发动机号(来自行驶证发动机号码)
*/
@Schema(description = "发动机号")
private String engineNumber;
/**
* 品牌车型(来自行驶证品牌型号,需匹配下拉选项)
*/
@Schema(description = "品牌车型")
private String brandModel;
/**
* 上牌时间(来自行驶证注册日期)
*/
@Schema(description = "上牌时间")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date registrationDate;
/**
* 原车主名称(来自行驶证所有人姓名)
*/
@Schema(description = "原车主名称")
private String previousOwnerName;
/**
* 原车主住址(来自行驶证住址)
*/
@Schema(description = "原车主住址")
private String previousOwnerAddress;
/**
* 识别状态:1-成功,0-失败
*/
@Schema(description = "识别状态:1-成功,0-失败")
private Integer status;
/**
* 识别失败原因
*/
@Schema(description = "识别失败原因")
private String errorMessage;
}
package com.gsc4cloud.gsc.facade.vpcpad.vo.evalorder;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Schema(description = "车架号OCR识别视图对象")
@Data
public class CarVinOcrVO {
@Schema(description = "车架号")
private String vin;
/**
* 识别状态:1-成功,0-失败
*/
@Schema(description = "识别状态:1-成功,0-失败")
private Integer status;
/**
* 识别失败原因
*/
@Schema(description = "识别失败原因")
private String errorMessage;
}
package com.gsc4cloud.gsc.facade.vpcpad.vo.evalorder;
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
@Schema(description = "代保管协议保管人")
public class CustodyAgreementCustodianVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
private Integer id;
/**
* 驻店人员id
*/
@Schema(description = "驻店人员id")
private String conversionUserId;
/**
* 驻店手机号
*/
@Schema(description = "驻店手机号")
private String conversionPhone;
/**
* 签约保管人姓名
*/
@Schema(description = "签约保管人姓名")
private String name;
/**
* 签约保管人身份证号
*/
@Schema(description = "签约保管人身份证号")
private String idCard;
/**
* 签约保管人手机号码
*/
@Schema(description = "签约保管人手机号码")
private String phone;
/**
* 保管人地址
*/
@Schema(description = "保管人地址")
private String address;
/**
* 创建人
*/
@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.vpcpad.vo.evalorder;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.Date;
@Schema(description = "交车信息视图对象")
@Data
public class EvalCarHandoverInfoVO {
/**
* 确认人(提交车辆交接确认的人)
*/
@Schema(description = "确认人(提交车辆交接确认的人)")
private String operator;
/**
* 确认时间
*/
@Schema(description = "确认时间(提交车辆交接确认时间)")
private Date handoverTime;
@Schema(description = "车钥匙数量")
private Integer carKeyCount;
/**
* 机动车登记本链接
*/
@Schema(description = "机动车登记本")
private String motorBookUrl;
/**
* 机动车行驶证链接
*/
@Schema(description = "机动车行驶证")
private String motorRegistrationCertificateUrl;
/**
* 购置税完税收据链接
*/
@Schema(description = "购置税完税收据链接")
private String purchaseReceiptUrl;
/**
* 购车发票链接
*/
@Schema(description = "购车发票链接")
private String purchaseInvoiceUrl;
/**
* 交管12123截图链接
*/
@Schema(description = "交管12123截图链接")
private String trafficScreenshotUrl;
/**
* 车钥匙链接
*/
@Schema(description = "车钥匙链接")
private String carKeyUrl;
/**
* 交强险链接
*/
@Schema(description = "交强险链接")
private String trafficInsuranceUrl;
/**
* 保险单商业保险卡或卡链接
*/
@Schema(description = "保险单商业保险卡或卡链接")
private String insuranceCardUrl;
/**
* 过户授权委托书照片/视频链接
*/
@Schema(description = "过户授权委托书照片/视频链接")
private String transferPhotoUrl;
/**
* 其他链接
*/
@Schema(description = "其他链接")
private String otherUrl;
/**
* 其他_文字
*/
@Schema(description = "其他_文字")
private String otherText;
/**
* 交车确认照片:正面45°
*/
@Schema(description = "交车确认照片 - 正面45°")
private String handoverPhotoFrontFourFive;
/**
* 交车确认照片:正面
*/
@Schema(description = "交车确认照片 - 正面")
private String handoverPhotoFront;
/**
* 交车确认照片:右侧面
*/
@Schema(description = "交车确认照片 - 右侧面")
private String handoverPhotoRightSide;
/**
* 交车确认照片:左侧面
*/
@Schema(description = "交车确认照片 - 左侧面")
private String handoverPhotoLeftSide;
/**
* 交车确认照片:后面
*/
@Schema(description = "交车确认照片 - 后面")
private String handoverPhotoBack;
/**
* 交车确认照片:更多...// 多个额外照片
*/
@Schema(description = "交车确认照片 - 更多")
private String handoverPhotoMore;
/**
* 交接地点
*/
@Schema(description = "交车地点")
private String handoverAddress;
/**
* 补充协议条款
*/
@Schema(description = "补充协议条款")
private String supplementaryClauseText;
@Schema(description = "车辆交接合同编号")
private String handleOverContractNo;
@Schema(description = "补充协议合同编号")
private String supplementaryContractNo;
}
package com.gsc4cloud.gsc.facade.vpcpad.vo.evalorder;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.Date;
@Schema(description = "车辆牌证信息视图对象")
@Data
public class EvalCarLicenseVO {
/**
* 钥匙数量,整数 0-9
*/
@Schema(description = "钥匙数量,整数 0-9")
private Integer keyCount;
/**
* 过户次数,整数 0-9
*/
@Schema(description = "过户次数,整数 0-9")
private Integer transferCount;
/**
* 交强险到期日 yyyy-mm-dd
*/
@Schema(description = "交强险到期日 yyyy-mm-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date compulsoryInsuranceExpiry;
/**
* 年审到期日 yyyy-mm-dd
*/
@Schema(description = "年审到期日 yyyy-mm-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date annualInspectionExpiry;
/**
* 商业险到期日 yyyy-mm-dd
*/
@Schema(description = "商业险到期日 yyyy-mm-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date commercialInsuranceExpiry;
/**
* 原车主名称
*/
@Schema(description = "原车主名称")
private String previousOwnerName;
/**
* 原车主住址
*/
@Schema(description = "原车主住址")
private String previousOwnerAddress;
/**
* 原车主电话,11位手机号
*/
@Schema(description = "原车主电话,11位手机号")
private String previousOwnerPhone;
}
package com.gsc4cloud.gsc.facade.vpcpad.vo.evalorder;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Schema(description = "图像信息")
@Data
public class EvalImageInfoVO {
/**
* 文件类型:1车辆图片 2证件资料 3车辆视频 4其他图片
*/
@Schema(description = "文件类型:1车辆图片 2证件资料 3车辆视频 4其他图片")
private Integer fileType;
/**
* 文件子类型:11-左前45度 12-主驾驶全景 13-仪表盘 14-后排座椅 15-中控台全景 16-右后45度 17-铭牌 21-行驶证 22-登记证1 23-登记证2 24-登记证3,31-发动机概况,32-车况解说,41-其他图片
*/
@Schema(description = "文件子类型:11-左前45度 12-主驾驶全景 13-仪表盘 14-后排座椅 15-中控台全景 16-右后45度 17-铭牌 21-行驶证 22-登记证1 23-登记证2 24-登记证3,31-发动机概况,32-车况解说,41-其他图片")
private Integer fileSubtype;
/**
* 原始文件名
*/
@Schema(description = "原始文件名")
private String fileName;
/**
* 文件存储路径
*/
@Schema(description = "文件存储路径")
private String fileUrl;
/**
* 文件格式:jpeg/png/mp4
*/
@Schema(description = "文件格式:jpeg/png/mp4")
private String fileFormat;
}
package com.gsc4cloud.gsc.facade.vpcpad.vo.evalorder;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
@Schema(description = "评估单基本信息视图")
@Data
public class EvalOrderBasicVO {
/**
* 评估单编号
*/
@Schema(description = "评估单编号")
private String evalOrderNo;
/**
* 评估单状态(10-评估中、20-已报价、30-已签约、40-已支付-定金、50-已支付-尾款、100已完成、-1-已驳回)
*/
@Schema(description = "评估单状态(10-评估中、20-已报价、30-已签约、40-已支付-定金、50-已支付-尾款、100已完成、-1-已驳回)")
private Integer status;
@Schema(description = "评估单变更前状态(10-评估中、20-已报价、30-已签约、40-已支付-定金、50-已支付-尾款、100已完成、-1-已驳回)")
private Integer previousStatus;
/**
* 子状态(1-合同签署中,2-定金支付中,3-尾款支付中)
*/
@Schema(description = "子状态(1-合同签署中,2-定金支付中,3-尾款支付中)")
private Integer subStatus;
/**
* 车牌号(冗余eval_car_base字段)
*/
@Schema(description = "车牌号(冗余eval_car_base字段)")
private String licensePlate;
/**
* 评估师评估价格(元)
*/
@Schema(description = "评估师评估价格(元)")
private BigDecimal evalPrice;
/**
* 评估意见
*/
@Schema(description = "评估意见")
private String evalOpinion;
/**
* 客户意向价(元)
*/
@Schema(description = "客户意向价(元)")
private BigDecimal customerTargetPrice;
/**
* 客户意向价报价反馈
*/
@Schema(description = "客户意向价报价反馈")
private String customerTargetPriceFeedback;
/**
* 驳回原因
*/
@Schema(description = "驳回原因")
private String rejectReason;
/**
* 驳回意见
*/
@Schema(description = "驳回意见")
private String rejectSuggestion;
/**
* 买卖合同类型1-定金+尾款,2-全款
*/
@Schema(description = "买卖合同类型1-定金+尾款,2-全款")
private Integer paymentType;
/**
* 定金金额(元)
*/
@Schema(description = "定金金额(元)")
private BigDecimal depositPrice;
/**
* 尾款金额(元)
*/
@Schema(description = "尾款金额(元)")
private BigDecimal finalPrice;
/**
* 全款金额(元)
*/
@Schema(description = "全款金额(元)")
private BigDecimal fullPrice;
@Schema(description = "买卖合同编号")
private String saleContractNo;
@Schema(description = "代保管合同编号")
private String custodyContractNo;
@Schema(description = "确认交接合同编号")
private String handoverContractNo;
@Schema(description = "二手车买卖补充合同编号")
private String supplementaryContractNo;
/**
* 销售用户id(园区店)
*/
@Schema(description = "销售用户id(园区店)")
private String sellerUserId;
/**
* 销售姓名(园区店) - 销售顾问
*/
@Schema(description = "销售姓名(园区店)")
@NotBlank(message = "销售顾问不能为空")
@Size(max = 50, message = "销售顾问长度不能超过50个字符")
private String sellerName;
/**
* 销售商户号(园区店)
*/
@Schema(description = "销售商户号(园区店)")
private Integer sellerMerchantId;
/**
* 销售(园区店)商户名称
*/
@Schema(description = "销售(园区店)商户名称")
private String sellerMerchantName;
/**
* 转化用户id(园区店)
*/
@Schema(description = "转化用户id(园区店)")
private String conversionUserId;
/**
* 转化姓名(园区店)
*/
@Schema(description = "转化姓名(园区店)")
private String conversionName;
/**
* 转化商户号(园区店)
*/
@Schema(description = "转化商户号(园区店)")
private Integer conversionMerchantId;
/**
* 转化(园区店)商户名称
*/
@Schema(description = "转化(园区店)商户名称")
private String conversionMerchantName;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@Schema(description = "创建时间")
private Date createdDate;
}
package com.gsc4cloud.gsc.facade.vpcpad.vo.evalorder;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
@Schema(description = "车辆信息")
@Data
public class EvalOrderCarVO {
/**
* 车辆品牌id
*/
@Schema(description = "车辆品牌id")
private Integer carBrandId;
/**
* 车辆品牌名称 - 品牌车型
*/
@Schema(description = "车辆品牌名称")
private String carBrand;
/**
* 子品牌id
*/
@Schema(description = "子品牌id")
private Integer carChildsBrandId;
/**
* 子品牌名字
*/
@Schema(description = "子品牌名字")
private String carChildsBrandName;
/**
* 车系id
*/
@Schema(description = "车系id")
private Integer carSeriesId;
/**
* 车系名字
*/
@Schema(description = "车系名字")
private String carSeriesName;
/**
* 车型id
*/
@Schema(description = "车型id")
private Integer carTypeId;
/**
* 车型名称
*/
@Schema(description = "车型名称")
private String carTypeName;
/**
* 车架号
*/
@Schema(description = "车架号")
private String vin;
/**
* 车牌号
*/
@Schema(description = "车牌号")
private String licensePlate;
/**
* 发动机号
*/
@Schema(description = "发动机号")
private String engineNumber;
/**
* 上牌时间
*/
@Schema(description = "上牌时间")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date registrationDate;
/**
* 上牌省份id
*/
@Schema(description = "上牌省份id")
private Integer registrationProvinceId;
/**
* 上牌省份名称
*/
@Schema(description = "上牌省份名称")
private String registrationProvinceName;
/**
* 上牌城市id
*/
@Schema(description = "上牌城市id")
private Integer registrationCityId;
/**
* 上牌城市名称
*/
@Schema(description = "上牌城市名称")
private String registrationCityName;
/**
* 车辆所在地省份id
*/
@Schema(description = "车辆所在地省份id")
private Integer carProvinceId;
/**
* 车辆所在地省份名称
*/
@Schema(description = "车辆所在地省份名称")
private String carProvinceName;
/**
* 车辆所在地城市id
*/
@Schema(description = "车辆所在地城市id")
private Integer carCityId;
/**
* 车辆所在地城市名称
*/
@Schema(description = "车辆所在地城市名称")
private String carCityName;
/**
* 表显里程(公里)
*/
@Schema(description = "表显里程(公里)")
private Integer mileage;
/**
* 使用性质:1-非营运/2-营运/3-营转非
*/
@Schema(description = "使用性质:1-非营运/2-营运/3-营转非")
private Integer usageType;
/**
* 所有人性质:1-个人/2-单位
*/
@Schema(description = "所有人性质:1-个人/2-单位")
private Integer ownerType;
/**
* 天窗:1-无天窗/2-普通天窗/3-全景天窗
*/
@Schema(description = "天窗:1-无天窗/2-普通天窗/3-全景天窗")
private Integer sunroof;
/**
* 车辆类别:1-置换车/2-报废车
*/
@Schema(description = "车辆类别:1-置换车/2-报废车")
private Integer vehicleCategory;
/**
* 排放标准:3-国3/4-国4/5-国5/6-国6
*/
@Schema(description = "排放标准:3-国3/4-国4/5-国5/6-国6")
private Integer emissionStandard;
/**
* 内饰颜色
*/
@Schema(description = "内饰颜色")
private String interiorColor;
/**
* 外观颜色
*/
@Schema(description = "外观颜色")
private String exteriorColor;
/**
* 生产日期
*/
@Schema(description = "生产日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date productionDate;
/**
* 指导价
*/
@Schema(description = "指导价")
private BigDecimal guidePrice;
/**
* 是否购买新车:1-是/0-否
*/
@Schema(description = "是否购买新车:1-是/0-否")
private Integer buyNewCar;
/**
* 是否事故:1-是/0-否
*/
@Schema(description = "是否事故:1-是/0-否")
private Integer hasAccident;
/**
* 综合评价:1-优/2-良/3-中/4-差
*/
@Schema(description = "综合评价:1-优/2-良/3-中/4-差")
private Byte overallRating;
/**
* 车况描述
*/
@Schema(description = "车况描述")
private String conditionDescription;
}
package com.gsc4cloud.gsc.facade.vpcpad.vo.evalorder;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Schema(description = "创建评估单视图对象")
@Data
public class EvalOrderCreateVO {
/**
* 评估单编号
*/
private String evalOrderNo;
}
package com.gsc4cloud.gsc.facade.vpcpad.vo.evalorder;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.List;
@Schema(description = "评估单详情视图")
@Data
public class EvalOrderDetailVO {
@Schema(description = "评估单基本信息")
private EvalOrderBasicVO basic;
@Schema(description = "车辆信息")
private EvalOrderCarVO carInfo;
@Schema(description = "车辆牌证信息")
private EvalCarLicenseVO carLicense;
@Schema(description = "图像信息")
private List<EvalImageInfoVO> images;
@Schema(description = "评估信息")
private List<EvalPriceHistoryVO> priceHistory;
@Schema(description = "签约信息")
private EvalSigningInfoVO signingInfo;
@Schema(description = "支付信息")
private List<EvalPaymentVO> paymentList;
@Schema(description = "交车确认信息")
private EvalCarHandoverInfoVO carHandoverInfo;
@Schema(description = "编辑记录")
private List<EvalOrderEditLogVO> editLogList;
}
package com.gsc4cloud.gsc.facade.vpcpad.vo.evalorder;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.Date;
import java.util.List;
@Schema(description = "评估单编辑记录视图")
@Data
public class EvalOrderEditLogVO {
@Schema(description = "操作编辑人")
private String editor;
@Schema(description = "操作时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date operateTime;
@Schema(description = "评估单编号")
private String evalOrderNo;
@Schema(description = "操作类型", example = "new或者edit")
private String type;
@Schema(description = "评估单状态")
private Integer status;
@Schema(description = "变更字段列表")
private List<ChangeItem> changeList;
@Data
public static class ChangeItem {
@Schema(description = "变更字段名称")
private String fieldName;
@Schema(description = "变更前值")
private String fieldBeforeValue;
@Schema(description = "变更后值")
private String fieldAfterValue;
@Schema(description = "字段类型(文本、图片、视频等)", example = "text/image/video")
private String fieldType;
}
}
package com.gsc4cloud.gsc.facade.vpcpad.vo.evalorder;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Schema(description = "评估单分页数量统计视图对象")
@Data
public class EvalOrderPageCountVO {
@Schema(description = "全部工单数量")
private Long allNum;
@Schema(description = "评估中工单数量")
private Long evaluatingNum;
@Schema(description = "已报价工单数量")
private Long quotedNum;
@Schema(description = "已签约工单数量")
private Long signedNum;
@Schema(description = "已支付定金工单数量")
private Long depositPaidNum;
@Schema(description = "已支付尾款工单数量")
private Long balancePaidNum;
@Schema(description = "已完成工单数量")
private Long completedNum;
@Schema(description = "已驳回工单数量")
private Long rejectedNum;
}
package com.gsc4cloud.gsc.facade.vpcpad.vo.evalorder;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
@Schema(description = "评估单分页对象视图")
@Data
public class EvalOrderPageVO {
@Schema(description = "评估单编号")
private String evalOrderNo;
@Schema(description = "评估单状态")
private Integer status;
@Schema(description = "评估单变更前状态(10-评估中、20-已报价、30-已签约、40-已支付-定金、50-已支付-尾款、100已完成、-1-已驳回)")
private Integer previousStatus;
@Schema(description = "评估单子状态")
private Integer subStatus;
@Schema(description = "评估价格")
private BigDecimal evalPrice;
@Schema(description = "评估价格(以W为单位)")
private String evalPriceDisplay;
@Schema(description = "买卖合同类型1-定金+尾款,2-全款")
private Integer paymentType;
@Schema(description = "定金金额(元)")
private BigDecimal depositPrice;
@Schema(description = "尾款金额(元)")
private BigDecimal finalPrice;
@Schema(description = "驳回原因")
private String rejectReason;
@Schema(description = "驳回意见")
private String rejectSuggestion;
@Schema(description = "买卖合同编号")
private String saleContractNo;
@Schema(description = "代保管合同编号")
private String custodyContractNo;
@Schema(description = "确认交接合同编号")
private String handoverContractNo;
@Schema(description = "二手车买卖补充合同编号")
private String supplementaryContractNo;
@Schema(description = "签约时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date signingSaleDate;
@Schema(description = "工单时间")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date createdDate;
@Schema(description = "销售用户id(园区店)")
private String sellerUserId;
@Schema(description = "销售姓名(4s店)")
private String sellerName;
@Schema(description = "销售商户号(4s店")
private Integer sellerMerchantId;
@Schema(description = "销售(4s店)商户名称")
private String sellerMerchantName;
@Schema(description = "转化用户id(园区店)")
private String conversionUserId;
@Schema(description = "转化姓名(园区店)")
private String conversionName;
@Schema(description = "转化商户号(园区店)")
private Integer conversionMerchantId;
@Schema(description = "转化(园区店)商户名称")
private String conversionMerchantName;
@Schema(description = "车主姓名")
private String previousOwnerName;
@Schema(description = "车主电话")
private String previousOwnerPhone;
@Schema(description = "车辆品牌名称")
private String carBrand;
@Schema(description = "子品牌名字")
private String carChildsBrandName;
@Schema(description = "车系名字")
private String carSeriesName;
@Schema(description = "车型名称")
private String carTypeName;
@Schema(description = "车牌号")
private String licensePlate;
@Schema(description = "上牌时间,例如2020年上牌")
private String registrationDateStr;
@Schema(description = "行驶里程单位(万公里),例如4.2万公里")
private String mileageStr;
@Schema(description = "几手车,例如:一手车")
private String transferCountStr;
@Schema(description = "车辆封面图(“左45度”)")
private String coverImage;
@Schema(description = "车辆类别:1-置换车/2-报废车")
private Integer vehicleCategory;
/**
* 车架号
*/
@Schema(description = "车架号")
private String vin;
/**
* 上牌城市名称
*/
@Schema(description = "上牌城市名称")
private String registrationCityName;
/**
* 使用性质:1-非营运/2-营运/3-营转非
*/
@Schema(description = "使用性质:1-非营运/2-营运/3-营转非")
private Integer usageType;
/**
* 所有人性质:1-个人/2-单位
*/
@Schema(description = "所有人性质:1-个人/2-单位")
private Integer ownerType;
/**
* 是否购买新车:1-是/0-否
*/
@Schema(description = "是否购买新车:1-是/0-否")
private Integer buyNewCar;
/**
* 是否事故:1-是/0-否
*/
@Schema(description = "是否事故:1-是/0-否")
private Integer hasAccident;
/**
* 评估单下单时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@Schema(description = "评估单下单时间")
private Date evalOrderTime;
/**
* 总部定价师
*/
@Schema(description = "总部定价师")
private String evalOperatorName;
}
package com.gsc4cloud.gsc.facade.vpcpad.vo.evalorder;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Schema(description = "评估单是否重复检查对象")
@Data
public class EvalOrderRepeatVO {
/**
* 检查结果:
* 0-不存在该车牌号的评估单,可以正常新增
* 1-存在评估中的评估单,提示进入编辑流程
* 2-存在30天内有效的已报价评估单,提示进入详情查看
*/
@Schema(description = "0-不存在该车牌号的评估单,可以正常新增 1-存在评估中的评估单,提示进入编辑流程 2-存在30天内有效的已报价评估单,提示进入详情查看")
private Byte result;
/**
* 评估单编号
*/
private String evalOrderNo;
}
package com.gsc4cloud.gsc.facade.vpcpad.vo.evalorder;
import com.gsc4cloud.gsc.facade.vpcpad.vo.contract.EvalElectronicContractVO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Data
public class EvalOrderSimpleDetailVO {
@Schema(description = "评估单基本信息")
private EvalOrderBasicVO evalOrder;
@Schema(description = "车辆基本信息")
private EvalOrderCarVO evalCarBase;
@Schema(description = "车辆证件信息")
private EvalCarLicenseVO evalCarLicense;
/**
* 二手车买卖合同
*/
@Schema(description = "买卖合同")
private EvalElectronicContractVO saleContract;
/**
* 代保管合同
*/
@Schema(description = "代保管合同")
private EvalElectronicContractVO custodyContract;
/**
* 确认交车合同
*/
@Schema(description = "确认交车合同")
private EvalElectronicContractVO handoverContract;
/**
* 二手车买卖合同补充协议
*/
@Schema(description = "二手车买卖合同补充协议")
private EvalElectronicContractVO supplementaryContract;
}
package com.gsc4cloud.gsc.facade.vpcpad.vo.evalorder;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
@Schema(description = "支付信息")
@Data
public class EvalPaymentVO {
@Schema(description = "支付方式 1-定金 2-尾款 3-全款")
private Integer paymentType;
@Schema(description = "支付状态 1-未支付,2-已支付")
private Integer status;
@Schema(description = "支付时间(OA审批打款时间)")
private Date payTime;
@Schema(description = "支付金额(单位:元)")
private BigDecimal paymentAmount;
}
package com.gsc4cloud.gsc.facade.vpcpad.vo.evalorder;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
@Schema(description = "评估信息")
@Data
public class EvalPriceHistoryVO {
@Schema(description = "报价轮次")
private Integer roundNo;
@Schema(description = "评估价格")
private BigDecimal evalPrice;
@Schema(description = "评估价格(以W为单位)")
private String evalPriceDisplay;
@Schema(description = "客户报价(元)")
private BigDecimal customerTargetPrice;
@Schema(description = "客户报价(以W为单位)")
private String customerTargetPriceDisplay;
@Schema(description = "客户反馈意见")
private String customerTargetPriceFeedback;
@Schema(description = "评估意见")
private String evalOpinion;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@Schema(description = "报价时间")
private Date quoteTime;
}
package com.gsc4cloud.gsc.facade.vpcpad.vo.evalorder;
import com.gsc4cloud.gsc.facade.vpcpad.vo.contract.CustodyContractVO;
import com.gsc4cloud.gsc.facade.vpcpad.vo.contract.SaleContractVO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Schema(description = "签约信息")
@Data
public class EvalSigningInfoVO {
@Schema(description = "车辆买卖合同")
private SaleContractVO saleContract;
@Schema(description = "代保管合同")
private CustodyContractVO custodyContract;
}
package com.gsc4cloud.gsc.facade.vpcpad.vo.evalorder;
import lombok.Data;
@Data
public class OssStsVO {
}
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: test
<?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.vpcpad.VpcPadFacadeMain;
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 = VpcPadFacadeMain.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!