Java Code Examples for org.jeecg.common.system.vo.LoginUser#getRealname()

The following examples show how to use org.jeecg.common.system.vo.LoginUser#getRealname() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SysUserController.java    From jeecg-cloud with Apache License 2.0 8 votes vote down vote up
/**
   * 导出excel
   *
   * @param request
   */
  @RequestMapping(value = "/exportXls")
  public ModelAndView exportXls(SysUser sysUser,HttpServletRequest request) {
      // Step.1 组装查询条件
      QueryWrapper<SysUser> queryWrapper = QueryGenerator.initQueryWrapper(sysUser, request.getParameterMap());
      //Step.2 AutoPoi 导出Excel
      ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
      //update-begin--Author:kangxiaolin  Date:20180825 for:[03]用户导出,如果选择数据则只导出相关数据--------------------
      String selections = request.getParameter("selections");
     if(!oConvertUtils.isEmpty(selections)){
         queryWrapper.in("id",selections.split(","));
     }
      //update-end--Author:kangxiaolin  Date:20180825 for:[03]用户导出,如果选择数据则只导出相关数据----------------------
      List<SysUser> pageList = sysUserService.list(queryWrapper);

      //导出文件名称
      mv.addObject(NormalExcelConstants.FILE_NAME, "用户列表");
      mv.addObject(NormalExcelConstants.CLASS, SysUser.class);
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
      ExportParams exportParams = new ExportParams("用户列表数据", "导出人:"+user.getRealname(), "导出信息");
      exportParams.setImageBasePath(upLoadPath);
      mv.addObject(NormalExcelConstants.PARAMS, exportParams);
      mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
      return mv;
  }
 
Example 2
Source File: SysUserAgentController.java    From jeecg-cloud with Apache License 2.0 8 votes vote down vote up
/**
    * 导出excel
 *
 * @param sysUserAgent
 * @param request
 */
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(SysUserAgent sysUserAgent,HttpServletRequest request) {
    // Step.1 组装查询条件
    QueryWrapper<SysUserAgent> queryWrapper = QueryGenerator.initQueryWrapper(sysUserAgent, request.getParameterMap());
    //Step.2 AutoPoi 导出Excel
    ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
    List<SysUserAgent> pageList = sysUserAgentService.list(queryWrapper);
    //导出文件名称
    mv.addObject(NormalExcelConstants.FILE_NAME, "用户代理人设置列表");
    mv.addObject(NormalExcelConstants.CLASS, SysUserAgent.class);
    LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
 ExportParams exportParams = new ExportParams("用户代理人设置列表数据", "导出人:"+user.getRealname(), "导出信息");
 exportParams.setImageBasePath(upLoadPath);
    mv.addObject(NormalExcelConstants.PARAMS, exportParams);
    mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
    return mv;
}
 
Example 3
Source File: SysUserController.java    From jeecg-boot with Apache License 2.0 8 votes vote down vote up
/**
   * 导出excel
   *
   * @param request
   * @param response
   */
  @RequestMapping(value = "/exportXls")
  public ModelAndView exportXls(SysUser sysUser,HttpServletRequest request) {
      // Step.1 组装查询条件
      QueryWrapper<SysUser> queryWrapper = QueryGenerator.initQueryWrapper(sysUser, request.getParameterMap());
      //Step.2 AutoPoi 导出Excel
      ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
      //update-begin--Author:kangxiaolin  Date:20180825 for:[03]用户导出,如果选择数据则只导出相关数据--------------------
      String selections = request.getParameter("selections");
     if(!oConvertUtils.isEmpty(selections)){
         queryWrapper.in("id",selections.split(","));
     }
      //update-end--Author:kangxiaolin  Date:20180825 for:[03]用户导出,如果选择数据则只导出相关数据----------------------
      List<SysUser> pageList = sysUserService.list(queryWrapper);

      //导出文件名称
      mv.addObject(NormalExcelConstants.FILE_NAME, "用户列表");
      mv.addObject(NormalExcelConstants.CLASS, SysUser.class);
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
      ExportParams exportParams = new ExportParams("用户列表数据", "导出人:"+user.getRealname(), "导出信息");
      exportParams.setImageBasePath(upLoadPath);
      mv.addObject(NormalExcelConstants.PARAMS, exportParams);
      mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
      return mv;
  }
 
