Browse Source

科目与班级绑定

zhaoy 6 years ago
parent
commit
e2e6d07ffd

+ 1 - 1
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/service/impl/ClassServiceImpl.java

@@ -86,7 +86,7 @@ public class ClassServiceImpl implements ClassService{
         for (SysTeacherClazz detail : teachers) {
             detail.setClazz_id(clazz.getClazz_id());
             Integer count = 0;
-            count = sysClazzMapper.teacherClazz(detail.getSubject_name(),detail.getTeacher_id());
+            count = sysClazzMapper.teacherClazz(detail.getSubject_name(),clazz.getClazz_id());
             if(count > 0){
                 throw new BizException(BizExceptionCode.REPEAT_SUBJECTS);
             }

+ 1 - 1
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/exception/BizExceptionCode.java

@@ -25,7 +25,7 @@ public enum BizExceptionCode implements BaseExceptionCode {
     EXISTS_SCORE_PUBLISH(5000013, "存在已发布成绩,禁止删除"),
     EXISTS_CLASS(500011, "存在班级,无法删除"),
     HOMEWORK_RELEASE(500012, "存在发布作业,无法删除"),
-    REPEAT_SUBJECTS(600001, "同个老师不可班带相同的课"),
+    REPEAT_SUBJECTS(600001, "课程已存在"),
     REPEAT_GRADE_NAME(600001, "年级名称重复"),
     REPEAT_CLASS_NAME(600002, "班级名称重复"),
     REPEAT_STUDENT_NUMBER(600003, "学生学号不可重复"),

+ 1 - 1
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/mapper/SysClazzMapper.java

@@ -35,5 +35,5 @@ public interface SysClazzMapper {
 
     int countClazz(@Param("clazz_name") String clazz_name, @Param("clazz_grade") String clazz_grade, @Param("school_id") Long school_id);
 
-    Integer teacherClazz(@Param("subject_name") String subject_name,@Param("teacher_id") Long teacher_id );
+    Integer teacherClazz(@Param("subject_name") String subject_name, @Param("clazz_id") Long clazz_id);
 }

+ 3 - 3
applications/school/school-server/src/main/resources/mapper/SysClazzMapper.xml

@@ -254,9 +254,9 @@
       <if test="subject_name != null">
         subject_name=#{subject_name}
       </if>
-        <if test="teacher_id != null">
-            and teacher_id=#{teacher_id}
-        </if>
+      <if test="clazz_id != null">
+        and clazz_id=#{clazz_id}
+      </if>
     </where>
   </select>