| | |
| | | package cn.huge.module.client.api.impl; |
| | | |
| | | import cn.huge.base.common.bo.R; |
| | | import cn.huge.base.common.bo.ReturnBO; |
| | | import cn.huge.base.common.constant.ReturnConsts; |
| | | import cn.huge.base.common.exception.ClientException; |
| | | import cn.huge.base.common.exception.ServiceException; |
| | | import cn.huge.module.client.api.SysClient; |
| | | import cn.huge.module.client.api.UtilsClient; |
| | | import cn.huge.module.ctuser.domain.po.CtUserole; |
| | | import cn.huge.module.cust.dto.CtUnitDTO; |
| | | import cn.huge.module.sys.dto.GridRoleMenuDTO; |
| | | import cn.huge.module.sys.dto.GridTokenBaseDTO; |
| | | import cn.huge.module.sys.dto.GridUserBaseDTO; |
| | | import cn.huge.module.sys.dto.GridUserRoleDTO; |
| | | import cn.huge.module.sys.vo.GridRoleMenuVo; |
| | | import cn.huge.module.sys.vo.GridUserRoleVo; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | /** |
| | | * 根据用户token获取用户信息 |
| | | * @url {ctx}/api/thrid/grid/user/get-userinfo |
| | | * |
| | | * @param gridTokenBaseDTO |
| | | * @return |
| | | * @url {ctx}/api/thrid/grid/user/get-userinfo |
| | | */ |
| | | public GridUserBaseDTO getUserInfo(GridTokenBaseDTO gridTokenBaseDTO){ |
| | | GridUserBaseDTO gridUserBaseDTO = null; |
| | |
| | | return gridUserBaseDTO; |
| | | } |
| | | |
| | | /** |
| | | * @param gridUserRoleVo |
| | | * @return 返回当前登录使用的机构角色 |
| | | */ |
| | | public GridUserRoleDTO getUserRoleList(GridUserRoleVo gridUserRoleVo) { |
| | | GridUserRoleDTO roleDTO = new GridUserRoleDTO(); |
| | | R<List<GridUserRoleDTO>> userRoleList = sysClient.getUserRoleList(gridUserRoleVo); |
| | | if (userRoleList.getCode() == R.SUCCESS) { |
| | | List<GridUserRoleDTO> data = userRoleList.getData(); |
| | | for (GridUserRoleDTO item : data) { |
| | | if (item.isLastOrgRole()) { |
| | | BeanUtils.copyProperties(item, roleDTO); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | return roleDTO; |
| | | } |
| | | |
| | | /** |
| | | * @param gridRoleMenuVo |
| | | * @return true管理员,全部权限;false,纠纷调解员,部分权限 //如果全部菜单权限,分配管理员角色;如果部分菜单权限,分配纠纷化解员角色 |
| | | */ |
| | | public CtUserole getRoleMenu(GridRoleMenuVo gridRoleMenuVo) { |
| | | //需要等所有菜单权限确认后再编写后续逻辑 |
| | | CtUserole ctUserole = new CtUserole(); |
| | | ctUserole.setRoleId("22_00024-4"); |
| | | ctUserole.setRoleName("纠纷化解人员"); |
| | | R<List<GridRoleMenuDTO>> roleMenu = sysClient.getRoleMenu(gridRoleMenuVo); |
| | | if (roleMenu.getCode() == R.SUCCESS) { |
| | | List<GridRoleMenuDTO> data = roleMenu.getData(); |
| | | String name = data.get(0).getName(); |
| | | if("矛盾纠纷化解子系统".equals(name)){ |
| | | List<GridRoleMenuDTO> children = data.get(0).getChildren(); |
| | | |
| | | } |
| | | } |
| | | return ctUserole; |
| | | } |
| | | |
| | | } |