|
@@ -12,15 +12,17 @@ import cn.hobbystocks.auc.domain.*;
|
|
|
import cn.hobbystocks.auc.handle.RuleHandlerHolder;
|
|
import cn.hobbystocks.auc.handle.RuleHandlerHolder;
|
|
|
import cn.hobbystocks.auc.handle.context.Live;
|
|
import cn.hobbystocks.auc.handle.context.Live;
|
|
|
import cn.hobbystocks.auc.mapper.*;
|
|
import cn.hobbystocks.auc.mapper.*;
|
|
|
|
|
+import cn.hobbystocks.auc.service.DepositOrderService;
|
|
|
import cn.hobbystocks.auc.service.IAuctionService;
|
|
import cn.hobbystocks.auc.service.IAuctionService;
|
|
|
import cn.hobbystocks.auc.service.ILotService;
|
|
import cn.hobbystocks.auc.service.ILotService;
|
|
|
-import cn.hobbystocks.auc.service.IOrderStatusService;
|
|
|
|
|
-import cn.hobbystocks.auc.vo.CardGroupLivesConfigVO;
|
|
|
|
|
|
|
+import cn.hobbystocks.auc.service.IOrderService;
|
|
|
import cn.hobbystocks.auc.vo.OrderVO;
|
|
import cn.hobbystocks.auc.vo.OrderVO;
|
|
|
-import com.alibaba.fastjson.JSON;
|
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Lists;
|
|
|
import io.micrometer.core.instrument.util.NamedThreadFactory;
|
|
import io.micrometer.core.instrument.util.NamedThreadFactory;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
+import org.apache.commons.lang3.Strings;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
@@ -30,7 +32,6 @@ import org.springframework.util.CollectionUtils;
|
|
|
import javax.annotation.PostConstruct;
|
|
import javax.annotation.PostConstruct;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
import java.util.concurrent.*;
|
|
import java.util.concurrent.*;
|
|
|
-import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
@Component
|
|
@Component
|
|
|
@Slf4j
|
|
@Slf4j
|
|
@@ -50,7 +51,10 @@ public class BidTask implements CacheMap {
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private IAuctionService auctionService;
|
|
private IAuctionService auctionService;
|
|
|
-
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private DepositOrderService depositOrderService;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IOrderService orderService;
|
|
|
@Value("${auction.thread.corePoolSize:50}")
|
|
@Value("${auction.thread.corePoolSize:50}")
|
|
|
private Integer corePoolSize;
|
|
private Integer corePoolSize;
|
|
|
@Value("${auction.thread.maximumPoolSize:100}")
|
|
@Value("${auction.thread.maximumPoolSize:100}")
|
|
@@ -62,20 +66,17 @@ public class BidTask implements CacheMap {
|
|
|
private String userUrl;
|
|
private String userUrl;
|
|
|
|
|
|
|
|
private ThreadPoolExecutor threadPool;
|
|
private ThreadPoolExecutor threadPool;
|
|
|
- @Autowired
|
|
|
|
|
- private LotFansMapper lotFansMapper;
|
|
|
|
|
|
|
+
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private AppClient appClient;
|
|
private AppClient appClient;
|
|
|
- @Autowired
|
|
|
|
|
- private LotGroupMapper lotGroupMapper;
|
|
|
|
|
|
|
+
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private LotMapper lotMapper;
|
|
private LotMapper lotMapper;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private BidMapper bidMapper;
|
|
private BidMapper bidMapper;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private BidRecordMapper bidRecordMapper;
|
|
private BidRecordMapper bidRecordMapper;
|
|
|
- @Autowired
|
|
|
|
|
- IOrderStatusService orderStatusService;
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
// endregion
|
|
// endregion
|
|
|
|
|
|
|
@@ -164,32 +165,15 @@ public class BidTask implements CacheMap {
|
|
|
|
|
|
|
|
// region schedule tasks
|
|
// region schedule tasks
|
|
|
|
|
|
|
|
- /// 5s一次检查并处理即将过期的订单
|
|
|
|
|
- /*@Scheduled(fixedRate = 5000)
|
|
|
|
|
- public void expire() {
|
|
|
|
|
- lotFansMapper.selectLotFansList(LotFans.builder().type("pre_pay_expire").build()).forEach(fans -> {
|
|
|
|
|
- Lot lot = lotService.selectLotById(fans.getLotId());
|
|
|
|
|
- /// 如果当前时间大于 fans 对象的过期时间
|
|
|
|
|
- if (System.currentTimeMillis() > fans.getExpire().getTime()) {
|
|
|
|
|
- ///更新过期未支付
|
|
|
|
|
- lotService.updateExpire(fans);
|
|
|
|
|
- /// 通知直播平台更新商品状态
|
|
|
|
|
- appClient.noticeLiveLot(lot.getId());
|
|
|
|
|
- }else {
|
|
|
|
|
- lotService.updateSoldAndPaid(fans, lot.getGroupId());
|
|
|
|
|
- // 通知app更新商品
|
|
|
|
|
- appClient.noticeLiveLot(lot.getId());
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }*/
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 每5秒检查下订单状态,如订单已过期则更新拍品状态为
|
|
|
|
|
|
|
+ * 每5秒检查下订单状态,如订单已过期则更新拍品状态为流拍
|
|
|
*/
|
|
*/
|
|
|
@Scheduled(fixedRate = 5000)
|
|
@Scheduled(fixedRate = 5000)
|
|
|
public void expireOrder(){
|
|
public void expireOrder(){
|
|
|
//查询所有订单状态,如果订单超时未支付,更新拍品状态为流拍
|
|
//查询所有订单状态,如果订单超时未支付,更新拍品状态为流拍
|
|
|
- List<Order> orderList = orderStatusService.list();
|
|
|
|
|
|
|
+ List<Order> orderList = orderService.list();
|
|
|
for (Order order : orderList) {
|
|
for (Order order : orderList) {
|
|
|
Lot lot = lotMapper.selectLotById(order.getLotId());
|
|
Lot lot = lotMapper.selectLotById(order.getLotId());
|
|
|
if (System.currentTimeMillis() > order.getExpireTime().getTime()) {
|
|
if (System.currentTimeMillis() > order.getExpireTime().getTime()) {
|
|
@@ -205,12 +189,12 @@ public class BidTask implements CacheMap {
|
|
|
//更新拍品状态为流拍
|
|
//更新拍品状态为流拍
|
|
|
lotMapper.updateLot(Lot.builder().id(order.getLotId()).status(Constants.LOT_STATUS_PASS).build());
|
|
lotMapper.updateLot(Lot.builder().id(order.getLotId()).status(Constants.LOT_STATUS_PASS).build());
|
|
|
//更新订单标识为已处理
|
|
//更新订单标识为已处理
|
|
|
- orderStatusService.modifyOrder(Order.builder().orderNo(order.getOrderNo()).flag(1).expireTime(DateUtils.addDays(new Date(),1)).build());
|
|
|
|
|
|
|
+ orderService.modifyOrder(Order.builder().orderNo(order.getOrderNo()).flag(1).expireTime(DateUtils.addDays(new Date(),1)).build());
|
|
|
}else{
|
|
}else{
|
|
|
//订单状态已支付,更新拍品为成交状态
|
|
//订单状态已支付,更新拍品为成交状态
|
|
|
lotMapper.updatePay(order.getLotId(), 1);
|
|
lotMapper.updatePay(order.getLotId(), 1);
|
|
|
- lotGroupMapper.addSold(lot.getGroupId());
|
|
|
|
|
- orderStatusService.modifyOrder(Order.builder().orderNo(order.getOrderNo()).flag(2).build());
|
|
|
|
|
|
|
+
|
|
|
|
|
+ orderService.modifyOrder(Order.builder().orderNo(order.getOrderNo()).flag(2).build());
|
|
|
// 通知更新拍品信息
|
|
// 通知更新拍品信息
|
|
|
}
|
|
}
|
|
|
appClient.notice(lot.getId().toString(),"","{}","lot_auction","");
|
|
appClient.notice(lot.getId().toString(),"","{}","lot_auction","");
|
|
@@ -218,39 +202,12 @@ public class BidTask implements CacheMap {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- /// 每5s检查一次order_status查询flag=1,订单超时未支付状态并且已超过过期的时间的orderStatus然后将其移除
|
|
|
|
|
- @Scheduled(fixedRate = 5000)
|
|
|
|
|
- public void expirePay() {
|
|
|
|
|
- orderStatusService.orderStatusCheck();
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * 每5秒检查一次直播状态,并更新数据库中的直播信息
|
|
|
|
|
- */
|
|
|
|
|
- /*@Scheduled(fixedDelay = 5000)
|
|
|
|
|
- private void liveCheck(){
|
|
|
|
|
- // 查询需要检查直播状态为结束的直播ID列表
|
|
|
|
|
- List<Long> ids = lotGroupMapper.selectLiveCheck().stream().mapToLong(LotGroup::getLiveId).distinct().boxed().collect(Collectors.toList());
|
|
|
|
|
- if (!CollectionUtils.isEmpty(ids)) {
|
|
|
|
|
- // 通过App获取直播状态信息
|
|
|
|
|
- List<CardGroupLivesConfigVO> list = appClient.getLive(ids);
|
|
|
|
|
- if (!CollectionUtils.isEmpty(list)) {
|
|
|
|
|
- // 过滤出有效的直播ID
|
|
|
|
|
- List<Long> liveIds = list.stream()
|
|
|
|
|
- .filter(cardGroupLivesConfigVO -> Objects.nonNull(cardGroupLivesConfigVO.getId()))
|
|
|
|
|
- .mapToLong(CardGroupLivesConfigVO::getId)
|
|
|
|
|
- .boxed()
|
|
|
|
|
- .collect(Collectors.toList());
|
|
|
|
|
- if (!CollectionUtils.isEmpty(liveIds)) {
|
|
|
|
|
- // 更新数据库中的直播信息
|
|
|
|
|
- lotGroupMapper.updateClearLive(liveIds);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }*/
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 每1秒检查一次正在竞拍的拍品,并更新直播状态
|
|
|
|
|
|
|
+ * 每1秒检查一次正在竞拍的拍品,并更新拍卖状态
|
|
|
*/
|
|
*/
|
|
|
@Scheduled(fixedRate = 1000)
|
|
@Scheduled(fixedRate = 1000)
|
|
|
public void live() {
|
|
public void live() {
|
|
@@ -258,19 +215,19 @@ public class BidTask implements CacheMap {
|
|
|
lotService.selectBidding().forEach(lot -> {
|
|
lotService.selectBidding().forEach(lot -> {
|
|
|
// 根据拍品的拍卖ID生成Redis缓存键
|
|
// 根据拍品的拍卖ID生成Redis缓存键
|
|
|
String aucKey = String.format(Constants.REDIS_MAP_AUC_LOT_TEMPLATE, lot.getAuctionId());
|
|
String aucKey = String.format(Constants.REDIS_MAP_AUC_LOT_TEMPLATE, lot.getAuctionId());
|
|
|
- // 从Redis缓存中获取对应拍品的直播数据
|
|
|
|
|
|
|
+ // 从Redis缓存中获取对应拍品的数据
|
|
|
Live live = redisCache.getCacheMapValue(aucKey, lot.getId().toString());
|
|
Live live = redisCache.getCacheMapValue(aucKey, lot.getId().toString());
|
|
|
if (Objects.nonNull(live)) {
|
|
if (Objects.nonNull(live)) {
|
|
|
- // 将直播数据放入本地缓存中
|
|
|
|
|
|
|
+ // 将拍卖数据放入本地缓存中
|
|
|
liveCacheMap.computeIfAbsent(aucKey, s -> new ConcurrentHashMap<>())
|
|
liveCacheMap.computeIfAbsent(aucKey, s -> new ConcurrentHashMap<>())
|
|
|
.put(live.getLot().getId().toString(), live);
|
|
.put(live.getLot().getId().toString(), live);
|
|
|
- // 将直播任务提交到线程池中执行
|
|
|
|
|
|
|
+ // 将拍卖任务提交到线程池中执行
|
|
|
threadPool.submit(() -> {
|
|
threadPool.submit(() -> {
|
|
|
String currentStatus = ruleHandlerHolder.getCurrentStatus(live);
|
|
String currentStatus = ruleHandlerHolder.getCurrentStatus(live);
|
|
|
- // 如果当前状态不是拍品状态未开始,则返回
|
|
|
|
|
|
|
+ // 如果当前状态是拍品状态未开始,则返回
|
|
|
if (Objects.equals(Constants.LOT_STATUS_WAITING, currentStatus))
|
|
if (Objects.equals(Constants.LOT_STATUS_WAITING, currentStatus))
|
|
|
return;
|
|
return;
|
|
|
- // 尝试获取锁,并执行直播服务
|
|
|
|
|
|
|
+ // 尝试获取锁,并执行拍卖计算服务
|
|
|
locker.tryLock(String.format(Constants.REDIS_LOCK_LOT_TEMPLATE, live.getLot().getId()), () -> lotService.live(live));
|
|
locker.tryLock(String.format(Constants.REDIS_LOCK_LOT_TEMPLATE, live.getLot().getId()), () -> lotService.live(live));
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
@@ -279,36 +236,36 @@ public class BidTask implements CacheMap {
|
|
|
lotService.selectCancel().forEach(lot -> {
|
|
lotService.selectCancel().forEach(lot -> {
|
|
|
// 根据拍品的拍卖ID生成Redis缓存键
|
|
// 根据拍品的拍卖ID生成Redis缓存键
|
|
|
String aucKey = String.format(Constants.REDIS_MAP_AUC_LOT_TEMPLATE, lot.getAuctionId());
|
|
String aucKey = String.format(Constants.REDIS_MAP_AUC_LOT_TEMPLATE, lot.getAuctionId());
|
|
|
- // 从本地缓存中移除已取消的拍品的直播数据
|
|
|
|
|
|
|
+ // 从本地缓存中移除已取消的拍品的拍卖数据
|
|
|
liveCacheMap.computeIfAbsent(aucKey, s -> new ConcurrentHashMap<>())
|
|
liveCacheMap.computeIfAbsent(aucKey, s -> new ConcurrentHashMap<>())
|
|
|
.remove(lot.getId().toString());
|
|
.remove(lot.getId().toString());
|
|
|
});
|
|
});
|
|
|
- // 遍历本地缓存中的所有直播数据
|
|
|
|
|
|
|
+ // 遍历本地缓存中的所有拍卖数据
|
|
|
for (String aucKey : liveCacheMap.keySet()) {
|
|
for (String aucKey : liveCacheMap.keySet()) {
|
|
|
ConcurrentHashMap<String, Live> map = liveCacheMap.get(aucKey);
|
|
ConcurrentHashMap<String, Live> map = liveCacheMap.get(aucKey);
|
|
|
List<String> lotIds = Lists.newArrayList();
|
|
List<String> lotIds = Lists.newArrayList();
|
|
|
- // 遍历所有直播数据,检查是否有过期的直播
|
|
|
|
|
|
|
+ // 遍历所有拍卖数据,检查是否有过期的拍卖
|
|
|
map.values().forEach(live -> {
|
|
map.values().forEach(live -> {
|
|
|
- // 如果当前时间超过直播结束时间3秒,则将该拍品ID添加到移除列表中
|
|
|
|
|
|
|
+ // 如果当前时间超过拍卖结束时间3秒,则将该拍品ID添加到移除列表中
|
|
|
if (live.getCurrentEndTime() + 3000 < System.currentTimeMillis()) {
|
|
if (live.getCurrentEndTime() + 3000 < System.currentTimeMillis()) {
|
|
|
lotIds.add(live.getLot().getId().toString());
|
|
lotIds.add(live.getLot().getId().toString());
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
- // 移除过期的直播数据
|
|
|
|
|
|
|
+ // 移除过期的拍卖数据
|
|
|
lotIds.forEach(map::remove);
|
|
lotIds.forEach(map::remove);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 每5分钟检查一次已结束的直播,并清理相关数据
|
|
|
|
|
|
|
+ * 每5分钟检查一次已结束的拍卖,并移除缓存
|
|
|
*/
|
|
*/
|
|
|
@Scheduled(fixedRate = 5 * 60 * 1000)
|
|
@Scheduled(fixedRate = 5 * 60 * 1000)
|
|
|
public void delFinishLive() {
|
|
public void delFinishLive() {
|
|
|
- // 遍历所有正在直播的拍卖
|
|
|
|
|
|
|
+ // 遍历所有正在拍卖的拍卖会
|
|
|
auctionService.live().forEach(auction -> {
|
|
auctionService.live().forEach(auction -> {
|
|
|
// 根据拍卖ID生成Redis缓存键
|
|
// 根据拍卖ID生成Redis缓存键
|
|
|
String aucKey = String.format(Constants.REDIS_MAP_AUC_LOT_TEMPLATE, auction.getId());
|
|
String aucKey = String.format(Constants.REDIS_MAP_AUC_LOT_TEMPLATE, auction.getId());
|
|
|
- // 从Redis缓存中获取对应拍卖的直播数据Map
|
|
|
|
|
|
|
+ // 从Redis缓存中获取对应拍卖的数据Map
|
|
|
Map<String, Live> auctionMap = redisCache.getCacheMap(aucKey);
|
|
Map<String, Live> auctionMap = redisCache.getCacheMap(aucKey);
|
|
|
// 遍历所有直播数据
|
|
// 遍历所有直播数据
|
|
|
auctionMap.values().forEach(live -> {
|
|
auctionMap.values().forEach(live -> {
|
|
@@ -331,12 +288,18 @@ public class BidTask implements CacheMap {
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 每秒更新拍卖会状态
|
|
|
|
|
+ */
|
|
|
|
|
+ @Scheduled(fixedRate = 1000)
|
|
|
|
|
+ public void auction(){
|
|
|
|
|
+ auctionService.auctionLive();
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 每1秒检查一次拍卖状态,并将缓存中未写入数据库的bid数据写入数据库
|
|
* 每1秒检查一次拍卖状态,并将缓存中未写入数据库的bid数据写入数据库
|
|
|
*/
|
|
*/
|
|
|
- @Scheduled(fixedDelay = 1 * 1 * 1000)
|
|
|
|
|
|
|
+ @Scheduled(fixedDelay = 1000)
|
|
|
private void auctionLotCheck(){
|
|
private void auctionLotCheck(){
|
|
|
lotService.selectBidding().forEach(lot -> {
|
|
lotService.selectBidding().forEach(lot -> {
|
|
|
List<Bid> bidList = redisCache.getCacheList(String.format(Constants.REDIS_MAP_AUC_LOT_BID_LIST_PREFIX, lot.getId()));
|
|
List<Bid> bidList = redisCache.getCacheList(String.format(Constants.REDIS_MAP_AUC_LOT_BID_LIST_PREFIX, lot.getId()));
|
|
@@ -366,5 +329,68 @@ public class BidTask implements CacheMap {
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ //拍卖会结束发起退保证金,每五分钟执行一次
|
|
|
|
|
+ @Scheduled(fixedRate = 1000*60*5)
|
|
|
|
|
+ public void depositOrderRefund(){
|
|
|
|
|
+ //查询已支付待退款的保证金订单
|
|
|
|
|
+ DepositOrder depositOrder = new DepositOrder();
|
|
|
|
|
+ depositOrder.setStatus(1);
|
|
|
|
|
+ List<DepositOrder> depositOrderList = depositOrderService.selectDepositOrder(depositOrder);
|
|
|
|
|
+ for (DepositOrder order : depositOrderList) {
|
|
|
|
|
+ Long userId = order.getUserId();
|
|
|
|
|
+ //判断拍卖会是否已结束
|
|
|
|
|
+ Auction auction = auctionService.selectAuctionById(order.getAuctionId());
|
|
|
|
|
+ if (!Constants.GROUP_STATUS_FINISH.equals(auction.getStatus())){
|
|
|
|
|
+ //如果拍卖会未结束,处理下一个保证金订单
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (StringUtils.equals("拍卖会",order.getDepositType())){
|
|
|
|
|
+
|
|
|
|
|
+ //判断是否有未结束的未设置单独保证金的拍品
|
|
|
|
|
+ List<Lot> lots = lotMapper.selectNotEndLotList(order.getAuctionId());
|
|
|
|
|
+ if (!CollectionUtils.isEmpty(lots))
|
|
|
|
|
+ continue;
|
|
|
|
|
+ //拍卖会保证金,查询用户在该拍卖会下是否有非单独保证金的拍品中标未支付订单
|
|
|
|
|
+ List<Order> orderList = orderService.getOrderListByUserAndAuction(order.getAuctionId(), userId);
|
|
|
|
|
+ if (CollectionUtils.isEmpty(orderList)){
|
|
|
|
|
+ //todo 没有待支付订单,或没中标,或已支付,执行退保证金操作
|
|
|
|
|
+ OrderVO orderVO = depositOrderService.refundDepositOrder(order.getOrderNo());
|
|
|
|
|
+ // todo 更新保证金订单状态
|
|
|
|
|
+
|
|
|
|
|
+ depositOrderService.lambdaUpdate().eq(DepositOrder::getId,order.getId()).set(DepositOrder::getStatus,orderVO.getStatus());
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+ //有待支付的订单列表,判断订单是否已过期,并更新订单记录表状态,
|
|
|
|
|
+ for (Order order1 : orderList) {
|
|
|
|
|
+ if (order1.getFlag()==2){
|
|
|
|
|
+ //todo 订单待支付已过期,调用扣除保证金接口,更新订单记录表状态
|
|
|
|
|
+
|
|
|
|
|
+ // todo 更新保证金订单状态
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }else{
|
|
|
|
|
+ Long lotId = order.getLotId();
|
|
|
|
|
+ //查询拍品是否已结束,未结束则跳过
|
|
|
|
|
+ Lot lot = lotMapper.selectLotById(lotId);
|
|
|
|
|
+ if (StringUtils.equalsAny(lot.getStatus(), Constants.LOT_STATUS_WAITING, Constants.LOT_STATUS_STARTING, Constants.LOT_STATUS_BIDDING))
|
|
|
|
|
+ continue;
|
|
|
|
|
+
|
|
|
|
|
+ //已结束,查询用户是否有该拍品的订单,
|
|
|
|
|
+ LambdaQueryWrapper<Order> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
+ queryWrapper.eq(Order::getLotId,lotId).eq(Order::getUserId,order.getUserId());
|
|
|
|
|
+ Order order1 = orderService.getOne(queryWrapper);
|
|
|
|
|
+
|
|
|
|
|
+ if (order1==null){
|
|
|
|
|
+ //todo 未中标,退拍品保证金
|
|
|
|
|
+
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (order1.getFlag()==2){
|
|
|
|
|
+ //todo 订单已过期 调用接口扣除保证金
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
// endregion
|
|
// endregion
|
|
|
}
|
|
}
|