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 9440e870
authored
Mar 10, 2026
by
章家宝
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat:轮询出价中途取消处理
1 parent
16644dfc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
4 deletions
aus-core/src/main/java/com/glsx/usedcar/module/auction/service/AuctionChangeService.java
aus-core/src/main/java/com/glsx/usedcar/module/auction/service/AuctionService.java
aus-core/src/main/java/com/glsx/usedcar/module/auction/service/LightAuctionPoollingBidService.java
aus-core/src/main/java/com/glsx/usedcar/module/auction/service/AuctionChangeService.java
View file @
9440e87
...
...
@@ -136,13 +136,16 @@ public class AuctionChangeService extends AbstractAuctionService {
if
(
approveHistory
.
getApproveResult
()
==
AuditState
.
AUDITED
&&
auctionVehicle
.
inProgress
())
{
// 处理撤销的逻辑
if
(
auctionVehicleChange
.
getChangeType
()
==
AuctionBaseChange
.
ChangeType
.
CANCEL
)
{
Auction
auction
=
auctionVehicle
.
getAuction
();
// 中止车辆拍卖
if
(
auction
.
getAuctionType
()
==
AuctionType
.
LIGHT
&&
auction
.
getAuctionMode
()
==
2
)
{
lightAuctionPoollingBidService
.
cancelAucVeh
(
auctionVehicle
);
}
Vehicle
vehicle
=
auctionVehicle
.
getVehicle
();
auctionVehicle
.
setAuctionState
(
AuctionVehicle
.
AuctionState
.
CANCELLED
);
vehicle
.
setVehicleState
(
Vehicle
.
VehicleState
.
PRICED
);
// 退回保证金
returnDepositsByAuctionVehicle
(
auctionVehicle
,
"参拍失败,解冻保证金"
);
Auction
auction
=
auctionVehicle
.
getAuction
();
auction
.
setVehicleCount
(
auction
.
getVehicleCount
()
-
1
);
}
// 处理延期的逻辑
...
...
aus-core/src/main/java/com/glsx/usedcar/module/auction/service/AuctionService.java
View file @
9440e87
...
...
@@ -306,8 +306,13 @@ public class AuctionService extends AbstractAuctionService {
vehicle
.
setVehicleState
(
Vehicle
.
VehicleState
.
PREVIEW
);
}
case
AUCTIONING
->
{
av
.
setAuctionState
(
AuctionVehicle
.
AuctionState
.
AUCTIONING
);
vehicle
.
setVehicleState
(
Vehicle
.
VehicleState
.
AUCTIONING
);
if
(
auction
.
getAuctionMode
()
==
2
&&
auction
.
getAuctionType
()
==
AuctionType
.
LIGHT
)
{
av
.
setAuctionState
(
AuctionVehicle
.
AuctionState
.
PREVIEW
);
vehicle
.
setVehicleState
(
Vehicle
.
VehicleState
.
PREVIEW
);
}
else
{
av
.
setAuctionState
(
AuctionVehicle
.
AuctionState
.
AUCTIONING
);
vehicle
.
setVehicleState
(
Vehicle
.
VehicleState
.
AUCTIONING
);
}
}
}
auctionVehicleDao
.
save
(
av
);
...
...
aus-core/src/main/java/com/glsx/usedcar/module/auction/service/LightAuctionPoollingBidService.java
View file @
9440e87
...
...
@@ -5,6 +5,7 @@ import com.glsx.usedcar.module.auction.dao.AuctionDao;
import
com.glsx.usedcar.module.auction.dao.AuctionVehicleDao
;
import
com.glsx.usedcar.module.auction.entity.*
;
import
com.glsx.usedcar.module.auction.entity.Auction.AuctionType
;
import
com.glsx.usedcar.module.auction.entity.AuctionVehicle.AuctionState
;
import
com.glsx.usedcar.module.auction.entity.dto.LightPollingBidConfigDTO
;
import
com.glsx.usedcar.module.auction.entity.vo.LightAuctionPoolingBidNextAucVehVO
;
import
com.glsx.usedcar.module.auction.entity.vo.LightAuctionPoolingBidTimeAndPriceVO
;
...
...
@@ -562,4 +563,21 @@ public class LightAuctionPoollingBidService {
l
.
add
(
String
.
valueOf
(
av
.
getAucvehId
()));
redisCacheUtil
.
setCacheWithExpire
(
String
.
format
(
AUCTION_ORDER_KEY
,
auction
.
getAuctionId
()),
StringUtils
.
join
(
l
,
","
),
24
,
TimeUnit
.
HOURS
);
}
/**
* 取消车辆拍卖
*/
public
void
cancelAucVeh
(
AuctionVehicle
auctionVehicle
)
{
log
.
info
(
"取消车辆拍卖{} {}"
,
auctionVehicle
.
getAucvehId
(),
auctionVehicle
.
getAuctionState
());
if
(
auctionVehicle
.
getAuctionState
()
!=
AuctionState
.
AUCTIONING
)
{
return
;
}
Auction
auction
=
auctionVehicle
.
getAuction
();
LightPollingBidConfigDTO
lightPollingBidConfigDTO
=
LightPollingBidConfigDTO
.
fromJson
(
auction
.
getExtraJson
());
int
bidAucVehDuration
=
lightPollingBidConfigDTO
.
getBidAucVehDuration
();
long
curr
=
System
.
currentTimeMillis
();
long
nextAuctionVehicleStartTimeMillis
=
curr
+
bidAucVehDuration
*
1000L
;
redisCacheUtil
.
setCacheWithExpire
(
String
.
format
(
NEXT_AUCTION_VEHICLE_START_TIME_KEY
,
auction
.
getAuctionId
()),
nextAuctionVehicleStartTimeMillis
,
24
,
TimeUnit
.
HOURS
);
redisCacheUtil
.
setCacheWithExpire
(
String
.
format
(
END_TIME_KEY
,
auctionVehicle
.
getAucvehId
()),
curr
,
24
,
TimeUnit
.
HOURS
);
}
}
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