|
@@ -2,16 +2,20 @@ package com.ym.mec.web.controller;
|
|
|
|
|
|
import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
|
+import com.ym.mec.biz.dal.dao.ClassGroupStudentMapperDao;
|
|
|
import com.ym.mec.biz.dal.dao.EmployeeDao;
|
|
|
import com.ym.mec.biz.dal.entity.Employee;
|
|
|
import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
|
|
|
import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
|
|
|
+import com.ym.mec.biz.dal.entity.StudentRegistration;
|
|
|
+import com.ym.mec.biz.dal.enums.ClassGroupStudentStatusEnum;
|
|
|
import com.ym.mec.biz.dal.page.MusicGroupPaymentCalenderQueryInfo;
|
|
|
import com.ym.mec.biz.service.MusicGroupPaymentCalenderCourseSettingsService;
|
|
|
import com.ym.mec.biz.service.MusicGroupPaymentCalenderService;
|
|
|
import com.ym.mec.common.controller.BaseController;
|
|
|
import com.ym.mec.common.entity.HttpResponseResult;
|
|
|
|
|
|
+import com.ym.mec.common.exception.BizException;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
@@ -20,10 +24,13 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.MediaType;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.ui.ModelMap;
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
+import java.util.Objects;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@RequestMapping("musicGroupPaymentCalender")
|
|
@@ -39,6 +46,8 @@ public class MusicGroupPaymentCalenderController extends BaseController {
|
|
|
private SysUserFeignService sysUserFeignService;
|
|
|
@Autowired
|
|
|
private EmployeeDao employeeDao;
|
|
|
+ @Autowired
|
|
|
+ private ClassGroupStudentMapperDao classGroupStudentMapperDao;
|
|
|
|
|
|
@ApiOperation(value = "分页查询乐团缴费日历列表")
|
|
|
@GetMapping(value = "/queryPage", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
|
@@ -132,10 +141,18 @@ public class MusicGroupPaymentCalenderController extends BaseController {
|
|
|
@ApiOperation(value = "获取指定学员在指定乐团下本次课排课时长")
|
|
|
@GetMapping("/getMusicCourseSettingsWithStudents")
|
|
|
@PreAuthorize("@pcs.hasPermissions('musicGroupPaymentCalender/getMusicCourseSettingsWithStudents')")
|
|
|
- public HttpResponseResult<List<MusicGroupPaymentCalenderCourseSettings>> getMusicCourseSettingsWithStudents(String musicGroupId, String studentIds){
|
|
|
- if(StringUtils.isBlank(studentIds)){
|
|
|
- return failed("请指定学员编号");
|
|
|
+ public HttpResponseResult<List<MusicGroupPaymentCalenderCourseSettings>> getMusicCourseSettingsWithStudents(String musicGroupId, String studentIds, Long classGroupId){
|
|
|
+ List<Integer> studentIdList = new ArrayList<>();
|
|
|
+ if(StringUtils.isNotBlank(studentIds)){
|
|
|
+ studentIdList = Arrays.stream(studentIds.split(",")).map(id -> Integer.valueOf(id)).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+ if(Objects.nonNull(classGroupId)){
|
|
|
+ List<StudentRegistration> studentList = classGroupStudentMapperDao.findClassStudentList(classGroupId.intValue(), ClassGroupStudentStatusEnum.NORMAL);
|
|
|
+ studentIdList = studentList.stream().map(StudentRegistration::getUserId).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+ if(CollectionUtils.isEmpty(studentIdList)){
|
|
|
+ throw new BizException("未指定学员");
|
|
|
}
|
|
|
- return succeed(musicGroupPaymentCalenderCourseSettingsService.getMusicCourseSettingsWithStudents(musicGroupId,Arrays.stream(studentIds.split(",")).map(id -> Integer.valueOf(id)).collect(Collectors.toList())));
|
|
|
+ return succeed(musicGroupPaymentCalenderCourseSettingsService.getMusicCourseSettingsWithStudents(musicGroupId,studentIdList));
|
|
|
}
|
|
|
}
|