Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-trialdrive-admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 36dc3a29
authored
Aug 25, 2022
by
levphon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
用户数据检测
1 parent
ee91b065
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
src/main/java/cn/com/glsx/admin/modules/service/VehicleService.java
src/main/java/cn/com/glsx/admin/modules/service/VehicleService.java
View file @
36dc3a2
...
...
@@ -74,7 +74,7 @@ import org.springframework.util.StopWatch;
import
java.io.FileNotFoundException
;
import
java.io.InputStream
;
import
java.util.*
;
import
java.util.concurrent.atomic.Atomic
Integer
;
import
java.util.concurrent.atomic.Atomic
Reference
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
...
...
@@ -2412,14 +2412,25 @@ public class VehicleService extends AbstractCommonService {
* @return
*/
public
boolean
dataSniff
(
DataSniffBO
sniffBO
)
{
//类型必须都检查到
Map
<
Integer
,
Integer
>
checkedMap
=
Maps
.
newHashMap
();
if
(
CollectionUtils
.
isNotEmpty
(
sniffBO
.
getTypes
()))
{
AtomicInteger
vehicleCnt
=
new
AtomicInteger
();
sniffBO
.
getTypes
().
forEach
(
type
->
{
checkedMap
.
put
(
type
,
null
);
if
(
type
==
1
)
{
//车辆
vehicleCnt
.
set
(
vehicleMapper
.
countByUserId
(
sniffBO
.
getUserId
()));
Integer
cnt
=
vehicleMapper
.
countByUserId
(
sniffBO
.
getUserId
());
checkedMap
.
put
(
type
,
cnt
);
}
});
return
vehicleCnt
.
get
()
<=
0
;
//1、有传类型,但是没有检测到数据,则按检测不通过处理
//2、检测数据最后所有结果相加必须小于0,则为用户下面没数据
if
(
checkedMap
.
containsValue
(
null
))
{
return
false
;
}
else
{
AtomicReference
<
Integer
>
totalCnt
=
new
AtomicReference
<>(
0
);
checkedMap
.
forEach
((
k
,
v
)
->
totalCnt
.
updateAndGet
(
v1
->
v1
+
v
));
return
totalCnt
.
get
()
<=
0
;
}
}
return
false
;
}
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment