| | |
| | | ).permitAll() |
| | | .antMatchers("/files/**").permitAll() |
| | | // 静态资源,可匿名访问 |
| | | // todo 设置部门管理员可以看的请求 |
| | | .antMatchers("/api/admin/**").hasAnyRole(RoleEnum.ADMIN.getName(), RoleEnum.DEPT_ADMIN.getName()) |
| | | .antMatchers("/api/student/**").hasAnyRole(RoleEnum.STUDENT.getName(), RoleEnum.DEPT_ADMIN.getName()) |
| | | .anyRequest().permitAll() |
| | |
| | | |
| | | @RequestMapping(value = "/selectStudent", method = RequestMethod.POST) |
| | | public RestResponse<PageInfo<UserVO>> selectStudent(@RequestBody UserVO userVO) { |
| | | return RestResponse.ok(examPaperService.selectStudent(userVO)); |
| | | List<Integer> adminDeptIds = getAdminDeptIds(); |
| | | return RestResponse.ok(examPaperService.selectStudent(userVO, adminDeptIds)); |
| | | } |
| | | } |
| | |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | public class UserVO implements Serializable { |
| | | |
| | |
| | | |
| | | private Integer tagId; |
| | | |
| | | private Integer deptId; |
| | | private List<Integer> deptIds; |
| | | |
| | | private Integer pageIndex; |
| | | |
| | | private Integer pageSize; |
| | | |
| | | public List<Integer> getDeptIds() { |
| | | return deptIds; |
| | | } |
| | | |
| | | public void setDeptIds(List<Integer> deptIds) { |
| | | this.deptIds = deptIds; |
| | | } |
| | | |
| | | public Integer getPageIndex() { |
| | | return pageIndex; |
| | |
| | | this.tagId = tagId; |
| | | } |
| | | |
| | | public Integer getDeptId() { |
| | | return deptId; |
| | | } |
| | | |
| | | public void setDeptId(Integer deptId) { |
| | | this.deptId = deptId; |
| | | } |
| | | |
| | | public String getConditionDetail() { |
| | | return conditionDetail; |
| | |
| | | |
| | | List<ExamPaper> list(List<Integer> deptIds); |
| | | |
| | | PageInfo<UserVO> selectStudent(UserVO userVO); |
| | | /** |
| | | * 获取部门的学生 |
| | | * |
| | | * @param userVO |
| | | * @param adminDeptIds |
| | | * @return |
| | | */ |
| | | PageInfo<UserVO> selectStudent(UserVO userVO, List<Integer> adminDeptIds); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public PageInfo<UserVO> selectStudent(UserVO userVO) { |
| | | public PageInfo<UserVO> selectStudent(UserVO userVO, List<Integer> adminDeptIds) { |
| | | userVO.setDeptIds(ObjectUtils.isNotEmpty(userVO.getDeptIds()) ? userVO.getDeptIds() : adminDeptIds); |
| | | return PageHelper.startPage(userVO.getPageIndex(), userVO.getPageSize()).doSelectPageInfo(() -> |
| | | examPaperMapper.selectStudent(userVO)); |
| | | } |
| | |
| | | <if test="tagId != null and tagId != ''"> |
| | | and b.tag_id = #{tagId} |
| | | </if> |
| | | <if test="deptId != null and deptId != ''"> |
| | | and c.department_id = #{deptId} |
| | | <if test="deptIds != null and deptIds.size > 0"> |
| | | and c.department_id in |
| | | <foreach collection="deptIds" open="(" separator="," close=")" item="deptId"> |
| | | #{deptId} |
| | | </foreach> |
| | | </if> |
| | | group by a.id, a.real_name |
| | | order by a.id |