Example 4
Source File: SysUserAgentController.java    From jeecg-boot with Apache License 2.0 6 votes vote down vote up
/**
    * 导出excel
 *
 * @param sysUserAgent
 * @param request
 */
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(SysUserAgent sysUserAgent,HttpServletRequest request) {
    // Step.1 组装查询条件
    QueryWrapper<SysUserAgent> queryWrapper = QueryGenerator.initQueryWrapper(sysUserAgent, request.getParameterMap());
    //Step.2 AutoPoi 导出Excel
    ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
    List<SysUserAgent> pageList = sysUserAgentService.list(queryWrapper);
    //导出文件名称
    mv.addObject(NormalExcelConstants.FILE_NAME, "用户代理人设置列表");
    mv.addObject(NormalExcelConstants.CLASS, SysUserAgent.class);
    LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
 ExportParams exportParams = new ExportParams("用户代理人设置列表数据", "导出人:"+user.getRealname(), "导出信息");
 exportParams.setImageBasePath(upLoadPath);
    mv.addObject(NormalExcelConstants.PARAMS, exportParams);
    mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
    return mv;
}
 
Example 5
Source File: JwtUtil.java    From jeecg-cloud with Apache License 2.0 4 votes vote down vote up
/**
  * 从当前用户中获取变量
 * @param key
 * @param user
 * @return
 */
//TODO 急待改造 sckjkdsjsfjdk
public static String getUserSystemData(String key,SysUserCacheInfo user) {
	if(user==null) {
		user = JeecgDataAutorUtils.loadUserInfo();
	}
	//#{sys_user_code}%
	// 获取登录用户信息
	LoginUser sysUser = JwtUtil.getLoginUser();
	
	String moshi = "";
	if(key.indexOf("}")!=-1){
		 moshi = key.substring(key.indexOf("}")+1);
	}
	String returnValue = null;
	//针对特殊标示处理#{sysOrgCode},判断替换
	if (key.contains("#{")) {
		key = key.substring(2,key.indexOf("}"));
	} else {
		key = key;
	}
	//替换为系统登录用户帐号
	if (key.equals(DataBaseConstant.SYS_USER_CODE)|| key.toLowerCase().equals(DataBaseConstant.SYS_USER_CODE_TABLE)) {
		if(user==null) {
			returnValue = sysUser.getUsername();
		}else {
			returnValue = user.getSysUserCode();
		}
	}
	//替换为系统登录用户真实名字
	else if (key.equals(DataBaseConstant.SYS_USER_NAME)|| key.toLowerCase().equals(DataBaseConstant.SYS_USER_NAME_TABLE)) {
		if(user==null) {
			returnValue = sysUser.getRealname();
		}else {
			returnValue = user.getSysUserName();
		}
	}
	
	//替换为系统用户登录所使用的机构编码
	else if (key.equals(DataBaseConstant.SYS_ORG_CODE)|| key.toLowerCase().equals(DataBaseConstant.SYS_ORG_CODE_TABLE)) {
		if(user==null) {
			returnValue = sysUser.getOrgCode();
		}else {
			returnValue = user.getSysOrgCode();
		}
	}
	//替换为系统用户所拥有的所有机构编码
	else if (key.equals(DataBaseConstant.SYS_MULTI_ORG_CODE)|| key.toLowerCase().equals(DataBaseConstant.SYS_MULTI_ORG_CODE_TABLE)) {
		if(user.isOneDepart()) {
			returnValue = user.getSysMultiOrgCode().get(0);
		}else {
			returnValue = Joiner.on(",").join(user.getSysMultiOrgCode());
		}
	}
	//替换为当前系统时间(年月日)
	else if (key.equals(DataBaseConstant.SYS_DATE)|| key.toLowerCase().equals(DataBaseConstant.SYS_DATE_TABLE)) {
		returnValue = user.getSysDate();
	}
	//替换为当前系统时间(年月日时分秒)
	else if (key.equals(DataBaseConstant.SYS_TIME)|| key.toLowerCase().equals(DataBaseConstant.SYS_TIME_TABLE)) {
		returnValue = user.getSysTime();
	}
	//流程状态默认值(默认未发起)
	else if (key.equals(DataBaseConstant.BPM_STATUS)|| key.toLowerCase().equals(DataBaseConstant.BPM_STATUS_TABLE)) {
		returnValue = "1";
	}
	if(returnValue!=null){returnValue = returnValue + moshi;}
	return returnValue;
}
 
Example 6
Source File: JwtUtil.java    From jeecg-boot-with-activiti with MIT License 4 votes vote down vote up
/**
  * 从当前用户中获取变量
 * @param key
 * @param user
 * @return
 */
