Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hzjtpushdateService
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
建金
hzjtpushdateService
Commits
4b4847d9
Commit
4b4847d9
authored
Mar 31, 2021
by
wangjinjing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
videoid
parent
5aa5aa09
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
24 deletions
+52
-24
src/main/java/com/hzjt/HZJTApplication.java
src/main/java/com/hzjt/HZJTApplication.java
+1
-1
src/main/java/com/hzjt/controller/TraffController.java
src/main/java/com/hzjt/controller/TraffController.java
+31
-12
src/main/resources/application.properties
src/main/resources/application.properties
+20
-11
No files found.
src/main/java/com/hzjt/HZJTApplication.java
View file @
4b4847d9
...
...
@@ -17,7 +17,7 @@ import org.springframework.data.redis.listener.adapter.MessageListenerAdapter;
@SpringBootApplication
@ServletComponentScan
@MapperScan
(
"com.hzjt.mapper"
)
@PropertySource
(
"file:${spring.profiles.path}"
)
//
@PropertySource("file:${spring.profiles.path}")
public
class
HZJTApplication
{
@Bean
RedisMessageListenerContainer
container
(
RedisConnectionFactory
connectionFactory
,
MessageListenerAdapter
listenerAdapterSingle
,
MessageListenerAdapter
listenerAdapterList
)
{
...
...
src/main/java/com/hzjt/controller/TraffController.java
View file @
4b4847d9
...
...
@@ -121,7 +121,7 @@ public class TraffController {
}
String
videoId
=
trffClientMessage
.
getVideo_id
();
if
(
StringUtils
.
isBlank
(
videoId
)
||
!
videoId
.
contains
(
"_"
)
||
videoId
.
split
(
"_"
).
length
!=
2
)
{
if
(
StringUtils
.
isBlank
(
videoId
))
{
// log.info("video_id值异常 值为:" + videoId);
return
ResultObj
.
error
(
ResponseEnum
.
E_1002
.
getCode
(),
"video_id值异常 值为:"
+
videoId
);
}
...
...
@@ -130,10 +130,16 @@ public class TraffController {
// log.info("[事件推送]->设备" + videoId + "-推送已达到限流限制");
return
ResultObj
.
error
(
ResponseEnum
.
E_9999
.
getCode
(),
"设备"
+
videoId
+
"请求过于频繁"
);
}
String
[]
sbAndTd
=
videoId
.
split
(
"_"
);
String
sbbh
=
sbAndTd
[
0
];
int
tdbh
=
Integer
.
valueOf
(
sbAndTd
[
1
])
+
1
;
String
sbbh
=
""
;
int
tdbh
=
0
;
if
(
videoId
.
contains
(
"_"
)
&&
videoId
.
split
(
"_"
).
length
==
2
)
{
String
[]
sbAndTd
=
videoId
.
split
(
"_"
);
sbbh
=
sbAndTd
[
0
];
tdbh
=
Integer
.
valueOf
(
sbAndTd
[
1
])
+
1
;
}
else
{
sbbh
=
videoId
;
}
List
<
Sbtdspsr
>
sbtdspsrs
=
sbtdspsrMapper
.
selectBySbbh
(
sbbh
,
tdbh
);
if
(
sbtdspsrs
.
isEmpty
())
{
...
...
@@ -165,9 +171,15 @@ public class TraffController {
traffAlarmRecord
.
setAreaid
(
Long
.
valueOf
(
trffClientMessage
.
getDept
()));
traffAlarmRecord
.
setRecordtype
(
trffClientMessage
.
getIncident_type
().
toLowerCase
());
traffAlarmRecord
.
setRecordtime
(
new
Date
(
Long
.
valueOf
(
trffClientMessage
.
getTs
())));
String
[]
videoIdArr
=
trffClientMessage
.
getVideo_id
().
split
(
"_"
);
traffAlarmRecord
.
setFdid
(
videoIdArr
[
0
]);
Integer
channelid
=
Integer
.
valueOf
(
videoIdArr
[
1
])
+
1
;
Integer
channelid
=
0
;
if
(
trffClientMessage
.
getVideo_id
().
contains
(
"_"
)&&
trffClientMessage
.
getVideo_id
().
split
(
"_"
).
length
==
2
)
{
String
[]
videoIdArr
=
trffClientMessage
.
getVideo_id
().
split
(
"_"
);
traffAlarmRecord
.
setFdid
(
videoIdArr
[
0
]);
channelid
=
Integer
.
valueOf
(
videoIdArr
[
1
])
+
1
;
}
else
{
traffAlarmRecord
.
setFdid
(
trffClientMessage
.
getVideo_id
());
}
traffAlarmRecord
.
setChannelid
(
channelid
);
//判断是否在正检时间内
...
...
@@ -323,7 +335,7 @@ public class TraffController {
rateLimiter
=
rateLimiterMap
.
get
(
videoId
);
}
else
{
RateLimiter
value
=
RateLimiter
.
create
(
rate
);
rateLimiter
=
rateLimiterMap
.
putIfAbsent
(
videoId
,
value
);
rateLimiter
=
rateLimiterMap
.
putIfAbsent
(
videoId
,
value
);
if
(
rateLimiter
==
null
)
{
rateLimiter
=
value
;
}
...
...
@@ -337,9 +349,16 @@ public class TraffController {
public
ResultObj
traffflow
(
@RequestBody
Vehicles
vehicles
)
{
if
(
"TRAFFIC_STATISTICS_VEHICLES"
.
equalsIgnoreCase
(
vehicles
.
getType
()))
{
String
[]
sbAndTd
=
vehicles
.
getVideo_id
().
split
(
"_"
);
String
sbbh
=
sbAndTd
[
0
];
int
tdbh
=
Integer
.
valueOf
(
sbAndTd
[
1
])
+
1
;
String
sbbh
=
""
;
int
tdbh
=
0
;
if
(
vehicles
.
getVideo_id
().
contains
(
"_"
))
{
String
[]
sbAndTd
=
vehicles
.
getVideo_id
().
split
(
"_"
);
sbbh
=
sbAndTd
[
0
];
tdbh
=
Integer
.
valueOf
(
sbAndTd
[
1
])
+
1
;
}
else
{
sbbh
=
vehicles
.
getVideo_id
();
}
//重置videoid
vehicles
.
setVideo_id
(
sbbh
+
"_"
+
tdbh
);
//直接放入表中
...
...
src/main/resources/application.properties
View file @
4b4847d9
...
...
@@ -29,12 +29,12 @@ mybatis.configuration.default-statement-timeout=3000
#spring.datasource.dbcp2.connection-properties=characterEncoding=utf8
# Mysql���ݿ�-����Դ����
spring.datasource.username
=
test
spring.datasource.password
=
test
spring.datasource.url
=
jdbc:oracle:thin:@192.168.168.212:1523:helowin
#
spring.datasource.username=hzjt
#
spring.datasource.password=hzjt
#spring.datasource.url=jdbc:oracle:thin:@33.50.1.22
:1521:orcl
#
spring.datasource.username=test
#
spring.datasource.password=test
#
spring.datasource.url=jdbc:oracle:thin:@192.168.168.212:1523:helowin
spring.datasource.username
=
hzjt
spring.datasource.password
=
hzjt
spring.datasource.url
=
jdbc:oracle:thin:@33.65.219.103
:1521:orcl
spring.datasource.driverClassName
=
oracle.jdbc.OracleDriver
# druid
spring.datasource.type
=
com.alibaba.druid.pool.DruidDataSource
...
...
@@ -62,7 +62,7 @@ spring.datasource.useGlobalDataSourceStat=true
#redis
# Redis��������ַ
spring.redis.host
=
127.0.0.1
spring.redis.host
=
33.65.219.103
# Redis���������Ӷ˿�
spring.redis.port
=
6379
# Redis�������������루Ĭ��Ϊ�գ�
...
...
@@ -81,12 +81,12 @@ spring.redis.pool.min-idle=0
spring.redis.timeout
=
2000
#spring-session ʹ��
spring.session.store-type
=
none
ip.host
=
33.
57.1.22
ip.host
=
33.
65.219.103
port
=
21
message.dept
=
33030
message.rate
=
10
ftp.host
=
33.
50.1.22:21:reader:reader
ftp.host
=
33.
65.219.103:21:hzjt:1qaz2wsx
alarm.subscribe.data.key
=
gs:traff:alarmlist
...
...
@@ -94,7 +94,7 @@ alarm.subscribe.data.key=gs:traff:alarmlist
alarmrecord.check.enable
=
1
#spring.profiles.path= D:/imp/config/im/hzjt.properties
spring.profiles.path
=
D:/hzjt_service/imp/config/im/hzjt.properties
#
spring.profiles.path= D:/hzjt_service/imp/config/im/hzjt.properties
spring.redis.cachekey.ftplist
=
gs:traff:global:cache:ftplist
qingzhi.redis.token
=
gs:traff:qingzhi:token
qingzhi.devicewrite.url
=
http://33.50.1.213:38080/api/jtldpt/impld/deviceWrite
...
...
@@ -107,4 +107,13 @@ mybatis.mapper-locations=classpath:mapper/*.xml
spring.mvc.throw-exception-if-no-handler-found
=
true
spring.resources.add-mappings
=
true
gs.traff.cloud.web.fileagent.url
=
ftp://reader:reader@33.50.1.22:21/gstraff/
jms.queueName
=
demo_queue
\ No newline at end of file
jms.queueName
=
demo_queue
alarmrecord.check.push.enable
=
1
alarmrecord.check.push.recordtype
=
1
flv.resisvalue
=
flvvalue
json.resisurl
=
http://33.50.1.21:57081/record/ecvs
flv.url
=
http://33.50.1.21:57080/ecvs/get_play_list
qingzhi.login.username
=
zksy
qingzhi.login.password
=
zksy@123
qingzhi.login.url
=
http://33.50.1.213:38080/api/auth/login
qingzhi.login.keepaliveurl
=
http://33.50.1.213:38080/api/auth/token/keepalive
\ No newline at end of file
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