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

修改消费海康回调函数

parent 51789065
...@@ -111,7 +111,7 @@ public class TestController { ...@@ -111,7 +111,7 @@ public class TestController {
public String mockStatData() { public String mockStatData() {
ArrayList<RealtimeDataflowStatEntity> statEntities = new ArrayList<>(); ArrayList<RealtimeDataflowStatEntity> statEntities = new ArrayList<>();
//模拟构造过去人流数据 //模拟构造过去人流数据
DateTime startDateTime = DateUtil.parseDate("2023-03-01"); DateTime startDateTime = DateUtil.parseDate("2024-07-20");
DateTime endDateTime = DateUtil.date(); DateTime endDateTime = DateUtil.date();
Integer subDay = Integer.parseInt(String.valueOf(DateUtil.betweenDay(startDateTime, endDateTime, false))); Integer subDay = Integer.parseInt(String.valueOf(DateUtil.betweenDay(startDateTime, endDateTime, false)));
...@@ -143,7 +143,7 @@ public class TestController { ...@@ -143,7 +143,7 @@ public class TestController {
statEntity.initAttrValue(); statEntity.initAttrValue();
statEntity.setSiteId(1L); statEntity.setSiteId(1L);
statEntity.setSiteName("宜宾市民中心"); statEntity.setSiteName("宜宾市民中心");
if(j>8&&j<18){ if (j > 8 && j < 18) {
//随机500~1200人 //随机500~1200人
int total = RandomUtil.randomInt(400, 1200); int total = RandomUtil.randomInt(400, 1200);
statEntity.setPersonSum(total); statEntity.setPersonSum(total);
...@@ -173,13 +173,12 @@ public class TestController { ...@@ -173,13 +173,12 @@ public class TestController {
} }
@GetMapping("mockFlowData") @GetMapping("mockFlowData")
@UnAuth @UnAuth
public String mockFlowData() { public String mockFlowData() {
List<RealtimeDataflowEntity> flowEntities = new ArrayList<>(); List<RealtimeDataflowEntity> flowEntities = new ArrayList<>();
//模拟构造过去人流数据 //模拟构造过去人流数据
DateTime startDateTime = DateUtil.parseDate("2024-03-01"); DateTime startDateTime = DateUtil.parseDate("2024-07-20");
DateTime endDateTime = DateUtil.date(); DateTime endDateTime = DateUtil.date();
Integer subDay = Integer.parseInt(String.valueOf(DateUtil.betweenDay(startDateTime, endDateTime, false))); Integer subDay = Integer.parseInt(String.valueOf(DateUtil.betweenDay(startDateTime, endDateTime, false)));
...@@ -187,26 +186,21 @@ public class TestController { ...@@ -187,26 +186,21 @@ public class TestController {
for (int i = 0; i <= subDay; i++) { for (int i = 0; i <= subDay; i++) {
DateTime date = DateUtil.offsetDay(startDateTime, i); DateTime date = DateUtil.offsetDay(startDateTime, i);
boolean weekend = DateUtil.isWeekend(date); boolean weekend = DateUtil.isWeekend(date);
if (weekend) { if (!weekend) {
//周末 默认数据 //周末 默认数据
for (int j = 0; j <= 23; j++) { int randomInt = RandomUtil.randomInt(100, 1000);
RealtimeDataflowStatEntity statEntity = new RealtimeDataflowStatEntity(); for (int j = 0; j <= randomInt; j++) {
statEntity.initAttrValue();
statEntity.setSiteId(1L);
statEntity.setSiteName("宜宾市民中心");
RealtimeDataflowEntity realtimeDataflowEntity = new RealtimeDataflowEntity(); RealtimeDataflowEntity realtimeDataflowEntity = new RealtimeDataflowEntity();
realtimeDataflowEntity.initAttrValue(); realtimeDataflowEntity.initAttrValue();
realtimeDataflowEntity.setSiteId(1L); realtimeDataflowEntity.setSiteId(1L);
realtimeDataflowEntity.setSiteName("宜宾市民中心"); realtimeDataflowEntity.setSiteName("宜宾市民中心");
realtimeDataflowEntity.setDetectTime(DateUtil.offsetHour(date, j));
realtimeDataflowEntity.setDevice(RandomUtil.randomString(10)); realtimeDataflowEntity.setDevice(RandomUtil.randomString(10));
realtimeDataflowEntity.setPicUri(""); realtimeDataflowEntity.setPicUri("");
realtimeDataflowEntity.setEventId(RandomUtil.randomString(10)); realtimeDataflowEntity.setEventId(RandomUtil.randomString(10));
realtimeDataflowEntity.setEventType(HikEventTypeEnum.陌生人员识别事件.getValue().longValue()); realtimeDataflowEntity.setEventType(HikEventTypeEnum.陌生人员识别事件.getValue().longValue());
realtimeDataflowEntity.setCreateUserId(1L); realtimeDataflowEntity.setCreateUserId(1L);
realtimeDataflowEntity.setCreateTime(DateUtil.offsetHour(date, j)); realtimeDataflowEntity.setCreateTime(date);
realtimeDataflowEntity.setCreateUserName("system"); realtimeDataflowEntity.setCreateUserName("system");
flowEntities.add(realtimeDataflowEntity); flowEntities.add(realtimeDataflowEntity);
...@@ -224,7 +218,7 @@ public class TestController { ...@@ -224,7 +218,7 @@ public class TestController {
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
String str="admin"; String str = "admin";
System.out.println(SecurityUtil.md5DoubleEncoding(str)); System.out.println(SecurityUtil.md5DoubleEncoding(str));
byte[] md5s = SecurityUtil.getDigest(str, "MD5"); byte[] md5s = SecurityUtil.getDigest(str, "MD5");
...@@ -243,7 +237,6 @@ public class TestController { ...@@ -243,7 +237,6 @@ public class TestController {
System.out.println(HexUtil.encodeHex(md5s1)); 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