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 33fac8ce
authored
Apr 23, 2026
by
章家宝
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat:拍卖状态流转与发拍状态对应
1 parent
0ac170ca
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
3 deletions
aus-core/src/main/java/com/glsx/usedcar/module/auction/service/AuctionOrderService.java
aus-core/src/main/java/com/glsx/usedcar/module/auction/service/AuctionService.java
aus-core/src/main/java/com/glsx/usedcar/module/vrsystem/service/VrAuditService.java
aus-core/src/main/java/com/glsx/usedcar/module/auction/service/AuctionOrderService.java
View file @
33fac8c
...
...
@@ -283,6 +283,7 @@ public class AuctionOrderService extends AbstractAuctionService {
vehicle
.
setVehicleState
(
Vehicle
.
VehicleState
.
PRICED
);
// 退还保证金
returnDepositsByAuctionVehicle
(
auctionVehicle
,
"参拍失败,解冻保证金"
);
vrAuditService
.
syncVrAuditStatus
(
auctionVehicle
);
}
}
}
...
...
aus-core/src/main/java/com/glsx/usedcar/module/auction/service/AuctionService.java
View file @
33fac8c
...
...
@@ -161,11 +161,14 @@ public class AuctionService extends AbstractAuctionService {
auction
.
setAuctionState
(
Auction
.
AuctionState
.
PENDING_AUCTION
);
Auction
auctionDb
=
auctionDao
.
save
(
auction
);
// 将车辆设置为待上拍状态
vehicleDao
.
updateVehicleStates
(
Vehicle
.
VehicleState
.
PENDING_AUCTION
,
vehicleIds
);
auctionVehicles
.
forEach
(
auctionVehicle
->
{
Vehicle
vehicle
=
auctionVehicle
.
getVehicle
();
vehicle
.
setVehicleState
(
Vehicle
.
VehicleState
.
PENDING_AUCTION
);
auctionVehicle
.
setAuctionState
(
AuctionVehicle
.
AuctionState
.
PENDING_AUCTION
);
auctionVehicle
.
setAuction
(
auctionDb
);
vrAuditService
.
syncVrAuditStatus
(
auctionVehicle
);
});
vehicleDao
.
updateVehicleStates
(
Vehicle
.
VehicleState
.
PENDING_AUCTION
,
vehicleIds
);
auctionVehicleDao
.
saveAll
(
auctionVehicles
);
// 发送通知消息
...
...
@@ -262,11 +265,13 @@ public class AuctionService extends AbstractAuctionService {
av
.
setAuctionStartTime
(
auctionVehicle
.
getAuctionStartTime
());
av
.
setAuctionEndTime
(
auctionVehicle
.
getAuctionEndTime
());
av
.
getVehicle
().
setVehicleState
(
Vehicle
.
VehicleState
.
PENDING_AUCTION
);
vrAuditService
.
syncVrAuditStatus
(
av
);
auctionVehicleDbs
.
remove
(
av
);
}
else
{
//集合中不存在,新建一条车辆数据
auctionVehicle
.
setAuction
(
auctionDb
);
vehicleDao
.
updateVehicleState
(
Vehicle
.
VehicleState
.
PENDING_AUCTION
,
auctionVehicle
.
getVehicle
().
getVehicleId
());
vrAuditService
.
syncVrAuditStatus
(
auctionVehicle
);
auctionVehicleDao
.
save
(
auctionVehicle
);
}
}
...
...
@@ -275,6 +280,7 @@ public class AuctionService extends AbstractAuctionService {
// 将删除的车辆还原为已定价状态
auctionVehicleDbs
.
forEach
(
av
->
{
av
.
getVehicle
().
setVehicleState
(
Vehicle
.
VehicleState
.
PRICED
);
vrAuditService
.
syncVrAuditStatus
(
av
);
});
auctionVehicleDao
.
deleteAll
(
auctionVehicleDbs
);
}
...
...
@@ -415,6 +421,11 @@ public class AuctionService extends AbstractAuctionService {
List
<
Integer
>
ids
=
auctionVehicles
.
stream
().
map
(
p
->
p
.
getVehicle
().
getVehicleId
()).
toList
();
if
(
auction
.
getAuditState
()
==
AuditState
.
REJECTED
)
{
// 车辆审核不通过,将拍卖下所有车辆设置为已定价状态
for
(
AuctionVehicle
av
:
auctionVehicles
)
{
Vehicle
v
=
av
.
getVehicle
();
v
.
setVehicleState
(
Vehicle
.
VehicleState
.
PRICED
);
vrAuditService
.
syncVrAuditStatus
(
av
);
}
vehicleDao
.
updateVehicleStates
(
Vehicle
.
VehicleState
.
PRICED
,
ids
);
}
}
...
...
@@ -469,6 +480,7 @@ public class AuctionService extends AbstractAuctionService {
if
(!
auctionVehicles
.
isEmpty
())
{
auctionVehicles
.
forEach
(
auctionVehicle
->
{
auctionVehicle
.
resetAuctionState
(
AuctionVehicle
.
AuctionState
.
CANCELLED
,
Vehicle
.
VehicleState
.
PRICED
);
vrAuditService
.
syncVrAuditStatus
(
auctionVehicle
);
// 车辆状态设置为未定价
gscInvoker
.
pushAuction
(
auctionVehicle
,
null
);
});
...
...
aus-core/src/main/java/com/glsx/usedcar/module/vrsystem/service/VrAuditService.java
View file @
33fac8c
...
...
@@ -100,6 +100,7 @@ public class VrAuditService {
* 拍卖中相关的车辆状态集合,对应发拍单状态为"拍卖中"
*/
private
static
final
EnumSet
<
Vehicle
.
VehicleState
>
AUCTIONING_VEHICLE_STATES
=
EnumSet
.
of
(
Vehicle
.
VehicleState
.
PENDING_AUCTION
,
Vehicle
.
VehicleState
.
WAIT_AUCTION
,
Vehicle
.
VehicleState
.
PREVIEW
,
Vehicle
.
VehicleState
.
AUCTIONING
,
...
...
@@ -109,6 +110,15 @@ public class VrAuditService {
Vehicle
.
VehicleState
.
TRANSFERRING
);
private
static
final
EnumSet
<
Vehicle
.
VehicleState
>
WAITING_AUCTION_STATES
=
EnumSet
.
of
(
Vehicle
.
VehicleState
.
INVENTORY
,
Vehicle
.
VehicleState
.
VENUE
,
Vehicle
.
VehicleState
.
TO_BE_PRICED
,
Vehicle
.
VehicleState
.
PRICED
);
/**
* 分页查询发拍单列表
*
...
...
@@ -138,7 +148,8 @@ public class VrAuditService {
builder
.
like
(
root
.
get
(
VrAudit_
.
carTypeName
),
likePattern
),
builder
.
like
(
root
.
get
(
VrAudit_
.
carBrandName
),
likePattern
),
builder
.
like
(
root
.
get
(
VrAudit_
.
carChildsBrandName
),
likePattern
),
builder
.
like
(
root
.
get
(
VrAudit_
.
publishNo
),
likePattern
)
builder
.
like
(
root
.
get
(
VrAudit_
.
publishNo
),
likePattern
),
builder
.
like
(
root
.
get
(
VrAudit_
.
vin
),
likePattern
)
));
}
}
...
...
@@ -846,10 +857,18 @@ public class VrAuditService {
else
if
(
auctionVehicleState
==
AuctionVehicle
.
AuctionState
.
UNSOLD
)
{
newStatus
=
VrAudit
.
PublishStatus
.
UNSOLD
.
getValue
();
}
// 规则4:车辆状态为拍卖相关状态 → 拍卖中
// 规则4:车辆状态为待拍卖 → 待拍卖
else
if
(
vehicleState
==
VehicleState
.
PRICED
)
{
newStatus
=
VrAudit
.
PublishStatus
.
WAIT_AUCTION
.
getValue
();
}
// 规则5:车辆状态为拍卖相关状态 → 拍卖中
else
if
(
AUCTIONING_VEHICLE_STATES
.
contains
(
vehicleState
))
{
newStatus
=
VrAudit
.
PublishStatus
.
AUCTIONING
.
getValue
();
}
// 规则6: 待拍卖相关状态 → 待拍卖
else
if
(
WAITING_AUCTION_STATES
.
contains
(
vehicleState
))
{
newStatus
=
VrAudit
.
PublishStatus
.
WAIT_AUCTION
.
getValue
();
}
if
(
newStatus
!=
null
)
{
Integer
oldStatus
=
vrAudit
.
getStatus
();
...
...
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