huang
2025-11-25 19f59c243e8df97c8b9fd9dba4e758be8235d68b
mes-processes/mes-plcSend/src/main/java/com/mes/device/service/impl/DeviceConfigServiceImpl.java
@@ -135,9 +135,9 @@
        
        // 设备类型过滤
        if (deviceType != null && !deviceType.trim().isEmpty()) {
            String convertedDeviceType = convertDeviceTypeFromString(deviceType);
            if (convertedDeviceType != null) {
                wrapper.eq(DeviceConfig::getDeviceType, convertedDeviceType);
            List<String> convertedDeviceTypes = convertDeviceTypeFromString(deviceType);
            if (convertedDeviceTypes != null && !convertedDeviceTypes.isEmpty()) {
                wrapper.in(DeviceConfig::getDeviceType, convertedDeviceTypes);
            }
        }
        
@@ -315,24 +315,42 @@
    /**
     * 字符串转换为设备类型
     */
    private String convertDeviceTypeFromString(String deviceType) {
        if (deviceType == null) return null;
    private List<String> convertDeviceTypeFromString(String deviceType) {
        if (deviceType == null) {
            return Collections.emptyList();
        }
        
        switch (deviceType.trim().toLowerCase()) {
        String normalized = deviceType.trim().toLowerCase();
        switch (normalized) {
            case "load_vehicle":
            case "上大车":
            case "上大车设备":
            case "大车设备":
            case "1":
                return DeviceConfig.DeviceType.LOAD_VEHICLE;
                return Arrays.asList(
                    DeviceConfig.DeviceType.LOAD_VEHICLE,
                    "大车设备"
                );
            case "large_glass":
            case "大理片":
            case "大理片笼":
            case "2":
                return DeviceConfig.DeviceType.LARGE_GLASS;
                return Arrays.asList(
                    DeviceConfig.DeviceType.LARGE_GLASS,
                    "大理片笼"
                );
            case "glass_storage":
            case "玻璃存储":
            case "卧式缓存":
            case "玻璃存储设备":
            case "3":
                return DeviceConfig.DeviceType.GLASS_STORAGE;
                return Arrays.asList(
                    DeviceConfig.DeviceType.GLASS_STORAGE,
                    "卧式缓存",
                    "玻璃存储设备"
                );
            default:
                return null;
                return Collections.emptyList();
        }
    }
@@ -625,9 +643,9 @@
            
            // 设备类型过滤
            if (deviceType != null && !deviceType.trim().isEmpty()) {
                String convertedDeviceType = convertDeviceTypeFromString(deviceType);
                if (convertedDeviceType != null) {
                    wrapper.eq(DeviceConfig::getDeviceType, convertedDeviceType);
            List<String> convertedDeviceTypes = convertDeviceTypeFromString(deviceType);
            if (convertedDeviceTypes != null && !convertedDeviceTypes.isEmpty()) {
                wrapper.in(DeviceConfig::getDeviceType, convertedDeviceTypes);
                }
            }