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
51789065
Commit
51789065
authored
Jul 20, 2024
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改消费海康回调函数
parent
5646614e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
0 deletions
+64
-0
refined-manager/src/main/java/com/mortals/xhx/busiz/web/TestController.java
...c/main/java/com/mortals/xhx/busiz/web/TestController.java
+64
-0
No files found.
refined-manager/src/main/java/com/mortals/xhx/busiz/web/TestController.java
View file @
51789065
package
com.mortals.xhx.busiz.web
;
package
com.mortals.xhx.busiz.web
;
import
cn.hutool.core.codec.Base64
;
import
cn.hutool.core.date.DateTime
;
import
cn.hutool.core.date.DateTime
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.HexUtil
;
import
cn.hutool.core.util.HexUtil
;
...
@@ -9,6 +10,10 @@ import com.alibaba.fastjson.JSON;
...
@@ -9,6 +10,10 @@ import com.alibaba.fastjson.JSON;
import
com.mortals.framework.annotation.UnAuth
;
import
com.mortals.framework.annotation.UnAuth
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.util.SecurityUtil
;
import
com.mortals.framework.util.SecurityUtil
;
import
com.mortals.framework.utils.ServletUtils
;
import
com.mortals.xhx.common.code.HikEventTypeEnum
;
import
com.mortals.xhx.common.code.YesNoEnum
;
import
com.mortals.xhx.module.hik.face.model.req.img.ImgReq
;
import
com.mortals.xhx.module.hik.face.service.FacePlanService
;
import
com.mortals.xhx.module.hik.face.service.FacePlanService
;
import
com.mortals.xhx.module.hik.door.model.req.door.DoorEventReq
;
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.model.rsp.door.DoorEventDataInfo
;
...
@@ -21,14 +26,22 @@ import com.mortals.xhx.module.hik.person.model.req.person.PersonReq;
...
@@ -21,14 +26,22 @@ import com.mortals.xhx.module.hik.person.model.req.person.PersonReq;
import
com.mortals.xhx.module.hik.person.model.rsp.org.OrgDataInfo
;
import
com.mortals.xhx.module.hik.person.model.rsp.org.OrgDataInfo
;
import
com.mortals.xhx.module.hik.person.model.rsp.person.PersonDataInfo
;
import
com.mortals.xhx.module.hik.person.model.rsp.person.PersonDataInfo
;
import
com.mortals.xhx.module.hik.person.service.IHikPersonService
;
import
com.mortals.xhx.module.hik.person.service.IHikPersonService
;
import
com.mortals.xhx.module.realtime.model.RealtimeDataflowEntity
;
import
com.mortals.xhx.module.realtime.model.RealtimeDataflowStatEntity
;
import
com.mortals.xhx.module.realtime.model.RealtimeDataflowStatEntity
;
import
com.mortals.xhx.module.realtime.service.RealtimeDataflowService
;
import
com.mortals.xhx.module.realtime.service.RealtimeDataflowStatService
;
import
com.mortals.xhx.module.realtime.service.RealtimeDataflowStatService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.ByteArrayInputStream
;
import
java.io.InputStream
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
/**
* 设备
* 设备
...
@@ -51,6 +64,8 @@ public class TestController {
...
@@ -51,6 +64,8 @@ public class TestController {
private
FacePlanService
facePlanService
;
private
FacePlanService
facePlanService
;
@Autowired
@Autowired
private
RealtimeDataflowStatService
realtimeDataflowStatService
;
private
RealtimeDataflowStatService
realtimeDataflowStatService
;
@Autowired
private
RealtimeDataflowService
realtimeDataflowService
;
@GetMapping
(
"webservice"
)
@GetMapping
(
"webservice"
)
...
@@ -158,6 +173,55 @@ public class TestController {
...
@@ -158,6 +173,55 @@ public class TestController {
}
}
@GetMapping
(
"mockFlowData"
)
@UnAuth
public
String
mockFlowData
()
{
List
<
RealtimeDataflowEntity
>
flowEntities
=
new
ArrayList
<>();
//模拟构造过去人流数据
DateTime
startDateTime
=
DateUtil
.
parseDate
(
"2024-03-01"
);
DateTime
endDateTime
=
DateUtil
.
date
();
Integer
subDay
=
Integer
.
parseInt
(
String
.
valueOf
(
DateUtil
.
betweenDay
(
startDateTime
,
endDateTime
,
false
)));
for
(
int
i
=
0
;
i
<=
subDay
;
i
++)
{
DateTime
date
=
DateUtil
.
offsetDay
(
startDateTime
,
i
);
boolean
weekend
=
DateUtil
.
isWeekend
(
date
);
if
(
weekend
)
{
//周末 默认数据
for
(
int
j
=
0
;
j
<=
23
;
j
++)
{
RealtimeDataflowStatEntity
statEntity
=
new
RealtimeDataflowStatEntity
();
statEntity
.
initAttrValue
();
statEntity
.
setSiteId
(
1L
);
statEntity
.
setSiteName
(
"宜宾市民中心"
);
RealtimeDataflowEntity
realtimeDataflowEntity
=
new
RealtimeDataflowEntity
();
realtimeDataflowEntity
.
initAttrValue
();
realtimeDataflowEntity
.
setSiteId
(
1L
);
realtimeDataflowEntity
.
setSiteName
(
"宜宾市民中心"
);
realtimeDataflowEntity
.
setDetectTime
(
DateUtil
.
offsetHour
(
date
,
j
));
realtimeDataflowEntity
.
setDevice
(
RandomUtil
.
randomString
(
10
));
realtimeDataflowEntity
.
setPicUri
(
""
);
realtimeDataflowEntity
.
setEventId
(
RandomUtil
.
randomString
(
10
));
realtimeDataflowEntity
.
setEventType
(
HikEventTypeEnum
.
陌生人员识别事件
.
getValue
().
longValue
());
realtimeDataflowEntity
.
setCreateUserId
(
1L
);
realtimeDataflowEntity
.
setCreateTime
(
DateUtil
.
offsetHour
(
date
,
j
));
realtimeDataflowEntity
.
setCreateUserName
(
"system"
);
flowEntities
.
add
(
realtimeDataflowEntity
);
}
}
}
log
.
info
(
"新增数量:{}"
,
flowEntities
.
size
());
realtimeDataflowService
.
save
(
flowEntities
);
return
"ok"
;
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
String
str
=
"admin"
;
String
str
=
"admin"
;
...
...
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