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
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit f198fc81
authored
Dec 25, 2020
by
xmh
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
类型转或错误说明人员池有问题需要先删掉
1 parent
bf226020
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
3 deletions
src/main/java/com/viontech/match/config/Constant.java
src/main/java/com/viontech/match/service/PersonService.java
src/main/resources/application-option.properties
src/main/java/com/viontech/match/config/Constant.java
View file @
f198fc8
...
...
@@ -17,6 +17,9 @@ public class Constant {
/** poolId不存在时es返回的message所包含的字段 */
public
final
static
String
STR_POOL_ID_ALREADY_EXISTS
=
"already_exists"
;
/** 类型错误时返回所包含的字段 */
public
final
static
String
CLASS_CAST_EXCEPTION
=
"class_cast_exception"
;
/** 人脸匹配结果的数量 */
public
final
static
int
MATCH_RESULT_SIZE
=
5
;
}
src/main/java/com/viontech/match/service/PersonService.java
View file @
f198fc8
...
...
@@ -9,6 +9,7 @@ import com.viontech.match.config.Constant;
import
com.viontech.match.entity.vo.RequestVo
;
import
com.viontech.match.entity.vo.ResponseVo
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.tomcat.util.http.fileupload.FileUtils
;
import
org.elasticsearch.ElasticsearchStatusException
;
import
org.elasticsearch.action.bulk.BulkRequest
;
import
org.elasticsearch.action.bulk.BulkResponse
;
...
...
@@ -23,6 +24,7 @@ import org.elasticsearch.index.query.TermQueryBuilder;
import
org.elasticsearch.index.query.functionscore.ScriptScoreQueryBuilder
;
import
org.elasticsearch.index.reindex.BulkByScrollResponse
;
import
org.elasticsearch.index.reindex.DeleteByQueryRequest
;
import
org.elasticsearch.rest.RestStatus
;
import
org.elasticsearch.script.Script
;
import
org.elasticsearch.script.ScriptType
;
import
org.elasticsearch.search.SearchHit
;
...
...
@@ -90,6 +92,16 @@ public class PersonService {
log
.
info
(
"人员匹配操作完成,PoolIds:[{}},结果:[{}]"
,
poolIds
.
toString
(),
objectMapper
.
writeValueAsString
(
success
));
return
success
;
}
catch
(
ElasticsearchStatusException
e
)
{
if
(
e
.
status
()
==
RestStatus
.
BAD_REQUEST
&&
e
.
getDetailedMessage
().
contains
(
Constant
.
CLASS_CAST_EXCEPTION
))
{
for
(
String
id
:
poolIds
)
{
RequestVo
requestVo1
=
new
RequestVo
();
requestVo1
.
setRid
(
"1"
);
requestVo1
.
setPoolId
(
id
);
requestVo1
.
setFlushPool
(
1
);
poolService
.
deletePool
(
requestVo1
);
}
}
log
.
error
(
"matchPerson"
,
e
);
ResponseVo
error
=
ResponseVo
.
error
(
rid
,
e
.
getDetailedMessage
());
error
.
setMatch
(
0
);
...
...
src/main/resources/application-option.properties
View file @
f198fc8
...
...
@@ -3,6 +3,4 @@ server.port=12000
spring.jackson.time-
zone
=
GMT+8
spring.jackson.date-
format
=
yyyy-MM-dd HH:mm:ss
# es
#spring.elasticsearch.rest.uris=http://192.168.9.116:9200
#spring.elasticsearch.rest.uris=http://127.0.0.1:9200
spring.elasticsearch.rest.uris
=
http://139.217.100.35:9200,http://139.217.100.35:9201
\ No newline at end of file
spring.elasticsearch.rest.uris
=
http://127.0.0.1:9200
\ No newline at end of file
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