Quellcode durchsuchen

修改禁用的课程属性,在新建蓝图结构时仍然可以看到的bug

weiwenhai vor 7 Jahren
Ursprung
Commit
d0702702b8

+ 3 - 0
cqb-question-resource/src/main/java/com/qmth/cqb/question/dao/CoursePropertyRepo.java

@@ -27,5 +27,8 @@ public interface CoursePropertyRepo extends JpaRepository<CourseProperty, Long>,
 	
 	//根据课程代码查询已开启的课程属性
 	List<CourseProperty> findByCourseCodeAndEnable(String code,Boolean enable);
+	
+	//根据课程id查询已经开启的课程属性
+	List<CourseProperty> findByCourseIdAndEnable(Long courseId,Boolean enable);
 
 }

+ 1 - 3
cqb-question-resource/src/main/java/com/qmth/cqb/question/service/impl/CoursePropertyServiceImpl.java

@@ -91,7 +91,7 @@ public class CoursePropertyServiceImpl implements CoursePropertyService{
 
 	@Override
 	public List<CourseProperty> findAllByCourseId(Long courseId) {
-		List<CourseProperty> courseProperties = coursePropertyRepo.findByCourseId(courseId);
+		List<CourseProperty> courseProperties = coursePropertyRepo.findByCourseIdAndEnable(courseId,true);
 		return courseProperties;
 	}
 
@@ -100,7 +100,5 @@ public class CoursePropertyServiceImpl implements CoursePropertyService{
 		List<CourseProperty> courseProperties = coursePropertyRepo.findByCourseCode(code);
 		return courseProperties;
 	}
-
-	
 	
 }