From 582d5981172b9637da99ea4f5e5cbaf7de1351c8 Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Tue, 14 May 2024 11:01:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Tiobon.Core.Api/Tiobon.Core.Model.xml | 10 +++++++ .../View/Ghre/Ghre_Attachment.Dto.View.cs | 18 ++++++++---- .../Extend/DefaultGhre_ExamPaperInput.cs | 15 +++++++--- .../Ghre/Ghre_ExamPaperServices.cs | 29 ++++++++++++++----- Tiobon.Core/Tiobon.Core.Model.xml | 10 +++++++ 5 files changed, 66 insertions(+), 16 deletions(-) diff --git a/Tiobon.Core.Api/Tiobon.Core.Model.xml b/Tiobon.Core.Api/Tiobon.Core.Model.xml index a24f77d5..3147299e 100644 --- a/Tiobon.Core.Api/Tiobon.Core.Model.xml +++ b/Tiobon.Core.Api/Tiobon.Core.Model.xml @@ -4942,6 +4942,16 @@ + + + 修改信息 黄一名 于 2024-05-10 15:02 最后修改 + + + + + 创建信息 黄一名 于 2024-05-10 14:57 创建 + + 试卷ID diff --git a/Tiobon.Core.Model/View/Ghre/Ghre_Attachment.Dto.View.cs b/Tiobon.Core.Model/View/Ghre/Ghre_Attachment.Dto.View.cs index 055f65aa..4e8803fe 100644 --- a/Tiobon.Core.Model/View/Ghre/Ghre_Attachment.Dto.View.cs +++ b/Tiobon.Core.Model/View/Ghre/Ghre_Attachment.Dto.View.cs @@ -15,13 +15,21 @@ *└──────────────────────────────────┘ */ -namespace Tiobon.Core.Model.Models +namespace Tiobon.Core.Model.Models; + + +/// +/// 附件(Dto.View) +/// +public class Ghre_AttachmentDto : Ghre_Attachment { + /// + /// 创建信息 + /// + public string CreateDataInfo { get; set; } /// - /// 附件(Dto.View) + /// 修改信息 /// - public class Ghre_AttachmentDto : Ghre_Attachment - { - } + public string UpdateDataInfo { get; set; } } diff --git a/Tiobon.Core.Model/ViewModels/Extend/DefaultGhre_ExamPaperInput.cs b/Tiobon.Core.Model/ViewModels/Extend/DefaultGhre_ExamPaperInput.cs index 00290179..fc40cb22 100644 --- a/Tiobon.Core.Model/ViewModels/Extend/DefaultGhre_ExamPaperInput.cs +++ b/Tiobon.Core.Model/ViewModels/Extend/DefaultGhre_ExamPaperInput.cs @@ -1,7 +1,4 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel; -using System.Dynamic; -using Tiobon.Core.Model.Models; +using Tiobon.Core.Model.Models; namespace Tiobon.Core.Model; @@ -11,6 +8,16 @@ public class DefaultGhre_ExamPaperInput public List randomSetColumns { get; set; } = new List(); public List manualSetColumns { get; set; } = new List(); public DefaultGhre_ExamPaperPageData pageData { get; set; } = new DefaultGhre_ExamPaperPageData(); + + /// + /// 修改信息 黄一名 于 2024-05-10 15:02 最后修改 + /// + public string UpdateDataInfo { get; set; } + + /// + /// 创建信息 黄一名 于 2024-05-10 14:57 创建 + /// + public string CreateDataInfo { get; set; } } public class DefaultGhre_ExamPaperColumn { diff --git a/Tiobon.Core.Services/Ghre/Ghre_ExamPaperServices.cs b/Tiobon.Core.Services/Ghre/Ghre_ExamPaperServices.cs index 414be127..0b1d056b 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_ExamPaperServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_ExamPaperServices.cs @@ -1,10 +1,8 @@  using System.Data; -using System.Dynamic; using AgileObjects.AgileMapper; +using MongoDB.Driver.Linq; using SqlSugar; -using Tiobon.Core.Common; -using Tiobon.Core.Common.DB.Dapper.Extensions; using Tiobon.Core.IRepository.Base; using Tiobon.Core.IServices; using Tiobon.Core.Model; @@ -21,6 +19,7 @@ namespace Tiobon.Core.Services private IGhre_ExamPaperConfigServices _ghre_ExamPaperConfigServices; private IGhre_ExamPaperQuestionServices _ghre_ExamPaperQuestionServices; private IGhre_QuestionServices _ghre_QuestionServices; + readonly IGhrs_UserServices _ghrs_UserServices; private IGhre_QuestionAnswerServices _ghre_QuestionAnswerServices; private readonly IBaseRepository _dal; @@ -28,7 +27,8 @@ namespace Tiobon.Core.Services IGhre_ExamPaperConfigServices ghre_ExamPaperConfigServices, IGhre_QuestionServices ghre_QuestionServices, IGhre_QuestionAnswerServices ghre_QuestionAnswerServices, - IGhre_ExamPaperQuestionServices ghre_ExamPaperQuestionServices) + IGhre_ExamPaperQuestionServices ghre_ExamPaperQuestionServices, + IGhrs_UserServices ghrs_UserServices) { this._dal = dal; base.BaseDal = dal; @@ -36,6 +36,8 @@ namespace Tiobon.Core.Services _ghre_ExamPaperQuestionServices = ghre_ExamPaperQuestionServices; _ghre_QuestionServices = ghre_QuestionServices; _ghre_QuestionAnswerServices = ghre_QuestionAnswerServices; + _ghrs_UserServices = ghrs_UserServices; + } public async Task> QueryDefault(long Id) @@ -302,6 +304,19 @@ namespace Tiobon.Core.Services baseData.CourseSceneId = exampaper.LinkId; input.pageData.baseData = baseData; + #region 系统信息 + var userIds = new List(); + if (exampaper.CreateBy != null) + userIds.Add(Convert.ToInt32(exampaper.CreateBy.Value)); + if (exampaper.UpdateBy != null) + userIds.Add(Convert.ToInt32(exampaper.UpdateBy.Value)); + var users = await _ghrs_UserServices.Query(x => userIds.Contains(x.UserId)); + if (exampaper.CreateBy != null) + input.CreateDataInfo = $"创建信息 {users.FirstOrDefault(x => x.UserId == exampaper.CreateBy)?.UserName} 于 {(exampaper.CreateTime != null ? exampaper.CreateTime.Value.ToString(@"yyyy\/MM\/dd HH:mm") : null)} 创建"; + if (exampaper.UpdateBy != null) + input.CreateDataInfo = $"修改信息 {users.FirstOrDefault(x => x.UserId == exampaper.UpdateBy)?.UserName} 于 {(exampaper.UpdateTime != null ? exampaper.UpdateTime.Value.ToString(@"yyyy\/MM\/dd HH:mm") : null)} 最后修改"; + #endregion + input.pageData.styleInfo.coverImage = exampaper.CoverUrl; input.pageData.styleInfo.paperStyle = exampaper.Style; @@ -326,8 +341,8 @@ namespace Tiobon.Core.Services previews.ForEach(x => { var answers1 = answers.Where(y => y.QuestionId == x.QuestionId).ToList(); - x.QuestionType = questions1.FirstOrDefault(a=>a.Id==x.QuestionId)?.QuestionType; - x.QuestionContent = questions1.FirstOrDefault(a=>a.Id==x.QuestionId)?.QuestionContent; + x.QuestionType = questions1.FirstOrDefault(a => a.Id == x.QuestionId)?.QuestionType; + x.QuestionContent = questions1.FirstOrDefault(a => a.Id == x.QuestionId)?.QuestionContent; //var detail = questions1.Select(o => //new FromGhre_QuestionQuestionTypeDetail() @@ -392,7 +407,7 @@ namespace Tiobon.Core.Services sql += $" AND QuestionType='{insert.QuestionType}'"; if (insert.CourseId != null) sql += $" AND CourseId='{insert.CourseId}'"; - if (insert.CourseId != null) + if (insert.QuestionId != null) sql += $" AND Id='{insert.QuestionId}'"; sql += $" ORDER BY GuidValue ASC"; var questions = await Db.Ado.SqlQueryAsync(sql); diff --git a/Tiobon.Core/Tiobon.Core.Model.xml b/Tiobon.Core/Tiobon.Core.Model.xml index a24f77d5..3147299e 100644 --- a/Tiobon.Core/Tiobon.Core.Model.xml +++ b/Tiobon.Core/Tiobon.Core.Model.xml @@ -4942,6 +4942,16 @@ + + + 修改信息 黄一名 于 2024-05-10 15:02 最后修改 + + + + + 创建信息 黄一名 于 2024-05-10 14:57 创建 + + 试卷ID