Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
usedCarAuction
/
aus
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit b923293b
authored
Apr 22, 2026
by
杨卫
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat:添加发拍数量统计
1 parent
a6a1e040
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
389 additions
and
42 deletions
aus-core/src/main/java/com/glsx/usedcar/config/ExecutorConfig.java
aus-core/src/main/java/com/glsx/usedcar/module/vrsystem/service/VrAuditService.java
aus-core/src/main/java/com/glsx/usedcar/module/vrsystem/service/VrUserService.java
aus-core/src/main/java/com/glsx/usedcar/module/vrsystem/vo/VrAuditStatusCountRespVO.java
aus-core/src/main/java/com/glsx/usedcar/module/vrsystem/vo/VrLoginReqVO.java
aus-core/src/main/java/com/glsx/usedcar/module/vrsystem/vo/VrUserAddVO.java
aus-vr/src/main/java/com/glsx/usedcar/config/OpenApiConfig.java
aus-vr/src/main/java/com/glsx/usedcar/controller/VrAuditController.java
aus-core/src/main/java/com/glsx/usedcar/config/ExecutorConfig.java
0 → 100644
View file @
b923293
package
com
.
glsx
.
usedcar
.
config
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
;
import
java.util.concurrent.Executor
;
import
java.util.concurrent.ThreadPoolExecutor
;
import
java.util.concurrent.Executors
;
import
java.util.concurrent.ScheduledExecutorService
;
import
java.util.concurrent.LinkedBlockingQueue
;
import
java.util.concurrent.TimeUnit
;
/**
* 线程池配置
* @author yangwei
* @since 2026/4/22 11:07
*/
@Configuration
public
class
ExecutorConfig
{
/**
* CPU 核心数
*/
private
static
final
int
CPU_CORE_COUNT
=
Runtime
.
getRuntime
().
availableProcessors
();
/**
* IO 密集型任务线程池
* 适合:网络请求、文件读写、数据库操作等
* @author yangwei
* @since 2026/4/22 11:07
* @return org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
*/
@Bean
(
name
=
"ioIntensiveExecutor"
)
public
ThreadPoolTaskExecutor
ioIntensiveExecutor
()
{
ThreadPoolTaskExecutor
executor
=
new
ThreadPoolTaskExecutor
();
// 核心线程数:通常设置较大,因为 IO 操作会有大量等待时间
// 公式:CPU核心数 * (1 + IO等待时间/CPU计算时间)
// 假设 IO 等待时间较长,这里设为 CPU核心数的 4 倍
executor
.
setCorePoolSize
(
CPU_CORE_COUNT
*
4
);
// 最大线程数:核心线程数不够时,最大可创建的线程数
executor
.
setMaxPoolSize
(
CPU_CORE_COUNT
*
8
);
// 队列容量:缓冲队列的大小
executor
.
setQueueCapacity
(
1000
);
// 线程空闲时间:超过核心线程数的线程空闲多长时间后被回收
executor
.
setKeepAliveSeconds
(
60
);
// 线程名前缀
executor
.
setThreadNamePrefix
(
"io-thread-"
);
// 拒绝策略:当队列和线程池都满了时的处理策略
// CallerRunsPolicy: 由调用线程处理该任务
executor
.
setRejectedExecutionHandler
(
new
ThreadPoolExecutor
.
CallerRunsPolicy
());
// 等待所有任务结束后再关闭线程池
executor
.
setWaitForTasksToCompleteOnShutdown
(
true
);
// 等待时间,超时强制关闭
executor
.
setAwaitTerminationSeconds
(
60
);
// 初始化线程池
executor
.
initialize
();
return
executor
;
}
/**
* CPU 密集型任务线程池
* 适合:计算密集型任务,如复杂算法、数据处理等
* @author yangwei
* @since 2026/4/22 11:07
* @return org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
*/
@Bean
(
name
=
"cpuIntensiveExecutor"
)
public
ThreadPoolTaskExecutor
cpuIntensiveExecutor
()
{
ThreadPoolTaskExecutor
executor
=
new
ThreadPoolTaskExecutor
();
// 核心线程数:CPU 密集型任务线程数不宜过多
// 通常设为 CPU核心数 + 1,避免过多上下文切换
executor
.
setCorePoolSize
(
CPU_CORE_COUNT
+
1
);
// 最大线程数:不超过 CPU核心数的 2 倍
executor
.
setMaxPoolSize
(
CPU_CORE_COUNT
*
2
);
// 队列容量:设置较小,避免任务堆积
executor
.
setQueueCapacity
(
200
);
// 线程空闲时间:较短,因为 CPU 密集型任务通常不需要长时间保留额外线程
executor
.
setKeepAliveSeconds
(
30
);
// 线程名前缀
executor
.
setThreadNamePrefix
(
"cpu-thread-"
);
// 拒绝策略:直接抛出异常,让调用方知道系统繁忙
executor
.
setRejectedExecutionHandler
(
new
ThreadPoolExecutor
.
AbortPolicy
());
// 等待所有任务结束后再关闭线程池
executor
.
setWaitForTasksToCompleteOnShutdown
(
true
);
// 等待时间
executor
.
setAwaitTerminationSeconds
(
30
);
// 初始化
executor
.
initialize
();
return
executor
;
}
/**
* 可选的:定时任务线程池(使用 ScheduledExecutorService)
* @author yangwei
* @since 2026/4/22 11:08
* @return java.util.concurrent.ScheduledExecutorService
*/
@Bean
(
name
=
"scheduledExecutor"
)
public
ScheduledExecutorService
scheduledExecutor
()
{
// 创建定时任务线程池,核心线程数设为 CPU 核心数
return
Executors
.
newScheduledThreadPool
(
CPU_CORE_COUNT
,
r
->
{
Thread
t
=
new
Thread
(
r
);
t
.
setName
(
"scheduled-thread-"
+
t
.
getId
());
t
.
setDaemon
(
true
);
// 设置为守护线程
return
t
;
});
}
}
\ No newline at end of file
aus-core/src/main/java/com/glsx/usedcar/module/vrsystem/service/VrAuditService.java
View file @
b923293
...
...
@@ -25,6 +25,7 @@ import com.glsx.usedcar.module.business.entity.NoticeTemplate;
import
com.glsx.usedcar.module.business.service.NoticeField
;
import
com.glsx.usedcar.module.vehicle.dao.VehicleDao
;
import
com.glsx.usedcar.module.vehicle.domain.CarImage
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.summerframework.storage.domain.FileInfo
;
import
com.glsx.usedcar.module.vehicle.entity.*
;
import
com.glsx.usedcar.module.vehicle.entity.Vehicle.VehicleState
;
...
...
@@ -39,6 +40,7 @@ import cn.hutool.core.date.DateUtil;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.data.domain.Page
;
import
org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -53,6 +55,7 @@ import java.time.LocalDate;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.util.*
;
import
java.util.concurrent.CompletableFuture
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -62,7 +65,7 @@ import java.util.stream.Collectors;
*/
@Slf4j
@Service
@RequiredArgsConstructor
@RequiredArgsConstructor
(
onConstructor_
=
{
@Autowired
})
@Transactional
(
propagation
=
Propagation
.
SUPPORTS
,
readOnly
=
true
)
public
class
VrAuditService
{
...
...
@@ -86,6 +89,8 @@ public class VrAuditService {
private
final
WebHookHandler
webHookHandler
;
private
final
ThreadPoolTaskExecutor
ioIntensiveExecutor
;
/**
* 拍卖中相关的车辆状态集合,对应发拍单状态为"拍卖中"
*/
...
...
@@ -107,6 +112,18 @@ public class VrAuditService {
*/
@DataPermission
(
key
=
"vrUserId"
)
public
Page
<
VrAuditRespVO
>
pageList
(
Pagination
<
VrAudit
>
pagination
)
{
applyBaseFilters
(
pagination
);
Page
<
VrAudit
>
resultPage
=
vrAuditRepository
.
findAll
(
pagination
,
pagination
.
getPageRequest
());
return
resultPage
.
map
(
vrAuditConverter:
:
vrAuditMapRespVO
);
}
/**
* 构建基础查询条件(公共过滤条件)
* <p>应用未删除过滤、关键词模糊匹配等通用条件,供分页查询和状态统计复用</p>
*
* @param pagination 分页查询对象
*/
private
void
applyBaseFilters
(
Pagination
<
VrAudit
>
pagination
)
{
pagination
.
addFilter
(
JpaQueryConstants
.
VrAudit
.
DELETE_FLAG
,
DeleteFlag
.
NOT_DELETED
.
getCode
(),
Operator
.
eq
);
Object
keyword
=
pagination
.
getFilterValueOrElseNull
(
JpaQueryConstants
.
VrAudit
.
KEYWORD
);
if
(
keyword
instanceof
String
kw
&&
StrUtil
.
isNotBlank
(
kw
))
{
...
...
@@ -118,8 +135,40 @@ public class VrAuditService {
builder
.
like
(
root
.
get
(
VrAudit_
.
publishNo
),
likePattern
)
));
}
Page
<
VrAudit
>
resultPage
=
vrAuditRepository
.
findAll
(
pagination
,
pagination
.
getPageRequest
());
return
resultPage
.
map
(
vrAuditConverter:
:
vrAuditMapRespVO
);
}
/**
* 复制 Pagination 查询条件(用于异步 count 查询)
* <p>复制 filters、conditions、logic 等查询条件,排除分页和排序参数</p>
*
* @param source 源 Pagination 对象
* @return 复制后的 Pagination 对象
*/
@SuppressWarnings
(
"unchecked"
)
private
Pagination
<
VrAudit
>
copyPagination
(
Pagination
<
VrAudit
>
source
)
{
Pagination
<
VrAudit
>
copy
=
new
Pagination
<>(
0
,
1
);
if
(
source
.
getFilters
()
!=
null
)
{
copy
.
setFilters
(
new
ArrayList
<>(
source
.
getFilters
()));
}
try
{
java
.
lang
.
reflect
.
Field
logicField
=
Pagination
.
class
.
getDeclaredField
(
"logic"
);
logicField
.
setAccessible
(
true
);
Object
logic
=
logicField
.
get
(
source
);
if
(
logic
!=
null
)
{
logicField
.
set
(
copy
,
logic
);
}
java
.
lang
.
reflect
.
Field
conditionsField
=
Pagination
.
class
.
getDeclaredField
(
"conditions"
);
conditionsField
.
setAccessible
(
true
);
List
<
org
.
summerframework
.
orm
.
paging
.
FilterDescriptor
<?>>
conditions
=
(
List
<
org
.
summerframework
.
orm
.
paging
.
FilterDescriptor
<?>>)
conditionsField
.
get
(
source
);
if
(
conditions
!=
null
)
{
conditionsField
.
set
(
copy
,
new
ArrayList
<>(
conditions
));
}
}
catch
(
Exception
e
)
{
log
.
warn
(
"复制Pagination条件失败"
,
e
);
}
return
copy
;
}
/**
...
...
@@ -570,6 +619,70 @@ public class VrAuditService {
}
/**
* 查询发拍单各状态的数量统计
* <p>查询条件与分页列表保持一致(由Controller的buildPagination构建),使用线程池异步并发查询各状态数量</p>
*
* @param pagination 查询参数(已包含所有筛选条件)
* @return 各状态数量统计响应VO
*/
@DataPermission
(
key
=
"vrUserId"
)
public
VrAuditStatusCountRespVO
getStatusCount
(
Pagination
<
VrAudit
>
pagination
)
{
CompletableFuture
<
Long
>
totalFuture
=
CompletableFuture
.
supplyAsync
(
()
->
vrAuditRepository
.
count
(
copyPagination
(
pagination
)),
ioIntensiveExecutor
);
CompletableFuture
<
Long
>
draftFuture
=
CompletableFuture
.
supplyAsync
(()
->
{
Pagination
<
VrAudit
>
p
=
copyPagination
(
pagination
);
p
.
addFilter
(
VrAudit_
.
STATUS
,
VrAudit
.
PublishStatus
.
DRAFT
.
getValue
(),
Operator
.
eq
);
return
vrAuditRepository
.
count
(
p
);
},
ioIntensiveExecutor
);
CompletableFuture
<
Long
>
waitAuctionFuture
=
CompletableFuture
.
supplyAsync
(()
->
{
Pagination
<
VrAudit
>
p
=
copyPagination
(
pagination
);
p
.
addFilter
(
VrAudit_
.
STATUS
,
VrAudit
.
PublishStatus
.
WAIT_AUCTION
.
getValue
(),
Operator
.
eq
);
return
vrAuditRepository
.
count
(
p
);
},
ioIntensiveExecutor
);
CompletableFuture
<
Long
>
auctioningFuture
=
CompletableFuture
.
supplyAsync
(()
->
{
Pagination
<
VrAudit
>
p
=
copyPagination
(
pagination
);
p
.
addFilter
(
VrAudit_
.
STATUS
,
VrAudit
.
PublishStatus
.
AUCTIONING
.
getValue
(),
Operator
.
eq
);
return
vrAuditRepository
.
count
(
p
);
},
ioIntensiveExecutor
);
CompletableFuture
<
Long
>
soldFuture
=
CompletableFuture
.
supplyAsync
(()
->
{
Pagination
<
VrAudit
>
p
=
copyPagination
(
pagination
);
p
.
addFilter
(
VrAudit_
.
STATUS
,
VrAudit
.
PublishStatus
.
SOLD
.
getValue
(),
Operator
.
eq
);
return
vrAuditRepository
.
count
(
p
);
},
ioIntensiveExecutor
);
CompletableFuture
<
Long
>
unsoldFuture
=
CompletableFuture
.
supplyAsync
(()
->
{
Pagination
<
VrAudit
>
p
=
copyPagination
(
pagination
);
p
.
addFilter
(
VrAudit_
.
STATUS
,
VrAudit
.
PublishStatus
.
UNSOLD
.
getValue
(),
Operator
.
eq
);
return
vrAuditRepository
.
count
(
p
);
},
ioIntensiveExecutor
);
CompletableFuture
<
Long
>
offShelfFuture
=
CompletableFuture
.
supplyAsync
(()
->
{
Pagination
<
VrAudit
>
p
=
copyPagination
(
pagination
);
p
.
addFilter
(
VrAudit_
.
STATUS
,
VrAudit
.
PublishStatus
.
OFF_SHELF
.
getValue
(),
Operator
.
eq
);
return
vrAuditRepository
.
count
(
p
);
},
ioIntensiveExecutor
);
CompletableFuture
.
allOf
(
totalFuture
,
draftFuture
,
waitAuctionFuture
,
auctioningFuture
,
soldFuture
,
unsoldFuture
,
offShelfFuture
).
join
();
return
VrAuditStatusCountRespVO
.
builder
()
.
total
(
totalFuture
.
join
())
.
draftCount
(
draftFuture
.
join
())
.
waitAuctionCount
(
waitAuctionFuture
.
join
())
.
auctioningCount
(
auctioningFuture
.
join
())
.
soldCount
(
soldFuture
.
join
())
.
unsoldCount
(
unsoldFuture
.
join
())
.
offShelfCount
(
offShelfFuture
.
join
())
.
build
();
}
/**
* 下架发拍单
* <p>仅草稿状态(DRAFT)和待拍卖状态(WAIT_AUCTION)可以下架,下架后状态变更为已下架(OFF_SHELF)</p>
*
...
...
aus-core/src/main/java/com/glsx/usedcar/module/vrsystem/service/VrUserService.java
View file @
b923293
...
...
@@ -11,6 +11,7 @@ import com.glsx.usedcar.module.vrsystem.dao.*;
import
com.glsx.usedcar.module.vrsystem.entity.*
;
import
com.glsx.usedcar.module.vrsystem.util.RedisTokenUtil
;
import
com.glsx.usedcar.module.vrsystem.vo.*
;
import
com.glsx.usedcar.util.RedisCacheUtil
;
import
jakarta.persistence.criteria.Join
;
import
jakarta.persistence.criteria.Root
;
import
jakarta.persistence.criteria.Subquery
;
...
...
@@ -26,6 +27,7 @@ import org.springframework.transaction.annotation.Propagation;
import
org.springframework.transaction.annotation.Transactional
;
import
org.summerframework.core.enums.ErrorCodeEnum
;
import
org.summerframework.core.exception.BusinessCodeException
;
import
org.summerframework.core.util.StringUtils
;
import
org.summerframework.orm.entity.AuditingTimeEntity
;
import
org.summerframework.orm.paging.Pagination
;
...
...
@@ -33,6 +35,7 @@ import java.time.LocalDate;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.util.*
;
import
java.util.concurrent.TimeUnit
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -52,51 +55,68 @@ public class VrUserService {
private
final
VrSystemConverter
vrSystemConverter
;
private
final
PasswordEncoder
passwordEncoder
;
private
final
RedisTokenUtil
redisTokenUtil
;
private
final
RedisCacheUtil
redisCacheUtil
;
private
static
final
String
VR_USER_ADD_LOCK_KEY
=
"simpleLock:vrUser:add:{0}"
;
/**
* 新增用户
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
addUser
(
VrUserAddVO
addVO
)
{
// 校验手机号唯一
if
(
vrUserRepository
.
findByPhoneAndDeleteFlag
(
addVO
.
getPhone
(),
DeleteFlag
.
NOT_DELETED
.
getCode
()).
isPresent
())
{
throw
new
BusinessCodeException
(
ErrorCodeEnum
.
PHONE_ALREADY_EXISTS
,
addVO
.
getPhone
());
}
String
lockKey
=
StringUtils
.
templateFormat
(
VR_USER_ADD_LOCK_KEY
,
addVO
.
getPhone
());
String
lockValue
=
UUID
.
randomUUID
().
toString
();
boolean
isLockSuccess
=
false
;
try
{
isLockSuccess
=
redisCacheUtil
.
setCacheIfAbsent
(
lockKey
,
lockValue
,
30
,
TimeUnit
.
SECONDS
);
if
(!
isLockSuccess
)
{
throw
new
BusinessCodeException
(
ErrorCodeEnum
.
BUSINESS_BUSY
);
}
// 生成账号ID
String
accountId
=
generateAccountId
();
// 校验手机号唯一
if
(
vrUserRepository
.
findByPhoneAndDeleteFlag
(
addVO
.
getPhone
(),
DeleteFlag
.
NOT_DELETED
.
getCode
()).
isPresent
())
{
throw
new
BusinessCodeException
(
ErrorCodeEnum
.
PHONE_ALREADY_EXISTS
,
addVO
.
getPhone
());
}
// 密码: 指定密码或默认手机号后6位
String
rawPassword
=
StrUtil
.
isNotBlank
(
addVO
.
getPassword
())
?
addVO
.
getPassword
()
:
addVO
.
getPhone
().
substring
(
addVO
.
getPhone
().
length
()
-
6
);
String
encodedPassword
=
passwordEncoder
.
encode
(
rawPassword
);
// 生成账号ID
String
accountId
=
generateAccountId
();
// 查询角色和组织
VrRole
role
=
null
;
if
(
addVO
.
getRoleId
()
!=
null
)
{
role
=
vrRoleRepository
.
findByIdAndDeleteFlag
(
addVO
.
getRoleId
(),
DeleteFlag
.
NOT_DELETED
.
getCode
())
.
orElse
(
null
);
}
VrOrg
org
=
null
;
if
(
addVO
.
getOrgId
()
!=
null
)
{
org
=
vrOrgRepository
.
findByIdAndDeleteFlag
(
addVO
.
getOrgId
(),
DeleteFlag
.
NOT_DELETED
.
getCode
())
.
orElse
(
null
);
}
// 密码: 指定密码或默认手机号后6位
String
rawPassword
=
StrUtil
.
isNotBlank
(
addVO
.
getPassword
())
?
addVO
.
getPassword
()
:
addVO
.
getPhone
().
substring
(
addVO
.
getPhone
().
length
()
-
6
);
String
encodedPassword
=
passwordEncoder
.
encode
(
rawPassword
);
// 保存用户(包含关联关系)
VrUser
user
=
VrUser
.
builder
()
.
accountId
(
accountId
)
.
phone
(
addVO
.
getPhon
e
())
.
userName
(
addVO
.
getUserName
())
.
password
(
encodedPassword
)
.
status
(
1
)
.
roles
(
role
!=
null
?
new
HashSet
<>(
Set
.
of
(
role
))
:
new
HashSet
<>())
.
orgs
(
org
!=
null
?
new
HashSet
<>(
Set
.
of
(
org
))
:
new
HashSet
<>
())
.
build
(
);
vrUserRepository
.
save
(
user
);
// 查询角色和组织
VrRole
role
=
null
;
if
(
addVO
.
getRoleId
()
!=
null
)
{
role
=
vrRoleRepository
.
findByIdAndDeleteFlag
(
addVO
.
getRoleId
(),
DeleteFlag
.
NOT_DELETED
.
getCod
e
())
.
orElse
(
null
);
}
VrOrg
org
=
null
;
if
(
addVO
.
getOrgId
()
!=
null
)
{
org
=
vrOrgRepository
.
findByIdAndDeleteFlag
(
addVO
.
getOrgId
(),
DeleteFlag
.
NOT_DELETED
.
getCode
())
.
orElse
(
null
);
}
log
.
info
(
"用户新增成功: ID={}, accountId={}"
,
user
.
getId
(),
accountId
);
// 保存用户(包含关联关系)
VrUser
user
=
VrUser
.
builder
()
.
accountId
(
accountId
)
.
phone
(
addVO
.
getPhone
())
.
userName
(
addVO
.
getUserName
())
.
password
(
encodedPassword
)
.
status
(
1
)
.
roles
(
role
!=
null
?
new
HashSet
<>(
Set
.
of
(
role
))
:
new
HashSet
<>())
.
orgs
(
org
!=
null
?
new
HashSet
<>(
Set
.
of
(
org
))
:
new
HashSet
<>())
.
build
();
vrUserRepository
.
save
(
user
);
log
.
info
(
"用户新增成功: ID={}, accountId={}"
,
user
.
getId
(),
accountId
);
}
finally
{
if
(
isLockSuccess
)
{
redisCacheUtil
.
deleteCacheIfMatch
(
lockKey
,
lockValue
);
}
}
}
/**
...
...
aus-core/src/main/java/com/glsx/usedcar/module/vrsystem/vo/VrAuditStatusCountRespVO.java
0 → 100644
View file @
b923293
package
com
.
glsx
.
usedcar
.
module
.
vrsystem
.
vo
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* 发拍单状态统计响应VO
*
* @since 2026-04-22
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema
(
description
=
"发拍单状态统计响应"
)
public
class
VrAuditStatusCountRespVO
{
@Schema
(
description
=
"全部数量"
)
private
Long
total
;
@Schema
(
description
=
"草稿数量"
)
private
Long
draftCount
;
@Schema
(
description
=
"待拍卖数量"
)
private
Long
waitAuctionCount
;
@Schema
(
description
=
"拍卖中数量"
)
private
Long
auctioningCount
;
@Schema
(
description
=
"交易成功数量"
)
private
Long
soldCount
;
@Schema
(
description
=
"流拍数量"
)
private
Long
unsoldCount
;
@Schema
(
description
=
"已下架数量"
)
private
Long
offShelfCount
;
}
aus-core/src/main/java/com/glsx/usedcar/module/vrsystem/vo/VrLoginReqVO.java
View file @
b923293
...
...
@@ -3,6 +3,7 @@ package com.glsx.usedcar.module.vrsystem.vo;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
jakarta.validation.constraints.NotBlank
;
import
jakarta.validation.constraints.Pattern
;
import
jakarta.validation.constraints.Size
;
import
lombok.Data
;
import
java.io.Serial
;
...
...
@@ -25,5 +26,6 @@ public class VrLoginReqVO implements Serializable {
@Schema
(
description
=
"密码"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"123456"
)
@NotBlank
(
message
=
"密码不能为空"
)
@Size
(
min
=
6
,
max
=
16
,
message
=
"密码长度必须在{min}至{max}位之间"
)
private
String
password
;
}
aus-core/src/main/java/com/glsx/usedcar/module/vrsystem/vo/VrUserAddVO.java
View file @
b923293
...
...
@@ -27,7 +27,7 @@ public class VrUserAddVO implements Serializable {
@Schema
(
description
=
"用户姓名"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"张三"
)
@NotBlank
(
message
=
"用户姓名不能为空"
)
@Size
(
m
ax
=
64
,
message
=
"用户姓名长度不能超过{max}个字符
"
)
@Size
(
m
in
=
2
,
max
=
10
,
message
=
"用户姓名长度必须在{min}至{max}个字符之间
"
)
private
String
userName
;
@Schema
(
description
=
"角色ID"
,
example
=
"3"
)
...
...
@@ -37,7 +37,7 @@ public class VrUserAddVO implements Serializable {
private
Long
orgId
;
@Schema
(
description
=
"登录密码(可选,默认手机号后6位)"
,
example
=
""
)
@Size
(
min
=
6
,
max
=
20
,
message
=
"密码长度必须在{min}至{max}位之间"
)
@Size
(
min
=
6
,
max
=
16
,
message
=
"密码长度必须在{min}至{max}位之间"
)
@Pattern
(
regexp
=
"^[A-Za-z\\d!@#$%^&*()_+\\-=\\[\\]{};':\"\\\\|,.<>\\/?]*$"
,
message
=
"密码只能包含大小写字母、数字及特殊字符"
)
private
String
password
;
...
...
aus-vr/src/main/java/com/glsx/usedcar/config/OpenApiConfig.java
View file @
b923293
package
com
.
glsx
.
usedcar
.
config
;
import
io.swagger.v3.oas.models.ExternalDocumentation
;
import
io.swagger.v3.oas.models.OpenAPI
;
import
io.swagger.v3.oas.models.info.*
;
import
io.swagger.v3.oas.models.servers.Server
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
java.util.List
;
/**
* <pre>
* Knife4j/OpenAPI配置类
...
...
@@ -22,14 +26,36 @@ public class OpenApiConfig {
return
new
OpenAPI
()
.
info
(
new
Info
()
.
title
(
"aus-vr API文档"
)
.
version
(
"1.0.0"
)
.
description
(
"发拍端后台 API接口文档"
)
.
version
(
"v1.0.0"
)
.
description
(
"""
## 发拍端后台管理系统 API
### 主要功能模块:
1. **发拍管理** - 发拍订单管理
2. **系统管理** - 用户认证与权限管理
### 接口规范:
- 所有接口均需在 Header 中携带 token
- 响应格式统一为:{ "
code
": "
200
", "
success
": true, "
message
": "
操作成功
","
data
": {} }
- 时间格式:yyyy-MM-dd HH:mm:ss
- 分页参数:page, size
### 版本历史:
| 版本 | 日期 | 描述 |
|------|------|------|
| v1.0.0 | 2026-04-30 | 初始版本 |
"""
)
.
termsOfService
(
"https://www.glsx.com"
)
.
contact
(
new
Contact
()
.
name
(
"开发团队"
)
.
email
(
"yangwei@didihu.com.cn"
)
.
url
(
"https://gitee.com/foutouren/aus.git"
))
.
license
(
new
License
()
.
name
(
"Apache 2.0"
)
.
url
(
"http://www.apache.org/licenses/LICENSE-2.0.html"
)));
.
url
(
"http://www.apache.org/licenses/LICENSE-2.0.html"
)))
.
externalDocs
(
new
ExternalDocumentation
()
.
description
(
"项目仓库地址"
)
.
url
(
"https://gitee.com/foutouren/aus"
))
;
}
}
\ No newline at end of file
aus-vr/src/main/java/com/glsx/usedcar/controller/VrAuditController.java
View file @
b923293
...
...
@@ -169,6 +169,21 @@ public class VrAuditController {
}
/**
* 发拍单状态数量统计
* <p>查询各状态发拍单数量,查询条件与分页列表完全一致(支持发拍单号/VIN/车牌号/省市/门店/场次时间区间筛选),使用线程池异步并发查询</p>
*/
@PostMapping
(
"/statusCount"
)
@Operation
(
summary
=
"发拍单状态数量统计"
,
description
=
"查询各状态发拍单数量,查询条件与分页列表完全一致"
)
public
BaseResp
<
VrAuditStatusCountRespVO
>
statusCount
(
@RequestBody
VrAuditPageQueryVO
queryVO
)
{
log
.
info
(
"发拍单状态统计请求: publishNo={}, vin={}, status={}"
,
queryVO
.
getPublishNo
(),
queryVO
.
getVin
(),
queryVO
.
getStatus
());
Pagination
<
VrAudit
>
pagination
=
buildPagination
(
queryVO
);
// 移除状态过滤,统计需要查询所有状态的数量
pagination
.
removeFilter
(
VrAudit_
.
STATUS
);
VrAuditStatusCountRespVO
result
=
vrAuditService
.
getStatusCount
(
pagination
);
return
BaseResp
.
success
(
result
);
}
/**
* 查询发拍单详情
*/
@GetMapping
(
"/detail/{id}"
)
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment