diff --git a/stwzhj-modules/wzhj-system/src/main/java/org/dromara/system/service/impl/FenceDetectionServiceImpl.java b/stwzhj-modules/wzhj-system/src/main/java/org/dromara/system/service/impl/FenceDetectionServiceImpl.java index 989b646f..19098e0d 100644 --- a/stwzhj-modules/wzhj-system/src/main/java/org/dromara/system/service/impl/FenceDetectionServiceImpl.java +++ b/stwzhj-modules/wzhj-system/src/main/java/org/dromara/system/service/impl/FenceDetectionServiceImpl.java @@ -328,8 +328,11 @@ public class FenceDetectionServiceImpl implements FenceDetectionService { * 获取设备名称 */ private String getDeviceName(String deviceCode, String deviceType, Map locationInfo) { - if (locationInfo != null && locationInfo.get("deviceName") != null) { - return locationInfo.get("deviceName").toString(); + if (locationInfo != null) { + if (deviceType.equals("2")){ + return locationInfo.get("carNum").toString(); + } + return locationInfo.get("policeName").toString(); } try { @@ -340,7 +343,10 @@ public class FenceDetectionServiceImpl implements FenceDetectionService { .last("LIMIT 1") ); if (device != null) { - return device.getRemark1(); + if (deviceType.equals("2")){ + return device.getCarNum(); + } + return device.getPoliceName(); } } catch (Exception e) { log.warn("查询设备名称失败: {}", e.getMessage());