licailing 4 年之前
父節點
當前提交
c574e55763

+ 13 - 0
src/main/java/com/izouma/wenlvju/service/PerformanceApplyService.java

@@ -242,4 +242,17 @@ public class PerformanceApplyService {
         apply.setScore(scores1);
         performanceApplyRepo.save(apply);
     }
+
+    /*
+    获取相关
+     */
+    public List<PerformanceApply> related(Long id) {
+        PerformanceApply apply = performanceApplyRepo.findById(id).orElseThrow(new BusinessException("无记录"));
+        List<PerformanceApply> applies = performanceApplyRepo.findAllByStatusAndPerformanceId(ApplyStatus.PASS, apply
+                .getPerformanceId());
+        return applies.stream()
+                .filter(app -> app.getShowStartTime().isAfter(apply.getShowStartTime()))
+                .sorted(Comparator.comparing(PerformanceApply::getShowStartTime))
+                .collect(Collectors.toList());
+    }
 }

+ 6 - 0
src/main/java/com/izouma/wenlvju/web/PerformanceApplyController.java

@@ -102,5 +102,11 @@ public class PerformanceApplyController extends BaseController {
     public Map<String, String> getAuth(Long id, String phone) {
         return performanceApplyService.getAuth(id, phone);
     }
+
+    @ApiOperation("获取当前节目后续列表")
+    @PostMapping("/related")
+    public List<PerformanceApply> related(Long id) {
+        return performanceApplyService.related(id);
+    }
 }