Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
device-new-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
device-new-platform
Commits
32d7b20d
Commit
32d7b20d
authored
Nov 16, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改用户同步接口
parent
1f9ac10e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
device-manager/src/main/java/com/mortals/xhx/common/utils/MemoryPagination.java
...n/java/com/mortals/xhx/common/utils/MemoryPagination.java
+8
-5
No files found.
device-manager/src/main/java/com/mortals/xhx/common/utils/MemoryPagination.java
View file @
32d7b20d
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
));
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment