diff --git a/cmvr-iot-ti/src/main/java/com/cmvr/ti/service/ex/ExTiVehicleFunctionServiceImpl.java b/cmvr-iot-ti/src/main/java/com/cmvr/ti/service/ex/ExTiVehicleFunctionServiceImpl.java index a7a9296..02f1988 100644 --- a/cmvr-iot-ti/src/main/java/com/cmvr/ti/service/ex/ExTiVehicleFunctionServiceImpl.java +++ b/cmvr-iot-ti/src/main/java/com/cmvr/ti/service/ex/ExTiVehicleFunctionServiceImpl.java @@ -80,18 +80,12 @@ public class ExTiVehicleFunctionServiceImpl implements ExTiVehicleFunctionServic List funcList = tiVehicleFunctionService.selectTiVehicleFunctionList( TiVehicleFunctionVO.builder().vehicleConfigId(vehicleConfigId).build()); - // 2. uiKey → TiVehicleUi - Map uiByKey = new HashMap(); - for (TiVehicleUi ui : uiList) { - uiByKey.put(ui.getUiKey(), ui); - } - - // 3. funcKey → TiVehicleFunction - Map funcById = new HashMap(); + // 2. funcKey → TiVehicleFunction + Map funcById = new HashMap<>(); for (TiVehicleFunction f : funcList) { funcById.put(f.getId(), f); } - // 4.组装uiMap + // 3.组装uiMap Map uiMap = new HashMap<>(); List icons; CarUi carUi; @@ -115,12 +109,12 @@ public class ExTiVehicleFunctionServiceImpl implements ExTiVehicleFunctionServic ); uiMap.put(carUi.getUiName(), carUi); } - // 5.获取路径 + // 4.获取路径 List path = CarPathFinderUtil.findPath(uiMap, startUiName, targetFuncName); if (CollectionUtils.isEmpty(path)) { throw new GlobalException("没有找到匹配的路径"); } - // 组装结果 + // 5.组装结果 Map map = new HashMap<>(); map.put("nextLocation", path.get(0).getIconName()); map.put("isEnd", path.size() == 1);