SchoolService.cs 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810
  1. using HTEXLib.COMM.Helpers;
  2. using Microsoft.AspNetCore.Hosting;
  3. using Microsoft.International.Converters.PinYinConverter;
  4. using Microsoft.International.Converters.TraditionalChineseToSimplifiedConverter;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.IO;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Text.Json;
  11. using System.Text.RegularExpressions;
  12. using System.Threading.Tasks;
  13. using TEAMModelOS.Models;
  14. using TEAMModelOS.SDK.DI;
  15. using TEAMModelOS.SDK.Extension;
  16. using TEAMModelOS.SDK.Models;
  17. namespace TEAMModelOS.SDK
  18. {
  19. public class SchoolService
  20. {
  21. public static async Task<object> DoScsApiSchool(HttpTrigger _httpTrigger,Dictionary<string,object> dict, Option _option, List<IdNameCode> ignore,
  22. string areaId,string city,string dist, AzureStorageFactory _azureStorage ,DingDing _dingDing, IWebHostEnvironment _environment
  23. )
  24. {
  25. List<ScSchool> tbschools = null;
  26. List<ScSchool> matchSchools = null;
  27. List<ScSchool> schools = null;
  28. List<ScSchool> saveschools = null;
  29. // 5.3.1.18根据机构ID、项目ID、子项目ID返回学校列表
  30. ( int status, string json) = await _httpTrigger.RequestHttpTrigger(dict, _option.Location, "GetSchoolList");
  31. if (status == 200)
  32. {
  33. schools = json.ToObject<List<ScSchool>>(new JsonSerializerOptions { PropertyNameCaseInsensitive = false });
  34. if (ignore.IsNotEmpty())
  35. {
  36. matchSchools = schools.FindAll(x => ignore.Select(y => y.name).Contains(x.schoolname));
  37. if (matchSchools.IsNotEmpty())
  38. {
  39. if (matchSchools.Count != ignore.Count)
  40. {
  41. var matched = matchSchools.Select(x => x.schoolname);
  42. var unmatch = ignore.Select(y => y.name).Except(matched);
  43. List<string> scschoolUnmatch = schools.Select(y => y.schoolname).Except(matched).ToList();
  44. if (scschoolUnmatch.IsNotEmpty())
  45. {
  46. return new { matched, unmatch, scschoolUnmatch };
  47. }
  48. }
  49. else
  50. {
  51. matchSchools.ForEach(x => {
  52. var exschool = ignore.Find(y => y.name.Equals(x.schoolname));
  53. if (exschool != null)
  54. {
  55. x.schoolCode = exschool.id;
  56. x.areaId = $"{areaId}";
  57. x.city = $"{city}";
  58. x.dist = $"{dist}";
  59. }
  60. });
  61. }
  62. }
  63. else
  64. {
  65. return new { unmatch = ignore, schools };
  66. }
  67. }
  68. //数据校验
  69. tbschools = await _azureStorage.FindListByDict<ScSchool>(new Dictionary<string, object>() { { "PartitionKey", "ScSchool" } });
  70. if (tbschools.IsNotEmpty())
  71. {
  72. var a = tbschools.Select(y => $"{y.RowKey}").ToList();
  73. saveschools = schools.Where(x => !a.Exists(z => z.Equals($"{x.schoolid}"))).ToList();
  74. List<SchoolData> schoolDatas = new List<SchoolData>();
  75. saveschools.ForEach(x =>
  76. {
  77. x.RowKey = $"{x.schoolid}";
  78. x.PartitionKey = "ScSchool";
  79. x.areaId = $"{areaId}";
  80. x.city = $"{city}";
  81. x.dist = $"{dist}";
  82. if (string.IsNullOrEmpty(x.schoolCode))
  83. {
  84. if (string.IsNullOrEmpty(x.schoolCode))
  85. {
  86. schoolDatas.Add(new SchoolData { uid = $"{x.schoolid}", province = "四川省", city = $"{city}", name = x.schoolname });
  87. }
  88. }
  89. });
  90. schoolDatas = await SchoolService.GenerateSchoolCode(schoolDatas, _dingDing, _environment);
  91. saveschools.ForEach(x => {
  92. var schoolData = schoolDatas.Find(y => y.uid.Equals($"{x.schoolid}"));
  93. if (schoolData != null && !string.IsNullOrEmpty(schoolData.id))
  94. {
  95. x.schoolCode = schoolData.id;
  96. x.areaId = $"{areaId}";
  97. x.city = $"{city}";
  98. x.dist = $"{dist}";
  99. }
  100. });
  101. saveschools.RemoveAll(x => string.IsNullOrEmpty(x.schoolCode));
  102. saveschools.RemoveAll(x => tbschools.FindAll(z => !string.IsNullOrEmpty(z.schoolCode)).Exists(y => y.schoolCode.Equals(x.schoolCode)));
  103. saveschools = await _azureStorage.SaveAll(saveschools);
  104. }
  105. else
  106. {
  107. List<SchoolData> schoolDatas = new List<SchoolData>();
  108. schools.ForEach(x =>
  109. {
  110. x.RowKey = $"{x.schoolid}";
  111. x.PartitionKey = "ScSchool";
  112. x.areaId = $"{areaId}";
  113. x.city = $"{city}";
  114. x.dist = $"{dist}";
  115. var a = ignore.Find(z => z.name.Equals(x.schoolname));
  116. if (a != null)
  117. {
  118. x.schoolCode = a.id;
  119. }
  120. else
  121. {
  122. if (string.IsNullOrEmpty(x.schoolCode))
  123. {
  124. schoolDatas.Add(new SchoolData { uid = $"{x.schoolid}", province = "四川省", city = $"{city}", name = x.schoolname });
  125. }
  126. }
  127. });
  128. schoolDatas = await SchoolService.GenerateSchoolCode(schoolDatas, _dingDing, _environment);
  129. schools.ForEach(x => {
  130. var schoolData = schoolDatas.Find(y => y.uid.Equals($"{x.schoolid}"));
  131. if (schoolData != null && !string.IsNullOrEmpty(schoolData.id))
  132. {
  133. x.schoolCode = schoolData.id;
  134. x.areaId = $"{areaId}";
  135. x.city = $"{city}";
  136. x.dist = $"{dist}";
  137. }
  138. });
  139. schools.RemoveAll(x => string.IsNullOrEmpty(x.schoolCode));
  140. saveschools = await _azureStorage.SaveOrUpdateAll(schools);
  141. }
  142. }
  143. return null;
  144. }
  145. public static async Task<List<SchoolData>> GenerateSchoolCode(List<SchoolData> schools, DingDing _dingDing, IWebHostEnvironment _environment)
  146. {
  147. string path = $"{_environment.ContentRootPath}/JsonFile/Core/region.json";
  148. //var schools = jsonstr.ToObject<JsonElement>().GetProperty("schools").ToObject<List<SchoolData>>();
  149. schools = schools.Where((x, i) => schools.FindIndex(n => n.name.Equals(x.name)) == i).ToList();
  150. StreamReader streamReader = new StreamReader(new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite), Encoding.UTF8);
  151. StringBuilder stringBuilder = new StringBuilder();
  152. string text;
  153. while ((text = streamReader.ReadLine()) != null)
  154. {
  155. stringBuilder.Append(text.ToString());
  156. }
  157. streamReader.Close();
  158. string input = stringBuilder.ToString();
  159. List<Region> region = input.ToObject<List<Region>>();
  160. try
  161. {
  162. schools.ForEach(x =>
  163. {
  164. x.province = ChineseConverter.Convert(x.province, ChineseConversionDirection.TraditionalToSimplified);
  165. if (String.IsNullOrEmpty(x.city))
  166. {
  167. x.city = x.province;
  168. }
  169. else
  170. {
  171. x.city = ChineseConverter.Convert(x.city, ChineseConversionDirection.TraditionalToSimplified);
  172. }
  173. x.name = ChineseConverter.Convert(x.name, ChineseConversionDirection.TraditionalToSimplified);
  174. comeRemoveStr.ForEach(c => { x.province = x.province.Replace(c, ""); });
  175. prvcRemoveStr.ForEach(c => { x.province = x.province.Replace(c, ""); });
  176. var province = region.Find(r => r.name.Contains(x.province));
  177. string tmpprovince = x.province;
  178. string tmpcity = x.city;
  179. if (province != null)
  180. {
  181. x.province = province.name;
  182. comeRemoveStr.ForEach(c => { x.city = x.city.Replace(c, ""); });
  183. cityRemoveStr.ForEach(c => { x.city = x.city.Replace(c, ""); });
  184. nationRemoveStr.ForEach(c => { x.city = x.city.Replace(c, ""); });
  185. tmpcity = x.city;
  186. var city = province.children.Find(r => r.name.Contains(x.city));
  187. if (city == null)
  188. {
  189. city = province.children.Find(r => r.name.Contains(x.city));
  190. if (city == null)
  191. {
  192. city = province.children.SelectMany(x => x.children).ToList().Find(r => r.name.Contains(x.city));
  193. }
  194. }
  195. if (city != null)
  196. {
  197. x.city = city.name;
  198. }
  199. }
  200. string name = x.name;
  201. //去除冗余的学校信息,只保留地名和校名关键信息
  202. schemoveStr.ForEach(str =>
  203. {
  204. name = name.Replace(str, "");
  205. });
  206. string[] names = name.Split("(");
  207. if (names.Length > 1)
  208. {
  209. name = $"{names[0]}";
  210. for (int index = 1; index < names.Length; index++)
  211. {
  212. name = $"{name}{names[index].Substring(0, 1)}";
  213. var afnames = names[index].Split(")");
  214. if (afnames.Length > 1)
  215. {
  216. for (int i = 1; i < afnames.Length; i++)
  217. {
  218. name = $"{name}{afnames[i]}";
  219. }
  220. }
  221. }
  222. }
  223. names = name.Split("(");
  224. if (names.Length > 1)
  225. {
  226. name = $"{names[0]}";
  227. for (int index = 1; index < names.Length; index++)
  228. {
  229. name = $"{name}{names[index].Substring(0, 1)}";
  230. var afnames = names[index].Split(")");
  231. if (afnames.Length > 1)
  232. {
  233. for (int i = 1; i < afnames.Length; i++)
  234. {
  235. name = $"{name}{afnames[i]}";
  236. }
  237. }
  238. }
  239. }
  240. name = Regex.Replace(name, "[ \\[ \\] \\^ \\-|()【】/' {}_*×――(^)$%~!@#$…&%¥—+=<>《》!!???::•`·、。,;,.;\"‘’“”-]", " ");
  241. //检查是否有英文
  242. if (Regex.Matches(name, "[a-zA-Z]").Count > 0)
  243. {
  244. var array = Regex.Split(name, "\\s+", RegexOptions.IgnoreCase);
  245. StringBuilder tmpname = new StringBuilder();
  246. if (array.Length > 1)
  247. {
  248. foreach (var item in array)
  249. {
  250. var arr = item.Select(x => $"{x}");
  251. int index = 0;
  252. foreach (var stra in arr)
  253. {
  254. if (Regex.Matches(stra, "[a-zA-Z]").Count > 0)
  255. {
  256. if (index == 1|| index == 0)
  257. {
  258. tmpname.Append(stra);
  259. }
  260. else
  261. {
  262. }
  263. }
  264. else
  265. {
  266. tmpname.Append(stra);
  267. }
  268. index++;
  269. }
  270. }
  271. }
  272. else
  273. {
  274. var arr = name.Select(x => $"{x}");
  275. int index = 0;
  276. foreach (var stra in arr)
  277. {
  278. if (Regex.Matches(stra, "[A-Z]").Count > 0)
  279. {
  280. tmpname.Append(stra);
  281. }
  282. else if (Regex.Matches(stra, "[a-z]").Count > 0)
  283. {
  284. }
  285. else
  286. {
  287. tmpname.Append(stra);
  288. }
  289. index++;
  290. }
  291. }
  292. name = tmpname.ToString();
  293. }
  294. name = Regex.Replace(name, @"\s", "");
  295. name = name.Replace("\\", "");
  296. if (name.Length > 6)
  297. {
  298. //新区,高新,产业等非新政单位
  299. areaRemoveStr.ForEach(str =>
  300. {
  301. name = name.Replace(str.Key, str.Value);
  302. });
  303. //去除冗余的学校信息,只保留地名和校名关键信息
  304. schooRemoveStr.ForEach(str =>
  305. {
  306. name = name.Replace(str, "");
  307. });
  308. //替换民族信息词
  309. if (name.Length > 6)
  310. {
  311. nationRemoveStr.ForEach(str =>
  312. {
  313. name = name.Replace(str, "");
  314. });
  315. }
  316. //替换学校信息的副词
  317. if (name.Length > 6)
  318. {
  319. foreach (var str in schooReplaceStr)
  320. {
  321. if (name.Length <= 6)
  322. {
  323. break;
  324. }
  325. name = name.Replace(str.Key, str.Value);
  326. }
  327. }
  328. //替换省简称信息词
  329. string tmpname = name;
  330. if (name.Length > 6)
  331. {
  332. proReplaceStr.ForEach(str =>
  333. {
  334. name = name.Replace(str.Key, str.Value);
  335. });
  336. //如果替换后仍然大于6位,则取消,直接替换省份完整的词
  337. if (name.Length > 6)
  338. {
  339. name = tmpname.Replace(tmpprovince, "");
  340. }
  341. }
  342. //替换城市信息词
  343. if (name.Length > 6)
  344. {
  345. name = name.Replace(tmpcity, "");
  346. }
  347. }
  348. int len = name.Length;
  349. if (len > 6)
  350. {
  351. foreach (var str in afterSchoolRm)
  352. {
  353. if (name.Length <= 6)
  354. {
  355. break;
  356. }
  357. name = name.Replace(str, "");
  358. }
  359. }
  360. len = name.Length;
  361. if (len >= 6)
  362. {
  363. name = $"{name.Substring(0, 1)}{name.Substring(len - 5, 3)}{name.Substring(len - 2, 2)}";
  364. }
  365. //if (len <= 7 && len > 6)
  366. //{
  367. // name = name.Substring(len - 6);
  368. //}
  369. if (len <= 4)
  370. {
  371. name = $"{x.city.Substring(0, 2)}{name}";
  372. }
  373. if (len == 5)
  374. {
  375. name = $"{x.city.Substring(0, 1)}{name}";
  376. }
  377. string code = ToFirstPinYin(name);
  378. x.aname = name;
  379. x.id = code;
  380. });
  381. }
  382. catch (Exception ex)
  383. {
  384. await _dingDing.SendBotMsg($"{ex.Message}\n{ex.StackTrace}", GroupNames.成都开发測試群組);
  385. }
  386. string a_z = "abcdefghijklmnopqrstuvwxyz";
  387. var data = schools.GroupBy(x => x.id).Select(x => new { key = x.Key, more = x.ToList().Count > 2, count = x.ToList().Count, list = x.ToList() }).ToList();
  388. data.ForEach(x =>
  389. {
  390. if (x.count > 1)
  391. {
  392. var first = x.list.First();
  393. var same = x.list.Skip(1).Take(x.count - 1).ToList();
  394. var fs = first.aname.Select(x => x).ToArray();
  395. same.ForEach(z =>
  396. {
  397. var sp = z.aname.Select(x => x).ToArray();
  398. int len = sp.Length;
  399. if (sp.Length >= fs.Length)
  400. {
  401. len = fs.Count();
  402. }
  403. for (int index = 0; index < len; index++)
  404. {
  405. if (!$"{sp[index]}".Equals($"{fs[index]}"))
  406. {
  407. short st = ChineseChar.GetStrokeNumber(sp[index]);
  408. if (st > 0)
  409. {
  410. var ins = st % 27;
  411. var insch = a_z[ins];
  412. if (z.aname.EndsWith($"{insch}"))
  413. {
  414. ins = (st + 1) % 27;
  415. insch = a_z[ins];
  416. }
  417. z.id = z.id.Insert(index, $"{insch}").Remove(index + 1, 1);
  418. break;
  419. }
  420. }
  421. }
  422. });
  423. }
  424. });
  425. var dataz = data.SelectMany(y=>y.list).GroupBy(x => x.id).Select(x => new { key = x.Key, more = x.ToList().Count > 2, count = x.ToList().Count, list = x.ToList() }).ToList();
  426. dataz.ForEach(x =>
  427. {
  428. if (x.count > 1)
  429. {
  430. var first = x.list.First();
  431. var same = x.list.Skip(1).Take(x.count - 1).ToList();
  432. var fs = first.aname.Select(x => x).ToArray();
  433. same.ForEach(z =>
  434. {
  435. var sp = z.aname.Select(x => x).ToArray();
  436. int len = sp.Length;
  437. if (sp.Length >= fs.Length)
  438. {
  439. len = fs.Count();
  440. }
  441. for (int index = 0; index < len; index++)
  442. {
  443. if (!$"{sp[index]}".Equals($"{fs[index]}"))
  444. {
  445. var spstr = ToPinYin($"{sp[index]}" );
  446. var fsstr = ToPinYin($"{fs[index]}");
  447. var insch= spstr.Select(x => $"{x}").Except( fsstr.Select(z => $"{z}"));
  448. if (insch != null && insch.Count() > 0) {
  449. if (index > 1)
  450. {
  451. z.id = z.id.Insert(index - 1, insch.First()).Remove(index, 1);
  452. }
  453. else if (index == 1)
  454. {
  455. z.id = z.id.Insert(index, insch.First()).Remove(index - 1, 1);
  456. }
  457. }
  458. }
  459. }
  460. });
  461. }
  462. });
  463. var dataa = dataz.SelectMany(y => y.list).GroupBy(x => x.id).Select(x => new { key = x.Key, more = x.ToList().Count > 2, count = x.ToList().Count, list = x.ToList() }).ToList();
  464. Random random = new Random();
  465. List<SchoolData> list = new List<SchoolData>();
  466. dataa.ForEach(x =>
  467. {
  468. if (x.count > 1)
  469. {
  470. x.list.ForEach(y => {
  471. int r= random.Next(25);
  472. int index= random.Next(5);
  473. y.id = y.id.Insert(index - 1, $"{a_z[r]}").Remove(index, 1);
  474. });
  475. }
  476. list.AddRange(x.list);
  477. });
  478. return list;
  479. }
  480. public static string ToPinYin(string val)
  481. {
  482. StringBuilder sb = new StringBuilder();
  483. val.ToCharArray().ToList().ForEach(x =>
  484. {
  485. if (('a' <= x && x <= 'z') || ('A' <= x && x <= 'Z') || ('0' <= x && x <= '9'))
  486. {
  487. sb.Append(x);
  488. }
  489. else
  490. {
  491. try
  492. {
  493. ChineseChar cc = new ChineseChar(x);
  494. if (cc.Pinyins.Count > 0 && cc.Pinyins[0].Length > 0)
  495. {
  496. sb.Append(cc.Pinyins[0]);
  497. }
  498. }
  499. catch (Exception ex)
  500. {
  501. }
  502. }
  503. });
  504. return sb.ToString().ToLower();
  505. }
  506. public static string ToFirstPinYin(string val)
  507. {
  508. StringBuilder sb = new StringBuilder();
  509. val.ToCharArray().ToList().ForEach(x =>
  510. {
  511. if (('a' <= x && x <= 'z') || ('A' <= x && x <= 'Z') || ('0' <= x && x <= '9'))
  512. {
  513. sb.Append(x);
  514. }
  515. else
  516. {
  517. try
  518. {
  519. ChineseChar cc = new ChineseChar(x);
  520. if (cc.Pinyins.Count > 0 && cc.Pinyins[0].Length > 0)
  521. {
  522. sb.Append(cc.Pinyins[0][0]);
  523. }
  524. }
  525. catch (Exception ex)
  526. {
  527. }
  528. }
  529. });
  530. return sb.ToString().ToLower();
  531. }
  532. public class SchoolData
  533. {
  534. public string province { get; set; }
  535. public string id { get; set; }
  536. public string name { get; set; }
  537. public string city { get; set; }
  538. public string aname { get; set; }
  539. public string uid { get; set; }
  540. }
  541. public static List<string> comeRemoveStr = new List<string>() { "省", "市", "区", "州", "县", "旗", "盟", "自治" };
  542. public static List<string> prvcRemoveStr = new List<string>() { "回族", "维吾尔", "壮族", };
  543. public static List<string> cityRemoveStr = new List<string>() { "蒙古族", "地区", "壮族", "朝鲜族", "直辖" };
  544. public static List<string> nationRemoveStr = new List<string> {
  545. "维吾尔","回族", "自治", "满族", "蒙古", "壮族", "苗族" , "侗族", "瑶族",
  546. "达斡尔","鄂温克","朝鲜","畲族","土家","各族","仫佬","毛南","羌族","彝族","仡佬","布依","水族",
  547. "傣族","纳西","哈尼","拉祜","佤族","傈僳","独龙","怒族","白族","普米","固族","哈萨克","土族","撒拉","景颇","族"
  548. };
  549. public static List<string> schemoveStr = new List<string> { "第", "校区", "部", "楼", "与", "学校", "校园", };
  550. public static List<string> schooRemoveStr = new List<string>() {"省", "市", "区", "州", "县", "旗", "盟","办事处","街道", "自治",
  551. "镇","村","乡","街","路","站","馆"
  552. };
  553. public static List<string> afterSchoolRm = new List<string>() {"校","园","院", "湾","峡","沟","山","庄",
  554. "堡","江","屯","岭","溪","河","桥","营","铺","坡","寨","场","湖","巷","集","关","庙","寺","矿","塘"};
  555. public static List<KeyValuePair<string, string>> areaRemoveStr = new List<KeyValuePair<string, string>>{
  556. new KeyValuePair<string, string>("高新技术产业开发区", "高") ,
  557. new KeyValuePair<string, string>("经济技术开发区", "经") ,
  558. new KeyValuePair<string, string>("国际", "际") ,
  559. new KeyValuePair<string, string>("中国", ""),
  560. new KeyValuePair<string, string>("国家", ""),
  561. new KeyValuePair<string, string>("新区", ""),
  562. new KeyValuePair<string, string>("高新", "高"),
  563. new KeyValuePair<string, string>("园区", ""),
  564. new KeyValuePair<string, string>("产业", "产"),
  565. new KeyValuePair<string, string>("经济", "经"),
  566. new KeyValuePair<string, string>("开发", "开"),
  567. new KeyValuePair<string, string>("中心", "") ,
  568. new KeyValuePair<string, string>("集团", "") ,
  569. new KeyValuePair<string, string>("公司", "") ,
  570. new KeyValuePair<string, string>("有限", "") ,
  571. new KeyValuePair<string, string>("股份", "") ,
  572. new KeyValuePair<string, string>("服务", "") ,
  573. new KeyValuePair<string, string>("基地", "") ,
  574. new KeyValuePair<string, string>("社区", "社") ,
  575. new KeyValuePair<string, string>("职工", "") ,
  576. new KeyValuePair<string, string>("专修", ""),
  577. new KeyValuePair<string, string>("实验", "验"),
  578. new KeyValuePair<string, string>("完全", ""),
  579. new KeyValuePair<string, string>("一贯制", "") ,
  580. new KeyValuePair<string, string>("联办", ""),
  581. new KeyValuePair<string, string>("联合", ""),
  582. new KeyValuePair<string, string>("完小", "小"),
  583. new KeyValuePair<string, string>("义务", ""),
  584. new KeyValuePair<string, string>("基础", ""),
  585. new KeyValuePair<string, string>("制造", "")
  586. };
  587. public static List<KeyValuePair<string, string>> schooReplaceStr = new List<KeyValuePair<string, string>> {
  588. new KeyValuePair<string, string>("分校", "分") ,
  589. new KeyValuePair<string, string>("分园", "分") ,
  590. new KeyValuePair<string, string>("分院", "分") ,
  591. new KeyValuePair<string, string>("藏文", "藏"),
  592. new KeyValuePair<string, string>("职业技术学院", "职") ,
  593. new KeyValuePair<string, string>("创新创业", "创") ,
  594. new KeyValuePair<string, string>("就业创业", "就") ,
  595. new KeyValuePair<string, string>("应用核技术", "核") ,
  596. new KeyValuePair<string, string>("职业学院", "职") ,
  597. new KeyValuePair<string, string>("幼儿园", "幼") ,
  598. new KeyValuePair<string, string>("幼儿", "幼") ,
  599. new KeyValuePair<string, string>("小学", "小") ,
  600. new KeyValuePair<string, string>("中学", "中") ,
  601. new KeyValuePair<string, string>("中等", "中") ,
  602. new KeyValuePair<string, string>("双语", "双") ,
  603. new KeyValuePair<string, string>("初中", "初") ,
  604. new KeyValuePair<string, string>("初级", "初") ,
  605. new KeyValuePair<string, string>("广播", "广"),
  606. new KeyValuePair<string, string>("高中", "高") ,
  607. new KeyValuePair<string, string>("高级", "高") ,
  608. new KeyValuePair<string, string>("大学", "大") ,
  609. new KeyValuePair<string, string>("学院", "院") ,
  610. new KeyValuePair<string, string>("综合", "综") ,
  611. new KeyValuePair<string, string>("职业", "职") ,
  612. new KeyValuePair<string, string>("技术", "技") ,
  613. new KeyValuePair<string, string>("专科", "专") ,
  614. new KeyValuePair<string, string>("外国语", "外") ,
  615. new KeyValuePair<string, string>("九年", "九") ,
  616. new KeyValuePair<string, string>("五年", "五") ,
  617. new KeyValuePair<string, string>("年制", "制") ,
  618. new KeyValuePair<string, string>("高等", "高") ,
  619. new KeyValuePair<string, string>("院校", "院") ,
  620. new KeyValuePair<string, string>("初等", "小") ,
  621. new KeyValuePair<string, string>("附属", "附"),
  622. new KeyValuePair<string, string>("寄宿制", "寄") ,
  623. new KeyValuePair<string, string>("寄宿", "寄") ,
  624. new KeyValuePair<string, string>("卫生", "卫") ,
  625. new KeyValuePair<string, string>("创业", "创") ,
  626. new KeyValuePair<string, string>("继续", "继") ,
  627. new KeyValuePair<string, string>("开放", "开") ,
  628. new KeyValuePair<string, string>("技师", "技") ,
  629. new KeyValuePair<string, string>("成人", "成") ,
  630. new KeyValuePair<string, string>("教育", "教") ,
  631. new KeyValuePair<string, string>("科技", "科") ,
  632. new KeyValuePair<string, string>("行政", "政") ,
  633. new KeyValuePair<string, string>("生物", "生") ,
  634. new KeyValuePair<string, string>("美术", "美") ,
  635. new KeyValuePair<string, string>("设计", "设") ,
  636. new KeyValuePair<string, string>("传播", "传") ,
  637. new KeyValuePair<string, string>("计算机", "算") ,
  638. new KeyValuePair<string, string>("土木", "土") ,
  639. new KeyValuePair<string, string>("石油", "油") ,
  640. new KeyValuePair<string, string>("科普", "普") ,
  641. new KeyValuePair<string, string>("电信", "信") ,
  642. new KeyValuePair<string, string>("联合", "联") ,
  643. new KeyValuePair<string, string>("电商", "商") ,
  644. new KeyValuePair<string, string>("纺织", "织") ,
  645. new KeyValuePair<string, string>("服装", "服") ,
  646. new KeyValuePair<string, string>("新闻", "新") ,
  647. new KeyValuePair<string, string>("网络", "网") ,
  648. new KeyValuePair<string, string>("应用", "应") ,
  649. new KeyValuePair<string, string>("畜牧", "畜") ,
  650. new KeyValuePair<string, string>("兽医", "兽") ,
  651. new KeyValuePair<string, string>("师范", "师") ,
  652. new KeyValuePair<string, string>("人文", "文") ,
  653. new KeyValuePair<string, string>("创新", "创") ,
  654. new KeyValuePair<string, string>("法官", "法") ,
  655. new KeyValuePair<string, string>("邮电", "邮") ,
  656. new KeyValuePair<string, string>("文化", "文") ,
  657. new KeyValuePair<string, string>("函授", "函") ,
  658. new KeyValuePair<string, string>("科学", "科") ,
  659. new KeyValuePair<string, string>("信息", "息") ,
  660. new KeyValuePair<string, string>("水利", "利") ,
  661. new KeyValuePair<string, string>("水电", "电") ,
  662. new KeyValuePair<string, string>("电力", "力") ,
  663. new KeyValuePair<string, string>("环境", "环") ,
  664. new KeyValuePair<string, string>("建材", "材") ,
  665. new KeyValuePair<string, string>("机电", "机") ,
  666. new KeyValuePair<string, string>("航空", "空") ,
  667. new KeyValuePair<string, string>("航天", "天") ,
  668. new KeyValuePair<string, string>("警察", "警") ,
  669. new KeyValuePair<string, string>("警官", "警") ,
  670. new KeyValuePair<string, string>("财贸", "财") ,
  671. new KeyValuePair<string, string>("电子", "电") ,
  672. new KeyValuePair<string, string>("建筑", "筑") ,
  673. new KeyValuePair<string, string>("艺术", "艺") ,
  674. new KeyValuePair<string, string>("体育", "体") ,
  675. new KeyValuePair<string, string>("城市", "城") ,
  676. new KeyValuePair<string, string>("地质", "地") ,
  677. new KeyValuePair<string, string>("医药", "药") ,
  678. new KeyValuePair<string, string>("政法", "法") ,
  679. new KeyValuePair<string, string>("铁路", "铁") ,
  680. new KeyValuePair<string, string>("铁道", "道") ,
  681. new KeyValuePair<string, string>("轨道", "轨") ,
  682. new KeyValuePair<string, string>("交通", "通") ,
  683. new KeyValuePair<string, string>("医学院", "医") ,
  684. new KeyValuePair<string, string>("医学", "医") ,
  685. new KeyValuePair<string, string>("传媒", "媒") ,
  686. new KeyValuePair<string, string>("工程", "程") ,
  687. new KeyValuePair<string, string>("临床", "临") ,
  688. new KeyValuePair<string, string>("化工", "化") ,
  689. new KeyValuePair<string, string>("林业", "林") ,
  690. new KeyValuePair<string, string>("老年", "老") ,
  691. new KeyValuePair<string, string>("旅游", "游") ,
  692. new KeyValuePair<string, string>("护理", "护") ,
  693. new KeyValuePair<string, string>("贸易", "贸") ,
  694. new KeyValuePair<string, string>("中医药", "中医") ,
  695. new KeyValuePair<string, string>("资源", "源") ,
  696. new KeyValuePair<string, string>("冶金", "冶") ,
  697. new KeyValuePair<string, string>("能源", "能") ,
  698. new KeyValuePair<string, string>("汽车", "车") ,
  699. new KeyValuePair<string, string>("医科", "医") ,
  700. new KeyValuePair<string, string>("机械", "械") ,
  701. new KeyValuePair<string, string>("应用", "应") ,
  702. new KeyValuePair<string, string>("电气", "电") ,
  703. new KeyValuePair<string, string>("材料", "材") ,
  704. new KeyValuePair<string, string>("劳动", "劳") ,
  705. new KeyValuePair<string, string>("轻工", "轻") ,
  706. new KeyValuePair<string, string>("农业", "农") ,
  707. new KeyValuePair<string, string>("委员会", "委") ,
  708. new KeyValuePair<string, string>("专业", "专") ,
  709. new KeyValuePair<string, string>("广播", "广"),
  710. new KeyValuePair<string, string>("电视", "电") ,
  711. new KeyValuePair<string, string>("工商", "商") ,
  712. new KeyValuePair<string, string>("工业", "工") ,
  713. new KeyValuePair<string, string>("管理", "管") ,
  714. new KeyValuePair<string, string>("社会主义", "社") ,
  715. new KeyValuePair<string, string>("社会", "社") ,
  716. new KeyValuePair<string, string>("自动化", "自") ,
  717. };
  718. public static List<KeyValuePair<string, string>> proReplaceStr = new List<KeyValuePair<string, string>> {
  719. new KeyValuePair<string, string>("北京","京") ,
  720. new KeyValuePair<string, string>("天津","津") ,
  721. new KeyValuePair<string, string>("河北","冀") ,
  722. new KeyValuePair<string, string>("山西","晋") ,
  723. new KeyValuePair<string, string>("内蒙古","蒙") ,
  724. new KeyValuePair<string, string>("辽宁","辽") ,
  725. new KeyValuePair<string, string>("吉林","吉") ,
  726. new KeyValuePair<string, string>("黑龙江","黑") ,
  727. new KeyValuePair<string, string>("上海","沪") ,
  728. new KeyValuePair<string, string>("江苏","苏") ,
  729. new KeyValuePair<string, string>("浙江","浙") ,
  730. new KeyValuePair<string, string>("安徽","皖") ,
  731. new KeyValuePair<string, string>("福建","闽") ,
  732. new KeyValuePair<string, string>("江西","赣") ,
  733. new KeyValuePair<string, string>("山东","鲁") ,
  734. new KeyValuePair<string, string>("河南","豫") ,
  735. new KeyValuePair<string, string>("湖北","鄂") ,
  736. new KeyValuePair<string, string>("湖南","湘") ,
  737. new KeyValuePair<string, string>("广东","粤") ,
  738. new KeyValuePair<string, string>("广西","桂") ,
  739. new KeyValuePair<string, string>("海南","琼") ,
  740. new KeyValuePair<string, string>("四川","川") ,
  741. new KeyValuePair<string, string>("贵州","贵") ,
  742. new KeyValuePair<string, string>("云南","云") ,
  743. new KeyValuePair<string, string>("重庆","渝") ,
  744. new KeyValuePair<string, string>("西藏","藏") ,
  745. new KeyValuePair<string, string>("陕西","陕") ,
  746. new KeyValuePair<string, string>("甘肃","甘") ,
  747. new KeyValuePair<string, string>("青海","青") ,
  748. new KeyValuePair<string, string>("宁夏","宁") ,
  749. new KeyValuePair<string, string>("新疆","新") ,
  750. new KeyValuePair<string, string>("香港","港") ,
  751. new KeyValuePair<string, string>("澳门","澳") ,
  752. new KeyValuePair<string, string>("台湾","台")
  753. };
  754. /*
  755. [
  756. {"method":"台北市","params":{"CountryId":"TW","CityId":"30"}},1
  757. {"method":"新北市","params":{"CountryId":"TW","CityId":"01"}},1
  758. {"method":"桃园市","params":{"CountryId":"TW","CityId":"03"}},1
  759. {"method":"台中市","params":{"CountryId":"TW","CityId":"66"}},1
  760. {"method":"台南市","params":{"CountryId":"TW","CityId":"67"}},1
  761. {"method":"高雄市","params":{"CountryId":"TW","CityId":"64"}},1
  762. {"method":"基隆市","params":{"CountryId":"TW","CityId":"17"}},1
  763. {"method":"新竹市","params":{"CountryId":"TW","CityId":"18"}},1
  764. {"method":"嘉义市","params":{"CountryId":"TW","CityId":"20"}},1
  765. {"method":"新竹县","params":{"CountryId":"TW","CityId":"04"}},1
  766. {"method":"苗栗县","params":{"CountryId":"TW","CityId":"05"}},1
  767. {"method":"彰化县","params":{"CountryId":"TW","CityId":"07"}},1
  768. {"method":"南投县","params":{"CountryId":"TW","CityId":"08"}},1
  769. {"method":"云林县","params":{"CountryId":"TW","CityId":"09"}},1
  770. {"method":"嘉义县","params":{"CountryId":"TW","CityId":"10"}},1
  771. {"method":"屏东县","params":{"CountryId":"TW","CityId":"13"}},1
  772. {"method":"宜兰县","params":{"CountryId":"TW","CityId":"02"}},1
  773. {"method":"花莲县","params":{"CountryId":"TW","CityId":"15"}},1
  774. {"method":"台东县","params":{"CountryId":"TW","CityId":"14"}},1
  775. {"method":"澎湖县","params":{"CountryId":"TW","CityId":"16"}},1
  776. {"method":"金门县","params":{"CountryId":"TW","CityId":"71"}},
  777. {"method":"连江县","params":{"CountryId":"TW","CityId":"72"}}
  778. ]
  779. */
  780. }
  781. }