123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208 |
- package com.ym.mec.web.controller;
- import com.ym.mec.biz.dal.dto.ClassGroupAdjustDto;
- import com.ym.mec.biz.dal.dto.HighClassGroupDto;
- import com.ym.mec.biz.dal.entity.ClassGroup;
- import com.ym.mec.biz.dal.entity.ClassGroupTeacherMapper;
- import com.ym.mec.biz.dal.enums.SalarySettlementTypeEnum;
- import com.ym.mec.biz.dal.page.queryMusicGroupCourseScheduleQueryInfo;
- import com.ym.mec.biz.service.ClassGroupService;
- import com.ym.mec.biz.service.ClassGroupTeacherMapperService;
- import com.ym.mec.common.controller.BaseController;
- import com.ym.mec.common.entity.HttpResponseResult;
- import com.ym.mec.common.page.QueryInfo;
- import io.swagger.annotations.*;
- import org.apache.commons.lang3.StringUtils;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.security.access.prepost.PreAuthorize;
- import org.springframework.web.bind.annotation.*;
- import java.util.Date;
- import java.util.List;
- @RequestMapping("classGroup")
- @Api(tags = "班级服务")
- @RestController
- public class ClassGroupController extends BaseController {
- @Autowired
- private ClassGroupService classGroupService;
- @Autowired
- private ClassGroupTeacherMapperService classGroupTeacherMapperService;
- @ApiOperation(value = "新增单技班班级")
- @PostMapping("/add")
- @PreAuthorize("@pcs.hasPermissions('classGroup/add')")
- public Object add(@RequestBody ClassGroup classGroup) throws Exception {
- return succeed(classGroupService.addClassGroup(classGroup));
- }
- @ApiOperation(value = "新增合奏班")
- @PostMapping("/addMixClass")
- @PreAuthorize("@pcs.hasPermissions('classGroup/addMixClass')")
- public Object addMixClass(@ApiParam(value = "乐团编号", required = true) @RequestParam String musicGroupId,
- @ApiParam(value = "班级名称", required = true) String name,
- @ApiParam(value = "班级编号,号分割", required = true) String classGroupIds) throws Exception {
- return succeed(classGroupService.addMixClassGroup(musicGroupId, name, classGroupIds));
- }
- @ApiOperation(value = "新增提高班")
- @PostMapping("/addHighClass")
- @PreAuthorize("@pcs.hasPermissions('classGroup/addHighClass')")
- @ApiParam(value = "乐团提高班json", required = true)
- public Object addHighClass(@RequestBody List<HighClassGroupDto> highClassGroupDtoList) throws Exception {
- if (highClassGroupDtoList.size() <= 0) {
- return failed("参数不合法");
- }
- return succeed(classGroupService.addHighClassGroup(highClassGroupDtoList));
- }
- @ApiOperation(value = "删除单技班")
- @PostMapping("/delSingle")
- @PreAuthorize("@pcs.hasPermissions('classGroup/delSingle')")
- public Object delSingle(Integer classGroupId) {
- classGroupService.delete(classGroupId);
- return succeed();
- }
- @ApiOperation(value = "删除合奏班")
- @PostMapping("/delMix")
- @PreAuthorize("@pcs.hasPermissions('classGroup/delMix')")
- public Object delMix(Integer classGroupId) {
- classGroupService.delete(classGroupId);
- return succeed();
- }
- @ApiOperation(value = "修改班级")
- @PostMapping("/update")
- @PreAuthorize("@pcs.hasPermissions('classGroup/update')")
- public Object update(ClassGroup classGroup) {
- classGroup.setUpdateTime(new Date());
- classGroupService.update(classGroup);
- return succeed();
- }
- @ApiOperation(value = "分页查询班级列表")
- @GetMapping("/queryPage")
- @PreAuthorize("@pcs.hasPermissions('classGroup/queryPage')")
- public Object queryPage(QueryInfo queryInfo) {
- return succeed(classGroupService.queryPage(queryInfo));
- }
- @ApiOperation(value = "合奏班相关班级获取")
- @GetMapping("/findClassGroupAboutMix")
- @PreAuthorize("@pcs.hasPermissions('classGroup/findClassGroupAboutMix')")
- public HttpResponseResult findClassGroupAboutMix(@ApiParam(value = "乐团编号", required = true) @RequestParam String musicGroupId,
- @ApiParam(value = "班级编号", required = false) Integer mixClassGroupId) {
- return succeed(classGroupService.findClassGroup(musicGroupId, mixClassGroupId));
- }
- @ApiOperation(value = "乐团单技班列表")
- @GetMapping("/findMusicGroupClass")
- @PreAuthorize("@pcs.hasPermissions('classGroup/findMusicGroupClass')")
- public HttpResponseResult findMusicGroupClass(@ApiParam(value = "乐团编号", required = true) @RequestParam String musicGroupId) {
- return succeed(classGroupService.findAllNormalClassGroupByMusicGroupId(musicGroupId));
- }
- @ApiOperation(value = "获取未分班的单技班列表")
- @GetMapping("/findNoClassSubjects")
- @PreAuthorize("@pcs.hasPermissions('classGroup/findNoClassSubjects')")
- public HttpResponseResult findNoClassSubjects(@ApiParam(value = "乐团编号", required = true) @RequestParam String musicGroupId) {
- return succeed(classGroupService.findNoClassSubjects(musicGroupId));
- }
- @ApiOperation(value = "乐团合奏班列表")
- @GetMapping("/findMixMusicGroupClass")
- @PreAuthorize("@pcs.hasPermissions('classGroup/findMixMusicGroupClass')")
- public HttpResponseResult findMixMusicGroupClass(@ApiParam(value = "乐团编号", required = true) @RequestParam String musicGroupId) {
- return succeed(classGroupService.findAllMixClassGroupByMusicGroupId(musicGroupId));
- }
- @ApiOperation(value = "乐团所有班级列表")
- @GetMapping("/findAllClassGroupByMusicGroup")
- @PreAuthorize("@pcs.hasPermissions('classGroup/findAllClassGroupByMusicGroup')")
- public HttpResponseResult findAllClassGroupByMusicGroup(@ApiParam(value = "乐团编号", required = true) @RequestParam String musicGroupId) {
- return succeed(classGroupService.findAllClassGroupByMusicGroup(musicGroupId));
- }
- @ApiOperation(value = "乐团详情--班级详情列表")
- @GetMapping("/queryMusicGroupClassGroup")
- @PreAuthorize("@pcs.hasPermissions('classGroup/queryMusicGroupClassGroup')")
- public HttpResponseResult queryMusicGroupClassGroup(QueryInfo queryInfo) {
- return succeed(classGroupService.queryMusicGroupClassGroup(queryInfo));
- }
- @ApiOperation(value = "乐团详情--课表详情列表")
- @GetMapping("/queryMusicGroupCourseSchedule")
- @PreAuthorize("@pcs.hasPermissions('classGroup/queryMusicGroupCourseSchedule')")
- public HttpResponseResult queryMusicGroupCourseSchedule(queryMusicGroupCourseScheduleQueryInfo queryInfo) {
- return succeed(classGroupService.queryMusicGroupCourseSchedule(queryInfo));
- }
- @ApiOperation(value = "乐团班级老师设置")
- @PostMapping("/addClassGroupTeacher")
- @ApiParam(value = "乐团班级老师json", required = true)
- @PreAuthorize("@pcs.hasPermissions('classGroup/addClassGroupTeacher')")
- public HttpResponseResult addClassGroupTeacher(@RequestBody List<ClassGroupTeacherMapper> classGroupTeacherMapperList) {
- if (classGroupTeacherMapperList.size() <= 0) {
- return failed("参数不合法");
- }
- return succeed(classGroupTeacherMapperService.classGroupTeachersInsert(classGroupTeacherMapperList));
- }
- @ApiOperation(value = "获取乐团班级老师")
- @GetMapping("/findMusicGroupClassTeacher")
- @PreAuthorize("@pcs.hasPermissions('classGroup/findMusicGroupClassTeacher')")
- public HttpResponseResult findMusicGroupClassTeacher(@ApiParam(value = "乐团编号", required = true) @RequestParam String musicGroupId) {
- return succeed(classGroupService.getClassGroupAndTeachers(musicGroupId, "NORMAL,MIX"));
- }
- @ApiOperation(value = "获取乐团班级老师课酬")
- @GetMapping("/findMusicGroupClassTeacherSalary")
- @PreAuthorize("@pcs.hasPermissions('classGroup/findMusicGroupClassTeacherSalary')")
- @ApiImplicitParams({@ApiImplicitParam(name = "musicGroupId", value = "乐团编号", required = true, dataType = "String"),
- @ApiImplicitParam(name = "type", value = "结算类型(1-基准课酬,4-梯度课酬)", required = true, dataType = "Integer")})
- public HttpResponseResult findMusicGroupClassTeacherSalary(String musicGroupId, SalarySettlementTypeEnum type) {
- try {
- return succeed(classGroupService.getClassGroupAndTeacherSalary(musicGroupId, type));
- } catch (Exception e) {
- return failed(e.getMessage());
- }
- }
- @ApiOperation(value = "乐团班级老师课酬确认")
- @PostMapping("/setClassGroupTeacherSalary")
- @PreAuthorize("@pcs.hasPermissions('classGroup/setClassGroupTeacherSalary')")
- @ApiParam(value = "乐团班级老师<包含相应课酬>json", required = true)
- public Object setClassGroupTeacherSalary(@RequestBody List<ClassGroupTeacherMapper> classGroupTeacherMapperList) throws Exception {
- if (classGroupTeacherMapperList.size() <= 0) {
- return failed("参数不合法");
- }
- return succeed(classGroupTeacherMapperService.classGroupTeacherMapperUpdate(classGroupTeacherMapperList));
- }
- @ApiOperation(value = "乐团班级设置,成团确认")
- @PostMapping("/addMusicGroupTeam")
- @PreAuthorize("@pcs.hasPermissions('classGroup/addMusicGroupTeam')")
- @ApiImplicitParams({@ApiImplicitParam(name = "musicGroupId", value = "乐团编号", required = true, dataType = "String"),
- @ApiImplicitParam(name = "teacherId", value = "老师编号", required = true, dataType = "Integer")})
- public Object addMusicGroupTeam(Integer teacherId, String musicGroupId, Integer improventClassesNum) throws Exception {
- if (teacherId == null || StringUtils.isEmpty(musicGroupId) || improventClassesNum == null) {
- return failed("参数校验错误");
- }
- classGroupService.addMusicGroupTeam(teacherId, musicGroupId, improventClassesNum);
- return succeed();
- }
- @ApiOperation(value = "调整班级(添加班级)")
- @PostMapping("/revisionClassGroup")
- @PreAuthorize("@pcs.hasPermissions('classGroup/revisionClassGroup')")
- @ApiImplicitParams({@ApiImplicitParam(name = "classGroupIds", value = "班级编号,号分割", required = true, dataType = "String")})
- public HttpResponseResult revisionClassGroup(@RequestBody ClassGroupAdjustDto classGroupAdjustDto) throws Exception {
- return succeed(classGroupService.classGroupAdjust(classGroupAdjustDto));
- }
- }
|