Commit 67649b9a by 江和松

Merge remote-tracking branch 'origin/dev' into dev

parents 1f42711d 63b45660
......@@ -153,17 +153,20 @@ public class UserSessionUtils extends UserSession {
}
List<String> companyCodes = userGroups.stream().map(UserGroup::getCompanyCode)
.filter(StringUtils::isNotBlank).collect(Collectors.toList());
if(CollectionUtils.isNotEmpty(companyCodes)) {
// 查询组织信息
List<Org> orgs = HGXSTools.XsOrg.list(companyCodes);
Optional.ofNullable(companyCodes).orElse(new ArrayList<>()).stream().forEach( code -> {
orgs.addAll(HGXSTools.XsOrg.queryByParent(code,OrgTypeEnum.COMPANY.getCode()));
Optional.ofNullable(companyCodes).orElse(new ArrayList<>()).stream().forEach(code -> {
orgs.addAll(HGXSTools.XsOrg.queryByParent(code, OrgTypeEnum.COMPANY.getCode()));
});
return orgs.stream().filter(o->StringUtils.equals(o.getOrgType(),OrgTypeEnum.COMPANY.getCode())).map(item -> new Company(item.getOrgId(), item.getOrgCname())).collect(Collectors.collectingAndThen(
return orgs.stream().filter(o -> StringUtils.equals(o.getOrgType(), OrgTypeEnum.COMPANY.getCode())).map(item -> new Company(item.getOrgId(), item.getOrgCname())).collect(Collectors.collectingAndThen(
Collectors.toMap(Company::getCompanyCode, Function.identity(), (oldValue, newValue) -> oldValue),
// 将Map转回List
m -> new ArrayList<>(m.values())
));
}
return new ArrayList<Company>();
}
/**
* 获取指定公司的部门列表
......
......@@ -2,7 +2,6 @@ package com.baosight.hggp.hg.cb.service;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.cb.domain.HGCB001;
import com.baosight.hggp.hg.cb.domain.HGCB002;
import com.baosight.hggp.hg.cb.domain.HGCB005;
import com.baosight.hggp.hg.cb.tools.HGCBTools;
import com.baosight.hggp.hg.cw.domain.HGCW001;
......
......@@ -12,6 +12,10 @@
<%@ page import="com.baosight.iplat4j.core.web.threadlocal.UserSession" %>
<%@ page import="com.baosight.iplat4j.core.service.soa.XLocalManager" %>
<%@ page import="com.baosight.iplat4j.ed.service.PlatApplicationDynamicContext" %>
<%@ page import="com.baosight.hggp.hg.xs.tools.HGXSTools" %>
<%@ page import="com.baosight.hggp.hg.xs.domain.Org" %>
<%@ page import="java.util.List" %>
<%@ page import="org.apache.commons.collections.CollectionUtils" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
......@@ -21,8 +25,29 @@
UserSession.web2Service(request);
String userName = UserSession.getLoginCName();
String loginName = UserSession.getLoginName();
List<Org> orgList =HGXSTools.XsOrg.queryByUser();
String companyName = "";
String orgName = "";
String orgInfo = "";
if(CollectionUtils.isNotEmpty(orgList)){
Org org = orgList.get(0);
companyName = org.getCompanyName();
orgName = org.getOrgCname();
if(StringUtils.isNotBlank(companyName)) {
orgInfo = companyName;
if (!StringUtils.equals(org.getCompanyCode(), org.getOrgEname()) && StringUtils.isNotBlank(orgName)) {
orgInfo += "-" + orgName;
}
}
if(StringUtils.isBlank(orgName)){
orgName = companyName;
}
}
request.setAttribute("userName", userName);
request.setAttribute("loginName", loginName);
request.setAttribute("companyName", companyName);
request.setAttribute("orgName", orgName);
request.setAttribute("orgInf", orgInfo);
String efSecurityToken = null;
Boolean SideBarIsMini = PlatApplicationContext.getProperty("SideBarIsMini")==null?false: Boolean.valueOf(PlatApplicationContext.getProperty("SideBarIsMini"));
......@@ -118,6 +143,11 @@
<c:set var="loadingIcon" value="<%=loadingIcon%>" scope="session"/>
<c:set var="SideBarIsMini" value="<%=SideBarIsMini%>" />
<c:set var="loginName" value="<%=loginName%>" />
<c:set var="companyName" value="<%=companyName%>" />
<c:set var="orgName" value="<%=orgName%>" />
<c:set var="orgInfo" value="<%=orgInfo%>" />
<!--[if IE 9]>
<html class="ie9 no-focus" xmlns="http://www.w3.org/1999/xhtml">
<![endif]-->
......@@ -167,8 +197,8 @@
<script src="${iPlatStaticURL}/iplatui/assets/js/iplat.ui.bootstrap.min.js"></script>
<script src="${iPlatStaticURL}/iplatui/js/iplat.ui.min.js"></script>
<script src="${iPlatStaticURL}/iPlatV7-index.js"></script>
<%-- <link href="${iPlatStaticURL}/Layx/layx.css" rel="stylesheet" type="text/css" />--%>
<%-- <script src="${iPlatStaticURL}/Layx/layx.js" type="text/javascript"></script>--%>
<link href="${iPlatStaticURL}/Layx/layx.css" rel="stylesheet" type="text/css" />
<script src="${iPlatStaticURL}/Layx/layx.js" type="text/javascript"></script>
<%-- <script src="${iPlatStaticURL}/EM/NT/websocket.js"></script>--%>
</head>
......@@ -317,8 +347,12 @@
<span>${loginName}</span>
</li>
<li>
<span class="information">公司:</span>
<span class="detail-info user-org">${companyName}</span>
</li>
<li>
<span class="information">组织机构:</span>
<span class="detail-info user-org"></span>
<span class="detail-info user-org">${orgName}</span>
</li>
<%--<li data-accountset="true">
<span class="information k-link change-org">公司别:</span>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment