Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
refined-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
赵啸非
refined-platform
Commits
63430df8
Commit
63430df8
authored
Apr 17, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加识别计划任务等逻辑
parent
efa500ff
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
413 additions
and
29 deletions
+413
-29
doc/精细化管理系统.docx
doc/精细化管理系统.docx
+0
-0
refined-manager/src/main/java/com/mortals/xhx/common/key/Constant.java
...er/src/main/java/com/mortals/xhx/common/key/Constant.java
+9
-0
refined-manager/src/main/java/com/mortals/xhx/daemon/applicationservice/SubEventStartedService.java
...xhx/daemon/applicationservice/SubEventStartedService.java
+3
-3
refined-manager/src/main/java/com/mortals/xhx/daemon/task/CreateBlackPlanToHikByDayTaskImpl.java
...ls/xhx/daemon/task/CreateBlackPlanToHikByDayTaskImpl.java
+246
-0
refined-manager/src/main/java/com/mortals/xhx/daemon/task/SyncSubmitAppointTaskImpl.java
...om/mortals/xhx/daemon/task/SyncSubmitAppointTaskImpl.java
+0
-2
refined-manager/src/main/java/com/mortals/xhx/daemon/task/SyncUserToHikTaskImpl.java
...va/com/mortals/xhx/daemon/task/SyncUserToHikTaskImpl.java
+1
-1
refined-manager/src/main/java/com/mortals/xhx/module/face/service/FaceGroupService.java
...com/mortals/xhx/module/face/service/FaceGroupService.java
+6
-0
refined-manager/src/main/java/com/mortals/xhx/module/face/service/impl/FaceGroupServiceImpl.java
...ls/xhx/module/face/service/impl/FaceGroupServiceImpl.java
+37
-7
refined-manager/src/main/java/com/mortals/xhx/module/hik/face/model/req/plan/PlanRecognListReq.java
...xhx/module/hik/face/model/req/plan/PlanRecognListReq.java
+1
-1
refined-manager/src/main/java/com/mortals/xhx/module/hik/face/model/req/plan/PlanRecognReq.java
...als/xhx/module/hik/face/model/req/plan/PlanRecognReq.java
+1
-1
refined-manager/src/main/java/com/mortals/xhx/module/hik/face/service/IHikPlanService.java
.../mortals/xhx/module/hik/face/service/IHikPlanService.java
+38
-9
refined-manager/src/main/java/com/mortals/xhx/module/hik/face/service/impl/HikPlanServiceImpl.java
.../xhx/module/hik/face/service/impl/HikPlanServiceImpl.java
+71
-5
No files found.
doc/精细化管理系统.docx
View file @
63430df8
No preview for this file type
refined-manager/src/main/java/com/mortals/xhx/common/key/Constant.java
View file @
63430df8
...
...
@@ -91,6 +91,15 @@ public final class Constant {
*/
public
static
final
String
EXCHANGE_SPLIT
=
"."
;
/**
* 预约监控计划前缀
*/
public
final
static
String
APPOINTMENT_PLAN_PREFIX
=
"appointment_plan_"
;
/**
* 预约人员分组
*/
public
final
static
String
APPOINTMENT_GROUP_PREFIX
=
"appointment_group_"
;
}
refined-manager/src/main/java/com/mortals/xhx/daemon/applicationservice/SubEventStartedService.java
View file @
63430df8
...
...
@@ -23,7 +23,7 @@ import com.mortals.xhx.module.hik.event.model.req.sub.EventSubReq;
import
com.mortals.xhx.module.hik.event.model.rsp.EventInfo
;
import
com.mortals.xhx.module.hik.event.service.IHikEventService
;
import
com.mortals.xhx.module.hik.face.model.req.group.FaceGroupReq
;
import
com.mortals.xhx.module.hik.face.model.req.plan.PlanRecogn
Black
Req
;
import
com.mortals.xhx.module.hik.face.model.req.plan.PlanRecognReq
;
import
com.mortals.xhx.module.hik.face.model.rsp.group.FaceGroupDataInfo
;
import
com.mortals.xhx.module.hik.face.service.IHikFaceService
;
import
com.mortals.xhx.module.hik.face.service.IHikPlanService
;
...
...
@@ -100,14 +100,14 @@ public class SubEventStartedService implements IApplicationStartedService {
}
}
//
创建重点人员识别计划
//
删除创建陌生人员识别计划,todo
String
planBlackName
=
GlobalSysInfo
.
getParamValue
(
ParamKey
.
PARAM_FACE_PLAN_BLACK
,
"取号监控"
);
int
threshold
=
GlobalSysInfo
.
getParamIntValue
(
ParamKey
.
PARAM_FACE_THRESHOLD
,
80
);
FacePlanEntity
facePlanEntity
=
facePlanService
.
selectOne
(
new
FacePlanQuery
().
name
(
planBlackName
));
if
(
ObjectUtils
.
isEmpty
(
facePlanEntity
))
{
//初始化新增取号监控识别计划
PlanRecogn
BlackReq
planRecognBlackReq
=
new
PlanRecognBlack
Req
();
PlanRecogn
Req
planRecognBlackReq
=
new
PlanRecogn
Req
();
planRecognBlackReq
.
setName
(
planBlackName
);
planRecognBlackReq
.
setDescription
(
planBlackName
);
planRecognBlackReq
.
setThreshold
(
threshold
);
...
...
refined-manager/src/main/java/com/mortals/xhx/daemon/task/CreateBlackPlanToHikByDayTaskImpl.java
0 → 100644
View file @
63430df8
This diff is collapsed.
Click to expand it.
refined-manager/src/main/java/com/mortals/xhx/daemon/task/SyncSubmitAppointTaskImpl.java
View file @
63430df8
...
...
@@ -32,8 +32,6 @@ import java.util.List;
@Service
(
"SyncSubmitAppointTask"
)
public
class
SyncSubmitAppointTaskImpl
implements
ITaskExcuteService
{
@Autowired
private
AppointmentPersonService
appointmentPersonService
;
@Autowired
private
AppointmentRecordsService
appointmentRecordsService
;
...
...
refined-manager/src/main/java/com/mortals/xhx/daemon/task/SyncUserToHikTaskImpl.java
View file @
63430df8
...
...
@@ -45,7 +45,7 @@ import java.util.List;
* 时间间隔以同步注册用户之后
* 默认同步到一个人脸用户组,如要其它用户组 则页面上进行添加
* 需要根据计划进行同步人脸链接
* 默认
* 默认
用户组 主要是陌生人识别 不在当前库中的 都是陌生人
*
*/
@Slf4j
...
...
refined-manager/src/main/java/com/mortals/xhx/module/face/service/FaceGroupService.java
View file @
63430df8
package
com.mortals.xhx.module.face.service
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.service.ICRUDService
;
import
com.mortals.xhx.module.face.model.FaceGroupEntity
;
import
com.mortals.xhx.module.hik.face.model.req.group.FaceGroupReq
;
/**
* FaceGroupService
*
...
...
@@ -11,4 +14,7 @@ import com.mortals.xhx.module.face.model.FaceGroupEntity;
*/
public
interface
FaceGroupService
extends
ICRUDService
<
FaceGroupEntity
,
Long
>{
Rest
<
FaceGroupEntity
>
saveFaceGroupToHik
(
FaceGroupReq
faceGroupReq
);
}
\ No newline at end of file
refined-manager/src/main/java/com/mortals/xhx/module/face/service/impl/FaceGroupServiceImpl.java
View file @
63430df8
package
com.mortals.xhx.module.face.service.impl
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.xhx.common.code.YesNoEnum
;
import
com.mortals.xhx.module.hik.face.model.req.group.FaceGroupReq
;
import
com.mortals.xhx.module.hik.face.model.rsp.group.FaceGroupDataInfo
;
import
com.mortals.xhx.module.hik.face.service.IHikFaceService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.framework.exception.AppException
;
...
...
@@ -6,14 +13,37 @@ import com.mortals.framework.model.Context;
import
com.mortals.xhx.module.face.dao.FaceGroupDao
;
import
com.mortals.xhx.module.face.model.FaceGroupEntity
;
import
com.mortals.xhx.module.face.service.FaceGroupService
;
import
java.util.Date
;
/**
* FaceGroupService
* 人脸分组信息 service实现
*
* @author zxfei
* @date 2023-04-15
*/
* FaceGroupService
* 人脸分组信息 service实现
*
* @author zxfei
* @date 2023-04-15
*/
@Service
(
"faceGroupService"
)
public
class
FaceGroupServiceImpl
extends
AbstractCRUDServiceImpl
<
FaceGroupDao
,
FaceGroupEntity
,
Long
>
implements
FaceGroupService
{
@Autowired
private
IHikFaceService
hikFaceService
;
@Override
public
Rest
<
FaceGroupEntity
>
saveFaceGroupToHik
(
FaceGroupReq
faceGroupReq
)
{
Rest
<
FaceGroupDataInfo
>
faceGroupRest
=
hikFaceService
.
faceGroupSingleAdd
(
faceGroupReq
);
if
(
faceGroupRest
.
getCode
()
==
YesNoEnum
.
YES
.
getValue
())
{
FaceGroupEntity
groupEntity
=
new
FaceGroupEntity
();
groupEntity
.
initAttrValue
();
groupEntity
.
setName
(
faceGroupReq
.
getName
());
groupEntity
.
setDescription
(
faceGroupReq
.
getDescription
());
groupEntity
.
setIndexCode
(
faceGroupRest
.
getData
().
getIndexCode
());
groupEntity
.
setCreateTime
(
new
Date
());
groupEntity
.
setCreateUserId
(
1L
);
groupEntity
.
setCreateUserName
(
"admin"
);
this
.
save
(
groupEntity
);
return
Rest
.
ok
(
groupEntity
);
}
return
Rest
.
fail
();
}
}
\ No newline at end of file
refined-manager/src/main/java/com/mortals/xhx/module/hik/face/model/req/plan/PlanRecogn
Black
ListReq.java
→
refined-manager/src/main/java/com/mortals/xhx/module/hik/face/model/req/plan/PlanRecognListReq.java
View file @
63430df8
...
...
@@ -4,7 +4,7 @@ import java.util.List;
import
lombok.Data
;
@Data
public
class
PlanRecogn
BlackListReq
{
public
class
PlanRecogn
ListReq
{
private
List
<
String
>
faceGroupIndexCodes
;
private
String
name
;
private
String
description
;
...
...
refined-manager/src/main/java/com/mortals/xhx/module/hik/face/model/req/plan/PlanRecogn
Black
Req.java
→
refined-manager/src/main/java/com/mortals/xhx/module/hik/face/model/req/plan/PlanRecognReq.java
View file @
63430df8
...
...
@@ -4,7 +4,7 @@ import java.util.List;
import
lombok.Data
;
@Data
public
class
PlanRecogn
BlackReq
{
public
class
PlanRecogn
Req
{
private
List
<
String
>
cameraIndexCodes
;
private
List
<
String
>
faceGroupIndexCodes
;
private
String
name
;
...
...
refined-manager/src/main/java/com/mortals/xhx/module/hik/face/service/IHikPlanService.java
View file @
63430df8
...
...
@@ -2,14 +2,15 @@ package com.mortals.xhx.module.hik.face.service;
import
com.mortals.framework.common.Rest
;
import
com.mortals.xhx.module.hik.face.model.req.plan.PlanRecogn
Black
ListReq
;
import
com.mortals.xhx.module.hik.face.model.req.plan.PlanRecogn
Black
Req
;
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.PlanRecognBlackInfo
;
import
java.util.List
;
/**
* 海康门禁接口对接类
*
* @author:
* @date: 2023/4/12 17:47
*/
...
...
@@ -18,23 +19,51 @@ public interface IHikPlanService {
/**
* 查询重点识别计划
* @param planRecognBlackListReq
*
* @param planRecognListReq
* @return
*/
Rest
<
List
<
PlanRecognBlackInfo
>>
findPlanRecognBlackList
(
PlanRecogn
BlackListReq
planRecognBlack
ListReq
);
Rest
<
List
<
PlanRecognBlackInfo
>>
findPlanRecognBlackList
(
PlanRecogn
ListReq
planRecogn
ListReq
);
/**
* 人员监视计划
* @param planRecognBlackReq
* 添加人员监视计划
*
* @param planRecognReq
* @return
*/
Rest
<
String
>
planRecognBlackAdd
(
PlanRecogn
BlackReq
planRecognBlack
Req
);
Rest
<
String
>
planRecognBlackAdd
(
PlanRecogn
Req
planRecogn
Req
);
/**
* 人员监视计划删除
* @param planRecognBlackReq
*
* @param planRecognReq
* @return
*/
Rest
<
Boolean
>
planRecognBlackDel
(
PlanRecognBlackReq
planRecognBlackReq
);
Rest
<
Boolean
>
planRecognBlackDel
(
PlanRecognReq
planRecognReq
);
/**
* 查询陌生人识别计划
*
* @param planRecognListReq
* @return
*/
Rest
<
List
<
PlanRecognBlackInfo
>>
findPlanRecognWhiteList
(
PlanRecognListReq
planRecognListReq
);
/**
* 添加陌生人监视计划
*
* @param planRecognReq
* @return
*/
Rest
<
String
>
planRecognWhiteAdd
(
PlanRecognReq
planRecognReq
);
/**
* 陌生人人员监视计划删除
*
* @param planRecognReq
* @return
*/
Rest
<
Boolean
>
planRecognWhiteDel
(
PlanRecognReq
planRecognReq
);
}
refined-manager/src/main/java/com/mortals/xhx/module/hik/face/service/impl/HikPlanServiceImpl.java
View file @
63430df8
...
...
@@ -7,8 +7,8 @@ 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.PlanRecogn
Black
ListReq
;
import
com.mortals.xhx.module.hik.face.model.req.plan.PlanRecogn
Black
Req
;
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.PlanRecognBlackInfo
;
import
com.mortals.xhx.module.hik.face.service.IHikPlanService
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -27,7 +27,7 @@ import java.util.List;
public
class
HikPlanServiceImpl
extends
AbstractHikService
implements
IHikPlanService
{
@Override
public
Rest
<
List
<
PlanRecognBlackInfo
>>
findPlanRecognBlackList
(
PlanRecogn
Black
ListReq
planRecognBlackListReq
)
{
public
Rest
<
List
<
PlanRecognBlackInfo
>>
findPlanRecognBlackList
(
PlanRecognListReq
planRecognBlackListReq
)
{
ArtemisConfig
config
=
getArtemisConfig
();
String
getCamsApi
=
ARTEMIS_PATH
+
"/api/frs/v1/plan/recognition/black"
;
path
.
put
(
protocol
,
getCamsApi
);
...
...
@@ -68,11 +68,12 @@ public class HikPlanServiceImpl extends AbstractHikService implements IHikPlanSe
* 当时间计划参数不传时,默认全天候。当传入此参数时,时间计划规则如下:按周计划进行配置,每一天的时间段上限为8,每一个时间段的开始时间必须小于结束时间。
* j)同一个深眸支持配置多个识别计划。
* k)若设备上人脸分组达到上限,则有可能导致下发失败。
*
* @param planRecognBlackReq
* @return
*/
@Override
public
Rest
<
String
>
planRecognBlackAdd
(
PlanRecogn
Black
Req
planRecognBlackReq
)
{
public
Rest
<
String
>
planRecognBlackAdd
(
PlanRecognReq
planRecognBlackReq
)
{
ArtemisConfig
config
=
getArtemisConfig
();
String
getCamsApi
=
ARTEMIS_PATH
+
"/api/frs/v1/plan/recognition/black/addition"
;
path
.
put
(
protocol
,
getCamsApi
);
...
...
@@ -95,7 +96,7 @@ public class HikPlanServiceImpl extends AbstractHikService implements IHikPlanSe
}
@Override
public
Rest
<
Boolean
>
planRecognBlackDel
(
PlanRecogn
Black
Req
planRecognBlackReq
)
{
public
Rest
<
Boolean
>
planRecognBlackDel
(
PlanRecognReq
planRecognBlackReq
)
{
ArtemisConfig
config
=
getArtemisConfig
();
String
getCamsApi
=
ARTEMIS_PATH
+
"/api/frs/v1/plan/recognition/black/deletion"
;
path
.
put
(
protocol
,
getCamsApi
);
...
...
@@ -114,4 +115,69 @@ public class HikPlanServiceImpl extends AbstractHikService implements IHikPlanSe
return
Rest
.
fail
(
e
.
getMessage
());
}
}
@Override
public
Rest
<
List
<
PlanRecognBlackInfo
>>
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
<
PlanRecognBlackInfo
>>
rest
=
JSON
.
parseObject
(
respJson
,
new
TypeReference
<
HikApiRest
<
List
<
PlanRecognBlackInfo
>>>()
{
});
if
(
rest
.
getCode
()
==
"0"
)
{
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
(
rest
.
getCode
()
==
"0"
)
{
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
(
rest
.
getCode
()
==
"0"
)
{
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
());
}
}
}
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