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 62095cd9
authored
Jun 29, 2023
by
朱海
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[chg]同步数据增加人员类型过滤
1 parent
225ee1a2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 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/repository/KeliuRepository.java
label-tool-keliu/src/main/java/com/viontech/label/tool/keliu/controller/KeliuController.java
View file @
62095cd
...
...
@@ -58,6 +58,7 @@ public class KeliuController {
@GetMapping
(
"/sendData"
)
public
Object
sendData
(
@RequestParam
Date
date
,
@RequestParam
Long
mallId
,
@RequestParam
Long
packId
,
@RequestParam
(
required
=
false
)
Long
taskId
,
@RequestParam
(
required
=
false
,
defaultValue
=
"-1,0,1"
)
String
direction
,
@RequestParam
(
required
=
false
,
defaultValue
=
"0,1"
)
String
personType
,
@RequestParam
(
required
=
false
,
value
=
"deviceSerialNum"
)
String
deviceSerialNum
)
{
List
<
Future
<
JsonMessageUtil
.
JsonMessage
>>
responses
=
new
LinkedList
<>();
...
...
@@ -68,7 +69,7 @@ public class KeliuController {
ThreadPoolExecutor
threadPoolExecutor
=
new
ThreadPoolExecutor
(
20
,
20
,
1
,
TimeUnit
.
MINUTES
,
new
LinkedBlockingDeque
<>(
10000
),
new
ThreadPoolExecutor
.
CallerRunsPolicy
());
try
{
AtomicLong
count
=
new
AtomicLong
();
List
<
FaceRecognition
>
faceRecognitions
=
keliuRepository
.
getFaceRecognitionsByDateAndMallId
(
date
,
mallId
,
direction
,
deviceSerialNum
);
List
<
FaceRecognition
>
faceRecognitions
=
keliuRepository
.
getFaceRecognitionsByDateAndMallId
(
date
,
mallId
,
direction
,
deviceSerialNum
,
personType
);
log
.
info
(
"上传数据量:"
+
faceRecognitions
.
size
());
for
(
FaceRecognition
faceRecognition
:
faceRecognitions
)
{
Future
<
JsonMessageUtil
.
JsonMessage
>
submit
=
threadPoolExecutor
.
submit
(()
->
{
...
...
label-tool-keliu/src/main/java/com/viontech/label/tool/keliu/repository/KeliuRepository.java
View file @
62095cd
...
...
@@ -26,7 +26,7 @@ public class KeliuRepository {
private
JdbcTemplate
jdbcTemplate
;
public
List
<
FaceRecognition
>
getFaceRecognitionsByDateAndMallId
(
Date
date
,
Long
mallId
,
String
direction
,
String
deviceSerialNum
)
{
public
List
<
FaceRecognition
>
getFaceRecognitionsByDateAndMallId
(
Date
date
,
Long
mallId
,
String
direction
,
String
deviceSerialNum
,
String
personType
)
{
String
sql
=
"select unid,person_unid,channel_serialnum,body_pic,countdate,counttime,direction,gate_id from d_face_recognition where countdate=? and mall_id=?"
;
//方向过滤
if
(
StringUtils
.
isNotBlank
(
direction
))
{
...
...
@@ -41,6 +41,19 @@ public class KeliuRepository {
sql
=
sql
+
")"
;
}
//顾客店员过滤
if
(
StringUtils
.
isNotBlank
(
personType
))
{
String
[]
personTypes
=
personType
.
split
(
","
);
sql
=
sql
+
" and person_type in("
;
for
(
int
i
=
0
;
i
<
personTypes
.
length
;
i
++)
{
sql
=
sql
+
Integer
.
valueOf
(
personTypes
[
i
]);
if
(
i
<
personTypes
.
length
-
1
)
{
sql
=
sql
+
","
;
}
}
sql
=
sql
+
")"
;
}
if
(
StringUtils
.
isNotBlank
(
deviceSerialNum
))
{
String
[]
devices
=
deviceSerialNum
.
split
(
","
);
StringBuilder
sb
=
new
StringBuilder
();
...
...
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