fix:userinfo返回角色编码
This commit is contained in:
@@ -8,11 +8,11 @@ import com.honeycombis.honeycom.msg.api.constant.MessageArgsEnum;
|
||||
import com.honeycombis.honeycom.msg.api.dto.MessageParameterDTO;
|
||||
import com.honeycombis.honeycom.msg.api.vo.MessageArgsVo;
|
||||
import com.honeycombis.honeycom.msg.service.MessageArgsService;
|
||||
import com.honeycombis.honeycom.pm.entity.PmMilestoneEntity;
|
||||
import com.honeycombis.honeycom.pm.entity.PmProjectEntity;
|
||||
import com.honeycombis.honeycom.pm.entity.PmTaskEntity;
|
||||
import com.honeycombis.honeycom.pm.feign.HoneycomPmTaskServiceFeign;
|
||||
import com.honeycombis.honeycom.pm.vo.PmTaskToMsgVo;
|
||||
//import com.honeycombis.honeycom.pm.entity.PmMilestoneEntity;
|
||||
//import com.honeycombis.honeycom.pm.entity.PmProjectEntity;
|
||||
//import com.honeycombis.honeycom.pm.entity.PmTaskEntity;
|
||||
//import com.honeycombis.honeycom.pm.feign.HoneycomPmTaskServiceFeign;
|
||||
//import com.honeycombis.honeycom.pm.vo.PmTaskToMsgVo;
|
||||
import com.honeycombis.honeycom.tenant.entity.SysDeptEntity;
|
||||
import com.honeycombis.honeycom.tenant.feign.HoneycomTenantServiceFeign;
|
||||
import com.honeycombis.honeycom.tenant.vo.SysStaffDetailVO;
|
||||
@@ -33,7 +33,7 @@ import java.util.Objects;
|
||||
@RequiredArgsConstructor
|
||||
public class MessageArgsServiceImpl implements MessageArgsService {
|
||||
|
||||
private final HoneycomPmTaskServiceFeign honeycomPmTaskServiceFeign;
|
||||
// private final HoneycomPmTaskServiceFeign honeycomPmTaskServiceFeign;
|
||||
private final HoneycomTenantServiceFeign honeycomTenantServiceFeign;
|
||||
private final HoneycomUserServiceFeign honeycomUserServiceFeign;
|
||||
|
||||
@@ -70,39 +70,39 @@ public class MessageArgsServiceImpl implements MessageArgsService {
|
||||
*/
|
||||
@Override
|
||||
public String getValue4Args(String businessArgsJson, Long tenantId, MessageArgsEnum args, Long userId) {
|
||||
if (StringUtils.isBlank(businessArgsJson)) {
|
||||
// json值为空则返回空串
|
||||
return "";
|
||||
}
|
||||
JSONObject jsonObject = JSONObject.parseObject(businessArgsJson);
|
||||
String argsValue = jsonObject.getString(args.getBusinessArgName());
|
||||
if (StrUtil.isBlank(argsValue)) {
|
||||
// 获取的属性值为空返回空串
|
||||
return "";
|
||||
}
|
||||
if (args.getDataSource() == 0) {
|
||||
// 根据项目ID获取项目信息
|
||||
R<PmProjectEntity> result = honeycomPmTaskServiceFeign.getMsgProjectArgs(Long.valueOf(argsValue), SecurityConstants.FROM_IN);
|
||||
return getObjectValue(result, args.getApiFieldName());
|
||||
} else if (args.getDataSource() == 1) {
|
||||
// 根据任务ID获取任务信息
|
||||
R<PmTaskToMsgVo> result = honeycomPmTaskServiceFeign.getMsgTaskArgs(Long.valueOf(argsValue), SecurityConstants.FROM_IN);
|
||||
return getObjectValue(result, args.getApiFieldName());
|
||||
} else if (args.getDataSource() == 2) {
|
||||
// 根据里程碑ID获取里程碑信息
|
||||
R<PmMilestoneEntity> result = honeycomPmTaskServiceFeign.getMsgMilestoneArgs(Long.valueOf(argsValue), SecurityConstants.FROM_IN);
|
||||
return getObjectValue(result, args.getApiFieldName());
|
||||
} else if (args.getDataSource() == 3) {
|
||||
// 根据租户ID获取租户信息
|
||||
R<TenantViewVO> result = honeycomTenantServiceFeign.getTenantView(tenantId, SecurityConstants.FROM_IN);
|
||||
return getObjectValue(result, args.getApiFieldName());
|
||||
} else if (args.getDataSource() == 4) {
|
||||
R<SysStaffDetailVO> result = honeycomTenantServiceFeign.getById(Long.valueOf(argsValue), SecurityConstants.FROM_IN);
|
||||
return getObjectValue(result, args.getApiFieldName());
|
||||
} else if (args.getDataSource() == 5) {
|
||||
R<SysDeptEntity> result = honeycomTenantServiceFeign.getDeptById(Long.valueOf(argsValue), SecurityConstants.FROM_IN);
|
||||
return getObjectValue(result, args.getApiFieldName());
|
||||
}
|
||||
// if (StringUtils.isBlank(businessArgsJson)) {
|
||||
// // json值为空则返回空串
|
||||
// return "";
|
||||
// }
|
||||
// JSONObject jsonObject = JSONObject.parseObject(businessArgsJson);
|
||||
// String argsValue = jsonObject.getString(args.getBusinessArgName());
|
||||
// if (StrUtil.isBlank(argsValue)) {
|
||||
// // 获取的属性值为空返回空串
|
||||
// return "";
|
||||
// }
|
||||
// if (args.getDataSource() == 0) {
|
||||
// // 根据项目ID获取项目信息
|
||||
// R<PmProjectEntity> result = honeycomPmTaskServiceFeign.getMsgProjectArgs(Long.valueOf(argsValue), SecurityConstants.FROM_IN);
|
||||
// return getObjectValue(result, args.getApiFieldName());
|
||||
// } else if (args.getDataSource() == 1) {
|
||||
// // 根据任务ID获取任务信息
|
||||
// R<PmTaskToMsgVo> result = honeycomPmTaskServiceFeign.getMsgTaskArgs(Long.valueOf(argsValue), SecurityConstants.FROM_IN);
|
||||
// return getObjectValue(result, args.getApiFieldName());
|
||||
// } else if (args.getDataSource() == 2) {
|
||||
// // 根据里程碑ID获取里程碑信息
|
||||
// R<PmMilestoneEntity> result = honeycomPmTaskServiceFeign.getMsgMilestoneArgs(Long.valueOf(argsValue), SecurityConstants.FROM_IN);
|
||||
// return getObjectValue(result, args.getApiFieldName());
|
||||
// } else if (args.getDataSource() == 3) {
|
||||
// // 根据租户ID获取租户信息
|
||||
// R<TenantViewVO> result = honeycomTenantServiceFeign.getTenantView(tenantId, SecurityConstants.FROM_IN);
|
||||
// return getObjectValue(result, args.getApiFieldName());
|
||||
// } else if (args.getDataSource() == 4) {
|
||||
// R<SysStaffDetailVO> result = honeycomTenantServiceFeign.getById(Long.valueOf(argsValue), SecurityConstants.FROM_IN);
|
||||
// return getObjectValue(result, args.getApiFieldName());
|
||||
// } else if (args.getDataSource() == 5) {
|
||||
// R<SysDeptEntity> result = honeycomTenantServiceFeign.getDeptById(Long.valueOf(argsValue), SecurityConstants.FROM_IN);
|
||||
// return getObjectValue(result, args.getApiFieldName());
|
||||
// }
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
@@ -32,4 +32,10 @@ public class SysUserInfoVO implements Serializable {
|
||||
@Schema(description = "角色标识集合")
|
||||
private List<Long> roles = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* 角色编码集合
|
||||
*/
|
||||
@Schema(description = "角色编码集合")
|
||||
private List<String> roleCodes = new ArrayList<>();
|
||||
|
||||
}
|
||||
|
||||
@@ -829,6 +829,9 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUserEntity
|
||||
List<Long> roleIds = sysRoleList.stream().map(SysRoleVO::getRoleId).collect(Collectors.toList());
|
||||
result.setRoles(roleIds);
|
||||
|
||||
List<String> roleCodes = sysRoleList.stream().map(SysRoleVO::getRoleCode).collect(Collectors.toList());
|
||||
result.setRoleCodes(roleCodes);
|
||||
|
||||
// 获取功能编码相关
|
||||
R<List<String>> functionCodeReturn = honeycomTenantServiceFeign.findFunctionCodesByRoleId(userInfo.getUserId(), String.valueOf(loginDefaultStaff.getTenantId()), SecurityConstants.FROM_IN);
|
||||
if (Objects.isNull(functionCodeReturn) || !functionCodeReturn.isOk()) {
|
||||
|
||||
Reference in New Issue
Block a user