using Azure.Cosmos; using DocumentFormat.OpenXml.Bibliography; using HTEXLib.COMM.Helpers; using Microsoft.AspNetCore.Hosting; using Microsoft.International.Converters.PinYinConverter; using Microsoft.International.Converters.TraditionalChineseToSimplifiedConverter; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Text.Json; using System.Text.RegularExpressions; using System.Threading.Tasks; using TEAMModelOS.Models; using TEAMModelOS.SDK.DI; using TEAMModelOS.SDK.Extension; using TEAMModelOS.SDK.Models; namespace TEAMModelOS.SDK { public class SchoolService { /// /// 根据年级获取入学 /// /// /// public static (List> gradeYear, HashSet years) GetYears(School school, string periodId, IEnumerable grades, long time = 0) { var date = DateTimeOffset.UtcNow; //2001-09-09 09:46:40 if (time > 1000000000000) { date = DateTimeOffset.FromUnixTimeMilliseconds(time); } //年级算法 var period = school.period.Find(x => x.id.Equals(periodId)); int Day = date.Day; int Month = date.Month; int Year = date.Year; int start = int.Parse($"{Year}0901"); var se = period.semesters.Find(x => x.start == 1); if (se == null) { se = period.semesters.First(); } string sm = "09"; string sd = "01"; if (se != null) { sm = se.month >= 10 ? $"{se.month}" : $"0{se.month}"; sd = se.day >= 10 ? $"{se.day}" : $"0{se.day}"; start = int.Parse($"{Year}{sm}{sd}"); } int curr = int.Parse(date.ToString("yyyyMMdd")); //新学年开学时间大于当前时间,计算年级需要减1 20220901-20220408 > 0 则当前20220408是2021年入学的, //当前时间大于新学年开学时间,计算年级则不需要 20220901-20221203 < 1 则当前20221203是2022年入学的, //20230901-20230101 > 0 则当前20230101是2022年入学的, int dis = start - curr; List years= new List(); List> gradeYear = new List>(); foreach (int grade in grades) { int year = 0; if (dis > 0) { year = Year - grade -1; } else { year= Year - grade ; } years.Add(year); gradeYear.Add(new KeyValuePair(grade,year )); } return (gradeYear,years.ToHashSet()); } /// /// 根据年份获取年级,只返回time 或当前时间以前入学的学生年级。 /// /// /// public static (List> yearGrade,HashSet grades) GetGrades(School school,string periodId , IEnumerable years,long time =0) { var date = DateTimeOffset.UtcNow; //2001-09-09 09:46:40 if (time > 1000000000000) { date = DateTimeOffset.FromUnixTimeMilliseconds(time); } //年级算法 var period = school.period.Find(x => x.id.Equals(periodId)); int? Count = period?.grades?.Count; List> yearGrades = new List>(); if (Count.HasValue) { int Day = date.Day; int Month = date.Month; int Year = date.Year; int start = int.Parse($"{Year}0901"); var se = period.semesters.Find(x => x.start == 1); if (se == null) { se = period.semesters.First(); } string sm = "09"; string sd = "01"; if (se != null) { sm = se.month >= 10 ? $"{se.month}" : $"0{se.month}"; sd = se.day >= 10 ? $"{se.day}" : $"0{se.day}"; start = int.Parse($"{Year}{sm}{sd}"); } int curr = int.Parse(date.ToString("yyyyMMdd")); //新学年开学时间大于当前时间,计算年级需要减1 20220901-20220408 > 0 则当前20220408是2021年入学的, //当前时间大于新学年开学时间,计算年级则不需要 20220901-20221203 < 1 则当前20221203是2022年入学的, //20230901-20230101 > 0 则当前20230101是2022年入学的, int dis = start - curr; foreach (int year in years) { if (int.Parse($"{year}{sm}{sd}") < curr) { int grade; if (dis > 0) { grade = Math.Abs((Year - year - 1)) % Count.Value; } else { grade = Math.Abs((Year - year)) % Count.Value; } yearGrades.Add(new KeyValuePair(year, $"{grade}")); } } } return (yearGrades, yearGrades.Select(z=>z.Value).ToHashSet()); } /// /// 处理学期排序 /// /// /// public static List SortSemester(List semesterList) { int Year = DateTimeOffset.UtcNow.Year; List> pairs = new List>(); semesterList.ForEach(se => { string sm = se.month >= 10 ? $"{se.month}" : $"0{se.month}"; string sd = se.day >= 10 ? $"{se.day}" : $"0{se.day}"; int order = int.Parse($"{Year}{sm}{sd}"); pairs.Add(new KeyValuePair(order, se)); }); var orderPairs = pairs.OrderBy(z => z.Key); semesterList = orderPairs.Select(z => z.Value).ToList(); int startIndex = semesterList.FindIndex(z => z.start == 1); if (startIndex == -1) { //未设置学期的情况默认9月份开始的。 startIndex = semesterList.FindIndex(z => z.month == 9); //如果还未找到,就以排序结果为准 if (startIndex == -1) { startIndex = 0; } } if (startIndex > 0) { List before = semesterList.Take(startIndex).ToList(); List after = semesterList.Skip(startIndex).ToList(); semesterList = new List(); semesterList.AddRange(after); semesterList.AddRange(before); return semesterList; } else { return semesterList; } } public static async Task<(List school_classes, List graduate_classes)> DoGraduateClasses(HttpTrigger _httpTrigger, AzureCosmosFactory _azureCosmos, List periodIds, School school_base, Option _option,DingDing _dingDing, int waite = 0) { List school_classes = new List(); List graduate_classes = new List(); try { var client = _azureCosmos.GetCosmosClient(); //取得班级 int nowYear = DateTimeOffset.UtcNow.Year; int nowMonth = DateTimeOffset.UtcNow.Month; int nowDay = DateTimeOffset.UtcNow.Day; //因为修改年级,而导致取消的 List cancel_graduate_classes = new List(); string sql = $"SELECT value c FROM c where (c.graduate = 0 or IS_DEFINED(c.graduate) = false) "; if (periodIds.IsNotEmpty()) { sql = $"SELECT value c FROM c where c.periodId in ({string.Join(",", periodIds.Select(x => $"'{x}'"))}) "; } await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator //(queryText: $"SELECT value c FROM c where (c.graduate = 0 or IS_DEFINED(c.graduate) = false)", (queryText: sql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Class-{school_base.id}") })) { bool isgraduate = false; if (!string.IsNullOrWhiteSpace(item.periodId)) { var period = school_base.period.Find(x => x.id.Equals(item.periodId)); if (period != null) { var gradeCount = period.grades.Count(); //2022-2016=6(待判断月份日期是否是毕业) 2022-2017=5(未毕业) if (nowYear - item.year > gradeCount) { isgraduate = true; } else if (nowYear - item.year == gradeCount) { var semester = period.semesters.Find(x => x.start == 1); if (semester != null) { if (nowMonth > semester.month) { isgraduate = true; } else if (nowMonth == semester.month) { if (nowDay >= semester.day) { isgraduate = true; } else { } } else { isgraduate = false; } } } else { isgraduate = false; } } } if (isgraduate) { graduate_classes.Add(item); } else { if (item.graduate == 1) { item.graduate = 0; cancel_graduate_classes.Add(item); } school_classes.Add(item); } } if (graduate_classes.Any() || cancel_graduate_classes.Any()) { if (waite == 0) { _ = _httpTrigger.RequestHttpTrigger(new { graduate_classes = graduate_classes, cancel_graduate_classes = cancel_graduate_classes, schoolId = $"{school_base.id}" }, _option.Location, "graduate-change"); } else { await _httpTrigger.RequestHttpTrigger(new { graduate_classes = graduate_classes, cancel_graduate_classes = cancel_graduate_classes, schoolId = $"{school_base.id}" }, _option.Location, "graduate-change"); } } } catch (Exception ex) { await _dingDing.SendBotMsg($"{_option.Location},{ex.Message}\n{ex.StackTrace}", GroupNames.醍摩豆服務運維群組); } return (school_classes,graduate_classes); } public static async Task DoScsApiSchool(HttpTrigger _httpTrigger,Dictionary dict, Option _option, List ignore, string areaId,string city,string dist, AzureStorageFactory _azureStorage ,DingDing _dingDing, IWebHostEnvironment _environment ) { List tbschools = null; List matchSchools = null; List schools = null; List saveschools = null; var table = _azureStorage.GetCloudTableClient().GetTableReference("ScYxpt"); // 5.3.1.18根据机构ID、项目ID、子项目ID返回学校列表 ( int status, string json) = await _httpTrigger.RequestHttpTrigger(dict, _option.Location, "GetSchoolList"); if (status == 200) { schools = json.ToObject>(new JsonSerializerOptions { PropertyNameCaseInsensitive = false }); if (ignore.IsNotEmpty()) { matchSchools = schools.FindAll(x => ignore.Select(y => y.name).Contains(x.schoolname)); if (matchSchools.IsNotEmpty()) { if (matchSchools.Count != ignore.Count) { var matched = matchSchools.Select(x => x.schoolname); var unmatch = ignore.Select(y => y.name).Except(matched); List scschoolUnmatch = schools.Select(y => y.schoolname).Except(matched).ToList(); if (scschoolUnmatch.IsNotEmpty()) { return new { matched, unmatch, scschoolUnmatch }; } } else { matchSchools.ForEach(x => { var exschool = ignore.Find(y => y.name.Equals(x.schoolname)); if (exschool != null) { x.schoolCode = exschool.id; x.areaId = $"{areaId}"; x.city = $"{city}"; x.dist = $"{dist}"; } }); } } else { return new { unmatch = ignore, schools }; } } //数据校验 tbschools = await table.FindListByDict(new Dictionary() { { "PartitionKey", "ScSchool" } }); if (tbschools.IsNotEmpty()) { var a = tbschools.Select(y => $"{y.RowKey}").ToList(); saveschools = schools.Where(x => !a.Exists(z => z.Equals($"{x.schoolid}"))).ToList(); List schoolDatas = new List(); saveschools.ForEach(x => { x.RowKey = $"{x.schoolid}"; x.PartitionKey = "ScSchool"; x.areaId = $"{areaId}"; x.city = $"{city}"; x.dist = $"{dist}"; if (string.IsNullOrEmpty(x.schoolCode)) { if (string.IsNullOrEmpty(x.schoolCode)) { schoolDatas.Add(new SchoolData { uid = $"{x.schoolid}", province = "四川省", city = $"{city}", name = x.schoolname }); } } }); schoolDatas = await SchoolService.GenerateSchoolCode(schoolDatas, _dingDing, _environment); saveschools.ForEach(x => { var schoolData = schoolDatas.Find(y => y.uid.Equals($"{x.schoolid}")); if (schoolData != null && !string.IsNullOrEmpty(schoolData.id)) { x.schoolCode = schoolData.id; x.areaId = $"{areaId}"; x.city = $"{city}"; x.dist = $"{dist}"; } }); saveschools.RemoveAll(x => string.IsNullOrEmpty(x.schoolCode)); saveschools.RemoveAll(x => tbschools.FindAll(z => !string.IsNullOrEmpty(z.schoolCode)).Exists(y => y.schoolCode.Equals(x.schoolCode))); saveschools = await table.SaveAll(saveschools); } else { List schoolDatas = new List(); schools.ForEach(x => { x.RowKey = $"{x.schoolid}"; x.PartitionKey = "ScSchool"; x.areaId = $"{areaId}"; x.city = $"{city}"; x.dist = $"{dist}"; var a = ignore.Find(z => z.name.Equals(x.schoolname)); if (a != null) { x.schoolCode = a.id; } else { if (string.IsNullOrEmpty(x.schoolCode)) { schoolDatas.Add(new SchoolData { uid = $"{x.schoolid}", province = "四川省", city = $"{city}", name = x.schoolname }); } } }); schoolDatas = await SchoolService.GenerateSchoolCode(schoolDatas, _dingDing, _environment); schools.ForEach(x => { var schoolData = schoolDatas.Find(y => y.uid.Equals($"{x.schoolid}")); if (schoolData != null && !string.IsNullOrEmpty(schoolData.id)) { x.schoolCode = schoolData.id; x.areaId = $"{areaId}"; x.city = $"{city}"; x.dist = $"{dist}"; } }); schools.RemoveAll(x => string.IsNullOrEmpty(x.schoolCode)); saveschools = await table.SaveOrUpdateAll(schools); } } return null; } public static async Task> GenerateSchoolCode(List schools, DingDing _dingDing, IWebHostEnvironment _environment) { string path = $"{_environment.ContentRootPath}/JsonFile/Core/region.json"; //var schools = jsonstr.ToObject().GetProperty("schools").ToObject>(); schools = schools.Where((x, i) => schools.FindIndex(n => n.name.Equals(x.name)) == i).ToList(); StreamReader streamReader = new StreamReader(new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite), Encoding.UTF8); StringBuilder stringBuilder = new StringBuilder(); string text; while ((text = streamReader.ReadLine()) != null) { stringBuilder.Append(text.ToString()); } streamReader.Close(); string input = stringBuilder.ToString(); List region = input.ToObject>(); try { schools.ForEach(x => { x.province = ChineseConverter.Convert(x.province, ChineseConversionDirection.TraditionalToSimplified); if (String.IsNullOrEmpty(x.city)) { x.city = x.province; } else { x.city = ChineseConverter.Convert(x.city, ChineseConversionDirection.TraditionalToSimplified); } x.name = ChineseConverter.Convert(x.name, ChineseConversionDirection.TraditionalToSimplified); comeRemoveStr.ForEach(c => { x.province = x.province.Replace(c, ""); }); prvcRemoveStr.ForEach(c => { x.province = x.province.Replace(c, ""); }); var province = region.Find(r => r.name.Contains(x.province)); string tmpprovince = x.province; string tmpcity = x.city; if (province != null) { x.province = province.name; comeRemoveStr.ForEach(c => { x.city = x.city.Replace(c, ""); }); cityRemoveStr.ForEach(c => { x.city = x.city.Replace(c, ""); }); nationRemoveStr.ForEach(c => { x.city = x.city.Replace(c, ""); }); tmpcity = x.city; var city = province.children.Find(r => r.name.Contains(x.city)); if (city == null) { city = province.children.Find(r => r.name.Contains(x.city)); if (city == null) { city = province.children.SelectMany(x => x.children).ToList().Find(r => r.name.Contains(x.city)); } } if (city != null) { x.city = city.name; } } string name = x.name; //去除冗余的学校信息,只保留地名和校名关键信息 schemoveStr.ForEach(str => { name = name.Replace(str, ""); }); string[] names = name.Split("("); if (names.Length > 1) { name = $"{names[0]}"; for (int index = 1; index < names.Length; index++) { name = $"{name}{names[index].Substring(0, 1)}"; var afnames = names[index].Split(")"); if (afnames.Length > 1) { for (int i = 1; i < afnames.Length; i++) { name = $"{name}{afnames[i]}"; } } } } names = name.Split("("); if (names.Length > 1) { name = $"{names[0]}"; for (int index = 1; index < names.Length; index++) { name = $"{name}{names[index].Substring(0, 1)}"; var afnames = names[index].Split(")"); if (afnames.Length > 1) { for (int i = 1; i < afnames.Length; i++) { name = $"{name}{afnames[i]}"; } } } } name = Regex.Replace(name, "[ \\[ \\] \\^ \\-|()【】/' {}_*×――(^)$%~!@#$…&%¥—+=<>《》!!???::•`·、。,;,.;\"‘’“”-]", " "); //检查是否有英文 if (Regex.Matches(name, "[a-zA-Z]").Count > 0) { var array = Regex.Split(name, "\\s+", RegexOptions.IgnoreCase); StringBuilder tmpname = new StringBuilder(); if (array.Length > 1) { foreach (var item in array) { var arr = item.Select(x => $"{x}"); int index = 0; foreach (var stra in arr) { if (Regex.Matches(stra, "[a-zA-Z]").Count > 0) { if (index == 1|| index == 0) { tmpname.Append(stra); } else { } } else { tmpname.Append(stra); } index++; } } } else { var arr = name.Select(x => $"{x}"); int index = 0; foreach (var stra in arr) { if (Regex.Matches(stra, "[A-Z]").Count > 0) { tmpname.Append(stra); } else if (Regex.Matches(stra, "[a-z]").Count > 0) { } else { tmpname.Append(stra); } index++; } } name = tmpname.ToString(); } name = Regex.Replace(name, @"\s", ""); name = name.Replace("\\", ""); if (name.Length > 6) { //新区,高新,产业等非新政单位 areaRemoveStr.ForEach(str => { name = name.Replace(str.Key, str.Value); }); //去除冗余的学校信息,只保留地名和校名关键信息 schooRemoveStr.ForEach(str => { name = name.Replace(str, ""); }); //替换民族信息词 if (name.Length > 6) { nationRemoveStr.ForEach(str => { name = name.Replace(str, ""); }); } //替换学校信息的副词 if (name.Length > 6) { foreach (var str in schooReplaceStr) { if (name.Length <= 6) { break; } name = name.Replace(str.Key, str.Value); } } //替换省简称信息词 string tmpname = name; if (name.Length > 6) { proReplaceStr.ForEach(str => { name = name.Replace(str.Key, str.Value); }); //如果替换后仍然大于6位,则取消,直接替换省份完整的词 if (name.Length > 6) { name = tmpname.Replace(tmpprovince, ""); } } //替换城市信息词 if (name.Length > 6) { name = name.Replace(tmpcity, ""); } } int len = name.Length; if (len > 6) { foreach (var str in afterSchoolRm) { if (name.Length <= 6) { break; } name = name.Replace(str, ""); } } len = name.Length; if (len >= 6) { name = $"{name.Substring(0, 1)}{name.Substring(len - 5, 3)}{name.Substring(len - 2, 2)}"; } //if (len <= 7 && len > 6) //{ // name = name.Substring(len - 6); //} if (len <= 4) { name = $"{x.city.Substring(0, 2)}{name}"; } if (len == 5) { name = $"{x.city.Substring(0, 1)}{name}"; } string code = ToFirstPinYin(name); x.aname = name; x.id = code; }); } catch (Exception ex) { await _dingDing.SendBotMsg($"{ex.Message}\n{ex.StackTrace}\n", GroupNames.醍摩豆服務運維群組); } string a_z = "abcdefghijklmnopqrstuvwxyz"; 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(); data.ForEach(x => { if (x.count > 1) { var first = x.list.First(); var same = x.list.Skip(1).Take(x.count - 1).ToList(); var fs = first.aname.Select(x => x).ToArray(); same.ForEach(z => { var sp = z.aname.Select(x => x).ToArray(); int len = sp.Length; if (sp.Length >= fs.Length) { len = fs.Count(); } for (int index = 0; index < len; index++) { if (!$"{sp[index]}".Equals($"{fs[index]}")) { short st = ChineseChar.GetStrokeNumber(sp[index]); if (st > 0) { var ins = st % 27; var insch = a_z[ins]; if (z.aname.EndsWith($"{insch}")) { ins = (st + 1) % 27; insch = a_z[ins]; } z.id = z.id.Insert(index, $"{insch}").Remove(index + 1, 1); break; } } } }); } }); 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(); dataz.ForEach(x => { if (x.count > 1) { var first = x.list.First(); var same = x.list.Skip(1).Take(x.count - 1).ToList(); var fs = first.aname.Select(x => x).ToArray(); same.ForEach(z => { var sp = z.aname.Select(x => x).ToArray(); int len = sp.Length; if (sp.Length >= fs.Length) { len = fs.Count(); } for (int index = 0; index < len; index++) { if (!$"{sp[index]}".Equals($"{fs[index]}")) { var spstr = ToPinYin($"{sp[index]}" ); var fsstr = ToPinYin($"{fs[index]}"); var insch= spstr.Select(x => $"{x}").Except( fsstr.Select(z => $"{z}")); if (insch != null && insch.Count() > 0) { if (index > 1) { z.id = z.id.Insert(index - 1, insch.First()).Remove(index, 1); } else if (index == 1) { z.id = z.id.Insert(index, insch.First()).Remove(index - 1, 1); } } } } }); } }); 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(); Random random = new Random(); List list = new List(); dataa.ForEach(x => { if (x.count > 1) { x.list.ForEach(y => { int r= random.Next(25); int index= random.Next(5); y.id = y.id.Insert(index - 1, $"{a_z[r]}").Remove(index, 1); }); } list.AddRange(x.list); }); return list; } public static string ToPinYin(string val) { StringBuilder sb = new StringBuilder(); val.ToCharArray().ToList().ForEach(x => { if (('a' <= x && x <= 'z') || ('A' <= x && x <= 'Z') || ('0' <= x && x <= '9')) { sb.Append(x); } else { try { ChineseChar cc = new ChineseChar(x); if (cc.Pinyins.Count > 0 && cc.Pinyins[0].Length > 0) { sb.Append(cc.Pinyins[0]); } } catch (Exception ex) { } } }); return sb.ToString().ToLower(); } public static string ToFirstPinYin(string val) { StringBuilder sb = new StringBuilder(); val.ToCharArray().ToList().ForEach(x => { if (('a' <= x && x <= 'z') || ('A' <= x && x <= 'Z') || ('0' <= x && x <= '9')) { sb.Append(x); } else { try { ChineseChar cc = new ChineseChar(x); if (cc.Pinyins.Count > 0 && cc.Pinyins[0].Length > 0) { sb.Append(cc.Pinyins[0][0]); } } catch (Exception ex) { } } }); return sb.ToString().ToLower(); } public class SchoolData { public string province { get; set; } public string id { get; set; } public string name { get; set; } public string city { get; set; } public string aname { get; set; } public string uid { get; set; } } public static List comeRemoveStr = new List() { "省", "市", "区", "州", "县", "旗", "盟", "自治" }; public static List prvcRemoveStr = new List() { "回族", "维吾尔", "壮族", }; public static List cityRemoveStr = new List() { "蒙古族", "地区", "壮族", "朝鲜族", "直辖" }; public static List nationRemoveStr = new List { "维吾尔","回族", "自治", "满族", "蒙古", "壮族", "苗族" , "侗族", "瑶族", "达斡尔","鄂温克","朝鲜","畲族","土家","各族","仫佬","毛南","羌族","彝族","仡佬","布依","水族", "傣族","纳西","哈尼","拉祜","佤族","傈僳","独龙","怒族","白族","普米","固族","哈萨克","土族","撒拉","景颇","族" }; public static List schemoveStr = new List { "第", "校区", "部", "楼", "与", "学校", "校园", }; public static List schooRemoveStr = new List() {"省", "市", "区", "州", "县", "旗", "盟","办事处","街道", "自治", "镇","村","乡","街","路","站","馆" }; public static List afterSchoolRm = new List() {"校","园","院", "湾","峡","沟","山","庄", "堡","江","屯","岭","溪","河","桥","营","铺","坡","寨","场","湖","巷","集","关","庙","寺","矿","塘"}; public static List> areaRemoveStr = new List>{ new KeyValuePair("高新技术产业开发区", "高") , new KeyValuePair("经济技术开发区", "经") , new KeyValuePair("国际", "际") , new KeyValuePair("中国", ""), new KeyValuePair("国家", ""), new KeyValuePair("新区", ""), new KeyValuePair("高新", "高"), new KeyValuePair("园区", ""), new KeyValuePair("产业", "产"), new KeyValuePair("经济", "经"), new KeyValuePair("开发", "开"), new KeyValuePair("中心", "") , new KeyValuePair("集团", "") , new KeyValuePair("公司", "") , new KeyValuePair("有限", "") , new KeyValuePair("股份", "") , new KeyValuePair("服务", "") , new KeyValuePair("基地", "") , new KeyValuePair("社区", "社") , new KeyValuePair("职工", "") , new KeyValuePair("专修", ""), new KeyValuePair("实验", "验"), new KeyValuePair("完全", ""), new KeyValuePair("一贯制", "") , new KeyValuePair("联办", ""), new KeyValuePair("联合", ""), new KeyValuePair("完小", "小"), new KeyValuePair("义务", ""), new KeyValuePair("基础", ""), new KeyValuePair("制造", "") }; public static List> schooReplaceStr = new List> { new KeyValuePair("分校", "分") , new KeyValuePair("分园", "分") , new KeyValuePair("分院", "分") , new KeyValuePair("藏文", "藏"), new KeyValuePair("职业技术学院", "职") , new KeyValuePair("创新创业", "创") , new KeyValuePair("就业创业", "就") , new KeyValuePair("应用核技术", "核") , new KeyValuePair("职业学院", "职") , new KeyValuePair("幼儿园", "幼") , new KeyValuePair("幼儿", "幼") , new KeyValuePair("小学", "小") , new KeyValuePair("中学", "中") , new KeyValuePair("中等", "中") , new KeyValuePair("双语", "双") , new KeyValuePair("初中", "初") , new KeyValuePair("初级", "初") , new KeyValuePair("广播", "广"), new KeyValuePair("高中", "高") , new KeyValuePair("高级", "高") , new KeyValuePair("大学", "大") , new KeyValuePair("学院", "院") , new KeyValuePair("综合", "综") , new KeyValuePair("职业", "职") , new KeyValuePair("技术", "技") , new KeyValuePair("专科", "专") , new KeyValuePair("外国语", "外") , new KeyValuePair("九年", "九") , new KeyValuePair("五年", "五") , new KeyValuePair("年制", "制") , new KeyValuePair("高等", "高") , new KeyValuePair("院校", "院") , new KeyValuePair("初等", "小") , new KeyValuePair("附属", "附"), new KeyValuePair("寄宿制", "寄") , new KeyValuePair("寄宿", "寄") , new KeyValuePair("卫生", "卫") , new KeyValuePair("创业", "创") , new KeyValuePair("继续", "继") , new KeyValuePair("开放", "开") , new KeyValuePair("技师", "技") , new KeyValuePair("成人", "成") , new KeyValuePair("教育", "教") , new KeyValuePair("科技", "科") , new KeyValuePair("行政", "政") , new KeyValuePair("生物", "生") , new KeyValuePair("美术", "美") , new KeyValuePair("设计", "设") , new KeyValuePair("传播", "传") , new KeyValuePair("计算机", "算") , new KeyValuePair("土木", "土") , new KeyValuePair("石油", "油") , new KeyValuePair("科普", "普") , new KeyValuePair("电信", "信") , new KeyValuePair("联合", "联") , new KeyValuePair("电商", "商") , new KeyValuePair("纺织", "织") , new KeyValuePair("服装", "服") , new KeyValuePair("新闻", "新") , new KeyValuePair("网络", "网") , new KeyValuePair("应用", "应") , new KeyValuePair("畜牧", "畜") , new KeyValuePair("兽医", "兽") , new KeyValuePair("师范", "师") , new KeyValuePair("人文", "文") , new KeyValuePair("创新", "创") , new KeyValuePair("法官", "法") , new KeyValuePair("邮电", "邮") , new KeyValuePair("文化", "文") , new KeyValuePair("函授", "函") , new KeyValuePair("科学", "科") , new KeyValuePair("信息", "息") , new KeyValuePair("水利", "利") , new KeyValuePair("水电", "电") , new KeyValuePair("电力", "力") , new KeyValuePair("环境", "环") , new KeyValuePair("建材", "材") , new KeyValuePair("机电", "机") , new KeyValuePair("航空", "空") , new KeyValuePair("航天", "天") , new KeyValuePair("警察", "警") , new KeyValuePair("警官", "警") , new KeyValuePair("财贸", "财") , new KeyValuePair("电子", "电") , new KeyValuePair("建筑", "筑") , new KeyValuePair("艺术", "艺") , new KeyValuePair("体育", "体") , new KeyValuePair("城市", "城") , new KeyValuePair("地质", "地") , new KeyValuePair("医药", "药") , new KeyValuePair("政法", "法") , new KeyValuePair("铁路", "铁") , new KeyValuePair("铁道", "道") , new KeyValuePair("轨道", "轨") , new KeyValuePair("交通", "通") , new KeyValuePair("医学院", "医") , new KeyValuePair("医学", "医") , new KeyValuePair("传媒", "媒") , new KeyValuePair("工程", "程") , new KeyValuePair("临床", "临") , new KeyValuePair("化工", "化") , new KeyValuePair("林业", "林") , new KeyValuePair("老年", "老") , new KeyValuePair("旅游", "游") , new KeyValuePair("护理", "护") , new KeyValuePair("贸易", "贸") , new KeyValuePair("中医药", "中医") , new KeyValuePair("资源", "源") , new KeyValuePair("冶金", "冶") , new KeyValuePair("能源", "能") , new KeyValuePair("汽车", "车") , new KeyValuePair("医科", "医") , new KeyValuePair("机械", "械") , new KeyValuePair("应用", "应") , new KeyValuePair("电气", "电") , new KeyValuePair("材料", "材") , new KeyValuePair("劳动", "劳") , new KeyValuePair("轻工", "轻") , new KeyValuePair("农业", "农") , new KeyValuePair("委员会", "委") , new KeyValuePair("专业", "专") , new KeyValuePair("广播", "广"), new KeyValuePair("电视", "电") , new KeyValuePair("工商", "商") , new KeyValuePair("工业", "工") , new KeyValuePair("管理", "管") , new KeyValuePair("社会主义", "社") , new KeyValuePair("社会", "社") , new KeyValuePair("自动化", "自") , }; public static List> proReplaceStr = new List> { new KeyValuePair("北京","京") , new KeyValuePair("天津","津") , new KeyValuePair("河北","冀") , new KeyValuePair("山西","晋") , new KeyValuePair("内蒙古","蒙") , new KeyValuePair("辽宁","辽") , new KeyValuePair("吉林","吉") , new KeyValuePair("黑龙江","黑") , new KeyValuePair("上海","沪") , new KeyValuePair("江苏","苏") , new KeyValuePair("浙江","浙") , new KeyValuePair("安徽","皖") , new KeyValuePair("福建","闽") , new KeyValuePair("江西","赣") , new KeyValuePair("山东","鲁") , new KeyValuePair("河南","豫") , new KeyValuePair("湖北","鄂") , new KeyValuePair("湖南","湘") , new KeyValuePair("广东","粤") , new KeyValuePair("广西","桂") , new KeyValuePair("海南","琼") , new KeyValuePair("四川","川") , new KeyValuePair("贵州","贵") , new KeyValuePair("云南","云") , new KeyValuePair("重庆","渝") , new KeyValuePair("西藏","藏") , new KeyValuePair("陕西","陕") , new KeyValuePair("甘肃","甘") , new KeyValuePair("青海","青") , new KeyValuePair("宁夏","宁") , new KeyValuePair("新疆","新") , new KeyValuePair("香港","港") , new KeyValuePair("澳门","澳") , new KeyValuePair("台湾","台") }; /* [ {"method":"台北市","params":{"CountryId":"TW","CityId":"30"}},1 {"method":"新北市","params":{"CountryId":"TW","CityId":"01"}},1 {"method":"桃园市","params":{"CountryId":"TW","CityId":"03"}},1 {"method":"台中市","params":{"CountryId":"TW","CityId":"66"}},1 {"method":"台南市","params":{"CountryId":"TW","CityId":"67"}},1 {"method":"高雄市","params":{"CountryId":"TW","CityId":"64"}},1 {"method":"基隆市","params":{"CountryId":"TW","CityId":"17"}},1 {"method":"新竹市","params":{"CountryId":"TW","CityId":"18"}},1 {"method":"嘉义市","params":{"CountryId":"TW","CityId":"20"}},1 {"method":"新竹县","params":{"CountryId":"TW","CityId":"04"}},1 {"method":"苗栗县","params":{"CountryId":"TW","CityId":"05"}},1 {"method":"彰化县","params":{"CountryId":"TW","CityId":"07"}},1 {"method":"南投县","params":{"CountryId":"TW","CityId":"08"}},1 {"method":"云林县","params":{"CountryId":"TW","CityId":"09"}},1 {"method":"嘉义县","params":{"CountryId":"TW","CityId":"10"}},1 {"method":"屏东县","params":{"CountryId":"TW","CityId":"13"}},1 {"method":"宜兰县","params":{"CountryId":"TW","CityId":"02"}},1 {"method":"花莲县","params":{"CountryId":"TW","CityId":"15"}},1 {"method":"台东县","params":{"CountryId":"TW","CityId":"14"}},1 {"method":"澎湖县","params":{"CountryId":"TW","CityId":"16"}},1 {"method":"金门县","params":{"CountryId":"TW","CityId":"71"}}, {"method":"连江县","params":{"CountryId":"TW","CityId":"72"}} ] */ } }