feat:bug fixed
parent
b6a6769c33
commit
4e8e6aa76f
|
|
@ -193,6 +193,27 @@ namespace New_College.Api.Controllers.Front
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取霍兰德测评结果解析
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="query"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
[Authorize]
|
||||||
|
public async Task<MessageModel<HollandOccupDetail>> GetHollandOccupDetail([FromQuery] ResultLookQuery query)
|
||||||
|
{
|
||||||
|
var result = await test_PsychMeasurementInfoServices.GetHollandOccupDetail(query);
|
||||||
|
return new MessageModel<HollandOccupDetail>()
|
||||||
|
{
|
||||||
|
success = true,
|
||||||
|
msg = "获取成功",
|
||||||
|
response = result
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取MBTI测评结果
|
/// 获取MBTI测评结果
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -5000,6 +5000,41 @@
|
||||||
|
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:New_College.Model.ViewModels.HollandOccupDetail.TagOccupations">
|
||||||
|
<summary>
|
||||||
|
标签关联职业
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:New_College.Model.ViewModels.HollandOccupDetail.tagMapPeople">
|
||||||
|
<summary>
|
||||||
|
标签关联人物
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:New_College.Model.ViewModels.HollandOccupDetail.tagMapExplain">
|
||||||
|
<summary>
|
||||||
|
标签解析
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:New_College.Model.ViewModels.HollandTagMapExplain.Description">
|
||||||
|
<summary>
|
||||||
|
标签描述
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:New_College.Model.ViewModels.HollandTagMapExplain.BaseProperty">
|
||||||
|
<summary>
|
||||||
|
标签基本特征
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:New_College.Model.ViewModels.HollandTagMapExplain.OccupationProperty">
|
||||||
|
<summary>
|
||||||
|
职业特征
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:New_College.Model.ViewModels.HollandTagMapExplain.Occupation">
|
||||||
|
<summary>
|
||||||
|
标签关联职业
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="T:New_College.Model.ViewModels.UserResult">
|
<member name="T:New_College.Model.ViewModels.UserResult">
|
||||||
<summary>
|
<summary>
|
||||||
测评结果
|
测评结果
|
||||||
|
|
|
||||||
|
|
@ -494,6 +494,13 @@
|
||||||
<param name="query"></param>
|
<param name="query"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:New_College.Api.Controllers.Front.TestController.GetHollandOccupDetail(New_College.Model.ViewModels.ResultLookQuery)">
|
||||||
|
<summary>
|
||||||
|
获取霍兰德测评结果解析
|
||||||
|
</summary>
|
||||||
|
<param name="query"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="M:New_College.Api.Controllers.Front.TestController.GetMBTIResult(New_College.Model.ViewModels.ResultLookQuery)">
|
<member name="M:New_College.Api.Controllers.Front.TestController.GetMBTIResult(New_College.Model.ViewModels.ResultLookQuery)">
|
||||||
<summary>
|
<summary>
|
||||||
获取MBTI测评结果
|
获取MBTI测评结果
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ namespace New_College.IServices
|
||||||
|
|
||||||
Task<bool> SaveHolland(SaveHollandQuery query);
|
Task<bool> SaveHolland(SaveHollandQuery query);
|
||||||
|
|
||||||
|
Task<HollandOccupDetail> GetHollandOccupDetail(ResultLookQuery query);
|
||||||
Task<TagtestingHollandResult> GetHollandResult(ResultLookQuery query);
|
Task<TagtestingHollandResult> GetHollandResult(ResultLookQuery query);
|
||||||
|
|
||||||
Task<UserResult> GetMBTIResult(ResultLookQuery query);
|
Task<UserResult> GetMBTIResult(ResultLookQuery query);
|
||||||
|
|
|
||||||
|
|
@ -133,9 +133,68 @@ namespace New_College.Model.ViewModels
|
||||||
public Radar radar { get; set; }
|
public Radar radar { get; set; }
|
||||||
|
|
||||||
public string TagName { get; set; }
|
public string TagName { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class HollandOccupDetail
|
||||||
|
{
|
||||||
|
public TagtestingHollandResult tagtestingHolland { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 标签关联职业
|
||||||
|
/// </summary>
|
||||||
|
public List<string> TagOccupations { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 标签关联人物
|
||||||
|
/// </summary>
|
||||||
|
public List<HollandTagMapPerson> tagMapPeople { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 标签解析
|
||||||
|
/// </summary>
|
||||||
|
public HollandTagMapExplain tagMapExplain { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class HollandTagMapExplain
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 标签描述
|
||||||
|
/// </summary>
|
||||||
|
public string Description { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 标签基本特征
|
||||||
|
/// </summary>
|
||||||
|
public string BaseProperty { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 职业特征
|
||||||
|
/// </summary>
|
||||||
|
public List<string> OccupationProperty { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 标签关联职业
|
||||||
|
/// </summary>
|
||||||
|
public string Occupation { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class HollandTagMapPerson
|
||||||
|
{
|
||||||
|
public string NickName { get; set; }
|
||||||
|
|
||||||
|
public string AvatarUrl { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class Radar
|
public class Radar
|
||||||
{
|
{
|
||||||
public List<string> categories { get; set; }
|
public List<string> categories { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ using New_College.Model;
|
||||||
using New_College.Model.ViewModels.Result;
|
using New_College.Model.ViewModels.Result;
|
||||||
using New_College.Model.ViewModels.Query;
|
using New_College.Model.ViewModels.Query;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
using SqlSugar;
|
||||||
|
|
||||||
namespace New_College.Services
|
namespace New_College.Services
|
||||||
{
|
{
|
||||||
|
|
@ -30,6 +31,9 @@ namespace New_College.Services
|
||||||
private readonly IT_PlanMapTagRepository t_PlanMapTagRepository;
|
private readonly IT_PlanMapTagRepository t_PlanMapTagRepository;
|
||||||
private readonly IT_EnrollmentPlaneRepository t_EnrollmentPlaneRepository;
|
private readonly IT_EnrollmentPlaneRepository t_EnrollmentPlaneRepository;
|
||||||
private readonly IT_EnrollmentPlanedescRepository t_EnrollmentPlanedescRepository;
|
private readonly IT_EnrollmentPlanedescRepository t_EnrollmentPlanedescRepository;
|
||||||
|
private readonly ID_TagMapPersonRepository _TagMapPersonRepository;
|
||||||
|
private readonly ID_HollandMapExplainRepository _HollandMapExplainRepository;
|
||||||
|
private IHoldGroupMapOccupRepository _groupMapOccupRepository;
|
||||||
|
|
||||||
private readonly ILogger<Test_PsychMeasurementInfoServices> _loggerHelper;
|
private readonly ILogger<Test_PsychMeasurementInfoServices> _loggerHelper;
|
||||||
public Test_PsychMeasurementInfoServices(IBaseRepository<Test_PsychMeasurementInfo> dal
|
public Test_PsychMeasurementInfoServices(IBaseRepository<Test_PsychMeasurementInfo> dal
|
||||||
|
|
@ -39,7 +43,11 @@ namespace New_College.Services
|
||||||
, IV_SubjectSelectRepository IV_SubjectSelectRepository
|
, IV_SubjectSelectRepository IV_SubjectSelectRepository
|
||||||
, IT_PlanMapTagRepository IT_PlanMapTagRepository
|
, IT_PlanMapTagRepository IT_PlanMapTagRepository
|
||||||
, IT_EnrollmentPlaneRepository IT_EnrollmentPlaneRepository
|
, IT_EnrollmentPlaneRepository IT_EnrollmentPlaneRepository
|
||||||
, IT_EnrollmentPlanedescRepository IT_EnrollmentPlanedescRepository, ILogger<Test_PsychMeasurementInfoServices> loggerHelper)
|
, IT_EnrollmentPlanedescRepository IT_EnrollmentPlanedescRepository,
|
||||||
|
ILogger<Test_PsychMeasurementInfoServices> loggerHelper,
|
||||||
|
ID_TagMapPersonRepository tagMapPersonRepository,
|
||||||
|
ID_HollandMapExplainRepository hollandMapExplainRepository,
|
||||||
|
IHoldGroupMapOccupRepository groupMapOccupRepository)
|
||||||
{
|
{
|
||||||
this._dal = dal;
|
this._dal = dal;
|
||||||
_QuestionTypeInfoRepository = ITest_QuestionTypeInfoRepository;
|
_QuestionTypeInfoRepository = ITest_QuestionTypeInfoRepository;
|
||||||
|
|
@ -51,6 +59,9 @@ namespace New_College.Services
|
||||||
t_EnrollmentPlanedescRepository = IT_EnrollmentPlanedescRepository;
|
t_EnrollmentPlanedescRepository = IT_EnrollmentPlanedescRepository;
|
||||||
base.BaseDal = dal;
|
base.BaseDal = dal;
|
||||||
this._loggerHelper = loggerHelper;
|
this._loggerHelper = loggerHelper;
|
||||||
|
_TagMapPersonRepository = tagMapPersonRepository;
|
||||||
|
_HollandMapExplainRepository = hollandMapExplainRepository;
|
||||||
|
_groupMapOccupRepository = groupMapOccupRepository;
|
||||||
}
|
}
|
||||||
public List<string> permut = new List<string>();
|
public List<string> permut = new List<string>();
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -452,6 +463,60 @@ namespace New_College.Services
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="query"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<HollandOccupDetail> GetHollandOccupDetail(ResultLookQuery query)
|
||||||
|
{
|
||||||
|
var response = new HollandOccupDetail();
|
||||||
|
Test_PsychMeasurementInfo info = new Test_PsychMeasurementInfo() { };
|
||||||
|
if (query.CycleTimeId > 0)
|
||||||
|
{
|
||||||
|
info = (await _dal.Query(x => x.CategoryId == query.CategoryId && x.StudentId == query.StudentId && x.CycleTimeId == query.CycleTimeId)).FirstOrDefault();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
info = (await _dal.Query(x => x.CategoryId == query.CategoryId && x.StudentId == query.StudentId)).OrderByDescending(x => x.CreateTime).FirstOrDefault();
|
||||||
|
}
|
||||||
|
if (info == null || string.IsNullOrEmpty(info.Result))
|
||||||
|
return new HollandOccupDetail() { };
|
||||||
|
var taginfo = JsonConvert.DeserializeObject<TagtestingHollandResult>(info.Result);
|
||||||
|
response.tagtestingHolland = taginfo;
|
||||||
|
var tagmappersons = await _TagMapPersonRepository.Query(c => SqlFunc.Contains(taginfo.TagName, c.Tag));
|
||||||
|
response.tagMapPeople = tagmappersons.Select(c => new HollandTagMapPerson() { AvatarUrl = c.AvatarUrl, NickName = c.NickName }).ToList();
|
||||||
|
var tagmapexplain = await _HollandMapExplainRepository.Query(c => SqlFunc.Contains(taginfo.TagName, c.Tag));
|
||||||
|
var baseprop = string.Empty;
|
||||||
|
var occupationprop = string.Empty;
|
||||||
|
var description = string.Empty;
|
||||||
|
var occupation = string.Empty;
|
||||||
|
tagmapexplain.ForEach(a =>
|
||||||
|
{
|
||||||
|
baseprop += a.BaseProperty;
|
||||||
|
|
||||||
|
occupationprop += a.OccupationProperty;
|
||||||
|
|
||||||
|
description += a.Description;
|
||||||
|
occupation += a.Occupation;
|
||||||
|
|
||||||
|
});
|
||||||
|
response.tagMapExplain = new HollandTagMapExplain()
|
||||||
|
{
|
||||||
|
BaseProperty = baseprop,
|
||||||
|
Description = description,
|
||||||
|
OccupationProperty = occupationprop.Replace(" ","").Replace("1","").Replace("2", "").Replace("3", "").Replace("4", "").Replace("5", "").Split('.', StringSplitOptions.RemoveEmptyEntries).ToList(),
|
||||||
|
Occupation = occupation
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取霍兰德测评结果
|
/// 获取霍兰德测评结果
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -488,7 +553,7 @@ namespace New_College.Services
|
||||||
return new UserResult() { };
|
return new UserResult() { };
|
||||||
return new UserResult()
|
return new UserResult()
|
||||||
{
|
{
|
||||||
Occupation=mbtiresult.Occupation,
|
Occupation = mbtiresult.Occupation,
|
||||||
PersonType = mbtiresult.PersonType,
|
PersonType = mbtiresult.PersonType,
|
||||||
Advantage = mbtiresult.Advantage,
|
Advantage = mbtiresult.Advantage,
|
||||||
BlindSpot = mbtiresult.BlindSpot,
|
BlindSpot = mbtiresult.BlindSpot,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue