@@ -32,7 +32,7 @@ public interface RegionCacheHelper { | |||||
* @param level 区域层级 | * @param level 区域层级 | ||||
* @return {@link RegionDTO} | * @return {@link RegionDTO} | ||||
*/ | */ | ||||
RegionDTO getByCodeAndLevel(String code, int level); | |||||
RegionDTO getByCodeAndLevel(String code, Integer level); | |||||
/** | /** | ||||
* 获取区域名称 | * 获取区域名称 | ||||
@@ -14,6 +14,7 @@ import com.ningdatech.pmapi.sys.model.dto.RegionTreeDTO; | |||||
import com.ningdatech.pmapi.sys.model.vo.RegionTreeVO; | import com.ningdatech.pmapi.sys.model.vo.RegionTreeVO; | ||||
import lombok.extern.slf4j.Slf4j; | import lombok.extern.slf4j.Slf4j; | ||||
import org.apache.commons.collections4.CollectionUtils; | import org.apache.commons.collections4.CollectionUtils; | ||||
import org.apache.commons.lang3.StringUtils; | |||||
import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
import java.util.*; | import java.util.*; | ||||
@@ -29,7 +30,10 @@ import java.util.stream.Collectors; | |||||
public class RegionsCacheHelperImpl extends AbstractRegionCacheHelper implements RegionCacheHelper { | public class RegionsCacheHelperImpl extends AbstractRegionCacheHelper implements RegionCacheHelper { | ||||
@Override | @Override | ||||
public RegionDTO getByCodeAndLevel(String code, int level) { | |||||
public RegionDTO getByCodeAndLevel(String code, Integer level) { | |||||
if (StringUtils.isBlank(code) || Objects.isNull(level)) { | |||||
return null; | |||||
} | |||||
return super.get(RegionMapKey.of(code, level)); | return super.get(RegionMapKey.of(code, level)); | ||||
} | } | ||||
@@ -68,7 +68,7 @@ public class ExpertMetaApplyManage { | |||||
private final IExpertMetaApplyService iMetaApplyService; | private final IExpertMetaApplyService iMetaApplyService; | ||||
private final IExpertDictionaryService expertDictionaryService; | private final IExpertDictionaryService expertDictionaryService; | ||||
// private final IExpertAdminManageService ExpertAdminManageService; | |||||
// private final IExpertAdminManageService ExpertAdminManageService; | |||||
private final RegionCacheHelper regionCacheHelper; | private final RegionCacheHelper regionCacheHelper; | ||||
private final IExpertUserFullInfoService userFullInfoService; | private final IExpertUserFullInfoService userFullInfoService; | ||||
private final DictionaryCache dictionaryCache; | private final DictionaryCache dictionaryCache; | ||||
@@ -434,11 +434,14 @@ public class ExpertMetaApplyManage { | |||||
expertApplyMetaVO.setName(expertUserFullInfo.getExpertName()); | expertApplyMetaVO.setName(expertUserFullInfo.getExpertName()); | ||||
RegionDTO regionDTO = regionCacheHelper.getByCodeAndLevel(expertUserFullInfo.getRegionCode(), expertUserFullInfo.getRegionLevel()); | RegionDTO regionDTO = regionCacheHelper.getByCodeAndLevel(expertUserFullInfo.getRegionCode(), expertUserFullInfo.getRegionLevel()); | ||||
ExpertRegionInfo expertRegionInfo = new ExpertRegionInfo(); | |||||
expertRegionInfo.setRegionCode(expertUserFullInfo.getRegionCode()); | |||||
expertRegionInfo.setRegionLevel(expertUserFullInfo.getRegionLevel()); | |||||
expertRegionInfo.setRegionName(regionDTO.getRegionName()); | |||||
expertApplyMetaVO.setExpertRegionInfo(expertRegionInfo); | |||||
if (Objects.nonNull(regionDTO)) { | |||||
ExpertRegionInfo expertRegionInfo = new ExpertRegionInfo(); | |||||
expertRegionInfo.setRegionCode(expertUserFullInfo.getRegionCode()); | |||||
expertRegionInfo.setRegionLevel(expertUserFullInfo.getRegionLevel()); | |||||
expertRegionInfo.setRegionName(regionDTO.getRegionName()); | |||||
expertApplyMetaVO.setExpertRegionInfo(expertRegionInfo); | |||||
} | |||||
List<ExpertDictionary> expertDictionaryList = expertDictionaryListMap.get(userId); | List<ExpertDictionary> expertDictionaryList = expertDictionaryListMap.get(userId); | ||||
if (CollectionUtils.isNotEmpty(expertDictionaryList)) { | if (CollectionUtils.isNotEmpty(expertDictionaryList)) { | ||||
@@ -6,7 +6,6 @@ import com.ningdatech.pmapi.user.security.auth.constants.UserDeatilsServiceConst | |||||
import com.ningdatech.zwdd.client.ZwddAuthClient; | import com.ningdatech.zwdd.client.ZwddAuthClient; | ||||
import org.springframework.security.authentication.AuthenticationProvider; | import org.springframework.security.authentication.AuthenticationProvider; | ||||
import org.springframework.security.authentication.BadCredentialsException; | import org.springframework.security.authentication.BadCredentialsException; | ||||
import org.springframework.security.authentication.InternalAuthenticationServiceException; | |||||
import org.springframework.security.core.Authentication; | import org.springframework.security.core.Authentication; | ||||
import org.springframework.security.core.AuthenticationException; | import org.springframework.security.core.AuthenticationException; | ||||
import org.springframework.security.core.userdetails.UserDetails; | import org.springframework.security.core.userdetails.UserDetails; | ||||
@@ -60,12 +59,6 @@ public class CredentialAuthProvider implements AuthenticationProvider { | |||||
case USERNAME_PASSWORD_LOGIN: { | case USERNAME_PASSWORD_LOGIN: { | ||||
user = userDetailsService.loadUserByUsername(principal + UserDeatilsServiceConstant.USER_DETAILS_SERVICE_SEPARATOR + loginTypeEnum.name()); | user = userDetailsService.loadUserByUsername(principal + UserDeatilsServiceConstant.USER_DETAILS_SERVICE_SEPARATOR + loginTypeEnum.name()); | ||||
// TODO 校验测试环境关闭登陆校验 | // TODO 校验测试环境关闭登陆校验 | ||||
// if (user == null) { | |||||
// throw new InternalAuthenticationServiceException("can not get user info!"); | |||||
// } | |||||
// // 账号密码登陆 更改 | |||||
// additionalAuthenticationChecks(user, authenticationToken); | |||||
} | } | ||||
break; | break; | ||||
} | } | ||||