SchoolService.cs 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811
  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. var table = _azureStorage.GetCloudTableClient().GetTableReference("ScYxpt");
  30. // 5.3.1.18根据机构ID、项目ID、子项目ID返回学校列表
  31. ( int status, string json) = await _httpTrigger.RequestHttpTrigger(dict, _option.Location, "GetSchoolList");
  32. if (status == 200)
  33. {
  34. schools = json.ToObject<List<ScSchool>>(new JsonSerializerOptions { PropertyNameCaseInsensitive = false });
  35. if (ignore.IsNotEmpty())
  36. {
  37. matchSchools = schools.FindAll(x => ignore.Select(y => y.name).Contains(x.schoolname));
  38. if (matchSchools.IsNotEmpty())
  39. {
  40. if (matchSchools.Count != ignore.Count)
  41. {
  42. var matched = matchSchools.Select(x => x.schoolname);
  43. var unmatch = ignore.Select(y => y.name).Except(matched);
  44. List<string> scschoolUnmatch = schools.Select(y => y.schoolname).Except(matched).ToList();
  45. if (scschoolUnmatch.IsNotEmpty())
  46. {
  47. return new { matched, unmatch, scschoolUnmatch };
  48. }
  49. }
  50. else
  51. {
  52. matchSchools.ForEach(x => {
  53. var exschool = ignore.Find(y => y.name.Equals(x.schoolname));
  54. if (exschool != null)
  55. {
  56. x.schoolCode = exschool.id;
  57. x.areaId = $"{areaId}";
  58. x.city = $"{city}";
  59. x.dist = $"{dist}";
  60. }
  61. });
  62. }
  63. }
  64. else
  65. {
  66. return new { unmatch = ignore, schools };
  67. }
  68. }
  69. //数据校验
  70. tbschools = await table.FindListByDict<ScSchool>(new Dictionary<string, object>() { { "PartitionKey", "ScSchool" } });
  71. if (tbschools.IsNotEmpty())
  72. {
  73. var a = tbschools.Select(y => $"{y.RowKey}").ToList();
  74. saveschools = schools.Where(x => !a.Exists(z => z.Equals($"{x.schoolid}"))).ToList();
  75. List<SchoolData> schoolDatas = new List<SchoolData>();
  76. saveschools.ForEach(x =>
  77. {
  78. x.RowKey = $"{x.schoolid}";
  79. x.PartitionKey = "ScSchool";
  80. x.areaId = $"{areaId}";
  81. x.city = $"{city}";
  82. x.dist = $"{dist}";
  83. if (string.IsNullOrEmpty(x.schoolCode))
  84. {
  85. if (string.IsNullOrEmpty(x.schoolCode))
  86. {
  87. schoolDatas.Add(new SchoolData { uid = $"{x.schoolid}", province = "四川省", city = $"{city}", name = x.schoolname });
  88. }
  89. }
  90. });
  91. schoolDatas = await SchoolService.GenerateSchoolCode(schoolDatas, _dingDing, _environment);
  92. saveschools.ForEach(x => {
  93. var schoolData = schoolDatas.Find(y => y.uid.Equals($"{x.schoolid}"));
  94. if (schoolData != null && !string.IsNullOrEmpty(schoolData.id))
  95. {
  96. x.schoolCode = schoolData.id;
  97. x.areaId = $"{areaId}";
  98. x.city = $"{city}";
  99. x.dist = $"{dist}";
  100. }
  101. });
  102. saveschools.RemoveAll(x => string.IsNullOrEmpty(x.schoolCode));
  103. saveschools.RemoveAll(x => tbschools.FindAll(z => !string.IsNullOrEmpty(z.schoolCode)).Exists(y => y.schoolCode.Equals(x.schoolCode)));
  104. saveschools = await table.SaveAll(saveschools);
  105. }
  106. else
  107. {
  108. List<SchoolData> schoolDatas = new List<SchoolData>();
  109. schools.ForEach(x =>
  110. {
  111. x.RowKey = $"{x.schoolid}";
  112. x.PartitionKey = "ScSchool";
  113. x.areaId = $"{areaId}";
  114. x.city = $"{city}";
  115. x.dist = $"{dist}";
  116. var a = ignore.Find(z => z.name.Equals(x.schoolname));
  117. if (a != null)
  118. {
  119. x.schoolCode = a.id;
  120. }
  121. else
  122. {
  123. if (string.IsNullOrEmpty(x.schoolCode))
  124. {
  125. schoolDatas.Add(new SchoolData { uid = $"{x.schoolid}", province = "四川省", city = $"{city}", name = x.schoolname });
  126. }
  127. }
  128. });
  129. schoolDatas = await SchoolService.GenerateSchoolCode(schoolDatas, _dingDing, _environment);
  130. schools.ForEach(x => {
  131. var schoolData = schoolDatas.Find(y => y.uid.Equals($"{x.schoolid}"));
  132. if (schoolData != null && !string.IsNullOrEmpty(schoolData.id))
  133. {
  134. x.schoolCode = schoolData.id;
  135. x.areaId = $"{areaId}";
  136. x.city = $"{city}";
  137. x.dist = $"{dist}";
  138. }
  139. });
  140. schools.RemoveAll(x => string.IsNullOrEmpty(x.schoolCode));
  141. saveschools = await table.SaveOrUpdateAll(schools);
  142. }
  143. }
  144. return null;
  145. }
  146. public static async Task<List<SchoolData>> GenerateSchoolCode(List<SchoolData> schools, DingDing _dingDing, IWebHostEnvironment _environment)
  147. {
  148. string path = $"{_environment.ContentRootPath}/JsonFile/Core/region.json";
  149. //var schools = jsonstr.ToObject<JsonElement>().GetProperty("schools").ToObject<List<SchoolData>>();
  150. schools = schools.Where((x, i) => schools.FindIndex(n => n.name.Equals(x.name)) == i).ToList();
  151. StreamReader streamReader = new StreamReader(new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite), Encoding.UTF8);
  152. StringBuilder stringBuilder = new StringBuilder();
  153. string text;
  154. while ((text = streamReader.ReadLine()) != null)
  155. {
  156. stringBuilder.Append(text.ToString());
  157. }
  158. streamReader.Close();
  159. string input = stringBuilder.ToString();
  160. List<Region> region = input.ToObject<List<Region>>();
  161. try
  162. {
  163. schools.ForEach(x =>
  164. {
  165. x.province = ChineseConverter.Convert(x.province, ChineseConversionDirection.TraditionalToSimplified);
  166. if (String.IsNullOrEmpty(x.city))
  167. {
  168. x.city = x.province;
  169. }
  170. else
  171. {
  172. x.city = ChineseConverter.Convert(x.city, ChineseConversionDirection.TraditionalToSimplified);
  173. }
  174. x.name = ChineseConverter.Convert(x.name, ChineseConversionDirection.TraditionalToSimplified);
  175. comeRemoveStr.ForEach(c => { x.province = x.province.Replace(c, ""); });
  176. prvcRemoveStr.ForEach(c => { x.province = x.province.Replace(c, ""); });
  177. var province = region.Find(r => r.name.Contains(x.province));
  178. string tmpprovince = x.province;
  179. string tmpcity = x.city;
  180. if (province != null)
  181. {
  182. x.province = province.name;
  183. comeRemoveStr.ForEach(c => { x.city = x.city.Replace(c, ""); });
  184. cityRemoveStr.ForEach(c => { x.city = x.city.Replace(c, ""); });
  185. nationRemoveStr.ForEach(c => { x.city = x.city.Replace(c, ""); });
  186. tmpcity = x.city;
  187. var city = province.children.Find(r => r.name.Contains(x.city));
  188. if (city == null)
  189. {
  190. city = province.children.Find(r => r.name.Contains(x.city));
  191. if (city == null)
  192. {
  193. city = province.children.SelectMany(x => x.children).ToList().Find(r => r.name.Contains(x.city));
  194. }
  195. }
  196. if (city != null)
  197. {
  198. x.city = city.name;
  199. }
  200. }
  201. string name = x.name;
  202. //去除冗余的学校信息,只保留地名和校名关键信息
  203. schemoveStr.ForEach(str =>
  204. {
  205. name = name.Replace(str, "");
  206. });
  207. string[] names = name.Split("(");
  208. if (names.Length > 1)
  209. {
  210. name = $"{names[0]}";
  211. for (int index = 1; index < names.Length; index++)
  212. {
  213. name = $"{name}{names[index].Substring(0, 1)}";
  214. var afnames = names[index].Split(")");
  215. if (afnames.Length > 1)
  216. {
  217. for (int i = 1; i < afnames.Length; i++)
  218. {
  219. name = $"{name}{afnames[i]}";
  220. }
  221. }
  222. }
  223. }
  224. names = name.Split("(");
  225. if (names.Length > 1)
  226. {
  227. name = $"{names[0]}";
  228. for (int index = 1; index < names.Length; index++)
  229. {
  230. name = $"{name}{names[index].Substring(0, 1)}";
  231. var afnames = names[index].Split(")");
  232. if (afnames.Length > 1)
  233. {
  234. for (int i = 1; i < afnames.Length; i++)
  235. {
  236. name = $"{name}{afnames[i]}";
  237. }
  238. }
  239. }
  240. }
  241. name = Regex.Replace(name, "[ \\[ \\] \\^ \\-|()【】/' {}_*×――(^)$%~!@#$…&%¥—+=<>《》!!???::•`·、。,;,.;\"‘’“”-]", " ");
  242. //检查是否有英文
  243. if (Regex.Matches(name, "[a-zA-Z]").Count > 0)
  244. {
  245. var array = Regex.Split(name, "\\s+", RegexOptions.IgnoreCase);
  246. StringBuilder tmpname = new StringBuilder();
  247. if (array.Length > 1)
  248. {
  249. foreach (var item in array)
  250. {
  251. var arr = item.Select(x => $"{x}");
  252. int index = 0;
  253. foreach (var stra in arr)
  254. {
  255. if (Regex.Matches(stra, "[a-zA-Z]").Count > 0)
  256. {
  257. if (index == 1|| index == 0)
  258. {
  259. tmpname.Append(stra);
  260. }
  261. else
  262. {
  263. }
  264. }
  265. else
  266. {
  267. tmpname.Append(stra);
  268. }
  269. index++;
  270. }
  271. }
  272. }
  273. else
  274. {
  275. var arr = name.Select(x => $"{x}");
  276. int index = 0;
  277. foreach (var stra in arr)
  278. {
  279. if (Regex.Matches(stra, "[A-Z]").Count > 0)
  280. {
  281. tmpname.Append(stra);
  282. }
  283. else if (Regex.Matches(stra, "[a-z]").Count > 0)
  284. {
  285. }
  286. else
  287. {
  288. tmpname.Append(stra);
  289. }
  290. index++;
  291. }
  292. }
  293. name = tmpname.ToString();
  294. }
  295. name = Regex.Replace(name, @"\s", "");
  296. name = name.Replace("\\", "");
  297. if (name.Length > 6)
  298. {
  299. //新区,高新,产业等非新政单位
  300. areaRemoveStr.ForEach(str =>
  301. {
  302. name = name.Replace(str.Key, str.Value);
  303. });
  304. //去除冗余的学校信息,只保留地名和校名关键信息
  305. schooRemoveStr.ForEach(str =>
  306. {
  307. name = name.Replace(str, "");
  308. });
  309. //替换民族信息词
  310. if (name.Length > 6)
  311. {
  312. nationRemoveStr.ForEach(str =>
  313. {
  314. name = name.Replace(str, "");
  315. });
  316. }
  317. //替换学校信息的副词
  318. if (name.Length > 6)
  319. {
  320. foreach (var str in schooReplaceStr)
  321. {
  322. if (name.Length <= 6)
  323. {
  324. break;
  325. }
  326. name = name.Replace(str.Key, str.Value);
  327. }
  328. }
  329. //替换省简称信息词
  330. string tmpname = name;
  331. if (name.Length > 6)
  332. {
  333. proReplaceStr.ForEach(str =>
  334. {
  335. name = name.Replace(str.Key, str.Value);
  336. });
  337. //如果替换后仍然大于6位,则取消,直接替换省份完整的词
  338. if (name.Length > 6)
  339. {
  340. name = tmpname.Replace(tmpprovince, "");
  341. }
  342. }
  343. //替换城市信息词
  344. if (name.Length > 6)
  345. {
  346. name = name.Replace(tmpcity, "");
  347. }
  348. }
  349. int len = name.Length;
  350. if (len > 6)
  351. {
  352. foreach (var str in afterSchoolRm)
  353. {
  354. if (name.Length <= 6)
  355. {
  356. break;
  357. }
  358. name = name.Replace(str, "");
  359. }
  360. }
  361. len = name.Length;
  362. if (len >= 6)
  363. {
  364. name = $"{name.Substring(0, 1)}{name.Substring(len - 5, 3)}{name.Substring(len - 2, 2)}";
  365. }
  366. //if (len <= 7 && len > 6)
  367. //{
  368. // name = name.Substring(len - 6);
  369. //}
  370. if (len <= 4)
  371. {
  372. name = $"{x.city.Substring(0, 2)}{name}";
  373. }
  374. if (len == 5)
  375. {
  376. name = $"{x.city.Substring(0, 1)}{name}";
  377. }
  378. string code = ToFirstPinYin(name);
  379. x.aname = name;
  380. x.id = code;
  381. });
  382. }
  383. catch (Exception ex)
  384. {
  385. await _dingDing.SendBotMsg($"{ex.Message}\n{ex.StackTrace}\n", GroupNames.醍摩豆服務運維群組);
  386. }
  387. string a_z = "abcdefghijklmnopqrstuvwxyz";
  388. 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();
  389. data.ForEach(x =>
  390. {
  391. if (x.count > 1)
  392. {
  393. var first = x.list.First();
  394. var same = x.list.Skip(1).Take(x.count - 1).ToList();
  395. var fs = first.aname.Select(x => x).ToArray();
  396. same.ForEach(z =>
  397. {
  398. var sp = z.aname.Select(x => x).ToArray();
  399. int len = sp.Length;
  400. if (sp.Length >= fs.Length)
  401. {
  402. len = fs.Count();
  403. }
  404. for (int index = 0; index < len; index++)
  405. {
  406. if (!$"{sp[index]}".Equals($"{fs[index]}"))
  407. {
  408. short st = ChineseChar.GetStrokeNumber(sp[index]);
  409. if (st > 0)
  410. {
  411. var ins = st % 27;
  412. var insch = a_z[ins];
  413. if (z.aname.EndsWith($"{insch}"))
  414. {
  415. ins = (st + 1) % 27;
  416. insch = a_z[ins];
  417. }
  418. z.id = z.id.Insert(index, $"{insch}").Remove(index + 1, 1);
  419. break;
  420. }
  421. }
  422. }
  423. });
  424. }
  425. });
  426. 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();
  427. dataz.ForEach(x =>
  428. {
  429. if (x.count > 1)
  430. {
  431. var first = x.list.First();
  432. var same = x.list.Skip(1).Take(x.count - 1).ToList();
  433. var fs = first.aname.Select(x => x).ToArray();
  434. same.ForEach(z =>
  435. {
  436. var sp = z.aname.Select(x => x).ToArray();
  437. int len = sp.Length;
  438. if (sp.Length >= fs.Length)
  439. {
  440. len = fs.Count();
  441. }
  442. for (int index = 0; index < len; index++)
  443. {
  444. if (!$"{sp[index]}".Equals($"{fs[index]}"))
  445. {
  446. var spstr = ToPinYin($"{sp[index]}" );
  447. var fsstr = ToPinYin($"{fs[index]}");
  448. var insch= spstr.Select(x => $"{x}").Except( fsstr.Select(z => $"{z}"));
  449. if (insch != null && insch.Count() > 0) {
  450. if (index > 1)
  451. {
  452. z.id = z.id.Insert(index - 1, insch.First()).Remove(index, 1);
  453. }
  454. else if (index == 1)
  455. {
  456. z.id = z.id.Insert(index, insch.First()).Remove(index - 1, 1);
  457. }
  458. }
  459. }
  460. }
  461. });
  462. }
  463. });
  464. 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();
  465. Random random = new Random();
  466. List<SchoolData> list = new List<SchoolData>();
  467. dataa.ForEach(x =>
  468. {
  469. if (x.count > 1)
  470. {
  471. x.list.ForEach(y => {
  472. int r= random.Next(25);
  473. int index= random.Next(5);
  474. y.id = y.id.Insert(index - 1, $"{a_z[r]}").Remove(index, 1);
  475. });
  476. }
  477. list.AddRange(x.list);
  478. });
  479. return list;
  480. }
  481. public static string ToPinYin(string val)
  482. {
  483. StringBuilder sb = new StringBuilder();
  484. val.ToCharArray().ToList().ForEach(x =>
  485. {
  486. if (('a' <= x && x <= 'z') || ('A' <= x && x <= 'Z') || ('0' <= x && x <= '9'))
  487. {
  488. sb.Append(x);
  489. }
  490. else
  491. {
  492. try
  493. {
  494. ChineseChar cc = new ChineseChar(x);
  495. if (cc.Pinyins.Count > 0 && cc.Pinyins[0].Length > 0)
  496. {
  497. sb.Append(cc.Pinyins[0]);
  498. }
  499. }
  500. catch (Exception ex)
  501. {
  502. }
  503. }
  504. });
  505. return sb.ToString().ToLower();
  506. }
  507. public static string ToFirstPinYin(string val)
  508. {
  509. StringBuilder sb = new StringBuilder();
  510. val.ToCharArray().ToList().ForEach(x =>
  511. {
  512. if (('a' <= x && x <= 'z') || ('A' <= x && x <= 'Z') || ('0' <= x && x <= '9'))
  513. {
  514. sb.Append(x);
  515. }
  516. else
  517. {
  518. try
  519. {
  520. ChineseChar cc = new ChineseChar(x);
  521. if (cc.Pinyins.Count > 0 && cc.Pinyins[0].Length > 0)
  522. {
  523. sb.Append(cc.Pinyins[0][0]);
  524. }
  525. }
  526. catch (Exception ex)
  527. {
  528. }
  529. }
  530. });
  531. return sb.ToString().ToLower();
  532. }
  533. public class SchoolData
  534. {
  535. public string province { get; set; }
  536. public string id { get; set; }
  537. public string name { get; set; }
  538. public string city { get; set; }
  539. public string aname { get; set; }
  540. public string uid { get; set; }
  541. }
  542. public static List<string> comeRemoveStr = new List<string>() { "省", "市", "区", "州", "县", "旗", "盟", "自治" };
  543. public static List<string> prvcRemoveStr = new List<string>() { "回族", "维吾尔", "壮族", };
  544. public static List<string> cityRemoveStr = new List<string>() { "蒙古族", "地区", "壮族", "朝鲜族", "直辖" };
  545. public static List<string> nationRemoveStr = new List<string> {
  546. "维吾尔","回族", "自治", "满族", "蒙古", "壮族", "苗族" , "侗族", "瑶族",
  547. "达斡尔","鄂温克","朝鲜","畲族","土家","各族","仫佬","毛南","羌族","彝族","仡佬","布依","水族",
  548. "傣族","纳西","哈尼","拉祜","佤族","傈僳","独龙","怒族","白族","普米","固族","哈萨克","土族","撒拉","景颇","族"
  549. };
  550. public static List<string> schemoveStr = new List<string> { "第", "校区", "部", "楼", "与", "学校", "校园", };
  551. public static List<string> schooRemoveStr = new List<string>() {"省", "市", "区", "州", "县", "旗", "盟","办事处","街道", "自治",
  552. "镇","村","乡","街","路","站","馆"
  553. };
  554. public static List<string> afterSchoolRm = new List<string>() {"校","园","院", "湾","峡","沟","山","庄",
  555. "堡","江","屯","岭","溪","河","桥","营","铺","坡","寨","场","湖","巷","集","关","庙","寺","矿","塘"};
  556. public static List<KeyValuePair<string, string>> areaRemoveStr = new List<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. new KeyValuePair<string, string>("制造", "")
  587. };
  588. public static List<KeyValuePair<string, string>> schooReplaceStr = new List<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. new KeyValuePair<string, string>("自动化", "自") ,
  718. };
  719. public static List<KeyValuePair<string, string>> proReplaceStr = new List<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. new KeyValuePair<string, string>("台湾","台")
  754. };
  755. /*
  756. [
  757. {"method":"台北市","params":{"CountryId":"TW","CityId":"30"}},1
  758. {"method":"新北市","params":{"CountryId":"TW","CityId":"01"}},1
  759. {"method":"桃园市","params":{"CountryId":"TW","CityId":"03"}},1
  760. {"method":"台中市","params":{"CountryId":"TW","CityId":"66"}},1
  761. {"method":"台南市","params":{"CountryId":"TW","CityId":"67"}},1
  762. {"method":"高雄市","params":{"CountryId":"TW","CityId":"64"}},1
  763. {"method":"基隆市","params":{"CountryId":"TW","CityId":"17"}},1
  764. {"method":"新竹市","params":{"CountryId":"TW","CityId":"18"}},1
  765. {"method":"嘉义市","params":{"CountryId":"TW","CityId":"20"}},1
  766. {"method":"新竹县","params":{"CountryId":"TW","CityId":"04"}},1
  767. {"method":"苗栗县","params":{"CountryId":"TW","CityId":"05"}},1
  768. {"method":"彰化县","params":{"CountryId":"TW","CityId":"07"}},1
  769. {"method":"南投县","params":{"CountryId":"TW","CityId":"08"}},1
  770. {"method":"云林县","params":{"CountryId":"TW","CityId":"09"}},1
  771. {"method":"嘉义县","params":{"CountryId":"TW","CityId":"10"}},1
  772. {"method":"屏东县","params":{"CountryId":"TW","CityId":"13"}},1
  773. {"method":"宜兰县","params":{"CountryId":"TW","CityId":"02"}},1
  774. {"method":"花莲县","params":{"CountryId":"TW","CityId":"15"}},1
  775. {"method":"台东县","params":{"CountryId":"TW","CityId":"14"}},1
  776. {"method":"澎湖县","params":{"CountryId":"TW","CityId":"16"}},1
  777. {"method":"金门县","params":{"CountryId":"TW","CityId":"71"}},
  778. {"method":"连江县","params":{"CountryId":"TW","CityId":"72"}}
  779. ]
  780. */
  781. }
  782. }