报名功能完善
This commit is contained in:
parent
ba156e72ff
commit
a47d5ae284
|
|
@ -70,7 +70,7 @@ public class CmsExaminationController {
|
|||
@GetMapping()
|
||||
@ResponseBody
|
||||
public AjaxResult list(ExamExamination examExamination) {
|
||||
SysUser sysUser = sysUserService.selectUserByLoginName( ShiroUtils.getLoginName() );
|
||||
SysUser sysUser = ShiroUtils.getSysUser();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put( "ination", examExamination );
|
||||
map.put( "userId", sysUser.getUserId() );
|
||||
|
|
@ -90,7 +90,7 @@ public class CmsExaminationController {
|
|||
@GetMapping()
|
||||
@ResponseBody
|
||||
public AjaxResult signupist(ExamExamination examExamination) {
|
||||
SysUser sysUser = sysUserService.selectUserByLoginName( ShiroUtils.getLoginName() );
|
||||
SysUser sysUser = ShiroUtils.getSysUser();
|
||||
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put( "ination", examExamination );
|
||||
|
|
@ -102,6 +102,34 @@ public class CmsExaminationController {
|
|||
return success;
|
||||
}
|
||||
|
||||
@RequestMapping("/examination/signup/{id}")
|
||||
@GetMapping()
|
||||
@ResponseBody
|
||||
public AjaxResult signupist(@PathVariable Integer id) {
|
||||
SysUser sysUser = ShiroUtils.getSysUser();
|
||||
Long userId = sysUser.getUserId();
|
||||
|
||||
|
||||
ExamExaminationUser examExaminationUser = new ExamExaminationUser();
|
||||
examExaminationUser.setVipUserId( Integer.parseInt( userId.toString() ) );
|
||||
examExaminationUser.setDelFlag( "0" );
|
||||
examExaminationUser.setCreateDate( new Date() );
|
||||
examExaminationUser.setCreateBy( sysUser.getLoginName() );
|
||||
examExaminationUser.setExamExaminationId(id);
|
||||
examExaminationUserService.insertOne( examExaminationUser );
|
||||
|
||||
AjaxResult success = AjaxResult.success( "报名成功" );
|
||||
return success;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 开始考试
|
||||
* @param id
|
||||
* @param mmap
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/examination/start/{id}")
|
||||
@GetMapping()
|
||||
public String start(@PathVariable String id, ModelMap mmap) {
|
||||
|
|
|
|||
|
|
@ -177,11 +177,23 @@ document.write(unescape("%3Cspan id='cnzz_stat_icon_30088308'%3E%3C/span%3E%3Csc
|
|||
, page: true
|
||||
});
|
||||
|
||||
table.on('tool(signup)', function (obj) { //注:tool 是工具条事件名,test 是 table 原始容器的属性 lay-filter="对应的值"
|
||||
table.on('tool(signupList)', function (obj) { //注:tool 是工具条事件名,test 是 table 原始容器的属性 lay-filter="对应的值"
|
||||
var data = obj.data //获得当前行数据
|
||||
, layEvent = obj.event; //获得 lay-event 对应的值
|
||||
if (layEvent === 'start') {
|
||||
window.location.href = "/web/examination/start/" + data.id;
|
||||
if (layEvent === 'signup') {
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: "/web/examination/signup/"+data.id,
|
||||
success: function (result) {
|
||||
if (result.code != web_status.SUCCESS) {
|
||||
layer.msg(result.msg, {icon: 2});
|
||||
}else{
|
||||
layer.msg(result.msg, {icon: 1});
|
||||
}
|
||||
table.reload('signupList')
|
||||
table.reload('test')
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
});
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@
|
|||
<dd><a th:href="@{/web/user/set.html}"><i class="layui-icon"></i>基本设置</a></dd>
|
||||
<dd><a th:href="@{/web/user/set.html}"><i class="layui-icon" style="margin-left: 2px; font-size: 22px;"></i>更多...</a></dd>
|
||||
<!--<dd><a th:href="@{/web/user/collectquestion.html}"><i class="layui-icon" style="margin-left: 2px; font-size: 22px;"></i>我的收藏</a></dd>-->
|
||||
dd><a th:href="@{/logout}" style="text-align: center;">退出</a></dd>
|
||||
<dd><a th:href="@{/logout}" style="text-align: center;">退出</a></dd>
|
||||
</dl>
|
||||
</li>
|
||||
<script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue