| | |
| | | package com.ots.project.exam.controller; |
| | | |
| | | import com.ots.common.utils.poi.ExcelUtil; |
| | | import com.ots.framework.aspectj.lang.annotation.Log; |
| | | import com.ots.framework.aspectj.lang.enums.BusinessType; |
| | |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.ModelMap; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 维度表Controller |
| | | * |
| | | * @author ots |
| | | * @date 2019-12-09 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/exam/subject") |
| | | public class TSubjectController extends BaseController { |
| | | private String prefix = "exam/subject"; |
| | | |
| | | @Autowired |
| | | private ITSubjectService tSubjectService; |
| | | |
| | | @RequiresPermissions("exam:subject:view") |
| | | @GetMapping() |
| | | public String subject() { |
| | | return prefix + "/subject"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询维度表列表 |
| | | */ |
| | | @RequiresPermissions("exam:subject:list") |
| | | @PostMapping("/list") |
| | | @ResponseBody |
| | |
| | | List<TSubject> list = tSubjectService.selectTSubjectList(tSubject); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 导出维度表列表 |
| | | */ |
| | | @RequiresPermissions("exam:subject:export") |
| | | @PostMapping("/export") |
| | | @ResponseBody |
| | |
| | | ExcelUtil<TSubject> util = new ExcelUtil<TSubject>(TSubject.class); |
| | | return util.exportExcel(list, "subject"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 新增维度表 |
| | | */ |
| | | @GetMapping("/add") |
| | | public String add() { |
| | | return prefix + "/add"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 新增保存维度表 |
| | | */ |
| | | @RequiresPermissions("exam:subject:add") |
| | | @Log(title = "维度表", businessType = BusinessType.INSERT) |
| | | @PostMapping("/add") |
| | |
| | | public AjaxResult addSave(TSubject tSubject) { |
| | | return toAjax(tSubjectService.insertTSubject(tSubject)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改维度表 |
| | | */ |
| | | @GetMapping("/edit/{id}") |
| | | public String edit(@PathVariable("id") Long id, ModelMap mmap) { |
| | | TSubject tSubject = tSubjectService.selectTSubjectById(id); |
| | | mmap.put("tSubject", tSubject); |
| | | return prefix + "/edit"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改保存维度表 |
| | | */ |
| | | @RequiresPermissions("exam:subject:edit") |
| | | @Log(title = "维度表", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/edit") |
| | |
| | | public AjaxResult editSave(TSubject tSubject) { |
| | | return toAjax(tSubjectService.updateTSubject(tSubject)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除维度表 |
| | | */ |
| | | @RequiresPermissions("exam:subject:remove") |
| | | @Log(title = "维度表", businessType = BusinessType.DELETE) |
| | | @PostMapping("/remove") |