linzhijie
2021-04-12 c632636e2f5b4188b430f5efc9d9f68c8dbe3d6d
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
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 {
    
    @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());
        }
 
        return getDataTable(null);
    }
    
    @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());
        }
 
        return getDataTable(null);
    }
    
    @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());
        }
 
        return getDataTable(null);
    }
}