Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ public TicketPurchaseRespDTO purchaseTicketsV2(PurchaseTicketReqDTO requestParam
List<RLock> distributedLockList = new ArrayList<>();
Map<Integer, List<PurchaseTicketPassengerDetailDTO>> seatTypeMap = requestParam.getPassengers().stream()
.collect(Collectors.groupingBy(PurchaseTicketPassengerDetailDTO::getSeatType));
seatTypeMap.forEach((searType, count) -> {
seatTypeMap.keySet().stream().sorted().forEach((searType) -> {
String lockKey = environment.resolvePlaceholders(String.format(LOCK_PURCHASE_TICKETS_V2, requestParam.getTrainId(), searType));
ReentrantLock localLock = localLockMap.getIfPresent(lockKey);
if (localLock == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ public static List<RouteDTO> takeoutStation(List<String> stations, String startS
if (startIndex == -1 || endIndex == -1 || startIndex >= endIndex) {
return takeoutStationList;
}
if (startIndex != 0) {
for (int i = 0; i < startIndex; i++) {
for (int j = 1; j < stations.size() - startIndex; j++) {
takeoutStationList.add(new RouteDTO(stations.get(i), stations.get(startIndex + j)));
}
// 发车在 startStation 之前的 route
for (int i = 0; i < startIndex; i++) {
for (int j = startIndex + 1; j < stations.size(); j++) {
takeoutStationList.add(new RouteDTO(stations.get(i), stations.get(j)));
}
}
for (int i = startIndex; i <= endIndex; i++) {
for (int j = i + 1; j < stations.size() && i < endIndex; j++) {
// 发车在 startStation 及之后的 route
for (int i = startIndex; i < endIndex; i++) {
for (int j = i + 1; j < stations.size(); j++) {
takeoutStationList.add(new RouteDTO(stations.get(i), stations.get(j)));
}
}
Expand Down