JECloud平台默认提供的前端变量说明

这些变量常用于过滤条件中,使用方式例如 and createName= {@USER_NAME@}

变量名
变量说明
登录用户 @USER_NAME@
登录用户编码 @USER_CODE@
登录用户ID @USER_ID@
登录部门 @DEPT_NAME@
登录部门编码 @DEPT_CODE@
登录部门ID @DEPT_ID@
登录部门路径 @DEPT_PATH@
登录集团公司 @USER_JTGSMC@
登录集团公司编码 @USER_JTGSCODE@
登录集团公司ID @USER_JTGSID@
当前日期(年月日) @NOW_DATE@
当前日期(年月日时分秒) @NOW_TIME@
当前年(年) @NOW_YEAR@
当前月(月) @NOW_MONTH@
登录用户邮箱 @USER_EMAIL@
登录用户电话 @USER.phone@
登录机构名称 @USER.ORGANIZATION_NAME@
登录机构编码 @USER.ORGANIZATION_CODE@
登录机构ID @USER.ORGANIZATION_ID@

前端变量对应处理的项目是 jecloud-pc-libs 项目

处理过程中需要读懂下面代码的逻辑

JECloud平台默认提供的后端变量说明


//用户基础信息
RealOrganizationUser realOrganizationUser = SecurityUserHolder.getCurrentAccountRealUser();
if (realOrganizationUser != null) {
    //用户ID
    variables.put("@USER_ID@", realOrganizationUser.getId());
    variables.put("@JE.currentUser.userId@", realOrganizationUser.getId());
    //用户CODE
    variables.put("@USER_CODE@", realOrganizationUser.getCode());
    variables.put("@JE.currentUser.userCode@", realOrganizationUser.getCode());
    //用户NAME
    variables.put("@USER_NAME@", realOrganizationUser.getName());
    variables.put("@JE.currentUser.username@", realOrganizationUser.getName());
}

Account account = SecurityUserHolder.getCurrentAccount();
    if (account != null) {
        variables.put("@USER_DEPTMENT_USER_ID@", account.getDeptId());
        variables.put("@USER_ROLEIDS@", account.getRoleIds());
        variables.put("@JE.currentUser.roleIds@", account.getRoleIds());
        variables.put("@USER_ROLECODES@", account.getRoleCodes());
        variables.put("@JE.currentUser.roleCodes@", account.getRoleCodes());
        variables.put("@USER_ROLENAMES@", account.getRoleNames());
        variables.put("@JE.currentUser.roleNames@", account.getRoleNames());
        variables.put("@USER_PHONE@", account.getPhone());
        variables.put("@JE.currentUser.phone@", account.getPhone());
        variables.put("@USER_IDCARD@", account.getCardNum());
        variables.put("@JE.currentUser.idCard@", account.getCardNum());
        variables.put("@USER_TENANT_ID@", account.getTenantId());
        variables.put("@JE.currentUser.tenantId@", account.getTenantId());
        variables.put("@USER_TENANT_NAME@", account.getTenantName());
        variables.put("@JE.currentUser.tenantName@", account.getTenantName());
        }

Department department = SecurityUserHolder.getCurrentAccountDepartment();
if (department != null) {
    variables.put("@USER_GROUP_COMPANY_ID@", department.getGroupCompanyId());
   variables.put("@JE.currentUser.groupCompanyId@", department.getGroupCompanyId());
    variables.put("@USER_GROUP_COMPANY_NAME@", department.getGroupCompanyName());
    variables.put("@JE.currentUser.groupCompanyName@", department.getGroupCompanyName());
    variables.put("@USER_GROUP_COMPANY_CODE@", department.getGroupCompanyCode());
    variables.put("@JE.currentUser.groupCompanyCode@", department.getGroupCompanyCode());
    variables.put("@DEPT_ID@", department.getId());
    variables.put("@JE.currentUser.deptId@", department.getId());
    variables.put("@DEPT_CODE@", department.getCode());
    variables.put("@JE.currentUser.deptCode@", department.getCode());
    variables.put("@DEPT_NAME@", department.getName());
    variables.put("@JE.currentUser.deptName@", department.getName());
    variables.put("@DEPT_PARENT_ID@", department.getParent());
    variables.put("@JE.currentUser.dept.parentId@", department.getParent());
    variables.put("@COMPANY_ID@", department.getCompanyId());
    variables.put("@JE.currentUser.companyId@", department.getCompanyCode());
    variables.put("@COMPANY_NAME@", department.getCompanyName());
}
//时间变量
variables.put("@NOW_DATE@", DateUtils.formatDate(new Date())); variables.put("@NOW_MONTH@", DateUtils.formatDate(new Date(), "yyyy-MM"));
variables.put("@NOW_TIME@", DateUtils.formatDateTime(new Date()));
variables.put("@NOW_YEAR@", DateUtils.formatDate(new Date(), "yyyy"));
variables.put("@NOW_ONLYMONTH@", DateUtils.formatDate(new Date(), "MM"));

后台处理变量是在jecloud-meta项目里面

最后编辑: 呼丽华  文档更新时间: 2024-08-08 13:51   作者:呼丽华