| | |
| | | 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; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 报告模板配置Controller |
| | | * |
| | | * @author ots |
| | | * @date 2020-03-24 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/exam/template") |
| | | public class TReportTemplateController extends BaseController { |
| | | private String prefix = "exam/template"; |
| | | |
| | | @Autowired |
| | | private ITReportTemplateService tReportTemplateService; |
| | | |
| | | @RequiresPermissions("exam:template:view") |
| | | @GetMapping() |
| | | public String template() { |
| | | return prefix + "/template"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询报告模板配置列表 |
| | | */ |
| | | @RequiresPermissions("exam:template:list") |
| | | @PostMapping("/list") |
| | | @ResponseBody |
| | |
| | | List<TReportTemplate> list = tReportTemplateService.selectTReportTemplateList(tReportTemplate); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 导出报告模板配置列表 |
| | | */ |
| | | @RequiresPermissions("exam:template:export") |
| | | @PostMapping("/export") |
| | | @ResponseBody |
| | |
| | | ExcelUtil<TReportTemplate> util = new ExcelUtil<TReportTemplate>(TReportTemplate.class); |
| | | return util.exportExcel(list, "template"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 新增报告模板配置 |
| | | */ |
| | | @GetMapping("/add") |
| | | public String add() { |
| | | return prefix + "/add"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 新增保存报告模板配置 |
| | | */ |
| | | @RequiresPermissions("exam:template:add") |
| | | @Log(title = "报告模板配置", businessType = BusinessType.INSERT) |
| | | @PostMapping("/add") |
| | |
| | | } |
| | | return toAjax(tReportTemplateService.insertTReportTemplate(tReportTemplate)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改报告模板配置 |
| | | */ |
| | | @GetMapping("/edit/{id}") |
| | | public String edit(@PathVariable("id") Long id, ModelMap mmap) { |
| | | TReportTemplate tReportTemplate = tReportTemplateService.selectTReportTemplateById(id); |
| | | mmap.put("tReportTemplate", tReportTemplate); |
| | | return prefix + "/edit"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改保存报告模板配置 |
| | | */ |
| | | @RequiresPermissions("exam:template:edit") |
| | | @Log(title = "报告模板配置", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/edit") |
| | |
| | | public AjaxResult editSave(TReportTemplate tReportTemplate) { |
| | | return toAjax(tReportTemplateService.updateTReportTemplate(tReportTemplate)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除报告模板配置 |
| | | */ |
| | | @RequiresPermissions("exam:template:remove") |
| | | @Log(title = "报告模板配置", businessType = BusinessType.DELETE) |
| | | @PostMapping("/remove") |