|
@@ -596,10 +596,13 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
|
catch
|
|
|
{
|
|
|
}
|
|
|
- if (tempFile != null)
|
|
|
- await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReplaceItemAsync<StandardFile>(saveFile, saveFile.id, new PartitionKey("StandardFile")); //直接替换以前的数据
|
|
|
- else
|
|
|
- await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").CreateItemAsync(saveFile, new PartitionKey($"StandardFile")); // 需要删除原来的政策文件数据在进行添加
|
|
|
+ if (tempFile.id != null)
|
|
|
+ {
|
|
|
+ if (tempFile.id.Equals(saveFile.id))
|
|
|
+ await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReplaceItemAsync<StandardFile>(saveFile, saveFile.id, new PartitionKey("StandardFile")); //直接替换以前的数据
|
|
|
+ else
|
|
|
+ await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").CreateItemAsync(saveFile, new PartitionKey($"StandardFile")); // 需要删除原来的政策文件数据在进行添加
|
|
|
+ }
|
|
|
|
|
|
//新的区域设置
|
|
|
AreaSetting saveSetting = new AreaSetting();
|
|
@@ -622,10 +625,13 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
|
catch
|
|
|
{
|
|
|
}
|
|
|
- if (tempSetting != null)
|
|
|
- await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReplaceItemAsync<AreaSetting>(saveSetting, saveSetting.id, new PartitionKey($"AreaSetting")); //直接替换以前的数据
|
|
|
- else
|
|
|
- await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").CreateItemAsync(saveSetting, new PartitionKey($"AreaSetting")); //需要删除原来的区域设置数据在进行添加
|
|
|
+ if (tempSetting.id != null)
|
|
|
+ {
|
|
|
+ if (tempSetting.id.Equals(saveSetting.id))
|
|
|
+ await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReplaceItemAsync<AreaSetting>(saveSetting, saveSetting.id, new PartitionKey($"AreaSetting")); //直接替换以前的数据
|
|
|
+ else
|
|
|
+ await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").CreateItemAsync(saveSetting, new PartitionKey($"AreaSetting")); //需要删除原来的区域设置数据在进行添加
|
|
|
+ }
|
|
|
|
|
|
//发送消息分区键
|
|
|
string partitionCode = "DelBeforeCopyAbility-mark";
|