|
|
|
@ -79,24 +79,8 @@ public class DashboardPushTask { |
|
|
|
|
|
|
|
// 计算数据哈希值 |
|
|
|
int currentHash = data.hashCode(); |
|
|
|
int lastHash = lastDataHash.getOrDefault("robot-picking", 0); |
|
|
|
|
|
|
|
// 只在数据变更时推送(包括从有数据变为空数据) |
|
|
|
if (currentHash != lastHash) { |
|
|
|
boolean isEmpty = isDataEmpty(data); |
|
|
|
if (isEmpty) { |
|
|
|
log.info("=== 机械臂拣选数据为空,推送空数据清空前端列表 ==="); |
|
|
|
} else { |
|
|
|
int containerCount = ((List<?>) data.get("containerList")).size(); |
|
|
|
int materialCount = ((List<?>) data.get("materialList")).size(); |
|
|
|
log.info("=== 检测到机械臂拣选数据变更,推送到前端(周转箱:{}条,原材:{}条)===", |
|
|
|
containerCount, materialCount); |
|
|
|
} |
|
|
|
webSocketService.pushRobotPickingData(data); |
|
|
|
lastDataHash.put("robot-picking", currentHash); |
|
|
|
} else { |
|
|
|
log.debug("机械臂拣选数据无变化,跳过推送"); |
|
|
|
} |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
log.error("推送机械臂拣选数据失败,推送空数据清空前端列表: {}", e.getMessage(), e); |
|
|
|
@ -266,24 +250,8 @@ public class DashboardPushTask { |
|
|
|
|
|
|
|
// 计算数据哈希值 |
|
|
|
int currentHash = data.hashCode(); |
|
|
|
int lastHash = lastDataHash.getOrDefault("slitting-board", 0); |
|
|
|
|
|
|
|
// 只在数据变更时推送 |
|
|
|
if (currentHash != lastHash) { |
|
|
|
boolean isEmpty = isSlittingDataEmpty(data); |
|
|
|
if (isEmpty) { |
|
|
|
log.info("=== 分切区看板数据为空,推送空数据清空前端列表 ==="); |
|
|
|
} else { |
|
|
|
int assistArmCount = ((List<?>) data.get("assistArmList")).size(); |
|
|
|
int inboundCount = ((List<?>) data.get("slittingInboundList")).size(); |
|
|
|
log.info("=== 检测到分切区看板数据变更,推送到前端(助力臂:{}条,入库:{}条)===", |
|
|
|
assistArmCount, inboundCount); |
|
|
|
} |
|
|
|
webSocketService.pushSlittingBoardData(data); |
|
|
|
lastDataHash.put("slitting-board", currentHash); |
|
|
|
} else { |
|
|
|
log.debug("分切区看板数据无变化,跳过推送"); |
|
|
|
} |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
log.error("推送分切区看板数据失败,推送空数据清空前端列表: {}", e.getMessage(), e); |
|
|
|
@ -382,21 +350,8 @@ public class DashboardPushTask { |
|
|
|
|
|
|
|
// 计算数据哈希值 |
|
|
|
int currentHash = data.hashCode(); |
|
|
|
int lastHash = lastDataHash.getOrDefault("warehouse-3d", 0); |
|
|
|
|
|
|
|
// 只在数据变更时推送 |
|
|
|
if (currentHash != lastHash) { |
|
|
|
boolean isEmpty = isWarehouse3dDataEmpty(data); |
|
|
|
if (isEmpty) { |
|
|
|
log.info("=== 智能立体仓库看板数据为空,推送空数据 ==="); |
|
|
|
} else { |
|
|
|
log.info("=== 检测到智能立体仓库看板数据变更,推送到前端 ==="); |
|
|
|
} |
|
|
|
webSocketService.pushWarehouse3dBoardData(data); |
|
|
|
lastDataHash.put("warehouse-3d", currentHash); |
|
|
|
} else { |
|
|
|
log.debug("智能立体仓库看板数据无变化,跳过推送"); |
|
|
|
} |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
log.error("推送智能立体仓库看板数据失败,推送空数据: {}", e.getMessage(), e); |
|
|
|
|