|
|
@@ -1,11 +1,12 @@
|
|
|
package com.example.cinema.blImpl.management;
|
|
|
|
|
|
import com.example.cinema.bl.management.MovieService;
|
|
|
-import com.example.cinema.data.user.AccountMapper;
|
|
|
+import com.example.cinema.bl.management.ScheduleService;
|
|
|
+import com.example.cinema.blImpl.management.schedule.MovieServiceForSchedule;
|
|
|
+import com.example.cinema.blImpl.management.schedule.ScheduleServiceForMovie;
|
|
|
import com.example.cinema.data.statistics.MovieLikeMapper;
|
|
|
import com.example.cinema.data.management.MovieMapper;
|
|
|
|
|
|
-import com.example.cinema.data.management.ScheduleMapper;
|
|
|
import com.example.cinema.vo.MovieBatchOffForm;
|
|
|
import com.example.cinema.vo.MovieForm;
|
|
|
import com.example.cinema.vo.ResponseVO;
|
|
|
@@ -22,7 +23,7 @@ import java.util.List;
|
|
|
* @date 2019/3/12 6:43 PM
|
|
|
*/
|
|
|
@Service
|
|
|
-public class MovieServiceImpl implements MovieService {
|
|
|
+public class MovieServiceImpl implements MovieService, MovieServiceForSchedule {
|
|
|
|
|
|
private static final String ALREADY_LIKE_ERROR_MESSAGE = "用户已标记该电影为想看";
|
|
|
private static final String UNLIKE_ERROR_MESSAGE = "用户未标记该电影为想看";
|
|
|
@@ -34,10 +35,10 @@ public class MovieServiceImpl implements MovieService {
|
|
|
private MovieMapper movieMapper;
|
|
|
@Autowired
|
|
|
private MovieLikeMapper movieLikeMapper;
|
|
|
+
|
|
|
+
|
|
|
@Autowired
|
|
|
- private AccountMapper accountMapper;
|
|
|
- @Autowired
|
|
|
- private ScheduleMapper scheduleMapper;
|
|
|
+ private ScheduleServiceForMovie scheduleService;
|
|
|
|
|
|
@Override
|
|
|
public ResponseVO addMovie(MovieForm addMovieForm) {
|
|
|
@@ -50,6 +51,17 @@ public class MovieServiceImpl implements MovieService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public ResponseVO searchOneMovieById(int id) {
|
|
|
+ try {
|
|
|
+ return ResponseVO.buildSuccess(movieMapper.selectMovieById(id));
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ return ResponseVO.buildFailure("失败");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public ResponseVO searchOneMovieByIdAndUserId(int id, int userId) {
|
|
|
try {
|
|
|
@@ -180,7 +192,7 @@ public class MovieServiceImpl implements MovieService {
|
|
|
*/
|
|
|
public ResponseVO preCheck(List<Integer> movieIdList){
|
|
|
Date thisTime = new Date();
|
|
|
- List<ScheduleItem> scheduleItems = scheduleMapper.selectScheduleByMovieIdList(movieIdList);
|
|
|
+ List<ScheduleItem> scheduleItems = scheduleService.selectScheduleByMovieIdList(movieIdList);
|
|
|
|
|
|
// 检查是否有电影后续有排片及是否有观众购票未使用
|
|
|
for(ScheduleItem s : scheduleItems){
|