Prechádzať zdrojové kódy

Merge remote-tracking branch 'origin/master'

周箭河 5 rokov pred
rodič
commit
0e6f80670a

+ 4 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherAttendanceServiceImpl.java

@@ -425,6 +425,10 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 		if(Objects.isNull(teacherAttendanceInfo.getSignOutStatus())){
 			throw new BizException("请指定签退状态");
 		}
+		CourseSchedule courseSchedule = courseScheduleDao.get(teacherAttendanceInfo.getCourseScheduleId());
+		if(Objects.isNull(courseSchedule)){
+			throw new BizException("课程不存在");
+		}
 		TeacherAttendance teacherAttendance=teacherAttendanceDao.findByTeacherAttendanceInfo(teacherAttendanceInfo.getTeacherId().longValue(),teacherAttendanceInfo.getCourseScheduleId());
 
 		Date date = new Date();
@@ -432,8 +436,6 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 			teacherAttendance=new TeacherAttendance();
 			teacherAttendance.setTeacherId(teacherAttendanceInfo.getTeacherId());
 			teacherAttendance.setCreateTime(date);
-		}else if(teacherAttendance.getSignInTime() != null && teacherAttendance.getSignOutTime() != null){
-			throw new BizException("当前课程已签到");
 		}
 		teacherAttendance.setSignOutTime(date);
 		teacherAttendance.setSignInStatus(teacherAttendanceInfo.getSignInStatus());

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

@@ -1313,7 +1313,7 @@
         SELECT DISTINCT cgsm.music_group_id_ FROM class_group_student_mapper cgsm
         LEFT JOIN music_group mg ON mg.id_ = cgsm.music_group_id_ AND cgsm.group_type_ = 'MUSIC'
         LEFT JOIN vip_group vg ON vg.id_ = cgsm.music_group_id_ AND cgsm.group_type_ = 'VIP'
-        WHERE cgsm.user_id_ = #{userId} AND cgsm.status_ != 'QUIT' AND (mg.status_ = 'PROGRESS' OR vg.status_ = 2 OR vg.status_=5 OR vg.status_=1)
+        WHERE cgsm.user_id_ = #{userId} AND cgsm.status_ != 'QUIT' AND (mg.status_ = 'PROGRESS' OR vg.group_status_  = 2 OR vg.group_status_ =5 OR vg.group_status_ =1)
         ORDER BY cgsm.music_group_id_
         <include refid="global.limit"/>
     </select>
@@ -1329,7 +1329,7 @@
         LEFT JOIN class_group cg ON cgsm.class_group_id_ = cg.id_
         WHERE spo.type_ != 'OTHER' AND spo.music_group_id_ IS NOT NULL
         AND spo.user_id_ = #{userId} AND spo.status_='SUCCESS' AND cgsm.status_ != 'QUIT'
-        AND IF(spo.group_type_ = 'VIP', (vg.status_ = 4 OR vg.status_ = 3 ),0)=0 AND cg.del_flag_ = 0
+        AND IF(spo.group_type_ = 'VIP', (vg.group_status_  = 4 OR vg.group_status_  = 3 ),0)=0 AND cg.del_flag_ = 0
         <include refid="global.limit"/>
     </select>
 
@@ -1340,7 +1340,7 @@
         LEFT JOIN class_group cg ON cgsm.class_group_id_ = cg.id_
         WHERE spo.type_ != 'OTHER' AND spo.music_group_id_ IS NOT NULL
         AND spo.user_id_ = #{userId} AND spo.status_='SUCCESS' AND cgsm.status_ != 'QUIT'
-        AND IF(spo.group_type_ = 'VIP', (vg.status_ = 4 OR vg.status_ = 3),0)=0 AND cg.del_flag_ = 0
+        AND IF(spo.group_type_ = 'VIP', (vg.group_status_  = 4 OR vg.group_status_  = 3),0)=0 AND cg.del_flag_ = 0
     </select>
     <select id="countExistRepeatInDateZone" resultType="int">
         SELECT
@@ -1923,64 +1923,12 @@
 
     <sql id="endFindCourseSchedulesCondition">
         <where>
-            <if test="search != null">
-                AND (cs.name_ LIKE CONCAT('%',#{search},'%') OR cs.id_ = #{search}
-                  <if test="groups != null and groupId==null">
-                      OR cs.music_group_id_ IN
-                      <foreach collection="groups" item="group" open="(" close=")" separator=",">
-                          #{group.id}
-                      </foreach>
-                  </if>
-                  <if test="courseIds != null and groupId==null">
-                    OR cs.id_ IN
-                    <foreach collection="courseIds" item="courseId" open="(" close=")" separator=",">
-                        #{courseId}
-                    </foreach>
-                  </if>
-                )
-            </if>
-            <if test="groups != null and groupId!=null">
-                AND cs.music_group_id_ IN
-                <foreach collection="groups" item="group" open="(" close=")" separator=",">
-                    #{group.id}
-                </foreach>
-            </if>
-            <if test="courseIds != null and groupId!=null">
+            <if test="courseScheduleIds != null">
                 AND cs.id_ IN
-                <foreach collection="courseIds" item="courseId" open="(" close=")" separator=",">
+                <foreach collection="courseScheduleIds" item="courseId" open="(" close=")" separator=",">
                     #{courseId}
                 </foreach>
             </if>
-            <if test="teacherIdList != null">
-                AND FIND_IN_SET(cs.actual_teacher_id_,#{teacherIdList})
-            </if>
-            <if test="groupType != null">
-                AND cs.group_type_=#{groupType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
-            </if>
-            <if test="groupId != null">
-                AND cs.music_group_id_=#{groupId}
-            </if>
-            <if test="classGroupId != null">
-                AND cs.class_group_id_=#{classGroupId}
-            </if>
-            <if test="startTime!=null and endTime==null">
-                AND cs.class_date_ &gt; DATE_FORMAT(#{startTime},"%Y-%m-%d")
-            </if>
-            <if test="startTime==null and endTime!=null">
-                AND cs.class_date_ &lt; DATE_FORMAT(#{endTime},"%Y-%m-%d")
-            </if>
-            <if test="startTime!=null and endTime!=null">
-                AND cs.class_date_ BETWEEN DATE_FORMAT(#{startTime},"%Y-%m-%d") AND DATE_FORMAT(#{endTime},"%Y-%m-%d")
-            </if>
-            <if test="courseStatus!=null">
-                AND cs.status_ = #{courseStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
-            </if>
-            <if test="courseType!=null">
-                AND cs.type_ = #{courseType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
-            </if>
-            <if test="schoolId!=null">
-                AND cs.schoole_id_ = #{schoolId}
-            </if>
         </where>
     </sql>
 
@@ -2118,7 +2066,7 @@
         SELECT cs.id_ FROM course_schedule cs
         LEFT JOIN vip_group vg ON cs.music_group_id_ = vg.id_
         LEFT JOIN class_group cg ON cs.class_group_id_ = cg.id_
-        WHERE cs.group_type_ = 'VIP' AND vg.status_ = '2' AND cs.del_flag_ = 0 AND cg.del_flag_ = 0
+        WHERE cs.group_type_ = 'VIP' AND vg.group_status_  = '2' AND cs.del_flag_ = 0 AND cg.del_flag_ = 0
         <if test="search != null and search != ''">
             AND (vg.id_ = #{search} OR vg.name_ LIKE CONCAT('%',#{search},'%')
             OR cs.id_ = #{search} OR cs.name_ LIKE CONCAT('%',#{search},'%')