Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-task-sxj
This project
Loading...
Sign in
Toggle navigation
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 31a3ab46
authored
Apr 02, 2026
by
范富荣
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改出围栏预警逻辑,新增围栏名称
1 parent
ac256a27
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
9 deletions
src/main/java/cn/com/glsx/schedulerjob/task/modules/service/AlarmJobService.java
src/main/java/cn/com/glsx/schedulerjob/task/modules/service/QyproAdminApiFacade.java
src/test/java/cn/com/glsx/schedulerjob/task/modules/service/AlarmJobServiceTest.java
src/main/java/cn/com/glsx/schedulerjob/task/modules/service/AlarmJobService.java
View file @
31a3ab4
...
@@ -2,9 +2,7 @@ package cn.com.glsx.schedulerjob.task.modules.service;
...
@@ -2,9 +2,7 @@ package cn.com.glsx.schedulerjob.task.modules.service;
import
cn.com.glsx.alarm.api.AlarmFeignClient
;
import
cn.com.glsx.alarm.api.AlarmFeignClient
;
import
cn.com.glsx.alarm.api.StuJudgeAlarmFeignClient
;
import
cn.com.glsx.alarm.api.StuJudgeAlarmFeignClient
;
import
cn.com.glsx.alarm.services.model.CommonAlarmBo
;
import
cn.com.glsx.alarm.services.model.*
;
import
cn.com.glsx.alarm.services.model.CommonAlarmDto
;
import
cn.com.glsx.alarm.services.model.StuJudgeAlarmBo
;
import
cn.com.glsx.alarm.services.model.StuJudgeAlarmDto
;
import
cn.com.glsx.alarm.services.model.StuJudgeAlarmDto
;
import
cn.com.glsx.devicemonitor.api.dto.LngLatDTO
;
import
cn.com.glsx.devicemonitor.api.dto.LngLatDTO
;
import
cn.com.glsx.devicemonitor.api.dto.TrackPointDTO
;
import
cn.com.glsx.devicemonitor.api.dto.TrackPointDTO
;
...
@@ -405,6 +403,7 @@ public class AlarmJobService {
...
@@ -405,6 +403,7 @@ public class AlarmJobService {
List
<
VehicleDto
>
list
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
vehicleDtoList
),
VehicleDto
.
class
);
List
<
VehicleDto
>
list
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
vehicleDtoList
),
VehicleDto
.
class
);
list
.
forEach
(
x
->
{
list
.
forEach
(
x
->
{
String
sn
=
x
.
getSn
();
String
sn
=
x
.
getSn
();
//String sn = "1510922145";
//查询思享驾设备轨迹数据
//查询思享驾设备轨迹数据
TrackPointRequestDTO
trackPointRequestDTO
=
new
TrackPointRequestDTO
();
TrackPointRequestDTO
trackPointRequestDTO
=
new
TrackPointRequestDTO
();
trackPointRequestDTO
.
setSn
(
sn
);
trackPointRequestDTO
.
setSn
(
sn
);
...
@@ -628,13 +627,15 @@ public class AlarmJobService {
...
@@ -628,13 +627,15 @@ public class AlarmJobService {
date
=
DateUtil
.
formatDate
(
new
Date
());
date
=
DateUtil
.
formatDate
(
new
Date
());
}
}
R
<
List
<
Integer
>>
sxjCreatedIds
=
vehicleDeviceClient
.
getSXJCreatedIds
();
R
<
List
<
Integer
>>
sxjCreatedIds
=
vehicleDeviceClient
.
getSXJCreatedIds
();
List
<
Integer
>
createdIds
=
sxjCreatedIds
.
getDataList
(
Integer
.
class
);
List
<
Integer
>
createdIds
=
sxjCreatedIds
.
getDataList
(
new
TypeToken
<
List
<
Integer
>>()
{
}.
getType
());
if
(
CollectionUtils
.
isEmpty
(
createdIds
))
{
if
(
CollectionUtils
.
isEmpty
(
createdIds
))
{
log
.
info
(
"根据思享驾租户id查询到的用户id列表为空"
);
log
.
info
(
"根据思享驾租户id查询到的用户id列表为空"
);
return
;
return
;
}
}
Integer
pageNum
=
1
;
Integer
pageNum
=
1
;
Integer
pageSize
=
Integer
.
valueOf
(
PropertiesUtils
.
getProperty
(
"sixiangjia.pageSize"
,
"100"
));
Integer
pageSize
=
Integer
.
valueOf
(
PropertiesUtils
.
getProperty
(
"sixiangjia.pageSize"
,
"100"
));
String
fenceName
=
PropertiesUtils
.
getProperty
(
"sixiangjia.fenceName"
,
"出围栏预警"
);
while
(
true
)
{
while
(
true
)
{
R
<
PageInfo
<
FenceAlarmItem
>>
pageInfoR
=
vehicleDeviceClient
.
listAlarmElectricFence
(
createdIds
,
pageNum
,
pageSize
);
R
<
PageInfo
<
FenceAlarmItem
>>
pageInfoR
=
vehicleDeviceClient
.
listAlarmElectricFence
(
createdIds
,
pageNum
,
pageSize
);
if
(!
pageInfoR
.
isSuccess
())
{
if
(!
pageInfoR
.
isSuccess
())
{
...
@@ -655,6 +656,8 @@ public class AlarmJobService {
...
@@ -655,6 +656,8 @@ public class AlarmJobService {
x
.
setTime
((
int
)
x
.
getAlarmTime
().
getTime
());
x
.
setTime
((
int
)
x
.
getAlarmTime
().
getTime
());
}
}
x
.
setIsAlarm
(
1
);
x
.
setIsAlarm
(
1
);
x
.
setFenceName
(
fenceName
);
//x.setVinNumber("LYVWGG2D0TL005375");
try
{
try
{
qyproAdminApiFacade
.
syncDeviceWarningContent
(
qyproAdminApiFacade
.
syncDeviceWarningContent
(
x
.
getId
(),
x
.
getId
(),
...
@@ -680,7 +683,8 @@ public class AlarmJobService {
...
@@ -680,7 +683,8 @@ public class AlarmJobService {
date
=
DateUtil
.
formatDate
(
now
);
date
=
DateUtil
.
formatDate
(
now
);
}
}
R
<
List
<
Integer
>>
sxjCreatedIds
=
vehicleDeviceClient
.
getSXJCreatedIds
();
R
<
List
<
Integer
>>
sxjCreatedIds
=
vehicleDeviceClient
.
getSXJCreatedIds
();
List
<
Integer
>
createdIds
=
sxjCreatedIds
.
getDataList
(
Integer
.
class
);
List
<
Integer
>
createdIds
=
sxjCreatedIds
.
getDataList
(
new
TypeToken
<
List
<
Integer
>>()
{
}.
getType
());
if
(
CollectionUtils
.
isEmpty
(
createdIds
))
{
if
(
CollectionUtils
.
isEmpty
(
createdIds
))
{
log
.
info
(
"根据思享驾租户id查询到的用户id列表为空"
);
log
.
info
(
"根据思享驾租户id查询到的用户id列表为空"
);
return
;
return
;
...
@@ -704,12 +708,14 @@ public class AlarmJobService {
...
@@ -704,12 +708,14 @@ public class AlarmJobService {
List
<
OfflineAlarmInfo
>
offlineAlarmList
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
rawList
),
OfflineAlarmInfo
.
class
);
List
<
OfflineAlarmInfo
>
offlineAlarmList
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
rawList
),
OfflineAlarmInfo
.
class
);
parseOfficeGpsAndBs
(
offlineAlarmList
);
parseOfficeGpsAndBs
(
offlineAlarmList
);
for
(
OfflineAlarmInfo
offlineAlarmInfo
:
offlineAlarmList
)
{
for
(
OfflineAlarmInfo
offlineAlarmInfo
:
offlineAlarmList
)
{
//Date lastTime = offlineAlarmInfo.getLastGpsTime() == null ? offlineAlarmInfo.getLastBsTime() : offlineAlarmInfo.getLastGpsTime();
Date
lastTime
=
offlineAlarmInfo
.
getLastGpsTime
();
if
(
lastTime
==
null
)
{
continue
;
}
offlineAlarmInfo
.
setMessDataType
(
"46"
);
offlineAlarmInfo
.
setMessDataType
(
"46"
);
Date
lastTime
=
offlineAlarmInfo
.
getLastGpsTime
()
==
null
?
offlineAlarmInfo
.
getLastBsTime
()
:
offlineAlarmInfo
.
getLastGpsTime
();
offlineAlarmInfo
.
setTime
(
lastTime
);
offlineAlarmInfo
.
setTime
(
lastTime
);
if
(
lastTime
!=
null
)
{
offlineAlarmInfo
.
setAlarmDay
(
calculateOfflineDays
(
now
,
lastTime
).
toString
());
offlineAlarmInfo
.
setAlarmDay
(
calculateOfflineDays
(
now
,
lastTime
).
toString
());
}
try
{
try
{
qyproAdminApiFacade
.
syncDeviceWarningContent
(
qyproAdminApiFacade
.
syncDeviceWarningContent
(
offlineAlarmInfo
.
getId
(),
offlineAlarmInfo
.
getId
(),
...
@@ -767,7 +773,8 @@ public class AlarmJobService {
...
@@ -767,7 +773,8 @@ public class AlarmJobService {
date
=
DateUtil
.
formatDate
(
new
Date
());
date
=
DateUtil
.
formatDate
(
new
Date
());
}
}
R
<
List
<
Integer
>>
sxjCreatedIds
=
vehicleDeviceClient
.
getSXJCreatedIds
();
R
<
List
<
Integer
>>
sxjCreatedIds
=
vehicleDeviceClient
.
getSXJCreatedIds
();
List
<
Integer
>
createdIds
=
sxjCreatedIds
.
getDataList
(
Integer
.
class
);
List
<
Integer
>
createdIds
=
sxjCreatedIds
.
getDataList
(
new
TypeToken
<
List
<
Integer
>>()
{
}.
getType
());
if
(
CollectionUtils
.
isEmpty
(
createdIds
))
{
if
(
CollectionUtils
.
isEmpty
(
createdIds
))
{
log
.
info
(
"根据思享驾租户id查询到的用户id列表为空"
);
log
.
info
(
"根据思享驾租户id查询到的用户id列表为空"
);
return
;
return
;
...
...
src/main/java/cn/com/glsx/schedulerjob/task/modules/service/QyproAdminApiFacade.java
View file @
31a3ab4
...
@@ -80,6 +80,10 @@ public class QyproAdminApiFacade implements DisposableBean {
...
@@ -80,6 +80,10 @@ public class QyproAdminApiFacade implements DisposableBean {
sleepQuietly
(
waitMs
);
sleepQuietly
(
waitMs
);
continue
;
continue
;
}
}
if
(
Integer
.
valueOf
(
500
).
equals
(
code
))
{
log
.
warn
(
"Qypro gps-sync 500 code=500, msg={}"
,
o
.
getString
(
"msg"
));
return
;
}
throw
new
ApiClient
.
ApiException
(
throw
new
ApiClient
.
ApiException
(
"预警内容同步失败: code="
+
code
+
", msg="
+
o
.
getString
(
"msg"
));
"预警内容同步失败: code="
+
code
+
", msg="
+
o
.
getString
(
"msg"
));
}
}
...
@@ -113,6 +117,10 @@ public class QyproAdminApiFacade implements DisposableBean {
...
@@ -113,6 +117,10 @@ public class QyproAdminApiFacade implements DisposableBean {
sleepQuietly
(
waitMs
);
sleepQuietly
(
waitMs
);
continue
;
continue
;
}
}
if
(
Integer
.
valueOf
(
500
).
equals
(
code
))
{
log
.
warn
(
"Qypro gps-sync 500 code=500, msg={}"
,
o
.
getString
(
"msg"
));
return
;
}
throw
new
ApiClient
.
ApiException
(
throw
new
ApiClient
.
ApiException
(
"GPS 信息同步失败: code="
+
code
+
", msg="
+
o
.
getString
(
"msg"
));
"GPS 信息同步失败: code="
+
code
+
", msg="
+
o
.
getString
(
"msg"
));
}
}
...
...
src/test/java/cn/com/glsx/schedulerjob/task/modules/service/AlarmJobServiceTest.java
View file @
31a3ab4
...
@@ -73,4 +73,19 @@ public class AlarmJobServiceTest {
...
@@ -73,4 +73,19 @@ public class AlarmJobServiceTest {
public
void
testAlarmDeviceSeparationJob
()
{
public
void
testAlarmDeviceSeparationJob
()
{
alarmDeviceSeparationJob
.
execute
(
null
);
alarmDeviceSeparationJob
.
execute
(
null
);
}
}
@Test
public
void
testPushSXJDeviceSeparationAlarmData
()
{
alarmJobService
.
pushSXJDeviceSeparationAlarmData
(
null
);
}
@Test
public
void
testPushSXJAlarmElectricFence
()
{
alarmJobService
.
pushSXJAlarmElectricFence
(
null
);
}
@Test
public
void
testPushSXJOfflineAlarmData
()
{
alarmJobService
.
pushSXJOfflineAlarmData
(
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