JLChen
2020-12-11 d616b67bd6ea95562af73a00bf0aab38eec935df
HDL_ON/Entity/FunctionList.cs
@@ -112,6 +112,11 @@
                var functionDataBytes = FileUtils.ReadFile(filePath);
                var functionDataString = System.Text.Encoding.UTF8.GetString(functionDataBytes);
                var tempFunction = Newtonsoft.Json.JsonConvert.DeserializeObject<Function>(functionDataString);
                if (tempFunction == null)
                {
                    FileUtils.DeleteFile(filePath);
                    return;
                }
                if (tempFunction.DeleteSign)
                {
                    //todo 删除云端数据 20201203--App不能删除功能数据
@@ -365,8 +370,9 @@
                        //    }
                        //})
                        //{ IsBackground = true }.Start();
                        foreach (var localFunction in List.GetAllDeviceFunctionList())
                        for (int i =0;i < List.GetAllDeviceFunctionList().Count;)
                        {
                            var localFunction = List.GetAllDeviceFunctionList()[0];
                            var newFunction = deviceList.list.Find((obj) => obj.deviceId == localFunction.deviceId);
                            if (newFunction == null)//如果云端最新数据没有该条数据,则本地需要删掉该数据记录
                            {
@@ -374,6 +380,7 @@
                            }
                            else
                            {
                                i++;
                                if (localFunction.modifyTime != newFunction.modifyTime)
                                {
                                    localFunction.name = newFunction.name;
@@ -426,8 +433,9 @@
                        //    }
                        //})
                        //{ IsBackground = true }.Start();
                        foreach (var localScene in List.scenes)
                        for(int i=0;i<List.scenes.Count;)
                        {
                            var localScene = List.scenes[i];
                            var newScene = sceneList.Find((obj) => obj.userSceneId == localScene.userSceneId);
                            if (newScene == null)//如果云端最新数据没有该条数据,则本地需要删掉该数据记录
                            {
@@ -435,6 +443,7 @@
                            }
                            else
                            {
                                i++;
                                if (localScene.modifyTime != newScene.modifyTime)
                                {
                                    localScene.name = newScene.name;