From f45a57fad6d3fbb74556aa2c0287dc3f455519fe Mon Sep 17 00:00:00 2001
From: xuqiuyun <1113560936@qq.com>
Date: Mon, 24 Nov 2025 16:10:39 +0800
Subject: [PATCH] =?UTF-8?q?=E5=B7=B2=E7=BB=8F=E6=88=90=E5=8A=9F=E9=9B=86?=
=?UTF-8?q?=E6=88=90=E7=99=BE=E5=BA=A6=E9=B9=B0=E7=9C=BC=E6=9C=8D=E5=8A=A1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../earlywarning/warningDetailDialog.vue | 110 +-
.../src/views/entry/details.vue | 997 +++++++++---------
.../business/service/BaiduYingyanService.java | 286 ++++-
.../service/DeliveryYingyanSyncService.java | 58 +-
.../service/impl/DeliveryServiceImpl.java | 114 +-
.../target/maven-archiver/pom.properties | 3 +
6 files changed, 1017 insertions(+), 551 deletions(-)
create mode 100644 tradeCattle/aiotagro-redis/target/maven-archiver/pom.properties
diff --git a/pc-cattle-transportation/src/views/earlywarning/warningDetailDialog.vue b/pc-cattle-transportation/src/views/earlywarning/warningDetailDialog.vue
index 35dda7d..1ba4bfc 100644
--- a/pc-cattle-transportation/src/views/earlywarning/warningDetailDialog.vue
+++ b/pc-cattle-transportation/src/views/earlywarning/warningDetailDialog.vue
@@ -377,7 +377,47 @@
-
+
+
最新定位
+
+
+ {{ formatTimestamp(latestPoint.locTime) }}
+
+
+ {{ latestPoint.lat }}
+
+
+ {{ latestPoint.lng }}
+
+
+ {{ latestPoint.speed ?? '--' }}
+
+
+ {{ latestPoint.direction ?? '--' }}
+
+
+
+
+
+
轨迹查询分段({{ segmentStats.length }})
+
+
+
+
+ {{ formatTimestamp(scope.row.startTime) }}
+
+
+
+
+ {{ formatTimestamp(scope.row.endTime) }}
+
+
+
+
+
+
+
+
停留点分析(15分钟)
@@ -468,6 +508,8 @@ const playTimer = ref(null); // 播放定时器
const currentPlayIndex = ref(0); // 当前播放到的轨迹点索引
const trackBMapGL = ref(null); // 保存 BMapGL 实例,避免重复加载
const stayPoints = ref([]); // 停留点列表
+const latestPoint = ref(null); // 最新轨迹点
+const segmentStats = ref([]);
const yingyanMeta = reactive({
entityName: '',
startTime: null,
@@ -491,6 +533,11 @@ const isLocationWarning = computed(() => {
return isLocWarning;
});
+const isStaticTrack = computed(() => {
+ const status = Number(warningData.status || 0);
+ return status >= 3;
+});
+
const dialogTitle = computed(() => {
return `${warningData.warningTypeDesc || '预警'}详情`;
});
@@ -816,6 +863,25 @@ const formatDuration = (seconds) => {
return parts.join('') || `${sec}秒`;
};
+function parseLatestPoint(point) {
+ if (!point) {
+ return null;
+ }
+ const lng = parseFloat(point.longitude ?? point.lng ?? 0);
+ const lat = parseFloat(point.latitude ?? point.lat ?? 0);
+ if (Number.isNaN(lng) || Number.isNaN(lat) || (lng === 0 && lat === 0)) {
+ return null;
+ }
+
+ return {
+ lng,
+ lat,
+ locTime: point.locTime ?? point.loc_time ?? null,
+ speed: point.speed ?? null,
+ direction: point.direction ?? null,
+ };
+}
+
// 关闭对话框
const handleClose = () => {
// 清理地图实例
@@ -850,11 +916,17 @@ const handleTrackClick = async () => {
ElMessage.warning('运单ID不存在,无法查看轨迹');
return;
}
+ console.info('[TRACK] 开始轨迹定位流程', {
+ deliveryId: warningData.deliveryId,
+ status: warningData.status,
+ estimatedDepartureTime: warningData.estimatedDepartureTime,
+ });
trackDialogVisible.value = true;
trackLoading.value = true;
trackMapShow.value = false;
trackPath.value = [];
+ latestPoint.value = null;
isPlaying.value = false;
currentPlayIndex.value = 0;
@@ -913,6 +985,8 @@ const getDeliveryStatus = async () => {
const loadYingyanTrack = async () => {
stayPoints.value = [];
trackPath.value = [];
+ latestPoint.value = null;
+ segmentStats.value = [];
trackMapShow.value = false;
yingyanMeta.entityName = '';
yingyanMeta.startTime = null;
@@ -925,7 +999,10 @@ const loadYingyanTrack = async () => {
try {
const res = await getYingyanTrack({ deliveryId: warningData.deliveryId });
+ console.info('[TRACK] 后端轨迹接口响应', res);
if (res.code === 200 && res.data) {
+ segmentStats.value = Array.isArray(res.data.segmentStats) ? res.data.segmentStats : [];
+ console.info('[TRACK] 分段统计', segmentStats.value);
const rawPoints = Array.isArray(res.data.trackPoints) ? res.data.trackPoints : [];
trackPath.value = rawPoints
.map(item => {
@@ -946,9 +1023,18 @@ const loadYingyanTrack = async () => {
yingyanMeta.entityName = res.data.entityName || '';
yingyanMeta.startTime = res.data.startTime || null;
yingyanMeta.endTime = res.data.endTime || null;
+ latestPoint.value = parseLatestPoint(res.data.latestPoint);
+ console.info('[TRACK] 轨迹点数量', trackPath.value.length);
if (trackPath.value.length > 0) {
trackMapShow.value = true;
+ } else if (latestPoint.value) {
+ trackPath.value.push({
+ lng: latestPoint.value.lng,
+ lat: latestPoint.value.lat,
+ locTime: latestPoint.value.locTime || null,
+ });
+ trackMapShow.value = true;
} else {
ElMessage.warning('暂无有效轨迹点');
}
@@ -1340,6 +1426,28 @@ defineExpose({
margin-top: 20px;
}
+.latest-point-panel {
+ margin-top: 20px;
+
+ h4 {
+ margin: 0 0 10px 0;
+ font-size: 15px;
+ font-weight: 600;
+ color: #303133;
+ }
+}
+
+.segment-stats {
+ margin-top: 20px;
+
+ h4 {
+ margin: 0 0 10px 0;
+ font-size: 15px;
+ font-weight: 600;
+ color: #303133;
+ }
+}
+
.staypoint-section {
margin-top: 20px;
diff --git a/pc-cattle-transportation/src/views/entry/details.vue b/pc-cattle-transportation/src/views/entry/details.vue
index 8897862..8bdd7be 100644
--- a/pc-cattle-transportation/src/views/entry/details.vue
+++ b/pc-cattle-transportation/src/views/entry/details.vue
@@ -1,11 +1,7 @@
-
+
返回上一页
前往列表页面
@@ -14,384 +10,347 @@
-
-
-
-
基础信息
-
- {{ data.baseInfo.deliveryNumber || '-' }}
-
- {{ data.baseInfo.supplierName || '-' }}
- {{ data.baseInfo.buyerName || '-' }}
- {{ data.baseInfo.licensePlate || '-' }}
- {{ data.baseInfo.driverName || '-' }}
- {{ data.baseInfo.startLocation || '-' }}
- {{ data.baseInfo.endLocation || '-' }}
- {{ data.baseInfo.estimatedDeliveryTime || '-' }}
- {{ data.baseInfo.createTime || '' }}
- {{ totalRegisteredDevices }} 个
-
- {{ getStatusText(data.baseInfo.status) }}
+
+
+
+
+
+
+
+
+
+
+ {{ data.baseInfo.deliveryNumber || '-' }}
+ {{ data.baseInfo.supplierName || '-' }}
+ {{ data.baseInfo.buyerName || '-' }}
+ {{ data.baseInfo.licensePlate || '-' }}
+ {{ data.baseInfo.driverName || '-' }}
+ {{ data.baseInfo.startLocation || '-' }}
+ {{ data.baseInfo.endLocation || '-' }}
+ {{ data.baseInfo.estimatedDeliveryTime || '-' }}
+ {{ data.baseInfo.createTime || '' }}
+ {{ totalRegisteredDevices }} 个
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.warningTypeDesc }}
+
+ {{ item.warningTime || '--' }}
+ {{ totalRegisteredDevices }} 个
+ {{ item.inventoryJbqCount || '--' }} 个
+
+
+
+ {{ item.warningTypeDesc || '' }}
+
+ {{ item.warningTime || '' }}
+ {{ item.expectedDistance || '' }} km
+ {{ item.actualDistance || '' }} km
+
+
+
+
+
+
+
+
+
+
+
+
+
+
重量信息
+
+
+ {{ data.baseInfo.emptyWeight }}kg
-
-
+
+ {{ data.baseInfo.entruckWeight }}kg
+
+
+ {{ data.baseInfo.landingEntruckWeight }}kg
+
+
+
+
+
+
+
照片信息
+
-
-
智能主机
-
-
-
- {{ scope.row.battery || scope.row.deviceVoltage || '-' }}%
-
-
- {{ scope.row.steps || scope.row.walkSteps || '-' }}步
-
-
- {{ scope.row.temperature || scope.row.deviceTemp || '-' }}℃
-
-
- {{ scope.row.time || scope.row.updateTime || scope.row.createTime || '-' }}
-
-
-
- 日志
- 运动轨迹
- 定位
-
-
-
+
+
+
-
-
智能项圈
-
-
-
- {{ scope.row.battery || scope.row.deviceVoltage || '-' }}%
-
-
- {{ scope.row.steps || scope.row.walkSteps || '-' }}步
-
-
- {{ scope.row.deviceTemp || scope.row.temperature || '-' }}℃
-
-
- {{ scope.row.time || scope.row.updateTime || scope.row.createTime || '-' }}
-
-
-
- 日志
- 运动轨迹
-
-
-
-
-
-
-
智能耳标
-
-
-
-
- {{ scope.row.battery || scope.row.deviceVoltage || '-' }}%
-
-
- {{ scope.row.walkSteps || scope.row.steps || '-' }}步
-
-
- {{ scope.row.deviceTemp || scope.row.temperature || '-' }}℃
-
-
- {{ scope.row.updateTime || scope.row.createTime || '-' }}
-
-
-
- 日志
- 运动轨迹
-
-
-
-
-
-
-
- 返回
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ scope.row.battery || scope.row.deviceVoltage || '-' }}%
+
+
+ {{ scope.row.steps || scope.row.walkSteps || '-' }}步
+
+
+ {{ scope.row.temperature || scope.row.deviceTemp || '-' }}℃
+
+
+ {{ scope.row.time || scope.row.updateTime || scope.row.createTime || '-' }}
+
+
+
+ 日志
+ 运动轨迹
+ 定位
+
+
+
+
+
+
+
+
+ {{ scope.row.battery || scope.row.deviceVoltage || '-' }}%
+
+
+ {{ scope.row.steps || scope.row.walkSteps || '-' }}步
+
+
+ {{ scope.row.deviceTemp || scope.row.temperature || '-' }}℃
+
+
+ {{ scope.row.time || scope.row.updateTime || scope.row.createTime || '-' }}
+
+
+
+ 日志
+ 运动轨迹
+
+
+
+
+
+
+
+
+
+
+ {{ scope.row.battery || scope.row.deviceVoltage || '-' }}%
+
+
+ {{ scope.row.walkSteps || scope.row.steps || '-' }}步
+
+
+ {{ scope.row.deviceTemp || scope.row.temperature || '-' }}℃
+
+
+ {{ scope.row.updateTime || scope.row.createTime || '-' }}
+
+
+
+ 日志
+ 运动轨迹
+
+
+
+
+
+
+
+
-
+
@@ -409,14 +368,10 @@
-
-
-
+
-
+
-
-
-
-
-
-
-
-
+
+
+
+
{{ scope.row.deviceVoltage || scope.row.battery || '-' }}%
@@ -466,20 +412,23 @@
{{ scope.row.deviceTemp || scope.row.temperature || '-' }}℃
-
+
{{ scope.row.updateTime || scope.row.createTime || '-' }}
-
+
定位
-
+
-
-
-
+
+
+
+
{{ scope.row.battery || scope.row.deviceVoltage || '-' }}%
@@ -490,25 +439,28 @@
{{ scope.row.temperature || scope.row.deviceTemp || '-' }}℃
-
+
{{ scope.row.time || scope.row.updateTime || scope.row.createTime || '-' }}
-
+
定位
-
+
-
-
-
+
+
+
+
{{ scope.row.deviceVoltage || scope.row.battery || '-' }}%
@@ -519,13 +471,13 @@
{{ scope.row.deviceTemp || scope.row.temperature || '-' }}℃
-
+
{{ scope.row.hourTime || '-' }}
-
+
{{ scope.row.updateTime || scope.row.createTime || '-' }}
-
+
定位
@@ -534,12 +486,12 @@
-
+