| | |
| | | import com.xiaopeng.api.model.operation.XpWhitelistOperlog; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.exception.ServiceException; |
| | | import com.xiaopeng.common.core.utils.SensitiveDataCryptoUtil; |
| | | import com.xiaopeng.common.core.utils.WebUtils; |
| | | import com.xiaopeng.common.core.utils.bean.BeanUtils; |
| | | import com.xiaopeng.common.core.utils.ip.IpUtils; |
| | |
| | | if (!CollectionUtils.isEmpty(candidateAccounts)) { |
| | | existsAccounts = xpWhitelistService.lambdaQuery() |
| | | .select(XpWhitelist::getAccount) |
| | | .in(XpWhitelist::getAccount, candidateAccounts) |
| | | .in(XpWhitelist::getAccount, buildAccountQueryValues(candidateAccounts)) |
| | | .list() |
| | | .stream() |
| | | .map(XpWhitelist::getAccount) |
| | | .map(SensitiveDataCryptoUtil::decryptIfPossible) |
| | | .filter(StringUtils::hasLength) |
| | | .collect(Collectors.toSet()); |
| | | } |
| | |
| | | return value.substring(0, maxLength); |
| | | } |
| | | |
| | | private static List<String> buildAccountQueryValues(Set<String> accounts) { |
| | | if (CollectionUtils.isEmpty(accounts)) { |
| | | return Collections.emptyList(); |
| | | } |
| | | return accounts.stream() |
| | | .filter(StringUtils::hasLength) |
| | | .flatMap(account -> SensitiveDataCryptoUtil.queryValues(account).stream()) |
| | | .distinct() |
| | | .collect(Collectors.toList()); |
| | | } |
| | | |
| | | @ApiOperation(value = "白名单导出") |
| | | @PostMapping(value = "/api/v1/whitelist/exportExcels") |
| | | public void exportExcels(@RequestBody WhitelistPageListQuery query) { |