Browse Source

课表接口查询逻辑调整

dzx 1 year ago
parent
commit
784a58006f

+ 1 - 1
src/main/java/com/xjrsoft/module/courseTable/service/impl/CourseTableServiceImpl.java

@@ -251,7 +251,7 @@ public class CourseTableServiceImpl extends ServiceImpl<CourseTableMapper, Cours
             }
         }
         if(dto.getStartDate() != null && dto.getEndDate() != null){
-            if(dto.getStudentId() == null && dto.getTeacherId() == null){
+            if(dto.getStudentId() == null && dto.getTeacherId() == null && dto.getClassId() == null){
                 dto.setTeacherId(StpUtil.getLoginIdAsLong());
             }else{
                 List<BaseStudentSchoolRoll> schoolRolls = baseStudentSchoolRollService.list(

+ 1 - 1
src/main/java/com/xjrsoft/module/schedule/util/DataUtil.java

@@ -34,7 +34,7 @@ public class DataUtil {
 
     public Map<Long, String> insertClass(Db db, String tableName, Map<Long, String> gradeMap,
     Map<Long, String> teacherMap, String semesterSerialNo, Map<Long, String> ids, Map<Long, String> classroomMap) throws Exception {
-        String sql = "SELECT * FROM " + tableName + " WHERE delete_mark = 0";
+        String sql = "SELECT * FROM " + tableName + " WHERE delete_mark = 0 and is_graduate = 1";
         List<BaseClass> dataList = db.query(sql, BaseClass.class);
 
         Map<Long, String> idMap = new HashMap<>();

+ 3 - 0
src/main/resources/mapper/courseTable/CourseTable.xml

@@ -44,6 +44,9 @@
         <if test="dto.teacherId != null">
             and t1.teacher_id = #{dto.teacherId}
         </if>
+        <if test="dto.classId != null">
+            and t5.id = #{dto.classId}
+        </if>
     </select>
     <select id="getAdjustList" parameterType="com.xjrsoft.module.schedule.dto.CourseTableAdjustDto" resultType="com.xjrsoft.module.schedule.vo.CourseListVo">
         SELECT t1.time_period,t1.time_number,t1.course_name,t2.name AS class_name,t3.name AS classroom_name,t1.id,t2.id as class_id FROM course_table t1