//TODO 急待改造 sckjkdsjsfjdk
public static String getUserSystemData(String key,SysUserCacheInfo user) {
	if(user==null) {
		user = JeecgDataAutorUtils.loadUserInfo();
	}
	//#{sys_user_code}%
	
	// 获取登录用户信息
	LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
	
	String moshi = "";
	if(key.indexOf("}")!=-1){
		 moshi = key.substring(key.indexOf("}")+1);
	}
	String returnValue = null;
	//针对特殊标示处理#{sysOrgCode},判断替换
	if (key.contains("#{")) {
		key = key.substring(2,key.indexOf("}"));
	} else {
		key = key;
	}
	//替换为系统登录用户帐号
	if (key.equals(DataBaseConstant.SYS_USER_CODE)|| key.equals(DataBaseConstant.SYS_USER_CODE_TABLE)) {
		if(user==null) {
			returnValue = sysUser.getUsername();
		}else {
			returnValue = user.getSysUserCode();
		}
	}
	//替换为系统登录用户真实名字
	else if (key.equals(DataBaseConstant.SYS_USER_NAME)|| key.equals(DataBaseConstant.SYS_USER_NAME_TABLE)) {
		if(user==null) {
			returnValue = sysUser.getRealname();
		}else {
			returnValue = user.getSysUserName();
		}
	}
	
	//替换为系统用户登录所使用的机构编码
	else if (key.equals(DataBaseConstant.SYS_ORG_CODE)|| key.equals(DataBaseConstant.SYS_ORG_CODE_TABLE)) {
		if(user==null) {
			returnValue = sysUser.getOrgCode();
		}else {
			returnValue = user.getSysOrgCode();
		}
	}
	//替换为系统用户所拥有的所有机构编码
	else if (key.equals(DataBaseConstant.SYS_MULTI_ORG_CODE)|| key.equals(DataBaseConstant.SYS_MULTI_ORG_CODE_TABLE)) {
		if(user.isOneDepart()) {
			returnValue = user.getSysMultiOrgCode().get(0);
		}else {
			returnValue = Joiner.on(",").join(user.getSysMultiOrgCode());
		}
	}
	//替换为当前系统时间(年月日)
	else if (key.equals(DataBaseConstant.SYS_DATE)|| key.equals(DataBaseConstant.SYS_DATE_TABLE)) {
		returnValue = user.getSysDate();
	}
	//替换为当前系统时间(年月日时分秒)
	else if (key.equals(DataBaseConstant.SYS_TIME)|| key.equals(DataBaseConstant.SYS_TIME_TABLE)) {
		returnValue = user.getSysTime();
	}
	//流程状态默认值(默认未发起)
	else if (key.equals(DataBaseConstant.BPM_STATUS)|| key.equals(DataBaseConstant.BPM_STATUS_TABLE)) {
		returnValue = "1";
	}
	if(returnValue!=null){returnValue = returnValue + moshi;}
	return returnValue;
}
 
Example 7
Source File: JwtUtil.java    From teaching with Apache License 2.0 4 votes vote down vote up
/**
  * 从当前用户中获取变量
 * @param key
 * @param user
 * @return
 */
//TODO 急待改造 sckjkdsjsfjdk
public static String getUserSystemData(String key,SysUserCacheInfo user) {
	if(user==null) {
		user = JeecgDataAutorUtils.loadUserInfo();
	}
	//#{sys_user_code}%
	
	// 获取登录用户信息
	LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
	
	String moshi = "";
	if(key.indexOf("}")!=-1){
		 moshi = key.substring(key.indexOf("}")+1);
	}
	String returnValue = null;
	//针对特殊标示处理#{sysOrgCode},判断替换
	if (key.contains("#{")) {
		key = key.substring(2,key.indexOf("}"));
	} else {
		key = key;
	}
	//替换为系统登录用户帐号
	if (key.equals(DataBaseConstant.SYS_USER_CODE)|| key.equals(DataBaseConstant.SYS_USER_CODE_TABLE)) {
		if(user==null) {
			returnValue = sysUser.getUsername();
		}else {
			returnValue = user.getSysUserCode();
		}
	}
	//替换为系统登录用户真实名字
	else if (key.equals(DataBaseConstant.SYS_USER_NAME)|| key.equals(DataBaseConstant.SYS_USER_NAME_TABLE)) {
		if(user==null) {
			returnValue = sysUser.getRealname();
		}else {
			returnValue = user.getSysUserName();
		}
	}
	
	//替换为系统用户登录所使用的机构编码
	else if (key.equals(DataBaseConstant.SYS_ORG_CODE)|| key.equals(DataBaseConstant.SYS_ORG_CODE_TABLE)) {
		if(user==null) {
			returnValue = sysUser.getOrgCode();
		}else {
			returnValue = user.getSysOrgCode();
		}
	}
	//替换为系统用户所拥有的所有机构编码
	else if (key.equals(DataBaseConstant.SYS_MULTI_ORG_CODE)|| key.equals(DataBaseConstant.SYS_MULTI_ORG_CODE_TABLE)) {
		if(user.isOneDepart()) {
			returnValue = user.getSysMultiOrgCode().get(0);
		}else {
			returnValue = Joiner.on(",").join(user.getSysMultiOrgCode());
		}
	}
	//替换为当前系统时间(年月日)
	else if (key.equals(DataBaseConstant.SYS_DATE)|| key.equals(DataBaseConstant.SYS_DATE_TABLE)) {
		returnValue = user.getSysDate();
	}
	//替换为当前系统时间(年月日时分秒)
	else if (key.equals(DataBaseConstant.SYS_TIME)|| key.equals(DataBaseConstant.SYS_TIME_TABLE)) {
		returnValue = user.getSysTime();
	}
	//流程状态默认值(默认未发起)
	else if (key.equals(DataBaseConstant.BPM_STATUS)|| key.equals(DataBaseConstant.BPM_STATUS_TABLE)) {
		returnValue = "1";
	}
	if(returnValue!=null){returnValue = returnValue + moshi;}
	return returnValue;
}
 
