|
@@ -16,10 +16,7 @@ import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.text.ParseException;
|
|
import java.text.ParseException;
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
-import java.util.ArrayList;
|
|
|
|
-import java.util.Calendar;
|
|
|
|
-import java.util.Date;
|
|
|
|
-import java.util.List;
|
|
|
|
|
|
+import java.util.*;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@Component("siteTask")
|
|
@Component("siteTask")
|
|
@@ -125,7 +122,7 @@ public class SiteTask {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
if (!ids.isEmpty()) {
|
|
if (!ids.isEmpty()) {
|
|
- ticketService.updateTicketStatus(ids);
|
|
|
|
|
|
+ ticketService.updateTicketStatus(ids, "3");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -138,15 +135,32 @@ public class SiteTask {
|
|
// 获取当前时间
|
|
// 获取当前时间
|
|
Date now = new Date();
|
|
Date now = new Date();
|
|
// 筛选出需要更新的订单
|
|
// 筛选出需要更新的订单
|
|
- List<String> orderIdsToUpdate = paidOrders.stream()
|
|
|
|
- .filter(order -> now.after(order.getRefund())) // 当前时间大于refund时间
|
|
|
|
- .map(BootACourse::getOrderId) // 获取订单ID
|
|
|
|
|
|
+// List<String> orderIdsToUpdate = paidOrders.stream()
|
|
|
|
+// .filter(order -> now.after(order.getRefund())) // 当前时间大于refund时间
|
|
|
|
+// .map(BootACourse::getOrderId) // 获取订单ID
|
|
|
|
+// .collect(Collectors.toList());
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ Map<Boolean, List<BootACourse>> partitionedOrders = paidOrders.stream()
|
|
|
|
+ .collect(Collectors.partitioningBy(order -> now.after(order.getRefund())));
|
|
|
|
+
|
|
|
|
+ List<String> orderIdsToUpdate = partitionedOrders.get(true).stream()
|
|
|
|
+ .map(BootACourse::getOrderId)
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
+
|
|
|
|
+ List<String> ticketIdsToUpdate = partitionedOrders.get(true).stream()
|
|
|
|
+ .map(BootACourse::getTicketId)
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
// 批量更新订单状态为已核销
|
|
// 批量更新订单状态为已核销
|
|
if (!orderIdsToUpdate.isEmpty()) {
|
|
if (!orderIdsToUpdate.isEmpty()) {
|
|
courseMapper.updateOrderStatusToVerification(orderIdsToUpdate);
|
|
courseMapper.updateOrderStatusToVerification(orderIdsToUpdate);
|
|
}
|
|
}
|
|
|
|
+ // 批量更新门票状态为已核销
|
|
|
|
+ if (!orderIdsToUpdate.isEmpty()) {
|
|
|
|
+ //核销订单的同时, 更新门票信息状态
|
|
|
|
+ ticketService.updateTicketStatus(ticketIdsToUpdate, "4");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|