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
b7f0da7c
Commit
b7f0da7c
authored
May 10, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加服务追踪
parent
d2af209a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
5 deletions
+42
-5
refined-manager/src/main/java/com/mortals/xhx/daemon/task/RealTimeDownloadImgTaskImpl.java
.../mortals/xhx/daemon/task/RealTimeDownloadImgTaskImpl.java
+1
-1
refined-manager/src/main/java/com/mortals/xhx/daemon/task/SyncRegisterUserTaskImpl.java
...com/mortals/xhx/daemon/task/SyncRegisterUserTaskImpl.java
+5
-1
refined-manager/src/main/java/com/mortals/xhx/module/hik/event/service/impl/StrangerRecoginze.java
.../xhx/module/hik/event/service/impl/StrangerRecoginze.java
+32
-0
refined-manager/src/main/java/com/mortals/xhx/module/realtime/service/impl/RealtimeDataflowStatServiceImpl.java
...ealtime/service/impl/RealtimeDataflowStatServiceImpl.java
+4
-3
No files found.
refined-manager/src/main/java/com/mortals/xhx/daemon/task/RealTimeDownloadImgTaskImpl.java
View file @
b7f0da7c
...
@@ -35,7 +35,7 @@ import static java.util.stream.Collectors.toList;
...
@@ -35,7 +35,7 @@ import static java.util.stream.Collectors.toList;
* 人流图片下载
* 人流图片下载
*/
*/
@Slf4j
@Slf4j
@Service
(
"RealTimeDownloadImgTask"
)
//
@Service("RealTimeDownloadImgTask")
public
class
RealTimeDownloadImgTaskImpl
implements
ITaskExcuteService
{
public
class
RealTimeDownloadImgTaskImpl
implements
ITaskExcuteService
{
@Autowired
@Autowired
...
...
refined-manager/src/main/java/com/mortals/xhx/daemon/task/SyncRegisterUserTaskImpl.java
View file @
b7f0da7c
...
@@ -96,12 +96,15 @@ public class SyncRegisterUserTaskImpl implements ITaskExcuteService {
...
@@ -96,12 +96,15 @@ public class SyncRegisterUserTaskImpl implements ITaskExcuteService {
if
(
restTotal
.
getCode
()
==
YesNoEnum
.
YES
.
getValue
())
{
if
(
restTotal
.
getCode
()
==
YesNoEnum
.
YES
.
getValue
())
{
//同步所有用户
//同步所有用户
List
<
DataItem
>
userList
=
restTotal
.
getData
().
getData
();
List
<
DataItem
>
userList
=
restTotal
.
getData
().
getData
();
log
.
info
(
"注册用户
新增
数量:{}"
,
userList
.
size
());
log
.
info
(
"注册用户数量:{}"
,
userList
.
size
());
if
(!
ObjectUtils
.
isEmpty
(
userList
))
{
if
(!
ObjectUtils
.
isEmpty
(
userList
))
{
List
<
PersonEntity
>
newUserList
=
userList
.
stream
().
map
(
user
->
{
List
<
PersonEntity
>
newUserList
=
userList
.
stream
().
map
(
user
->
{
if
(
ObjectUtils
.
isEmpty
(
user
.
getIdcardIDCardNo
()))
{
if
(
ObjectUtils
.
isEmpty
(
user
.
getIdcardIDCardNo
()))
{
return
null
;
return
null
;
}
}
if
(!
ObjectUtils
.
isEmpty
(
user
.
getIdcardDataPhotoFileName
()))
{
log
.
info
(
"注册用户名称:{} ,idCard:{},照片路径:{}"
,
user
.
getIdcardName
(),
user
.
getIdcardIDCardNo
(),
user
.
getIdcardDataPhotoFileName
());
}
PersonEntity
personEntity
=
new
PersonEntity
();
PersonEntity
personEntity
=
new
PersonEntity
();
personEntity
.
initAttrValue
();
personEntity
.
initAttrValue
();
personEntity
.
setName
(
user
.
getIdcardName
());
personEntity
.
setName
(
user
.
getIdcardName
());
...
@@ -127,6 +130,7 @@ public class SyncRegisterUserTaskImpl implements ITaskExcuteService {
...
@@ -127,6 +130,7 @@ public class SyncRegisterUserTaskImpl implements ITaskExcuteService {
if
(
oldUserMap
.
containsKey
(
item
.
getIdCard
()))
{
if
(
oldUserMap
.
containsKey
(
item
.
getIdCard
()))
{
PersonEntity
personEntity
=
oldUserMap
.
get
(
item
.
getIdCard
());
PersonEntity
personEntity
=
oldUserMap
.
get
(
item
.
getIdCard
());
//校验 如果参数都一样 则不添加更新
//校验 如果参数都一样 则不添加更新
//if(!ObjectUtils.isEmpty(item.getSourcePhotoUri()))
Boolean
bool
=
checkFieldSame
(
item
,
personEntity
);
Boolean
bool
=
checkFieldSame
(
item
,
personEntity
);
if
(
bool
)
return
null
;
if
(
bool
)
return
null
;
personEntity
.
setName
(
item
.
getName
());
personEntity
.
setName
(
item
.
getName
());
...
...
refined-manager/src/main/java/com/mortals/xhx/module/hik/event/service/impl/StrangerRecoginze.java
View file @
b7f0da7c
package
com.mortals.xhx.module.hik.event.service.impl
;
package
com.mortals.xhx.module.hik.event.service.impl
;
import
cn.hutool.core.codec.Base64
;
import
cn.hutool.core.date.DateUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.utils.ServletUtils
;
import
com.mortals.xhx.base.system.upload.service.UploadService
;
import
com.mortals.xhx.common.code.HikEventTypeEnum
;
import
com.mortals.xhx.common.code.HikEventTypeEnum
;
import
com.mortals.xhx.common.code.YesNoEnum
;
import
com.mortals.xhx.module.hik.event.model.req.callback.recognition.EventData
;
import
com.mortals.xhx.module.hik.event.model.req.callback.recognition.EventData
;
import
com.mortals.xhx.module.hik.event.model.req.callback.EventsItem
;
import
com.mortals.xhx.module.hik.event.model.req.callback.EventsItem
;
import
com.mortals.xhx.module.hik.event.model.req.callback.recognition.FaceRecognitionResult
;
import
com.mortals.xhx.module.hik.event.model.req.callback.recognition.FaceRecognitionResult
;
import
com.mortals.xhx.module.hik.event.model.req.callback.recognition.Snap
;
import
com.mortals.xhx.module.hik.event.model.req.callback.recognition.Snap
;
import
com.mortals.xhx.module.hik.face.model.req.img.ImgReq
;
import
com.mortals.xhx.module.hik.face.service.IHikFaceService
;
import
com.mortals.xhx.module.realtime.model.RealtimeDataflowEntity
;
import
com.mortals.xhx.module.realtime.model.RealtimeDataflowEntity
;
import
com.mortals.xhx.module.realtime.service.RealtimeDataflowService
;
import
com.mortals.xhx.module.realtime.service.RealtimeDataflowService
;
import
com.mortals.xhx.utils.SpringUtils
;
import
com.mortals.xhx.utils.SpringUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.ByteArrayInputStream
;
import
java.io.InputStream
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -26,9 +38,15 @@ public class StrangerRecoginze extends EventTypeAbstract {
...
@@ -26,9 +38,15 @@ public class StrangerRecoginze extends EventTypeAbstract {
private
RealtimeDataflowService
dataflowService
;
private
RealtimeDataflowService
dataflowService
;
private
IHikFaceService
faceService
;
private
UploadService
uploadService
;
public
StrangerRecoginze
(
int
type
)
{
public
StrangerRecoginze
(
int
type
)
{
super
(
type
);
super
(
type
);
this
.
dataflowService
=
SpringUtils
.
getBean
(
RealtimeDataflowService
.
class
);
this
.
dataflowService
=
SpringUtils
.
getBean
(
RealtimeDataflowService
.
class
);
this
.
faceService
=
SpringUtils
.
getBean
(
IHikFaceService
.
class
);
this
.
uploadService
=
SpringUtils
.
getBean
(
UploadService
.
class
);
}
}
...
@@ -57,6 +75,20 @@ public class StrangerRecoginze extends EventTypeAbstract {
...
@@ -57,6 +75,20 @@ public class StrangerRecoginze extends EventTypeAbstract {
if
(!
ObjectUtils
.
isEmpty
(
eventData
.
getResInfo
()))
{
if
(!
ObjectUtils
.
isEmpty
(
eventData
.
getResInfo
()))
{
realtimeDataflowEntity
.
setLocation
(
eventData
.
getResInfo
().
get
(
0
).
getCn
());
realtimeDataflowEntity
.
setLocation
(
eventData
.
getResInfo
().
get
(
0
).
getCn
());
}
}
ImgReq
imgReq
=
new
ImgReq
();
imgReq
.
setUrl
(
realtimeDataflowEntity
.
getPicUri
());
Rest
<
String
>
rest
=
faceService
.
downloadPicture
(
imgReq
);
if
(
YesNoEnum
.
YES
.
getValue
()
==
rest
.
getCode
())
{
byte
[]
bytes
=
Base64
.
decode
(
rest
.
getData
());
if
(!
ObjectUtils
.
isEmpty
(
bytes
))
{
InputStream
inputStream
=
new
ByteArrayInputStream
(
bytes
);
MultipartFile
file
=
ServletUtils
.
getMultipartFile
(
inputStream
,
"snap.jpg"
);
String
filePath
=
uploadService
.
saveFileUpload
(
file
,
"file/fileupload/snap/"
+
DateUtil
.
today
(),
null
);
realtimeDataflowEntity
.
setPicture
(
filePath
);
}
}
realtimeDataflowEntity
.
setEventId
(
event
.
getEventId
());
realtimeDataflowEntity
.
setEventId
(
event
.
getEventId
());
realtimeDataflowEntity
.
setEventType
(
HikEventTypeEnum
.
陌生人员识别事件
.
getValue
().
longValue
());
realtimeDataflowEntity
.
setEventType
(
HikEventTypeEnum
.
陌生人员识别事件
.
getValue
().
longValue
());
realtimeDataflowEntity
.
setCreateUserId
(
1L
);
realtimeDataflowEntity
.
setCreateUserId
(
1L
);
...
...
refined-manager/src/main/java/com/mortals/xhx/module/realtime/service/impl/RealtimeDataflowStatServiceImpl.java
View file @
b7f0da7c
...
@@ -85,15 +85,16 @@ public class RealtimeDataflowStatServiceImpl extends AbstractCRUDServiceImpl<Rea
...
@@ -85,15 +85,16 @@ public class RealtimeDataflowStatServiceImpl extends AbstractCRUDServiceImpl<Rea
query
.
setSiteId
(
siteId
);
query
.
setSiteId
(
siteId
);
if
(
datePattern
==
TimeUnitEnum
.
HOUR
.
getValue
())
{
if
(
datePattern
==
TimeUnitEnum
.
HOUR
.
getValue
())
{
query
.
setGroupList
(
Arrays
.
asList
(
"hour"
));
query
.
setGroupList
(
Arrays
.
asList
(
"hour"
));
query
.
setOrderColList
(
Arrays
.
asList
(
new
OrderCol
(
"hour"
,
OrderCol
.
DESCENDING
),
new
OrderCol
(
"createTime"
)));
query
.
setOrderColList
(
Arrays
.
asList
(
new
OrderCol
(
"year"
,
OrderCol
.
DESCENDING
),
new
OrderCol
(
"month"
,
OrderCol
.
DESCENDING
),
new
OrderCol
(
"day"
,
OrderCol
.
DESCENDING
),
new
OrderCol
(
"hour"
,
OrderCol
.
DESCENDING
)
,
new
OrderCol
(
"createTime"
)));
statList
=
this
.
getDao
().
getStatList
(
query
,
pageInfo
);
statList
=
this
.
getDao
().
getStatList
(
query
,
pageInfo
);
}
else
if
(
datePattern
==
TimeUnitEnum
.
DAY
.
getValue
())
{
}
else
if
(
datePattern
==
TimeUnitEnum
.
DAY
.
getValue
())
{
query
.
setGroupList
(
Arrays
.
asList
(
"day"
));
query
.
setGroupList
(
Arrays
.
asList
(
"day"
));
query
.
setOrderColList
(
Arrays
.
asList
(
new
OrderCol
(
"day"
,
OrderCol
.
DESCENDING
),
new
OrderCol
(
"createTime"
)));
query
.
setOrderColList
(
Arrays
.
asList
(
new
OrderCol
(
"
year"
,
OrderCol
.
DESCENDING
),
new
OrderCol
(
"month"
,
OrderCol
.
DESCENDING
),
new
OrderCol
(
"
day"
,
OrderCol
.
DESCENDING
),
new
OrderCol
(
"createTime"
)));
statList
=
this
.
getDao
().
getStatList
(
query
,
pageInfo
);
statList
=
this
.
getDao
().
getStatList
(
query
,
pageInfo
);
}
else
if
(
datePattern
==
TimeUnitEnum
.
MONTH
.
getValue
())
{
}
else
if
(
datePattern
==
TimeUnitEnum
.
MONTH
.
getValue
())
{
query
.
setGroupList
(
Arrays
.
asList
(
"month"
));
query
.
setGroupList
(
Arrays
.
asList
(
"month"
));
query
.
setOrderColList
(
Arrays
.
asList
(
new
OrderCol
(
"month"
,
OrderCol
.
DESCENDING
),
new
OrderCol
(
"createTime"
)));
query
.
setOrderColList
(
Arrays
.
asList
(
new
OrderCol
(
"
year"
,
OrderCol
.
DESCENDING
),
new
OrderCol
(
"
month"
,
OrderCol
.
DESCENDING
),
new
OrderCol
(
"createTime"
)));
statList
=
this
.
getDao
().
getStatList
(
query
,
pageInfo
);
statList
=
this
.
getDao
().
getStatList
(
query
,
pageInfo
);
}
else
if
(
datePattern
==
TimeUnitEnum
.
YEAR
.
getValue
())
{
}
else
if
(
datePattern
==
TimeUnitEnum
.
YEAR
.
getValue
())
{
query
.
setGroupList
(
Arrays
.
asList
(
"year"
));
query
.
setGroupList
(
Arrays
.
asList
(
"year"
));
...
...
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