|
|
|
@ -1,4 +1,8 @@ |
|
|
|
|
namespace Tiobon.Core.Services; |
|
|
|
|
using Mysqlx.Crud; |
|
|
|
|
using System.Net; |
|
|
|
|
using Tiobon.Core.IServices; |
|
|
|
|
|
|
|
|
|
namespace Tiobon.Core.Services; |
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
/// 问卷题库 (服务) |
|
|
|
@ -201,7 +205,25 @@ public class Ghre_SurveyQuestionPoolServices : BaseServices<Ghre_SurveyQuestionP |
|
|
|
|
if (Id != 0) |
|
|
|
|
{ |
|
|
|
|
var question = await base.QueryById(Id); |
|
|
|
|
data.PageData.questionType.ForEach(x => 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<Ghre_SurveyQuestionP |
|
|
|
|
{ |
|
|
|
|
OptionNo = x.OptionNo, |
|
|
|
|
OptionContent = x.OptionContent, |
|
|
|
|
Score = x.Score, |
|
|
|
|
ImageUrl = x.ImageUrl, |
|
|
|
|
ImageWidthPc = x.ImageWidthPc, |
|
|
|
|
ImageWidthApp = x.ImageWidthApp, |
|
|
|
@ -248,7 +271,7 @@ public class Ghre_SurveyQuestionPoolServices : BaseServices<Ghre_SurveyQuestionP |
|
|
|
|
i = i + 100; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await _ghre_SurveyQuestionPoolOptionServicesServices.Add(insertAnswers); |
|
|
|
|
//} |
|
|
|
|
await Db.Ado.CommitTranAsync(); |
|
|
|
@ -295,16 +318,16 @@ public class Ghre_SurveyQuestionPoolServices : BaseServices<Ghre_SurveyQuestionP |
|
|
|
|
insert.BuiltIn = editModel.baseData.BuiltIn; |
|
|
|
|
|
|
|
|
|
insert.QuestionType = questionType.QuestionType; |
|
|
|
|
insert.QuestionNo = await GenerateContinuousSequence(insert.QuestionType.Substring(0, 1)); |
|
|
|
|
insert.QuestionContent = questionType.QuestionContent; |
|
|
|
|
insert.QuestionAnalysis = questionType.QuestionAnalysis; |
|
|
|
|
|
|
|
|
|
await base.Update(Id, insert); |
|
|
|
|
await base.Update(Id, insert); |
|
|
|
|
|
|
|
|
|
var insertAnswers = questionType.Options.Select(x => new InsertGhre_SurveyQuestionPoolOptionInput() |
|
|
|
|
{ |
|
|
|
|
OptionNo = x.OptionNo, |
|
|
|
|
OptionContent = x.OptionContent, |
|
|
|
|
Score = x.Score, |
|
|
|
|
ImageUrl = x.ImageUrl, |
|
|
|
|
ImageWidthPc = x.ImageWidthPc, |
|
|
|
|
ImageWidthApp = x.ImageWidthApp, |
|
|
|
|