diff --git a/New_College.Api/Controllers/Front/EvaluationsController.cs b/New_College.Api/Controllers/Front/EvaluationsController.cs new file mode 100644 index 0000000..9dc9957 --- /dev/null +++ b/New_College.Api/Controllers/Front/EvaluationsController.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using New_College.IServices; +using New_College.Model; +using New_College.Model.ViewModels.Query; +using New_College.Model.ViewModels.Result; + +namespace New_College.Api.Controllers.Front +{ + [Route("api/[controller]")] + [ApiController] + public class EvaluationsController : ControllerBase + { + + private readonly ITest_PsychMeasurementInfoServices _test_Psych; + public EvaluationsController(ITest_PsychMeasurementInfoServices _PsychMeasurementInfoServices) + { + this._test_Psych = _PsychMeasurementInfoServices; + } + + /// + /// 测评结果列表 + /// + /// + /// + [HttpGet] + public async Task>> GetEvaluations([FromQuery] EvaluationRequest request) + { + try + { + var result = await this._test_Psych.GetEvaluations(request); + return new MessageModel>() + { + msg = "success", + response = result, + success = true + }; + } + catch (Exception ex) + { + + return new MessageModel>() + { + msg = ex.Message + }; + } + } + + } +} diff --git a/New_College.Api/Controllers/Front/FeedBackController.cs b/New_College.Api/Controllers/Front/FeedBackController.cs new file mode 100644 index 0000000..97992b0 --- /dev/null +++ b/New_College.Api/Controllers/Front/FeedBackController.cs @@ -0,0 +1,66 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using New_College.IServices; +using New_College.Model; +using New_College.Model.ViewModels.Query; + +namespace New_College.Api.Controllers.Front +{ + [Route("api/front/[controller]/[action]")] + [ApiController] + public class FeedBackController : ControllerBase + { + + private readonly IFeedbackInfoServices feedback; + public FeedBackController(IFeedbackInfoServices feedbackInfoServices) + { + this.feedback = feedbackInfoServices; + } + + + + + /// + /// 用户反馈 + /// + /// + /// + [HttpPost] + public async Task> Add(FeedBackRequest request) + { + try + { + var status = await feedback.Add(new Model.Models.FeedbackInfo() + { + Content = request.Content, + CustomerId = request.CustomerId, + Title = request.Title + }); + + return new MessageModel() + { + response = "系统已收到您的反馈!!!我们平台运维人员将对您的问题做统计分类,请您耐心等待后续反馈", + msg = "success", + success = true + }; + } + catch (Exception ex) + { + + return new MessageModel() + { + msg = ex.Message + }; + } + } + + + + + } +} diff --git a/New_College.Api/Controllers/Front/FrontSelectionController.cs b/New_College.Api/Controllers/Front/FrontSelectionController.cs index d56bb2c..517ef3e 100644 --- a/New_College.Api/Controllers/Front/FrontSelectionController.cs +++ b/New_College.Api/Controllers/Front/FrontSelectionController.cs @@ -40,24 +40,20 @@ namespace New_College.Api.Controllers.Front { try { - var wheres = PredicateBuilder.New(); + var query = new List(); - if (request.UniversityName.Any()) + + var subjectlist = new PageModel(); + if (request.UniversityName != null) { - request.UniversityName.ForEach(a => { - wheres = wheres.Or(x => x.UniversityName.Contains(a)); - }); - + query = Newtonsoft.Json.JsonConvert.DeserializeObject>(request.UniversityName); + subjectlist = await _selectionServices.QueryPage(w => query.Contains(w.UniversityName), request.PageIndex, request.PageSize); } - - if (request.MajorName.Any()) + if (request.MajorName != null) { - request.UniversityName.ForEach(a => { - wheres = wheres.Or(x => x.MajorName.Contains(a)); - }); + query = Newtonsoft.Json.JsonConvert.DeserializeObject>(request.MajorName); + subjectlist = await _selectionServices.QueryPage(w => query.Contains(w.MajorName), request.PageIndex, request.PageSize); } - var subjectlist = await _selectionServices.QueryPage(wheres, request.PageIndex, request.PageSize); - return new MessageModel>() { msg = "success", diff --git a/New_College.Api/Controllers/Front/LibraryController.cs b/New_College.Api/Controllers/Front/LibraryController.cs index 1ddf48d..68fc675 100644 --- a/New_College.Api/Controllers/Front/LibraryController.cs +++ b/New_College.Api/Controllers/Front/LibraryController.cs @@ -69,6 +69,24 @@ namespace New_College.Api.Controllers.Front }; } + + /// + /// 根据一级专业Id获取二三级专业数据 + /// + /// + /// + [HttpGet] + public async Task>> GetTreeMajors([FromQuery] int tradeId) + { + var result = await iD_LongIdMapServices.GetTreeMajors(tradeId); + return new MessageModel>() + { + success = result.Count <= 0 ? false : true, + msg = result.Count <= 0 ? "获取失败" : "获取成功", + response = result + }; + } + /// /// 获取推荐职业 /// diff --git a/New_College.Api/Controllers/Front/MyHistoryInfoController.cs b/New_College.Api/Controllers/Front/MyHistoryInfoController.cs new file mode 100644 index 0000000..ed9e84f --- /dev/null +++ b/New_College.Api/Controllers/Front/MyHistoryInfoController.cs @@ -0,0 +1,79 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using New_College.IServices; +using New_College.Model; +using New_College.Model.ViewModels.Result; + +namespace New_College.Api.Controllers.Front +{ + /// + /// 历史大学 + /// + [Route("api/front/[controller]/[action]")] + [ApiController] + public class MyHistoryInfoController : ControllerBase + { + private readonly ID_MyHistoryInfoServices _MyHistory; + private readonly ID_UniversityServices _UniversityServices; + public MyHistoryInfoController(ID_MyHistoryInfoServices d_MyHistoryInfoServices, ID_UniversityServices d_UniversityServices) + { + this._MyHistory = d_MyHistoryInfoServices; + this._UniversityServices = d_UniversityServices; + } + + + /// + /// 浏览历史记录列表 + /// + /// + /// + [HttpGet] + public async Task>> GetMyHistory([FromQuery] int CustomerId) + { + var response = new List(); + try + { + var query = await _MyHistory.Query(e => e.UId == CustomerId); + if (query.Any()) + { + var uids = query.Select(s => s.UId).ToList(); + var universitysinfo = await this._UniversityServices.Query(q => uids.Contains(q.Id)); + response = universitysinfo.Select(s => new MyHistoryResponse() + { + AreaName = s.Area_Name, + Id = s.Id, + Logo = s.Logo, + Name = s.Name, + Nature = s.Nature, + Rank = s.Rank, + Syl = s.Syl == 1 ? true : false, + Nhef = s.Nhef == 1 ? true : false, + Sff = s.Sff == 1 ? true : false + }).ToList(); + } + return new MessageModel>() + { + msg = "success", + response = response, + success = true + }; + } + catch (Exception ex) + { + return new MessageModel>() + { + msg = ex.Message + }; + } + + + } + + + + } +} diff --git a/New_College.Api/New_College.Model.xml b/New_College.Api/New_College.Model.xml index 024ecd0..e05e562 100644 --- a/New_College.Api/New_College.Model.xml +++ b/New_College.Api/New_College.Model.xml @@ -440,6 +440,16 @@ 薪资 + + + 记录Id + + + + + + + @@ -635,6 +645,11 @@ 排名 + + + + + 留言表 @@ -3509,9 +3524,9 @@ 高考年份 - + - 批次Id + 省份Id @@ -3519,6 +3534,11 @@ 学生预估分数 + + + 批次Id + + 学校省份 @@ -4139,6 +4159,56 @@ 招生人数 + + + 0未测评,1已测评 + + + + + 主键id + + + + + 名称 + + + + + 排名 + + + + + 是否985 + + + + + 是否211 + + + + + 是否双一流 + + + + + 学校logo + + + + + 省市区名称 + + + + + 办学性质 + + 省份名称 @@ -5184,6 +5254,11 @@ 学校logo + + + 办学性质 + + diff --git a/New_College.Api/New_College.xml b/New_College.Api/New_College.xml index b0f600f..0ed79ef 100644 --- a/New_College.Api/New_College.xml +++ b/New_College.Api/New_College.xml @@ -162,6 +162,13 @@ + + + 测评结果列表 + + + + 获取考试时间 @@ -187,6 +194,13 @@ + + + 用户反馈 + + + + 新高考选科 @@ -213,6 +227,13 @@ + + + 根据一级专业Id获取二三级专业数据 + + + + 获取推荐职业 @@ -335,6 +356,18 @@ + + + 历史大学 + + + + + 浏览历史记录列表 + + + + 获取top多少的新闻 diff --git a/New_College.IServices/ID_LongIdMapServices.cs b/New_College.IServices/ID_LongIdMapServices.cs index 69a66da..a61e000 100644 --- a/New_College.IServices/ID_LongIdMapServices.cs +++ b/New_College.IServices/ID_LongIdMapServices.cs @@ -18,6 +18,13 @@ namespace New_College.IServices Task> uniGetMajorInfo(MajorcategoryQuery query); + /// + /// 根据一级分类id获取二三级分类数据 + /// + /// + /// + Task> GetTreeMajors(int tradeId); + Task> GetRecommendOccupation(); Task> uniGetOccupationInfo(); diff --git a/New_College.IServices/ID_MyHistoryInfoServices.cs b/New_College.IServices/ID_MyHistoryInfoServices.cs new file mode 100644 index 0000000..c76104c --- /dev/null +++ b/New_College.IServices/ID_MyHistoryInfoServices.cs @@ -0,0 +1,12 @@ +using New_College.IServices.BASE; +using New_College.Model.Models; + +namespace New_College.IServices +{ + /// + /// ID_MyHistoryInfoServices + /// + public interface ID_MyHistoryInfoServices :IBaseServices + { + } +} \ No newline at end of file diff --git a/New_College.IServices/IFeedbackInfoServices.cs b/New_College.IServices/IFeedbackInfoServices.cs new file mode 100644 index 0000000..86355cd --- /dev/null +++ b/New_College.IServices/IFeedbackInfoServices.cs @@ -0,0 +1,12 @@ +using New_College.IServices.BASE; +using New_College.Model.Models; + +namespace New_College.IServices +{ + /// + /// IFeedbackInfoServices + /// + public interface IFeedbackInfoServices :IBaseServices + { + } +} \ No newline at end of file diff --git a/New_College.IServices/ITest_PsychMeasurementInfoServices.cs b/New_College.IServices/ITest_PsychMeasurementInfoServices.cs index 242fd06..a6e7a55 100644 --- a/New_College.IServices/ITest_PsychMeasurementInfoServices.cs +++ b/New_College.IServices/ITest_PsychMeasurementInfoServices.cs @@ -2,6 +2,8 @@ using New_College.Model; using New_College.Model.Models; using New_College.Model.ViewModels; +using New_College.Model.ViewModels.Query; +using New_College.Model.ViewModels.Result; using System.Collections.Generic; using System.Threading.Tasks; @@ -62,5 +64,13 @@ namespace New_College.IServices /// Task> GetHollandSubject(HollandSubjectQuery query); + + /// + /// + /// + /// + /// + Task> GetEvaluations(EvaluationRequest request); + } } \ No newline at end of file diff --git a/New_College.Model/Models/D_MyHistoryInfo.cs b/New_College.Model/Models/D_MyHistoryInfo.cs new file mode 100644 index 0000000..13b4156 --- /dev/null +++ b/New_College.Model/Models/D_MyHistoryInfo.cs @@ -0,0 +1,24 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Text; + +namespace New_College.Model.Models +{ + [SugarTable("D_MyHistoryInfo", "WMBLOG_MYSQL")] + public class D_MyHistoryInfo : EntityModel + { + public int CustomerId { get; set; } + + /// + /// 记录Id + /// + public int UId { get; set; } + + /// + /// + /// + public int Type { get; set; } + + } +} diff --git a/New_College.Model/Models/FeedbackInfo.cs b/New_College.Model/Models/FeedbackInfo.cs new file mode 100644 index 0000000..2c6dfe8 --- /dev/null +++ b/New_College.Model/Models/FeedbackInfo.cs @@ -0,0 +1,22 @@ +using System; +using System.Linq; +using System.Text; +using SqlSugar; + + +namespace New_College.Model.Models +{ + /// + /// + /// + [SugarTable("FeedbackInfo", "WMBLOG_MYSQL")] + public class FeedbackInfo:EntityModel + { + + public int? CustomerId { get; set; } + + public string Title { get; set; } + + public string Content { get; set; } + } +} \ No newline at end of file diff --git a/New_College.Model/Request/SelectionServiceRequest.cs b/New_College.Model/Request/SelectionServiceRequest.cs index 25aff42..37d0376 100644 --- a/New_College.Model/Request/SelectionServiceRequest.cs +++ b/New_College.Model/Request/SelectionServiceRequest.cs @@ -7,9 +7,9 @@ namespace New_College.Model.Request { public class SelectionServiceRequest: BasePageRequest { - public List UniversityName { get; set; } + public string UniversityName { get; set; } - public List MajorName { get; set; } + public string MajorName { get; set; } } } diff --git a/New_College.Model/ViewModels/BaseResult.cs b/New_College.Model/ViewModels/BaseResult.cs index 60ebfc4..6a259aa 100644 --- a/New_College.Model/ViewModels/BaseResult.cs +++ b/New_College.Model/ViewModels/BaseResult.cs @@ -17,6 +17,7 @@ namespace New_College.Model.ViewModels public class IdQuery { + public int? CustomerId { get; set; } public int Id { get; set; } public List Ids { get; set; } diff --git a/New_College.Model/ViewModels/Query/EvaluationRequest.cs b/New_College.Model/ViewModels/Query/EvaluationRequest.cs new file mode 100644 index 0000000..d89a59c --- /dev/null +++ b/New_College.Model/ViewModels/Query/EvaluationRequest.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace New_College.Model.ViewModels.Query +{ + public class EvaluationRequest + { + public int CustomerId { get; set; } + } +} diff --git a/New_College.Model/ViewModels/Query/FeedBackRequest.cs b/New_College.Model/ViewModels/Query/FeedBackRequest.cs new file mode 100644 index 0000000..5aedbaf --- /dev/null +++ b/New_College.Model/ViewModels/Query/FeedBackRequest.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace New_College.Model.ViewModels.Query +{ + public class FeedBackRequest + { + public int CustomerId { get; set; } + + public string Title { get; set; } + + public string Content { get; set; } + } +} diff --git a/New_College.Model/ViewModels/Query/TagEnrollmentPlaneQuery.cs b/New_College.Model/ViewModels/Query/TagEnrollmentPlaneQuery.cs index 7c85c4e..bc5d40a 100644 --- a/New_College.Model/ViewModels/Query/TagEnrollmentPlaneQuery.cs +++ b/New_College.Model/ViewModels/Query/TagEnrollmentPlaneQuery.cs @@ -121,15 +121,19 @@ namespace New_College.Model.ViewModels public int Year { get; set; } /// - /// 批次Id + /// 省份Id /// - public int BatchId { get; set; } + public int AreaId { get; set; } /// /// 学生预估分数 /// public float Score { get; set; } + /// + /// 批次Id + /// + public int BatchId { get; set; } /// /// 学校省份 /// diff --git a/New_College.Model/ViewModels/Result/EvaluationResponse.cs b/New_College.Model/ViewModels/Result/EvaluationResponse.cs new file mode 100644 index 0000000..c36029b --- /dev/null +++ b/New_College.Model/ViewModels/Result/EvaluationResponse.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace New_College.Model.ViewModels.Result +{ + public class EvaluationResponse + { + public int PId { get; set; } + + public string Title { get; set; } + public string Message { get; set; } + + /// + /// 0未测评,1已测评 + /// + public int Status { get; set; } = 0; + } +} diff --git a/New_College.Model/ViewModels/Result/MyHistoryResponse.cs b/New_College.Model/ViewModels/Result/MyHistoryResponse.cs new file mode 100644 index 0000000..33d2646 --- /dev/null +++ b/New_College.Model/ViewModels/Result/MyHistoryResponse.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace New_College.Model.ViewModels.Result +{ + public class MyHistoryResponse + { + /// + /// 主键id + /// + public int Id { get; set; } + /// + /// 名称 + /// + public string Name { get; set; } + /// + /// 排名 + /// + public int? Rank { get; set; } + /// + /// 是否985 + /// + public bool? Nhef { get; set; } + /// + /// 是否211 + /// + public bool? Sff { get; set; } + /// + /// 是否双一流 + /// + public bool? Syl { get; set; } + /// + /// 学校logo + /// + public string Logo { get; set; } + + /// + /// 省市区名称 + /// + public string AreaName { get; set; } + /// + /// 办学性质 + /// + public int Nature { get; set; } + + } +} diff --git a/New_College.Model/ViewModels/Result/VolunteerResult.cs b/New_College.Model/ViewModels/Result/VolunteerResult.cs index 848da7e..ed76c61 100644 --- a/New_College.Model/ViewModels/Result/VolunteerResult.cs +++ b/New_College.Model/ViewModels/Result/VolunteerResult.cs @@ -34,6 +34,9 @@ namespace New_College.Model.ViewModels public List Infos { get; set; } + public string AreaName { get; set; } + + public string Year { get; set; } /// /// 行政名称 /// diff --git a/New_College.Model/ViewModels/Result/VolunteerTableResult.cs b/New_College.Model/ViewModels/Result/VolunteerTableResult.cs index 3e30a55..17f64e3 100644 --- a/New_College.Model/ViewModels/Result/VolunteerTableResult.cs +++ b/New_College.Model/ViewModels/Result/VolunteerTableResult.cs @@ -12,6 +12,14 @@ namespace New_College.Model.ViewModels public int UniversityId { get; set; } public string UniversityName { get; set; } + /// + /// 省市区名称 + /// + public string AreaName { get; set; } + /// + /// 年份 + /// + public int Year { get; set; } public List Infos { get; set; } } @@ -27,6 +35,7 @@ namespace New_College.Model.ViewModels public string Year { get; set; } public string Money { get; set; } + public string YearName { get; set; } public float Scoreline { get; set; } } @@ -75,6 +84,13 @@ namespace New_College.Model.ViewModels public string UniversityName { get; set; } + public string Province { get; set; } + + /// + /// 办学性质 + /// + public int Nature { get; set; } + public List Infos { get; set; } } } diff --git a/New_College.Model/ViewModels/Result/uniMajorSecond.cs b/New_College.Model/ViewModels/Result/uniMajorSecond.cs index 5b76787..ca6314e 100644 --- a/New_College.Model/ViewModels/Result/uniMajorSecond.cs +++ b/New_College.Model/ViewModels/Result/uniMajorSecond.cs @@ -24,6 +24,7 @@ namespace New_College.Model.ViewModels /// public class uniMajorInfoResult { + public int RootId { get; set; } public string FirstName { get; set; } public List SecondInfo { get; set; } public int MajorNum { get; set; } @@ -37,4 +38,14 @@ namespace New_College.Model.ViewModels public string MajorName { get; set; } public int MajorNum { get; set; } } + + + public class TreeMajorInfoResult + { + public int MajorClassId { get; set; } + public string MajorClassName { get; set; } + public List MajorsInfo { get; set; } + } + + } diff --git a/New_College.Repository/BASE/D_MyHistoryInfoRepository.cs b/New_College.Repository/BASE/D_MyHistoryInfoRepository.cs new file mode 100644 index 0000000..b41740f --- /dev/null +++ b/New_College.Repository/BASE/D_MyHistoryInfoRepository.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_MyHistoryInfoRepository + /// + public class D_MyHistoryInfoRepository : BaseRepository, ID_MyHistoryInfoRepository + { + public D_MyHistoryInfoRepository(IUnitOfWork unitOfWork) : base(unitOfWork) + { + } + } +} \ No newline at end of file diff --git a/New_College.Repository/BASE/FeedbackInfoRepository.cs b/New_College.Repository/BASE/FeedbackInfoRepository.cs new file mode 100644 index 0000000..5ea6127 --- /dev/null +++ b/New_College.Repository/BASE/FeedbackInfoRepository.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 +{ + /// + /// FeedbackInfoRepository + /// + public class FeedbackInfoRepository : BaseRepository, IFeedbackInfoRepository + { + public FeedbackInfoRepository(IUnitOfWork unitOfWork) : base(unitOfWork) + { + } + } +} \ No newline at end of file diff --git a/New_College.Repository/BASE/ID_MyHistoryInfoRepository.cs b/New_College.Repository/BASE/ID_MyHistoryInfoRepository.cs new file mode 100644 index 0000000..7447fb4 --- /dev/null +++ b/New_College.Repository/BASE/ID_MyHistoryInfoRepository.cs @@ -0,0 +1,12 @@ +using New_College.IRepository.Base; +using New_College.Model.Models; + +namespace New_College.IRepository +{ + /// + /// ID_MyHistoryInfoRepository + /// + public interface ID_MyHistoryInfoRepository : IBaseRepository + { + } +} \ No newline at end of file diff --git a/New_College.Repository/BASE/IFeedbackInfoRepository.cs b/New_College.Repository/BASE/IFeedbackInfoRepository.cs new file mode 100644 index 0000000..05989aa --- /dev/null +++ b/New_College.Repository/BASE/IFeedbackInfoRepository.cs @@ -0,0 +1,12 @@ +using New_College.IRepository.Base; +using New_College.Model.Models; + +namespace New_College.IRepository +{ + /// + /// IFeedbackInfoRepository + /// + public interface IFeedbackInfoRepository : IBaseRepository + { + } +} \ No newline at end of file diff --git a/New_College.Services/D_LongIdMapServices.cs b/New_College.Services/D_LongIdMapServices.cs index 4b2167c..ee338e6 100644 --- a/New_College.Services/D_LongIdMapServices.cs +++ b/New_College.Services/D_LongIdMapServices.cs @@ -43,7 +43,7 @@ namespace New_College.Services private readonly IT_EnrollmentBatchRepository t_EnrollmentBatchRepository; private readonly ID_GraduateFlowRepository d_GraduateFlowRepository; private readonly IT_EnrollmentPlaneRepository t_EnrollmentPlaneRepository; - + private readonly ID_MyHistoryInfoServices d_MyHistory; public D_LongIdMapServices(IBaseRepository dal , ID_MajorCategoryRepository ID_MajorCategoryRepository , ID_MajorClassRepository ID_MajorClassRepository @@ -63,7 +63,7 @@ namespace New_College.Services , IT_EnrollmentPlanedescRepository IT_EnrollmentPlanedescRepository , IT_EnrollmentBatchRepository IT_EnrollmentBatchRepository , ID_GraduateFlowRepository ID_GraduateFlowRepository - , IT_EnrollmentPlaneRepository IT_EnrollmentPlaneRepository) + , IT_EnrollmentPlaneRepository IT_EnrollmentPlaneRepository, ID_MyHistoryInfoServices d_MyHistoryInfoServices) { this._dal = dal; d_MajorCategoryRepository = ID_MajorCategoryRepository; @@ -86,6 +86,7 @@ namespace New_College.Services d_GraduateFlowRepository = ID_GraduateFlowRepository; t_EnrollmentPlaneRepository = IT_EnrollmentPlaneRepository; base.BaseDal = dal; + this.d_MyHistory = d_MyHistoryInfoServices; } /// @@ -185,12 +186,41 @@ namespace New_College.Services list.Add(new uniMajorInfoResult() { FirstName = item.Name, + RootId = item.Id, SecondInfo = scond }); } return list; } + + + /// + /// 根据一级分类id 获取二级三级专业数据 + /// + /// + /// + public async Task> GetTreeMajors(int tradeId) + { + var result = new List(); + var classmajors = (await d_MajorClassRepository.Query(x => x.IsDelete == false && x.TradeId == tradeId)).Select(x => new uniMajorClassSelect() { Id = x.Id, Name = x.Name, TradeId = x.TradeId }).ToList(); + var majorinfo = (await d_MajorRepository.Query(x => x.IsDelete == false)).Select(s => new uniMajorClassSelect() { Id = s.Id, TradeId = s.CategoryClass_Id, Name = s.Name }).ToList(); + classmajors.ForEach(a => + { + var models = new TreeMajorInfoResult(); + models.MajorClassId = a.Id; + models.MajorClassName = a.Name; + models.MajorsInfo = majorinfo.Where(e => e.TradeId == a.Id).Select(s => new uniMajorSelect() + { + Id = s.Id, + Name = s.Name + }).ToList(); + result.Add(models); + }); + return result; + } + + /// /// 获取推荐职业 /// @@ -252,6 +282,16 @@ namespace New_College.Services { imgs = imglist.ImgList; } + if (query.CustomerId.HasValue && query.CustomerId.Value > 0) + { + await d_MyHistory.Add(new D_MyHistoryInfo() + { + + OrderSort = 0, + Type = 0, + UId = query.CustomerId.Value + }); + } result.universityResult = new UniversityResult { Id = university.Id, diff --git a/New_College.Services/D_MyHistoryInfoServices.cs b/New_College.Services/D_MyHistoryInfoServices.cs new file mode 100644 index 0000000..954927f --- /dev/null +++ b/New_College.Services/D_MyHistoryInfoServices.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_MyHistoryInfoServices : BaseServices, ID_MyHistoryInfoServices + { + private readonly IBaseRepository _dal; + public D_MyHistoryInfoServices(IBaseRepository dal) + { + this._dal = dal; + base.BaseDal = dal; + } + } +} \ No newline at end of file diff --git a/New_College.Services/FeedbackInfoServices.cs b/New_College.Services/FeedbackInfoServices.cs new file mode 100644 index 0000000..f2c8113 --- /dev/null +++ b/New_College.Services/FeedbackInfoServices.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 FeedbackInfoServices : BaseServices, IFeedbackInfoServices + { + private readonly IBaseRepository _dal; + public FeedbackInfoServices(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 052b03c..c8f060e 100644 --- a/New_College.Services/T_EnrollmentPlanedescServices.cs +++ b/New_College.Services/T_EnrollmentPlanedescServices.cs @@ -34,7 +34,7 @@ namespace New_College.Services private readonly IU_VolunteerTableDetailRepository u_VolunteerTableDetailRepository; private readonly ID_UniversityCollectionRepository d_UniversityCollectionRepository; private readonly IT_GearInfoRepository t_GearInfo; - + private readonly IT_EnrollmentPlanedescRepository t_EnrollmentPlanedesc; public T_EnrollmentPlanedescServices(IBaseRepository dal , ID_UniversityRepository ID_UniversityRepository , IT_EnrollmentBatchRepository IT_EnrollmentBatchRepository @@ -49,7 +49,7 @@ namespace New_College.Services , IU_VolunteerTableRepository IU_VolunteerTableRepository , IU_VolunteerTableDetailRepository IU_VolunteerTableDetailRepository , ID_UniversityCollectionRepository ID_UniversityCollectionRepository - , IT_GearInfoRepository IT_GearInfoRepository) + , IT_GearInfoRepository IT_GearInfoRepository, IT_EnrollmentPlanedescRepository t_EnrollmentPlanedescServices) { this._dal = dal; d_UniversityRepository = ID_UniversityRepository; @@ -67,6 +67,7 @@ namespace New_College.Services d_UniversityCollectionRepository = ID_UniversityCollectionRepository; t_GearInfo = IT_GearInfoRepository; base.BaseDal = dal; + this.t_EnrollmentPlanedesc = t_EnrollmentPlanedescServices; } public List permut = new List(); @@ -986,6 +987,8 @@ namespace New_College.Services Nhef = item.Nhef, Sff = item.Sff, Syl = item.Syl, + AreaName = item.Area_Name, + Year = query.Year, Infos = plansinfo.Select(x => new PlanInfo() { MajorId = x.Id, @@ -1088,7 +1091,7 @@ namespace New_College.Services //所选科目 分数 if (query.Score <= 0) return new MessageModel>() { success = false, msg = "分数不能为0..." }; - var planinfo = await t_EnrollmentPlaneRepository.Query(w => w.Id == query.BatchId); + var planinfo = await t_EnrollmentPlaneRepository.Query(w => w.Area_Id == query.AreaId && w.Years == query.Year); if (planinfo == null) return new MessageModel>() { success = false, msg = "所选省份年份的招生计划,正在完善中..." }; //筛选符合条件的院校ids @@ -1203,7 +1206,13 @@ namespace New_College.Services if (planinfo == null) return new MessageModel>() { success = false, msg = "所选省份年份的招生计划,正在完善中..." }; var wheres = PredicateBuilder.New(); - wheres.And(x => query.UniversityIds.Contains(x.UniversityId) && x.IsDelete == false && x.PlanId == planinfo.FirstOrDefault().Id && x.UniversityId > 0); + wheres.And(x => x.IsDelete == false && x.PlanId == planinfo.FirstOrDefault().Id && x.UniversityId > 0); + wheres.And(x => x.Scoreline > 0); + if (query.UniversityIds != null && query.UniversityIds.Any()) + { + wheres.And(x => query.UniversityIds.Contains(x.UniversityId)); + } + //此处需加冲稳保 if (query.AreaId != 821 && query.AreaId != 1047 && query.AreaId != 1965) { @@ -1239,12 +1248,27 @@ namespace New_College.Services } //根据上述所有筛选 求出招生计划 var plandesc = await _dal.Query(wheres, "Scoreline desc"); - + int universityidcount = 0; var start = query.PageSize * (query.PageIndex - 1); var end = query.PageIndex * query.PageSize; - string ids = string.Join(",", query.UniversityIds); + var stringBuilderinfo = new StringBuilder(); - stringBuilderinfo.AppendFormat("select Rank,Id,Name,Logo,Nhef,Sff,Syl,Area_Name,AscriptionName from D_University where IsDelete=0 and Id in ({0}) limit {1},{2}", ids, start, end); + + stringBuilderinfo.AppendFormat("select Rank,Id,Name,Logo,Nhef,Sff,Syl,Area_Name,AscriptionName from D_University where IsDelete=0"); + if (query.UniversityIds != null && query.UniversityIds.Count > 0) + { + universityidcount = query.UniversityIds.Count; + string ids = string.Join(",", query.UniversityIds); + stringBuilderinfo.AppendFormat(" and Id in ({0}) ", ids); + } + else + { + universityidcount = plandesc.Select(x => x.UniversityId).Distinct().Count(); + string ids = string.Join(",", plandesc.Select(x => x.UniversityId).Distinct().ToList()); + stringBuilderinfo.AppendFormat(" and Id in ({0}) ", ids); + } + stringBuilderinfo.AppendFormat(" limit {0},{1}", start, end); + var sqldata = await d_UniversityRepository.QuerySql(stringBuilderinfo.ToString()); if (sqldata.Count <= 0) return new MessageModel>() { success = false, msg = "获取失败,数据为空" }; @@ -1263,7 +1287,7 @@ namespace New_College.Services AscriptionName = item.AscriptionName, MjaorPlan = plandesc.Count(x => x.UniversityId == item.Id), Rank = item.Rank <= 0 ? "-" : item.Rank.ToString(), - Type = Type + Type = plandesc.Where(x => x.UniversityId == item.Id && x.Scoreline > query.Score + 20).Any() ? "冲" : (plandesc.Where(x => query.Score >= x.Scoreline && query.Score - 25 <= x.Scoreline)).Any() ? "稳" : plandesc.Where(x => x.UniversityId == item.Id && x.Scoreline > 0 && query.Score > x.Scoreline).Any() ? "保" : "其他" }).ToList(); return new MessageModel>() { @@ -1272,10 +1296,10 @@ namespace New_College.Services response = new PageModel() { data = list, - dataCount = query.UniversityIds.Count(), + dataCount = universityidcount, page = query.PageIndex, PageSize = query.PageSize, - pageCount = (int)Math.Ceiling(query.UniversityIds.Count() / Convert.ToDecimal(query.PageSize)) + pageCount = (int)Math.Ceiling(universityidcount / Convert.ToDecimal(query.PageSize)) } }; } @@ -1707,6 +1731,7 @@ namespace New_College.Services list.Add(new VolunteerTableResult() { UniversityName = item.UniversityName, + Infos = nowdesc.Select(x => new PlanInfo() { Money = x.Tuitionfee, @@ -1801,9 +1826,20 @@ namespace New_College.Services List list = new List() { }; //var planstringids = query.details.Select(x => x.PlanMagorIds).ToList(); List PlanIds = new List() { }; + var id = 0; foreach (var item in query.details) { + PlanIds.AddRange(item.PlanMagorIds); + id = item.PlanMagorIds.First(); + } + string yearName = string.Empty; + var plandescmodels = await this.t_EnrollmentPlanedesc.QueryById(id); + if (plandescmodels != null) + { + var planinfo = await this.t_EnrollmentPlaneRepository.QueryById(plandescmodels.PlanId); + if (planinfo != null) + yearName = planinfo.Years.ToString(); } var descinfo = await _dal.Query(x => x.IsDelete == false && PlanIds.Contains(x.Id)); var universityids = query.details.Select(x => x.UniversityId).ToList(); @@ -1842,6 +1878,8 @@ namespace New_College.Services Syl = nowuniversityinfo.Syl > 0, UniversityId = item.UniversityId, UniversityName = item.UniversityName, + Province = nowuniversityinfo.Area_Name, + Nature = nowuniversityinfo.Nature, Infos = nowdesc.Select(x => new PlanInfo() { MajorId = x.Id, @@ -1849,7 +1887,8 @@ namespace New_College.Services Year = x.Studyyears, PlanName = x.MajorName, PlanNum = x.Plancount, - Scoreline = x.Scoreline + Scoreline = x.Scoreline, + YearName = yearName }).ToList() }); } diff --git a/New_College.Services/Test_PsychMeasurementInfoServices.cs b/New_College.Services/Test_PsychMeasurementInfoServices.cs index 5665a0f..6bf0240 100644 --- a/New_College.Services/Test_PsychMeasurementInfoServices.cs +++ b/New_College.Services/Test_PsychMeasurementInfoServices.cs @@ -14,6 +14,8 @@ using System.Reflection; using System; using System.Text; using New_College.Model; +using New_College.Model.ViewModels.Result; +using New_College.Model.ViewModels.Query; namespace New_College.Services { @@ -1236,6 +1238,53 @@ namespace New_College.Services } } + public async Task> GetEvaluations(EvaluationRequest request) + { + var lists = new List(); + var categoryids = new List(); + categoryids.Add(18); + categoryids.Add(19); + categoryids.Add(21); + var querys = await _dal.Query(e => e.StudentId == request.CustomerId && categoryids.Contains(e.CategoryId)); + + lists.Add(new EvaluationResponse() + { + Title = "Holland" + }); + lists.Add(new EvaluationResponse() + { + Title = "MBTI" + }); + lists.Add(new EvaluationResponse() + { + Title = "DISC" + }); + lists.ForEach(a => + { + switch (a.Title) + { + case "Holland": + var holland = querys.Where(e => e.CategoryId == 18).FirstOrDefault(); + a.Message = JsonConvert.DeserializeObject(holland.Result).TagName; + a.PId = holland.Id; + break; + case "MBTI": + var mbti = querys.Where(e => e.CategoryId == 18).FirstOrDefault(); + a.Message = mbti.Result; + a.PId = mbti.Id; + break; + case "DISC": + var disc = querys.Where(e => e.CategoryId == 18).FirstOrDefault(); + a.Message = "有魅力的、自信的、有说服力的、热情的、鼓舞人心的、乐观的、令人信服的、受欢迎的、好交际的、可信赖的"; + a.PId = disc.Id; + break; + } + }); + return lists; + } + + + ///// ///// 判断是否为不常见标签,若是则匹配相关联标签 /////