From 9594d51a7f11c3c17d040760cc1a28d87124a2b5 Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Mon, 12 May 2025 14:33:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=97=AE=E5=8D=B7=E9=A2=98?= =?UTF-8?q?=E7=9B=AE=E6=B1=A0=E6=96=B0=E5=A2=9E=E7=BC=96=E8=BE=91=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Tiobon.Core.Api/Tiobon.Core.Model.xml | 5 +++ .../Extend/InsertGhre_SurveyExtend.cs | 5 +++ .../Ghre/Ghre_SurveyQuestionPoolServices.cs | 33 ++++++++++++++++--- Tiobon.Core/Tiobon.Core.Model.xml | 5 +++ 4 files changed, 43 insertions(+), 5 deletions(-) diff --git a/Tiobon.Core.Api/Tiobon.Core.Model.xml b/Tiobon.Core.Api/Tiobon.Core.Model.xml index b6c6d411..dee3b3f2 100644 --- a/Tiobon.Core.Api/Tiobon.Core.Model.xml +++ b/Tiobon.Core.Api/Tiobon.Core.Model.xml @@ -41208,6 +41208,11 @@ 备注 + + + 内置 + + 问卷调查题目 diff --git a/Tiobon.Core.Model/ViewModels/Extend/InsertGhre_SurveyExtend.cs b/Tiobon.Core.Model/ViewModels/Extend/InsertGhre_SurveyExtend.cs index 2b2c24ad..b76c14ea 100644 --- a/Tiobon.Core.Model/ViewModels/Extend/InsertGhre_SurveyExtend.cs +++ b/Tiobon.Core.Model/ViewModels/Extend/InsertGhre_SurveyExtend.cs @@ -189,6 +189,11 @@ public class Ghre_SurveyQuestionExtendBase /// [Display(Name = "RemarkSz"), Description("备注"), MaxLength(2000, ErrorMessage = "备注 不能超过 2000 个字符")] public string RemarkSz { get; set; } + + /// + /// 内置 + /// + public int? BuiltIn { get; set; } } public class InsertGhre_SurveyExtend : Ghre_SurveyExtendBase diff --git a/Tiobon.Core.Services/Ghre/Ghre_SurveyQuestionPoolServices.cs b/Tiobon.Core.Services/Ghre/Ghre_SurveyQuestionPoolServices.cs index 321354b9..b67a82d8 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_SurveyQuestionPoolServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_SurveyQuestionPoolServices.cs @@ -1,4 +1,8 @@ -namespace Tiobon.Core.Services; +using Mysqlx.Crud; +using System.Net; +using Tiobon.Core.IServices; + +namespace Tiobon.Core.Services; /// /// 问卷题库 (服务) @@ -201,7 +205,25 @@ public class Ghre_SurveyQuestionPoolServices : BaseServices x.isActive = 0); + var questionType = data.PageData.questionType.Where(x => x.QuestionType == question.QuestionType).FirstOrDefault(); + if (questionType != null) + { + var answers = await _ghre_SurveyQuestionPoolOptionServicesServices.Query(x => x.SurveyQuestionPoolId == Id, "TaxisNo ASC"); + questionType.isActive = 1; + questionType.QuestionContent = question.QuestionContent; + questionType.BuiltIn = question.BuiltIn; + questionType.QuestionAnalysis = question.QuestionAnalysis; + + questionType.Options = answers.Select(x => new InsertGhre_SurveyOptionExtend() + { + OptionNo = x.OptionNo, + OptionContent = x.OptionContent, + ImageUrl = x.ImageUrl, + ImageWidthPc = x.ImageWidthPc, + ImageWidthApp = x.ImageWidthApp, + Score = x.Score, + }).ToList(); + } data.PageData.baseData.CreateDataInfo = question.CreateDataInfo; data.PageData.baseData.UpdateDataInfo = question.UpdateDataInfo; @@ -236,6 +258,7 @@ public class Ghre_SurveyQuestionPoolServices : BaseServices new InsertGhre_SurveyQuestionPoolOptionInput() { OptionNo = x.OptionNo, OptionContent = x.OptionContent, + Score = x.Score, ImageUrl = x.ImageUrl, ImageWidthPc = x.ImageWidthPc, ImageWidthApp = x.ImageWidthApp, diff --git a/Tiobon.Core/Tiobon.Core.Model.xml b/Tiobon.Core/Tiobon.Core.Model.xml index b6c6d411..dee3b3f2 100644 --- a/Tiobon.Core/Tiobon.Core.Model.xml +++ b/Tiobon.Core/Tiobon.Core.Model.xml @@ -41208,6 +41208,11 @@ 备注 + + + 内置 + + 问卷调查题目