|
|
@@ -1,6 +1,5 @@
|
|
|
package com.example.cinema.blImpl;
|
|
|
|
|
|
-import com.example.cinema.bl.CouponService;
|
|
|
import com.example.cinema.bl.TicketService;
|
|
|
import com.example.cinema.data.CouponMapper;
|
|
|
import com.example.cinema.data.ScheduleMapper;
|
|
|
@@ -15,7 +14,6 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
-import java.util.Collections;
|
|
|
import java.util.List;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@@ -97,7 +95,11 @@ public class TicketServiceImpl implements TicketService {
|
|
|
@Override
|
|
|
public ResponseVO getTicketByUser(int userId) {
|
|
|
try {
|
|
|
- List<TicketVO> vos = ticketMapper.selectTicketByUser(userId).stream().map(ticket -> ticket.getVO()).collect(Collectors.toList());
|
|
|
+ List<TicketWithScheduleVO> vos = ticketMapper.selectTicketByUser(userId).stream().map(ticket -> {
|
|
|
+ TicketWithScheduleVO vo=ticket.getWithScheduleVO();
|
|
|
+ vo.setSchedule(scheduleMapper.selectScheduleById(ticket.getScheduleId()));
|
|
|
+ return vo;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
return ResponseVO.buildSuccess(vos);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|