|
@@ -3,6 +3,8 @@ package com.huaxu.org;
|
|
|
import com.huaxu.client.UserCenterClient;
|
|
|
import com.huaxu.util.RedisUtil;
|
|
|
import com.huaxu.util.UserUtil;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
@@ -60,13 +62,15 @@ public class OrgInfoUtil {
|
|
|
Integer parentId = null;
|
|
|
Org org = userCenterClient.selectOne(id).getData();
|
|
|
Org parentOrg = new Org();
|
|
|
- parentOrg.setOrgType(org.getOrgType());
|
|
|
+ BeanUtils.copyProperties(org,parentOrg);
|
|
|
while (parentOrg.getOrgType().equals("department")) {
|
|
|
- if (org.getParentOrgId().equals(0)) {
|
|
|
+ if (parentOrg.getParentOrgId().equals(0)|| parentOrg.getParentOrgId()==null) {
|
|
|
break;
|
|
|
}
|
|
|
- Org temp = userCenterClient.selectOne(org.getParentOrgId()).getData();
|
|
|
+ Org temp = userCenterClient.selectOne(parentOrg.getParentOrgId()).getData();
|
|
|
parentOrg.setOrgType(temp.getOrgType());
|
|
|
+ parentOrg.setId(temp.getId());
|
|
|
+ parentOrg.setParentOrgId(temp.getParentOrgId());
|
|
|
if (temp.getOrgType().equals("company")) {
|
|
|
parentId = temp.getId();
|
|
|
}
|