Commit 32d7b20d authored by 赵啸非's avatar 赵啸非

修改用户同步接口

parent 1f9ac10e
package com.mortals.xhx.common.utils; package com.mortals.xhx.common.utils;
import com.mortals.xhx.common.pdu.site.SitePdu;
import com.mortals.xhx.module.sitestat.model.SitestatEntity; import com.mortals.xhx.module.sitestat.model.SitestatEntity;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
...@@ -33,6 +32,10 @@ public class MemoryPagination { ...@@ -33,6 +32,10 @@ public class MemoryPagination {
if (CollectionUtils.isEmpty(records)) { if (CollectionUtils.isEmpty(records)) {
return Collections.emptyList(); return Collections.emptyList();
} }
if (pageSize == -1) {
pageSize = 9999;
}
int totalCount = records.size(); int totalCount = records.size();
int remainder = totalCount % pageSize; int remainder = totalCount % pageSize;
int pageCount = (remainder > 0) ? totalCount / pageSize + 1 : totalCount / pageSize; int pageCount = (remainder > 0) ? totalCount / pageSize + 1 : totalCount / pageSize;
...@@ -48,12 +51,12 @@ public class MemoryPagination { ...@@ -48,12 +51,12 @@ public class MemoryPagination {
} }
public static List<SitestatEntity> search(String name, List<SitestatEntity> list){ public static List<SitestatEntity> search(String name, List<SitestatEntity> list) {
List<SitestatEntity> results = new ArrayList(); List<SitestatEntity> results = new ArrayList();
Pattern pattern = Pattern.compile(name,Pattern.CASE_INSENSITIVE); Pattern pattern = Pattern.compile(name, Pattern.CASE_INSENSITIVE);
for(int i=0; i < list.size(); i++){ for (int i = 0; i < list.size(); i++) {
Matcher matcher = pattern.matcher((list.get(i)).getSiteName()); Matcher matcher = pattern.matcher((list.get(i)).getSiteName());
if(matcher.find()){ if (matcher.find()) {
results.add(list.get(i)); results.add(list.get(i));
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment