diff --git a/New_College.Api/New_College.Model.xml b/New_College.Api/New_College.Model.xml index 18e23db..3db0e30 100644 --- a/New_College.Api/New_College.Model.xml +++ b/New_College.Api/New_College.Model.xml @@ -695,6 +695,16 @@ 院校所在城市 + + + + + + + + + + 排名 diff --git a/New_College.Services/D_LongIdMapServices.cs b/New_College.Services/D_LongIdMapServices.cs index f5bdf1b..2d0fc37 100644 --- a/New_College.Services/D_LongIdMapServices.cs +++ b/New_College.Services/D_LongIdMapServices.cs @@ -53,6 +53,7 @@ namespace New_College.Services private readonly ID_PlanMajorScoreLineRepository d_PlanMajorScoreLineRepository; private readonly ID_QualificationLineRepository d_QualificationLineRepository; private readonly ID_PlanMajorDescRepository d_PlanMajorDescRepository; + private readonly ID_PlanMajorDescProRepository d_PlanMajorDescProRepository; public D_LongIdMapServices(IBaseRepository dal , ID_MajorCategoryRepository ID_MajorCategoryRepository , ID_MajorClassRepository ID_MajorClassRepository @@ -77,7 +78,8 @@ namespace New_College.Services ID_PlanMajorDescRepository _PlanMajorDescRepository, ID_PlanMajorScoreLineRepository d_PlanMajorScoreLineRepository, ID_QualificationLineRepository d_QualificationLineRepository, - ID_PlanMajorDescRepository d_PlanMajorDescRepository) + ID_PlanMajorDescRepository d_PlanMajorDescRepository, + ID_PlanMajorDescProRepository d_PlanMajorDescProRepository) { this._dal = dal; d_MajorCategoryRepository = ID_MajorCategoryRepository; @@ -105,6 +107,7 @@ namespace New_College.Services this.d_PlanMajorScoreLineRepository = d_PlanMajorScoreLineRepository; this.d_QualificationLineRepository = d_QualificationLineRepository; this.d_PlanMajorDescRepository = d_PlanMajorDescRepository; + this.d_PlanMajorDescProRepository = d_PlanMajorDescProRepository; } /// @@ -1664,7 +1667,7 @@ namespace New_College.Services public async Task Import() { // var universitylist = await d_UniversityRepository.Query(); - // var plist = await this._PlanMajorDescRepository.Query(c => c.Location == "山东省" && c.Years == 2023); + var plist = await this._PlanMajorDescRepository.Query(c => c.Location == "山东省" && c.Years == 2021 && c.PlanCount > 0); //universitylist.ForEach(async u => //{ // plist.ForEach(async cc => @@ -1719,41 +1722,41 @@ namespace New_College.Services //this.d_PlanMajorScoreLineRepository = d_PlanMajorScoreLineRepository; //this.d_QualificationLineRepository = d_QualificationLineRepository; - var plandesc = await d_PlanMajorDescRepository.Query(c => c.Years == 2023 && c.Location == "山东省"); - var plandescline = await d_PlanMajorScoreLineRepository.Query(c => c.Years == 2022 && c.Location == "山东省"); - plandesc.ForEach(async a => - { + //var plandesc = await d_PlanMajorDescRepository.Query(c => c.Years == 2023 && c.Location == "山东省"); + //var plandescline = await d_PlanMajorScoreLineRepository.Query(c => c.Years == 2022 && c.Location == "山东省"); + //plandesc.ForEach(async a => + //{ - // if (!string.IsNullOrEmpty(a.Major) && a.Major.Contains("(") && !string.IsNullOrEmpty(a.SelectSubject)) - //{ - // a.ModifyTime = DateTime.Now; - // a.Remark = a.Major.Remove(a.Major.Length - 1, 1).Replace(a.Major.Split("(")[0], ""); - // a.Remark = a.Remark.Remove(0, 1); - // a.Major = a.Major.Split("(")[0]; - // await d_PlanMajorDescRepository.Update(a); - //} + // // if (!string.IsNullOrEmpty(a.Major) && a.Major.Contains("(") && !string.IsNullOrEmpty(a.SelectSubject)) + // //{ + // // a.ModifyTime = DateTime.Now; + // // a.Remark = a.Major.Remove(a.Major.Length - 1, 1).Replace(a.Major.Split("(")[0], ""); + // // a.Remark = a.Remark.Remove(0, 1); + // // a.Major = a.Major.Split("(")[0]; + // // await d_PlanMajorDescRepository.Update(a); + // //} - //if (!string.IsNullOrEmpty(a.Major) && a.Major.Contains("(") && !string.IsNullOrEmpty(a.SelectSubject)) - //{ - // a.ModifyTime = DateTime.Now; - // a.Remark = a.Major.Remove(a.Major.Length - 1, 1).Replace(a.Major.Split("(")[0], ""); - // a.Remark = a.Remark.Remove(0, 1); - // a.Major = a.Major.Split("(")[0]; - // await d_PlanMajorDescRepository.Update(a); - //} + // //if (!string.IsNullOrEmpty(a.Major) && a.Major.Contains("(") && !string.IsNullOrEmpty(a.SelectSubject)) + // //{ + // // a.ModifyTime = DateTime.Now; + // // a.Remark = a.Major.Remove(a.Major.Length - 1, 1).Replace(a.Major.Split("(")[0], ""); + // // a.Remark = a.Remark.Remove(0, 1); + // // a.Major = a.Major.Split("(")[0]; + // // await d_PlanMajorDescRepository.Update(a); + // //} - if (plandescline.Any(e => e.UId == a.UId && e.Major == a.Major && e.Location == a.Location) && a.LowScore <= 0) - { - var firstdefault = plandescline.FirstOrDefault(e => e.UId == a.UId && a.Major == e.Major && e.Location == a.Location); - a.LowScore = firstdefault.LowScore; - a.LowScoreRank = firstdefault.LowScoreRank; - a.ModifyTime = DateTime.Now; - await d_PlanMajorDescRepository.Update(a); - } - }); + // if (plandescline.Any(e => e.UId == a.UId && e.Major == a.Major && e.Location == a.Location) && a.LowScore <= 0) + // { + // var firstdefault = plandescline.FirstOrDefault(e => e.UId == a.UId && a.Major == e.Major && e.Location == a.Location); + // a.LowScore = firstdefault.LowScore; + // a.LowScoreRank = firstdefault.LowScoreRank; + // a.ModifyTime = DateTime.Now; + // await d_PlanMajorDescRepository.Update(a); + // } + //}); //plandescline.ForEach(async a => //{ @@ -1776,8 +1779,17 @@ namespace New_College.Services // await d_PlanMajorDescRepository.Update(a); // } //}); - - + var plistpro = await d_PlanMajorDescProRepository.Query(c => c.Location == "山东省" && c.Years == 2023); + plist.ForEach(async c => + { + if (plistpro.Where(w => w.UId == c.UId && w.Major == c.Major && c.BatchName == w.BatchName && w.Location == "山东省").Any()) + { + var pmodel = plistpro.Where(w => w.UId == c.UId && w.Major == c.Major && c.BatchName == w.BatchName && w.Location == "山东省").FirstOrDefault(); + pmodel.NewCount = pmodel.PlanCount - c.PlanCount; + pmodel.ModifyTime = DateTime.Now; + await d_PlanMajorDescProRepository.Update(pmodel); + } + }); return true; }