|
|
|
@ -28,6 +28,7 @@ import cn.estsh.impp.framework.boot.auth.AuthUtil;
|
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
|
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionEnum;
|
|
|
|
|
import cn.estsh.impp.framework.boot.util.ImppRedis;
|
|
|
|
|
import cn.estsh.impp.framework.boot.util.RedisUtilTool;
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.apache.shiro.authc.AuthenticationException;
|
|
|
|
@ -105,6 +106,9 @@ public class SysUserService implements ISysUserService {
|
|
|
|
|
@Autowired
|
|
|
|
|
private IPersonnelService personnelService;
|
|
|
|
|
|
|
|
|
|
@Resource(name = CommonConstWords.IMPP_REDIS_RES)
|
|
|
|
|
private ImppRedis redisRes;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 缓存
|
|
|
|
|
*/
|
|
|
|
@ -125,6 +129,7 @@ public class SysUserService implements ISysUserService {
|
|
|
|
|
throw new CredentialsException("用户不存在");
|
|
|
|
|
}
|
|
|
|
|
packSessionUser(sessionUser, user, user.getUserType(),loginPlatform, languageCode,deviceId);
|
|
|
|
|
packPageSessionUser(sessionUser, user);
|
|
|
|
|
AuthUtil.setSessionUser(sessionUser);
|
|
|
|
|
refreshUserLoginInformation(user.getId());
|
|
|
|
|
AuthUtil.online(sessionUser);
|
|
|
|
@ -606,6 +611,37 @@ public class SysUserService implements ISysUserService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public SessionUser packPageSessionUser(SessionUser sessionUser, SysUser user) {
|
|
|
|
|
SysConfig configPageList = RedisUtilTool.getSysConfigByConfigCode(redisRes, CommonConstWords.CONFIG_PAGE_SIZE_LIST);
|
|
|
|
|
try {
|
|
|
|
|
if(configPageList != null && StringUtils.isNotBlank(configPageList.getConfigValue())){
|
|
|
|
|
String[] split = configPageList.getConfigValue().split(",");
|
|
|
|
|
int[] ints = Arrays.stream(split).mapToInt(Integer::parseInt).toArray();
|
|
|
|
|
sessionUser.setPageSizeArray(Arrays.stream(ints).boxed().toArray(Integer[]::new));
|
|
|
|
|
}
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(sessionUser.getPageSizeArray() == null){
|
|
|
|
|
sessionUser.setPageSizeArray(CommonConstWords.CONFIG_PAGE_SIZE_LIST_DEFAULT);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SysConfig configPageSize = RedisUtilTool.getSysConfigByConfigCode(redisRes, CommonConstWords.CONFIG_PAGE_DEFAULT_SIZE);
|
|
|
|
|
try {
|
|
|
|
|
if(configPageSize != null && StringUtils.isNotBlank(configPageSize.getConfigValue())){
|
|
|
|
|
sessionUser.setPageDefaultSize(Integer.parseInt(configPageSize.getConfigValue()));
|
|
|
|
|
}
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(sessionUser.getPageDefaultSize() == null || sessionUser.getPageDefaultSize() <= 0){
|
|
|
|
|
sessionUser.setPageDefaultSize(CommonConstWords.CONFIG_PAGE_DEFAULT);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return sessionUser;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<SysUser> findSysUserByIds(Long[] ids) {
|
|
|
|
|
DdlPackBean ddlPackBean = new DdlPackBean();
|
|
|
|
|
DdlPreparedPack.getInPackArray(ids, "id", ddlPackBean);
|
|
|
|
|