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 74a32d0b
authored
May 16, 2022
by
毛树良
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
<fix>:优化推送
1 parent
44712769
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
91 additions
and
54 deletions
fanxing-docking-gb1400/src/main/java/com/viontech/scheduled/DeviceSyncScheduled.java
fanxing-docking-gb1400/src/main/java/com/viontech/scheduled/LaneSyncScheduled.java
fanxing-docking-gb1400/src/main/java/com/viontech/scheduled/TollgateSyncScheduled.java
fanxing-docking-gb1400/src/main/java/com/viontech/scheduled/DeviceSyncScheduled.java
View file @
74a32d0
...
...
@@ -59,26 +59,39 @@ public class DeviceSyncScheduled {
return
;
}
//查询
DeviceModel
deviceQry
=
new
DeviceModel
();
deviceQry
.
setModifyTime_gte
(
lastTimeUtc
);
deviceQry
.
setModifyTime_lte
(
currentTimeUtc
);
deviceQry
.
setOffset
(
0
);
deviceQry
.
setLimit
(
20
);
List
<
DeviceModel
>
deviceModels
=
trafficEventService
.
selectDeviceDatas
(
deviceQry
);
log
.
info
(
"查询范围(lastTimeUtc,currentTimeUtc]=({},{}],本批次设备待同步数据总{}条。"
,
lastTimeUtc
,
currentTimeUtc
,
deviceModels
.
size
());
if
(!
CollectionUtils
.
isEmpty
(
deviceModels
))
{
//List<DeviceModel> 转 SubscribeNotificationsObj
SubscribeNotificationsObj
subscribeNotificationsObj
=
trafficDataConvertHandler
.
deviceToSubscribeNotifications
(
deviceModels
);
//将设备数据同步gb1400
if
(
subscribeNotificationsObj
!=
null
)
{
JsonMessage
resultVo
=
gb1400Service
.
subscribeNotifications
(
subscribeNotificationsObj
);
if
(
SystemConstants
.
APP_CODE_SUCCESS
==
resultVo
.
getCode
())
{
redisTemplate
.
opsForValue
().
set
(
RedisConstants
.
FANXING_TO_GB1400_DEVICE_LASTTIME
,
DateUtil
.
formatDate
(
deviceModels
.
get
(
deviceModels
.
size
()
-
1
).
getModifyTime
(),
DateUtil
.
TIMESTAMP_FORMAT
));
int
offset
=
0
;
int
limit
=
20
;
int
selectSize
=
0
;
int
num
=
0
;
do
{
DeviceModel
deviceQry
=
new
DeviceModel
();
deviceQry
.
setModifyTime_gte
(
lastTimeUtc
);
deviceQry
.
setModifyTime_lte
(
currentTimeUtc
);
deviceQry
.
setOffset
(
offset
);
deviceQry
.
setLimit
(
limit
);
List
<
DeviceModel
>
deviceModels
=
trafficEventService
.
selectDeviceDatas
(
deviceQry
);
selectSize
=
deviceModels
.
size
();
num
=
num
+
1
;
offset
=
limit
*
num
;
log
.
info
(
"查询范围(lastTimeUtc,currentTimeUtc]=({},{}],本批次设备待同步数据总{}条。"
,
lastTimeUtc
,
currentTimeUtc
,
deviceModels
.
size
());
if
(!
CollectionUtils
.
isEmpty
(
deviceModels
))
{
//List<DeviceModel> 转 SubscribeNotificationsObj
SubscribeNotificationsObj
subscribeNotificationsObj
=
trafficDataConvertHandler
.
deviceToSubscribeNotifications
(
deviceModels
);
//将设备数据同步gb1400
if
(
subscribeNotificationsObj
!=
null
)
{
JsonMessage
resultVo
=
gb1400Service
.
subscribeNotifications
(
subscribeNotificationsObj
);
if
(
SystemConstants
.
APP_CODE_SUCCESS
==
resultVo
.
getCode
())
{
Date
lastDataUtc
=
DateUtil
.
addHours
(
deviceModels
.
get
(
deviceModels
.
size
()
-
1
).
getModifyTime
(),
-
8
);
redisTemplate
.
opsForValue
().
set
(
RedisConstants
.
FANXING_TO_GB1400_DEVICE_LASTTIME
,
DateUtil
.
formatDate
(
lastDataUtc
,
DateUtil
.
TIMESTAMP_FORMAT
));
}
else
{
log
.
error
(
"trafficDataConvertHandler.deviceToSubscribeNotifications.failed=(offset,limit)=({},{})"
,
offset
,
limit
);
}
}
else
{
log
.
error
(
"trafficDataConvertHandler.deviceToSubscribeNotifications is null"
);
}
}
else
{
log
.
error
(
"trafficDataConvertHandler.deviceToSubscribeNotifications is null"
);
}
}
}
while
(
selectSize
>=
limit
);
log
.
info
(
"结束处理设备数据"
);
}
}
fanxing-docking-gb1400/src/main/java/com/viontech/scheduled/LaneSyncScheduled.java
View file @
74a32d0
...
...
@@ -59,26 +59,38 @@ public class LaneSyncScheduled {
return
;
}
//查询
LaneModel
laneQry
=
new
LaneModel
();
laneQry
.
setModifyTime_gte
(
lastTimeUtc
);
laneQry
.
setModifyTime_lte
(
currentTimeUtc
);
laneQry
.
setOffset
(
0
);
laneQry
.
setLimit
(
20
);
List
<
LaneModel
>
laneModels
=
trafficEventService
.
selectLaneDatas
(
laneQry
);
log
.
info
(
"查询范围(lastTimeUtc,currentTimeUtc]=({},{}],本批次车道待同步数据总{}条。"
,
lastTimeUtc
,
currentTimeUtc
,
laneModels
.
size
());
if
(!
CollectionUtils
.
isEmpty
(
laneModels
))
{
//List<LaneModel> 转 SubscribeNotificationsObj
SubscribeNotificationsObj
subscribeNotificationsObj
=
trafficDataConvertHandler
.
laneToSubscribeNotifications
(
laneModels
);
//将车道数据同步gb1400
if
(
subscribeNotificationsObj
!=
null
)
{
JsonMessage
resultVo
=
gb1400Service
.
subscribeNotifications
(
subscribeNotificationsObj
);
if
(
SystemConstants
.
APP_CODE_SUCCESS
==
resultVo
.
getCode
())
{
redisTemplate
.
opsForValue
().
set
(
RedisConstants
.
FANXING_TO_GB1400_LANE_LASTTIME
,
DateUtil
.
formatDate
(
laneModels
.
get
(
laneModels
.
size
()
-
1
).
getModifyTime
(),
DateUtil
.
TIMESTAMP_FORMAT
));
int
offset
=
0
;
int
limit
=
20
;
int
selectSize
=
0
;
int
num
=
0
;
do
{
LaneModel
laneQry
=
new
LaneModel
();
laneQry
.
setModifyTime_gte
(
lastTimeUtc
);
laneQry
.
setModifyTime_lte
(
currentTimeUtc
);
laneQry
.
setOffset
(
offset
);
laneQry
.
setLimit
(
limit
);
List
<
LaneModel
>
laneModels
=
trafficEventService
.
selectLaneDatas
(
laneQry
);
selectSize
=
laneModels
.
size
();
num
=
num
+
1
;
offset
=
limit
*
num
;
log
.
info
(
"查询范围(lastTimeUtc,currentTimeUtc]=({},{}],本批次车道待同步数据总{}条。"
,
lastTimeUtc
,
currentTimeUtc
,
laneModels
.
size
());
if
(!
CollectionUtils
.
isEmpty
(
laneModels
))
{
//List<LaneModel> 转 SubscribeNotificationsObj
SubscribeNotificationsObj
subscribeNotificationsObj
=
trafficDataConvertHandler
.
laneToSubscribeNotifications
(
laneModels
);
//将车道数据同步gb1400
if
(
subscribeNotificationsObj
!=
null
)
{
JsonMessage
resultVo
=
gb1400Service
.
subscribeNotifications
(
subscribeNotificationsObj
);
if
(
SystemConstants
.
APP_CODE_SUCCESS
==
resultVo
.
getCode
())
{
Date
lastDataUtc
=
DateUtil
.
addHours
(
laneModels
.
get
(
laneModels
.
size
()
-
1
).
getModifyTime
(),
-
8
);
redisTemplate
.
opsForValue
().
set
(
RedisConstants
.
FANXING_TO_GB1400_LANE_LASTTIME
,
DateUtil
.
formatDate
(
lastDataUtc
,
DateUtil
.
TIMESTAMP_FORMAT
));
}
else
{
log
.
error
(
"trafficDataConvertHandler.laneToSubscribeNotifications.failed=(offset,limit)=({},{})"
,
offset
,
limit
);
}
}
else
{
log
.
error
(
"trafficDataConvertHandler.laneToSubscribeNotifications is null"
);
}
}
else
{
log
.
error
(
"trafficDataConvertHandler.laneToSubscribeNotifications is null"
);
}
}
}
while
(
selectSize
>=
limit
);
log
.
info
(
"结束处理车道数据"
);
}
}
fanxing-docking-gb1400/src/main/java/com/viontech/scheduled/TollgateSyncScheduled.java
View file @
74a32d0
...
...
@@ -60,26 +60,38 @@ public class TollgateSyncScheduled {
return
;
}
//查询
TollgateModel
tollgateQry
=
new
TollgateModel
();
tollgateQry
.
setModifyTime_gte
(
lastTimeUtc
);
tollgateQry
.
setModifyTime_lte
(
currentTimeUtc
);
tollgateQry
.
setOffset
(
0
);
tollgateQry
.
setLimit
(
20
);
List
<
TollgateModel
>
tollgateModels
=
trafficEventService
.
selectTollgateDatas
(
tollgateQry
);
log
.
info
(
"查询范围(lastTimeUtc,currentTimeUtc]=({},{}],本批次卡口待同步数据总{}条。"
,
lastTimeUtc
,
currentTimeUtc
,
tollgateModels
.
size
());
if
(!
CollectionUtils
.
isEmpty
(
tollgateModels
))
{
//List<TollgateModel> 转 SubscribeNotificationsObj
SubscribeNotificationsObj
subscribeNotificationsObj
=
trafficDataConvertHandler
.
tollgateToSubscribeNotifications
(
tollgateModels
);
//将卡口数据同步gb1400
if
(
subscribeNotificationsObj
!=
null
)
{
JsonMessage
resultVo
=
gb1400Service
.
subscribeNotifications
(
subscribeNotificationsObj
);
if
(
SystemConstants
.
APP_CODE_SUCCESS
==
resultVo
.
getCode
())
{
redisTemplate
.
opsForValue
().
set
(
RedisConstants
.
FANXING_TO_GB1400_KAKOU_LASTTIME
,
DateUtil
.
formatDate
(
tollgateModels
.
get
(
tollgateModels
.
size
()
-
1
).
getModifyTime
(),
DateUtil
.
TIMESTAMP_FORMAT
));
int
offset
=
0
;
int
limit
=
20
;
int
selectSize
=
0
;
int
num
=
0
;
do
{
TollgateModel
tollgateQry
=
new
TollgateModel
();
tollgateQry
.
setModifyTime_gte
(
lastTimeUtc
);
tollgateQry
.
setModifyTime_lte
(
currentTimeUtc
);
tollgateQry
.
setOffset
(
offset
);
tollgateQry
.
setLimit
(
limit
);
List
<
TollgateModel
>
tollgateModels
=
trafficEventService
.
selectTollgateDatas
(
tollgateQry
);
selectSize
=
tollgateModels
.
size
();
num
=
num
+
1
;
offset
=
limit
*
num
;
log
.
info
(
"查询范围(lastTimeUtc,currentTimeUtc]=({},{}],本批次卡口待同步数据总{}条。"
,
lastTimeUtc
,
currentTimeUtc
,
tollgateModels
.
size
());
if
(!
CollectionUtils
.
isEmpty
(
tollgateModels
))
{
//List<TollgateModel> 转 SubscribeNotificationsObj
SubscribeNotificationsObj
subscribeNotificationsObj
=
trafficDataConvertHandler
.
tollgateToSubscribeNotifications
(
tollgateModels
);
//将卡口数据同步gb1400
if
(
subscribeNotificationsObj
!=
null
)
{
JsonMessage
resultVo
=
gb1400Service
.
subscribeNotifications
(
subscribeNotificationsObj
);
if
(
SystemConstants
.
APP_CODE_SUCCESS
==
resultVo
.
getCode
())
{
Date
lastDataUtc
=
DateUtil
.
addHours
(
tollgateModels
.
get
(
tollgateModels
.
size
()
-
1
).
getModifyTime
(),
-
8
);
redisTemplate
.
opsForValue
().
set
(
RedisConstants
.
FANXING_TO_GB1400_KAKOU_LASTTIME
,
DateUtil
.
formatDate
(
lastDataUtc
,
DateUtil
.
TIMESTAMP_FORMAT
));
}
else
{
log
.
error
(
"trafficDataConvertHandler.tollgateToSubscribeNotifications.failed=(offset,limit)=({},{})"
,
offset
,
limit
);
}
}
else
{
log
.
error
(
"trafficDataConvertHandler.tollgateToSubscribeNotifications is null"
);
}
}
else
{
log
.
error
(
"trafficDataConvertHandler.tollgateToSubscribeNotifications is null"
);
}
}
}
while
(
selectSize
>=
limit
);
log
.
info
(
"结束处理卡口数据"
);
}
}
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