Переглянути джерело

Merge remote-tracking branch 'origin/master'

tags/24080901
PoffyZhang 1 рік тому
джерело
коміт
5e3d1423bc
2 змінених файлів з 5 додано та 19 видалено
  1. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/organization/service/impl/DingOrganizationServiceImpl.java
  2. +4
    -18
      pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserAuthManage.java

+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/organization/service/impl/DingOrganizationServiceImpl.java Переглянути файл

@@ -87,7 +87,7 @@ public class DingOrganizationServiceImpl extends ServiceImpl<DingOrganizationMap
@Override
public Map<String, DingOrganization> getEmpCodeOrgMap(List<DingEmployeeInfo> employeeInfoList) {
List<String> orgCodeList = employeeInfoList.stream()
.map(DingEmployeeInfo::getOrganizationCode)
.map(DingEmployeeInfo::getEmpPosUnitCode)
.distinct().collect(Collectors.toList());

Map<String, DingOrganization> orgMap = this.getOrgMap(orgCodeList);


+ 4
- 18
pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserAuthManage.java Переглянути файл

@@ -1,7 +1,6 @@
package com.ningdatech.pmapi.user.manage;

import com.ningdatech.pmapi.common.helper.UserInfoHelper;
import com.ningdatech.pmapi.common.util.StrUtils;
import com.ningdatech.pmapi.user.convert.UserInfoConvertor;
import com.ningdatech.pmapi.user.security.auth.credential.CredentialAuthToken;
import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO;
@@ -34,7 +33,7 @@ public class UserAuthManage {
@SuppressWarnings({"rawtypes", "unchecked"})
public void refreshSession(Long userId) {
UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(userId);
List<String> sessionIds = getSessionIds(userFullInfo);
List<String> sessionIds = getSessionIds(userFullInfo.getUsername());
if (sessionIds.isEmpty()) {
return;
}
@@ -50,26 +49,13 @@ public class UserAuthManage {
});
}

private List<String> getSessionIds(UserFullInfoDTO userFullInfo) {
List<String> sessionIds = new ArrayList<>();
String identifier = userFullInfo.getIdentifier();
if (StrUtils.isNotBlank(identifier)) {
sessionIds.addAll(redisSessionRepository.findByPrincipalName(identifier).keySet());
}
String mobile = userFullInfo.getMobile();
if (StrUtils.isNotBlank(mobile)) {
sessionIds.addAll(redisSessionRepository.findByPrincipalName(mobile).keySet());
}
Long accountId = userFullInfo.getAccountId();
if (accountId != null) {
sessionIds.addAll(redisSessionRepository.findByPrincipalName(accountId.toString()).keySet());
}
return sessionIds;
private List<String> getSessionIds(String username) {
return new ArrayList<>(redisSessionRepository.findByPrincipalName(username).keySet());
}

public void kickOff(Long userId) {
UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(userId);
List<String> sessionIds = getSessionIds(userFullInfo);
List<String> sessionIds = getSessionIds(userFullInfo.getUsername());
sessionIds.forEach(redisSessionRepository::deleteById);
}



Завантаження…
Відмінити
Зберегти