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

修改用户同步接口

parent 1f9ac10e
package com.mortals.xhx.common.utils;
import com.mortals.xhx.common.pdu.site.SitePdu;
import com.mortals.xhx.module.sitestat.model.SitestatEntity;
import org.apache.commons.collections4.CollectionUtils;
......@@ -33,6 +32,10 @@ public class MemoryPagination {
if (CollectionUtils.isEmpty(records)) {
return Collections.emptyList();
}
if (pageSize == -1) {
pageSize = 9999;
}
int totalCount = records.size();
int remainder = totalCount % pageSize;
int pageCount = (remainder > 0) ? totalCount / pageSize + 1 : totalCount / pageSize;
......@@ -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();
Pattern pattern = Pattern.compile(name,Pattern.CASE_INSENSITIVE);
for(int i=0; i < list.size(); i++){
Pattern pattern = Pattern.compile(name, Pattern.CASE_INSENSITIVE);
for (int i = 0; i < list.size(); i++) {
Matcher matcher = pattern.matcher((list.get(i)).getSiteName());
if(matcher.find()){
if (matcher.find()) {
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