feat:错题删除

pg_adapter
wangxy 9 months ago
parent cd6421233a
commit ee73a6a096

@ -1,6 +1,10 @@
package com.ruoyi.web.controller.system.count; package com.ruoyi.web.controller.system.count;
import java.util.List; import java.util.List;
import com.ruoyi.system.domain.userexam.dto.request.UserExamReqDTO;
import com.ruoyi.system.domain.userexam.dto.response.UserExamRespDTO;
import com.ruoyi.web.controller.manager.UserExamManager;
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;
@ -20,6 +24,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
/** /**
@ -37,6 +42,9 @@ public class TdExamnumController extends BaseController
@Autowired @Autowired
private ITdExamnumService tdExamnumService; private ITdExamnumService tdExamnumService;
@Resource
private UserExamManager userExamManager;
@RequiresPermissions("system:examnum:view") @RequiresPermissions("system:examnum:view")
@GetMapping() @GetMapping()
public String examnum() public String examnum()
@ -50,10 +58,9 @@ public class TdExamnumController extends BaseController
@RequiresPermissions("system:examnum:list") @RequiresPermissions("system:examnum:list")
@PostMapping("/list") @PostMapping("/list")
@ResponseBody @ResponseBody
public TableDataInfo list(TdExamnum tdExamnum) public TableDataInfo list(UserExamReqDTO reqDTO) {
{
startPage(); startPage();
List<TdExamnum> list = tdExamnumService.selectTdExamnumList(tdExamnum); List<UserExamRespDTO> list = userExamManager.selectExamList(reqDTO);
return getDataTable(list); return getDataTable(list);
} }
@ -71,62 +78,7 @@ public class TdExamnumController extends BaseController
return util.exportExcel(list, "考试结果数据"); return util.exportExcel(list, "考试结果数据");
} }
/**
*
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
*
*/
@RequiresPermissions("system:examnum:add")
@Log(title = "考试结果", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(TdExamnum tdExamnum)
{
return toAjax(tdExamnumService.insertTdExamnum(tdExamnum));
}
/**
*
*/
@RequiresPermissions("system:examnum:edit")
@GetMapping("/edit/{id}")
public String edit(@PathVariable("id") Long id, ModelMap mmap)
{
TdExamnum tdExamnum = tdExamnumService.selectTdExamnumById(id);
mmap.put("tdExamnum", tdExamnum);
return prefix + "/edit";
}
/**
*
*/
@RequiresPermissions("system:examnum:edit")
@Log(title = "考试结果", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(TdExamnum tdExamnum)
{
return toAjax(tdExamnumService.updateTdExamnum(tdExamnum));
}
/**
*
*/
@RequiresPermissions("system:examnum:remove")
@Log(title = "考试结果", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(tdExamnumService.deleteTdExamnumByIds(ids));
}
} }

@ -1,102 +1,96 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head> <head>
<th:block th:include="include :: header('考试结果列表')" /> <th:block th:include="include :: header('考试管理')" />
</head> </head>
<body class="gray-bg"> <body class="gray-bg">
<div class="container-div"> <div class="container-div">
<div class="row"> <div class="row">
<div class="col-sm-12 search-collapse"> <div class="col-sm-12 search-collapse">
<form id="formId"> <form id="notice-form">
<div class="select-list"> <div class="select-list">
<ul> <ul>
<li> <li>
<label>考生姓名:</label> 搜索人员:<input type="text" name="userName"/>
<input type="text" name="userName"/> <input type="hidden" name="examId" th:value="*{examId}"/>
</li> </li>
<li> <li>
<label>单位名称:</label> <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<input type="text" name="dept"/> <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li> </li>
<li> </ul>
<label>试题类型:</label> </div>
<select name="type" th:with="type=${@dict.getType('td_question_type')}"> </form>
<option value="">所有</option> </div>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group"> <div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:examnum:export">
<i class="fa fa-download"></i> 导出 </div>
</a>
</div> <div class="col-sm-12 select-table table-striped">
<div class="col-sm-12 select-table table-striped"> <table id="bootstrap-table"></table>
<table id="bootstrap-table"></table> </div>
</div> </div>
</div>
</div> </div>
<th:block th:include="include :: footer" /> <th:block th:include="include :: footer" />
<script th:inline="javascript"> <script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('system:examnum:edit')}]];
var removeFlag = [[${@permission.hasPermi('system:examnum:remove')}]];
var typeDatas = [[${@dict.getType('td_question_type')}]];
var prefix = ctx + "system/examnum"; var prefix = ctx + "system/examnum";
var prefixUser = ctx + "system/userExam";
$(function() { $(function() {
var options = { var options = {
uniqueId: "id",
url: prefix + "/list", url: prefix + "/list",
createUrl: prefix + "/add", modalName: "考试",
updateUrl: prefix + "/edit/{id}", columns: [
removeUrl: prefix + "/remove", {
exportUrl: prefix + "/export", field : 'userName',
modalName: "考试结果", title : '人员'
columns: [{ },
checkbox: true {
}, field: 'tryCount',
{ title: '考试次数'
field: 'id', },
title: 'id', {
visible: false field: 'maxScore',
}, title: '最高分',
{ align: 'center'
field: 'userName', },
title: '考试姓名' {
}, field: 'passed',
{ title: '是否通过',
field: 'examResult', formatter: function(value, row, index) {
title: '考试分数' if(value=='1'){
}, return '通过';
{ }else{
field: 'startTime', return '未通过';
title: '开始时间' }
},
{ }
field: 'endTime', },
title: '结束时间' {
}, field: 'updateTime',
{ title: '最后考试时间',
field: 'dept', sortable: true
title: '单位名称' },
}, {
{ title: '操作',
field: 'type', align: 'center',
title: '试题类型', formatter: function(value, row, index) {
formatter: function(value, row, index) { var actions = [];
return $.table.selectDictLabel(typeDatas, value); actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="detail(\'' + row.examId + '\',\'' + row.userId + '\')"><i class="fa fa-search"></i>考试明细</a> ');
} return actions.join('');
}] }
}]
}; };
$.table.init(options); $.table.init(options);
}); });
/*资产列表-详细*/
function detail(id,userId) {
var url = prefixUser + '/detail/' + id +'/'+userId;
$.modal.open("考试明细", url);
}
</script> </script>
</body> </body>
</html> </html>
Loading…
Cancel
Save