|
@@ -1,5 +1,6 @@
|
|
|
package com.persagy.fm.saas.account.service.impl;
|
|
|
|
|
|
+import com.persagy.fm.common.constant.PageQueryConstants;
|
|
|
import com.persagy.fm.common.constant.enums.ValidEnum;
|
|
|
import com.persagy.fm.common.response.FmResponseContent;
|
|
|
import com.persagy.fm.saas.account.client.SaasAccountClient;
|
|
@@ -85,6 +86,36 @@ public class SaasAccountServiceImpl implements ISaasAccountService {
|
|
|
if (CollectionUtils.isEmpty(accountIds)) {
|
|
|
return Lists.newArrayList();
|
|
|
}
|
|
|
+
|
|
|
+ List<SaasAccountListItemVO> result = Lists.newArrayList();
|
|
|
+ int size = accountIds.size();
|
|
|
+ if (size < PageQueryConstants.PARAM_MAX_SIZE) {
|
|
|
+ return queryByAccountIdsWhenIdSizeSmall(accountIds);
|
|
|
+ } else {
|
|
|
+ int count = size / PageQueryConstants.PARAM_MAX_SIZE + 1;
|
|
|
+ for (int i = 0; i < count; i++) {
|
|
|
+ int startIndex = i * PageQueryConstants.PARAM_MAX_SIZE;
|
|
|
+ int endIndex = Math.min((i + 1) * PageQueryConstants.PARAM_MAX_SIZE, size);
|
|
|
+ List<String> subAccountIds = accountIds.subList(startIndex, endIndex);
|
|
|
+ result.addAll(queryByAccountIdsWhenIdSizeSmall(subAccountIds));
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 当账号列表size没有超过限制时,查询账号信息
|
|
|
+ *
|
|
|
+ * @param accountIds 账号id列表
|
|
|
+ * @return 账号列表
|
|
|
+ * @author lixing
|
|
|
+ * @version V1.0 2021/5/17 6:20 下午
|
|
|
+ */
|
|
|
+ private List<SaasAccountListItemVO> queryByAccountIdsWhenIdSizeSmall(List<String> accountIds) {
|
|
|
+ if (CollectionUtils.isEmpty(accountIds)) {
|
|
|
+ return Lists.newArrayList();
|
|
|
+ }
|
|
|
+
|
|
|
PageQuerySaasAccountDTO pageQuerySaasAccountDTO = new PageQuerySaasAccountDTO();
|
|
|
pageQuerySaasAccountDTO.setAccountIds(accountIds);
|
|
|
pageQuerySaasAccountDTO.setSize(accountIds.size());
|