diff --git a/New_College.Api/Controllers/Front/SeVolunteerInitializationController.cs b/New_College.Api/Controllers/Front/SeVolunteerInitializationController.cs new file mode 100644 index 0000000..73cd15d --- /dev/null +++ b/New_College.Api/Controllers/Front/SeVolunteerInitializationController.cs @@ -0,0 +1,149 @@ +using New_College.IServices; +using New_College.Model; +using New_College.Model.Models; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using System; +using System.Linq.Expressions; +using System.Threading.Tasks; +using System.Collections.Generic; +using Org.BouncyCastle.Asn1.Ocsp; +using System.Linq; + +namespace New_College.Api.Controllers +{ + + + + + + [Route("api/[controller]/[action]")] + [ApiController] + + public class SeVolunteerInitializationController : ControllerBase + { + /// + /// 服务器接口,因为是模板生成,所以首字母是大写的,自己可以重构下 + /// + private readonly ID_SeVolunteerInitializationServices _d_SeVolunteerInitializationServices; + + public SeVolunteerInitializationController(ID_SeVolunteerInitializationServices D_SeVolunteerInitializationServices) + { + _d_SeVolunteerInitializationServices = D_SeVolunteerInitializationServices; + } + + + /// + /// 志愿填报省份数据 + /// + /// + [HttpGet] + public async Task>> Get() + { + var data = new MessageModel>(); + var sevolunterlist = (await _d_SeVolunteerInitializationServices.Query()).Select(c => new SeVolunterInitializationDto() + { + AllScore = c.AllScore, + IsOpen = c.IsOpen, + ProvinceName = c.ProvinceName, + Policy = c.PolicyType, + Years = c.Years, + Code = c.Id + + }).ToList(); + int nowyear = DateTime.Now.Year; + int month = DateTime.Now.Month; + sevolunterlist.ForEach(a => + { + var list = new List(); + if (month < 8)//大于8月份则高考时间已过,为往届高考生 + { + list.Add(new LizationDto() + { + name = (nowyear - 1).ToString(), + code = nowyear - 1, + Policy = nowyear - 1 < a.Years ? 0 : a.Policy + + }); + list.Add(new LizationDto() + { + name = nowyear.ToString() + "(现高三)", + code = nowyear, + Policy = nowyear < a.Years ? 0 : a.Policy + + }); + list.Add(new LizationDto() + { + name = (nowyear + 1).ToString() + "(现高二)", + code = nowyear + 1, + Policy = nowyear + 1 < a.Years ? 0 : a.Policy + + }); + list.Add(new LizationDto() + { + name = (nowyear + 2).ToString() + "(现高一)", + code = nowyear + 2, + Policy = nowyear + 2 < a.Years ? 0 : a.Policy + }); + + } + else + { + list.Add(new LizationDto() + { + name = (nowyear).ToString(), + code = nowyear, + Policy = nowyear < a.Years ? 0 : a.Policy + + }); + list.Add(new LizationDto() + { + name = (nowyear + 1).ToString() + "(现高三)", + code = nowyear + 1, + Policy = nowyear + 1 < a.Years ? 0 : a.Policy + + }); + list.Add(new LizationDto() + { + name = (nowyear + 2).ToString() + "(现高二)", + code = nowyear + 2, + Policy = nowyear + 2 < a.Years ? 0 : a.Policy + + }); + list.Add(new LizationDto() + { + name = (nowyear + 3).ToString() + "(现高一)", + code = nowyear + 3, + Policy = nowyear + 3 < a.Years ? 0 : a.Policy + }); + } + a.lizations = list; + + }); + + data.response = sevolunterlist; + data.msg = "ok"; + return data; + + } + + [HttpPost] + public async Task> Post([FromBody] D_SeVolunteerInitialization request) + { + var data = new MessageModel(); + + var id = await _d_SeVolunteerInitializationServices.Add(request); + data.success = id > 0; + + if (data.success) + { + data.response = id.ObjToString(); + data.msg = "添加成功"; + } + + return data; + } + + + } +} \ No newline at end of file diff --git a/New_College.Api/New_College.Model.xml b/New_College.Api/New_College.Model.xml index b3032d0..6027bcb 100644 --- a/New_College.Api/New_College.Model.xml +++ b/New_College.Api/New_College.Model.xml @@ -851,6 +851,26 @@ 累计人数 + + + 政策类型:0文理 分科|1 3+3|2 3+1+2 + + + + + 执行年份 + + + + + 是否开通:1已开通,0未开通 + + + + + 高考总分数 + + 标签代表人物 @@ -3700,6 +3720,11 @@ 高校所在省份 + + + + + 高考年份 @@ -5945,5 +5970,15 @@ + + + + + + + + 0文理分科 1 3+3 2 3+1+3 + + diff --git a/New_College.Api/New_College.xml b/New_College.Api/New_College.xml index e26d636..3274411 100644 --- a/New_College.Api/New_College.xml +++ b/New_College.Api/New_College.xml @@ -815,6 +815,17 @@ + + + 服务器接口,因为是模板生成,所以首字母是大写的,自己可以重构下 + + + + + 志愿填报省份数据 + + + 省市区操作类 diff --git a/New_College.IServices/ID_SeVolunteerInitializationServices.cs b/New_College.IServices/ID_SeVolunteerInitializationServices.cs new file mode 100644 index 0000000..66f44f5 --- /dev/null +++ b/New_College.IServices/ID_SeVolunteerInitializationServices.cs @@ -0,0 +1,12 @@ +using New_College.IServices.BASE; +using New_College.Model.Models; + +namespace New_College.IServices +{ + /// + /// ID_SeVolunteerInitializationServices + /// + public interface ID_SeVolunteerInitializationServices :IBaseServices + { + } +} \ No newline at end of file diff --git a/New_College.Model/Models/D_SeVolunteerInitialization.cs b/New_College.Model/Models/D_SeVolunteerInitialization.cs new file mode 100644 index 0000000..6a6595c --- /dev/null +++ b/New_College.Model/Models/D_SeVolunteerInitialization.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace New_College.Model.Models +{ + public class D_SeVolunteerInitialization : EntityModel + { + + public string ProvinceName { get; set; } + + /// + /// 政策类型:0文理 分科|1 3+3|2 3+1+2 + /// + public int PolicyType { get; set; } + + /// + /// 执行年份 + /// + public int Years { get; set; } + + /// + /// 是否开通:1已开通,0未开通 + /// + public int IsOpen { get; set; } + + + /// + /// 高考总分数 + /// + public int AllScore { get; set; } + + + } +} diff --git a/New_College.Model/ViewModels/BaseResult.cs b/New_College.Model/ViewModels/BaseResult.cs index 6a259aa..b938d75 100644 --- a/New_College.Model/ViewModels/BaseResult.cs +++ b/New_College.Model/ViewModels/BaseResult.cs @@ -12,6 +12,7 @@ namespace New_College.Model.ViewModels public int Year { get; set; } + public string TypeName { get; set; } public int Score { get; set; } = 999; } diff --git a/New_College.Model/ViewModels/Query/PlanDetailQuery.cs b/New_College.Model/ViewModels/Query/PlanDetailQuery.cs index 1fb579c..9c2614b 100644 --- a/New_College.Model/ViewModels/Query/PlanDetailQuery.cs +++ b/New_College.Model/ViewModels/Query/PlanDetailQuery.cs @@ -35,6 +35,10 @@ namespace New_College.Model.ViewModels public int BatchId { get; set; } + /// + /// + /// + public string BatchName { get; set; } /// /// 高考年份 /// diff --git a/New_College.Model/ViewModels/SeVolunterInitializationDto.cs b/New_College.Model/ViewModels/SeVolunterInitializationDto.cs new file mode 100644 index 0000000..c799ddf --- /dev/null +++ b/New_College.Model/ViewModels/SeVolunterInitializationDto.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace New_College.Model +{ + public class SeVolunterInitializationDto + { + + public int Code { get; set; } + public string ProvinceName { get; set; } + + /// + /// + /// + public int Policy { get; set; } + public int IsOpen { get; set; } + + public int AllScore { get; set; } + + public int Years { get; set; } + public List lizations { get; set; } + } + + public class LizationDto + { + public string name { get; set; } + + /// + /// 0文理分科 1 3+3 2 3+1+3 + /// + public int Policy { get; set; } + public int code { get; set; } + } + +} diff --git a/New_College.Repository/BASE/D_SeVolunteerInitializationRepository.cs b/New_College.Repository/BASE/D_SeVolunteerInitializationRepository.cs new file mode 100644 index 0000000..7450bf6 --- /dev/null +++ b/New_College.Repository/BASE/D_SeVolunteerInitializationRepository.cs @@ -0,0 +1,17 @@ +using New_College.IRepository; +using New_College.IRepository.UnitOfWork; +using New_College.Model.Models; +using New_College.Repository.Base; + +namespace New_College.Repository +{ + /// + /// D_SeVolunteerInitializationRepository + /// + public class D_SeVolunteerInitializationRepository : BaseRepository, ID_SeVolunteerInitializationRepository + { + public D_SeVolunteerInitializationRepository(IUnitOfWork unitOfWork) : base(unitOfWork) + { + } + } +} \ No newline at end of file diff --git a/New_College.Repository/BASE/ID_SeVolunteerInitializationRepository.cs b/New_College.Repository/BASE/ID_SeVolunteerInitializationRepository.cs new file mode 100644 index 0000000..f5f8c64 --- /dev/null +++ b/New_College.Repository/BASE/ID_SeVolunteerInitializationRepository.cs @@ -0,0 +1,12 @@ +using New_College.IRepository.Base; +using New_College.Model.Models; + +namespace New_College.IRepository +{ + /// + /// ID_SeVolunteerInitializationRepository + /// + public interface ID_SeVolunteerInitializationRepository : IBaseRepository + { + } +} \ No newline at end of file diff --git a/New_College.Repository/BASE/T_EnrollmentPlanedescRepository.cs b/New_College.Repository/BASE/T_EnrollmentPlanedescRepository.cs index dbf1c92..63ba972 100644 --- a/New_College.Repository/BASE/T_EnrollmentPlanedescRepository.cs +++ b/New_College.Repository/BASE/T_EnrollmentPlanedescRepository.cs @@ -86,6 +86,7 @@ namespace New_College.Repository .WhereIF(regionlist.Any(), p => SqlFunc.ContainsArray(regionlist, p.AreaName)) .WhereIF(query.Year > 0, p => p.Years == query.Year) .WhereIF(!string.IsNullOrEmpty(query.Location), p => p.Location == query.Location) + .WhereIF(!string.IsNullOrEmpty(query.BatchName), p => p.BatchName == query.BatchName) .WhereIF(string.IsNullOrWhiteSpace(query.Type), p => p.LowScore > 0 && (p.LowScore <= query.Score + 15)) .WhereIF(query.Type == "冲", p => p.LowScore > 0 && (p.LowScore <= query.Score + 15 && p.LowScore > query.Score + 5)) .WhereIF(query.Type == "稳", p => p.LowScore > 0 && (p.LowScore <= query.Score + 5 && p.LowScore > query.Score - 15)) @@ -122,9 +123,9 @@ namespace New_College.Repository { query.Year = query.Year > 2023 ? 2023 : query.Year; RefAsync totalNumber = 0; - if(query.provinceIds == null) + if (query.provinceIds == null) { - query.provinceIds=new List() { 0}; + query.provinceIds = new List() { 0 }; } var regionlist = this.Db.Queryable().Where(c => c.Level == 1).WhereIF(query.provinceIds != null && query.provinceIds.Any(), c => SqlFunc.ContainsArray(query.provinceIds, c.KeyId)).Select(c => c.RegionName).ToList(); @@ -159,6 +160,7 @@ namespace New_College.Repository .WhereIF(regionlist.Any(), p => SqlFunc.ContainsArray(regionlist, p.AreaName)) .WhereIF(query.Year > 0, p => p.Years == query.Year) .WhereIF(!string.IsNullOrEmpty(query.Location), p => p.Location == query.Location) + .WhereIF(!string.IsNullOrEmpty(query.BatchName), p => p.BatchName == query.BatchName) .WhereIF(string.IsNullOrWhiteSpace(query.Type), p => p.LowScore > 0 && (p.LowScore <= query.Score + 15)) .WhereIF(query.Type == "冲", p => p.LowScore > 0 && (p.LowScore <= query.Score + 15 && p.LowScore > query.Score + 5)) .WhereIF(query.Type == "稳", p => p.LowScore > 0 && (p.LowScore <= query.Score + 5 && p.LowScore > query.Score - 15)) @@ -180,13 +182,13 @@ namespace New_College.Repository }) .Select(p => new UniversityEnrollmentPlanResult() { - // AreaName = p.AreaName, + // AreaName = p.AreaName, UniversityId = p.UId, // AscriptionName=p.Ownership, - //_211=p._211, - //_985=p._985, - //_SYL=p._SYL, - // Type= p.SubjectType, + //_211=p._211, + //_985=p._985, + //_SYL=p._SYL, + // Type= p.SubjectType, // Logo = universitys.Logo, // Nhef = universitys.Nhef, // Rank = universitys.Rank <= 0 ? "--" : universitys.Rank.ToString(), diff --git a/New_College.Services/D_SeVolunteerInitializationServices.cs b/New_College.Services/D_SeVolunteerInitializationServices.cs new file mode 100644 index 0000000..04478f1 --- /dev/null +++ b/New_College.Services/D_SeVolunteerInitializationServices.cs @@ -0,0 +1,18 @@ + +using New_College.IServices; +using New_College.Model.Models; +using New_College.Services.BASE; +using New_College.IRepository.Base; + +namespace New_College.Services +{ + public class D_SeVolunteerInitializationServices : BaseServices, ID_SeVolunteerInitializationServices + { + private readonly IBaseRepository _dal; + public D_SeVolunteerInitializationServices(IBaseRepository dal) + { + this._dal = dal; + base.BaseDal = dal; + } + } +} \ No newline at end of file diff --git a/New_College.Services/T_EnrollmentPlanedescServices.cs b/New_College.Services/T_EnrollmentPlanedescServices.cs index 5ba6c9d..3ee2af1 100644 --- a/New_College.Services/T_EnrollmentPlanedescServices.cs +++ b/New_College.Services/T_EnrollmentPlanedescServices.cs @@ -1530,7 +1530,8 @@ namespace New_College.Services list.Add(new IdNameResult() { Id = item.Id, - Name = item.Batch_name + "(" + item.Type + ")", + Name = item.Batch_name, + TypeName = item.Type, Year = item.Year, Score = item.ScoreLine });