Commit ebbf4d01 authored by Quxl's avatar Quxl

x

parent ef7bbd29
......@@ -110,14 +110,12 @@ public class CinemaServiceImpl implements CinemaService {
public void setShowtimeNo(Integer showtimeId) {
Fc_cinema_showtime showtime = common.queryById(showtimeId, Fc_cinema_showtime.class);
if(showtime.getShowtime_no() == null) {
Integer max_showtime_no = this.queryMaxShowtimeNoByCinemaId(showtimeId);
Integer nextNo = null;
Integer max_showtime_no = this.queryMaxShowtimeNoByCinemaId(showtime.getCinema_id());
if(max_showtime_no == null) {
Fc_cinema cinema = common.queryById(showtime.getCinema_id(), Fc_cinema.class);
nextNo = Integer.valueOf(cinema.getCinema_no()) * 10000;
} else {
nextNo = max_showtime_no + 1;
max_showtime_no = Integer.valueOf(cinema.getCinema_no()) * 10000;
}
Integer nextNo = max_showtime_no + 1;
jdbcTemplate.executeUpdate("update fc_cinema_showtime set showtime_no = ? where id = ?", nextNo, showtimeId);
}
}
......
......@@ -125,9 +125,8 @@ public class CinemaController {
Fc_cinema cinema = common.queryById(cinema_id, Fc_cinema.class);
String cinema_no = cinema.getCinema_no();
Integer max_showtime_no = service.queryMaxShowtimeNoByCinemaId(cinema_id);
Integer nextShowtimeNo = Integer.valueOf(cinema_no) * 10000;
if(max_showtime_no != null) {
nextShowtimeNo = max_showtime_no + 1;
if(max_showtime_no == null) {
max_showtime_no = Integer.valueOf(cinema_no) * 10000;
}
List<Object> list = new ArrayList<Object>();
for(Date date : show_date) {
......@@ -141,7 +140,7 @@ public class CinemaController {
showtime.setTicket_price(new BigDecimal(ticket_price));
showtime.setIs_important(is_important);
if(StringUtil.isNotBlank(ticket_price) || is_important != null) {
showtime.setShowtime_no(nextShowtimeNo++);
showtime.setShowtime_no(++max_showtime_no);
}
list.add(showtime);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment