Просмотр исходного кода

首页新增课程时间安排异常

zouxuan 4 лет назад
Родитель
Сommit
8aced4541f

+ 7 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/IndexBaseMonthDataDao.java

@@ -161,6 +161,13 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
 
 
     /**
+     * 课程时间安排异常
+     * @param organIds
+     * @return
+     */
+    int getCourseTimeError(@Param("organIds") Set<Integer> organIds);
+
+    /**
      * 获取考勤异常编号
      * @param organIds
      * @return

+ 1 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/IndexErrorType.java

@@ -28,6 +28,7 @@ public enum IndexErrorType implements BaseEnum<String, IndexErrorType> {
     STUDENT_VISIT("STUDENT_VISIT", "回访任务未完成"),
 
     ATTENDANCE_SERVE("ATTENDANCE_SERVE", "考勤及服务"),
+    COURSE_TIME_ERROR("COURSE_TIME_ERROR", "课程时间安排异常"),
     TEACHER_EXCEPTION_ATTENDANCE("TEACHER_EXCEPTION_ATTENDANCE", "课程考勤异常"),
     TEACHER_NOT_A_CLASS("TEACHER_NOT_A_CLASS", "课程异常"),
     TEACHER_SERVE_ERROR("TEACHER_SERVE_ERROR", "服务指标异常"),

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/IndexBaseMonthDataServiceImpl.java

@@ -371,6 +371,9 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			four.setDesc(IndexErrorType.ATTENDANCE_SERVE.getMsg());
 			List<IndexErrInfoDto> fourChild = new ArrayList<>();
 
+			int courseTimeError = indexBaseMonthDataDao.getCourseTimeError(organIds);
+			fourChild.add(new IndexErrInfoDto(IndexErrorType.COURSE_TIME_ERROR, IndexErrorType.COURSE_TIME_ERROR.getMsg(), courseTimeError, null));
+
 			int attendanceError = indexBaseMonthDataDao.getAttendanceError(organIds,startTime);
 			fourChild.add(new IndexErrInfoDto(IndexErrorType.TEACHER_EXCEPTION_ATTENDANCE, IndexErrorType.TEACHER_EXCEPTION_ATTENDANCE.getMsg(), attendanceError, null));
 
@@ -512,6 +515,12 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 
 		boolean flag4 = false;
 		if(!flag4){
+			int courseTimeError = indexBaseMonthDataDao.getCourseTimeError(organIds);
+			if(courseTimeError > 0){
+				flag4 = true;
+			}
+		}
+		if(!flag4){
 			int attendanceError = indexBaseMonthDataDao.getAttendanceError(organIds,startTime);
 			if(attendanceError > 0){
 				flag4 = true;

+ 6 - 2
mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml

@@ -2403,7 +2403,7 @@
                 LEFT JOIN course_schedule_student_payment cssp ON cssp.course_schedule_id_ = cs.id_
                 LEFT JOIN student_attendance sa ON sa.course_schedule_id_ = cs.id_ AND cssp.user_id_ = sa.user_id_
             </if>
-            <if test="searchType != 'ERR_ATTENDANCE'">
+            <if test="searchType == 'NO_ATTENDANCE'">
                 LEFT JOIN student_attendance sa ON sa.course_schedule_id_ = cs.id_
             </if>
             <include refid="endFindCourseSchedulesCondition"/>
@@ -2427,7 +2427,7 @@
             LEFT JOIN course_schedule_student_payment cssp ON cssp.course_schedule_id_ = cs.id_
             LEFT JOIN student_attendance sa ON sa.course_schedule_id_ = cs.id_ AND cssp.user_id_ = sa.user_id_
         </if>
-        <if test="searchType != 'ERR_ATTENDANCE'">
+        <if test="searchType == 'NO_ATTENDANCE'">
             LEFT JOIN student_attendance sa ON sa.course_schedule_id_ = cs.id_
         </if>
         LEFT JOIN teacher_attendance ta on ta.course_schedule_id_ = cs.id_
@@ -2563,6 +2563,10 @@
             AND cs.status_ = 'OVER' AND ta.sign_in_time_ IS NULL AND ta.sign_out_time_ IS NULL AND ta.dispose_content_ IS NULL
             AND (cs.new_course_id_ IS NULL OR cs.new_course_id_ = cs.id_)
         </if>
+        <if test="searchType == 'COURSE_TIME_ERROR'">
+            AND cs.status_ = 'NOT_START' AND cs.start_class_time_ &lt; '06:00:00'
+            AND (cs.new_course_id_ IS NULL OR cs.new_course_id_ = cs.id_)
+        </if>
     </sql>
     <select id="queryPracticeCourseScheduleIds" resultType="java.lang.Integer">
         SELECT cs.id_ FROM course_schedule cs

+ 11 - 0
mec-biz/src/main/resources/config/mybatis/IndexBaseMonthDataMapper.xml

@@ -739,6 +739,17 @@
 				</foreach>
 			</if>
 	</select>
+    <select id="getCourseTimeError" resultType="int">
+		SELECT COUNT(cs.id_) FROM course_schedule cs
+		WHERE cs.status_ = 'NOT_START' AND cs.del_flag_ = 0 AND cs.start_class_time_ &lt; '06:00:00'
+		AND (cs.new_course_id_ IS NULL OR cs.new_course_id_=cs.id_)
+		<if test="organIds != null and organIds.size()>0">
+			AND cs.organ_id_ IN
+			<foreach collection="organIds" item="organId" open="(" close=")" separator=",">
+				#{organId}
+			</foreach>
+		</if>
+	</select>
     <select id="getAttendanceError" resultType="int">
 		SELECT COUNT(DISTINCT c.id_) FROM (SELECT cs.id_ FROM course_schedule cs
 		LEFT JOIN teacher_attendance ta ON ta.course_schedule_id_ = cs.id_