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
30d25155
Commit
30d25155
authored
Apr 16, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加识别计划类
parent
f87f1377
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
1515 additions
and
28 deletions
+1515
-28
refined-manager/src/main/java/com/mortals/xhx/daemon/applicationservice/SubEventStartedService.java
...xhx/daemon/applicationservice/SubEventStartedService.java
+18
-2
refined-manager/src/main/java/com/mortals/xhx/module/hik/HikApiRest.java
.../src/main/java/com/mortals/xhx/module/hik/HikApiRest.java
+38
-0
refined-manager/src/main/java/com/mortals/xhx/module/hik/camera/service/impl/HikCameraServiceImpl.java
.../module/hik/camera/service/impl/HikCameraServiceImpl.java
+3
-2
refined-manager/src/main/java/com/mortals/xhx/module/hik/door/service/impl/HikDoorServiceImpl.java
.../xhx/module/hik/door/service/impl/HikDoorServiceImpl.java
+3
-2
refined-manager/src/main/java/com/mortals/xhx/module/hik/event/service/impl/HikEventServiceImpl.java
...hx/module/hik/event/service/impl/HikEventServiceImpl.java
+3
-2
refined-manager/src/main/java/com/mortals/xhx/module/hik/face/service/impl/HikFaceServiceImpl.java
.../xhx/module/hik/face/service/impl/HikFaceServiceImpl.java
+7
-6
refined-manager/src/main/java/com/mortals/xhx/module/hik/face/service/impl/HikPlanServiceImpl.java
.../xhx/module/hik/face/service/impl/HikPlanServiceImpl.java
+13
-10
refined-manager/src/main/java/com/mortals/xhx/module/hik/person/service/impl/HikPersonServiceImpl.java
.../module/hik/person/service/impl/HikPersonServiceImpl.java
+5
-4
refined-manager/src/main/resources/sqlmap/module/device/DeviceMapper.xml
.../src/main/resources/sqlmap/module/device/DeviceMapper.xml
+1425
-0
No files found.
refined-manager/src/main/java/com/mortals/xhx/daemon/applicationservice/SubEventStartedService.java
View file @
30d25155
...
...
@@ -27,6 +27,7 @@ import com.mortals.xhx.module.hik.face.model.req.group.FaceGroupReq;
import
com.mortals.xhx.module.hik.face.model.req.plan.PlanRecognBlackReq
;
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
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
...
...
@@ -51,6 +52,8 @@ public class SubEventStartedService implements IApplicationStartedService {
@Autowired
private
IHikFaceService
hikFaceService
;
@Autowired
private
IHikPlanService
hikPlanService
;
@Autowired
private
FaceGroupService
faceGroupService
;
@Autowired
private
FacePlanService
facePlanService
;
...
...
@@ -58,7 +61,6 @@ public class SubEventStartedService implements IApplicationStartedService {
private
DeviceService
deviceService
;
@Override
public
void
start
()
{
ThreadPool
.
getInstance
().
init
(
20
);
...
...
@@ -105,7 +107,7 @@ public class SubEventStartedService implements IApplicationStartedService {
int
threshold
=
GlobalSysInfo
.
getParamIntValue
(
ParamKey
.
PARAM_FACE_THRESHOLD
,
80
);
FacePlanEntity
facePlanEntity
=
facePlanService
.
selectOne
(
new
FacePlanQuery
().
name
(
planBlackName
));
if
(
ObjectUtils
.
isEmpty
(
facePlanEntity
))
{
if
(
ObjectUtils
.
isEmpty
(
facePlanEntity
))
{
//初始化新增取号监控识别计划
PlanRecognBlackReq
planRecognBlackReq
=
new
PlanRecognBlackReq
();
planRecognBlackReq
.
setName
(
planBlackName
);
...
...
@@ -122,6 +124,20 @@ public class SubEventStartedService implements IApplicationStartedService {
//设置识别方式
planRecognBlackReq
.
setRecognitionResourceType
(
RecognitionResourceEnum
.
COMPARISON
.
getValue
());
//设置时间段 默认全天候
Rest
<
String
>
planRecognBlackAddRest
=
hikPlanService
.
planRecognBlackAdd
(
planRecognBlackReq
);
if
(
planRecognBlackAddRest
.
getCode
()
==
YesNoEnum
.
YES
.
getValue
())
{
FacePlanEntity
planEntity
=
new
FacePlanEntity
();
planEntity
.
initAttrValue
();
planEntity
.
setIndexCode
(
planRecognBlackAddRest
.
getData
());
planEntity
.
setName
(
planBlackName
);
planEntity
.
setDescription
(
planBlackName
);
planEntity
.
setCreateTime
(
new
Date
());
planEntity
.
setCreateUserId
(
1L
);
planEntity
.
setCreateUserName
(
"admin"
);
facePlanService
.
save
(
planEntity
);
}
}
//创建陌生人员识别计划
...
...
refined-manager/src/main/java/com/mortals/xhx/module/hik/HikApiRest.java
0 → 100644
View file @
30d25155
package
com.mortals.xhx.module.hik
;
public
class
HikApiRest
<
T
>
{
private
T
data
;
private
String
code
;
private
String
msg
;
public
T
getData
()
{
return
data
;
}
public
void
setData
(
T
data
)
{
this
.
data
=
data
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
String
getMsg
()
{
return
msg
;
}
public
void
setMsg
(
String
msg
)
{
this
.
msg
=
msg
;
}
}
refined-manager/src/main/java/com/mortals/xhx/module/hik/camera/service/impl/HikCameraServiceImpl.java
View file @
30d25155
...
...
@@ -6,6 +6,7 @@ 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.camera.model.req.CameraListReq
;
import
com.mortals.xhx.module.hik.camera.model.rsp.CameraDataInfo
;
import
com.mortals.xhx.module.hik.camera.model.rsp.CameraInfo
;
...
...
@@ -35,9 +36,9 @@ public class HikCameraServiceImpl extends AbstractHikService implements IHikCame
log
.
info
(
"camera list req=>{}"
,
JSON
.
toJSONString
(
cameraListReq
));
String
respJson
=
ArtemisHttpUtil
.
doPostStringArtemis
(
config
,
path
,
JSON
.
toJSONString
(
cameraListReq
),
null
,
null
,
"application/json"
);
log
.
info
(
"camera list resp=>{}"
,
respJson
);
Rest
<
CameraDataInfo
>
rest
=
JSON
.
parseObject
(
respJson
,
new
TypeReference
<
Rest
<
CameraDataInfo
>>()
{
HikApiRest
<
CameraDataInfo
>
rest
=
JSON
.
parseObject
(
respJson
,
new
TypeReference
<
HikApi
Rest
<
CameraDataInfo
>>()
{
});
if
(
rest
.
getCode
()
==
0
)
{
if
(
rest
.
getCode
()
==
"0"
)
{
return
Rest
.
ok
(
rest
.
getData
());
}
else
{
return
Rest
.
fail
(
rest
.
getMsg
());
...
...
refined-manager/src/main/java/com/mortals/xhx/module/hik/door/service/impl/HikDoorServiceImpl.java
View file @
30d25155
...
...
@@ -6,6 +6,7 @@ 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.door.model.req.door.DoorEventReq
;
import
com.mortals.xhx.module.hik.door.model.rsp.door.DoorEventDataInfo
;
import
com.mortals.xhx.module.hik.door.service.IHikDoorService
;
...
...
@@ -36,9 +37,9 @@ public class HikDoorServiceImpl extends AbstractHikService implements IHikDoorSe
log
.
info
(
"door events req=>{}"
,
JSON
.
toJSONString
(
doorEventReq
));
String
respJson
=
ArtemisHttpUtil
.
doPostStringArtemis
(
config
,
path
,
JSON
.
toJSONString
(
doorEventReq
),
null
,
null
,
"application/json"
);
log
.
info
(
"door events error resp=>{}"
,
respJson
);
Rest
<
DoorEventDataInfo
>
rest
=
JSON
.
parseObject
(
respJson
,
new
TypeReference
<
Rest
<
DoorEventDataInfo
>>()
{
HikApiRest
<
DoorEventDataInfo
>
rest
=
JSON
.
parseObject
(
respJson
,
new
TypeReference
<
HikApi
Rest
<
DoorEventDataInfo
>>()
{
});
if
(
rest
.
getCode
()==
0
){
if
(
rest
.
getCode
()==
"0"
){
return
Rest
.
ok
(
rest
.
getData
());
}
else
{
return
Rest
.
fail
(
rest
.
getMsg
());
...
...
refined-manager/src/main/java/com/mortals/xhx/module/hik/event/service/impl/HikEventServiceImpl.java
View file @
30d25155
...
...
@@ -6,6 +6,7 @@ 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.event.model.req.EventSubReq
;
import
com.mortals.xhx.module.hik.event.model.rsp.EventInfo
;
import
com.mortals.xhx.module.hik.event.service.IHikEventService
;
...
...
@@ -35,9 +36,9 @@ public class HikEventServiceImpl extends AbstractHikService implements IHikEvent
log
.
info
(
"event sub req=>{}"
,
JSON
.
toJSONString
(
eventSubReq
));
String
respJson
=
ArtemisHttpUtil
.
doPostStringArtemis
(
config
,
path
,
JSON
.
toJSONString
(
eventSubReq
),
null
,
null
,
"application/json"
);
log
.
info
(
"event sub resp=>{}"
,
respJson
);
Rest
<
String
>
rest
=
JSON
.
parseObject
(
respJson
,
new
TypeReference
<
Rest
<
String
>>()
{
HikApiRest
<
String
>
rest
=
JSON
.
parseObject
(
respJson
,
new
TypeReference
<
HikApi
Rest
<
String
>>()
{
});
if
(
rest
.
getCode
()
==
0
)
{
if
(
rest
.
getCode
()
==
"0"
)
{
return
Rest
.
ok
();
}
else
{
return
Rest
.
fail
(
rest
.
getMsg
());
...
...
refined-manager/src/main/java/com/mortals/xhx/module/hik/face/service/impl/HikFaceServiceImpl.java
View file @
30d25155
...
...
@@ -6,6 +6,7 @@ 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.face.FaceListReq
;
import
com.mortals.xhx.module.hik.face.model.req.face.FaceReq
;
import
com.mortals.xhx.module.hik.face.model.req.face.ResRecognReq
;
...
...
@@ -36,9 +37,9 @@ public class HikFaceServiceImpl extends AbstractHikService implements IHikFaceSe
path
.
put
(
protocol
,
getCamsApi
);
try
{
String
respJson
=
ArtemisHttpUtil
.
doPostStringArtemis
(
config
,
path
,
JSON
.
toJSONString
(
faceListReq
),
null
,
null
,
"application/json"
);
Rest
<
List
<
FaceDataInfo
>>
rest
=
JSON
.
parseObject
(
respJson
,
new
TypeReference
<
Rest
<
List
<
FaceDataInfo
>>>()
{
HikApiRest
<
List
<
FaceDataInfo
>>
rest
=
JSON
.
parseObject
(
respJson
,
new
TypeReference
<
HikApi
Rest
<
List
<
FaceDataInfo
>>>()
{
});
if
(
rest
.
getCode
()
==
0
)
{
if
(
rest
.
getCode
()
==
"0"
)
{
return
Rest
.
ok
(
rest
.
getData
());
}
else
{
log
.
info
(
"face single error resp=>"
,
respJson
);
...
...
@@ -59,9 +60,9 @@ public class HikFaceServiceImpl extends AbstractHikService implements IHikFaceSe
//log.info("face single add req=>{}", JSON.toJSONString(faceReq));
String
respJson
=
ArtemisHttpUtil
.
doPostStringArtemis
(
config
,
path
,
JSON
.
toJSONString
(
faceReq
),
null
,
null
,
"application/json"
);
log
.
info
(
"face single add resp=>{}"
,
respJson
);
Rest
<
FaceDataInfo
>
rest
=
JSON
.
parseObject
(
respJson
,
new
TypeReference
<
Rest
<
FaceDataInfo
>>()
{
HikApiRest
<
FaceDataInfo
>
rest
=
JSON
.
parseObject
(
respJson
,
new
TypeReference
<
HikApi
Rest
<
FaceDataInfo
>>()
{
});
if
(
rest
.
getCode
()
==
0
)
{
if
(
rest
.
getCode
()
==
"0"
)
{
return
Rest
.
ok
(
rest
.
getData
());
}
else
{
return
Rest
.
fail
(
rest
.
getMsg
());
...
...
@@ -79,9 +80,9 @@ public class HikFaceServiceImpl extends AbstractHikService implements IHikFaceSe
path
.
put
(
protocol
,
getCamsApi
);
try
{
String
respJson
=
ArtemisHttpUtil
.
doPostStringArtemis
(
config
,
path
,
JSON
.
toJSONString
(
faceReq
),
null
,
null
,
"application/json"
);
Rest
<
Boolean
>
rest
=
JSON
.
parseObject
(
respJson
,
new
TypeReference
<
Rest
<
Boolean
>>()
{
HikApiRest
<
Boolean
>
rest
=
JSON
.
parseObject
(
respJson
,
new
TypeReference
<
HikApi
Rest
<
Boolean
>>()
{
});
if
(
rest
.
getCode
()
==
0
)
{
if
(
rest
.
getCode
()
==
"0"
)
{
return
Rest
.
ok
(
rest
.
getData
());
}
else
{
log
.
info
(
"face single error resp=>{}"
,
respJson
);
...
...
refined-manager/src/main/java/com/mortals/xhx/module/hik/face/service/impl/HikPlanServiceImpl.java
View file @
30d25155
...
...
@@ -6,6 +6,7 @@ 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.PlanRecognBlackListReq
;
import
com.mortals.xhx.module.hik.face.model.req.plan.PlanRecognBlackReq
;
import
com.mortals.xhx.module.hik.face.model.rsp.plan.PlanRecognBlackInfo
;
...
...
@@ -32,12 +33,12 @@ public class HikPlanServiceImpl extends AbstractHikService implements IHikPlanSe
path
.
put
(
protocol
,
getCamsApi
);
try
{
String
respJson
=
ArtemisHttpUtil
.
doPostStringArtemis
(
config
,
path
,
JSON
.
toJSONString
(
planRecognBlackListReq
),
null
,
null
,
"application/json"
);
Rest
<
List
<
PlanRecognBlackInfo
>>
rest
=
JSON
.
parseObject
(
respJson
,
new
TypeReference
<
Rest
<
List
<
PlanRecognBlackInfo
>>>()
{
HikApiRest
<
List
<
PlanRecognBlackInfo
>>
rest
=
JSON
.
parseObject
(
respJson
,
new
TypeReference
<
HikApi
Rest
<
List
<
PlanRecognBlackInfo
>>>()
{
});
if
(
rest
.
getCode
()
==
0
)
{
if
(
rest
.
getCode
()
==
"0"
)
{
return
Rest
.
ok
(
rest
.
getData
());
}
else
{
log
.
info
(
"plan recognize balck list error resp=>"
,
respJson
);
log
.
info
(
"plan recognize balck list error resp=>
{}
"
,
respJson
);
return
Rest
.
fail
(
rest
.
getMsg
());
}
}
catch
(
Exception
e
)
{
...
...
@@ -73,16 +74,18 @@ public class HikPlanServiceImpl extends AbstractHikService implements IHikPlanSe
@Override
public
Rest
<
String
>
planRecognBlackAdd
(
PlanRecognBlackReq
planRecognBlackReq
)
{
ArtemisConfig
config
=
getArtemisConfig
();
String
getCamsApi
=
ARTEMIS_PATH
+
"/api/frs/v1/
face/single
/addition"
;
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"
);
Rest
<
String
>
rest
=
JSON
.
parseObject
(
respJson
,
new
TypeReference
<
Rest
<
String
>>()
{
log
.
info
(
"plan recognize balck resp=>{}"
,
respJson
);
HikApiRest
<
String
>
rest
=
JSON
.
parseObject
(
respJson
,
new
TypeReference
<
HikApiRest
<
String
>>()
{
});
if
(
rest
.
getCode
()
==
0
)
{
if
(
rest
.
getCode
()
==
"0"
)
{
return
Rest
.
ok
(
rest
.
getData
());
}
else
{
log
.
info
(
"plan recognize balck error resp=>"
,
respJson
);
log
.
info
(
"plan recognize balck error resp=>
{}
"
,
respJson
);
return
Rest
.
fail
(
rest
.
getMsg
());
}
}
catch
(
Exception
e
)
{
...
...
@@ -98,12 +101,12 @@ public class HikPlanServiceImpl extends AbstractHikService implements IHikPlanSe
path
.
put
(
protocol
,
getCamsApi
);
try
{
String
respJson
=
ArtemisHttpUtil
.
doPostStringArtemis
(
config
,
path
,
JSON
.
toJSONString
(
planRecognBlackReq
),
null
,
null
,
"application/json"
);
Rest
<
Boolean
>
rest
=
JSON
.
parseObject
(
respJson
,
new
TypeReference
<
Rest
<
Boolean
>>()
{
HikApiRest
<
Boolean
>
rest
=
JSON
.
parseObject
(
respJson
,
new
TypeReference
<
HikApi
Rest
<
Boolean
>>()
{
});
if
(
rest
.
getCode
()
==
0
)
{
if
(
rest
.
getCode
()
==
"0"
)
{
return
Rest
.
ok
(
rest
.
getData
());
}
else
{
log
.
info
(
"plan recognize balck error del resp=>"
,
respJson
);
log
.
info
(
"plan recognize balck error del resp=>
{}
"
,
respJson
);
return
Rest
.
fail
(
rest
.
getMsg
());
}
}
catch
(
Exception
e
)
{
...
...
refined-manager/src/main/java/com/mortals/xhx/module/hik/person/service/impl/HikPersonServiceImpl.java
View file @
30d25155
...
...
@@ -6,6 +6,7 @@ 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.person.model.req.org.OrgListReq
;
import
com.mortals.xhx.module.hik.person.model.req.person.PersonReq
;
import
com.mortals.xhx.module.hik.person.model.rsp.org.OrgDataInfo
;
...
...
@@ -35,9 +36,9 @@ public class HikPersonServiceImpl extends AbstractHikService implements IHikPers
path
.
put
(
protocol
,
getCamsApi
);
try
{
String
respJson
=
ArtemisHttpUtil
.
doPostStringArtemis
(
config
,
path
,
JSON
.
toJSONString
(
personReq
),
null
,
null
,
"application/json"
);
Rest
<
PersonDataInfo
>
rest
=
JSON
.
parseObject
(
respJson
,
new
TypeReference
<
Rest
<
PersonDataInfo
>>()
{
HikApiRest
<
PersonDataInfo
>
rest
=
JSON
.
parseObject
(
respJson
,
new
TypeReference
<
HikApi
Rest
<
PersonDataInfo
>>()
{
});
if
(
rest
.
getCode
()
==
0
)
{
if
(
rest
.
getCode
()
==
"0"
)
{
return
Rest
.
ok
(
rest
.
getData
());
}
else
{
log
.
info
(
"person error resp=>{}"
,
respJson
);
...
...
@@ -71,9 +72,9 @@ public class HikPersonServiceImpl extends AbstractHikService implements IHikPers
path
.
put
(
protocol
,
getCamsApi
);
try
{
String
respJson
=
ArtemisHttpUtil
.
doPostStringArtemis
(
config
,
path
,
JSON
.
toJSONString
(
orgListReq
),
null
,
null
,
"application/json"
);
Rest
<
OrgDataInfo
>
rest
=
JSON
.
parseObject
(
respJson
,
new
TypeReference
<
Rest
<
OrgDataInfo
>>()
{
HikApiRest
<
OrgDataInfo
>
rest
=
JSON
.
parseObject
(
respJson
,
new
TypeReference
<
HikApi
Rest
<
OrgDataInfo
>>()
{
});
if
(
rest
.
getCode
()
==
0
)
{
if
(
rest
.
getCode
()
==
"0"
)
{
return
Rest
.
ok
(
rest
.
getData
());
}
else
{
log
.
info
(
"org list error resp=>{}"
,
respJson
);
...
...
refined-manager/src/main/resources/sqlmap/module/device/DeviceMapper.xml
0 → 100644
View file @
30d25155
This diff is collapsed.
Click to expand it.
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