|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
package com.sztzjy.financial_bigdata.controller.tea;
|
|
|
|
|
import javax.swing.JOptionPane;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
@ -38,7 +38,6 @@ import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Author xcj
|
|
|
|
@ -89,13 +88,12 @@ public class UserController {
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/login")
|
|
|
|
|
@ApiOperation("登录接口")
|
|
|
|
|
@AnonymousAccess
|
|
|
|
|
public ResultEntity login(@RequestParam(required = false) String passwordEncode,
|
|
|
|
|
@RequestParam(required = false) String userName,
|
|
|
|
|
@ApiParam("所属系统")@RequestParam String systemOwner,
|
|
|
|
|
@ApiParam("所属系统") @RequestParam String systemOwner,
|
|
|
|
|
HttpServletRequest request,
|
|
|
|
|
@RequestParam(required = false) String TOKEN) {
|
|
|
|
|
JwtUser jwtUser;
|
|
|
|
@ -132,11 +130,11 @@ public class UserController {
|
|
|
|
|
map.put("schoolId", user.getSchoolId());
|
|
|
|
|
map.put("classId", user.getClassId());
|
|
|
|
|
map.put("userId", user.getUserid());
|
|
|
|
|
map.put("zyuserid",user.getZyUserid());
|
|
|
|
|
map.put("zyuserid", user.getZyUserid());
|
|
|
|
|
String uuid = getIPAndPlace(request, user.getName(), user.getUserid(), user.getStudentId());
|
|
|
|
|
map.put("logId", uuid);
|
|
|
|
|
map.put("token", token);
|
|
|
|
|
map.put("systemOwner",user.getSystemOnwer());
|
|
|
|
|
map.put("systemOwner", user.getSystemOnwer());
|
|
|
|
|
return new ResultEntity(HttpStatus.OK, map);
|
|
|
|
|
} else { // 2、智云单点登录
|
|
|
|
|
jwtUser = TokenProvider.getJWTUserByZhiYun(TOKEN);
|
|
|
|
@ -194,7 +192,7 @@ public class UserController {
|
|
|
|
|
@AnonymousAccess
|
|
|
|
|
public ResultEntity<String> getClassNameByClassId(@RequestParam String classId) {
|
|
|
|
|
StuClass stuClass = classMapper.selectByPrimaryKey(classId);
|
|
|
|
|
if(stuClass==null){
|
|
|
|
|
if (stuClass == null) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
return new ResultEntity<>(stuClass.getClassName());
|
|
|
|
@ -224,17 +222,20 @@ public class UserController {
|
|
|
|
|
for (int i = 0; i < zyUserInfoList.size(); i++) {
|
|
|
|
|
StuClass stuClass = new StuClass();
|
|
|
|
|
ZYUserInfo zyUserInfo = zyUserInfoList.get(i);
|
|
|
|
|
String userId = String.valueOf(zyUserInfo.getUserId());
|
|
|
|
|
Integer zyUserId = zyUserInfo.getUserId();
|
|
|
|
|
String username = zyUserInfo.getUsername(); // studentid
|
|
|
|
|
String name = zyUserInfo.getName();
|
|
|
|
|
String password = zyUserInfo.getPassword();
|
|
|
|
|
Integer roleId = zyUserInfo.getRoleId(); //3教师 4学生
|
|
|
|
|
StuUser stuUser1 = stuUserMapper.selectByPrimaryKey(userId);
|
|
|
|
|
if (stuUser1 != null) {
|
|
|
|
|
|
|
|
|
|
StuUserExample example = new StuUserExample();
|
|
|
|
|
example.createCriteria().andZyUseridEqualTo(zyUserId).andSystemOnwerEqualTo(systemOwner);
|
|
|
|
|
List<StuUser> list = stuUserMapper.selectByExample(example);
|
|
|
|
|
if (list != null || !list.isEmpty()) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
StuUser stuUser = new StuUser();
|
|
|
|
|
stuUser.setUserid(userId);
|
|
|
|
|
stuUser.setUserid(IdUtil.randomUUID());
|
|
|
|
|
stuUser.setStudentId(zyUserInfo.getUsername());
|
|
|
|
|
stuUser.setName(name);
|
|
|
|
|
stuUser.setUsername(username);
|
|
|
|
|