ting.yin vor 8 Jahren
Ursprung
Commit
376739091f

+ 12 - 10
core-api/src/main/java/cn/com/qmth/examcloud/service/core/service/UserService.java

@@ -1,28 +1,29 @@
 package cn.com.qmth.examcloud.service.core.service;
 
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+import org.apache.commons.lang.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+
 import cn.com.qmth.examcloud.common.uac.AccessCtrlUtil;
 import cn.com.qmth.examcloud.common.uac.entity.AccessUser;
 import cn.com.qmth.examcloud.common.util.RedisUtil;
+import cn.com.qmth.examcloud.service.core.dto.UserInfo;
 import cn.com.qmth.examcloud.service.core.entity.Org;
 import cn.com.qmth.examcloud.service.core.entity.Student;
 import cn.com.qmth.examcloud.service.core.entity.User;
 import cn.com.qmth.examcloud.service.core.entity.UserRole;
-import cn.com.qmth.examcloud.service.core.dto.UserInfo;
 import cn.com.qmth.examcloud.service.core.enums.UserType;
 import cn.com.qmth.examcloud.service.core.params.UserParam;
 import cn.com.qmth.examcloud.service.core.repo.OrgRepo;
 import cn.com.qmth.examcloud.service.core.repo.StudentRepo;
 import cn.com.qmth.examcloud.service.core.repo.UserRepo;
 import cn.com.qmth.examcloud.service.core.repo.UserRoleRepo;
-import org.apache.commons.lang.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.stereotype.Service;
-
-import java.util.Map;
-import java.util.Set;
-import java.util.stream.Collectors;
 
 /**
  * 用户服务类
@@ -139,6 +140,7 @@ public class UserService {
         Org org = orgRepo.findById(user.getOrgId());
         Org rootOrg = orgRepo.findById(user.getRootOrgId());
         userInfo.setUserId(user.getId());
+        userInfo.setOrgId(user.getOrgId());
         userInfo.setName(user.getName());
         userInfo.setAvatar(user.getAvatar());
         userInfo.setLoginName(user.getLoginName());

+ 11 - 3
core-domain/src/main/java/cn/com/qmth/examcloud/service/core/dto/UserInfo.java

@@ -1,7 +1,5 @@
 package cn.com.qmth.examcloud.service.core.dto;
 
-import cn.com.qmth.examcloud.service.core.enums.UserType;
-
 import java.io.Serializable;
 
 /**
@@ -11,6 +9,8 @@ public class UserInfo implements Serializable{
     private static final long serialVersionUID = 7939545789907406883L;
 
     private Long userId;
+    
+    private Long orgId;
 
     private String name;
 
@@ -104,6 +104,14 @@ public class UserInfo implements Serializable{
         this.rootOrgLogo = rootOrgLogo;
     }
 
-    public UserInfo() {
+    public Long getOrgId() {
+		return orgId;
+	}
+
+	public void setOrgId(Long orgId) {
+		this.orgId = orgId;
+	}
+
+	public UserInfo() {
     }
 }