|
@@ -2,29 +2,24 @@ package com.ruoyi.sim.controller;
|
|
|
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
-import com.ruoyi.common.core.domain.entity.SysRole;
|
|
|
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
|
import com.ruoyi.common.core.page.TableDataInfo;
|
|
import com.ruoyi.common.core.page.TableDataInfo;
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
import com.ruoyi.sim.domain.Student;
|
|
import com.ruoyi.sim.domain.Student;
|
|
-import com.ruoyi.sim.service.impl.Consts;
|
|
|
|
|
|
+import com.ruoyi.sim.constant.Consts;
|
|
import com.ruoyi.sim.service.impl.StudentService;
|
|
import com.ruoyi.sim.service.impl.StudentService;
|
|
import com.ruoyi.system.service.ISysDeptService;
|
|
import com.ruoyi.system.service.ISysDeptService;
|
|
-import com.ruoyi.system.service.ISysPostService;
|
|
|
|
import com.ruoyi.system.service.ISysRoleService;
|
|
import com.ruoyi.system.service.ISysRoleService;
|
|
import com.ruoyi.system.service.ISysUserService;
|
|
import com.ruoyi.system.service.ISysUserService;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import org.apache.commons.lang3.ArrayUtils;
|
|
import org.apache.commons.lang3.ArrayUtils;
|
|
-import org.springframework.beans.BeanUtils;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
-import java.util.Objects;
|
|
|
|
-import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
@Api("学生Controller")
|
|
@Api("学生Controller")
|
|
@RestController
|
|
@RestController
|
|
@@ -33,16 +28,10 @@ public class StudentController extends BaseController {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private ISysUserService userService;
|
|
private ISysUserService userService;
|
|
-
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private ISysRoleService roleService;
|
|
private ISysRoleService roleService;
|
|
-
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private ISysDeptService deptService;
|
|
private ISysDeptService deptService;
|
|
-
|
|
|
|
- @Autowired
|
|
|
|
- private ISysPostService postService;
|
|
|
|
-
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private StudentService studentService;
|
|
private StudentService studentService;
|
|
|
|
|
|
@@ -61,6 +50,12 @@ public class StudentController extends BaseController {
|
|
return getDataTable(list);
|
|
return getDataTable(list);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @GetMapping(value = "/letTry/{code}")
|
|
|
|
+ @ApiOperation("letTry")
|
|
|
|
+ public void letTry(@PathVariable(value = "code") int code) {
|
|
|
|
+ studentService.letTry(code);
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* copy
|
|
* copy
|
|
* 根据用户编号获取详细信息
|
|
* 根据用户编号获取详细信息
|
|
@@ -101,11 +96,11 @@ public class StudentController extends BaseController {
|
|
// -------------------------------- --------------------------------
|
|
// -------------------------------- --------------------------------
|
|
|
|
|
|
// 自动添加学生权限
|
|
// 自动添加学生权限
|
|
- SysUser find = userService.selectUserByUserName(user.getUserName());
|
|
|
|
- logger.info(String.valueOf(find));
|
|
|
|
- if (find != null) {
|
|
|
|
|
|
+ SysUser suF = userService.selectUserByUserName(user.getUserName());
|
|
|
|
+ logger.info(String.valueOf(suF));
|
|
|
|
+ if (suF != null) {
|
|
// roleService.insertAuthUsers(Consts.ROLE_ID_STUDENT, new Long[]{userId});
|
|
// roleService.insertAuthUsers(Consts.ROLE_ID_STUDENT, new Long[]{userId});
|
|
- userService.insertUserAuth(find.getUserId(), new Long[]{Consts.ROLE_ID_STUDENT});
|
|
|
|
|
|
+ userService.insertUserAuth(suF.getUserId(), new Long[]{Consts.ROLE_ID_STUDENT});
|
|
}
|
|
}
|
|
return tempAjax;
|
|
return tempAjax;
|
|
}
|
|
}
|