Browse Source

feat:1、考勤

Joburgess 4 năm trước cách đây
mục cha
commit
ee11c602fa

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

@@ -155,7 +155,7 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
             if (date.before(courseSchedule.getStartClassTime()) && courseStartTime > beforeAttendanceTimeRange.getParanValue(Integer.class)) {
                 throw new BizException("VIP课开课前{}分钟禁止点名", beforeAttendanceTimeRange.getParanValue(Integer.class));
             }
-            attendanceTimeRange = sysConfigService.findByParamName(SysConfigService.ENABLE_STUDENT_ATTENDANCE_TIME_RANGE_VIP);
+            attendanceTimeRange = sysConfigService.findByParamName(SysConfigService.ENABLE_STUDENT_ATTENDANCE_BEFOR_COURSE_START_TIME_RANGE_VIP);
 
             int courseEndTime = DateUtil.minutesBetween(courseSchedule.getEndClassTime(), date);
             if (date.after(courseSchedule.getEndClassTime()) && courseEndTime > attendanceTimeRange.getParanValue(Integer.class)) {

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

@@ -444,12 +444,12 @@ public class StudentServeServiceImpl implements StudentServeService {
         for (StudentExtracurricularExercisesSituation result : results) {
             if(codeServeMap.containsKey(result.getStuAndTeaCode())){
                 StudentExtracurricularExercisesSituation s = codeServeMap.get(result.getStuAndTeaCode());
-                List<Long> courseIds = new ArrayList<>();
+                Set<Long> courseIds = new HashSet<>();
                 if(StringUtils.isNotBlank(s.getCourseIds())&&s.getActualExercisesNum()>0){
-                    courseIds = Arrays.stream(s.getCourseIds().split(",")).map(id->Long.valueOf(id)).collect(Collectors.toList());
+                    courseIds = Arrays.stream(s.getCourseIds().split(",")).map(id->Long.valueOf(id)).collect(Collectors.toSet());
                 }
                 if(StringUtils.isNotBlank(result.getCourseIds())){
-                    courseIds.addAll(Arrays.stream(result.getCourseIds().split(",")).map(id->Long.valueOf(id)).collect(Collectors.toList()));
+                    courseIds.addAll(Arrays.stream(result.getCourseIds().split(",")).map(id->Long.valueOf(id)).collect(Collectors.toSet()));
                 }
                 s.setServeType(result.getServeType());
                 if(s.getServeType().equals("HOMEWORK")){
@@ -527,7 +527,7 @@ public class StudentServeServiceImpl implements StudentServeService {
 
         for (StudentExtracurricularExercisesSituation weekServiceWithStudent : weekServiceWithStudents) {
             List<StudentServeCourseHomeworkDto> studentHomeworks = studentHomeworkMap.get(weekServiceWithStudent.getStudentId());
-            if(!CollectionUtils.isEmpty(studentHomeworks)){
+            if(!CollectionUtils.isEmpty(studentHomeworks)&&weekServiceWithStudent.getServeType().equals("HOMEWORK")){
                 weekServiceWithStudent.setActualExercisesNum(1);
                 long replyNum = studentHomeworks.stream().filter(e -> YesOrNoEnum.YES.equals(e.getStatus())).count();
                 weekServiceWithStudent.setExercisesReplyNum(replyNum>0?1:0);
@@ -555,7 +555,7 @@ public class StudentServeServiceImpl implements StudentServeService {
             }
 
             List<ExtracurricularExercisesReply> studentExercises = studentExercisesMap.get(weekServiceWithStudent.getStudentId());
-            if(!CollectionUtils.isEmpty(studentExercises)){
+            if(!CollectionUtils.isEmpty(studentExercises)&&weekServiceWithStudent.getServeType().equals("EXERCISE")){
                 weekServiceWithStudent.setActualExercisesNum(1);
                 long replyNum = studentExercises.stream().filter(e -> e.getStatus()==1).count();
                 if(weekServiceWithStudent.getExercisesReplyNum()<=0){