feat:考试管理

pg_adapter
wangxy 9 months ago
parent d646686a17
commit 2a17e23ae4

@ -1,6 +1,8 @@
package com.ruoyi.web.controller.system.system; package com.ruoyi.web.controller.system.system;
import java.util.List; import java.util.List;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
@ -22,13 +24,12 @@ import com.ruoyi.system.service.ISysDictDataService;
/** /**
* *
* *
* @author ruoyi * @author ruoyi
*/ */
@Controller @Controller
@RequestMapping("/system/dict/data") @RequestMapping("/system/dict/data")
public class SysDictDataController extends BaseController public class SysDictDataController extends BaseController {
{
private String prefix = "system/dict/data"; private String prefix = "system/dict/data";
@Autowired @Autowired
@ -36,16 +37,14 @@ public class SysDictDataController extends BaseController
@RequiresPermissions("system:dict:view") @RequiresPermissions("system:dict:view")
@GetMapping() @GetMapping()
public String dictData() public String dictData() {
{
return prefix + "/data"; return prefix + "/data";
} }
@PostMapping("/list") @PostMapping("/list")
@RequiresPermissions("system:dict:list") @RequiresPermissions("system:dict:list")
@ResponseBody @ResponseBody
public TableDataInfo list(SysDictData dictData) public TableDataInfo list(SysDictData dictData) {
{
startPage(); startPage();
List<SysDictData> list = dictDataService.selectDictDataList(dictData); List<SysDictData> list = dictDataService.selectDictDataList(dictData);
return getDataTable(list); return getDataTable(list);
@ -55,8 +54,7 @@ public class SysDictDataController extends BaseController
@RequiresPermissions("system:dict:export") @RequiresPermissions("system:dict:export")
@PostMapping("/export") @PostMapping("/export")
@ResponseBody @ResponseBody
public AjaxResult export(SysDictData dictData) public AjaxResult export(SysDictData dictData) {
{
List<SysDictData> list = dictDataService.selectDictDataList(dictData); List<SysDictData> list = dictDataService.selectDictDataList(dictData);
ExcelUtil<SysDictData> util = new ExcelUtil<SysDictData>(SysDictData.class); ExcelUtil<SysDictData> util = new ExcelUtil<SysDictData>(SysDictData.class);
return util.exportExcel(list, "字典数据"); return util.exportExcel(list, "字典数据");
@ -66,8 +64,7 @@ public class SysDictDataController extends BaseController
* *
*/ */
@GetMapping("/add/{dictType}") @GetMapping("/add/{dictType}")
public String add(@PathVariable("dictType") String dictType, ModelMap mmap) public String add(@PathVariable("dictType") String dictType, ModelMap mmap) {
{
mmap.put("dictType", dictType); mmap.put("dictType", dictType);
return prefix + "/add"; return prefix + "/add";
} }
@ -79,8 +76,7 @@ public class SysDictDataController extends BaseController
@RequiresPermissions("system:dict:add") @RequiresPermissions("system:dict:add")
@PostMapping("/add") @PostMapping("/add")
@ResponseBody @ResponseBody
public AjaxResult addSave(@Validated SysDictData dict) public AjaxResult addSave(@Validated SysDictData dict) {
{
dict.setCreateBy(getLoginName()); dict.setCreateBy(getLoginName());
return toAjax(dictDataService.insertDictData(dict)); return toAjax(dictDataService.insertDictData(dict));
} }
@ -90,8 +86,7 @@ public class SysDictDataController extends BaseController
*/ */
@RequiresPermissions("system:dict:edit") @RequiresPermissions("system:dict:edit")
@GetMapping("/edit/{dictCode}") @GetMapping("/edit/{dictCode}")
public String edit(@PathVariable("dictCode") Long dictCode, ModelMap mmap) public String edit(@PathVariable("dictCode") Long dictCode, ModelMap mmap) {
{
mmap.put("dict", dictDataService.selectDictDataById(dictCode)); mmap.put("dict", dictDataService.selectDictDataById(dictCode));
return prefix + "/edit"; return prefix + "/edit";
} }
@ -103,8 +98,7 @@ public class SysDictDataController extends BaseController
@RequiresPermissions("system:dict:edit") @RequiresPermissions("system:dict:edit")
@PostMapping("/edit") @PostMapping("/edit")
@ResponseBody @ResponseBody
public AjaxResult editSave(@Validated SysDictData dict) public AjaxResult editSave(@Validated SysDictData dict) {
{
dict.setUpdateBy(getLoginName()); dict.setUpdateBy(getLoginName());
return toAjax(dictDataService.updateDictData(dict)); return toAjax(dictDataService.updateDictData(dict));
} }
@ -113,9 +107,17 @@ public class SysDictDataController extends BaseController
@RequiresPermissions("system:dict:remove") @RequiresPermissions("system:dict:remove")
@PostMapping("/remove") @PostMapping("/remove")
@ResponseBody @ResponseBody
public AjaxResult remove(String ids) public AjaxResult remove(String ids) {
{
dictDataService.deleteDictDataByIds(ids); dictDataService.deleteDictDataByIds(ids);
return success(); return success();
} }
@ApiOperation("根据类型查询字典值")
@PostMapping("/dataList")
@ResponseBody
public AjaxResult dataList(SysDictData dictData) {
List<SysDictData> list = dictDataService.selectDictDataList(dictData);
return success(list);
}
} }

@ -75,7 +75,7 @@
}, },
{ {
field: 'openType', field: 'openType',
title: '题目类型', title: '考试类型',
align: 'center', align: 'center',
formatter: function(value, row, index) { formatter: function(value, row, index) {
return $.table.selectDictLabel(types, value); return $.table.selectDictLabel(types, value);

Loading…
Cancel
Save