feat:考试管理

pg_adapter
wangxy 9 months ago
parent d646686a17
commit 2a17e23ae4

@ -1,6 +1,8 @@
package com.ruoyi.web.controller.system.system;
import java.util.List;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@ -27,8 +29,7 @@ import com.ruoyi.system.service.ISysDictDataService;
*/
@Controller
@RequestMapping("/system/dict/data")
public class SysDictDataController extends BaseController
{
public class SysDictDataController extends BaseController {
private String prefix = "system/dict/data";
@Autowired
@ -36,16 +37,14 @@ public class SysDictDataController extends BaseController
@RequiresPermissions("system:dict:view")
@GetMapping()
public String dictData()
{
public String dictData() {
return prefix + "/data";
}
@PostMapping("/list")
@RequiresPermissions("system:dict:list")
@ResponseBody
public TableDataInfo list(SysDictData dictData)
{
public TableDataInfo list(SysDictData dictData) {
startPage();
List<SysDictData> list = dictDataService.selectDictDataList(dictData);
return getDataTable(list);
@ -55,8 +54,7 @@ public class SysDictDataController extends BaseController
@RequiresPermissions("system:dict:export")
@PostMapping("/export")
@ResponseBody
public AjaxResult export(SysDictData dictData)
{
public AjaxResult export(SysDictData dictData) {
List<SysDictData> list = dictDataService.selectDictDataList(dictData);
ExcelUtil<SysDictData> util = new ExcelUtil<SysDictData>(SysDictData.class);
return util.exportExcel(list, "字典数据");
@ -66,8 +64,7 @@ public class SysDictDataController extends BaseController
*
*/
@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);
return prefix + "/add";
}
@ -79,8 +76,7 @@ public class SysDictDataController extends BaseController
@RequiresPermissions("system:dict:add")
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(@Validated SysDictData dict)
{
public AjaxResult addSave(@Validated SysDictData dict) {
dict.setCreateBy(getLoginName());
return toAjax(dictDataService.insertDictData(dict));
}
@ -90,8 +86,7 @@ public class SysDictDataController extends BaseController
*/
@RequiresPermissions("system:dict:edit")
@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));
return prefix + "/edit";
}
@ -103,8 +98,7 @@ public class SysDictDataController extends BaseController
@RequiresPermissions("system:dict:edit")
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(@Validated SysDictData dict)
{
public AjaxResult editSave(@Validated SysDictData dict) {
dict.setUpdateBy(getLoginName());
return toAjax(dictDataService.updateDictData(dict));
}
@ -113,9 +107,17 @@ public class SysDictDataController extends BaseController
@RequiresPermissions("system:dict:remove")
@PostMapping("/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
public AjaxResult remove(String ids) {
dictDataService.deleteDictDataByIds(ids);
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',
title: '题目类型',
title: '考试类型',
align: 'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(types, value);

Loading…
Cancel
Save