|
@@ -978,6 +978,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
public boolean updateCourseScheduleToOverStatus() {
|
|
public boolean updateCourseScheduleToOverStatus() {
|
|
|
|
|
|
Date date = new Date();
|
|
Date date = new Date();
|
|
@@ -985,6 +986,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
List<StudentAttendance> studentAttendanceList = courseScheduleDao.queryUnsignedStudentList();
|
|
List<StudentAttendance> studentAttendanceList = courseScheduleDao.queryUnsignedStudentList();
|
|
for (StudentAttendance studentAttendance : studentAttendanceList) {
|
|
for (StudentAttendance studentAttendance : studentAttendanceList) {
|
|
studentAttendance.setStatus(StudentAttendanceStatusEnum.TRUANT);
|
|
studentAttendance.setStatus(StudentAttendanceStatusEnum.TRUANT);
|
|
|
|
+ studentAttendance.setCurrentClassTimes(studentAttendance.getCurrentClassTimes() + 1);
|
|
studentAttendance.setCreateTime(date);
|
|
studentAttendance.setCreateTime(date);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -996,7 +998,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
List<CourseSchedule> list = courseScheduleDao.queryFinishedWithNoUpdateStatus();
|
|
List<CourseSchedule> list = courseScheduleDao.queryFinishedWithNoUpdateStatus();
|
|
|
|
|
|
List<CourseSchedule> updateList = new ArrayList<CourseSchedule>();
|
|
List<CourseSchedule> updateList = new ArrayList<CourseSchedule>();
|
|
- List<Integer> classGroups = new ArrayList<Integer>();
|
|
|
|
|
|
+ List<Integer> classGroupIds = new ArrayList<Integer>();
|
|
List<Long> courseScheduleIdList = new ArrayList<Long>();
|
|
List<Long> courseScheduleIdList = new ArrayList<Long>();
|
|
|
|
|
|
for (CourseSchedule courseSchedule : list) {
|
|
for (CourseSchedule courseSchedule : list) {
|
|
@@ -1004,8 +1006,8 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
courseSchedule.setUpdateTime(date);
|
|
courseSchedule.setUpdateTime(date);
|
|
updateList.add(courseSchedule);
|
|
updateList.add(courseSchedule);
|
|
|
|
|
|
- if (!classGroups.contains(courseSchedule.getClassGroupId())) {
|
|
|
|
- classGroups.add(courseSchedule.getClassGroupId());
|
|
|
|
|
|
+ if (!classGroupIds.contains(courseSchedule.getClassGroupId())) {
|
|
|
|
+ classGroupIds.add(courseSchedule.getClassGroupId());
|
|
}
|
|
}
|
|
|
|
|
|
if(courseSchedule.getGroupType() == GroupType.VIP){
|
|
if(courseSchedule.getGroupType() == GroupType.VIP){
|
|
@@ -1018,9 +1020,28 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
}
|
|
}
|
|
|
|
|
|
// 更新班级已上课次
|
|
// 更新班级已上课次
|
|
- if (classGroups.size() > 0) {
|
|
|
|
- classGroupService.batchIncreaseClassTimes(classGroups);
|
|
|
|
|
|
+ if (classGroupIds.size() > 0) {
|
|
|
|
+ classGroupService.batchIncreaseClassTimes(classGroupIds);
|
|
|
|
+
|
|
|
|
+ //查询班级信息
|
|
|
|
+ List<ClassGroup> classGroupList = classGroupService.findClassGroupByIds(classGroupIds.stream().map(e->e.toString()).collect(Collectors.joining(",")));
|
|
|
|
|
|
|
|
+ List<String> vipGroupIdList = new ArrayList<String>();
|
|
|
|
+ for(ClassGroup classGroup : classGroupList){
|
|
|
|
+ if(classGroup.getGroupType() == GroupType.VIP && classGroup.getCurrentClassTimes() == classGroup.getTotalClassTimes().intValue()){
|
|
|
|
+ if(!vipGroupIdList.contains(classGroup.getMusicGroupId())){
|
|
|
|
+ vipGroupIdList.add(classGroup.getMusicGroupId());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(vipGroupIdList.size() > 0){
|
|
|
|
+ List<VipGroup> vipGroupList = vipGroupDao.queryByIds(vipGroupIdList.stream().collect(Collectors.joining(",")));
|
|
|
|
+ for(VipGroup vipGroup : vipGroupList){
|
|
|
|
+ vipGroup.setStatus(VipGroupStatusEnum.FINISHED);
|
|
|
|
+ vipGroup.setUpdateTime(date);
|
|
|
|
+ }
|
|
|
|
+ vipGroupDao.batchUpdate(vipGroupList);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
if (courseScheduleIdList.size() > 0) {
|
|
if (courseScheduleIdList.size() > 0) {
|