Commit 2615d545 by guojuxing

运维人员部门职位权限调整

parent 97cd84f1
......@@ -5,7 +5,10 @@ import java.util.stream.Collectors;
import com.gic.auth.entity.*;
import com.gic.auth.qo.UserMenuQO;
import com.gic.authcenter.api.dto.GicDepartmentDTO;
import com.gic.authcenter.api.dto.GicPositionDTO;
import com.gic.authcenter.api.dto.GicUserDTO;
import com.gic.authcenter.api.service.GicDepartmentService;
import com.gic.authcenter.api.service.GicUserService;
import com.gic.commons.util.CollectionUtil;
import com.gic.enterprise.dto.EnterpriseDTO;
......@@ -66,6 +69,8 @@ public class MenuApiServiceImpl implements MenuApiService {
private MenuAuthDepartService menuAuthDepartService;
@Autowired
private GicUserService gicUserService;
@Autowired
private GicDepartmentService gicDepartmentService;
@Override
public ServiceResponse<List<MenuDTO>> listByMenuIdList(List<Integer> menuIdList) {
......@@ -1208,8 +1213,23 @@ public class MenuApiServiceImpl implements MenuApiService {
LOGGER.info("运维人员的部门职位数据:{}", JSON.toJSONString(gicUserDTO));
//如果是运营人员
Set<String> departPosition = new HashSet<>(2);
if (StringUtils.isNotBlank(gicUserDTO.getDepartmentCode())) {
departPosition.add(gicUserDTO.getDepartmentCode() + "-" + gicUserDTO.getPositionCode());
String departmentCode = gicUserDTO.getDepartmentCode();
if (StringUtils.isNotBlank(departmentCode)) {
if (StringUtils.isBlank(gicUserDTO.getPositionCode())) {
//如果职位code是空,则取下面全部的职位code
List<GicDepartmentDTO> gicDepartmentDTOList = gicDepartmentService.listAllGicDepartment();
if (CollectionUtils.isNotEmpty(gicDepartmentDTOList)) {
Map<String, List<GicPositionDTO>> departMap = gicDepartmentDTOList
.stream()
.collect(Collectors.toMap(e -> e.getDepartmentCode(), e -> e.getPositionList()));
List<GicPositionDTO> positionList = departMap.get(departmentCode);
if (CollectionUtils.isNotEmpty(positionList)) {
positionList.forEach(e -> {
departPosition.add(departmentCode + "-" + e.getPositionCode());
});
}
}
}
}
//过滤运营人员的部门职位权限
Map<String, List<TabSysMenuAuthDepart>> departMap = getAuthDepartMap(null);
......
......@@ -70,4 +70,5 @@
<dubbo:reference interface="com.gic.goods.api.service.GoodsRightsSelectorApiService" id="goodsRightsSelectorApiService" timeout="6000" />
<dubbo:reference interface="com.gic.authcenter.api.service.GicUserService" id="gicUserService" timeout="6000" />
<dubbo:reference interface="com.gic.authcenter.api.service.GicDepartmentService" id="gicDepartmentService" timeout="6000" />
</beans>
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