|
|
@@ -197,15 +197,20 @@ public class AuctionOrderService {
|
|
|
|
|
|
public void notify(Long id, PayMethod payMethod, String transactionId) {
|
|
|
AuctionOrder order = auctionOrderRepo.findById(id).orElseThrow(new BusinessException("无记录"));
|
|
|
- order.setStatus(AuctionOrderStatus.FINISH);
|
|
|
+ AuctionActivity auction = auctionActivityRepo.findById(order.getAuctionId())
|
|
|
+ .orElseThrow(new BusinessException("无拍卖活动"));
|
|
|
+
|
|
|
+ if (auction.getAuctionType().equals(AuctionType.ENTITY)) {
|
|
|
+ order.setStatus(AuctionOrderStatus.DELIVERY);
|
|
|
+ } else {
|
|
|
+ order.setStatus(AuctionOrderStatus.FINISH);
|
|
|
+ }
|
|
|
order.setPayMethod(payMethod);
|
|
|
order.setTransactionId(transactionId);
|
|
|
order.setPayTime(LocalDateTime.now());
|
|
|
//存订单
|
|
|
auctionOrderRepo.save(order);
|
|
|
|
|
|
- AuctionActivity auction = auctionActivityRepo.findById(order.getAuctionId())
|
|
|
- .orElseThrow(new BusinessException("无拍卖活动"));
|
|
|
|
|
|
if (AuctionPaymentType.DEPOSIT.equals(order.getPaymentType())) {
|
|
|
//改出价记录表
|
|
|
@@ -355,4 +360,28 @@ public class AuctionOrderService {
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 发货
|
|
|
+ *
|
|
|
+ * @param id 编号
|
|
|
+ * @param courierId 快递单号
|
|
|
+ */
|
|
|
+ public void dispatch(Long id, String courierId) {
|
|
|
+ AuctionOrder auctionOrder = auctionOrderRepo.findById(id).orElseThrow(new BusinessException("铸造订单不存在"));
|
|
|
+ auctionOrder.setStatus(AuctionOrderStatus.RECEIVE);
|
|
|
+ auctionOrder.setCourierId(courierId);
|
|
|
+ auctionOrderRepo.save(auctionOrder);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 订单
|
|
|
+ *
|
|
|
+ * @param id 编号
|
|
|
+ */
|
|
|
+ public void finish(Long id) {
|
|
|
+ AuctionOrder auctionOrder = auctionOrderRepo.findById(id).orElseThrow(new BusinessException("铸造订单不存在"));
|
|
|
+ auctionOrder.setStatus(AuctionOrderStatus.FINISH);
|
|
|
+ auctionOrderRepo.save(auctionOrder);
|
|
|
+ }
|
|
|
}
|