Pārlūkot izejas kodu

1、服务指标;
2、增加课外训练待布置学员列表;
3、网管课续费提醒;

Joburgess 5 gadi atpakaļ
vecāks
revīzija
240efcbc7c

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

@@ -74,11 +74,12 @@ public class StudentServeServiceImpl implements StudentServeService {
         //本周无课学员编号集合
         Set<Integer> noClassStudentIds=new HashSet<>();
         for (Map.Entry<Integer, List<StudentServeDto>> studentCoursesEntry : studentCoursesMap.entrySet()) {
-            if(CollectionUtils.isEmpty(studentCoursesEntry.getValue())){
+            List<StudentServeDto> haveCourseStudents = studentCoursesEntry.getValue().stream().filter(e -> Objects.nonNull(e.getCourseStartTime())).collect(Collectors.toList());
+            if(CollectionUtils.isEmpty(haveCourseStudents)){
                 noClassStudentIds.add(studentCoursesEntry.getKey());
                 continue;
             }
-            StudentServeDto studentServeDto = studentCoursesEntry.getValue().stream().min(Comparator.comparing(StudentServeDto::getCourseStartTime)).get();
+            StudentServeDto studentServeDto = haveCourseStudents.stream().min(Comparator.comparing(StudentServeDto::getCourseStartTime)).get();
             if(Objects.isNull(studentServeDto.getCourseStartTime())){
                 noClassStudentIds.add(studentCoursesEntry.getKey());
                 continue;
@@ -87,8 +88,9 @@ public class StudentServeServiceImpl implements StudentServeService {
                 dontServeInCurrentWeekStudentIds.add(studentCoursesEntry.getKey());
                 continue;
             }
-            if(GroupType.PRACTICE.equals(studentServeDto.getGroupType())||
-                    (GroupType.MUSIC.equals(studentServeDto.getGroupType())&&TeachModeEnum.OFFLINE.equals(studentServeDto.getTeachMode()))){
+            long count = haveCourseStudents.stream().filter(e -> GroupType.PRACTICE.equals(e.getGroupType()) ||
+                    (GroupType.MUSIC.equals(e.getGroupType()) && TeachModeEnum.OFFLINE.equals(e.getTeachMode()))).count();
+            if(count>0){
                 haveClassStudentIds.add(studentCoursesEntry.getKey());
             }else{
                 noClassStudentIds.add(studentCoursesEntry.getKey());
@@ -109,23 +111,23 @@ public class StudentServeServiceImpl implements StudentServeService {
         }
 
         List<StudentExtracurricularExercisesSituation> results=new ArrayList<>();
-        for (StudentServeDto serviceStudent : serviceStudents) {
+        for (Map.Entry<Integer, List<StudentServeDto>> studentCoursesEntry : studentCoursesMap.entrySet()) {
 
-            if(dontServeInCurrentWeekStudentIds.contains(serviceStudent.getUserId())){
+            if(dontServeInCurrentWeekStudentIds.contains(studentCoursesEntry.getKey())){
                 continue;
             }
 
             StudentExtracurricularExercisesSituation studentExtracurricularExercisesSituation=new StudentExtracurricularExercisesSituation();
-            studentExtracurricularExercisesSituation.setStudentId(serviceStudent.getUserId());
-            studentExtracurricularExercisesSituation.setTeacherId(serviceStudent.getTeacherId());
+            studentExtracurricularExercisesSituation.setStudentId(studentCoursesEntry.getKey());
+            studentExtracurricularExercisesSituation.setTeacherId(studentCoursesEntry.getValue().get(0).getTeacherId());
             studentExtracurricularExercisesSituation.setExpectExercisesNum(1);
             studentExtracurricularExercisesSituation.setWeekOfYear(nowDate.get(DateUtil.weekFields.weekOfYear()));
             studentExtracurricularExercisesSituation.setMonday(DateUtil.stringToDate(monDayDate.toString(), "yyyy-MM-dd"));
             studentExtracurricularExercisesSituation.setSunday(DateUtil.stringToDate(sunDayDate.toString(), "yyyy-MM-dd"));
 
-            if(haveClassStudentIds.contains(serviceStudent.getUserId())){
+            if(haveClassStudentIds.contains(studentCoursesEntry.getKey())){
                 studentExtracurricularExercisesSituation.setServeType("HOMEWORK");
-                List<StudentServeCourseHomeworkDto> studentHomeworks = studentHomeworkMap.get(serviceStudent.getUserId());
+                List<StudentServeCourseHomeworkDto> studentHomeworks = studentHomeworkMap.get(studentCoursesEntry.getKey());
                 if(CollectionUtils.isEmpty(studentHomeworks)){
                     studentExtracurricularExercisesSituation.setActualExercisesNum(0);
                     studentExtracurricularExercisesSituation.setExercisesReplyNum(0);
@@ -161,9 +163,9 @@ public class StudentServeServiceImpl implements StudentServeService {
                 }
             }
 
-            if(noClassStudentIds.contains(serviceStudent.getUserId())){
+            if(noClassStudentIds.contains(studentCoursesEntry.getKey())){
                 studentExtracurricularExercisesSituation.setServeType("EXERCISE");
-                List<ExtracurricularExercisesReply> studentExercises = studentExercisesMap.get(serviceStudent.getUserId());
+                List<ExtracurricularExercisesReply> studentExercises = studentExercisesMap.get(studentCoursesEntry.getKey());
                 if(CollectionUtils.isEmpty(studentExercises)){
                     studentExtracurricularExercisesSituation.setActualExercisesNum(0);
                     studentExtracurricularExercisesSituation.setExercisesReplyNum(0);

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

@@ -355,7 +355,7 @@
 
     <resultMap id="StudentServeDto" type="com.ym.mec.biz.dal.dto.StudentServeDto" extends="Student">
         <result column="group_type_" property="groupType" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
-        <result column="teachMode" property="teach_mode_" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result column="teach_mode_" property="teachMode" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result property="courseStartTime" column="course_start_time_"/>
     </resultMap>
     <select id="getBeServiceStudents" resultMap="StudentServeDto">