| | |
| | | import com.mindskip.xzs.domain.vo.DepartmentExamineVO; |
| | | import com.mindskip.xzs.service.IDepartmentExamineService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.time.LocalDateTime; |
| | |
| | | |
| | | @RequestMapping(value = "list", method = RequestMethod.POST) |
| | | public RestResponse<PageInfo<DepartmentExamineVO>> list(@RequestBody DepartmentExamineVO departmentExamineVO) { |
| | | departmentExamineVO.setDeptIds(ObjectUtils.isNotEmpty(departmentExamineVO.getDeptIds()) ? departmentExamineVO.getDeptIds() : getAdminDeptIds()); |
| | | return RestResponse.ok(departmentExamineService.pageInfo(departmentExamineVO)); |
| | | } |
| | | |
| | |
| | | import com.mindskip.xzs.utility.PageInfoHelper; |
| | | import com.mindskip.xzs.viewmodel.admin.paper.ExamPaperAnswerPageRequestVM; |
| | | import com.mindskip.xzs.viewmodel.student.exampaper.ExamPaperAnswerPageResponseVM; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | |
| | | @RequestMapping(value = "/statistic", method = RequestMethod.POST) |
| | | public RestResponse<Map<String, Object>> statistic(@RequestBody ExamPaperStatisticVO examPaperStatisticVO) { |
| | | examPaperStatisticVO.setDepartmentId(isDeptAdmin() ? getAdminDeptIds() : null); |
| | | examPaperStatisticVO.setDepartmentId(ObjectUtils.isNotEmpty(examPaperStatisticVO.getDepartmentId()) ? examPaperStatisticVO.getDepartmentId() : getAdminDeptIds()); |
| | | return RestResponse.ok(examPaperAnswerService.statistic(examPaperStatisticVO)); |
| | | } |
| | | } |
| | |
| | | import com.mindskip.xzs.viewmodel.admin.exam.ExamPaperPageRequestVM; |
| | | import com.mindskip.xzs.viewmodel.admin.exam.ExamResponseVM; |
| | | import lombok.SneakyThrows; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | |
| | | @RequestMapping(value = "/page", method = RequestMethod.POST) |
| | | public RestResponse<PageInfo<ExamResponseVM>> pageList(@RequestBody ExamPaperPageRequestVM model) { |
| | | model.setDeptIds(isDeptAdmin() ? getAdminDeptIds() : null); |
| | | model.setDeptIds(ObjectUtils.isNotEmpty(model.getDeptIds()) ? model.getDeptIds() : getAdminDeptIds()); |
| | | if (Objects.nonNull(model.getLevel())) { |
| | | model.setDeptIds(Collections.singletonList(model.getLevel())); |
| | | } |
| | |
| | | import com.mindskip.xzs.service.*; |
| | | import com.mindskip.xzs.viewmodel.admin.paper.ExamPaperGradeQuery; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | |
| | | @RequestMapping(value = "/page", method = RequestMethod.POST) |
| | | public RestResponse<PageInfo<ExamPaperAnswer>> pageJudgeList(@RequestBody ExamPaperGradeQuery query) { |
| | | // 如果是部门管理员,需要做数据权限 |
| | | query.setDeptId(isDeptAdmin() ? getAdminDeptIds() : null); |
| | | query.setDeptId(ObjectUtils.isNotEmpty(query.getDeptId()) ? query.getDeptId() : getAdminDeptIds()); |
| | | query.setFullTime(); |
| | | // 查询 |
| | | PageInfo<ExamPaperAnswer> info = PageHelper.startPage(query.getPageIndex(), query.getPageSize()).doSelectPageInfo(() -> |
| | |
| | | import com.mindskip.xzs.utility.PageInfoHelper; |
| | | import com.mindskip.xzs.viewmodel.admin.exam.ExamPaperEditRequestVM; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | |
| | | @RequestMapping(value = "/list", method = RequestMethod.GET) |
| | | public RestResponse<PageInfo<ExamTemplatesVO>> list(ExamTemplatesVO examTemplatesVO) throws Exception { |
| | | // 如果是部门管理员,需要做数据权限 |
| | | examTemplatesVO.setDeptId(isDeptAdmin() ? getAdminDeptIds() : null); |
| | | examTemplatesVO.setDeptId(ObjectUtils.isNotEmpty(examTemplatesVO.getDeptId()) ? examTemplatesVO.getDeptId() : getAdminDeptIds()); |
| | | PageInfo<ExamTemplates> pageInfo = examTemplatesService.getByadmins(examTemplatesVO); |
| | | PageInfo<ExamTemplatesVO> info = PageInfoHelper.copyMap(pageInfo, e -> { |
| | | ExamTemplatesVO vo = new ExamTemplatesVO(); |
| | |
| | | |
| | | @RequestMapping(value = "/page/list", method = RequestMethod.POST) |
| | | public RestResponse<PageInfo<UserResponseVM>> pageList(@RequestBody UserPageRequestVM model) { |
| | | model.setDepartmentId(isDeptAdmin() ? getAdminDeptIds() : null); |
| | | model.setDepartmentId(ObjectUtils.isNotEmpty(model.getDepartmentId()) ? model.getDepartmentId() : getAdminDeptIds()); |
| | | PageInfo<User> pageInfo = userService.userPage(model); |
| | | PageInfo<UserResponseVM> page = PageInfoHelper.copyMap(pageInfo, d -> |
| | | UserResponseVM.from(d)); |
| | |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | private Integer pageSize; |
| | | |
| | | private List<Integer> deptIds; |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | private String userName; |
| | | private Integer role; |
| | | private List<Integer> roles; |
| | | |
| | | private List<Integer> departmentId; |
| | | |
| | | public List<Integer> getRoles() { |
| | | return roles; |
| | | } |
| | | |
| | | public void setRoles(List<Integer> roles) { |
| | | this.roles = roles; |
| | | } |
| | | |
| | | public List<Integer> getDepartmentId() { |
| | | return departmentId; |
| | | } |
| | |
| | | left join t_user c on a.create_user = c.id and c.deleted = 0 |
| | | left join t_user c2 on a.user_id = c2.id and c2.deleted = 0 |
| | | where a.deleted = 0 |
| | | <if test="deptIds != null and deptIds.size() > 0"> |
| | | and ( |
| | | b.id in <foreach collection="deptIds" item="item" index="index" open="(" separator="," close=")"> #{item} </foreach> |
| | | or b2.id in <foreach collection="deptIds" item="item" index="index" open="(" separator="," close=")"> #{item} </foreach> |
| | | ) |
| | | </if> |
| | | <if test="userName != null"> |
| | | and c2.real_name like concat('%', #{userName}, '%') |
| | | </if> |
| | | <if test="departmentIds != null"> |
| | | and FIND_IN_SET(#{departmentIds}, a.now_department_ids) |
| | | </if> |
| | | <if test="nowDepartmentIds != null"> |
| | | and FIND_IN_SET(#{nowDepartmentIds}, a.now_department_ids) |
| | | </if> |
| | | GROUP BY a.id, a.create_time |
| | | order by a.create_time desc |
| | | </select> |
| | |
| | | left join t_user_tag b on a.id = b.user_id |
| | | left join t_user_department c on a.id = c.user_id |
| | | where |
| | | user_name != 'admin' |
| | | user_name != 'admin' and a.status != 2 and a.deleted = 0 and (a.`condition` = 0 or a.`condition` is null) |
| | | <if test="tagId != null and tagId != ''"> |
| | | and b.tag_id = #{tagId} |
| | | </if> |
| | |
| | | <if test="userName != null and userName != ''"> |
| | | and real_name like concat('%',#{userName},'%') |
| | | </if> |
| | | <if test="role != null "> |
| | | and role= #{role} |
| | | <if test="role != null and role.size() > 0"> |
| | | and role in <foreach collection="role" item="item" open="(" separator="," close=")"> #{item} </foreach> |
| | | </if> |
| | | </select> |
| | | |