BatchAreaController.cs 51 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915
  1. using Microsoft.AspNetCore.Http;
  2. using Microsoft.AspNetCore.Mvc;
  3. using Microsoft.Extensions.Configuration;
  4. using Microsoft.Extensions.Options;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Linq;
  8. using System.Threading.Tasks;
  9. using TEAMModelOS.Models;
  10. using TEAMModelOS.SDK.DI;
  11. using TEAMModelOS.SDK.Models;
  12. using Azure.Cosmos;
  13. using System.Text.Json;
  14. using HTEXLib.COMM.Helpers;
  15. using TEAMModelOS.SDK.Models.Cosmos.Common;
  16. using TEAMModelOS.SDK.Models.Cosmos.BI;
  17. using Azure.Messaging.ServiceBus;
  18. using TEAMModelOS.SDK.Extension;
  19. using TEAMModelOS.SDK.Models.Service;
  20. using TEAMModelBI.Filter;
  21. using TEAMModelBI.Tool.Extension;
  22. using TEAMModelBI.Tool;
  23. using TEAMModelBI.Tool.Context;
  24. using TEAMModelBI.DI.BIAzureStorage;
  25. using Azure.Storage.Blobs.Models;
  26. using Azure;
  27. using Azure.Storage.Blobs.Specialized;
  28. namespace TEAMModelBI.Controllers.BISchool
  29. {
  30. [Route("batcharea")]
  31. [ApiController]
  32. public class BatchAreaController : ControllerBase
  33. {
  34. private readonly AzureCosmosFactory _azureCosmos;
  35. private readonly DingDing _dingDing;
  36. private readonly Option _option;
  37. private readonly AzureStorageFactory _azureStorage;
  38. private readonly IConfiguration _configuration;
  39. private readonly NotificationService _notificationService;
  40. private readonly AzureServiceBusFactory _serviceBus;
  41. public BatchAreaController(AzureCosmosFactory azureCosmos, DingDing dingDing, AzureStorageFactory azureStorage, IOptionsSnapshot<Option> option, IConfiguration configuration, NotificationService notificationService, AzureServiceBusFactory serviceBus)
  42. {
  43. _azureCosmos = azureCosmos;
  44. _dingDing = dingDing;
  45. _azureStorage = azureStorage;
  46. _option = option?.Value;
  47. _configuration = configuration;
  48. _notificationService = notificationService;
  49. _serviceBus = serviceBus;
  50. }
  51. /// <summary>
  52. /// 查询所有的区域标准
  53. /// </summary>
  54. /// <returns></returns>
  55. [ProducesDefaultResponseType]
  56. [HttpPost("get-areas")]
  57. public async Task<IActionResult> GetArea(JsonElement jsonElement)
  58. {
  59. try
  60. {
  61. jsonElement.TryGetProperty("site", out JsonElement site);
  62. List<RecArea> areas = new();
  63. var table = _azureStorage.GetCloudTableClient().GetTableReference("IESLogin");
  64. var azureClient = _azureCosmos.GetCosmosClient();
  65. if ($"{site}".Equals(BIConst.GlobalSite))
  66. {
  67. azureClient = _azureCosmos.GetCosmosClient(name: BIConst.GlobalSite);
  68. table = _azureStorage.GetCloudTableClient(BIConst.GlobalSite).GetTableReference("IESLogin");
  69. }
  70. await foreach (var item in azureClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<RecArea>(queryText: $"select c.id,c.code,c.pk,c.name,c.provCode,c.provName,c.cityCode,c.cityName,c.standard,c.standardName,c.institution from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base-Area") }))
  71. {
  72. areas.Add(item);
  73. }
  74. foreach (var recArea in areas)
  75. {
  76. recArea.schoolCount = await CommonFind.GetSqlValueCount(azureClient, "School", $"select value(count(c.id)) from c where c.areaId='{recArea.id}' and c.standard='{recArea.standard}'", "Base");
  77. List<AreaQuoteRecord> aqr = await table.QueryWhereString<AreaQuoteRecord>($"PartitionKey eq 'QuoteRecord' and areaId eq '{recArea.id}'");
  78. aqr.Sort((x, y) => y.RowKey.CompareTo(x.RowKey));
  79. recArea.aquoteRec = aqr;
  80. }
  81. return Ok(new { state = 200, areas });
  82. }
  83. catch (Exception ex)
  84. {
  85. await _dingDing.SendBotMsg($"BI,{_option.Location} batcharea/get-areas \n {ex.Message}\n{ex.StackTrace}", GroupNames.成都开发測試群組);
  86. return BadRequest();
  87. }
  88. }
  89. /// <summary>
  90. /// 批量创区
  91. /// </summary>
  92. /// <param name="areas"></param>
  93. /// <returns></returns>
  94. [ProducesDefaultResponseType]
  95. [HttpPost("upd-area")]
  96. public async Task<IActionResult> batchCreateArea(List<Area> areas)
  97. {
  98. try
  99. {
  100. List<Area> standards = new List<Area>();
  101. bool isCreate = true;
  102. if (areas.Count > 0)
  103. {
  104. foreach (Area itemarea in areas)
  105. {
  106. await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<Area>(queryText: $"select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-Area") }))
  107. {
  108. if (item.standard.Equals(itemarea.standard))
  109. {
  110. standards.Add(itemarea);
  111. isCreate = false;
  112. }
  113. }
  114. if (isCreate == true)
  115. {
  116. Area addArea = new Area()
  117. {
  118. id = Guid.NewGuid().ToString(),
  119. code = $"Base-Area",
  120. name = itemarea.name,
  121. provCode = itemarea.provCode,
  122. provName = itemarea.provName,
  123. cityCode = itemarea.cityCode,
  124. cityName = itemarea.cityName,
  125. standard = itemarea.standard,
  126. standardName = itemarea.standardName,
  127. institution = itemarea.institution
  128. };
  129. await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Normal").CreateItemAsync<Area>(addArea, new PartitionKey("Base-Area"));
  130. }
  131. }
  132. }
  133. else return Ok(new { state = 1, message = "区域参数为空" });
  134. if (standards.Count > 0)
  135. return Ok(new { state = 201, message = "已有部分区域批量创建成功;标准项已重复!请检查标准项!", standards = standards });
  136. else return Ok(new { state = 200, message = "批量创区全部完成", });
  137. }
  138. catch (Exception ex)
  139. {
  140. await _dingDing.SendBotMsg($"BI,{_option.Location} batcharea/batch-createarea \n {ex.Message}\n{ex.StackTrace}", GroupNames.成都开发測試群組);
  141. return BadRequest();
  142. }
  143. }
  144. /// <summary>
  145. /// 批量创区 新接口
  146. /// </summary>
  147. /// <param name="jsonElement"></param>
  148. /// <returns></returns>
  149. [ProducesDefaultResponseType]
  150. [AuthToken(Roles = "admin,rdc")]
  151. [HttpPost("batch-area")]
  152. public async Task<IActionResult> batchArea(JsonElement jsonElement)
  153. {
  154. try
  155. {
  156. if (!jsonElement.TryGetProperty("name", out JsonElement name)) return BadRequest();
  157. jsonElement.TryGetProperty("provCode", out JsonElement provCode);
  158. jsonElement.TryGetProperty("provName", out JsonElement provName);
  159. jsonElement.TryGetProperty("cityCode", out JsonElement cityCode);
  160. jsonElement.TryGetProperty("cityName", out JsonElement cityName);
  161. if (!jsonElement.TryGetProperty("standard", out JsonElement standard)) return BadRequest();
  162. if (!jsonElement.TryGetProperty("standardName", out JsonElement standardName)) return BadRequest();
  163. jsonElement.TryGetProperty("institution", out JsonElement institution);
  164. jsonElement.TryGetProperty("oldId", out JsonElement _oldId);
  165. jsonElement.TryGetProperty("oldStandard", out JsonElement oldStandard);
  166. jsonElement.TryGetProperty("oldName", out JsonElement oldName);
  167. jsonElement.TryGetProperty("site", out JsonElement site);
  168. var (_tmdId, _tmdName, pic, did, dname, dpic) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
  169. //操作记录实体
  170. var tempStandard = !string.IsNullOrEmpty($"{oldStandard}") && !string.IsNullOrEmpty($"{_oldId}") ? $"{oldStandard}" : "standard2";
  171. //var table = _azureStorage.GetCloudTableClient().GetTableReference("IESLogin");
  172. var cosmosClient = _azureCosmos.GetCosmosClient();//数据库连接
  173. var tableClient = _azureStorage.GetCloudTableClient();
  174. var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
  175. var serBusClient = _serviceBus.GetServiceBusClient();
  176. var activeTask = _configuration.GetValue<string>("Azure:ServiceBus:ActiveTask");//秘钥地址
  177. if ($"{site}".Equals(BIConst.GlobalSite))
  178. {
  179. cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.GlobalSite);
  180. tableClient = _azureStorage.GetCloudTableClient(BIConst.GlobalSite);
  181. //serBusClient = _serviceBus.GetServiceBusClient(BIConst.GlobalSite); //暂未确定使用默认
  182. //activeTask = _configuration.GetValue<string>("GlobalAzure:ServiceBus:ActiveTask"); //暂未确定使用默认
  183. }
  184. var table = tableClient.GetTableReference("IESLogin");
  185. //查询新的是否存在
  186. await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<Area>(queryText: $"select value(c) from c where c.standard='{standard}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-Area") }))
  187. {
  188. if (item.standard.Equals($"{standard}"))
  189. return Ok(new { state = 1, message = "新创区的standard已存在请检查" });
  190. }
  191. //区级的ID
  192. string areaId = Guid.NewGuid().ToString();
  193. Area addArea = new Area()
  194. {
  195. id = areaId,
  196. code = $"Base-Area",
  197. name = $"{name}",
  198. provCode = $"{provCode}",
  199. provName = $"{provName}",
  200. cityCode = $"{cityCode}",
  201. cityName = $"{cityName}",
  202. standard = $"{standard}",
  203. standardName = $"{standardName}",
  204. institution = $"{institution}"
  205. };
  206. //创建区域
  207. await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").CreateItemAsync<Area>(addArea, new PartitionKey("Base-Area"));
  208. //保存引用记录
  209. await table.SaveOrUpdate<AreaQuoteRecord>(new AreaQuoteRecord() { PartitionKey = "QuoteRecord", RowKey = $"{DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()}", areaId = $"{areaId}", quoteId = $"{_oldId}", quoteName = $"{oldName}", standard = tempStandard });
  210. //消息分区键
  211. string partitionCode = "copyAbility-mark";
  212. #region 使用Function创区
  213. //string areaCode = "copyArea-mark";
  214. //BatchCopyAreaRelevant bCopyArea = new BatchCopyAreaRelevant()
  215. //{
  216. // tmdid = $"{_tmdId}",
  217. // tmdName = $"{_tmdName}",
  218. // codeKey = areaCode,
  219. // tmdIds = new List<string> { $"{_tmdId}"},
  220. // oldStandard = $"{oldStandard}",
  221. // oldId = $"{_oldId}",
  222. // standard = $"{standard}",
  223. // areaId = areaId,
  224. // cut="",
  225. //};
  226. //var messageBatchCopyArea = new ServiceBusMessage(bCopyArea.ToJsonString());
  227. //messageBatchCopyArea.ApplicationProperties.Add("name", "CopyAreaRelevant");
  228. //var activeTaskArea = _configuration.GetValue<string>("Azure:ServiceBus:ActiveTask");
  229. //await _serviceBus.GetServiceBusClient().SendMessageAsync(activeTaskArea, messageBatchCopyArea);
  230. #endregion
  231. #region 旧的批量创区
  232. List<Task<ItemResponse<Ability>>> abilities = new List<Task<ItemResponse<Ability>>>(); //存储区域数据
  233. List<Task<ItemResponse<AbilityTask>>> abilityTasks = new List<Task<ItemResponse<AbilityTask>>>(); //存储章节
  234. if (!string.IsNullOrEmpty($"{oldStandard}") && !string.IsNullOrEmpty($"{_oldId}"))
  235. {
  236. //查询要复制区域的能力标准点
  237. await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<Ability>(queryText: $"select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Ability-{oldStandard}") }))
  238. {
  239. if (!string.IsNullOrEmpty(item.blob))
  240. {
  241. item.blob = item.blob.Replace($"/{oldStandard}/", $"/{standard}/");
  242. };
  243. item.standard = $"{standard}";
  244. item.code = $"Ability-{standard}";
  245. item.school = $"{standard}";
  246. //添加区能力标准点
  247. abilities.Add(cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").CreateItemAsync(item, new PartitionKey($"Ability-{standard}")));
  248. }
  249. try
  250. {
  251. if (abilities.Count < 256)
  252. {
  253. await Task.WhenAll(abilities);
  254. }
  255. else
  256. {
  257. int pages = (abilities.Count + 255) / 256;
  258. for (int i = 0; i < pages; i++)
  259. {
  260. List<Task<ItemResponse<Ability>>> tempAbility = abilities.Skip((i) * 256).Take(256).ToList();
  261. await Task.WhenAll(tempAbility);
  262. }
  263. }
  264. }
  265. catch
  266. {
  267. return Ok(new { state = 200, msg = "创区成功,能力标准点复制失败,遗留数据影响!" });
  268. }
  269. try
  270. {
  271. //微能力点
  272. await foreach (var atask in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<AbilityTask>(queryText: $"select value(c) from c ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"AbilityTask-{oldStandard}") }))
  273. {
  274. List<Tnode> tnodes = new List<Tnode>();
  275. foreach (Tnode tnode in atask.children)
  276. {
  277. if (tnode.rnodes != null)
  278. {
  279. List<Rnode> rnodes = new List<Rnode>();
  280. foreach (Rnode rnode in tnode.rnodes)
  281. {
  282. if (!string.IsNullOrEmpty($"{rnode.link}"))
  283. {
  284. rnode.link = rnode.link.Replace($"/{oldStandard}/", $"/{standard}/");
  285. }
  286. rnodes.Add(rnode);
  287. }
  288. tnode.rnodes = rnodes;
  289. }
  290. tnodes.Add(tnode);
  291. }
  292. atask.children = tnodes;
  293. atask.code = $"AbilityTask-{standard}";
  294. atask.standard = $"{standard}";
  295. atask.codeval = $"{standard}";
  296. //添加区能力标准点中的节点
  297. //abilityTasks.Add(cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").CreateItemAsync(atask, new PartitionKey($"AbilityTask-{standard}")));
  298. await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").CreateItemAsync(atask, new PartitionKey($"AbilityTask-{standard}"));
  299. }
  300. }
  301. catch
  302. {
  303. return Ok(new { state = 200, msg = "创区成功,能力标准创建成功,微能力点复制失败,遗留数据影响!" });
  304. }
  305. //if (abilityTasks.Count > 0)
  306. //{
  307. // for (int i = 0; i < abilityTasks.Count; i++)
  308. // {
  309. // List<Task<ItemResponse<AbilityTask>>> tempAbilityTasks = abilityTasks.Skip((i)).Take(1).ToList();
  310. // await Task.WhenAll(tempAbilityTasks);
  311. // }
  312. //}
  313. //新政策文件
  314. await foreach (StandardFile standardFile in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<StandardFile>(queryText: $"select value(c) from c where c.id='{_oldId}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"StandardFile") }))
  315. {
  316. if (standardFile != null)
  317. {
  318. standardFile.standard = $"{standard}";
  319. standardFile.id = areaId;
  320. await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").CreateItemAsync(standardFile, new PartitionKey($"StandardFile"));
  321. }
  322. }
  323. //新的区域设置
  324. await foreach (AreaSetting areaSetting in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<AreaSetting>(queryText: $"select value(c) from c where c.id='{_oldId}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("AreaSetting") }))
  325. {
  326. if (areaSetting != null)
  327. {
  328. areaSetting.accessConfig = null;
  329. areaSetting.id = areaId;
  330. await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").CreateItemAsync(areaSetting, new PartitionKey($"AreaSetting"));
  331. }
  332. }
  333. }
  334. else
  335. {
  336. Area area = null;
  337. await foreach (var tempArea in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<Area>(queryText: $"select value(c) from c where c.standard='standard2'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-Area") }))
  338. {
  339. area = tempArea;
  340. }
  341. if (area != null)
  342. {
  343. //查询要复制区域的能力标准点
  344. await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<Ability>(queryText: $"select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Ability-{area.standard}") }))
  345. {
  346. if (!string.IsNullOrEmpty(item.blob))
  347. {
  348. item.blob = item.blob.Replace($"/{area.standard}/", $"/{standard}/");
  349. };
  350. item.standard = $"{standard}";
  351. item.code = $"Ability-{standard}";
  352. item.school = $"{standard}";
  353. //添加区能力标准点
  354. abilities.Add(cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").CreateItemAsync(item, new PartitionKey($"Ability-{standard}")));
  355. }
  356. try
  357. {
  358. if (abilities.Count < 256)
  359. {
  360. await Task.WhenAll(abilities);
  361. }
  362. else
  363. {
  364. int pages = (abilities.Count + 255) / 256;
  365. for (int i = 0; i < pages; i++)
  366. {
  367. List<Task<ItemResponse<Ability>>> tempAbility = abilities.Skip((i) * 256).Take(256).ToList();
  368. await Task.WhenAll(tempAbility);
  369. }
  370. }
  371. }
  372. catch
  373. {
  374. return Ok(new { state = 200, msg = "创区成功,能力标准点复制失败,遗留数据影响!" });
  375. }
  376. try
  377. {
  378. //微能力点
  379. await foreach (var atask in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<AbilityTask>(queryText: $"select value(c) from c ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"AbilityTask-{area.standard}") }))
  380. {
  381. List<Tnode> tnodes = new List<Tnode>();
  382. foreach (Tnode tnode in atask.children)
  383. {
  384. if (tnode.rnodes != null)
  385. {
  386. List<Rnode> rnodes = new List<Rnode>();
  387. foreach (Rnode rnode in tnode.rnodes)
  388. {
  389. if (!string.IsNullOrEmpty($"{rnode.link}"))
  390. {
  391. rnode.link = rnode.link.Replace($"/{area.standard}/", $"/{standard}/");
  392. }
  393. rnodes.Add(rnode);
  394. }
  395. tnode.rnodes = rnodes;
  396. }
  397. tnodes.Add(tnode);
  398. }
  399. atask.children = tnodes;
  400. atask.code = $"AbilityTask-{standard}";
  401. atask.standard = $"{standard}";
  402. atask.codeval = $"{standard}";
  403. //添加区能力标准点中的节点
  404. //abilityTasks.Add(cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").CreateItemAsync(atask, new PartitionKey($"AbilityTask-{standard}")));
  405. await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").CreateItemAsync(atask, new PartitionKey($"AbilityTask-{standard}"));
  406. }
  407. }
  408. catch
  409. {
  410. return Ok(new { state = 200, msg = "创区成功,能力标准创建成功,微能力点复制失败,遗留数据影响!" });
  411. }
  412. //if (abilityTasks.Count > 0)
  413. //{
  414. // for (int i = 0; i < abilityTasks.Count; i++)
  415. // {
  416. // List<Task<ItemResponse<AbilityTask>>> tempAbilityTasks = abilityTasks.Skip(i).Take(1).ToList();
  417. // await Task.WhenAll(tempAbilityTasks);
  418. // }
  419. //}
  420. //新政策文件
  421. await foreach (StandardFile standardFile in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<StandardFile>(queryText: $"select value(c) from c where c.id='{area.id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"StandardFile") }))
  422. {
  423. if (standardFile != null)
  424. {
  425. standardFile.standard = $"{standard}";
  426. standardFile.id = areaId;
  427. await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").CreateItemAsync(standardFile, new PartitionKey($"StandardFile"));
  428. }
  429. }
  430. //新的区域设置
  431. await foreach (AreaSetting areaSetting in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<AreaSetting>(queryText: $"select value(c) from c where c.id='{area.id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("AreaSetting") }))
  432. {
  433. if (areaSetting != null)
  434. {
  435. areaSetting.accessConfig = null;
  436. areaSetting.id = areaId;
  437. await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").CreateItemAsync(areaSetting, new PartitionKey($"AreaSetting"));
  438. }
  439. }
  440. }
  441. else return Ok(new { state = 201, message = "未找到默认能力点!" });
  442. }
  443. #endregion
  444. //执行复制操作
  445. BatchCopyFile batchCopyFile = new BatchCopyFile();
  446. batchCopyFile.blobCntr = "teammodelos";
  447. batchCopyFile.oldFileName = $"{oldStandard}";
  448. batchCopyFile.newFileName = $"{standard}";
  449. batchCopyFile.tmdid = $"{_tmdId}";
  450. batchCopyFile.tmdIds = new List<string> { $"{ _tmdId}" };
  451. batchCopyFile.codeKey = partitionCode;
  452. batchCopyFile.tmdName = $"{_tmdName}";
  453. var messageBatchCopyFile = new ServiceBusMessage(batchCopyFile.ToJsonString());
  454. messageBatchCopyFile.ApplicationProperties.Add("name", "CopyStandardFile");
  455. //var activeTask = _configuration.GetValue<string>("Azure:ServiceBus:ActiveTask");
  456. try
  457. {
  458. //await _serviceBus.GetServiceBusClient().SendMessageAsync(activeTask, messageBatchCopyFile);
  459. await serBusClient.SendMessageAsync(activeTask, messageBatchCopyFile);
  460. }
  461. catch (Exception)
  462. {
  463. return Ok(new { state = 201, msg = "能力点复制成功,复制能力点的文件失败," });
  464. }
  465. //发送消息实体
  466. Notification notification = new Notification
  467. {
  468. hubName = "hita",
  469. type = "msg",
  470. from = $"BI:{_option.Location}:private",
  471. to = new List<string> { $"{ _tmdId}" },
  472. label = $"{partitionCode}_start",
  473. body = new { location = _option.Location, biz = partitionCode, tmdid = $"{_tmdId}", tmdname = $"{_tmdName}", status = 1, time = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() }.ToJsonString(),
  474. expires = DateTimeOffset.UtcNow.AddDays(7).ToUnixTimeSeconds()
  475. };
  476. var url = _configuration.GetValue<string>("HaBookAuth:CoreService:sendnotification");
  477. var clientID = _configuration.GetValue<string>("HaBookAuth:CoreService:clientID");
  478. var clientSecret = _configuration.GetValue<string>("HaBookAuth:CoreService:clientSecret");
  479. var location = _option.Location;
  480. await _notificationService.SendNotification(clientID, clientSecret, location, url, notification); //站内发送消息
  481. //保存操作记录
  482. //await _azureStorage.SaveBILog("area-add", $"{_tmdName}【{_tmdId}】已操作创区功能模块:{name},当前标准【{standard}】,复制的微能力点:{tempStandard}", _dingDing, httpContext: HttpContext);
  483. await BIAzureStorageBlobExtensions.SaveBILog(blobClient, tableClient, "area-add", $"{_tmdName}【{_tmdId}】已操作创区功能模块:{name},当前标准【{standard}】,复制的微能力点:{tempStandard}", _dingDing, httpContext: HttpContext);
  484. return Ok(new { state = 200, area = addArea });
  485. }
  486. catch (Exception ex)
  487. {
  488. await _dingDing.SendBotMsg($"BI,{_option.Location} /batcharea/batch-area \n {ex.Message}\n{ex.StackTrace}", GroupNames.成都开发測試群組);
  489. return BadRequest();
  490. }
  491. }
  492. /// <summary>
  493. /// 创区后切换能力点, 先删除原来的能力点,后复制新的能力点
  494. /// </summary>
  495. /// <param name="jsonElement"></param>
  496. /// <returns></returns>
  497. [ProducesDefaultResponseType]
  498. [AuthToken(Roles = "admin,rdc")]
  499. [HttpPost("cut-standard")]
  500. public async Task<IActionResult> CutStandard(JsonElement jsonElement)
  501. {
  502. try
  503. {
  504. if (!jsonElement.TryGetProperty("oldId", out JsonElement _oldId)) return BadRequest();
  505. if (!jsonElement.TryGetProperty("oldStandard", out JsonElement _oldStandard)) return BadRequest();
  506. if (!jsonElement.TryGetProperty("newId", out JsonElement _newId)) return BadRequest();
  507. if (!jsonElement.TryGetProperty("newStandard", out JsonElement _newStandard)) return BadRequest();
  508. jsonElement.TryGetProperty("newName", out JsonElement newName);
  509. jsonElement.TryGetProperty("site", out JsonElement site);
  510. var (_tmdId, _tmdName, pic, did, dname, dpic) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
  511. //操作记录实体
  512. string blobOrTable = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().ToString();
  513. var tableClient = _azureStorage.GetCloudTableClient();
  514. var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
  515. var cosmosClient = _azureCosmos.GetCosmosClient();
  516. var serBusClient = _serviceBus.GetServiceBusClient();
  517. var activeTask = _configuration.GetValue<string>("Azure:ServiceBus:ActiveTask");//秘钥地址
  518. if ($"{site}".Equals(BIConst.GlobalSite))
  519. {
  520. cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.GlobalSite);
  521. tableClient = _azureStorage.GetCloudTableClient(BIConst.GlobalSite);
  522. blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.GlobalSite);
  523. serBusClient = _serviceBus.GetServiceBusClient(BIConst.GlobalSite); //暂未确定使用默认
  524. //activeTask = _configuration.GetValue<string>("GlobalAzure:ServiceBus:ActiveTask"); //暂未确定使用默认
  525. }
  526. var table = tableClient.GetTableReference("IESLogin");
  527. //保存引用记录
  528. //await table.SaveOrUpdate<AreaQuoteRecord>(new AreaQuoteRecord() { PartitionKey = "QuoteRecord", RowKey = $"{DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()}", areaId = $"{_oldId}", quoteId = $"{_newId}", quoteName = $"{newName}", standard = $"{_newStandard}" });
  529. List<string> abilityIds = new List<string>(); //册别的ID集合
  530. //查询册别信息
  531. await foreach (var tempAbility in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<Ability>(queryText: $"select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Ability-{_oldStandard}") }))
  532. {
  533. abilityIds.Add(tempAbility.id); //查询出来册别ID添加册别ID集合
  534. }
  535. //删除册别
  536. if (abilityIds.IsNotEmpty())
  537. {
  538. var sresponse = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").DeleteItemsStreamAsync(abilityIds, $"Ability-{_oldStandard}");
  539. }
  540. List<string> abilityTaskIds = new List<string>(); //章节ID集合
  541. await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<AbilityTask>(queryText: $"select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"AbilityTask-{_oldStandard}") }))
  542. {
  543. abilityTaskIds.Add(item.id); //查询出来的章节信息ID添加到战绩集合
  544. }
  545. //删除章节
  546. if (abilityTaskIds.IsNotEmpty())
  547. {
  548. var sresponse = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").DeleteItemsStreamAsync(abilityTaskIds, $"AbilityTask-{_oldStandard}");
  549. }
  550. List<Task<ItemResponse<Ability>>> abilities = new List<Task<ItemResponse<Ability>>>(); //存储册别数据
  551. List<Task<ItemResponse<AbilityTask>>> abilityTasks = new List<Task<ItemResponse<AbilityTask>>>(); //存储章节
  552. //查询要复制区域的能力标准点
  553. await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<Ability>(queryText: $"select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Ability-{_newStandard}") }))
  554. {
  555. if (!string.IsNullOrEmpty(item.blob))
  556. {
  557. item.blob = item.blob.Replace($"/{_newStandard}/", $"/{_oldStandard}/");
  558. };
  559. item.standard = $"{_oldStandard}";
  560. item.code = $"Ability-{_oldStandard}";
  561. item.school = $"{_oldStandard}";
  562. //添加区能力标准点
  563. abilities.Add(cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").CreateItemAsync(item, new PartitionKey($"Ability-{_oldStandard}")));
  564. }
  565. try
  566. {
  567. if (abilities.Count < 256)
  568. {
  569. await Task.WhenAll(abilities);
  570. }
  571. else
  572. {
  573. int pages = (abilities.Count + 255) / 256;
  574. for (int i = 0; i < pages; i++)
  575. {
  576. List<Task<ItemResponse<Ability>>> tempAbility = abilities.Skip((i) * 256).Take(256).ToList();
  577. await Task.WhenAll(tempAbility);
  578. }
  579. }
  580. }
  581. catch
  582. {
  583. return Ok(new { state = 200, msg = "创区成功,能力标准点复制失败,遗留数据影响!" });
  584. }
  585. try
  586. {
  587. //微能力点
  588. await foreach (var atask in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<AbilityTask>(queryText: $"select value(c) from c ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"AbilityTask-{_newStandard}") }))
  589. {
  590. List<Tnode> tnodes = new();
  591. foreach (Tnode tnode in atask.children)
  592. {
  593. if (tnode.rnodes != null)
  594. {
  595. List<Rnode> rnodes = new();
  596. foreach (Rnode rnode in tnode.rnodes)
  597. {
  598. if (!string.IsNullOrEmpty($"{rnode.link}"))
  599. {
  600. rnode.link = rnode.link.Replace($"/{_newStandard}/", $"/{_oldStandard}/");
  601. }
  602. rnodes.Add(rnode);
  603. }
  604. tnode.rnodes = rnodes;
  605. }
  606. tnodes.Add(tnode);
  607. }
  608. atask.children = tnodes;
  609. atask.code = $"AbilityTask-{_oldStandard}";
  610. atask.standard = $"{_oldStandard}";
  611. atask.codeval = $"{_oldStandard}";
  612. ////添加区能力标准点中的节点
  613. //abilityTasks.Add(cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").CreateItemAsync(atask, new PartitionKey($"AbilityTask-{_oldStandard}")));
  614. await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").CreateItemAsync(atask, new PartitionKey($"AbilityTask-{_oldStandard}"));
  615. }
  616. }
  617. catch
  618. {
  619. return Ok(new { state = 200, msg = "创区成功,能力标准创建成功,微能力点复制失败,遗留数据影响!" });
  620. }
  621. StandardFile saveFile = new();
  622. //新政策文件
  623. await foreach (StandardFile standardFile in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<StandardFile>(queryText: $"select value(c) from c where c.id='{_newId}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"StandardFile") }))
  624. {
  625. if (standardFile != null)
  626. {
  627. standardFile.standard = $"{_oldStandard}";
  628. standardFile.id = $"{_oldId}";
  629. saveFile = standardFile;
  630. }
  631. }
  632. StandardFile tempFile = new();
  633. try
  634. {
  635. tempFile = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemAsync<StandardFile>(saveFile.id, new PartitionKey("StandardFile"));
  636. }
  637. catch
  638. {
  639. }
  640. if (tempFile.id != null)
  641. {
  642. if (tempFile.id.Equals(saveFile.id))
  643. await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReplaceItemAsync<StandardFile>(saveFile, saveFile.id, new PartitionKey("StandardFile")); //直接替换以前的数据
  644. else
  645. await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").CreateItemAsync(saveFile, new PartitionKey($"StandardFile")); // 需要删除原来的政策文件数据在进行添加
  646. }
  647. //新的区域设置
  648. AreaSetting saveSetting = new AreaSetting();
  649. await foreach (AreaSetting areaSetting in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<AreaSetting>(queryText: $"select value(c) from c where c.id='{_newId}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("AreaSetting") }))
  650. {
  651. if (areaSetting != null)
  652. {
  653. areaSetting.accessConfig = null;
  654. areaSetting.id = $"{_oldId}";
  655. saveSetting = areaSetting;
  656. }
  657. }
  658. AreaSetting tempSetting = new();
  659. try
  660. {
  661. tempSetting = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemAsync<AreaSetting>(saveSetting.id, new PartitionKey("StandardFile"));
  662. }
  663. catch
  664. {
  665. }
  666. if (tempSetting.id != null)
  667. {
  668. if (tempSetting.id.Equals(saveSetting.id))
  669. await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReplaceItemAsync<AreaSetting>(saveSetting, saveSetting.id, new PartitionKey($"AreaSetting")); //直接替换以前的数据
  670. else
  671. await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").CreateItemAsync(saveSetting, new PartitionKey($"AreaSetting")); //需要删除原来的区域设置数据在进行添加
  672. }
  673. //发送消息分区键
  674. string partitionCode = "DelBeforeCopyAbility-mark";
  675. //执行复制操作
  676. BatchCopyFile batchCopyFile = new BatchCopyFile();
  677. batchCopyFile.blobCntr = "teammodelos";
  678. batchCopyFile.oldFileName = $"{_newStandard}";
  679. batchCopyFile.newFileName = $"{_oldStandard}";
  680. batchCopyFile.tmdid = $"{_tmdId}";
  681. batchCopyFile.tmdIds = new List<string> { $"{ _tmdId}" };
  682. batchCopyFile.codeKey = partitionCode;
  683. batchCopyFile.tmdName = $"{_tmdName}";
  684. var messageBatchCopyFile = new ServiceBusMessage(batchCopyFile.ToJsonString());
  685. messageBatchCopyFile.ApplicationProperties.Add("name", "CopyStandardFile");
  686. try
  687. {
  688. //await _serviceBus.GetServiceBusClient().SendMessageAsync(activeTask, messageBatchCopyFile); //先执行删除操作,在执行复制 单一
  689. await serBusClient.SendMessageAsync(activeTask, messageBatchCopyFile); //先执行删除操作,在执行复制
  690. }
  691. catch (Exception)
  692. {
  693. return Ok(new { state = 201 ,msg = "能力点复制成功,复制能力点的文件失败," });
  694. }
  695. //发送消息实体
  696. Notification notification = new Notification
  697. {
  698. hubName = "hita",
  699. type = "msg",
  700. from = $"BI:{_option.Location}:private",
  701. to = new List<string> { $"{ _tmdId}" },
  702. label = $"{partitionCode}_start",
  703. body = new { location = _option.Location, biz = partitionCode, tmdid = $"{_tmdId}", tmdname = $"{_tmdName}", status = 1, time = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() }.ToJsonString(),
  704. expires = DateTimeOffset.UtcNow.AddDays(7).ToUnixTimeSeconds()
  705. };
  706. var url = _configuration.GetValue<string>("HaBookAuth:CoreService:sendnotification");
  707. var clientID = _configuration.GetValue<string>("HaBookAuth:CoreService:clientID");
  708. var clientSecret = _configuration.GetValue<string>("HaBookAuth:CoreService:clientSecret");
  709. var location = _option.Location;
  710. await _notificationService.SendNotification(clientID, clientSecret, location, url, notification); //发送站内发送消息
  711. //保存操作记录
  712. //await _azureStorage.SaveBILog("area-cut", $"{_tmdName}【{_tmdId}】已操作【{_oldStandard}】切换至{_newStandard}微能力点,复制标准:{_newStandard}", _dingDing, httpContext: HttpContext);
  713. await BIAzureStorageBlobExtensions.SaveBILog(blobClient, tableClient, "area-cut", $"{_tmdName}【{_tmdId}】已操作【{_oldStandard}】切换至{_newStandard}微能力点,复制标准:{_newStandard}", _dingDing, httpContext: HttpContext);
  714. return Ok(new { state = 200 });
  715. }
  716. catch (Exception ex)
  717. {
  718. await _dingDing.SendBotMsg($"BI,{_option.Location} batcharea/cut-standard \n {ex.Message}\n{ex.StackTrace}", GroupNames.成都开发測試群組);
  719. return BadRequest();
  720. }
  721. }
  722. /// <summary>
  723. /// 删除区域和区域的册别、能力点、区域文件、区域设置
  724. /// </summary>
  725. /// <param name="jsonElement"></param>
  726. /// <returns></returns>
  727. [HttpPost("del-area")]
  728. public async Task<IActionResult> DelArea(JsonElement jsonElement)
  729. {
  730. if (!jsonElement.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
  731. if (!jsonElement.TryGetProperty("standard", out JsonElement standard)) return BadRequest();
  732. jsonElement.TryGetProperty("site", out JsonElement site);
  733. var blobClient = _azureStorage.GetBlobContainerClient(containerName: "teammodelos");
  734. var cosmosClient = _azureCosmos.GetCosmosClient();
  735. if ($"{site}".Equals(BIConst.GlobalSite))
  736. {
  737. cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.GlobalSite);
  738. blobClient = _azureStorage.GetBlobContainerClient(containerName: "teammodelos", BIConst.GlobalSite);
  739. }
  740. var response = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync("areaId", new PartitionKey("Base-Area"));
  741. if (response.Status == 200)
  742. {
  743. using var json = await JsonDocument.ParseAsync(response.ContentStream);
  744. Area area = json.ToObject<Area>();
  745. if (area.standard == $"{standard}")
  746. {
  747. //await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").DeleteItemAsync<Area>(area.id, new PartitionKey("Base-Area")); //删除区
  748. List<string> abilityIds = new(); //册别的ID集合
  749. List<string> abilityTaskIds = new(); //章节ID集合
  750. //查询册别信息
  751. await foreach (var tempAbility in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<Ability>(queryText: $"select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Ability-{area.standard}") }))
  752. {
  753. abilityIds.Add(tempAbility.id); //查询出来册别ID添加册别ID集合
  754. }
  755. //删除册别
  756. if (abilityIds.IsNotEmpty())
  757. {
  758. //var sresponse = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").DeleteItemsStreamAsync(abilityIds, $"Ability-{area.standard}");
  759. }
  760. await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<AbilityTask>(queryText: $"select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"AbilityTask-{area.standard}") }))
  761. {
  762. abilityTaskIds.Add(item.id); //查询出来的章节信息ID添加到战绩集合
  763. }
  764. //删除章节
  765. if (abilityTaskIds.IsNotEmpty())
  766. {
  767. //var sresponse = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").DeleteItemsStreamAsync(abilityTaskIds, $"AbilityTask-{_oldStandard}");
  768. }
  769. //区域政策文件
  770. StandardFile delFile = new();
  771. var responseFile = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync(area.id, new PartitionKey("StandardFile"));
  772. if(responseFile.Status == 200)
  773. {
  774. using var fileJson = await JsonDocument.ParseAsync(responseFile.ContentStream);
  775. delFile = fileJson.ToObject<StandardFile>();
  776. //await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").DeleteItemAsync<StandardFile>(delFile.id, new PartitionKey("StandardFile"));
  777. }
  778. //区域设置
  779. AreaSetting delSet = new();
  780. var responseSet = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync(area.id, new PartitionKey("StandardFile"));
  781. if (responseFile.Status == 200)
  782. {
  783. using var fileJson = await JsonDocument.ParseAsync(responseFile.ContentStream);
  784. delSet = fileJson.ToObject<AreaSetting>();
  785. //await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").DeleteItemAsync<AreaSetting>(delSet.id, new PartitionKey("AreaSetting"));
  786. }
  787. List<object> fileobj = new();
  788. //先删除原有的文件
  789. List<Task<Response<bool>>> DelList = new List<Task<Response<bool>>>();
  790. await foreach (BlobItem blobItem in blobClient.GetBlobsAsync(BlobTraits.None, BlobStates.None, $"yxpt/{area.standard}/"))
  791. {
  792. fileobj.Add(blobItem);
  793. //DelList.Add(blobClient.GetBlobBaseClient(blobItem.Name).DeleteIfExistsAsync());
  794. }
  795. //if (DelList.Count <= 256)
  796. //{
  797. // await Task.WhenAll(DelList);
  798. //}
  799. //else
  800. //{
  801. // int pages = (DelList.Count + 255) / 256;
  802. // for (int i = 0; i < pages; i++)
  803. // {
  804. // List<Task<Response<bool>>> delList = DelList.Skip((i) * 256).Take(256).ToList();
  805. // await Task.WhenAll(delList);
  806. // }
  807. //}
  808. return Ok(new { state = 200,area, abilityIds, abilityTaskIds, });
  809. }
  810. else return Ok(new { state = 400, msg = "id和standard不匹配!" });
  811. }
  812. else return Ok(new { state = 404,msg="依据Id未找到该区!" });
  813. }
  814. /// <summary>
  815. /// 区域列表
  816. /// </summary>
  817. public record RecArea
  818. {
  819. public string id { get; set; }
  820. public string code { get; set; }
  821. public string pk { get; set; }
  822. public string name { get; set; }
  823. public string provCode { get; set; }
  824. public string provName { get; set; }
  825. public string cityCode { get; set; }
  826. public string cityName { get; set; }
  827. public string standard { get; set; }
  828. public string standardName { get; set; }
  829. public string institution { get; set; }
  830. public int schoolCount { get; set; }
  831. public List<AreaQuoteRecord> aquoteRec { get; set; } = new List<AreaQuoteRecord>();
  832. }
  833. }
  834. }