|
|
@ -19,7 +19,6 @@ using NPOI.SS.Util; |
|
|
|
using NPOI.XSSF.UserModel; |
|
|
|
using NPOI.XSSF.UserModel; |
|
|
|
using Microsoft.AspNetCore.Http; |
|
|
|
using Microsoft.AspNetCore.Http; |
|
|
|
using System.Data; |
|
|
|
using System.Data; |
|
|
|
using Org.BouncyCastle.Crypto; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace Tiobon.Core.Services; |
|
|
|
namespace Tiobon.Core.Services; |
|
|
|
|
|
|
|
|
|
|
@ -101,6 +100,10 @@ public class Ghre_StudyRecordServices : BaseServices<Ghre_StudyRecord, Ghre_Stud |
|
|
|
|
|
|
|
|
|
|
|
var entitys = await Db.Ado.SqlQueryAsync<Ghre_StudyRecordDto>(sql); |
|
|
|
var entitys = await Db.Ado.SqlQueryAsync<Ghre_StudyRecordDto>(sql); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var courseSceneIds = entitys.Select(x => x.CourseSceneId).Distinct().ToList(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var courses = await Db.Queryable<Ghre_Course>().Where(x => x.CourseSceneId != null && courseSceneIds.Contains(x.CourseSceneId)).ToListAsync(); |
|
|
|
|
|
|
|
|
|
|
|
entitys.ForEach(entity => |
|
|
|
entitys.ForEach(entity => |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (!string.IsNullOrWhiteSpace(entity.Indate)) |
|
|
|
if (!string.IsNullOrWhiteSpace(entity.Indate)) |
|
|
@ -118,6 +121,13 @@ public class Ghre_StudyRecordServices : BaseServices<Ghre_StudyRecord, Ghre_Stud |
|
|
|
if (entity.ExamStatus != "SystemEnd" && entity.ExamStatus.IsNotEmptyOrNull()) |
|
|
|
if (entity.ExamStatus != "SystemEnd" && entity.ExamStatus.IsNotEmptyOrNull()) |
|
|
|
entity.IsViewResult = true; |
|
|
|
entity.IsViewResult = true; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 处理场景对应课程 |
|
|
|
|
|
|
|
if (entity.CourseSceneId.IsNotEmptyOrNull()) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
entity.CourseName = string.Join("\n", courses.Where(x => x.CourseSceneId == entity.CourseSceneId).Select(x => x.CourseName + " (" + x.CourseNo + ")")); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
return new ServicePageResult<Ghre_StudyRecordDto>(filter.pageNum, total, filter.pageSize, entitys); |
|
|
|
return new ServicePageResult<Ghre_StudyRecordDto>(filter.pageNum, total, filter.pageSize, entitys); |
|
|
@ -181,6 +191,10 @@ public class Ghre_StudyRecordServices : BaseServices<Ghre_StudyRecord, Ghre_Stud |
|
|
|
|
|
|
|
|
|
|
|
var entitys = await Db.Ado.SqlQueryAsync<Ghre_StudyRecordDto>(sql); |
|
|
|
var entitys = await Db.Ado.SqlQueryAsync<Ghre_StudyRecordDto>(sql); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var courseSceneIds = entitys.Select(x => x.CourseSceneId).Distinct().ToList(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var courses = await Db.Queryable<Ghre_Course>().Where(x => x.CourseSceneId != null && courseSceneIds.Contains(x.CourseSceneId)).ToListAsync(); |
|
|
|
|
|
|
|
|
|
|
|
entitys.ForEach(entity => |
|
|
|
entitys.ForEach(entity => |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (!string.IsNullOrWhiteSpace(entity.Indate)) |
|
|
|
if (!string.IsNullOrWhiteSpace(entity.Indate)) |
|
|
@ -197,7 +211,12 @@ public class Ghre_StudyRecordServices : BaseServices<Ghre_StudyRecord, Ghre_Stud |
|
|
|
entity.UpdateYN = 1; |
|
|
|
entity.UpdateYN = 1; |
|
|
|
if (entity.ExamStatus != "SystemEnd" && entity.ExamStatus.IsNotEmptyOrNull()) |
|
|
|
if (entity.ExamStatus != "SystemEnd" && entity.ExamStatus.IsNotEmptyOrNull()) |
|
|
|
entity.IsViewResult = true; |
|
|
|
entity.IsViewResult = true; |
|
|
|
|
|
|
|
#region 处理场景对应课程 |
|
|
|
|
|
|
|
if (entity.CourseSceneId.IsNotEmptyOrNull()) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
entity.CourseName = string.Join("\n", courses.Where(x => x.CourseSceneId == entity.CourseSceneId).Select(x => x.CourseName + " (" + x.CourseNo + ")")); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
#endregion |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
return new ServicePageResult<Ghre_StudyRecordDto>(filter.pageNum, total, filter.pageSize, entitys); |
|
|
|
return new ServicePageResult<Ghre_StudyRecordDto>(filter.pageNum, total, filter.pageSize, entitys); |
|
|
|