123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182 |
- package com.zhongzheng.controller.grade;
- import java.util.List;
- import java.util.Arrays;
- import com.zhongzheng.common.utils.ServletUtils;
- import com.zhongzheng.modules.grade.bo.*;
- import com.zhongzheng.modules.grade.service.IClassGradeInterfaceService;
- import com.zhongzheng.modules.grade.service.IClassGradeSysService;
- import com.zhongzheng.modules.grade.service.IClassGradeUserService;
- import com.zhongzheng.modules.grade.vo.*;
- import lombok.RequiredArgsConstructor;
- import org.springframework.security.access.prepost.PreAuthorize;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.GetMapping;
- import org.springframework.web.bind.annotation.PostMapping;
- import org.springframework.web.bind.annotation.PutMapping;
- import org.springframework.web.bind.annotation.DeleteMapping;
- import org.springframework.web.bind.annotation.PathVariable;
- import org.springframework.web.bind.annotation.RequestBody;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RestController;
- import com.zhongzheng.common.annotation.Log;
- import com.zhongzheng.common.core.controller.BaseController;
- import com.zhongzheng.common.core.domain.AjaxResult;
- import com.zhongzheng.common.enums.BusinessType;
- import com.zhongzheng.modules.grade.service.IClassGradeService;
- import com.zhongzheng.common.utils.poi.ExcelUtil;
- import com.zhongzheng.common.core.page.TableDataInfo;
- import io.swagger.annotations.Api;
- import io.swagger.annotations.ApiOperation;
- /**
- * 班级Controller
- *
- * @author ruoyi
- * @date 2021-11-10
- */
- @Api(value = "班级控制器", tags = {"班级管理"})
- @RequiredArgsConstructor(onConstructor_ = @Autowired)
- @RestController
- @RequestMapping("/grade/grade")
- public class ClassGradeController extends BaseController {
- private final IClassGradeService iClassGradeService;
- private final IClassGradeInterfaceService iClassGradeInterfaceService;
- private final IClassGradeSysService iClassGradeSysService;
- private final IClassGradeUserService iClassGradeUserService;
- /**
- * 查询班级列表
- */
- @ApiOperation("查询班级列表")
- @PreAuthorize("@ss.hasPermi('grade:grade:list')")
- @GetMapping("/list")
- public TableDataInfo<ClassGradeVo> list(ClassGradeQueryBo bo) {
- startPage();
- List<ClassGradeVo> list = iClassGradeService.queryList(bo);
- return getDataTable(list);
- }
- /**
- * 查询班级列表
- */
- @ApiOperation("查询班级学员列表")
- @PreAuthorize("@ss.hasPermi('grade:grade:list')")
- @GetMapping("/listGrade")
- public TableDataInfo<ClassGradeStudentVo> listGrade(ClassGradeQueryBo bo) {
- startPage();
- List<ClassGradeStudentVo> list = iClassGradeService.listGrade(bo);
- return getDataTable(list);
- }
- /**
- * 查询学员记录列表
- */
- @ApiOperation("查询学员记录列表")
- @PreAuthorize("@ss.hasPermi('grade:user:list')")
- @GetMapping("/listUser")
- public TableDataInfo<ClassGradeUserVo> list(ClassGradeUserQueryBo bo) {
- startPage();
- List<ClassGradeUserVo> list = iClassGradeUserService.queryList(bo);
- return getDataTable(list);
- }
- /**
- * 查询班主任记录列表
- */
- @ApiOperation("查询班主任记录列表")
- @PreAuthorize("@ss.hasPermi('grade:sys:list')")
- @GetMapping("/listSys")
- public TableDataInfo<ClassGradeSysVo> list(ClassGradeSysQueryBo bo) {
- startPage();
- List<ClassGradeSysVo> list = iClassGradeSysService.queryList(bo);
- return getDataTable(list);
- }
- /**
- * 查询班级列表
- */
- @ApiOperation("是否出现官方接口选择")
- @PreAuthorize("@ss.hasPermi('grade:grade:select')")
- @GetMapping("/select")
- public AjaxResult<Integer> select(ClassGradeAddBo bo) {
- boolean tenantId = ServletUtils.getRequest().getHeader("TenantId").equals("867735392558919680");
- return AjaxResult.success(tenantId ? 1 : 0);
- }
- /**
- * 查询官方接口
- */
- @ApiOperation("查询官方接口")
- @PreAuthorize("@ss.hasPermi('grade:grade:list')")
- @GetMapping("/listInterfaceVo")
- public TableDataInfo<ClassGradeInterfaceVo> list(ClassGradeInterfaceQueryBo bo) {
- startPage();
- List<ClassGradeInterfaceVo> list = iClassGradeInterfaceService.queryList(bo);
- return getDataTable(list);
- }
- /* *//**
- * 导出班级列表
- *//*
- @ApiOperation("导出班级列表")
- @PreAuthorize("@ss.hasPermi('modules.grade:grade:export')")
- @Log(title = "班级", businessType = BusinessType.EXPORT)
- @GetMapping("/export")
- public AjaxResult<ClassGradeVo> export(ClassGradeQueryBo bo) {
- List<ClassGradeVo> list = iClassGradeService.queryList(bo);
- ExcelUtil<ClassGradeVo> util = new ExcelUtil<ClassGradeVo>(ClassGradeVo.class);
- return util.exportExcel(list, "班级");
- }*/
- /**
- * 获取班级详细信息
- */
- @ApiOperation("获取班级详细信息")
- @PreAuthorize("@ss.hasPermi('grade:grade:query')")
- @GetMapping("/{classId}")
- public AjaxResult<ClassGradeVo> getInfo(@PathVariable("classId") Long classId) {
- return AjaxResult.success(iClassGradeService.queryById(classId));
- }
- /**
- * 新增班级
- */
- @ApiOperation("新增班级")
- @PreAuthorize("@ss.hasPermi('grade:grade:add')")
- @Log(title = "班级", businessType = BusinessType.INSERT)
- @PostMapping()
- public AjaxResult<Void> add(@RequestBody ClassGradeAddBo bo) {
- return toAjax(iClassGradeService.insertByAddBo(bo) ? 1 : 0);
- }
- /**
- * 修改班级
- */
- @ApiOperation("修改班级")
- @PreAuthorize("@ss.hasPermi('grade:grade:edit')")
- @Log(title = "班级", businessType = BusinessType.UPDATE)
- @PostMapping("/edit")
- public AjaxResult<Void> edit(@RequestBody ClassGradeEditBo bo) {
- return toAjax(iClassGradeService.updateByEditBo(bo) ? 1 : 0);
- }
- /* *//**
- * 删除班级
- *//*
- @ApiOperation("删除班级")
- @PreAuthorize("@ss.hasPermi('modules.grade:grade:remove')")
- @Log(title = "班级" , businessType = BusinessType.DELETE)
- @DeleteMapping("/{classIds}")
- public AjaxResult<Void> remove(@PathVariable Long[] classIds) {
- return toAjax(iClassGradeService.deleteWithValidByIds(Arrays.asList(classIds), true) ? 1 : 0);
- }*/
- }
|