Browse Source

fix:作业回复功能更新服务指标错误

Joburgess 4 years ago
parent
commit
1a78b85d65

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

@@ -85,22 +85,8 @@ public class ExtracurricularExercisesMessageServiceImpl extends BaseServiceImpl<
 				}
 				if(change){
 					extracurricularExercisesReplyDao.update(extracurricularExercisesReply);
-					LocalDate nowDate = LocalDateTime.now(DateUtil.zoneId).toLocalDate();
-					LocalDate monDayDate = nowDate.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.MONDAY.getValue());
-					LocalDate createDateTime = LocalDateTime.ofInstant(extracurricularExercisesReply.getCreateTime().toInstant(), DateUtil.zoneId).toLocalDate();
-					LocalDate createMonday = createDateTime.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.MONDAY.getValue());
-					if(createDateTime.isBefore(monDayDate)){
-//						StudentExtracurricularExercisesSituation studentExercisesSituation = studentExtracurricularExercisesSituationDao.findStudentExercisesSituationsWithMonDay(createMonday.toString(), extracurricularExercisesReply.getUserId());
-//						if(Objects.nonNull(studentExercisesSituation)){
-//							if(new Integer(1).equals(extracurricularExercisesReply.getIsReplied())){
-//								studentExercisesSituation.setExercisesMessageNum(1);
-//							}
-//							if(new Integer(1).equals(extracurricularExercisesReply.getIsRepliedTimely())){
-//								studentExercisesSituation.setExercisesMessageTimelyNum(1);
-//							}
-//							studentExtracurricularExercisesSituationDao.update(studentExercisesSituation);
-//						}
-					}
+
+					studentServeService.updateExercisesSituation(new Date(), new ArrayList<>(Arrays.asList(extracurricularExercisesReply.getUserId())), extracurricularExercisesMessage.getUserId());
 				}
 			}
 

+ 0 - 8
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExtracurricularExercisesReplyServiceImpl.java

@@ -155,14 +155,6 @@ public class ExtracurricularExercisesReplyServiceImpl extends BaseServiceImpl<Lo
 		LocalDate monDayDate = nowDate.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.MONDAY.getValue());
 		LocalDate createDateTime = LocalDateTime.ofInstant(existExtra.getCreateTime().toInstant(), DateUtil.zoneId).toLocalDate();
 		LocalDate createMonday = createDateTime.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.MONDAY.getValue());
-//		if(createDateTime.isBefore(monDayDate)){
-//			StudentExtracurricularExercisesSituation studentExercisesSituation = studentExtracurricularExercisesSituationDao.findStudentExercisesSituationsWithMonDay(createMonday.toString(), existExtra.getUserId());
-//			if(Objects.nonNull(studentExercisesSituation)){
-//				studentExercisesSituation.setExercisesReplyNum(1);
-//				studentExercisesSituation.setLastSubmitTime(now);
-//				studentExtracurricularExercisesSituationDao.update(studentExercisesSituation);
-//			}
-//		}
 
 		int submitStudentNum=extracurricularExercisesReplyDao.countIsSubmitStudents(existExtra.getExtracurricularExercisesId());
 		extracurricularExercises.setCompletedNum(submitStudentNum);

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

@@ -140,14 +140,6 @@ public class StudentCourseHomeworkServiceImpl extends BaseServiceImpl<Long, Stud
                 }
                 break;
         }
-//        if(createDateTime.isBefore(monDayDate)&&isOk){
-//            StudentExtracurricularExercisesSituation studentExercisesSituation = studentExtracurricularExercisesSituationDao.findStudentExercisesSituationsWithMonDay(createMonday.toString(), existHomework.getUserId());
-//            if(Objects.nonNull(studentExercisesSituation)){
-//                studentExercisesSituation.setExercisesReplyNum(1);
-//                studentExercisesSituation.setLastSubmitTime(now);
-//                studentExtracurricularExercisesSituationDao.update(studentExercisesSituation);
-//            }
-//        }
 
         studentServeService.updateExercisesSituation(courseSchedule.getClassDate(), new ArrayList<>(Arrays.asList(bean.getUserId())), courseSchedule.getTeacherId());
 
@@ -261,16 +253,7 @@ public class StudentCourseHomeworkServiceImpl extends BaseServiceImpl<Long, Stud
                     break;
             }
             if(createDateTime.isBefore(monDayDate)&&isOk){
-//                StudentExtracurricularExercisesSituation studentExercisesSituation = studentExtracurricularExercisesSituationDao.findStudentExercisesSituationsWithMonDay(createMonday.toString(), byStudentAndCourseHomewok.getUserId());
-//                if(Objects.nonNull(studentExercisesSituation)){
-//                    if(YesOrNoEnum.YES.equals(byStudentAndCourseHomewok.getIsReplied())){
-//                        studentExercisesSituation.setExercisesMessageNum(1);
-//                    }
-//                    if(new Integer(1).equals(byStudentAndCourseHomewok.getIsRepliedTimely())){
-//                        studentExercisesSituation.setExercisesMessageTimelyNum(1);
-//                    }
-//                    studentExtracurricularExercisesSituationDao.update(studentExercisesSituation);
-//                }
+                studentServeService.updateExercisesSituation(new Date(), new ArrayList<>(Arrays.asList(byStudentAndCourseHomewok.getUserId())), teacherId);
             }
         }
         return true;