From b6a6769c33e51f7eef701070934ae9327fddd671 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?old=E6=98=93?= <156663459@qq.com> Date: Mon, 9 Oct 2023 16:20:35 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=96=B0=E5=A2=9E=E5=9F=BA=E7=A1=80?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/Front/NewsInfoController.cs | 4 +- New_College.Api/New_College.Model.xml | 40 ++++++++++++ New_College.Api/Startup.cs | 2 +- .../ID_HollandMapExplainServices.cs | 12 ++++ .../IHoldGroupMapOccupServices.cs | 12 ++++ .../Models/D_HollandMapExplain.cs | 37 +++++++++++ New_College.Model/Models/D_TagMapPerson.cs | 4 ++ New_College.Model/Models/HoldGroupMapOccup.cs | 17 +++++ .../Models/Test_MBTIMapResult.cs | 9 +++ .../Result/PsychMeasurementListResult.cs | 11 +++- .../BASE/D_HollandMapExplainRepository.cs | 17 +++++ .../BASE/HoldGroupMapOccupRepository.cs | 17 +++++ .../BASE/ID_HollandMapExplainRepository.cs | 12 ++++ .../BASE/IHoldGroupMapOccupRepository.cs | 12 ++++ .../D_HollandMapExplainServices.cs | 18 ++++++ .../HoldGroupMapOccupServices.cs | 18 ++++++ .../Test_PsychMeasurementInfoServices.cs | 63 +++++++++++++------ 17 files changed, 283 insertions(+), 22 deletions(-) create mode 100644 New_College.IServices/ID_HollandMapExplainServices.cs create mode 100644 New_College.IServices/IHoldGroupMapOccupServices.cs create mode 100644 New_College.Model/Models/D_HollandMapExplain.cs create mode 100644 New_College.Model/Models/HoldGroupMapOccup.cs create mode 100644 New_College.Repository/BASE/D_HollandMapExplainRepository.cs create mode 100644 New_College.Repository/BASE/HoldGroupMapOccupRepository.cs create mode 100644 New_College.Repository/BASE/ID_HollandMapExplainRepository.cs create mode 100644 New_College.Repository/BASE/IHoldGroupMapOccupRepository.cs create mode 100644 New_College.Services/D_HollandMapExplainServices.cs create mode 100644 New_College.Services/HoldGroupMapOccupServices.cs diff --git a/New_College.Api/Controllers/Front/NewsInfoController.cs b/New_College.Api/Controllers/Front/NewsInfoController.cs index ec079bd..1e76a68 100644 --- a/New_College.Api/Controllers/Front/NewsInfoController.cs +++ b/New_College.Api/Controllers/Front/NewsInfoController.cs @@ -37,7 +37,7 @@ namespace New_College.Api.Controllers.Front try { var list = new List(); - var query = (await d_NewsInfo.Query(e => e.IsDelete == false && e.CategoryId == request.CategoryId)).Take(request.Top).OrderByDescending(s => s.CreateTime); + var query = (await d_NewsInfo.Query(e => e.IsDelete == false && e.CategoryId == request.CategoryId, " CreateTime desc")).Take(request.Top).OrderByDescending(s => s.Id); list = query.Select(s => new NewsInfoResponse { CoverImg = s.CoverImg, @@ -75,7 +75,7 @@ namespace New_College.Api.Controllers.Front var pageresponse = new PageModel(); try { - var pageinfo = await d_NewsInfo.QueryPage(w => w.CategoryId == request.CategoryId, request.PageIndex, request.PageSize); + var pageinfo = await d_NewsInfo.QueryPage(w => w.CategoryId == request.CategoryId, request.PageIndex, request.PageSize, "CreateTime desc"); if (pageinfo.data.Any()) { pageresponse.data = pageinfo.data.Select(s => new NewsInfoResponse() diff --git a/New_College.Api/New_College.Model.xml b/New_College.Api/New_College.Model.xml index 4be5606..9febf40 100644 --- a/New_College.Api/New_College.Model.xml +++ b/New_College.Api/New_College.Model.xml @@ -205,6 +205,31 @@ + + + 标签 + + + + + 描述 + + + + + 基本属性特征 + + + + + 职业特征 + + + + + 典型职业 + + 专业二级分类id @@ -776,6 +801,11 @@ 人物昵称 + + + + + 人物头像 @@ -1872,6 +1902,11 @@ 标签 + + + 人格类型 + + 适合的领域 @@ -4970,6 +5005,11 @@ 测评结果 + + + + + 标签 diff --git a/New_College.Api/Startup.cs b/New_College.Api/Startup.cs index df47a35..1b61a29 100644 --- a/New_College.Api/Startup.cs +++ b/New_College.Api/Startup.cs @@ -215,7 +215,7 @@ namespace New_College }); // 生成种子数据 - // app.UseSeedDataMildd(myContext, Env.WebRootPath); + app.UseSeedDataMildd(myContext, Env.WebRootPath); // 开启QuartzNetJob调度服务 app.UseQuartzJobMildd(tasksQzServices, schedulerCenter); //服务注册 diff --git a/New_College.IServices/ID_HollandMapExplainServices.cs b/New_College.IServices/ID_HollandMapExplainServices.cs new file mode 100644 index 0000000..2625729 --- /dev/null +++ b/New_College.IServices/ID_HollandMapExplainServices.cs @@ -0,0 +1,12 @@ +using New_College.IServices.BASE; +using New_College.Model.Models; + +namespace New_College.IServices +{ + /// + /// ID_HollandMapExplainServices + /// + public interface ID_HollandMapExplainServices :IBaseServices + { + } +} \ No newline at end of file diff --git a/New_College.IServices/IHoldGroupMapOccupServices.cs b/New_College.IServices/IHoldGroupMapOccupServices.cs new file mode 100644 index 0000000..6d4bfd7 --- /dev/null +++ b/New_College.IServices/IHoldGroupMapOccupServices.cs @@ -0,0 +1,12 @@ +using New_College.IServices.BASE; +using New_College.Model.Models; + +namespace New_College.IServices +{ + /// + /// IHoldGroupMapOccupServices + /// + public interface IHoldGroupMapOccupServices :IBaseServices + { + } +} \ No newline at end of file diff --git a/New_College.Model/Models/D_HollandMapExplain.cs b/New_College.Model/Models/D_HollandMapExplain.cs new file mode 100644 index 0000000..60dff32 --- /dev/null +++ b/New_College.Model/Models/D_HollandMapExplain.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace New_College.Model.Models +{ + public class D_HollandMapExplain : EntityModel + { + /// + /// 标签 + /// + public string Tag { get; set; } + + /// + /// 描述 + /// + public string Description { get; set; } + + /// + /// 基本属性特征 + /// + public string BaseProperty { get; set; } + + /// + /// 职业特征 + /// + public string OccupationProperty { get; set; } + + /// + ///典型职业 + /// + public string Occupation { get; set; } + + + + } +} diff --git a/New_College.Model/Models/D_TagMapPerson.cs b/New_College.Model/Models/D_TagMapPerson.cs index e36c6b7..6f953c9 100644 --- a/New_College.Model/Models/D_TagMapPerson.cs +++ b/New_College.Model/Models/D_TagMapPerson.cs @@ -17,6 +17,10 @@ namespace New_College.Model.Models /// public string NickName { get; set; } + + /// + /// + /// public string Description { get; set; } /// diff --git a/New_College.Model/Models/HoldGroupMapOccup.cs b/New_College.Model/Models/HoldGroupMapOccup.cs new file mode 100644 index 0000000..d539608 --- /dev/null +++ b/New_College.Model/Models/HoldGroupMapOccup.cs @@ -0,0 +1,17 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Text; + +namespace New_College.Model.Models +{ + public class HoldGroupMapOccup : EntityModel + { + [SugarColumn(Length = 20, IsNullable = true, ColumnDataType = "varchar")] + public string Tag { get; set; } + + [SugarColumn(Length = 1500, IsNullable = true, ColumnDataType = "varchar")] + public string Occupation { get; set; } + + } +} diff --git a/New_College.Model/Models/Test_MBTIMapResult.cs b/New_College.Model/Models/Test_MBTIMapResult.cs index ec0a806..9417e5c 100644 --- a/New_College.Model/Models/Test_MBTIMapResult.cs +++ b/New_College.Model/Models/Test_MBTIMapResult.cs @@ -12,6 +12,11 @@ namespace New_College.Model.Models /// public string Tag { get; set; } + /// + /// 人格类型 + /// + public string PersonType { get; set; } + /// /// 适合的领域 /// @@ -43,6 +48,10 @@ namespace New_College.Model.Models [SugarColumn(Length = 1000, IsNullable = true, ColumnDataType = "nvarchar")] public string BlindSpot { get; set; } + + [SugarColumn(Length = 800, IsNullable = true, ColumnDataType = "nvarchar")] + public string Occupation { get; set; } + /// /// 建议 /// diff --git a/New_College.Model/ViewModels/Result/PsychMeasurementListResult.cs b/New_College.Model/ViewModels/Result/PsychMeasurementListResult.cs index fb4d89a..f155fee 100644 --- a/New_College.Model/ViewModels/Result/PsychMeasurementListResult.cs +++ b/New_College.Model/ViewModels/Result/PsychMeasurementListResult.cs @@ -91,7 +91,10 @@ namespace New_College.Model.ViewModels public class EvBillDTO { public string Name { get; set; } - public List BillDatas { get; set; } + public List data { get; set; } + + public List series { get; set; } + public List categories { get; set; } public List Billcators { get; set; } } @@ -152,6 +155,12 @@ namespace New_College.Model.ViewModels public class UserResult { + /// + /// + /// + public string PersonType { get; set; } + + public string Occupation { get; set; } /// /// 标签 /// diff --git a/New_College.Repository/BASE/D_HollandMapExplainRepository.cs b/New_College.Repository/BASE/D_HollandMapExplainRepository.cs new file mode 100644 index 0000000..e081954 --- /dev/null +++ b/New_College.Repository/BASE/D_HollandMapExplainRepository.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_HollandMapExplainRepository + /// + public class D_HollandMapExplainRepository : BaseRepository, ID_HollandMapExplainRepository + { + public D_HollandMapExplainRepository(IUnitOfWork unitOfWork) : base(unitOfWork) + { + } + } +} \ No newline at end of file diff --git a/New_College.Repository/BASE/HoldGroupMapOccupRepository.cs b/New_College.Repository/BASE/HoldGroupMapOccupRepository.cs new file mode 100644 index 0000000..6f5e5c3 --- /dev/null +++ b/New_College.Repository/BASE/HoldGroupMapOccupRepository.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 +{ + /// + /// HoldGroupMapOccupRepository + /// + public class HoldGroupMapOccupRepository : BaseRepository, IHoldGroupMapOccupRepository + { + public HoldGroupMapOccupRepository(IUnitOfWork unitOfWork) : base(unitOfWork) + { + } + } +} \ No newline at end of file diff --git a/New_College.Repository/BASE/ID_HollandMapExplainRepository.cs b/New_College.Repository/BASE/ID_HollandMapExplainRepository.cs new file mode 100644 index 0000000..5fe910a --- /dev/null +++ b/New_College.Repository/BASE/ID_HollandMapExplainRepository.cs @@ -0,0 +1,12 @@ +using New_College.IRepository.Base; +using New_College.Model.Models; + +namespace New_College.IRepository +{ + /// + /// ID_HollandMapExplainRepository + /// + public interface ID_HollandMapExplainRepository : IBaseRepository + { + } +} \ No newline at end of file diff --git a/New_College.Repository/BASE/IHoldGroupMapOccupRepository.cs b/New_College.Repository/BASE/IHoldGroupMapOccupRepository.cs new file mode 100644 index 0000000..71001cc --- /dev/null +++ b/New_College.Repository/BASE/IHoldGroupMapOccupRepository.cs @@ -0,0 +1,12 @@ +using New_College.IRepository.Base; +using New_College.Model.Models; + +namespace New_College.IRepository +{ + /// + /// IHoldGroupMapOccupRepository + /// + public interface IHoldGroupMapOccupRepository : IBaseRepository + { + } +} \ No newline at end of file diff --git a/New_College.Services/D_HollandMapExplainServices.cs b/New_College.Services/D_HollandMapExplainServices.cs new file mode 100644 index 0000000..f991278 --- /dev/null +++ b/New_College.Services/D_HollandMapExplainServices.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_HollandMapExplainServices : BaseServices, ID_HollandMapExplainServices + { + private readonly IBaseRepository _dal; + public D_HollandMapExplainServices(IBaseRepository dal) + { + this._dal = dal; + base.BaseDal = dal; + } + } +} \ No newline at end of file diff --git a/New_College.Services/HoldGroupMapOccupServices.cs b/New_College.Services/HoldGroupMapOccupServices.cs new file mode 100644 index 0000000..58a9f12 --- /dev/null +++ b/New_College.Services/HoldGroupMapOccupServices.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 HoldGroupMapOccupServices : BaseServices, IHoldGroupMapOccupServices + { + private readonly IBaseRepository _dal; + public HoldGroupMapOccupServices(IBaseRepository dal) + { + this._dal = dal; + base.BaseDal = dal; + } + } +} \ No newline at end of file diff --git a/New_College.Services/Test_PsychMeasurementInfoServices.cs b/New_College.Services/Test_PsychMeasurementInfoServices.cs index e12c121..1cb0ae5 100644 --- a/New_College.Services/Test_PsychMeasurementInfoServices.cs +++ b/New_College.Services/Test_PsychMeasurementInfoServices.cs @@ -480,7 +480,7 @@ namespace New_College.Services /// public async Task GetMBTIResult(ResultLookQuery query) { - var info = await _dal.Query(x => x.CategoryId == query.CategoryId && x.StudentId == query.StudentId && x.CycleTimeId == query.CycleTimeId); + var info = await _dal.Query(x => x.CategoryId == query.CategoryId && x.StudentId == query.StudentId); if (info.Count() <= 0 || string.IsNullOrEmpty(info?.FirstOrDefault()?.Result)) return new UserResult() { }; var mbtiresult = (await test_MBTIMapResultRepository.Query(x => x.Tag == info.FirstOrDefault().Result))?.FirstOrDefault(); @@ -488,6 +488,8 @@ namespace New_College.Services return new UserResult() { }; return new UserResult() { + Occupation=mbtiresult.Occupation, + PersonType = mbtiresult.PersonType, Advantage = mbtiresult.Advantage, BlindSpot = mbtiresult.BlindSpot, Disadvantage = mbtiresult.Disadvantage, @@ -801,15 +803,16 @@ namespace New_College.Services newlist.Add(new IntellectJson() { name = "地理", value = 0 }); EvBillDTO subjectinterest = new EvBillDTO() { }; - var chartsinterestvalue = new List(); + var chartsinterestvalue = new List(); var evbillinterest = new List(); EvBillDTO subjectability = new EvBillDTO() { }; - var chartsabilitvalue = new List(); + var chartsabilitvalue = new List(); var evbillabilit = new List(); var result = JsonConvert.DeserializeObject>(info.Result); var xqinfo = result.Where(w => w.name == "学科兴趣"); + var categoryNames = new List(); if (xqinfo.Any()) { var xq = xqinfo.FirstOrDefault().value; @@ -842,8 +845,22 @@ namespace New_College.Services newlist.Where(x => x.name == "地理").FirstOrDefault().value += item.value; break; } + + } - subjectinterest.BillDatas = chartsinterestvalue; + subjectinterest.data = chartsinterestvalue; + subjectinterest.series = new List() { new serie() + { + data = chartsinterestvalue, + name = "学科兴趣%" + } + }; + subjectinterest.categories = new List() {"物理", + "化学", + "生物", + "政治", + "历史", + "地理" }; var subjectinterestnewsort = xq.OrderByDescending(x => x.value); subjectinterest.Name = string.Join("|", subjectinterestnewsort.Take(3).Select(x => x.name).ToList()); @@ -888,10 +905,10 @@ namespace New_College.Services newlist.Where(x => x.name == "地理").FirstOrDefault().value += item.value; break; } - subjectability.BillDatas = chartsabilitvalue; + subjectability.data = chartsabilitvalue; var subjectabilitynewsort = nl.OrderByDescending(x => x.value); - subjectability.Name = string.Join("|", subjectabilitynewsort.Take(3).Select(x => x.name).ToList()); + subjectability.Name = string.Join("+", subjectabilitynewsort.Take(3).Select(x => x.name).ToList()); } } @@ -904,7 +921,7 @@ namespace New_College.Services evbillabilit.Add(new EvBillcator() { max = 32, text = "地理" }); var namelist = newlist.OrderByDescending(x => x.value).Take(3).Select(x => x.name).ToList(); - var Name = string.Join("|", namelist); + var Name = string.Join("+", namelist); return new MessageModel() { success = true, @@ -1247,7 +1264,7 @@ namespace New_College.Services var categoryids = new List(); categoryids.Add(18); categoryids.Add(19); - categoryids.Add(21); + categoryids.Add(20); var querys = await _dal.Query(e => e.StudentId == request.CustomerId && categoryids.Contains(e.CategoryId)); lists.Add(new EvaluationResponse() @@ -1260,7 +1277,7 @@ namespace New_College.Services }); lists.Add(new EvaluationResponse() { - Title = "DISC" + Title = "学科兴趣" }); try { @@ -1270,24 +1287,34 @@ namespace New_College.Services { case "Holland": var holland = querys.Where(e => e.CategoryId == 18).FirstOrDefault(); - a.Message = JsonConvert.DeserializeObject(holland.Result).TagName; - a.PId = holland.Id; - a.Status = 1; + if (holland != null) + { + a.Message = JsonConvert.DeserializeObject(holland.Result).TagName; + a.PId = holland.Id; + a.Status = 1; + } break; case "MBTI": var mbti = querys.Where(e => e.CategoryId == 19).FirstOrDefault(); - a.Message = mbti.Result; - a.PId = mbti.Id; - a.Status = 1; + if (mbti != null) + { + a.Message = mbti.Result; + a.PId = mbti.Id; + a.Status = 1; + } break; - case "DISC": + case "学科兴趣": var disc = querys.Where(e => e.CategoryId == 20); if (disc.Any()) { a.PId = disc.FirstOrDefault().Id; + var result = JsonConvert.DeserializeObject>(disc.FirstOrDefault().Result); + var xqinfo = result.Where(w => w.name == "学科兴趣"); + var subjectinterestnewsort = xqinfo.FirstOrDefault().value.OrderByDescending(x => x.value); + a.Message = string.Join("|", subjectinterestnewsort.Take(3).Select(x => x.name).ToList()); + a.Status = 1; } - a.Message = "有魅力的、自信的、有说服力的、热情的、鼓舞人心的、乐观的、令人信服的、受欢迎的、好交际的、可信赖的"; - a.Status = 1; + break; } });