Commit b40e1d81 authored by Quxl's avatar Quxl

x

parent c37d3cfc
......@@ -12,7 +12,7 @@ public interface CinemaService {
List<Map<String, Object>> getCinemaList(String keyword, Page page);
void setTmpData(Integer showtimeId);
void setTmpData(Integer cinemaId);
List<Map<String, Object>> queryShowtimeList(Integer cinemaId);
......
......@@ -52,14 +52,12 @@ public class CinemaServiceImpl implements CinemaService {
}
@Override
public void setTmpData(Integer showtimeId) {
String sql = "select cinema_id from fc_cinema_showtime where id = ?";
Integer cinema_id = jdbcTemplate.queryForInt(sql, showtimeId);
public void setTmpData(Integer cinemaId) {
String sql_tmp_count_show = "select count(*) from fc_cinema_showtime where cinema_id = ? and showtime_no is not null and showtime_no != '' and status = 0";
Integer tmp_count_show = jdbcTemplate.queryForInt(sql_tmp_count_show, cinema_id);
Integer tmp_count_show = jdbcTemplate.queryForInt(sql_tmp_count_show, cinemaId);
String sql_tmp_count_film = "select count(film_id) from fc_cinema_showtime where cinema_id = ? and film_id is not null and status = 0 group by film_id";
Integer tmp_count_film = jdbcTemplate.queryForInt(sql_tmp_count_film, cinema_id);
jdbcTemplate.executeUpdate("update fc_cinema set tmp_count_show = ?, tmp_count_film = ? where id = ?", tmp_count_show, tmp_count_film, cinema_id);
Integer tmp_count_film = jdbcTemplate.queryForInt(sql_tmp_count_film, cinemaId);
jdbcTemplate.executeUpdate("update fc_cinema set tmp_count_show = ?, tmp_count_film = ? where id = ?", tmp_count_show, tmp_count_film, cinemaId);
}
@Override
......
......@@ -116,7 +116,8 @@ public class CinemaController {
@ApiOperation("保存场次信息")
public Object updateShowtime(Fc_cinema_showtime_model showtimeModel) {
common.update(showtimeModel);
service.setTmpData(showtimeModel.getId());
Fc_cinema_showtime showtime = common.queryById(showtimeModel.getId(), Fc_cinema_showtime.class);
service.setTmpData(showtime.getCinema_id());
return Rjx.jsonOk();
}
......@@ -158,6 +159,7 @@ public class CinemaController {
@ApiOperation("删除排片时间(按播放时间彻底删除)")
public Object deleteShowtimeByShowtime(Integer cinema_id, String show_time) {
service.deleteShowtimeByShowtime(cinema_id, show_time);
service.setTmpData(cinema_id);
return Rjx.jsonOk();
}
......@@ -166,6 +168,7 @@ public class CinemaController {
@ApiOperation("删除排片时间(按播放日期彻底删除)")
public Object deleteShowtimeByShowdate(Integer cinema_id, @DateTimeFormat(pattern="yyyy-MM-dd")Date show_date) {
service.deleteShowtimeByShowdate(cinema_id, show_date);
service.setTmpData(cinema_id);
return Rjx.jsonOk();
}
......@@ -174,6 +177,8 @@ public class CinemaController {
@ApiOperation("删除单个场次(逻辑删除)")
public Object deleteShowtimeById(Integer id) {
service.deleteShowtimeById(id);
Fc_cinema_showtime showtime = common.queryById(id, Fc_cinema_showtime.class);
service.setTmpData(showtime.getCinema_id());
return Rjx.jsonOk();
}
}
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