Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
attendance-performance-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
attendance-performance-platform
Commits
bdeeee4f
Commit
bdeeee4f
authored
Jul 16, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加用户类型修改
parent
ac05c629
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
317 deletions
+17
-317
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/TestController.java
...r/src/main/java/com/mortals/xhx/busiz/TestController.java
+15
-2
attendance-performance-manager/src/main/java/com/mortals/xhx/module/hik/face/model/req/img/ImgReq.java
...com/mortals/xhx/module/hik/face/model/req/img/ImgReq.java
+1
-1
attendance-performance-manager/src/main/java/com/mortals/xhx/module/hik/face/service/IHikPlanService.java
.../mortals/xhx/module/hik/face/service/IHikPlanService.java
+0
-86
attendance-performance-manager/src/main/java/com/mortals/xhx/module/hik/face/service/impl/HikFaceServiceImpl.java
.../xhx/module/hik/face/service/impl/HikFaceServiceImpl.java
+1
-1
attendance-performance-manager/src/main/java/com/mortals/xhx/module/hik/face/service/impl/HikPlanServiceImpl.java
.../xhx/module/hik/face/service/impl/HikPlanServiceImpl.java
+0
-227
No files found.
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/TestController.java
View file @
bdeeee4f
...
@@ -138,7 +138,20 @@ public class TestController {
...
@@ -138,7 +138,20 @@ public class TestController {
if
(!
ObjectUtils
.
isEmpty
(
staffEntity
.
getPicUri
()))
{
if
(!
ObjectUtils
.
isEmpty
(
staffEntity
.
getPicUri
()))
{
ImgReq
imgReq
=
new
ImgReq
();
ImgReq
imgReq
=
new
ImgReq
();
imgReq
.
setUrl
(
staffEntity
.
getPicUri
());
imgReq
.
setUrl
(
staffEntity
.
getPicUri
());
Rest
<
String
>
rest
=
faceService
.
downloadPicture
(
imgReq
);
imgReq
.
setServerIndexCode
(
staffEntity
.
getServerIndexCode
());
//Rest<String> rest = faceService.downloadPicture(imgReq);
try
{
InputStream
in
=
faceService
.
callPostImgs
(
imgReq
);
if
(!
ObjectUtils
.
isEmpty
(
in
))
{
MultipartFile
file
=
ServletUtils
.
getMultipartFile
(
in
,
"snap.jpg"
);
String
filePath
=
uploadService
.
saveFileUpload
(
file
,
"file/fileupload/snap/"
+
DateUtil
.
today
(),
null
);
staffEntity
.
setPhotoPath
(
filePath
);
updateList
.
add
(
staffEntity
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"下载出错"
);
}
/*
if (YesNoEnum.YES.getValue() == rest.getCode()) {
if (YesNoEnum.YES.getValue() == rest.getCode()) {
byte[] bytes = Base64.decode(rest.getData());
byte[] bytes = Base64.decode(rest.getData());
if (!org.springframework.util.ObjectUtils.isEmpty(bytes)) {
if (!org.springframework.util.ObjectUtils.isEmpty(bytes)) {
...
@@ -151,7 +164,7 @@ public class TestController {
...
@@ -151,7 +164,7 @@ public class TestController {
}
}
} else {
} else {
log.info("download:{}", JSON.toJSONString(rest));
log.info("download:{}", JSON.toJSONString(rest));
}
}
*/
}
}
}
}
if
(!
ObjectUtils
.
isEmpty
(
updateList
))
{
if
(!
ObjectUtils
.
isEmpty
(
updateList
))
{
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/hik/face/model/req/img/ImgReq.java
View file @
bdeeee4f
...
@@ -5,7 +5,7 @@ import lombok.Data;
...
@@ -5,7 +5,7 @@ import lombok.Data;
@Data
@Data
public
class
ImgReq
{
public
class
ImgReq
{
private
String
s
v
rIndexCode
;
private
String
s
erve
rIndexCode
;
private
String
picUri
;
private
String
picUri
;
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/hik/face/service/IHikPlanService.java
deleted
100644 → 0
View file @
ac05c629
package
com.mortals.xhx.module.hik.face.service
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.xhx.module.hik.face.model.req.plan.PlanRecognListReq
;
import
com.mortals.xhx.module.hik.face.model.req.plan.PlanRecognReq
;
import
com.mortals.xhx.module.hik.face.model.rsp.plan.PlanRecognInfo
;
import
java.util.List
;
/**
* 海康门禁接口对接类
*
* @author:
* @date: 2023/4/12 17:47
*/
public
interface
IHikPlanService
{
/**
* 查询重点识别计划
*
* @param planRecognListReq
* @return
*/
Rest
<
List
<
PlanRecognInfo
>>
findPlanRecognBlackList
(
PlanRecognListReq
planRecognListReq
);
/**
* 添加人员监视计划
*
* @param planRecognReq
* @return
*/
Rest
<
String
>
planRecognBlackAdd
(
PlanRecognReq
planRecognReq
);
/**
* 人员监视计划删除
*
* @param planRecognReq
* @return
*/
Rest
<
Boolean
>
planRecognBlackDel
(
PlanRecognReq
planRecognReq
);
/**
* 查询陌生人识别计划
*
* @param planRecognListReq
* @return
*/
Rest
<
List
<
PlanRecognInfo
>>
findPlanRecognWhiteList
(
PlanRecognListReq
planRecognListReq
);
/**
* 添加陌生人监视计划
*
* @param planRecognReq
* @return
*/
Rest
<
String
>
planRecognWhiteAdd
(
PlanRecognReq
planRecognReq
);
/**
* 更新陌生人监视计划
*
* @param planRecognReq
* @return
*/
Rest
<
Boolean
>
planRecognWhiteUpdate
(
PlanRecognReq
planRecognReq
);
/**
* 陌生人人员监视计划删除
*
* @param planRecognReq
* @return
*/
Rest
<
Boolean
>
planRecognWhiteDel
(
PlanRecognReq
planRecognReq
);
/**
* 陌生人监视计划重新下发
*
* @param planRecognReq
* @return
*/
Rest
<
Boolean
>
planRecognWhiteReStart
(
PlanRecognReq
planRecognReq
);
}
attendance-performance-manager/src/main/java/com/mortals/xhx/module/hik/face/service/impl/HikFaceServiceImpl.java
View file @
bdeeee4f
...
@@ -269,7 +269,7 @@ public class HikFaceServiceImpl extends AbstractHikService implements IHikFaceSe
...
@@ -269,7 +269,7 @@ public class HikFaceServiceImpl extends AbstractHikService implements IHikFaceSe
@Override
@Override
public
InputStream
callPostImgs
(
ImgReq
imgReq
)
throws
Exception
{
public
InputStream
callPostImgs
(
ImgReq
imgReq
)
throws
Exception
{
ArtemisConfig
config
=
getArtemisConfig
();
ArtemisConfig
config
=
getArtemisConfig
();
String
getSecurityApi
=
ARTEMIS_PATH
+
"/api/
visitor/v1/record/pictures
"
;
String
getSecurityApi
=
ARTEMIS_PATH
+
"/api/
resource/v1/person/
"
;
path
.
put
(
protocol
,
getSecurityApi
);
path
.
put
(
protocol
,
getSecurityApi
);
//ArtemisHttpUtil.doPostStringImgArtemis(config, path, JSON.toJSONString(recognReq), null, null, "application/json");
//ArtemisHttpUtil.doPostStringImgArtemis(config, path, JSON.toJSONString(recognReq), null, null, "application/json");
Map
<
String
,
String
>
query
=
new
HashMap
<
String
,
String
>(
2
)
{
//get请求的head参数
Map
<
String
,
String
>
query
=
new
HashMap
<
String
,
String
>(
2
)
{
//get请求的head参数
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/hik/face/service/impl/HikPlanServiceImpl.java
deleted
100644 → 0
View file @
ac05c629
package
com.mortals.xhx.module.hik.face.service.impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.TypeReference
;
import
com.hikvision.artemis.sdk.ArtemisHttpUtil
;
import
com.hikvision.artemis.sdk.config.ArtemisConfig
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.xhx.module.hik.AbstractHikService
;
import
com.mortals.xhx.module.hik.HikApiRest
;
import
com.mortals.xhx.module.hik.face.model.req.plan.PlanRecognListReq
;
import
com.mortals.xhx.module.hik.face.model.req.plan.PlanRecognReq
;
import
com.mortals.xhx.module.hik.face.model.rsp.plan.PlanRecognInfo
;
import
com.mortals.xhx.module.hik.face.service.IHikPlanService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* 海康人员接口类
*
* @author: zxfei
* @date: 2023/4/12 17:51
*/
@Service
(
"hikPlanService"
)
@Slf4j
public
class
HikPlanServiceImpl
extends
AbstractHikService
implements
IHikPlanService
{
@Override
public
Rest
<
List
<
PlanRecognInfo
>>
findPlanRecognBlackList
(
PlanRecognListReq
planRecognBlackListReq
)
{
ArtemisConfig
config
=
getArtemisConfig
();
String
getCamsApi
=
ARTEMIS_PATH
+
"/api/frs/v1/plan/recognition/black"
;
path
.
put
(
protocol
,
getCamsApi
);
try
{
String
respJson
=
ArtemisHttpUtil
.
doPostStringArtemis
(
config
,
path
,
JSON
.
toJSONString
(
planRecognBlackListReq
),
null
,
null
,
"application/json"
);
HikApiRest
<
List
<
PlanRecognInfo
>>
rest
=
JSON
.
parseObject
(
respJson
,
new
TypeReference
<
HikApiRest
<
List
<
PlanRecognInfo
>>>()
{
});
if
(
"0"
.
equals
(
rest
.
getCode
()))
{
return
Rest
.
ok
(
rest
.
getData
());
}
else
{
log
.
info
(
"plan recognize balck list error resp=>{}"
,
respJson
);
return
Rest
.
fail
(
rest
.
getMsg
());
}
}
catch
(
Exception
e
)
{
log
.
error
(
"plan recognize balck list error异常"
,
e
);
return
Rest
.
fail
(
e
.
getMessage
());
}
}
/**
* a)该接口可以新增一条重点人员识别计划,以实现将若干抓拍点抓拍到的人脸,
* 通过若干识别资源同若干分组内的人脸比较,并将命中结果以事件形式上报。
* b)配置一条识别计划需要人脸分组集合(通过”按条件查询人脸分组”接口获取)
* ,抓拍点集合(通过LDAP服务获取监控点,并通过型号确定抓拍点),
* 识别资源集合(通过”按条件查询识别资源”接口获取)。
* c)一条重点人员识别计划只能配置一种识别资源类别:深眸或脸谱或超脑。
* d)一条重点人员识别计划,可以配置多个超脑作为识别资源或一个脸谱作为识别资源。
* e)一条重点人员识别计划如果配置深眸作为识别资源,则recognitionResourceIndexCodes可以传空
* 。因为深眸的抓拍点就是识别资源本身,人脸监控应用服务会根据抓拍点自动匹配正确的识别资源。
* f)人脸监控应用服务会校验抓拍点的有效性。校验规则如下:超脑作为识别资源时,
* 抓拍点必须是超脑的通道;脸谱作为识别资源时,脸谱作为识别资源时,抓拍点一般为深眸或其他人脸抓拍机通道;
* 深眸作为识别资源时,抓拍点必须是深眸的通道;一个通道是否是深眸/超脑/抓拍机的通道,取决于通道所属设备的型号,
* 详见详见附录I 人脸监控应用服务支持设备型号列表。
* g)重点人员识别计划配置有以下限制,这些限制会在添加时作为特殊错误返回:超脑的一个通道只能配置一次重点人员识别计划;
* 同一个抓拍点不能同时配置在多个脸谱上;抓拍点或识别资源没有同步到IAC前,无法配置识别计划。
* h)识别计划的配置为异步过程,调用接口成功后,人脸监控应用服务会在后台自动下发人脸分组并执行布控操作,
* 可以通过接口”单个查询重点人员识别计划详情”查询该识别计划的下发结果。 i) 识别计划支持配置时间计划模板,
* 当时间计划参数不传时,默认全天候。当传入此参数时,时间计划规则如下:按周计划进行配置,每一天的时间段上限为8,每一个时间段的开始时间必须小于结束时间。
* j)同一个深眸支持配置多个识别计划。
* k)若设备上人脸分组达到上限,则有可能导致下发失败。
*
* @param planRecognBlackReq
* @return
*/
@Override
public
Rest
<
String
>
planRecognBlackAdd
(
PlanRecognReq
planRecognBlackReq
)
{
ArtemisConfig
config
=
getArtemisConfig
();
String
getCamsApi
=
ARTEMIS_PATH
+
"/api/frs/v1/plan/recognition/black/addition"
;
path
.
put
(
protocol
,
getCamsApi
);
try
{
log
.
info
(
"plan recognize balck req=>{}"
,
JSON
.
toJSONString
(
planRecognBlackReq
));
String
respJson
=
ArtemisHttpUtil
.
doPostStringArtemis
(
config
,
path
,
JSON
.
toJSONString
(
planRecognBlackReq
),
null
,
null
,
"application/json"
);
log
.
info
(
"plan recognize balck resp=>{}"
,
respJson
);
HikApiRest
<
String
>
rest
=
JSON
.
parseObject
(
respJson
,
new
TypeReference
<
HikApiRest
<
String
>>()
{
});
if
(
"0"
.
equals
(
rest
.
getCode
()))
{
return
Rest
.
ok
(
rest
.
getData
());
}
else
{
log
.
info
(
"plan recognize balck error resp=>{}"
,
respJson
);
return
Rest
.
fail
(
rest
.
getMsg
());
}
}
catch
(
Exception
e
)
{
log
.
error
(
"plan recognize balck add error异常"
,
e
);
return
Rest
.
fail
(
e
.
getMessage
());
}
}
@Override
public
Rest
<
Boolean
>
planRecognBlackDel
(
PlanRecognReq
planRecognBlackReq
)
{
ArtemisConfig
config
=
getArtemisConfig
();
String
getCamsApi
=
ARTEMIS_PATH
+
"/api/frs/v1/plan/recognition/black/deletion"
;
path
.
put
(
protocol
,
getCamsApi
);
try
{
String
respJson
=
ArtemisHttpUtil
.
doPostStringArtemis
(
config
,
path
,
JSON
.
toJSONString
(
planRecognBlackReq
),
null
,
null
,
"application/json"
);
HikApiRest
<
Boolean
>
rest
=
JSON
.
parseObject
(
respJson
,
new
TypeReference
<
HikApiRest
<
Boolean
>>()
{
});
if
(
"0"
.
equals
(
rest
.
getCode
()))
{
return
Rest
.
ok
(
rest
.
getData
());
}
else
{
log
.
info
(
"plan recognize balck error del resp=>{}"
,
respJson
);
return
Rest
.
fail
(
rest
.
getMsg
());
}
}
catch
(
Exception
e
)
{
log
.
error
(
"plan recognize balck del error异常"
,
e
);
return
Rest
.
fail
(
e
.
getMessage
());
}
}
@Override
public
Rest
<
List
<
PlanRecognInfo
>>
findPlanRecognWhiteList
(
PlanRecognListReq
planRecognWhiteListReq
)
{
ArtemisConfig
config
=
getArtemisConfig
();
String
getCamsApi
=
ARTEMIS_PATH
+
"/api/frs/v1/plan/recognition/white"
;
path
.
put
(
protocol
,
getCamsApi
);
try
{
String
respJson
=
ArtemisHttpUtil
.
doPostStringArtemis
(
config
,
path
,
JSON
.
toJSONString
(
planRecognWhiteListReq
),
null
,
null
,
"application/json"
);
HikApiRest
<
List
<
PlanRecognInfo
>>
rest
=
JSON
.
parseObject
(
respJson
,
new
TypeReference
<
HikApiRest
<
List
<
PlanRecognInfo
>>>()
{
});
if
(
"0"
.
equals
(
rest
.
getCode
()))
{
return
Rest
.
ok
(
rest
.
getData
());
}
else
{
log
.
info
(
"plan recognize white list error resp=>{}"
,
respJson
);
return
Rest
.
fail
(
rest
.
getMsg
());
}
}
catch
(
Exception
e
)
{
log
.
error
(
"plan recognize white list error异常"
,
e
);
return
Rest
.
fail
(
e
.
getMessage
());
}
}
@Override
public
Rest
<
String
>
planRecognWhiteAdd
(
PlanRecognReq
planRecognWhiteReq
)
{
ArtemisConfig
config
=
getArtemisConfig
();
String
getCamsApi
=
ARTEMIS_PATH
+
"/api/frs/v1/plan/recognition/white/addition"
;
path
.
put
(
protocol
,
getCamsApi
);
try
{
log
.
info
(
"plan recognize white req=>{}"
,
JSON
.
toJSONString
(
planRecognWhiteReq
));
String
respJson
=
ArtemisHttpUtil
.
doPostStringArtemis
(
config
,
path
,
JSON
.
toJSONString
(
planRecognWhiteReq
),
null
,
null
,
"application/json"
);
log
.
info
(
"plan recognize white resp=>{}"
,
respJson
);
HikApiRest
<
String
>
rest
=
JSON
.
parseObject
(
respJson
,
new
TypeReference
<
HikApiRest
<
String
>>()
{
});
if
(
"0"
.
equals
(
rest
.
getCode
()))
{
return
Rest
.
ok
(
rest
.
getMsg
(),
rest
.
getData
());
}
else
{
log
.
info
(
"plan recognize white add error resp=>{}"
,
respJson
);
return
Rest
.
fail
(
rest
.
getMsg
());
}
}
catch
(
Exception
e
)
{
log
.
error
(
"plan recognize white add error异常"
,
e
);
return
Rest
.
fail
(
e
.
getMessage
());
}
}
@Override
public
Rest
<
Boolean
>
planRecognWhiteUpdate
(
PlanRecognReq
planRecognWhiteReq
)
{
ArtemisConfig
config
=
getArtemisConfig
();
String
getCamsApi
=
ARTEMIS_PATH
+
"/api/frs/v1/plan/recognition/white/update"
;
path
.
put
(
protocol
,
getCamsApi
);
try
{
log
.
info
(
"plan recognize white req=>{}"
,
JSON
.
toJSONString
(
planRecognWhiteReq
));
String
respJson
=
ArtemisHttpUtil
.
doPostStringArtemis
(
config
,
path
,
JSON
.
toJSONString
(
planRecognWhiteReq
),
null
,
null
,
"application/json"
);
log
.
info
(
"plan recognize white resp=>{}"
,
respJson
);
HikApiRest
<
Boolean
>
rest
=
JSON
.
parseObject
(
respJson
,
new
TypeReference
<
HikApiRest
<
Boolean
>>()
{
});
if
(
"0"
.
equals
(
rest
.
getCode
()))
{
return
Rest
.
ok
(
rest
.
getData
());
}
else
{
log
.
info
(
"plan recognize white add error resp=>{}"
,
respJson
);
return
Rest
.
fail
(
rest
.
getMsg
());
}
}
catch
(
Exception
e
)
{
log
.
error
(
"plan recognize white add error异常"
,
e
);
return
Rest
.
fail
(
e
.
getMessage
());
}
}
@Override
public
Rest
<
Boolean
>
planRecognWhiteDel
(
PlanRecognReq
planRecognWhiteReq
)
{
ArtemisConfig
config
=
getArtemisConfig
();
String
getCamsApi
=
ARTEMIS_PATH
+
"/api/frs/v1/plan/recognition/white/deletion"
;
path
.
put
(
protocol
,
getCamsApi
);
try
{
String
respJson
=
ArtemisHttpUtil
.
doPostStringArtemis
(
config
,
path
,
JSON
.
toJSONString
(
planRecognWhiteReq
),
null
,
null
,
"application/json"
);
HikApiRest
<
Boolean
>
rest
=
JSON
.
parseObject
(
respJson
,
new
TypeReference
<
HikApiRest
<
Boolean
>>()
{
});
if
(
"0"
.
equals
(
rest
.
getCode
()))
{
return
Rest
.
ok
(
rest
.
getData
());
}
else
{
log
.
info
(
"plan recognize white error del resp=>{}"
,
respJson
);
return
Rest
.
fail
(
rest
.
getMsg
());
}
}
catch
(
Exception
e
)
{
log
.
error
(
"plan recognize white del error异常"
,
e
);
return
Rest
.
fail
(
e
.
getMessage
());
}
}
@Override
public
Rest
<
Boolean
>
planRecognWhiteReStart
(
PlanRecognReq
planRecognReq
)
{
ArtemisConfig
config
=
getArtemisConfig
();
String
getCamsApi
=
ARTEMIS_PATH
+
"/api/frs/v1/plan/recognition/white/restart"
;
path
.
put
(
protocol
,
getCamsApi
);
try
{
String
respJson
=
ArtemisHttpUtil
.
doPostStringArtemis
(
config
,
path
,
JSON
.
toJSONString
(
planRecognReq
),
null
,
null
,
"application/json"
);
HikApiRest
<
Boolean
>
rest
=
JSON
.
parseObject
(
respJson
,
new
TypeReference
<
HikApiRest
<
Boolean
>>()
{
});
if
(
"0"
.
equals
(
rest
.
getCode
()))
{
return
Rest
.
ok
(
rest
.
getData
());
}
else
{
log
.
info
(
"plan recognize white error restart resp=>{}"
,
respJson
);
return
Rest
.
fail
(
rest
.
getMsg
());
}
}
catch
(
Exception
e
)
{
log
.
error
(
"plan recognize white erstart error异常"
,
e
);
return
Rest
.
fail
(
e
.
getMessage
());
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment