Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
StatInfo_1
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenyuling
StatInfo_1
Commits
7c440438
Commit
7c440438
authored
Jan 26, 2024
by
chenyuling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
"数据长度不变也进行更新数据"
parent
75dcf957
Pipeline
#2292
failed with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
43 deletions
+40
-43
MainActivity.java
...rc/main/java/com/srthinker/statinfo/uis/MainActivity.java
+40
-43
No files found.
app/src/main/java/com/srthinker/statinfo/uis/MainActivity.java
View file @
7c440438
...
@@ -251,30 +251,29 @@ public class MainActivity extends BaseActivity implements NetworkIPMonitor.OnIPC
...
@@ -251,30 +251,29 @@ public class MainActivity extends BaseActivity implements NetworkIPMonitor.OnIPC
if
(
type
==
ENTER_TYPE
){
if
(
type
==
ENTER_TYPE
){
if
(
passEntities
!=
null
)
{
if
(
passEntities
!=
null
)
{
int
size
=
passEntities
.
size
();
int
size
=
passEntities
.
size
();
if
(
size
!=
lastEnterSize
){
/*//更新进出情况
/*//更新进出情况
//enterBeans = passEntities; 全局变量直接赋值会出现问题
//enterBeans = passEntities; 全局变量直接赋值会出现问题
enterBeans.clear();
enterBeans.clear();
enterBeans.addAll(passEntities);
enterBeans.addAll(passEntities);
enterAdapter.setDataList(passEntities);
enterAdapter.setDataList(passEntities);
//更新人员情况(是否要根据id去重)
//更新人员情况(是否要根据id去重)
if (NEED_NO_REPET) {
if (NEED_NO_REPET) {
List<PersonEntity> enterListNo = StatSize.filterList(passEntities);
List<PersonEntity> enterListNo = StatSize.filterList(passEntities);
lastEnterSize = enterListNo.size();
lastEnterSize = enterListNo.size();
}else{
}else{
lastEnterSize = size;
}
lastPresentSize = lastEnterSize-lastLeaveSize;
mBinding.nvEnter.setNumber(lastEnterSize);
mBinding.nvLeave.setNumber(lastLeaveSize);
mBinding.nvPresent.setNumber(lastPresentSize);*/
enterBeans
.
clear
();
enterBeans
.
addAll
(
passEntities
);
lastEnterSize = size;
lastEnterSize = size;
//更新分组情况(是否要根据id去重)
groupEnterHashMap
=
getGroupSizeHashMap
(
passEntities
);
updatePresentSize
(
groupEnterHashMap
,
groupLeaveHashMap
);
}
}
lastPresentSize = lastEnterSize-lastLeaveSize;
mBinding.nvEnter.setNumber(lastEnterSize);
mBinding.nvLeave.setNumber(lastLeaveSize);
mBinding.nvPresent.setNumber(lastPresentSize);*/
enterBeans
.
clear
();
enterBeans
.
addAll
(
passEntities
);
lastEnterSize
=
size
;
//更新分组情况(是否要根据id去重)
groupEnterHashMap
=
getGroupSizeHashMap
(
passEntities
);
updatePresentSize
(
groupEnterHashMap
,
groupLeaveHashMap
);
}
}
}
else
if
(
type
==
LEAVE_TYPE
){
}
else
if
(
type
==
LEAVE_TYPE
){
...
@@ -282,29 +281,27 @@ public class MainActivity extends BaseActivity implements NetworkIPMonitor.OnIPC
...
@@ -282,29 +281,27 @@ public class MainActivity extends BaseActivity implements NetworkIPMonitor.OnIPC
if
(
passEntities
!=
null
)
{
if
(
passEntities
!=
null
)
{
int
size
=
passEntities
.
size
();
int
size
=
passEntities
.
size
();
//进出有变化时才更新
//进出有变化时才更新
if
(
size
!=
lastLeaveSize
){
/*leaveBeans.clear();
/*leaveBeans.clear();
leaveBeans.addAll(passEntities);
leaveBeans.addAll(passEntities);
//更新进出情况
//更新进出情况
leaveAdapter.setDataList(passEntities);
leaveAdapter.setDataList(passEntities);
//更新人员情况(是否要根据id去重)
//更新人员情况(是否要根据id去重)
if (NEED_NO_REPET) {
if (NEED_NO_REPET) {
List<PersonEntity> leaveListNo = StatSize.filterList(passEntities);
List<PersonEntity> leaveListNo = StatSize.filterList(passEntities);
lastLeaveSize = leaveListNo.size();
lastLeaveSize = leaveListNo.size();
}else{
}else{
lastLeaveSize = size;
}
lastPresentSize = lastEnterSize-lastLeaveSize;
mBinding.nvEnter.setNumber(lastEnterSize);
mBinding.nvLeave.setNumber(lastLeaveSize);
mBinding.nvPresent.setNumber(lastPresentSize);*/
leaveBeans
.
clear
();
leaveBeans
.
addAll
(
passEntities
);
lastLeaveSize = size;
lastLeaveSize = size;
//更新分组情况(是否要根据id去重)
groupLeaveHashMap
=
getGroupSizeHashMap
(
passEntities
);
updatePresentSize
(
groupEnterHashMap
,
groupLeaveHashMap
);
}
}
lastPresentSize = lastEnterSize-lastLeaveSize;
mBinding.nvEnter.setNumber(lastEnterSize);
mBinding.nvLeave.setNumber(lastLeaveSize);
mBinding.nvPresent.setNumber(lastPresentSize);*/
leaveBeans
.
clear
();
leaveBeans
.
addAll
(
passEntities
);
lastLeaveSize
=
size
;
//更新分组情况(是否要根据id去重)
groupLeaveHashMap
=
getGroupSizeHashMap
(
passEntities
);
updatePresentSize
(
groupEnterHashMap
,
groupLeaveHashMap
);
}
}
}
}
...
...
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