Commit 04190250 by 章家宝

fix:投标竞价的时候加上时间判断

1 parent 90177f99
...@@ -137,6 +137,11 @@ public class BidService { ...@@ -137,6 +137,11 @@ public class BidService {
if (auctionVehicle.getAuctionState() != AuctionVehicle.AuctionState.AUCTIONING) { if (auctionVehicle.getAuctionState() != AuctionVehicle.AuctionState.AUCTIONING) {
throw new FieldException("aucvehId", aucvehId, "该车辆已结束竞标"); throw new FieldException("aucvehId", aucvehId, "该车辆已结束竞标");
} }
LocalDateTime auctionEndTime = auctionVehicle.getAuctionEndTime();
// 判断是否已经结束
if (auctionEndTime.isBefore(LocalDateTime.now())) {
throw new FieldException("aucvehId", aucvehId, "该车辆已结束竞标");
}
Account account = accountDao.findById(accountId).orElseThrow(() -> new ObjectNotFoundException(accountId, Account.class.getSimpleName())); Account account = accountDao.findById(accountId).orElseThrow(() -> new ObjectNotFoundException(accountId, Account.class.getSimpleName()));
if (!account.isEnabled()) { if (!account.isEnabled()) {
throw new FieldException("accountId", accountId, "你已被禁止竞价"); throw new FieldException("accountId", accountId, "你已被禁止竞价");
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!