master
xiaochanghai 5 months ago
parent 001f8b6b2f
commit c1e41adc67
  1. 1
      Tiobon.Core.Model/Insert/Ghre/Ghre_CourseWare.Dto.InsertInput.cs
  2. 2
      Tiobon.Core.Services/CommonServices.cs
  3. 9
      Tiobon.Core.Services/Ghre/Ghre_CourseWareServices.cs
  4. 4
      Tiobon.Core.Services/Ghre/Ghre_QuestionServices.cs
  5. 7
      Tiobon.Core.Services/Ghre/Ghre_StudyRecordServices.cs

@ -32,6 +32,7 @@ public class InsertGhre_CourseWareInput : Ghre_CourseWareBase
}
public class Ghre_CourseWareLink
{
public long Id { get; set; }
public string LinkName { get; set; }
public string LinkAddress { get; set; }
}

@ -1059,7 +1059,7 @@ public partial class CommonServices : BaseServices<RootEntityTkey<int>>, ICommon
fnKey = "TBD4YN",
fnTitle = "课程顺序",
fnType = "row",
icon = "ghr-publish",
icon = "ghr-drag",
position = "left"
});
break;

@ -74,13 +74,19 @@ public class Ghre_CourseWareServices : BaseServices<Ghre_CourseWare, Ghre_Course
}
await _ghre_CourseWareAttachmentServices.Delete(x => x.CourseWareId == Id);
if (editModel.Source == "Attachments")
{
editModel.Attachments.ForEach(x =>
{
x.CourseWareId = Id;
x.RelativePath = x.RelativePath.Replace("/Advanced", null);
});
await _ghre_CourseWareAttachmentServices.Add(editModel.Attachments);
}
else
{
if (editModel.Links != null && editModel.Links.Any())
{
var attachments = editModel.Links.Select(x => new InsertGhre_CourseWareAttachmentInput()
@ -92,6 +98,7 @@ public class Ghre_CourseWareServices : BaseServices<Ghre_CourseWare, Ghre_Course
}).ToList();
await _ghre_CourseWareAttachmentServices.Add(attachments);
}
}
return await base.Update(Id, editModel);
}

@ -1,4 +1,5 @@
using NPOI.HSSF.UserModel;
using Microsoft.IdentityModel.Tokens;
using NPOI.HSSF.UserModel;
using NPOI.SS.UserModel;
using NPOI.SS.Util;
using NPOI.XSSF.UserModel;
@ -1010,7 +1011,6 @@ public class Ghre_QuestionServices : BaseServices<Ghre_Question, Ghre_QuestionDt
else if (questionType == "Completion")
{
questionContent = questionContent.Replace("()", "()");
var completionCount = 0;
for (int ii = 1; ii < 11; ii++)
{

@ -1238,9 +1238,12 @@ WHERE A.Id = '{id}'";
if (course.CourseWareList[j].Attachments != null && course.CourseWareList[j].Attachments.Any())
course.CourseWareList[j].Attachments.ForEach(x => x.RelativePath = "/Advanced" + x.RelativePath);
course.CourseWareList[j].Links = attachments.Where(x => x.AttachFileExtension == "http")
course.CourseWareList[j].Links = attachments
.Where(x => x.AttachFileExtension == "http")
.OrderBy(x => x.SortNo)
.Select(x => new Ghre_CourseWareLink()
{
Id = x.Id,
LinkName = x.AttachmentName,
LinkAddress = x.RelativePath,
}).ToList();
@ -1251,7 +1254,7 @@ WHERE A.Id = '{id}'";
if (course.CourseStandardDuration.IsNull())
{
sql = $@"SELECT ISNULL (A.Hours, 0) * 60 + A.Minutes Minutes
sql = $@"SELECT SUM (ISNULL (A.Hours, 0) * 60 + A.Minutes) Minutes
FROM Ghre_CourseWare A
WHERE A.Id IN
(SELECT CourseWareId

Loading…
Cancel
Save