|
@@ -28,6 +28,7 @@ import org.apache.commons.lang3.ArrayUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.MediaType;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.ui.ModelMap;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
import org.springframework.util.StringUtils;
|
|
@@ -170,6 +171,29 @@ public class CourseScheduleController extends BaseController {
|
|
|
return succeed();
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "根据班级列表调整课程")
|
|
|
+ @PreAuthorize("@pcs.hasPermissions('courseSchedule/classGroupTeacherAdjust','system')")
|
|
|
+ @PostMapping(value = "/classGroupTeacherAdjust")
|
|
|
+ public Object classGroupTeacherAdjust(String classGroupIds,Integer teacherId,Integer targetTeacherId){
|
|
|
+ List<CourseSchedule> courseSchedules = scheduleService.queryNoStartCourseByTeacherId(classGroupIds,teacherId,"BISHOP");
|
|
|
+ if(courseSchedules.size() > 0){
|
|
|
+ courseSchedules.forEach(e->{
|
|
|
+ e.setActualTeacherId(targetTeacherId);
|
|
|
+ });
|
|
|
+ scheduleService.courseAdjust(courseSchedules);
|
|
|
+ }
|
|
|
+ List<CourseSchedule> courseSchedules1 = scheduleService.queryNoStartCourseByTeacherId(classGroupIds, teacherId, "TEACHING");
|
|
|
+ if(courseSchedules1.size() > 0){
|
|
|
+ List<Integer> teachingTeacherIdList = new ArrayList<Integer>();
|
|
|
+ teachingTeacherIdList.add(targetTeacherId);
|
|
|
+ courseSchedules.forEach(e->{
|
|
|
+ e.setTeachingTeacherIdList(teachingTeacherIdList);
|
|
|
+ });
|
|
|
+ scheduleService.courseAdjust(courseSchedules1);
|
|
|
+ }
|
|
|
+ return succeed();
|
|
|
+ }
|
|
|
+
|
|
|
@ApiOperation(value = "课时调整-批量")
|
|
|
@PreAuthorize("@pcs.hasPermissions('courseSchedule/batchClassStartDateAdjust')")
|
|
|
@PostMapping(value = "/batchClassStartDateAdjust")
|
|
@@ -352,8 +376,15 @@ public class CourseScheduleController extends BaseController {
|
|
|
@ApiOperation(value = "陪练课课程组老师调整")
|
|
|
@PostMapping("/practiceGroupTeacherAdjust")
|
|
|
@PreAuthorize("@pcs.hasPermissions('courseSchedule/practiceGroupTeacherAdjust')")
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public Object practiceGroupTeacherAdjust(String practiceGroupId, Integer teacherId, Integer subjectId, Integer educationalTeacherId){
|
|
|
- scheduleService.practiceGroupTeacherAdjust(practiceGroupId,teacherId,subjectId, educationalTeacherId);
|
|
|
+ if(StringUtils.isEmpty(practiceGroupId)){
|
|
|
+ throw new BizException("参数校验失败");
|
|
|
+ }
|
|
|
+ String[] split = practiceGroupId.split(",");
|
|
|
+ for (int i = 0; i < split.length; i++) {
|
|
|
+ scheduleService.practiceGroupTeacherAdjust(split[i],teacherId,subjectId, educationalTeacherId);
|
|
|
+ }
|
|
|
return succeed();
|
|
|
}
|
|
|
|