Bläddra i källkod

Merge remote-tracking branch 'origin/master'

Joburgess 4 år sedan
förälder
incheckning
3196622133

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentAttendanceQueryInfo.java

@@ -56,6 +56,17 @@ public class StudentAttendanceQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "courseScheduleStudentPaymentId")
     private String ids;
 
+    //是否回访
+    private Boolean visitFlag;
+
+    public Boolean getVisitFlag() {
+        return visitFlag;
+    }
+
+    public void setVisitFlag(Boolean visitFlag) {
+        this.visitFlag = visitFlag;
+    }
+
     public String getIds() {
         return ids;
     }

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

@@ -379,9 +379,9 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			List<Long> quitGroupNum = indexBaseMonthDataDao.queryApplyForQuitGroupNum(organIds);
 			twoChild.add(new IndexErrInfoDto(IndexErrorType.STUDENT_APPLY_FOR_QUIT_MUSIC_GROUP, IndexErrorType.STUDENT_APPLY_FOR_QUIT_MUSIC_GROUP.getMsg(), quitGroupNum.size(),  quitGroupNum));
 			List<Long> attendanceInfo = indexBaseMonthDataDao.queryStudentAttendanceInfo(organIds, StudentAttendanceStatusEnum.TRUANT.getCode(),startTime);
-			twoChild.add(new IndexErrInfoDto(IndexErrorType.COURSE_TRUANT_STUDENT_NUM, IndexErrorType.COURSE_TRUANT_STUDENT_NUM.getMsg(), attendanceInfo.size(), attendanceInfo));
+			twoChild.add(new IndexErrInfoDto(IndexErrorType.COURSE_TRUANT_STUDENT_NUM, IndexErrorType.COURSE_TRUANT_STUDENT_NUM.getMsg(), attendanceInfo.size(), null));
 			List<Long> attendanceInfo1 = indexBaseMonthDataDao.queryStudentAttendanceInfo(organIds, StudentAttendanceStatusEnum.LEAVE.getCode(),startTime);
-			twoChild.add(new IndexErrInfoDto(IndexErrorType.COURSE_LEAVE_STUDENT_NUM, IndexErrorType.COURSE_LEAVE_STUDENT_NUM.getMsg(), attendanceInfo1.size(), attendanceInfo1));
+			twoChild.add(new IndexErrInfoDto(IndexErrorType.COURSE_LEAVE_STUDENT_NUM, IndexErrorType.COURSE_LEAVE_STUDENT_NUM.getMsg(), attendanceInfo1.size(), null));
 			two.setNum(twoChild.stream().mapToInt(IndexErrInfoDto::getNum).sum());
 			two.setResult(twoChild);
 			all.add(two);

+ 2 - 1
mec-biz/src/main/resources/config/mybatis/IndexBaseMonthDataMapper.xml

@@ -566,7 +566,8 @@
 			LEFT JOIN student_attendance sa ON sa.course_schedule_id_ = cssp.course_schedule_id_ AND sa.user_id_ = cssp.user_id_
 			LEFT JOIN student_visit sv ON cssp.id_ = sv.object_id_
 		WHERE
-				cs.status_ = 'OVER' AND sv.id_ IS NULL AND cs.del_flag_ = 0 AND DATE_FORMAT( cs.class_date_, '%Y-%m-%d' ) >= #{startTime}
+				cs.status_ = 'OVER' AND sv.id_ IS NULL AND cs.del_flag_ = 0 AND cs.class_date_ >= #{startTime} AND cs.class_date_ &lt;= DATE_FORMAT(NOW(),'%Y-%m-%d')
+				AND cssp.group_type_ IN ('MUSIC','PRACTICE','VIP')
 			<if test="type!=null and type=='LEAVE'">
 				AND sa.status_ = 'LEAVE'
 			</if>

+ 20 - 9
mec-biz/src/main/resources/config/mybatis/StudentAttendanceMapper.xml

@@ -494,38 +494,48 @@
         LEFT JOIN sys_user su ON cssp.user_id_ = su.id_
         left join sys_user tu on tu.id_ = cs.actual_teacher_id_
         left join organization o on o.id_ = cs.organ_id_
+        LEFT JOIN student_visit sv ON cssp.id_ = sv.object_id_
         <include refid="findStudentAttendanceSql"/>
         ORDER BY CONCAT(cs.class_date_, ' ', cs.start_class_time_) asc
         <include refid="global.limit"/>
     </select>
     <sql id="findStudentAttendanceSql">
         <where>
+            cs.status_ = 'OVER' AND cs.del_flag_ = 0 AND (cs.new_course_id_ IS NULL OR cs.new_course_id_ = cs.id_)
+            <if test="visitFlag != null">
+                <if test="visitFlag == 1">
+                    AND sv.id_ IS NOT NULL
+                </if>
+                <if test="visitFlag == 0">
+                    AND sv.id_ IS NULL
+                </if>
+            </if>
             <if test="courseScheduleId != null">
-                cssp.course_schedule_id_ = #{courseScheduleId}
+                AND cssp.course_schedule_id_ = #{courseScheduleId}
             </if>
             <if test="search != null">
-                and cssp.course_schedule_id_ = #{search}
+                AND cssp.course_schedule_id_ = #{search}
             </if>
             <if test="studentID != null">
-                and cssp.user_id_ = #{studentID}
+                AND cssp.user_id_ = #{studentID}
             </if>
             <if test="startDateOfCourse != null">
-                and cs.class_date_ &gt;= #{startDateOfCourse}
+                AND cs.class_date_ &gt;= #{startDateOfCourse}
             </if>
             <if test="endDateOfCourse != null">
-                and cs.class_date_ &lt;= #{endDateOfCourse}
+                AND cs.class_date_ &lt;= #{endDateOfCourse}
             </if>
             <if test="courseScheduleType != null">
-                and cs.type_ = #{courseScheduleType}
+                AND cs.type_ = #{courseScheduleType}
             </if>
             <if test="teacherId != null">
-                and cs.actual_teacher_id_ = #{teacherId}
+                AND cs.actual_teacher_id_ = #{teacherId}
             </if>
             <if test="courseStatus != null">
-                and cs.status_ = #{courseStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+                AND cs.status_ = #{courseStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
             </if>
             <if test="status != null">
-                and (sa.status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+                AND (sa.status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
                 <if test="status.code == 'TRUANT'">
                     OR sa.id_ IS NULL
                 </if>
@@ -551,6 +561,7 @@
         FROM course_schedule_student_payment cssp
         left join course_schedule cs on cs.id_ = cssp.course_schedule_id_
         left join student_attendance sa on cssp.course_schedule_id_ = sa.course_schedule_id_ and cssp.user_id_ = sa.user_id_
+        LEFT JOIN student_visit sv ON cssp.id_ = sv.object_id_
         <include refid="findStudentAttendanceSql"/>
     </select>
     <select id="findByCourseId" resultMap="StudentAttendance">