Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx-performance
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
姜武杰
clx-performance
Commits
9e85a23f
提交
9e85a23f
authored
5月 30, 2024
作者:
姜文业
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
车辆当前定位
上级
d0515678
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
12 行增加
和
6 行删除
+12
-6
TruckPositionJob.java
...va/com/clx/performance/job/position/TruckPositionJob.java
+12
-6
没有找到文件。
performance-web/src/main/java/com/clx/performance/job/position/TruckPositionJob.java
浏览文件 @
9e85a23f
...
@@ -21,6 +21,7 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -21,6 +21,7 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.CollectionUtils
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
...
@@ -74,13 +75,11 @@ public class TruckPositionJob {
...
@@ -74,13 +75,11 @@ public class TruckPositionJob {
Result
<
List
<
String
>>
result
=
userClxFeign
.
getPlatformTruckList
();
Result
<
List
<
String
>>
result
=
userClxFeign
.
getPlatformTruckList
();
log
.
info
(
"通过clx-user服务获取平台认证成功车辆,返回结果:{}"
,
JSON
.
toJSONString
(
result
));
log
.
info
(
"通过clx-user服务获取平台认证成功车辆,返回结果:{}"
,
JSON
.
toJSONString
(
result
));
LocalDateTime
now
=
LocalDateTime
.
now
();
LocalDateTime
beginTime
=
now
.
plus
(-
5
,
ChronoUnit
.
MINUTES
);
String
beginTimeStr
=
DateUtils
.
formatDateTime
(
beginTime
,
"yyyy-MM-dd HH:mm:ss"
).
get
();
String
endTimeStr
=
DateUtils
.
formatDateTime
(
now
,
"yyyy-MM-dd HH:mm:ss"
).
get
();
if
(
Objects
.
equals
(
result
.
getCode
(),
ResultCodeEnum
.
SUCCESS
.
getCode
())){
if
(
Objects
.
equals
(
result
.
getCode
(),
ResultCodeEnum
.
SUCCESS
.
getCode
())){
List
<
TruckPosition
>
truckPositionList
=
new
ArrayList
<>();
List
<
TruckPosition
>
truckPositionList
=
new
ArrayList
<>();
List
<
String
>
truckNos
=
result
.
getData
();
List
<
String
>
truckNos
=
result
.
getData
();
//批量处理不在内的车牌号均至为失效,位置为空
//批量处理不在内的车牌号均至为失效,位置为空
truckPositionDao
.
updateTruckPositionStatus
(
DeleteStatusEnum
.
YES
.
getCode
(),
truckNos
);
truckPositionDao
.
updateTruckPositionStatus
(
DeleteStatusEnum
.
YES
.
getCode
(),
truckNos
);
...
@@ -93,6 +92,11 @@ public class TruckPositionJob {
...
@@ -93,6 +92,11 @@ public class TruckPositionJob {
Map
<
String
,
TruckTraceDTO
>
truckTraceMap
=
Map
<
String
,
TruckTraceDTO
>
truckTraceMap
=
redisTemplate
.
opsForHash
().
entries
(
RedisConstants
.
ZJXL_TRUCK_TRACE_LIST
);
redisTemplate
.
opsForHash
().
entries
(
RedisConstants
.
ZJXL_TRUCK_TRACE_LIST
);
LocalDateTime
now
=
LocalDateTime
.
now
();
LocalDateTime
beginTime
=
now
.
plus
(-
5
,
ChronoUnit
.
MINUTES
);
String
beginTimeStr
=
DateUtils
.
formatDateTime
(
beginTime
,
"yyyy-MM-dd HH:mm:ss"
).
get
();
String
endTimeStr
=
DateUtils
.
formatDateTime
(
now
,
"yyyy-MM-dd HH:mm:ss"
).
get
();
//既没接单 又没有中交兴路坐标的车辆集合
//既没接单 又没有中交兴路坐标的车辆集合
List
<
String
>
noZJXLNoChildTruckNos
=
new
ArrayList
<>();
List
<
String
>
noZJXLNoChildTruckNos
=
new
ArrayList
<>();
...
@@ -111,8 +115,10 @@ public class TruckPositionJob {
...
@@ -111,8 +115,10 @@ public class TruckPositionJob {
TruckPosition
position
=
new
TruckPosition
();
TruckPosition
position
=
new
TruckPosition
();
position
.
setTruckNo
(
truckNo
);
position
.
setTruckNo
(
truckNo
);
position
.
setChildNo
(
child
.
getChildNo
());
position
.
setChildNo
(
child
.
getChildNo
());
position
.
setLatitude
(
traceVOS
.
get
(
0
).
getLatitude
());
if
(!
CollectionUtils
.
isEmpty
(
traceVOS
)){
position
.
setLongitude
(
traceVOS
.
get
(
0
).
getLongitude
());
position
.
setLatitude
(
traceVOS
.
get
(
0
).
getLatitude
());
position
.
setLongitude
(
traceVOS
.
get
(
0
).
getLongitude
());
}
position
.
setDeleteStatus
(
DeleteStatusEnum
.
NO
.
getCode
());
position
.
setDeleteStatus
(
DeleteStatusEnum
.
NO
.
getCode
());
truckPositionList
.
add
(
position
);
truckPositionList
.
add
(
position
);
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论