diff --git a/src/main/java/club/joylink/rtss/services/race/RaceSceneService.java b/src/main/java/club/joylink/rtss/services/race/RaceSceneService.java index cc9555a9f..52ade792b 100644 --- a/src/main/java/club/joylink/rtss/services/race/RaceSceneService.java +++ b/src/main/java/club/joylink/rtss/services/race/RaceSceneService.java @@ -139,12 +139,13 @@ public class RaceSceneService { } public void delete(Long id) { + + RacetrTaskExample taskExample = new RacetrTaskExample(); + taskExample.createCriteria().andSceneIdEqualTo(id); + long bindTaskCount = this.taskDAO.countByExample(taskExample); + BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(bindTaskCount <= 0, "此场景已被任务绑定不能删除"); RacetrScene rs = this.findById(id); this.removeObj(rs); -// RacetrTaskExample taskExample = new RacetrTaskExample(); -// taskExample.createCriteria().andSceneIdEqualTo(id); -// long bindTaskCount = this.taskDAO.countByExample(taskExample); -// BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(bindTaskCount <= 0, "此场景已被任务绑定不能删除"); this.sceneDAO.deleteByPrimaryKey(id); }