Commit 3e991f0e authored by 赵啸非's avatar 赵啸非

修改消费海康回调函数

parent 51789065
......@@ -111,7 +111,7 @@ public class TestController {
public String mockStatData() {
ArrayList<RealtimeDataflowStatEntity> statEntities = new ArrayList<>();
//模拟构造过去人流数据
DateTime startDateTime = DateUtil.parseDate("2023-03-01");
DateTime startDateTime = DateUtil.parseDate("2024-07-20");
DateTime endDateTime = DateUtil.date();
Integer subDay = Integer.parseInt(String.valueOf(DateUtil.betweenDay(startDateTime, endDateTime, false)));
......@@ -143,7 +143,7 @@ public class TestController {
statEntity.initAttrValue();
statEntity.setSiteId(1L);
statEntity.setSiteName("宜宾市民中心");
if(j>8&&j<18){
if (j > 8 && j < 18) {
//随机500~1200人
int total = RandomUtil.randomInt(400, 1200);
statEntity.setPersonSum(total);
......@@ -173,13 +173,12 @@ public class TestController {
}
@GetMapping("mockFlowData")
@UnAuth
public String mockFlowData() {
List<RealtimeDataflowEntity> flowEntities = new ArrayList<>();
//模拟构造过去人流数据
DateTime startDateTime = DateUtil.parseDate("2024-03-01");
DateTime startDateTime = DateUtil.parseDate("2024-07-20");
DateTime endDateTime = DateUtil.date();
Integer subDay = Integer.parseInt(String.valueOf(DateUtil.betweenDay(startDateTime, endDateTime, false)));
......@@ -187,26 +186,21 @@ public class TestController {
for (int i = 0; i <= subDay; i++) {
DateTime date = DateUtil.offsetDay(startDateTime, i);
boolean weekend = DateUtil.isWeekend(date);
if (weekend) {
if (!weekend) {
//周末 默认数据
for (int j = 0; j <= 23; j++) {
RealtimeDataflowStatEntity statEntity = new RealtimeDataflowStatEntity();
statEntity.initAttrValue();
statEntity.setSiteId(1L);
statEntity.setSiteName("宜宾市民中心");
int randomInt = RandomUtil.randomInt(100, 1000);
for (int j = 0; j <= randomInt; j++) {
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.setCreateTime(date);
realtimeDataflowEntity.setCreateUserName("system");
flowEntities.add(realtimeDataflowEntity);
......@@ -224,7 +218,7 @@ public class TestController {
public static void main(String[] args) throws Exception {
String str="admin";
String str = "admin";
System.out.println(SecurityUtil.md5DoubleEncoding(str));
byte[] md5s = SecurityUtil.getDigest(str, "MD5");
......@@ -243,7 +237,6 @@ public class TestController {
System.out.println(HexUtil.encodeHex(md5s1));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment