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
ab1e98d2
Commit
ab1e98d2
authored
May 05, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加服务追踪
parent
178b82d7
Changes
8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
243 additions
and
126 deletions
+243
-126
refined-manager/src/main/java/com/mortals/xhx/common/key/Constant.java
...er/src/main/java/com/mortals/xhx/common/key/Constant.java
+1
-0
refined-manager/src/main/java/com/mortals/xhx/daemon/applicationservice/SubEventStartedService.java
...xhx/daemon/applicationservice/SubEventStartedService.java
+1
-1
refined-manager/src/main/java/com/mortals/xhx/daemon/task/SyncSiteDeviceTaskImpl.java
...a/com/mortals/xhx/daemon/task/SyncSiteDeviceTaskImpl.java
+77
-57
refined-manager/src/main/java/com/mortals/xhx/module/device/model/DeviceEntity.java
...ava/com/mortals/xhx/module/device/model/DeviceEntity.java
+146
-53
refined-manager/src/main/java/com/mortals/xhx/module/face/model/FacePlanEntity.java
...ava/com/mortals/xhx/module/face/model/FacePlanEntity.java
+1
-1
refined-manager/src/main/java/com/mortals/xhx/module/face/service/impl/FacePlanServiceImpl.java
...als/xhx/module/face/service/impl/FacePlanServiceImpl.java
+15
-13
refined-manager/src/main/java/com/mortals/xhx/module/hik/camera/model/req/CameraListReq.java
...ortals/xhx/module/hik/camera/model/req/CameraListReq.java
+1
-0
refined-manager/src/main/java/com/mortals/xhx/module/hik/face/service/impl/HikPlanServiceImpl.java
.../xhx/module/hik/face/service/impl/HikPlanServiceImpl.java
+1
-1
No files found.
refined-manager/src/main/java/com/mortals/xhx/common/key/Constant.java
View file @
ab1e98d2
...
...
@@ -95,6 +95,7 @@ public final class Constant {
* 陌生人监控计划
*/
public
final
static
String
STRANGER_PLAN
=
"stranger_plan"
;
public
final
static
String
STRANGER_PLAN_DESC
=
"陌生人监控计划"
;
/**
* 预约监控计划前缀
...
...
refined-manager/src/main/java/com/mortals/xhx/daemon/applicationservice/SubEventStartedService.java
View file @
ab1e98d2
...
...
@@ -103,7 +103,7 @@ public class SubEventStartedService implements IApplicationStartedService {
}
//创建陌生人计划
facePlanService
.
createStrangerPlanByDay
();
//
facePlanService.createStrangerPlanByDay();
//删除重点人员计划
/* PlanRecognListReq planRecognBlackListReq = new PlanRecognListReq();
...
...
refined-manager/src/main/java/com/mortals/xhx/daemon/task/SyncSiteDeviceTaskImpl.java
View file @
ab1e98d2
...
...
@@ -5,6 +5,7 @@ import com.mortals.framework.common.Rest;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.service.ITask
;
import
com.mortals.framework.service.ITaskExcuteService
;
import
com.mortals.xhx.common.code.RecognitionResourceEnum
;
import
com.mortals.xhx.common.code.YesNoEnum
;
import
com.mortals.xhx.module.device.model.DeviceEntity
;
import
com.mortals.xhx.module.device.model.DeviceQuery
;
...
...
@@ -14,6 +15,9 @@ import com.mortals.xhx.module.hik.camera.model.req.CameraReq;
import
com.mortals.xhx.module.hik.camera.model.rsp.CameraDataInfo
;
import
com.mortals.xhx.module.hik.camera.model.rsp.CameraInfo
;
import
com.mortals.xhx.module.hik.camera.service.IHikCameraService
;
import
com.mortals.xhx.module.hik.face.model.req.resource.ResourceReq
;
import
com.mortals.xhx.module.hik.face.model.rsp.resource.ResourceDataInfo
;
import
com.mortals.xhx.module.hik.face.service.IHikFaceService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -35,6 +39,8 @@ public class SyncSiteDeviceTaskImpl implements ITaskExcuteService {
private
DeviceService
deviceService
;
@Autowired
private
IHikCameraService
hikCameraService
;
@Autowired
private
IHikFaceService
hikFaceService
;
@Override
...
...
@@ -85,10 +91,22 @@ public class SyncSiteDeviceTaskImpl implements ITaskExcuteService {
* "updateTime": "2023-04-10T15:11:56.446+08:00"
*/
private
void
syncDevice
()
{
//获取识别资源
ResourceReq
resourceReq
=
new
ResourceReq
();
resourceReq
.
setRecognitionResourceType
(
RecognitionResourceEnum
.
SUPER_BRAIN
.
getValue
());
Rest
<
List
<
ResourceDataInfo
>>
resourceRecognition
=
hikFaceService
.
getResourceRecognition
(
resourceReq
);
if
(
resourceRecognition
.
getCode
()
==
YesNoEnum
.
YES
.
getValue
()
&&
!
ObjectUtils
.
isEmpty
(
resourceRecognition
.
getData
()))
{
ArrayList
<
String
>
recognitionResourceIndexCodes
=
new
ArrayList
<>();
recognitionResourceIndexCodes
.
add
(
resourceRecognition
.
getData
().
get
(
0
).
getIndexCode
());
// planRecognWhiteReq.setRecognitionResourceIndexCodes(recognitionResourceIndexCodes);
CameraListReq
cameraListReq
=
new
CameraListReq
();
cameraListReq
.
setPageNo
(
1
);
cameraListReq
.
setPageSize
(
200
);
cameraListReq
.
setRegionIndexCode
(
"root000000"
);
cameraListReq
.
setEncodeDevIndexCode
(
resourceRecognition
.
getData
().
get
(
0
).
getIndexCode
());
//cameraListReq.setRegionIndexCode("root000000");
Rest
<
CameraDataInfo
>
rest
=
hikCameraService
.
findCameraList
(
cameraListReq
);
if
(
rest
.
getCode
()
==
YesNoEnum
.
YES
.
getValue
())
{
List
<
CameraInfo
>
cameraDataInfoList
=
rest
.
getData
().
getList
();
...
...
@@ -148,6 +166,8 @@ public class SyncSiteDeviceTaskImpl implements ITaskExcuteService {
}
else
{
log
.
info
(
"同步设备异常=>{}"
,
JSON
.
toJSONString
(
rest
));
}
}
}
...
...
refined-manager/src/main/java/com/mortals/xhx/module/device/model/DeviceEntity.java
View file @
ab1e98d2
This diff is collapsed.
Click to expand it.
refined-manager/src/main/java/com/mortals/xhx/module/face/model/FacePlanEntity.java
View file @
ab1e98d2
...
...
@@ -321,7 +321,7 @@ public class FacePlanEntity extends FacePlanVo {
this
.
status
=
""
;
this
.
available
=
""
;
this
.
available
=
"
true
"
;
this
.
description
=
""
;
...
...
refined-manager/src/main/java/com/mortals/xhx/module/face/service/impl/FacePlanServiceImpl.java
View file @
ab1e98d2
...
...
@@ -118,12 +118,12 @@ public class FacePlanServiceImpl extends AbstractCRUDServiceImpl<FacePlanDao, Fa
faceGroupIndexCodes
.
add
(
faceGroupEntity
.
getIndexCode
());
planRecognWhiteReq
.
setFaceGroupIndexCodes
(
faceGroupIndexCodes
);
//设置监控点
List
<
String
>
cameraIndexCodes
=
deviceService
.
find
(
new
DeviceQuery
()).
stream
().
distinct
().
map
(
DeviceEntity:
:
getDeviceCode
).
collect
(
Collectors
.
toList
());
List
<
String
>
cameraIndexCodes
=
deviceService
.
find
(
new
DeviceQuery
()).
stream
().
map
(
DeviceEntity:
:
getDeviceCode
).
distinct
(
).
collect
(
Collectors
.
toList
());
ArrayList
<
String
>
temp
=
new
ArrayList
<>();
temp
.
add
(
cameraIndexCodes
.
get
(
2
));
//
planRecognWhiteReq.setCameraIndexCodes(cameraIndexCodes);
planRecognWhiteReq
.
setCameraIndexCodes
(
temp
);
//
ArrayList<String> temp = new ArrayList<>();
//
temp.add(cameraIndexCodes.get(2));
planRecognWhiteReq
.
setCameraIndexCodes
(
cameraIndexCodes
);
//
planRecognWhiteReq.setCameraIndexCodes(temp);
//设置识别方式
planRecognWhiteReq
.
setRecognitionResourceType
(
RecognitionResourceEnum
.
SUPER_BRAIN
.
getValue
());
...
...
@@ -137,7 +137,7 @@ public class FacePlanServiceImpl extends AbstractCRUDServiceImpl<FacePlanDao, Fa
}
//设置时间段 默认全天候
List
<
TimeBlockListItem
>
timeBlockListItemList
=
new
ArrayList
<>();
/*
List<TimeBlockListItem> timeBlockListItemList=new ArrayList<>();
TimeBlockListItem timeBlockListItem = new TimeBlockListItem();
timeBlockListItem.setDayOfWeek("7");
List<TimeRangeItem> timeRange=new ArrayList<>();
...
...
@@ -147,7 +147,7 @@ public class FacePlanServiceImpl extends AbstractCRUDServiceImpl<FacePlanDao, Fa
timeRange.add(timeRangeItem);
timeBlockListItem.setTimeRange(timeRange);
timeBlockListItemList.add(timeBlockListItem);
planRecognWhiteReq
.
setTimeBlockList
(
timeBlockListItemList
);
planRecognWhiteReq.setTimeBlockList(timeBlockListItemList);
*/
if
(
ObjectUtils
.
isEmpty
(
planRecognWhiteInfo
))
{
Rest
<
String
>
planRecognWhiteAddRest
=
hikPlanService
.
planRecognWhiteAdd
(
planRecognWhiteReq
);
...
...
@@ -155,8 +155,15 @@ public class FacePlanServiceImpl extends AbstractCRUDServiceImpl<FacePlanDao, Fa
FacePlanEntity
planEntity
=
new
FacePlanEntity
();
planEntity
.
initAttrValue
();
planEntity
.
setIndexCode
(
planRecognWhiteAddRest
.
getData
());
planEntity
.
setFaceGroupIndexCodes
(
faceGroupEntity
.
getIndexCode
());
planEntity
.
setCameraIndexCodes
(
planRecognWhiteReq
.
getCameraIndexCodes
().
stream
().
collect
(
Collectors
.
joining
(
","
)));
planEntity
.
setRecognitionResourceIndexCodes
(
planRecognWhiteReq
.
getRecognitionResourceIndexCodes
().
stream
().
collect
(
Collectors
.
joining
(
","
)));
planEntity
.
setRecognitionResourceType
(
RecognitionResourceEnum
.
SUPER_BRAIN
.
getDesc
());
planEntity
.
setThreshold
(
threshold
);
planEntity
.
setStatus
(
PlanStatusEnum
.
RUNNING
.
getValue
());
planEntity
.
setStartTime
(
new
Date
());
planEntity
.
setName
(
Constant
.
STRANGER_PLAN
);
planEntity
.
setDescription
(
Constant
.
STRANGER_PLAN
);
planEntity
.
setDescription
(
Constant
.
STRANGER_PLAN
_DESC
);
planEntity
.
setCreateTime
(
new
Date
());
planEntity
.
setCreateUserId
(
1L
);
planEntity
.
setCreateUserName
(
"admin"
);
...
...
@@ -182,9 +189,7 @@ public class FacePlanServiceImpl extends AbstractCRUDServiceImpl<FacePlanDao, Fa
planRecognWhiteReq
.
setIndexCode
(
planRecognWhiteInfo
.
getIndexCode
());
Rest
<
Boolean
>
planRecognWhiteUpdateRest
=
hikPlanService
.
planRecognWhiteUpdate
(
planRecognWhiteReq
);
if
(
planRecognWhiteUpdateRest
.
getCode
()
==
YesNoEnum
.
YES
.
getValue
()
&&
planRecognWhiteUpdateRest
.
getData
())
{
FacePlanEntity
whitePlan
=
facePlanService
.
selectOne
(
new
FacePlanQuery
().
indexCode
(
planRecognWhiteInfo
.
getIndexCode
()));
if
(!
ObjectUtils
.
isEmpty
(
whitePlan
))
{
whitePlan
.
setUpdateTime
(
new
Date
());
whitePlan
.
setUpdateUserId
(
1L
);
...
...
@@ -193,12 +198,9 @@ public class FacePlanServiceImpl extends AbstractCRUDServiceImpl<FacePlanDao, Fa
}
}
}
}
return
planRecognWhiteListRest
;
}
...
...
refined-manager/src/main/java/com/mortals/xhx/module/hik/camera/model/req/CameraListReq.java
View file @
ab1e98d2
...
...
@@ -11,6 +11,7 @@ public class CameraListReq {
private
String
cameraIndexCodes
;
//识别资源,默认超脑
private
String
encodeDevIndexCode
;
private
String
regionIndexCode
;
...
...
refined-manager/src/main/java/com/mortals/xhx/module/hik/face/service/impl/HikPlanServiceImpl.java
View file @
ab1e98d2
...
...
@@ -149,7 +149,7 @@ public class HikPlanServiceImpl extends AbstractHikService implements IHikPlanSe
HikApiRest
<
String
>
rest
=
JSON
.
parseObject
(
respJson
,
new
TypeReference
<
HikApiRest
<
String
>>()
{
});
if
(
"0"
.
equals
(
rest
.
getCode
()))
{
return
Rest
.
ok
(
rest
.
getData
());
return
Rest
.
ok
(
rest
.
get
Msg
(),
rest
.
get
Data
());
}
else
{
log
.
info
(
"plan recognize white add error resp=>{}"
,
respJson
);
return
Rest
.
fail
(
rest
.
getMsg
());
...
...
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