|
|
@@ -8,6 +8,9 @@ import java.util.Map;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
+import com.lc.ibps.api.org.service.IPartyPositionService;
|
|
|
+import com.lc.ibps.org.party.persistence.entity.PartyPositionPo;
|
|
|
+import org.apache.commons.lang3.BooleanUtils;
|
|
|
import org.springframework.context.annotation.Lazy;
|
|
|
import org.springframework.stereotype.Repository;
|
|
|
|
|
|
@@ -16,7 +19,6 @@ import com.lc.ibps.api.base.model.PartyEntity;
|
|
|
import com.lc.ibps.api.base.query.QueryFilter;
|
|
|
import com.lc.ibps.api.common.rights.constants.RightsKey;
|
|
|
import com.lc.ibps.api.common.rights.service.IRightsDefService;
|
|
|
-import com.lc.ibps.api.org.service.IPartyOrgService;
|
|
|
import com.lc.ibps.base.core.constants.Bool;
|
|
|
import com.lc.ibps.base.core.constants.StringPool;
|
|
|
import com.lc.ibps.base.core.util.AppUtil;
|
|
|
@@ -92,7 +94,8 @@ public class DesktopManageRepositoryImpl extends AbstractRepository<String, Desk
|
|
|
@Override
|
|
|
public String getHasRightsLayout(String userId) {
|
|
|
// 取得当前的用户的组织的归属组织
|
|
|
- List<String> orgIds = getOrgSubByUserId(userId);
|
|
|
+ //医学版使用岗位代替组织
|
|
|
+ List<String> orgIds = getPartyPositionByUserId(userId);
|
|
|
if(BeanUtils.isEmpty(orgIds)) return null;
|
|
|
|
|
|
// 直接查询所属组织默认桌面,从本组织一个一个往上查,避免顺序问题
|
|
|
@@ -113,24 +116,23 @@ public class DesktopManageRepositoryImpl extends AbstractRepository<String, Desk
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- private List<String> getOrgSubByUserId(String userId) {
|
|
|
- IPartyOrgService orgService = AppUtil.getBean(IPartyOrgService.class);
|
|
|
- List<PartyEntity> data = orgService.findByUserId(userId);
|
|
|
+ private List<String> getPartyPositionByUserId(String userId) {
|
|
|
+ IPartyPositionService orgService = AppUtil.getBean(IPartyPositionService.class);
|
|
|
+ List<PartyEntity> data = orgService.getByUserId(userId);
|
|
|
if(BeanUtils.isEmpty(data)){
|
|
|
return Collections.emptyList();
|
|
|
}
|
|
|
|
|
|
List<String> objIds = new ArrayList<String>();
|
|
|
for (PartyEntity group : data) {
|
|
|
- objIds.add(group.getId());
|
|
|
-
|
|
|
- // 获取用户所属组的父节点,直到最顶级
|
|
|
- List<PartyEntity> pdata = orgService.findParents(group.getAlias());
|
|
|
- if(BeanUtils.isNotEmpty(pdata)){
|
|
|
- for (PartyEntity g : pdata) {
|
|
|
- objIds.add(g.getId());
|
|
|
- }
|
|
|
+ PartyPositionPo partyPosition = (PartyPositionPo) group;
|
|
|
+ //优先判断主岗位
|
|
|
+ if(BooleanUtils.toBoolean(partyPosition.getIsMainPost())){
|
|
|
+ objIds.add(0,group.getId());
|
|
|
+ }else {
|
|
|
+ objIds.add(group.getId());
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
return objIds;
|