|
@@ -30,18 +30,22 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
|
+import com.ym.mec.biz.dal.dao.ClassGroupDao;
|
|
|
import com.ym.mec.biz.dal.dao.ClassGroupTeacherMapperDao;
|
|
|
import com.ym.mec.biz.dal.dao.EmployeeDao;
|
|
|
import com.ym.mec.biz.dal.dto.BatchInsertCoursesDto;
|
|
|
import com.ym.mec.biz.dal.dto.CoursePostponeDto;
|
|
|
import com.ym.mec.biz.dal.dto.CreateCourseScheduleDto;
|
|
|
import com.ym.mec.biz.dal.dto.VipGroupCourseAdjustInfoDto;
|
|
|
+import com.ym.mec.biz.dal.entity.ClassGroup;
|
|
|
import com.ym.mec.biz.dal.entity.ClassGroupTeacherMapper;
|
|
|
import com.ym.mec.biz.dal.entity.CourseSchedule;
|
|
|
+import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
|
|
|
import com.ym.mec.biz.dal.entity.CourseScheduleComplaints;
|
|
|
import com.ym.mec.biz.dal.entity.Employee;
|
|
|
import com.ym.mec.biz.dal.entity.MusicGroup;
|
|
|
import com.ym.mec.biz.dal.enums.AuditStatusEnum;
|
|
|
+import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
|
|
|
import com.ym.mec.biz.dal.enums.GroupType;
|
|
|
import com.ym.mec.biz.dal.enums.TeachModeEnum;
|
|
|
import com.ym.mec.biz.dal.page.EndCourseScheduleQueryInfo;
|
|
@@ -75,6 +79,10 @@ public class CourseScheduleController extends BaseController {
|
|
|
private SysUserFeignService sysUserFeignService;
|
|
|
@Autowired
|
|
|
private MusicGroupService musicGroupService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ClassGroupDao classGroupDao;
|
|
|
+
|
|
|
@Autowired
|
|
|
private EmployeeDao employeeDao;
|
|
|
|
|
@@ -286,6 +294,16 @@ public class CourseScheduleController extends BaseController {
|
|
|
@PostMapping("/batchAddCourses")
|
|
|
@PreAuthorize("@pcs.hasPermissions('courseSchedule/batchAddCourses')")
|
|
|
public Object batchAddCourses(@RequestBody BatchInsertCoursesDto batchInsertCoursesDto){
|
|
|
+ if(batchInsertCoursesDto.getClassGroupId() == null){
|
|
|
+ if (batchInsertCoursesDto.getType() != CourseScheduleType.VIP && batchInsertCoursesDto.getType() != CourseScheduleType.PRACTICE) {
|
|
|
+ return failed("请指定班级");
|
|
|
+ }
|
|
|
+ List<ClassGroup> classGroupList = classGroupDao.findClassGroupByMusicGroupIdAndType(batchInsertCoursesDto.getMusicGroupId(), ClassGroupTypeEnum.valueOf(batchInsertCoursesDto.getType().getCode()));
|
|
|
+ if(classGroupList == null || classGroupList.size() == 0){
|
|
|
+ return failed("没有查询到班级信息");
|
|
|
+ }
|
|
|
+ batchInsertCoursesDto.setClassGroupId(classGroupList.get(0).getId());
|
|
|
+ }
|
|
|
scheduleService.batchAddCourseSchedule(batchInsertCoursesDto.getClassGroupId(), batchInsertCoursesDto.getCoursesTimes(),
|
|
|
batchInsertCoursesDto.getStartDate(), batchInsertCoursesDto.getTeachingArrangementList(), batchInsertCoursesDto.getTeachMode(),
|
|
|
batchInsertCoursesDto.getType(), batchInsertCoursesDto.getSchoolId(), batchInsertCoursesDto.getIsJumpHoliday());
|