기록
  • 0409 작업일지
    2024년 04월 10일 00시 44분 42초에 업로드 된 글입니다.
    작성자: 삶은고구마

    1.

    파이널 프로젝트 때 극장에서 상영하는 영화관 스케쥴을 담당했던 팀원의 작업물을 점검했다.

    원하는 날짜에 현재시간보다 미래인(앞으로의 스케쥴만) 상영 스케쥴만 출력하는 nativeQuery문이다.

    과거의 상영스케쥴은 예매를 할 수 없으므로 이렇게 설계했다.

     

    이 쪽은 다른 팀원들도 터치하지 않아서 문제 될 게 없었는데

    최근에 db 조회를 하려고 하니 뜻하지 않게 실행되지 않았다.

    미래의 상영 스케쥴을 db에 insert-commit 했는데도 단 하나도!!! 출력이 되지 않는 것이다..

    이상현상을 해결하기 위해 날짜,시간조건을 제외하고 마지막 where절에

    201(강남지점 영화관 id)만 조건을 걸었는데도 과거 스케쥴 8,9개중 3개만 출력이 되었다.

    뭐가 문제인가 싶어 쿼리문의 조인값 하나하나 대조하여 재실행 해봤는데 정상적으로 실행됨..;

     

     @Query(value = """
            SELECT
                m.id AS movieId,
                c.id AS cinemaId,
                s.id AS schId,
                s.sch_date AS schDate,
                c.region_cinema AS regionCinema,
                m.film_ratings AS filmRatings,
                m.title AS movieTitle,
                m.runtime AS runningTime,
                t.name AS theaterName,
                s.time AS startTime,
                (t.seat - (SELECT COUNT(*)
                           FROM reservation_seat rs
                           WHERE rs.res_id IN (SELECT r.id
                                               FROM reservation r
                                               WHERE r.schedule_id = s.id))) AS remainingSeats
            FROM cinema c
            JOIN theater t ON t.cinema_id = c.id
            JOIN schedule s ON s.theater_id = t.id
            JOIN movie_list ml ON ml.cinema_id = c.id
            JOIN movie m ON m.id = ml.movie_id AND m.id = s.movie_id
            WHERE (c.id = :id AND s.sch_date = :schDate) AND s.time > CURRENT_TIMESTAMP """, nativeQuery = true)
        List<IScheduleInfoDto> findScheduleDetailsByDateAndCinemaId(@Param("id") Long id,
                                                                    @Param("schDate") LocalDate schDate);

     

     

     

    2.

    팀원 두 명이 영화 api 관련 추가 작업을 함.

    작업물을 넘겨받고 예매 담당인 내가 이어서 작업을 진행하였다.

    아래는 reservatonBooking.html의 일부분이다.

    이 html은 예매 메인페이지 역할을 한다.

    대형 영화관 3사의 예매페이지를 참고하여 어떤 정보를 출력해야하나 공부했다.

    1.영화 리스트

    2.모든 지점 리스트

    3.오늘부터 2주간의 날짜(14일)리스트

    4.앞의 3개의 조건에 해당하는 상영 일정 출력 리스트

    이렇게 4개의 테이블로 구성하였으며, 영화 api를 작업한 팀원 코드에 맞춰 일부를 수정하였다.

    영화제목,포스터,관람등급 등 변수명이 싹 다 바뀌어서 고치는데 쉽지 않았다.

    테이블에서 행을 클릭시 js 함수를 통해 html 최하단에 제목,포스터를 출력해야 하는데 이부분도 수정함.

    <!-- 4개의 영역을 감싸는 최상단 div -->
        <div class = "info-movies">
    
            <table class="movieData-area">
                <thead>
                <tr>
                    <th colspan="2">영화 리스트</th>
                </tr>
                </thead>
                <tbody>
    <!--         0326 - movieData를 movie로 수정하기.   -->
                <tr th:each="movie, status : ${dataMap.movies}">
    <!--                0326 기존은 movie.poster였는데 에러가 발생함. posterUrl로 변경해보자..-->
    
    <!--                <th:block th:if="${#strings.startsWith(movie.posterUrl, 'http://file.koreafilm.or.kr')}">-->
    <!--                    <img th:src="${movie.posterUrl}" th:alt="${movie.title}">-->
    <!--                </th:block>-->
    
    <!--                <th:block th:if="${!#strings.startsWith(movie.posterUrl, 'http://file.koreafilm.or.kr')}">-->
                    <!-- 사이트에서 포스터 이미지를 가져오는 방법. 주소+movie.posterUrl -->
    <!--                    <img th:src="|https://image.tmdb.org/t/p/w200${movie.posterUrl}|" th:alt="${movie.title}">-->
    
    
                    </th:block>
                    <td class="select-movieData"
                        th:data-poster="${movie.posterUrl}"
                        th:data-title="${movie.title}"
                        th:attr="data-movieData-id=${movie.id}"
                        onclick="showPoster(this.getAttribute('data-poster'), this.getAttribute('data-title'))">
    
                        <th:block th:if="|${movie.filmRatings == '전체관람가'}|">
                            <span style="font-size: 0.4em" class="grade bg-gradient-to-r bg-green-100 text-green-800 text-m font-bold me-2 px-2.5 py-0.5 rounded dark:bg-gray-700 dark:text-green-400 border border-green-400">ALL</span>
                        </th:block>
                        <th:block th:if="|${movie.filmRatings == '12세관람가'}|">
                            <span style="font-size: 0.4em" class="grade bg-gradient-to-r bg-yellow-100 text-yellow-800 text-l font-bold me-2 px-2.5 py-0.5 rounded dark:bg-gray-700 dark:text-yellow-300 border border-yellow-300">12</span>
                        </th:block>
                        <th:block th:if="|${movie.filmRatings == '15세관람가'}|">
                            <span style="font-size: 0.4em" class="grade bg-gradient-to-r bg-purple-100 text-purple-800 text-l font-bold me-2 px-2.5 py-0.5 rounded dark:bg-gray-700 dark:text-purple-400 border border-purple-400">15</span>
                        </th:block>
                        <th:block th:if="|${movie.filmRatings == '18세관람가(청소년관람불가)'}|">
                            <span style="font-size: 0.4em" class="grade bg-gradient-to-r bg-red-100 text-red-800 text-l font-bold me-2 px-2.5 py-0.5 rounded dark:bg-gray-700 dark:text-red-400 border border-red-400">18</span>
                        </th:block>
                        <th:block th:if="|${movie.filmRatings == '정보 없음'}|">
                            <span style="font-size: 0.2em" class="grade bg-gradient-to-r shadow-lg shadow-gray-100/50 bg-gray-100 text-gray-800 text-l font-bold me-2 px-2.5 py-0.5 rounded dark:bg-gray-700 dark:text-gray-400 border border-gray-500">미정</span>
                        </th:block>
                        <button
                                th:text="${#strings.abbreviate(movie.title, 12)}">
                        </button>
                    </td>
    
    
                </tr>
                </tbody>
            </table>

     

     

    3.

    위의 영화,지역,날짜 조건에 해당하는 상영스케쥴이 있는경우 상영값은 올바르게 출력되지만

    css 작업이 꼬인건지 테이블 크기가 멋대로 변경된다.

    상영시간표 크기가 들쑥날쑥해서 확인해보니 값이 없을 땐 회색부분이었다가,

    값이 존재하면 파란배경만큼 확장된다.

    배경값을 따로 지정해보니 어디가 문제인지 시각적으로 확인이 된다.

    일단 width부터 줄이고 그다음엔 height를 손봐야겠다.(다른 테이블처럼 스크롤이 되도록)

    '공부' 카테고리의 다른 글

    0421 작업일지  (0) 2024.04.21
    0416 작업일지  (0) 2024.04.16
    국비 파이널 프로젝트 향후 계획  (0) 2024.04.09
    0226  (0) 2024.02.26
    0221 war jar test전  (0) 2024.02.21
    댓글