Browse Source

android获取待布置的学员列表,新增筛选条件

zouxuan 3 years ago
parent
commit
5be9b0bcb3

+ 2 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ExtracurricularExercisesDao.java

@@ -42,7 +42,8 @@ public interface ExtracurricularExercisesDao extends BaseDAO<Long, Extracurricul
                                                                     @Param("classGroupId") Long classGroupId,
                                                                     @Param("subjectId") Integer subjectId,
                                                                     @Param("search") String search,
-                                                                    @Param("hasMember") Integer hasMember);
+                                                                    @Param("hasMember") Integer hasMember,
+                                                                    @Param("studentIds") String studentIds);
 
     /**
      * 获取老师已布置训练列表

+ 7 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/ExtracurricularExercisesService.java

@@ -39,7 +39,13 @@ public interface ExtracurricularExercisesService extends BaseService<Long, Extra
      * @param search:
      * @return java.util.List<com.ym.mec.biz.dal.dto.SimpleUserDto>
      */
-    List<BasicUserDto> getDontServeStudents(Integer teacherId, String search, String musicGroupId,Long classGroupId,Integer subjectId,Integer hasMember);
+    List<BasicUserDto> getDontServeStudents(Integer teacherId,
+                                            String search,
+                                            String musicGroupId,
+                                            Long classGroupId,
+                                            Integer subjectId,
+                                            Integer hasMember,
+                                            String studentIds);
 
     /**
      * @describe 应布置课外训练提醒

+ 8 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExtracurricularExercisesServiceImpl.java

@@ -192,10 +192,16 @@ public class ExtracurricularExercisesServiceImpl extends BaseServiceImpl<Long, E
 	}
 
 	@Override
-	public List<BasicUserDto> getDontServeStudents(Integer teacherId, String search, String musicGroupId,Long classGroupId,Integer subjectId,Integer hasMember) {
+	public List<BasicUserDto> getDontServeStudents(Integer teacherId,
+												   String search,
+												   String musicGroupId,
+												   Long classGroupId,
+												   Integer subjectId,
+												   Integer hasMember,
+												   String studentIds) {
 		LocalDate nowDate = LocalDateTime.now(DateUtil.zoneId).toLocalDate();
 		LocalDate monDayDate = nowDate.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.MONDAY.getValue());
-		return extracurricularExercisesDao.findNoExercisesStudentsInThisWeekWithTeacher(teacherId, monDayDate.toString(), musicGroupId, classGroupId, subjectId, search,hasMember);
+		return extracurricularExercisesDao.findNoExercisesStudentsInThisWeekWithTeacher(teacherId, monDayDate.toString(), musicGroupId, classGroupId, subjectId, search,hasMember,studentIds);
 	}
 
 	@Override

+ 3 - 0
mec-biz/src/main/resources/config/mybatis/ExtracurricularExercisesMapper.xml

@@ -187,6 +187,9 @@
 					AND stu.member_rank_setting_id_ IS NULL
 				</if>
 			</if>
+			<if test="studentIds!=null and studentIds!=''">
+				AND FIND_IN_SET(sees.student_id_,#{studentIds})
+			</if>
 			<if test="musicGroupId!=null and musicGroupId!=''">
 				AND sr.music_group_id_=#{musicGroupId}
 			</if>

+ 4 - 6
mec-teacher/src/main/java/com/ym/mec/teacher/controller/ExtracurricularExercisesController.java

@@ -3,7 +3,6 @@ package com.ym.mec.teacher.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.CourseScheduleStudentPaymentDao;
 import com.ym.mec.biz.dal.dao.StudentDao;
 import com.ym.mec.biz.dal.dao.StudentRegistrationDao;
 import com.ym.mec.biz.dal.dto.BasicUserDto;
@@ -23,7 +22,6 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
-import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.*;
 
@@ -130,12 +128,12 @@ public class ExtracurricularExercisesController extends BaseController {
 
     @ApiOperation(value = "获取待布置学员列表")
     @GetMapping("/getDontServeStudents")
-    public HttpResponseResult getDontServeStudents(String search, String musicGroupId, Long classGroupId, Integer subjectId,Integer hasMember){
+    public HttpResponseResult getDontServeStudents(String search, String musicGroupId, Long classGroupId, Integer subjectId,Integer hasMember,String studentIds){
         SysUser sysUser = sysUserFeignService.queryUserInfo();
         if(Objects.isNull(sysUser)){
             return failed(HttpStatus.FORBIDDEN,"请登录");
         }
-        return succeed(extracurricularExercisesService.getDontServeStudents(sysUser.getId(), search, musicGroupId, classGroupId, subjectId,hasMember));
+        return succeed(extracurricularExercisesService.getDontServeStudents(sysUser.getId(), search, musicGroupId, classGroupId, subjectId,hasMember,studentIds));
     }
 
     @ApiOperation(value = "获取待布置学员乐团列表")
@@ -145,7 +143,7 @@ public class ExtracurricularExercisesController extends BaseController {
         if(Objects.isNull(sysUser)){
             return failed(HttpStatus.FORBIDDEN,"请登录");
         }
-        List<BasicUserDto> dontServeStudents = extracurricularExercisesService.getDontServeStudents(sysUser.getId(), search, null, null,null,null);
+        List<BasicUserDto> dontServeStudents = extracurricularExercisesService.getDontServeStudents(sysUser.getId(), search, null, null,null,null,null);
         if(CollectionUtils.isEmpty(dontServeStudents)){
             return succeed(Collections.emptyList());
         }
@@ -162,7 +160,7 @@ public class ExtracurricularExercisesController extends BaseController {
             return failed(HttpStatus.FORBIDDEN,"请登录");
         }
         Map<String, Object> result = new HashMap<>();
-        List<BasicUserDto> dontServeStudents = extracurricularExercisesService.getDontServeStudents(sysUser.getId(), null, null, null, null,null);
+        List<BasicUserDto> dontServeStudents = extracurricularExercisesService.getDontServeStudents(sysUser.getId(), null, null, null, null,null,null);
         if(CollectionUtils.isEmpty(dontServeStudents)){
             result.put("musicGroups", Collections.emptyList());
             result.put("classGroups", Collections.emptyList());