测试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")