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 225ee1a2
authored
Jun 29, 2023
by
朱海
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[chg]同步数据增加方向过滤
1 parent
1d08e991
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
6 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 @
225ee1a
...
...
@@ -57,7 +57,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"
)
Integer
needOutSide
,
@RequestParam
(
required
=
false
,
defaultValue
=
"
-1,0,1"
)
String
direction
,
@RequestParam
(
required
=
false
,
value
=
"deviceSerialNum"
)
String
deviceSerialNum
)
{
List
<
Future
<
JsonMessageUtil
.
JsonMessage
>>
responses
=
new
LinkedList
<>();
...
...
@@ -68,7 +68,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
,
needOutSide
,
deviceSerialNum
);
List
<
FaceRecognition
>
faceRecognitions
=
keliuRepository
.
getFaceRecognitionsByDateAndMallId
(
date
,
mallId
,
direction
,
deviceSerialNum
);
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 @
225ee1a
...
...
@@ -4,6 +4,7 @@ import com.viontech.label.tool.keliu.model.FaceRecognition;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.jdbc.core.BeanPropertyRowMapper
;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
;
import
org.springframework.stereotype.Repository
;
import
javax.annotation.Resource
;
...
...
@@ -24,12 +25,22 @@ public class KeliuRepository {
@Resource
private
JdbcTemplate
jdbcTemplate
;
public
List
<
FaceRecognition
>
getFaceRecognitionsByDateAndMallId
(
Date
date
,
Long
mallId
,
Integer
needOutSide
,
String
deviceSerialNum
)
{
public
List
<
FaceRecognition
>
getFaceRecognitionsByDateAndMallId
(
Date
date
,
Long
mallId
,
String
direction
,
String
deviceSerialNum
)
{
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
(
needOutSide
==
0
)
{
sql
=
sql
+
" and direction != 0"
;
//方向过滤
if
(
StringUtils
.
isNotBlank
(
direction
))
{
String
[]
directions
=
direction
.
split
(
","
);
sql
=
sql
+
" and direction in("
;
for
(
int
i
=
0
;
i
<
directions
.
length
;
i
++)
{
sql
=
sql
+
Integer
.
valueOf
(
directions
[
i
]);
if
(
i
<
directions
.
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