Parcourir la source

add:课程大纲下课程唯一

caozixuan il y a 1 an
Parent
commit
36896f07eb

+ 2 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ObeCourseOutlineServiceImpl.java

@@ -83,10 +83,10 @@ public class ObeCourseOutlineServiceImpl extends ServiceImpl<ObeCourseOutlineMap
 
         ObeCourseOutline checkUnique = this.getOne(new QueryWrapper<ObeCourseOutline>().lambda()
                 .eq(ObeCourseOutline::getCultureProgramId, cultureProgramId)
-                .eq(ObeCourseOutline::getName, courseOutlineName).last(SystemConstant.LIMIT1));
+                .eq(ObeCourseOutline::getCourseId, courseId).last(SystemConstant.LIMIT1));
         if (Objects.nonNull(checkUnique)) {
             if (!Objects.equals(checkUnique.getId(), id)) {
-                throw new RuntimeException("该课程大纲名称已存在");
+                throw new RuntimeException("该课程已经创建了课程大纲不能重复创建");
             }
         }
 

+ 7 - 0
distributed-print-business/src/main/resources/db/log/caozixuan.sql

@@ -169,3 +169,10 @@ ALTER TABLE t_c_final_score
     ADD UNIQUE INDEX t_c_final_score_unique (culture_program_id ASC, course_id ASC, name ASC, student_code ASC)
 ;
 
+ALTER TABLE obe_course_outline
+    DROP INDEX obe_course_outline_unique ,
+    ADD UNIQUE INDEX obe_course_outline_unique (culture_program_id ASC, course_id ASC) VISIBLE;
+;
+
+UPDATE sys_privilege SET related = '77,842,843,844,845,846,847,848,849,850,851,852,853,866,1115,3018,1117,1118,1119,1120,1121,1122,1123,1124,1125,1126,1128,1129' WHERE (id = '841');
+