招生计划bug fixed

develop
old易 2024-01-12 09:46:00 +08:00
parent 554acf1b43
commit a55f995a53
7 changed files with 109 additions and 71 deletions

View File

@ -186,7 +186,7 @@ namespace New_College.Api.Controllers
IsDelete = false, IsDelete = false,
ModifyTime = plist.FirstOrDefault().ModifyTime, ModifyTime = plist.FirstOrDefault().ModifyTime,
Nature = u.Nature == 0 ? "公办" : u.Nature == 1 ? "民办" : u.Nature == 2 ? "中外合作办学" : "港澳台", 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), RecruitCode = int.Parse(u.UniversityCode),
OrderSort = 1, OrderSort = 1,
UniversityName = u.Name, UniversityName = u.Name,
@ -249,7 +249,7 @@ namespace New_College.Api.Controllers
Remark = c.Remark, Remark = c.Remark,
SelectSubject = c.SelectSubject, SelectSubject = c.SelectSubject,
}).ToList(); }).OrderByDescending(c => c.Years).ToList();
return new MessageModel<List<PlanMajorScoreLineResponse>>() return new MessageModel<List<PlanMajorScoreLineResponse>>()
{ {
msg = "获取成功", msg = "获取成功",

View File

@ -43,6 +43,7 @@ namespace New_College.Api.Controllers.Front
{ {
try try
{ {
request.Years = request.Years >= 2023 ? 2023 : request.Years;
Expression<Func<D_PlanMajorDesc, bool>> whereexp = Expressionable.Create<D_PlanMajorDesc>() //创建表达式 Expression<Func<D_PlanMajorDesc, bool>> whereexp = Expressionable.Create<D_PlanMajorDesc>() //创建表达式
.And(c => c.Location == request.Location) .And(c => c.Location == request.Location)
.And(c => c.Years == request.Years) .And(c => c.Years == request.Years)

View File

@ -901,6 +901,11 @@
专业 专业
</summary> </summary>
</member> </member>
<member name="P:New_College.Model.Models.D_PlanMajorScoreLine.MajorCode">
<summary>
专业code
</summary>
</member>
<member name="P:New_College.Model.Models.D_PlanMajorScoreLine.AvgScore"> <member name="P:New_College.Model.Models.D_PlanMajorScoreLine.AvgScore">
<summary> <summary>
平均分 平均分

View File

@ -59,6 +59,11 @@ namespace New_College.Model.Models
[SugarColumn(IsNullable = true, Length = 500)] [SugarColumn(IsNullable = true, Length = 500)]
public string Major { get; set; } public string Major { get; set; }
/// <summary>
/// 专业code
/// </summary>
public string MajorCode { get; set; }
[SugarColumn(IsNullable = true, Length = 1000)] [SugarColumn(IsNullable = true, Length = 1000)]
public string Remark { get; set; } public string Remark { get; set; }

View File

@ -21,6 +21,13 @@ namespace New_College.Model.ViewModels
/// 办学性质 /// 办学性质
/// </summary> /// </summary>
public List<int>? Nature { get; set; } public List<int>? Nature { get; set; }
/// <summary>
/// 隶属于 1、教育部2、省政府, 3 其他部委4 军校
/// </summary>
public int? Ascription { get; set; }
/// <summary> /// <summary>
/// 用户id /// 用户id
/// </summary> /// </summary>

View File

@ -128,6 +128,7 @@ namespace New_College.Services
.AndIF(query.Nature != null && query.Nature.Any(), x => SqlFunc.ContainsArray(query.Nature, x.Nature)) .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.Type != null && query.Type.Any(), x => SqlFunc.ContainsArray(query.Type, x.Type))
.AndIF(query.SubjectLevel.HasValue, x => x.Subject_Level == query.SubjectLevel) .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.Nhef.HasValue, x => x.Nhef == query.Nhef)
.AndIF(query.Sff.HasValue, x => x.Sff == query.Sff) .AndIF(query.Sff.HasValue, x => x.Sff == query.Sff)
.AndIF(query.Syl.HasValue, x => x.Syl == query.Syl) .AndIF(query.Syl.HasValue, x => x.Syl == query.Syl)
@ -1919,61 +1920,61 @@ namespace New_College.Services
/// <returns></returns> /// <returns></returns>
public async Task<bool> UpdateUniveristyInf() public async Task<bool> 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 plist = await this._PlanMajorDescRepository.Query(c => c.Location == "山东省" && c.Years == 2023);
var info = await d_UniversityRepository.Query(); var info = await d_UniversityRepository.Query();
// var infoimg = await d_UniversityimgRepository.Query(); // var infoimg = await d_UniversityimgRepository.Query();
//info.ForEach(async a => info.ForEach(async a =>
//{ {
// if (tbinfo.Where(e => e.UniversityName == a.Name).Any()) if (tbinfo.Where(e => e.UniversityName == a.Name).Any())
// { {
// var baseinfo = tbinfo.Where(e => e.UniversityName == a.Name).FirstOrDefault(); var baseinfo = tbinfo.Where(e => e.UniversityName == a.Name).FirstOrDefault();
// var imginfo = infoimg.FirstOrDefault(o => o.UniversityId == a.Id); // var imginfo = infoimg.FirstOrDefault(o => o.UniversityId == a.Id);
//if (!string.IsNullOrWhiteSpace(baseinfo.VRUrl) && imginfo != null) //if (!string.IsNullOrWhiteSpace(baseinfo.VRUrl) && imginfo != null)
//{ //{
// imginfo.VRUrl = baseinfo.VRUrl; // imginfo.VRUrl = baseinfo.VRUrl;
// await d_UniversityimgRepository.Update(imginfo); // await d_UniversityimgRepository.Update(imginfo);
//} //}
// if (baseinfo.LnstitutionalLevel != null) if (baseinfo.LnstitutionalLevel != null)
// { {
// a.Sff = baseinfo.LnstitutionalLevel.Contains("211") ? 0 : 1; a.Sff = baseinfo.LnstitutionalLevel.Contains("211") ? 1 : 0;
// a.Syl = baseinfo.LnstitutionalLevel.Contains("双一流") ? 0 : 1; a.Syl = baseinfo.LnstitutionalLevel.Contains("双一流") ? 1 : 0;
// a.QJJH = baseinfo.LnstitutionalLevel.Contains("强基") ? 0 : 1; a.QJJH = baseinfo.LnstitutionalLevel.Contains("强基") ? 1 : 0;
// a.Nhef = baseinfo.LnstitutionalLevel.Contains("985") ? 0 : 1; a.Nhef = baseinfo.LnstitutionalLevel.Contains("985") ? 1 : 0;
// } }
// //a.Doctorate_Count = int.Parse(baseinfo.PhDPoint); //a.Doctorate_Count = int.Parse(baseinfo.PhDPoint);
// //a.Master_Count = int.Parse(baseinfo.MastersDegree); //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.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; //a.Subject_Level = baseinfo.EducationCategory == "本科" ? 0 : 1;
// await d_UniversityRepository.Update(a); 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);
} }
}); });
//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; return true;
} }
@ -1985,29 +1986,48 @@ namespace New_College.Services
public async Task<bool> UpdatePlanProInf() public async Task<bool> UpdatePlanProInf()
{ {
var tbinfo = await t_TbSNeedDataInfoRepository.Query(); 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 =>
{
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);
#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 tmpany=tbinfo.Where(e=>e.UniversityName==c.UniversityName&&e.MajorCode==c.MajorCode).Any();
if (tmpany)
{
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; return true;
} }