Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
谢明辉
/
fanxing3-integration
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit b78d683d
authored
Jun 27, 2022
by
毛树良
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
<fix>:优化日志
1 parent
37dd53e2
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
6 deletions
fanxing-docking-gb1400/src/main/java/com/viontech/handler/TrafficDataConvertHandler.java
fanxing-docking-gb1400/src/main/java/com/viontech/scheduled/TrafficIllegalScheduled.java
fanxing-docking-gb1400/src/main/java/com/viontech/scheduled/TrafficVehicleScheduled.java
fanxing-docking-gb1400/src/main/java/com/viontech/handler/TrafficDataConvertHandler.java
View file @
b78d683
...
@@ -524,7 +524,7 @@ public class TrafficDataConvertHandler {
...
@@ -524,7 +524,7 @@ public class TrafficDataConvertHandler {
ResponseEntity
<
String
>
responseEntity
=
restTemplate
.
getForEntity
(
geturl
,
String
.
class
);
ResponseEntity
<
String
>
responseEntity
=
restTemplate
.
getForEntity
(
geturl
,
String
.
class
);
if
(
responseEntity
.
getStatusCodeValue
()
==
200
)
{
if
(
responseEntity
.
getStatusCodeValue
()
==
200
)
{
String
picget
=
responseEntity
.
getBody
();
String
picget
=
responseEntity
.
getBody
();
log
.
info
(
"图片服务查询[{}],响应videoget={}"
,
pic_unid
,
picget
);
//
log.info("图片服务查询[{}],响应videoget={}", pic_unid, picget);
if
(
StringUtils
.
isNotBlank
(
picget
))
{
if
(
StringUtils
.
isNotBlank
(
picget
))
{
JSONObject
picJson
=
JSONObject
.
parseObject
(
picget
);
JSONObject
picJson
=
JSONObject
.
parseObject
(
picget
);
if
(
picJson
!=
null
&&
StringUtils
.
isNotBlank
(
picJson
.
getString
(
"pic_url"
)))
{
if
(
picJson
!=
null
&&
StringUtils
.
isNotBlank
(
picJson
.
getString
(
"pic_url"
)))
{
...
...
fanxing-docking-gb1400/src/main/java/com/viontech/scheduled/TrafficIllegalScheduled.java
View file @
b78d683
...
@@ -72,8 +72,9 @@ public class TrafficIllegalScheduled {
...
@@ -72,8 +72,9 @@ public class TrafficIllegalScheduled {
trafficQry
.
setEvent_dt__lt
(
event_dt__lt
);
trafficQry
.
setEvent_dt__lt
(
event_dt__lt
);
trafficQry
.
setLimit
(
limit
);
trafficQry
.
setLimit
(
limit
);
trafficQry
.
setOffset
(
offset
);
trafficQry
.
setOffset
(
offset
);
log
.
info
(
"违法查询范围(lastTimeUtc,currentTimeUtc]=({},{}]。"
,
lastTimeUtc
,
currentTimeUtc
);
List
<
Object
>
trafficModels
=
trafficEventService
.
selectJsonDatas
(
trafficQry
);
List
<
Object
>
trafficModels
=
trafficEventService
.
selectJsonDatas
(
trafficQry
);
log
.
info
(
"
查询范围(lastTimeUtc,currentTimeUtc]=({},{}],本批次待同步
数据总{}条。"
,
lastTimeUtc
,
currentTimeUtc
,
trafficModels
.
size
());
log
.
info
(
"
违法查询范围(lastTimeUtc,currentTimeUtc]=({},{}],本批次待同步违法
数据总{}条。"
,
lastTimeUtc
,
currentTimeUtc
,
trafficModels
.
size
());
if
(!
CollectionUtils
.
isEmpty
(
trafficModels
))
{
if
(!
CollectionUtils
.
isEmpty
(
trafficModels
))
{
List
<
TrafficMongoModel
>
trafficMongoModels
=
new
ArrayList
<>();
List
<
TrafficMongoModel
>
trafficMongoModels
=
new
ArrayList
<>();
for
(
Object
model
:
trafficModels
)
{
for
(
Object
model
:
trafficModels
)
{
...
@@ -81,6 +82,7 @@ public class TrafficIllegalScheduled {
...
@@ -81,6 +82,7 @@ public class TrafficIllegalScheduled {
if
(
CheckUtil
.
checkDeviceId
(
trafficModel
))
{
if
(
CheckUtil
.
checkDeviceId
(
trafficModel
))
{
trafficMongoModels
.
add
(
trafficModel
);
trafficMongoModels
.
add
(
trafficModel
);
}
else
{
}
else
{
log
.
info
(
"ill.update.record:{}-{}"
,
trafficModel
.
getId
(),
trafficModel
.
getEvent_dt
());
redisTemplate
.
opsForValue
().
set
(
RedisConstants
.
FANXING_TO_GB1400_LASTTIME
,
trafficModel
.
getEvent_dt
());
redisTemplate
.
opsForValue
().
set
(
RedisConstants
.
FANXING_TO_GB1400_LASTTIME
,
trafficModel
.
getEvent_dt
());
}
}
}
}
...
@@ -90,7 +92,9 @@ public class TrafficIllegalScheduled {
...
@@ -90,7 +92,9 @@ public class TrafficIllegalScheduled {
if
(
subscribeNotificationsObj
!=
null
)
{
if
(
subscribeNotificationsObj
!=
null
)
{
JsonMessage
resultVo
=
gb1400Service
.
subscribeNotifications
(
subscribeNotificationsObj
);
JsonMessage
resultVo
=
gb1400Service
.
subscribeNotifications
(
subscribeNotificationsObj
);
if
(
SystemConstants
.
APP_CODE_SUCCESS
==
resultVo
.
getCode
())
{
if
(
SystemConstants
.
APP_CODE_SUCCESS
==
resultVo
.
getCode
())
{
redisTemplate
.
opsForValue
().
set
(
RedisConstants
.
FANXING_TO_GB1400_LASTTIME
,
trafficMongoModels
.
get
(
trafficMongoModels
.
size
()
-
1
).
getEvent_dt
());
TrafficMongoModel
last
=
trafficMongoModels
.
get
(
trafficMongoModels
.
size
()
-
1
);
log
.
info
(
"ill.update.record:{}-{}"
,
last
.
getId
(),
last
.
getEvent_dt
());
redisTemplate
.
opsForValue
().
set
(
RedisConstants
.
FANXING_TO_GB1400_LASTTIME
,
last
.
getEvent_dt
());
}
}
}
else
{
}
else
{
log
.
error
(
"trafficDataConvertHandler.trafficIllegalToSubscribeNotifications is null"
);
log
.
error
(
"trafficDataConvertHandler.trafficIllegalToSubscribeNotifications is null"
);
...
...
fanxing-docking-gb1400/src/main/java/com/viontech/scheduled/TrafficVehicleScheduled.java
View file @
b78d683
...
@@ -60,7 +60,7 @@ public class TrafficVehicleScheduled {
...
@@ -60,7 +60,7 @@ public class TrafficVehicleScheduled {
}
}
int
offset
=
0
;
int
offset
=
0
;
int
limit
=
10
0
;
int
limit
=
5
0
;
//utc时间,当前时间减8小时
//utc时间,当前时间减8小时
String
event_dt__gte
=
lastTimeUtc
;
String
event_dt__gte
=
lastTimeUtc
;
String
event_dt__lt
=
currentTimeUtc
;
String
event_dt__lt
=
currentTimeUtc
;
...
@@ -72,8 +72,9 @@ public class TrafficVehicleScheduled {
...
@@ -72,8 +72,9 @@ public class TrafficVehicleScheduled {
trafficQry
.
setEvent_dt__lt
(
event_dt__lt
);
trafficQry
.
setEvent_dt__lt
(
event_dt__lt
);
trafficQry
.
setLimit
(
limit
);
trafficQry
.
setLimit
(
limit
);
trafficQry
.
setOffset
(
offset
);
trafficQry
.
setOffset
(
offset
);
log
.
info
(
"过车查询范围(lastTimeUtc,currentTimeUtc]=({},{}]。"
,
lastTimeUtc
,
currentTimeUtc
);
List
<
Object
>
trafficModels
=
trafficEventService
.
selectJsonDatas
(
trafficQry
);
List
<
Object
>
trafficModels
=
trafficEventService
.
selectJsonDatas
(
trafficQry
);
log
.
info
(
"查询范围(lastTimeUtc,currentTimeUtc]=({},{}],本批次待同步过车数据总{}条。"
,
lastTimeUtc
,
currentTimeUtc
,
trafficModels
.
size
());
log
.
info
(
"
过车
查询范围(lastTimeUtc,currentTimeUtc]=({},{}],本批次待同步过车数据总{}条。"
,
lastTimeUtc
,
currentTimeUtc
,
trafficModels
.
size
());
if
(!
CollectionUtils
.
isEmpty
(
trafficModels
))
{
if
(!
CollectionUtils
.
isEmpty
(
trafficModels
))
{
List
<
TrafficMongoModel
>
trafficMongoModels
=
new
ArrayList
<>();
List
<
TrafficMongoModel
>
trafficMongoModels
=
new
ArrayList
<>();
for
(
Object
model
:
trafficModels
)
{
for
(
Object
model
:
trafficModels
)
{
...
@@ -81,6 +82,7 @@ public class TrafficVehicleScheduled {
...
@@ -81,6 +82,7 @@ public class TrafficVehicleScheduled {
if
(
CheckUtil
.
checkDeviceId
(
trafficModel
))
{
if
(
CheckUtil
.
checkDeviceId
(
trafficModel
))
{
trafficMongoModels
.
add
(
trafficModel
);
trafficMongoModels
.
add
(
trafficModel
);
}
else
{
}
else
{
log
.
info
(
"gc.update.record:{}-{}"
,
trafficModel
.
getId
(),
trafficModel
.
getEvent_dt
());
redisTemplate
.
opsForValue
().
set
(
RedisConstants
.
FANXING_TO_GB1400_VEHICLE_LASTTIME
,
trafficModel
.
getEvent_dt
());
redisTemplate
.
opsForValue
().
set
(
RedisConstants
.
FANXING_TO_GB1400_VEHICLE_LASTTIME
,
trafficModel
.
getEvent_dt
());
}
}
}
}
...
@@ -90,7 +92,9 @@ public class TrafficVehicleScheduled {
...
@@ -90,7 +92,9 @@ public class TrafficVehicleScheduled {
if
(
subscribeNotificationsObj
!=
null
)
{
if
(
subscribeNotificationsObj
!=
null
)
{
JsonMessage
resultVo
=
gb1400Service
.
subscribeNotifications
(
subscribeNotificationsObj
);
JsonMessage
resultVo
=
gb1400Service
.
subscribeNotifications
(
subscribeNotificationsObj
);
if
(
SystemConstants
.
APP_CODE_SUCCESS
==
resultVo
.
getCode
())
{
if
(
SystemConstants
.
APP_CODE_SUCCESS
==
resultVo
.
getCode
())
{
redisTemplate
.
opsForValue
().
set
(
RedisConstants
.
FANXING_TO_GB1400_VEHICLE_LASTTIME
,
trafficMongoModels
.
get
(
trafficMongoModels
.
size
()
-
1
).
getEvent_dt
());
TrafficMongoModel
last
=
trafficMongoModels
.
get
(
trafficMongoModels
.
size
()
-
1
);
log
.
info
(
"gc.update.record:{}-{}"
,
last
.
getId
(),
last
.
getEvent_dt
());
redisTemplate
.
opsForValue
().
set
(
RedisConstants
.
FANXING_TO_GB1400_VEHICLE_LASTTIME
,
last
.
getEvent_dt
());
}
}
}
else
{
}
else
{
log
.
error
(
"trafficDataConvertHandler.trafficVehicleToSubscribeNotifications is null"
);
log
.
error
(
"trafficDataConvertHandler.trafficVehicleToSubscribeNotifications is null"
);
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment