测试userId的获取

This commit is contained in:
zjh 2025-12-08 18:33:10 +08:00
parent abf878bad1
commit e97c2df9d0
3 changed files with 20 additions and 10 deletions

View File

@ -1,6 +1,7 @@
package com.xdap.self_development.controller; package com.xdap.self_development.controller;
import com.definesys.mpaas.common.http.Response; import com.definesys.mpaas.common.http.Response;
import com.xdap.api.moudle.user.vo.LoginUserVo;
import com.xdap.runtime.service.RuntimeAppContextService; import com.xdap.runtime.service.RuntimeAppContextService;
import com.xdap.runtime.service.RuntimeDatasourceService; import com.xdap.runtime.service.RuntimeDatasourceService;
import com.xdap.runtime.service.RuntimeUserService; import com.xdap.runtime.service.RuntimeUserService;
@ -42,11 +43,13 @@ public class DataEntryController {
String currentTenantId = runtimeAppContextService.getCurrentTenantId(); String currentTenantId = runtimeAppContextService.getCurrentTenantId();
String currentToken = runtimeAppContextService.getCurrentToken(); String currentToken = runtimeAppContextService.getCurrentToken();
String currentUserId = runtimeAppContextService.getCurrentUserId(); String currentUserId = runtimeAppContextService.getCurrentUserId();
LoginUserVo loginUserVo = runtimeUserService.queryLoginUserVo(currentUserId, currentTenantId, currentAppId);
map.put("currentAppId", currentAppId); map.put("currentAppId", currentAppId);
map.put("currentTenantId", currentTenantId); map.put("currentTenantId", currentTenantId);
map.put("currentToken", currentToken); map.put("currentToken", currentToken);
map.put("currentUserId", currentUserId); map.put("currentUserId", currentUserId);
map.put("loginUserVo", loginUserVo.toString());
return Response.ok().data(map); return Response.ok().data(map);
} }

View File

@ -10,8 +10,10 @@ import com.xdap.self_development.pojo.Parameter;
import com.xdap.self_development.pojo.RevisionRecord; import com.xdap.self_development.pojo.RevisionRecord;
import com.xdap.self_development.pojo.Template; import com.xdap.self_development.pojo.Template;
import com.xdap.self_development.pojo.TemplateAndParameter; import com.xdap.self_development.pojo.TemplateAndParameter;
import com.xdap.self_development.pojo.view.MenuParamView;
import com.xdap.self_development.pojo.view.ParametersView; import com.xdap.self_development.pojo.view.ParametersView;
import com.xdap.self_development.pojo.view.TemplateInfoView; import com.xdap.self_development.pojo.view.TemplateInfoView;
import com.xdap.self_development.service.ModelRoleService;
import com.xdap.self_development.service.ParameterService; import com.xdap.self_development.service.ParameterService;
import com.xdap.self_development.utils.FormulaValidator; import com.xdap.self_development.utils.FormulaValidator;
import com.xdap.self_development.utils.ParameterOperation; import com.xdap.self_development.utils.ParameterOperation;
@ -31,6 +33,8 @@ import java.util.stream.Collectors;
public class ParameterServiceImpl implements ParameterService { public class ParameterServiceImpl implements ParameterService {
@Resource @Resource
private BusinessDatabase bd; private BusinessDatabase bd;
@Resource
private ModelRoleService modelRoleService;
@Override @Override
public PageQueryResult<Parameter> getParameterByCondition(ParameterPageForm form) { public PageQueryResult<Parameter> getParameterByCondition(ParameterPageForm form) {
@ -42,6 +46,9 @@ public class ParameterServiceImpl implements ParameterService {
throw new CommonException("模板未找到"); throw new CommonException("模板未找到");
} }
//todo 获取指定子系统下的用户的权限权限应该为:参数的 parameterNumber
List<MenuParamView> menuParamViews = modelRoleService.selectPersByUser("zjh");
return bd.getBusinessDatabase() return bd.getBusinessDatabase()
.viewQueryMode(true) .viewQueryMode(true)
.view("selectParametersByTemplateId") .view("selectParametersByTemplateId")

View File

@ -99,17 +99,17 @@ CREATE TABLE yfsjglpt_model_dep_user_role(
) COMMENT '部门或用户关联角色表'; ) COMMENT '部门或用户关联角色表';
-- -- 角色权限关联
DROP TABLE IF EXISTS yc_datasource_0.yfsjglpt_model_role_permission; DROP TABLE IF EXISTS yc_datasource_0.yfsjglpt_model_role_permission;
CREATE TABLE yc_datasource_0.yfsjglpt_model_role_permission( CREATE TABLE yc_datasource_0.yfsjglpt_model_role_permission(
`id` VARCHAR(64) NOT NULL COMMENT 'ID', `id` VARCHAR(64) NOT NULL COMMENT 'ID',
`role_id` VARCHAR(64) COMMENT '角色ID', `role_id` VARCHAR(64) COMMENT '角色ID',
`per_id` VARCHAR(64) COMMENT '权限路径ID', `per_id` VARCHAR(64) COMMENT '权限路径ID',
`is_enable` INT DEFAULT 1 COMMENT '是否启用;0未启用1启用', `is_enable` INT DEFAULT 1 COMMENT '是否启用;0未启用1启用',
`created_by` VARCHAR(64) COMMENT '创建人', `created_by` VARCHAR(64) COMMENT '创建人',
`creation_date` DATETIME COMMENT '创建时间', `creation_date` DATETIME COMMENT '创建时间',
`last_updated_by` VARCHAR(64) COMMENT '最后更新人', `last_updated_by` VARCHAR(64) COMMENT '最后更新人',
`last_update_date` DATETIME COMMENT '最后更新时间', `last_update_date` DATETIME COMMENT '最后更新时间',
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) COMMENT '角色权限关联表'; ) COMMENT '角色权限关联表';