Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
谢明辉
/
vion-label
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 7d503500
authored
Jul 04, 2024
by
朱海
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[chg]发送数据增加数量过滤
1 parent
3ed5f823
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
label-tool-keliu/src/main/java/com/viontech/label/tool/keliu/controller/KeliuController.java
label-tool-keliu/src/main/java/com/viontech/label/tool/keliu/controller/KeliuController.java
View file @
7d50350
...
@@ -24,15 +24,18 @@ import java.io.BufferedReader;
...
@@ -24,15 +24,18 @@ import java.io.BufferedReader;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStream
;
import
java.io.InputStreamReader
;
import
java.io.InputStreamReader
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.LinkedList
;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.Future
;
import
java.util.concurrent.Future
;
import
java.util.concurrent.LinkedBlockingDeque
;
import
java.util.concurrent.LinkedBlockingDeque
;
import
java.util.concurrent.ThreadPoolExecutor
;
import
java.util.concurrent.ThreadPoolExecutor
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.atomic.AtomicLong
;
import
java.util.concurrent.atomic.AtomicLong
;
import
java.util.stream.Collectors
;
/**
/**
* .
* .
...
@@ -79,8 +82,15 @@ public class KeliuController {
...
@@ -79,8 +82,15 @@ public class KeliuController {
try
{
try
{
AtomicLong
count
=
new
AtomicLong
();
AtomicLong
count
=
new
AtomicLong
();
List
<
FaceRecognition
>
faceRecognitions
=
keliuRepository
.
getFaceRecognitionsByDateAndMallId
(
date
,
mallId
,
direction
,
deviceSerialNum
,
personType
,
channelSerialNum
,
startTime
,
endTime
);
List
<
FaceRecognition
>
faceRecognitions
=
keliuRepository
.
getFaceRecognitionsByDateAndMallId
(
date
,
mallId
,
direction
,
deviceSerialNum
,
personType
,
channelSerialNum
,
startTime
,
endTime
);
log
.
info
(
"上传数据量:"
+
faceRecognitions
.
size
());
Map
<
String
,
List
<
FaceRecognition
>>
faceRecognitionMap
=
faceRecognitions
.
stream
().
collect
(
Collectors
.
groupingBy
(
FaceRecognition:
:
getPersonUnid
));
for
(
FaceRecognition
faceRecognition
:
faceRecognitions
)
{
List
<
FaceRecognition
>
faceRecognitionList
=
new
ArrayList
<>();
faceRecognitionMap
.
forEach
((
k
,
v
)
->
{
if
(
v
.
size
()
>=
8
)
{
faceRecognitionList
.
addAll
(
v
);
}
});
log
.
info
(
"上传数据量:"
+
faceRecognitionList
.
size
());
for
(
FaceRecognition
faceRecognition
:
faceRecognitionList
)
{
Future
<
JsonMessageUtil
.
JsonMessage
>
submit
=
threadPoolExecutor
.
submit
(()
->
{
Future
<
JsonMessageUtil
.
JsonMessage
>
submit
=
threadPoolExecutor
.
submit
(()
->
{
try
{
try
{
byte
[]
bodyPic
=
fileService
.
getFile
(
faceRecognition
.
getBodyPath
());
byte
[]
bodyPic
=
fileService
.
getFile
(
faceRecognition
.
getBodyPath
());
...
@@ -88,7 +98,7 @@ public class KeliuController {
...
@@ -88,7 +98,7 @@ public class KeliuController {
HttpEntity
<
MultiValueMap
<
String
,
Object
>>
requestEntity
=
getRequestEntity
(
faceRecognition
,
bodyPic
,
bodyFeature
,
packId
,
taskId
);
HttpEntity
<
MultiValueMap
<
String
,
Object
>>
requestEntity
=
getRequestEntity
(
faceRecognition
,
bodyPic
,
bodyFeature
,
packId
,
taskId
);
ResponseEntity
<
JsonMessageUtil
.
JsonMessage
>
exchange
=
restTemplate
.
exchange
(
vionConfig
.
getTargetUrl
(),
HttpMethod
.
POST
,
requestEntity
,
JsonMessageUtil
.
JsonMessage
.
class
);
ResponseEntity
<
JsonMessageUtil
.
JsonMessage
>
exchange
=
restTemplate
.
exchange
(
vionConfig
.
getTargetUrl
(),
HttpMethod
.
POST
,
requestEntity
,
JsonMessageUtil
.
JsonMessage
.
class
);
JsonMessageUtil
.
JsonMessage
body
=
exchange
.
getBody
();
JsonMessageUtil
.
JsonMessage
body
=
exchange
.
getBody
();
log
.
info
(
"unid:{},msg:{},count:{}/{}"
,
faceRecognition
.
getUnid
(),
body
.
getMsg
(),
count
.
incrementAndGet
(),
faceRecognition
s
.
size
());
log
.
info
(
"unid:{},msg:{},count:{}/{}"
,
faceRecognition
.
getUnid
(),
body
.
getMsg
(),
count
.
incrementAndGet
(),
faceRecognition
List
.
size
());
return
body
;
return
body
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
info
(
""
,
e
);
log
.
info
(
""
,
e
);
...
...
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