| | |
| | | return null;
|
| | | }
|
| | | var dataResult = Newtonsoft.Json.JsonConvert.DeserializeObject<GetShardInfoResult>(result);
|
| | | //对应旧版本的设备文件 Device_OnoffOutput_abcdfrtgg_01
|
| | | if (dataResult.ShareName.StartsWith("Device_") == true)
|
| | | {
|
| | | var strArry = dataResult.ShareName.Split(new string[] { "_" }, StringSplitOptions.None);
|
| | | if (strArry.Length == 4)
|
| | | {
|
| | | dataResult.ShareName = strArry[0] + "_" + strArry[2] + "_" + strArry[3];
|
| | | }
|
| | | }
|
| | | //文件名字
|
| | | listFile.Add(dataResult.ShareName);
|
| | | //保存到指定文件夹下
|
| | |
| | | {
|
| | | //性能优化:如果本地拥有这个文件的话,直接使用那个文件
|
| | | string fileName = data.ShareName;
|
| | | if (fileName.StartsWith("Device_") == true)
|
| | | {
|
| | | string[] Arry = fileName.Split(new string[] { "_" }, StringSplitOptions.RemoveEmptyEntries);
|
| | | if (Arry.Length == 4)
|
| | | {
|
| | | //对应旧数据:Device_OnOffOutput_abcjdffdfj_01
|
| | | fileName = Arry[0] + "_" + Arry[2] + "_" + Arry[3];
|
| | | }
|
| | | }
|
| | | //记录起它的主键
|
| | | memberShardInfo.dicAllShardKeys[fileName] = data.DistributedMark;
|
| | |
|
| | |
| | | else if (fileName.StartsWith("Device_") == true)
|
| | | {
|
| | | string[] Arry = fileName.Split(new string[] { "_" }, StringSplitOptions.RemoveEmptyEntries);
|
| | | string mainKeys = Common.LocalDevice.Current.GetDeviceMainKeys(Arry[2], Convert.ToInt32(Arry[3]));
|
| | | this.dicShardDeviceFile[mainKeys] = fileName;
|
| | |
|
| | | //设备文件
|
| | | dicDeviceFile[mainKeys] = fileName;
|
| | | if (Arry.Length == 4)
|
| | | {
|
| | | //对应旧数据:Device_OnOffOutput_abcjdffdfj_01
|
| | | string mainKeys = Common.LocalDevice.Current.GetDeviceMainKeys(Arry[2], Convert.ToInt32(Arry[3]));
|
| | | this.dicShardDeviceFile[mainKeys] = Arry[0] + "_" + Arry[2] + "_" + Arry[3];
|
| | | //设备文件
|
| | | dicDeviceFile[mainKeys] = this.dicShardDeviceFile[mainKeys];
|
| | | }
|
| | | else
|
| | | {
|
| | | string mainKeys = Common.LocalDevice.Current.GetDeviceMainKeys(Arry[1], Convert.ToInt32(Arry[2]));
|
| | | this.dicShardDeviceFile[mainKeys] = fileName;
|
| | | //设备文件
|
| | | dicDeviceFile[mainKeys] = fileName;
|
| | | }
|
| | | }
|
| | | else if (fileName.StartsWith("Scene_") == true)
|
| | | {
|