diff --git a/New_College.Api/Controllers/Back/PlanMajorScoreLineController.cs b/New_College.Api/Controllers/Back/PlanMajorScoreLineController.cs index 1e7b641..521d560 100644 --- a/New_College.Api/Controllers/Back/PlanMajorScoreLineController.cs +++ b/New_College.Api/Controllers/Back/PlanMajorScoreLineController.cs @@ -186,7 +186,7 @@ namespace New_College.Api.Controllers IsDelete = false, ModifyTime = plist.FirstOrDefault().ModifyTime, Nature = u.Nature == 0 ? "公办" : u.Nature == 1 ? "民办" : u.Nature == 2 ? "中外合作办学" : "港澳台", - Ownership = u.Ascription == 1 ? "教育部" : u.Ascription == 2 ? "省政府" : u.Ascription == 3 ? "其他部委" : "军校", + Ownership = u.Ascription == 1 ? "教育部" : u.Ascription == 2 ? "地方政府" : u.Ascription == 3 ? "其他部委" : "军校", RecruitCode = int.Parse(u.UniversityCode), OrderSort = 1, UniversityName = u.Name, @@ -249,7 +249,7 @@ namespace New_College.Api.Controllers Remark = c.Remark, SelectSubject = c.SelectSubject, - }).ToList(); + }).OrderByDescending(c => c.Years).ToList(); return new MessageModel>() { msg = "获取成功", diff --git a/New_College.Api/Controllers/Front/EnrollMentPlansController.cs b/New_College.Api/Controllers/Front/EnrollMentPlansController.cs index 8514d06..aeef41d 100644 --- a/New_College.Api/Controllers/Front/EnrollMentPlansController.cs +++ b/New_College.Api/Controllers/Front/EnrollMentPlansController.cs @@ -43,10 +43,11 @@ namespace New_College.Api.Controllers.Front { try { + request.Years = request.Years >= 2023 ? 2023 : request.Years; Expression> whereexp = Expressionable.Create() //创建表达式 .And(c => c.Location == request.Location) .And(c => c.Years == request.Years) - .AndIF(!string.IsNullOrEmpty(request.UniversityName), w =>SqlFunc.Contains(w.UniversityName, request.UniversityName)) + .AndIF(!string.IsNullOrEmpty(request.UniversityName), w => SqlFunc.Contains(w.UniversityName, request.UniversityName)) .AndIF(!string.IsNullOrEmpty(request.MajorName), w => SqlFunc.Contains(w.Major, request.MajorName)).ToExpression(); var pageModel = await this.d_PlanMajorDesc.QueryPage(whereexp, request.PageIndex, request.PageSize); diff --git a/New_College.Api/Controllers/HealthCheckController.cs b/New_College.Api/Controllers/HealthCheckController.cs index cc43a90..6d34264 100644 --- a/New_College.Api/Controllers/HealthCheckController.cs +++ b/New_College.Api/Controllers/HealthCheckController.cs @@ -55,7 +55,7 @@ namespace New_College.Controllers public Task Post() { // return t_EnrollmentPlane.Import(); - // return t_EnrollmentPlane.Importuniverbaseinfo(); + // return t_EnrollmentPlane.Importuniverbaseinfo(); // return t_EnrollmentPlane.universitydetailupdate(); @@ -64,10 +64,10 @@ namespace New_College.Controllers // return t_EnrollmentPlane.categoryupdate(); - // return d_LongIdMapServices.UpdateUniveristyInf(); + // return d_LongIdMapServices.UpdateUniveristyInf(); // return d_LongIdMapServices.Import(); - return d_LongIdMapServices.UpdatePlanProInf(); + return d_LongIdMapServices.UpdatePlanProInf(); } } diff --git a/New_College.Api/New_College.Model.xml b/New_College.Api/New_College.Model.xml index 72dcce2..bfd579d 100644 --- a/New_College.Api/New_College.Model.xml +++ b/New_College.Api/New_College.Model.xml @@ -901,6 +901,11 @@ 专业 + + + 专业code + + 平均分 diff --git a/New_College.Model/Models/D_PlanMajorScoreLine.cs b/New_College.Model/Models/D_PlanMajorScoreLine.cs index 78ccb9f..b7d0f15 100644 --- a/New_College.Model/Models/D_PlanMajorScoreLine.cs +++ b/New_College.Model/Models/D_PlanMajorScoreLine.cs @@ -59,6 +59,11 @@ namespace New_College.Model.Models [SugarColumn(IsNullable = true, Length = 500)] public string Major { get; set; } + /// + /// 专业code + /// + public string MajorCode { get; set; } + [SugarColumn(IsNullable = true, Length = 1000)] public string Remark { get; set; } diff --git a/New_College.Model/ViewModels/Query/UniversityQuery.cs b/New_College.Model/ViewModels/Query/UniversityQuery.cs index 31662aa..7dac959 100644 --- a/New_College.Model/ViewModels/Query/UniversityQuery.cs +++ b/New_College.Model/ViewModels/Query/UniversityQuery.cs @@ -21,6 +21,13 @@ namespace New_College.Model.ViewModels /// 办学性质 /// public List? Nature { get; set; } + + + /// + /// 隶属于 1、教育部,2、省政府, 3 其他部委,4 军校 + /// + public int? Ascription { get; set; } + /// /// 用户id /// diff --git a/New_College.Services/D_LongIdMapServices.cs b/New_College.Services/D_LongIdMapServices.cs index 47cea7f..064fdb9 100644 --- a/New_College.Services/D_LongIdMapServices.cs +++ b/New_College.Services/D_LongIdMapServices.cs @@ -128,6 +128,7 @@ namespace New_College.Services .AndIF(query.Nature != null && query.Nature.Any(), x => SqlFunc.ContainsArray(query.Nature, x.Nature)) .AndIF(query.Type != null && query.Type.Any(), x => SqlFunc.ContainsArray(query.Type, x.Type)) .AndIF(query.SubjectLevel.HasValue, x => x.Subject_Level == query.SubjectLevel) + .AndIF(query.Ascription.HasValue, x => x.Ascription == query.Ascription) .AndIF(query.Nhef.HasValue, x => x.Nhef == query.Nhef) .AndIF(query.Sff.HasValue, x => x.Sff == query.Sff) .AndIF(query.Syl.HasValue, x => x.Syl == query.Syl) @@ -1919,61 +1920,61 @@ namespace New_College.Services /// public async Task UpdateUniveristyInf() { - // var tbinfo = await t_TbSNeedDataInfoRepository.Query(); + var tbinfo = await t_TbSNeedDataInfoRepository.Query(); // var plist = await this._PlanMajorDescRepository.Query(c => c.Location == "山东省" && c.Years == 2023); var info = await d_UniversityRepository.Query(); - //var infoimg = await d_UniversityimgRepository.Query(); - //info.ForEach(async a => - //{ - // if (tbinfo.Where(e => e.UniversityName == a.Name).Any()) - // { - // var baseinfo = tbinfo.Where(e => e.UniversityName == a.Name).FirstOrDefault(); - // var imginfo = infoimg.FirstOrDefault(o => o.UniversityId == a.Id); - // if (!string.IsNullOrWhiteSpace(baseinfo.VRUrl)&& imginfo!=null) - // { - // imginfo.VRUrl = baseinfo.VRUrl; - // await d_UniversityimgRepository.Update(imginfo); - // } - // if (baseinfo.LnstitutionalLevel != null) - // { - // a.Sff = baseinfo.LnstitutionalLevel.Contains("211") ? 0 : 1; - // a.Syl = baseinfo.LnstitutionalLevel.Contains("双一流") ? 0 : 1; - // a.QJJH = baseinfo.LnstitutionalLevel.Contains("强基") ? 0 : 1; - // a.Nhef = baseinfo.LnstitutionalLevel.Contains("985") ? 0 : 1; - // } - // //a.Doctorate_Count = int.Parse(baseinfo.PhDPoint); - // //a.Master_Count = int.Parse(baseinfo.MastersDegree); - // a.Nature = baseinfo.Nature.Contains("公办") ? 0 : baseinfo.Nature.Contains("民办") ? 1 : baseinfo.Nature.Contains("中外合作") ? 2 : baseinfo.Nature.Contains("港澳台") ? 3 : -1; - // a.Subject_Level = baseinfo.EducationCategory == "本科" ? 0 : 1; - // await d_UniversityRepository.Update(a); - // } - //}); - var plist = await this._PlanMajorDescRepository.Query(c => c.Location == "山东省" && c.Years == 2023 && c.IsDelete == false && c.UId <= 0); + // var infoimg = await d_UniversityimgRepository.Query(); info.ForEach(async a => { - var pplist = plist.Where(ee => ee.UniversityName == a.Name).ToList(); - - pplist.ForEach(c => + if (tbinfo.Where(e => e.UniversityName == a.Name).Any()) { - - c.UId = a.Id; - c.AreaName = a.Area_Name; - c.Rank = a.Rank.ToString(); - c._985 = a.Nhef == 1 ? "是" : "否"; - c._SYL = a.Syl == 1 ? "是" : "否"; - c._211 = a.Sff == 1 ? "是" : "否"; - c.Nature = a.Nature == 0 ? "公办" : a.Nature == 1 ? "民办" : a.Nature == 2 ? "中外合作办学" : "港澳台"; - c.ReName = c.Major; - c.Remark = "(" + c.Major.Remove(c.Major.Length - 1, 1).Replace(c.Major.Split("(")[0], ""); - c.Major = c.Major.Split("(")[0]; - - }); - if (pplist.Any() && pplist.Count() > 0) - { - await this._PlanMajorDescRepository.Batchupdate(pplist); + var baseinfo = tbinfo.Where(e => e.UniversityName == a.Name).FirstOrDefault(); + // var imginfo = infoimg.FirstOrDefault(o => o.UniversityId == a.Id); + //if (!string.IsNullOrWhiteSpace(baseinfo.VRUrl) && imginfo != null) + //{ + // imginfo.VRUrl = baseinfo.VRUrl; + // await d_UniversityimgRepository.Update(imginfo); + //} + if (baseinfo.LnstitutionalLevel != null) + { + a.Sff = baseinfo.LnstitutionalLevel.Contains("211") ? 1 : 0; + a.Syl = baseinfo.LnstitutionalLevel.Contains("双一流") ? 1 : 0; + a.QJJH = baseinfo.LnstitutionalLevel.Contains("强基") ? 1 : 0; + a.Nhef = baseinfo.LnstitutionalLevel.Contains("985") ? 1 : 0; + } + //a.Doctorate_Count = int.Parse(baseinfo.PhDPoint); + //a.Master_Count = int.Parse(baseinfo.MastersDegree); + //a.Nature = baseinfo.Nature.Contains("公办") ? 0 : baseinfo.Nature.Contains("民办") ? 1 : baseinfo.Nature.Contains("中外合作") ? 2 : baseinfo.Nature.Contains("港澳台") ? 3 : -1; + //a.Subject_Level = baseinfo.EducationCategory == "本科" ? 0 : 1; + await d_UniversityRepository.Update(a); } }); + //var plist = await this._PlanMajorDescRepository.Query(c => c.Location == "山东省" && c.Years == 2023 && c.IsDelete == false && c.UId <= 0); + //info.ForEach(async a => + //{ + // var pplist = plist.Where(ee => ee.UniversityName == a.Name).ToList(); + + // pplist.ForEach(c => + // { + + // c.UId = a.Id; + // c.AreaName = a.Area_Name; + // c.Rank = a.Rank.ToString(); + // c._985 = a.Nhef == 1 ? "是" : "否"; + // c._SYL = a.Syl == 1 ? "是" : "否"; + // c._211 = a.Sff == 1 ? "是" : "否"; + // c.Nature = a.Nature == 0 ? "公办" : a.Nature == 1 ? "民办" : a.Nature == 2 ? "中外合作办学" : "港澳台"; + // c.ReName = c.Major; + // c.Remark = "(" + c.Major.Remove(c.Major.Length - 1, 1).Replace(c.Major.Split("(")[0], ""); + // c.Major = c.Major.Split("(")[0]; + + // }); + // if (pplist.Any() && pplist.Count() > 0) + // { + // await this._PlanMajorDescRepository.Batchupdate(pplist); + // } + //}); return true; } @@ -1985,29 +1986,48 @@ namespace New_College.Services public async Task UpdatePlanProInf() { var tbinfo = await t_TbSNeedDataInfoRepository.Query(); - var plist = await this._PlanMajorDescRepository.Query(c => c.Location == "山东省" && c.Years == 2023 && c.IsDelete == false && c.UId <= 0); - plist.ForEach(p => + + #region 更新专业计划信息 + //var plist = await this._PlanMajorDescRepository.Query(c => c.Location == "山东省" && c.Years == 2023 && c.IsDelete == false && c.UId <= 0); + //plist.ForEach(p => + //{ + // var newmodel = tbinfo.Where(e => e.EnrollmentCode == p.EnrollmentCode && e.MajorCode == p.MajorCode).FirstOrDefault(); + // if (newmodel != null) + // { + // p.CityName = newmodel.City; + // p.EducationCategory = newmodel.EducationCategory; + // // p.EnrollmentCode = newmodel.EnrollmentCode; + // p.EnrollmentType = newmodel.EnrollmentType; + // //p.SchoolType=newmodel.sch + // p.FirstType = newmodel.FirstType; + // p.Nature = newmodel.Nature; + // p.Ownership = newmodel.Ownership; + // p.LowScore = int.Parse(newmodel._23Score); + // p.LowScoreRank = int.Parse(newmodel._23ScoreLine); + + // } + + //}); + + //await this._PlanMajorDescRepository.Batchupdate(plist); + + #endregion + + #region 更新专业分数先选科数据 + + var planlinelist = await d_PlanMajorScoreLineRepository.Query(e => e.IsDelete == false && e.Years == 2023 && e.Location == "山东省"); + planlinelist.ForEach(async c => { - var newmodel = tbinfo.Where(e => e.EnrollmentCode == p.EnrollmentCode && e.MajorCode == p.MajorCode).FirstOrDefault(); - if (newmodel != null) + var tmpany=tbinfo.Where(e=>e.UniversityName==c.UniversityName&&e.MajorCode==c.MajorCode).Any(); + if (tmpany) { - p.CityName = newmodel.City; - p.EducationCategory = newmodel.EducationCategory; - // p.EnrollmentCode = newmodel.EnrollmentCode; - p.EnrollmentType = newmodel.EnrollmentType; - //p.SchoolType=newmodel.sch - p.FirstType = newmodel.FirstType; - p.Nature = newmodel.Nature; - p.Ownership = newmodel.Ownership; - p.LowScore = int.Parse(newmodel._23Score); - p.LowScoreRank = int.Parse(newmodel._23ScoreLine); - + var tmp = tbinfo.Where(e => e.UniversityName == c.UniversityName && e.MajorCode == c.MajorCode).FirstOrDefault(); + c.SelectSubject = tmp._23subject; + await d_PlanMajorScoreLineRepository.Update(c); } - }); - await this._PlanMajorDescRepository.Batchupdate(plist); - + #endregion return true; }