Przeglądaj źródła

feat:1、服务指标

Joburgess 4 lat temu
rodzic
commit
9d3299fbfc

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentExtracurricularExercisesSituationDao.java

@@ -109,4 +109,7 @@ public interface StudentExtracurricularExercisesSituationDao extends BaseDAO<Lon
                                                                                @Param("teacherId") Integer teacherId,
                                                                                @Param("studentIds") List<Integer> studentIds);
 
+    List<StudentExtracurricularExercisesSituation> findServiceWithCourse(@Param("monday") String monday,
+                                                                         @Param("courseId") Long courseId);
+
 }

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/StudentServeService.java

@@ -43,4 +43,14 @@ public interface StudentServeService {
 
     void updateExercisesSituation(Date date, List<Integer> studentIds, Integer teacherId);
 
+    /**
+     * @describe 获取与课程相关的应被服务的学员
+     * @author Joburgess
+     * @date 2020/12/29 0029
+     * @param date:
+     * @param courseId:
+     * @return java.util.Set<java.lang.Integer>
+     */
+    Set<Integer> getStudentWithCourse(Long courseId);
+
 }

+ 14 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentServeServiceImpl.java

@@ -413,7 +413,7 @@ public class StudentServeServiceImpl implements StudentServeService {
             }
         }
 
-        if(CollectionUtils.isEmpty(studentIds)){
+        if(CollectionUtils.isEmpty(results)){
             studentExtracurricularExercisesSituationDao.deleteByMonday(monDayDate.toString());
             BigDecimal currentPage1=BigDecimal.ONE,
                     pageSize1=new BigDecimal(10000),
@@ -656,4 +656,17 @@ public class StudentServeServiceImpl implements StudentServeService {
         }
         return courseIds;
     }
+
+    @Override
+    public Set<Integer> getStudentWithCourse(Long courseId) {
+        CourseSchedule courseSchedule = courseScheduleDao.get(courseId);
+        if(Objects.isNull(courseSchedule)){
+            throw new BizException("课程不存在");
+        }
+        LocalDate nowDate = LocalDateTime.ofInstant(courseSchedule.getClassDate().toInstant(), DateUtil.zoneId).toLocalDate();
+
+        LocalDate monDayDate = nowDate.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.MONDAY.getValue());
+        studentExtracurricularExercisesSituationDao.findServiceWithCourse(monDayDate.toString(), courseId);
+        return null;
+    }
 }

+ 5 - 0
mec-biz/src/main/resources/config/mybatis/StudentExtracurricularExercisesSituationMapper.xml

@@ -456,4 +456,9 @@
     <select id="findTeacherNoStartServices" resultMap="StudentExtracurricularExercisesSituation">
 		SELECT * FROM student_extracurricular_exercises_situation_ WHERE teacher_id_=#{teacherId} AND actual_exercises_num_&lt;=0 AND serve_type_='HOMEWORK';
 	</select>
+
+	<select id="findServiceWithCourse"
+			resultType="com.ym.mec.biz.dal.entity.StudentExtracurricularExercisesSituation">
+		SELECT * FROM student_extracurricular_exercises_situation_ WHERE monday_=#{monday} AND FIND_IN_SET(#{courseId}, course_ids_)
+	</select>
 </mapper>