Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
谢明辉
/
VVAS-Match
Go to a project
Project
Repository
Issues
0
Merge Requests
1
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 6f6a25b2
authored
Jun 28, 2025
by
wenshuaiying
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
自动创建person时,使用匹配到的personid
1 parent
34af005f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
src/main/java/com/viontech/match/controller/MainController.java
src/main/java/com/viontech/match/service/PersonService.java
src/main/java/com/viontech/match/controller/MainController.java
View file @
6f6a25b
...
...
@@ -46,6 +46,12 @@ public class MainController {
return
poolService
.
queryPool
(
requestVo
);
case
MatchPerson:
ResponseVo
matchPerson
=
personService
.
matchPerson
(
requestVo
);
if
(
matchPerson
.
getMatchBodies
()
!=
null
&&
matchPerson
.
getMatchBodies
().
size
()
>
0
)
{
requestVo
.
getPerson
().
setPersonId
(
matchPerson
.
getMatchBodies
().
get
(
0
).
getPersonId
());
}
else
if
(
matchPerson
.
getMatchPersons
()
!=
null
&&
matchPerson
.
getMatchPersons
().
size
()
>
0
)
{
requestVo
.
getPerson
().
setPersonId
(
matchPerson
.
getMatchPersons
().
get
(
0
).
getPersonId
());
}
poolService
.
asyncModifyPool
(
requestVo
.
getPersonPoolId
(),
requestVo
.
getPerson
());
return
matchPerson
;
case
UpdatePerson:
...
...
src/main/java/com/viontech/match/service/PersonService.java
View file @
6f6a25b
...
...
@@ -56,6 +56,7 @@ import java.util.stream.Stream;
@Slf4j
public
class
PersonService
{
private
static
final
String
[]
FETCH_SOURCE
=
new
String
[]{
"personId"
,
"age"
,
"gender"
,
"fid"
,
"counttime"
,
"channelSerialNum"
,
"body_type"
,
"unid"
};
public
static
final
SourceConfig
SOURCE_CONFIG
=
new
SourceConfig
.
Builder
().
filter
(
s
->
s
.
includes
(
Arrays
.
asList
(
FETCH_SOURCE
))).
build
();
@Resource
private
ElasticsearchClient
client
;
@Resource
...
...
@@ -577,14 +578,13 @@ public class PersonService {
// BoolQuery.Builder builder = getSearchSourceBuilder(feature, person, type);
Query
scriptScoreQuery
=
getScriptScoreQuery
(
feature
,
person
,
type
);
SourceConfig
sourceConfig
=
new
SourceConfig
.
Builder
().
filter
(
s
->
s
.
includes
(
Arrays
.
asList
(
FETCH_SOURCE
))).
build
();
double
minScore
=
0.0
;
if
(
type
==
0
)
{
minScore
=
person
.
getFaceMinScore
().
doubleValue
()/
100
;
}
else
if
(
type
==
1
)
{
minScore
=
person
.
getBodyMinScore
().
doubleValue
()/
100
;
}
return
new
SearchRequest
.
Builder
().
index
(
poolId
).
query
(
scriptScoreQuery
).
source
(
sourceConfig
)
return
new
SearchRequest
.
Builder
().
index
(
poolId
).
query
(
scriptScoreQuery
).
source
(
SOURCE_CONFIG
)
.
size
(
matchResultSize
)
.
minScore
(
minScore
)
.
timeout
(
"50ms"
)
...
...
@@ -640,7 +640,7 @@ public class PersonService {
}
}
}
catch
(
Exception
e
)
{
log
.
error
(
"
match0 excepto
n"
,
e
);
log
.
error
(
"
n"
,
e
);
}
return
persons
;
...
...
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