Example 8
Source File: JwtUtil.java    From jeecg-boot with Apache License 2.0 4 votes vote down vote up
/**
  * 从当前用户中获取变量
 * @param key
 * @param user
 * @return
 */
//TODO 急待改造 sckjkdsjsfjdk
public static String getUserSystemData(String key,SysUserCacheInfo user) {
	if(user==null) {
		user = JeecgDataAutorUtils.loadUserInfo();
	}
	//#{sys_user_code}%
	
	// 获取登录用户信息
	LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
	
	String moshi = "";
	if(key.indexOf("}")!=-1){
		 moshi = key.substring(key.indexOf("}")+1);
	}
	String returnValue = null;
	//针对特殊标示处理#{sysOrgCode},判断替换
	if (key.contains("#{")) {
		key = key.substring(2,key.indexOf("}"));
	} else {
		key = key;
	}
	//替换为系统登录用户帐号
	if (key.equals(DataBaseConstant.SYS_USER_CODE)|| key.toLowerCase().equals(DataBaseConstant.SYS_USER_CODE_TABLE)) {
		if(user==null) {
			returnValue = sysUser.getUsername();
		}else {
			returnValue = user.getSysUserCode();
		}
	}
	//替换为系统登录用户真实名字
	else if (key.equals(DataBaseConstant.SYS_USER_NAME)|| key.toLowerCase().equals(DataBaseConstant.SYS_USER_NAME_TABLE)) {
		if(user==null) {
			returnValue = sysUser.getRealname();
		}else {
			returnValue = user.getSysUserName();
		}
	}
	
	//替换为系统用户登录所使用的机构编码
	else if (key.equals(DataBaseConstant.SYS_ORG_CODE)|| key.toLowerCase().equals(DataBaseConstant.SYS_ORG_CODE_TABLE)) {
		if(user==null) {
			returnValue = sysUser.getOrgCode();
		}else {
			returnValue = user.getSysOrgCode();
		}
	}
	//替换为系统用户所拥有的所有机构编码
	else if (key.equals(DataBaseConstant.SYS_MULTI_ORG_CODE)|| key.toLowerCase().equals(DataBaseConstant.SYS_MULTI_ORG_CODE_TABLE)) {
		if(user.isOneDepart()) {
			returnValue = user.getSysMultiOrgCode().get(0);
		}else {
			returnValue = Joiner.on(",").join(user.getSysMultiOrgCode());
		}
	}
	//替换为当前系统时间(年月日)
	else if (key.equals(DataBaseConstant.SYS_DATE)|| key.toLowerCase().equals(DataBaseConstant.SYS_DATE_TABLE)) {
		returnValue = user.getSysDate();
	}
	//替换为当前系统时间(年月日时分秒)
	else if (key.equals(DataBaseConstant.SYS_TIME)|| key.toLowerCase().equals(DataBaseConstant.SYS_TIME_TABLE)) {
		returnValue = user.getSysTime();
	}
	//流程状态默认值(默认未发起)
	else if (key.equals(DataBaseConstant.BPM_STATUS)|| key.toLowerCase().equals(DataBaseConstant.BPM_STATUS_TABLE)) {
		returnValue = "1";
	}
	if(returnValue!=null){returnValue = returnValue + moshi;}
	return returnValue;
}