Merge origin/main into main
This commit is contained in:
@@ -8,6 +8,7 @@ import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Date;
|
||||
import org.apache.commons.lang3.time.DateFormatUtils;
|
||||
|
||||
@@ -36,6 +37,10 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
|
||||
"yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM",
|
||||
"yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm", "yyyy.MM"};
|
||||
|
||||
public static final DateTimeFormatter ES_DATE_FORMATTER = DateTimeFormatter
|
||||
.ofPattern("yyyy-MM-dd HH:mm:ss")
|
||||
.withZone(ZoneId.of("UTC"));
|
||||
|
||||
/**
|
||||
* 获取当前Date型日期
|
||||
*
|
||||
|
||||
@@ -2,8 +2,8 @@ package com.ruoyi.common.utils;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
@@ -189,4 +189,48 @@ public class SecurityUtils
|
||||
.anyMatch(x -> Constants.SUPER_ADMIN.equals(x) || PatternMatchUtils.simpleMatch(x, role));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取浪潮用户ID
|
||||
**/
|
||||
public static Long getlcUserid()
|
||||
{
|
||||
try
|
||||
{
|
||||
return getLoginUser().getUser().getLcUserid();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new ServiceException("获取用户ID异常", HttpStatus.UNAUTHORIZED);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
public static Long getAppuserId()
|
||||
{
|
||||
try
|
||||
{
|
||||
return getLoginUser().getUser().getAppUserId();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new ServiceException("获取用户ID异常", HttpStatus.UNAUTHORIZED);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取企业社会信用代码
|
||||
* @return
|
||||
*/
|
||||
public static String getIdcard(){
|
||||
try
|
||||
{
|
||||
return getLoginUser().getUser().getIdCard();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new ServiceException("获取用户ID异常", HttpStatus.UNAUTHORIZED);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,4 +119,20 @@ public class SiteSecurityUtils
|
||||
throw new ServiceException("获取用户信息异常", HttpStatus.UNAUTHORIZED);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取lc_userid
|
||||
* @return
|
||||
*/
|
||||
public static Long getlcUserid()
|
||||
{
|
||||
try
|
||||
{
|
||||
return getLoginSiteUser().getUser().getLcUserid();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new ServiceException("获取用户ID异常", HttpStatus.UNAUTHORIZED);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user