|
@@ -1,15 +1,15 @@
|
|
|
package com.ym.mec.biz.service.impl;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.ym.mec.biz.dal.dao.*;
|
|
|
-import com.ym.mec.biz.dal.dto.StudentServeCourseDto;
|
|
|
-import com.ym.mec.biz.dal.dto.StudentServeCourseHomeworkDto;
|
|
|
-import com.ym.mec.biz.dal.dto.StudentServeDto;
|
|
|
-import com.ym.mec.biz.dal.dto.StudentServiceHomeworkDto;
|
|
|
+import com.ym.mec.biz.dal.dto.*;
|
|
|
import com.ym.mec.biz.dal.entity.*;
|
|
|
import com.ym.mec.biz.dal.enums.GroupType;
|
|
|
import com.ym.mec.biz.dal.enums.TeachModeEnum;
|
|
|
+import com.ym.mec.biz.dal.enums.TeachTypeEnum;
|
|
|
import com.ym.mec.biz.dal.enums.YesOrNoEnum;
|
|
|
import com.ym.mec.biz.service.StudentServeService;
|
|
|
+import com.ym.mec.biz.service.SysConfigService;
|
|
|
import com.ym.mec.common.exception.BizException;
|
|
|
import com.ym.mec.util.date.DateUtil;
|
|
|
import org.apache.commons.lang3.ArrayUtils;
|
|
@@ -47,6 +47,10 @@ public class StudentServeServiceImpl implements StudentServeService {
|
|
|
private StudentExtracurricularExercisesSituationDao studentExtracurricularExercisesSituationDao;
|
|
|
@Autowired
|
|
|
private StudentServeService studentServeService;
|
|
|
+ @Autowired
|
|
|
+ private ClassGroupTeacherMapperDao classGroupTeacherMapperDao;
|
|
|
+ @Autowired
|
|
|
+ private SysConfigService sysConfigService;
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@@ -307,6 +311,26 @@ public class StudentServeServiceImpl implements StudentServeService {
|
|
|
LocalDate sunDayDate = nowDate.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.SUNDAY.getValue());
|
|
|
Date nextMonday = Date.from(sunDayDate.plusDays(1).atStartOfDay(DateUtil.zoneId).toInstant());
|
|
|
|
|
|
+ Set<String> holidayDays = new HashSet<>();
|
|
|
+ SysConfig holidaySetting = sysConfigService.findByParamName(SysConfigService.HOLIDAY_SETTING);
|
|
|
+ if(Objects.nonNull(holidaySetting)&&StringUtils.isNotBlank(holidaySetting.getParanValue())){
|
|
|
+ holidayDays = new HashSet<>(JSON.parseArray(holidaySetting.getParanValue(), String.class));
|
|
|
+ }
|
|
|
+ LocalDate everyDay=monDayDate;
|
|
|
+ boolean weekInHoliday = true;
|
|
|
+ while (everyDay.compareTo(sunDayDate)<=0){
|
|
|
+ if(!holidayDays.contains(everyDay.toString())){
|
|
|
+ weekInHoliday = false;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ everyDay = everyDay.plusDays(1);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(weekInHoliday){
|
|
|
+ studentExtracurricularExercisesSituationDao.deleteByMonday(monDayDate.toString(), studentIds);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
// int weekServiceNum = studentExtracurricularExercisesSituationDao.countWeekServiceNum(monDayDate.toString());
|
|
|
// if(weekServiceNum>0&&CollectionUtils.isEmpty(studentIds)){
|
|
|
// return;
|
|
@@ -411,8 +435,12 @@ public class StudentServeServiceImpl implements StudentServeService {
|
|
|
|
|
|
Map<Integer, Integer> teacherNumMap = new HashMap<>();
|
|
|
for (String groupId : groupCourseInfo.keySet()) {
|
|
|
- CourseSchedule studentHistoryLastCourse = courseScheduleStudentPaymentDao.getStudentHistoryLastCourse(studentCourseMapEntry.getKey(), monDayDate.toString(), groupId, CourseSchedule.CourseScheduleType.SINGLE);
|
|
|
- Integer teacherId = Objects.isNull(studentHistoryLastCourse)?studentCourseMapEntry.getValue().get(0).getLeadTeacherId():studentHistoryLastCourse.getActualTeacherId();
|
|
|
+ Integer teacherId = null;
|
|
|
+ List<BaseMapDto<Integer, Integer>> studentTeacherIdList = courseScheduleStudentPaymentDao.getStudentClassGroupBishopTeacherMap(null, groupId);
|
|
|
+ if(!CollectionUtils.isEmpty(studentTeacherIdList)){
|
|
|
+ teacherId = studentTeacherIdList.get(0).getValue();
|
|
|
+ }
|
|
|
+ teacherId = Objects.isNull(teacherId)?studentCourseMapEntry.getValue().get(0).getLeadTeacherId():teacherId;
|
|
|
if(Objects.isNull(teacherId)){
|
|
|
continue;
|
|
|
}
|