|
@@ -112,6 +112,7 @@ import com.ym.mec.biz.dal.page.StudentCourseScheduleRecordQueryInfo;
|
|
import com.ym.mec.biz.dal.page.VipGroupQueryInfo;
|
|
import com.ym.mec.biz.dal.page.VipGroupQueryInfo;
|
|
import com.ym.mec.biz.service.ClassGroupService;
|
|
import com.ym.mec.biz.service.ClassGroupService;
|
|
import com.ym.mec.biz.service.ClassGroupTeacherMapperService;
|
|
import com.ym.mec.biz.service.ClassGroupTeacherMapperService;
|
|
|
|
+import com.ym.mec.biz.service.CourseHomeworkService;
|
|
import com.ym.mec.biz.service.CourseScheduleService;
|
|
import com.ym.mec.biz.service.CourseScheduleService;
|
|
import com.ym.mec.biz.service.CourseScheduleStudentPaymentService;
|
|
import com.ym.mec.biz.service.CourseScheduleStudentPaymentService;
|
|
import com.ym.mec.biz.service.CourseScheduleTeacherSalaryService;
|
|
import com.ym.mec.biz.service.CourseScheduleTeacherSalaryService;
|
|
@@ -189,6 +190,10 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
private MusicGroupService musicGroupService;
|
|
private MusicGroupService musicGroupService;
|
|
@Autowired
|
|
@Autowired
|
|
private SysConfigService sysConfigService;
|
|
private SysConfigService sysConfigService;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private CourseHomeworkService courseHomeworkService;
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
private GroupDao groupDao;
|
|
private GroupDao groupDao;
|
|
@Autowired
|
|
@Autowired
|
|
@@ -1786,6 +1791,8 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
Date entryDate = DateUtil.stringToDate(sysConfigDao.findByParamName(SysConfigService.TEACHER_ENTRY_DATE).getParanValue(), "yyyy-MM-dd");
|
|
Date entryDate = DateUtil.stringToDate(sysConfigDao.findByParamName(SysConfigService.TEACHER_ENTRY_DATE).getParanValue(), "yyyy-MM-dd");
|
|
|
|
|
|
List<CourseScheduleModifyLog> insertCourseScheduleModifyLogList = new ArrayList<CourseScheduleModifyLog>();
|
|
List<CourseScheduleModifyLog> insertCourseScheduleModifyLogList = new ArrayList<CourseScheduleModifyLog>();
|
|
|
|
+
|
|
|
|
+ List<CourseScheduleStudentPayment> insertCourseScheduleStudentPaymentList = new ArrayList<CourseScheduleStudentPayment>();
|
|
|
|
|
|
for (CourseSchedule newCourseSchedule : newCourseSchedules) {
|
|
for (CourseSchedule newCourseSchedule : newCourseSchedules) {
|
|
courseScheduleId = newCourseSchedule.getId();
|
|
courseScheduleId = newCourseSchedule.getId();
|
|
@@ -1817,9 +1824,33 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- //如果已结束修改成了未开始,需要更新学生考勤记录
|
|
|
|
if ((newCourseSchedule.getStatus() != oldCourseSchedule.getStatus() && newCourseSchedule.getStatus() == CourseStatusEnum.NOT_START)) {
|
|
if ((newCourseSchedule.getStatus() != oldCourseSchedule.getStatus() && newCourseSchedule.getStatus() == CourseStatusEnum.NOT_START)) {
|
|
|
|
+ //如果已结束修改成了未开始,需要更新学生考勤记录
|
|
studentAttendanceDao.deleteStudentAttendancesByCourse(courseScheduleId);
|
|
studentAttendanceDao.deleteStudentAttendancesByCourse(courseScheduleId);
|
|
|
|
+
|
|
|
|
+ if(newCourseSchedule.getGroupType() == GroupType.MUSIC){
|
|
|
|
+ //查询新生(之前排课没有这个人,后来新进来的学生)
|
|
|
|
+ List<ClassGroupStudentMapper> newStudentList = classGroupStudentMapperDao.queryNewStudentListByCourseScheduleId(courseScheduleId);
|
|
|
|
+ if(newStudentList.size() > 0){
|
|
|
|
+ //生成courseScheduleStudentPayment记录
|
|
|
|
+ for(ClassGroupStudentMapper cgsm : newStudentList){
|
|
|
|
+ CourseScheduleStudentPayment sp = new CourseScheduleStudentPayment();
|
|
|
|
+ sp.setClassGroupId(newCourseSchedule.getClassGroupId());
|
|
|
|
+ sp.setCourseScheduleId(courseScheduleId);
|
|
|
|
+ sp.setCreateTime(date);
|
|
|
|
+ sp.setExpectPrice(new BigDecimal(0));
|
|
|
|
+ sp.setGroupType(GroupType.MUSIC);
|
|
|
|
+ sp.setMusicGroupId(newCourseSchedule.getMusicGroupId());
|
|
|
|
+ sp.setUpdateTime(date);
|
|
|
|
+ sp.setUserId(cgsm.getUserId());
|
|
|
|
+
|
|
|
|
+ insertCourseScheduleStudentPaymentList.add(sp);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //清理课程作业
|
|
|
|
+ courseHomeworkService.delHomwworkByCourseScheduleId(courseScheduleId);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
// 计算课程时长
|
|
// 计算课程时长
|
|
@@ -1966,6 +1997,10 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
if(newCourseSchedules.size() > 0){
|
|
if(newCourseSchedules.size() > 0){
|
|
courseScheduleDao.batchUpdate(newCourseSchedules);
|
|
courseScheduleDao.batchUpdate(newCourseSchedules);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if(insertCourseScheduleStudentPaymentList.size() > 0){
|
|
|
|
+ courseScheduleStudentPaymentDao.batchInsert(insertCourseScheduleStudentPaymentList);
|
|
|
|
+ }
|
|
|
|
|
|
// 推送
|
|
// 推送
|
|
try {
|
|
try {
|
|
@@ -3110,4 +3145,19 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
teacherIdMap, null, 0, "7","TEACHER");
|
|
teacherIdMap, null, 0, "7","TEACHER");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
+ public void cleanAttendance(String courseScheduleIds) {
|
|
|
|
+ SysUser user = sysUserFeignService.queryUserInfo();
|
|
|
|
+ if (null == user) {
|
|
|
|
+ throw new BizException("获取用户信息失败");
|
|
|
|
+ }
|
|
|
|
+ if(StringUtils.isEmpty(courseScheduleIds)){
|
|
|
|
+ throw new BizException("参数校验失败");
|
|
|
|
+ }
|
|
|
|
+ LOGGER.info("清空老师和学生考勤,user:{},参数:{}",user.getId(),courseScheduleIds);
|
|
|
|
+ teacherAttendanceDao.batchCleanCourseTeacherSign(courseScheduleIds);
|
|
|
|
+ studentAttendanceDao.batchCleanCourseStudentSign(courseScheduleIds);
|
|
|
|
+ }
|
|
}
|
|
}
|