linzhijie
2021-03-11 93af1c6ffb9ae0e894689ad3a37b548e57d54cff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
package com.ots.project.exam.controller;
 
import com.ots.common.utils.security.ShiroUtils;
import com.ots.framework.web.controller.BaseController;
import com.ots.framework.web.page.TableDataInfo;
import com.ots.project.exam.domain.SysUserExtend;
import com.ots.project.system.user.domain.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
 
import java.util.Objects;
 
/**
 * 首页展示内容
 */
@Controller
@RequestMapping("/mail/index")
public class MainIndexController extends BaseController {
 
    /**
     * 最近50个完成测试记录
     *
     * @param sysUserExtend
     * @return
     */
    @PostMapping("/listCompleteTestRecord")
    @ResponseBody
    public TableDataInfo listCompleteTestRecord(SysUserExtend sysUserExtend) {
        startPage();
        User sysUser = ShiroUtils.getSysUser();
        if ("01".equals(sysUser.getUserType())) {
            sysUserExtend.setParentUserId(sysUser.getUserId());
        } else {
            sysUserExtend.setUserType("02");
        }
        if (Objects.nonNull(sysUserExtend.getParentUserTempId())) {
            sysUserExtend.setParentUserId(sysUserExtend.getParentUserTempId());
        }
//        List<SysUserExtend> list = sysUserExtendService.selectSysUserExtendList(sysUserExtend);
        return getDataTable(null);
    }
 
    /**
     * @param sysUserExtend
     * @return
     */
    @PostMapping("/listAnsweringTestRecord")
    @ResponseBody
    public TableDataInfo listAnsweringTestRecord(SysUserExtend sysUserExtend) {
        startPage();
        User sysUser = ShiroUtils.getSysUser();
        if ("01".equals(sysUser.getUserType())) {
            sysUserExtend.setParentUserId(sysUser.getUserId());
        } else {
            sysUserExtend.setUserType("02");
        }
        if (Objects.nonNull(sysUserExtend.getParentUserTempId())) {
            sysUserExtend.setParentUserId(sysUserExtend.getParentUserTempId());
        }
//        List<SysUserExtend> list = sysUserExtendService.selectSysUserExtendList(sysUserExtend);
        return getDataTable(null);
    }
 
    /**
     * 最近创建的20个测试包
     *
     * @param sysUserExtend
     * @return
     */
    @PostMapping("/listRecentlyCreatedTestPackage")
    @ResponseBody
    public TableDataInfo listRecentlyCreatedTestPackage(SysUserExtend sysUserExtend) {
        startPage();
        User sysUser = ShiroUtils.getSysUser();
        if ("01".equals(sysUser.getUserType())) {
            sysUserExtend.setParentUserId(sysUser.getUserId());
        } else {
            sysUserExtend.setUserType("02");
        }
        if (Objects.nonNull(sysUserExtend.getParentUserTempId())) {
            sysUserExtend.setParentUserId(sysUserExtend.getParentUserTempId());
        }
//        List<SysUserExtend> list = sysUserExtendService.selectSysUserExtendList(sysUserExtend);
        return getDataTable(null);
    }
}