|
@@ -7,6 +7,7 @@ import com.ym.mec.biz.dal.dto.BasicUserDto;
|
|
|
import com.ym.mec.biz.dal.entity.ClassGroup;
|
|
|
import com.ym.mec.biz.dal.entity.CourseScheduleEvaluate;
|
|
|
import com.ym.mec.biz.dal.entity.PracticeGroup;
|
|
|
+import com.ym.mec.biz.dal.entity.Subject;
|
|
|
import com.ym.mec.biz.dal.enums.MessageTypeEnum;
|
|
|
import com.ym.mec.biz.service.CourseScheduleEvaluateService;
|
|
|
import com.ym.mec.biz.service.SysConfigService;
|
|
@@ -43,6 +44,8 @@ public class CourseScheduleEvaluateServiceImpl extends BaseServiceImpl<Long, Cou
|
|
|
private SysMessageService sysMessageService;
|
|
|
@Autowired
|
|
|
private SysConfigDao sysConfigDao;
|
|
|
+ @Autowired
|
|
|
+ private SubjectDao subjectDao;
|
|
|
|
|
|
@Override
|
|
|
public BaseDAO<Long, CourseScheduleEvaluate> getDAO() {
|
|
@@ -68,7 +71,7 @@ public class CourseScheduleEvaluateServiceImpl extends BaseServiceImpl<Long, Cou
|
|
|
Integer classGroupCourseTimes = courseScheduleEvaluateDao.getClassGroupCourseTimes(classGroup.getId());
|
|
|
Date date = new Date();
|
|
|
courseScheduleEvaluate.setTimes(classGroupCourseTimes);
|
|
|
- courseScheduleEvaluate.setTotalMinutes(classGroupCourseTimes*25);
|
|
|
+ courseScheduleEvaluate.setTotalMinutes(classGroupCourseTimes * 25);
|
|
|
courseScheduleEvaluate.setMusicGroupId(classGroup.getMusicGroupId());
|
|
|
courseScheduleEvaluate.setCreateTime(date);
|
|
|
courseScheduleEvaluate.setUpdateTime(date);
|
|
@@ -132,10 +135,11 @@ public class CourseScheduleEvaluateServiceImpl extends BaseServiceImpl<Long, Cou
|
|
|
Date afterDate = DateUtil.addDays(DateUtil.getLastSecondWithDay(nowDate), 5);
|
|
|
boolean afterDateIsLastDay = DateUtil.isSameDay(DateUtil.getLastDayOfMonth(startDate), afterDate);
|
|
|
|
|
|
- List<CourseScheduleEvaluate> needPostReportPracticeGroups = practiceGroupDao.getNeedPostReportPracticeGroups(startDate, afterDate,afterDateIsLastDay);
|
|
|
+ List<CourseScheduleEvaluate> needPostReportPracticeGroups = practiceGroupDao.getNeedPostReportPracticeGroups(startDate, afterDate, afterDateIsLastDay);
|
|
|
|
|
|
Map<Integer, Integer> courseTimesMap = new HashMap<>();
|
|
|
Map<Integer, Integer> reportCountMap = new HashMap<>();
|
|
|
+ Map<Integer, String> subjectMap = new HashMap<>();
|
|
|
if (needPostReportPracticeGroups.size() > 0) {
|
|
|
Date courseStartDate = DateUtil.addMonths(startDate, -1);
|
|
|
List<Integer> classGroupIds = needPostReportPracticeGroups.stream().map(CourseScheduleEvaluate::getClassGroupId).collect(Collectors.toList());
|
|
@@ -143,15 +147,23 @@ public class CourseScheduleEvaluateServiceImpl extends BaseServiceImpl<Long, Cou
|
|
|
courseTimesMap = reportCourseTimes.stream().collect(Collectors.toMap(ClassGroup::getId, ClassGroup::getTotalClassTimes));
|
|
|
|
|
|
List<CourseScheduleEvaluate> courseScheduleEvaluates = courseScheduleEvaluateDao.hasReportList(classGroupIds, startDate);
|
|
|
- if(courseScheduleEvaluates.size() > 0){
|
|
|
- reportCountMap = courseScheduleEvaluates.stream().collect(Collectors.toMap(CourseScheduleEvaluate::getClassGroupId,CourseScheduleEvaluate::getTimes));
|
|
|
+ if (courseScheduleEvaluates.size() > 0) {
|
|
|
+ reportCountMap = courseScheduleEvaluates.stream().collect(Collectors.toMap(CourseScheduleEvaluate::getClassGroupId, CourseScheduleEvaluate::getTimes));
|
|
|
}
|
|
|
+ List<Integer> subjectIds = needPostReportPracticeGroups.stream().map(CourseScheduleEvaluate::getSubjectId).collect(Collectors.toList());
|
|
|
+ List<Subject> subjects = subjectDao.findBySubjectIds(subjectIds);
|
|
|
+ subjectMap = subjects.stream().collect(Collectors.toMap(Subject::getId, Subject::getName));
|
|
|
}
|
|
|
Iterator<CourseScheduleEvaluate> iterator = needPostReportPracticeGroups.iterator();
|
|
|
- while (iterator.hasNext()){
|
|
|
+ while (iterator.hasNext()) {
|
|
|
CourseScheduleEvaluate courseScheduleEvaluate = iterator.next();
|
|
|
- if(reportCountMap.containsKey(courseScheduleEvaluate.getClassGroupId()) &&
|
|
|
- reportCountMap.get(courseScheduleEvaluate.getClassGroupId()) > 0){
|
|
|
+ if (subjectMap.get(courseScheduleEvaluate.getSubjectId()).contains("钢琴")) {
|
|
|
+ iterator.remove();
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (reportCountMap.containsKey(courseScheduleEvaluate.getClassGroupId()) &&
|
|
|
+ reportCountMap.get(courseScheduleEvaluate.getClassGroupId()) > 0) {
|
|
|
iterator.remove();
|
|
|
continue;
|
|
|
}
|