@ -21,6 +21,7 @@ import com.engine.organization.util.db.DBType;
import com.engine.organization.util.db.MapperProxyFactory ;
import com.engine.organization.util.db.MapperProxyFactory ;
import com.engine.organization.util.detach.DetachUtil ;
import com.engine.organization.util.detach.DetachUtil ;
import com.engine.organization.util.tree.SearchTreeUtil ;
import com.engine.organization.util.tree.SearchTreeUtil ;
import org.apache.commons.collections.CollectionUtils ;
import org.apache.commons.lang.StringUtils ;
import org.apache.commons.lang.StringUtils ;
import weaver.conn.RecordSet ;
import weaver.conn.RecordSet ;
import weaver.general.Util ;
import weaver.general.Util ;
@ -143,18 +144,31 @@ public class JobBrowserService extends BrowserService {
private List < TreeNode > getCurrentTreeNode ( SearchTreeParams params ) {
private List < TreeNode > getCurrentTreeNode ( SearchTreeParams params ) {
// 分权
// 分权
DetachUtil detachUtil = new DetachUtil ( user . getUID ( ) ) ;
DetachUtil detachUtil = new DetachUtil ( user . getUID ( ) ) ;
List < Long > jclRoleLevelList = Arrays . stream ( detachUtil . getJclRoleLevels ( ) . split ( "," ) ) . map ( Long : : parseLong ) . collect ( Collectors . toList ( ) ) ;
List < Long > jclRoleLevelList ;
if ( StringUtils . isNotBlank ( detachUtil . getJclRoleLevels ( ) ) ) {
jclRoleLevelList = Arrays . stream ( detachUtil . getJclRoleLevels ( ) . split ( "," ) ) . map ( Long : : parseLong ) . collect ( Collectors . toList ( ) ) ;
} else {
jclRoleLevelList = new ArrayList < > ( ) ;
}
List < TreeNode > treeNodes = new ArrayList < > ( ) ;
List < TreeNode > treeNodes = new ArrayList < > ( ) ;
if ( StringUtils . isBlank ( params . getId ( ) ) ) {
if ( StringUtils . isBlank ( params . getId ( ) ) ) {
// 集团总部
// 集团总部
SearchTree topGroup = SearchTreeUtil . getTopGroup ( ) ;
SearchTree topGroup = SearchTreeUtil . getTopGroup ( ) ;
topGroup . setIsParent ( true ) ;
if ( detachUtil . isDETACH ( ) & & StringUtils . isNotBlank ( detachUtil . getJclRoleLevels ( ) ) ) {
topGroup . setIsParent ( true ) ;
} else {
topGroup . setIsParent ( false ) ;
}
treeNodes . add ( topGroup ) ;
treeNodes . add ( topGroup ) ;
} else {
} else {
// 分部存在下级的ID
// 分部存在下级的ID
List < String > compHasSubs ;
List < String > compHasSubs ;
if ( detachUtil . isDETACH ( ) ) {
if ( detachUtil . isDETACH ( ) ) {
compHasSubs = MapperProxyFactory . getProxy ( CompMapper . class ) . hasDetachSubs ( jclRoleLevelList ) ;
if ( CollectionUtils . isNotEmpty ( jclRoleLevelList ) ) {
compHasSubs = MapperProxyFactory . getProxy ( CompMapper . class ) . hasDetachSubs ( jclRoleLevelList ) ;
} else {
compHasSubs = new ArrayList < > ( ) ;
}
} else {
} else {
compHasSubs = MapperProxyFactory . getProxy ( CompMapper . class ) . hasSubs ( ) ;
compHasSubs = MapperProxyFactory . getProxy ( CompMapper . class ) . hasSubs ( ) ;
}
}
@ -164,8 +178,12 @@ public class JobBrowserService extends BrowserService {
if ( "0" . equals ( params . getId ( ) ) ) {
if ( "0" . equals ( params . getId ( ) ) ) {
List < CompPO > compList ;
List < CompPO > compList ;
if ( detachUtil . isDETACH ( ) ) {
if ( detachUtil . isDETACH ( ) ) {
compList = MapperProxyFactory . getProxy ( CompMapper . class ) . getCompsByIds ( jclRoleLevelList ) ;
if ( CollectionUtils . isNotEmpty ( jclRoleLevelList ) ) {
detachUtil . filterCompanyList ( compList ) ;
compList = MapperProxyFactory . getProxy ( CompMapper . class ) . getCompsByIds ( jclRoleLevelList ) ;
detachUtil . filterCompanyList ( compList ) ;
} else {
compList = new ArrayList < > ( ) ;
}
} else {
} else {
compList = MapperProxyFactory . getProxy ( CompMapper . class ) . listParent ( ) ;
compList = MapperProxyFactory . getProxy ( CompMapper . class ) . listParent ( ) ;
}
}