|
|
|
@ -1,12 +1,9 @@ |
|
|
|
|
using Microsoft.Extensions.Logging; |
|
|
|
|
using MongoDB.Driver.Linq; |
|
|
|
|
using NPOI.HSSF.UserModel; |
|
|
|
|
using NPOI.SS.Formula.Functions; |
|
|
|
|
using NPOI.SS.UserModel; |
|
|
|
|
using NPOI.SS.Util; |
|
|
|
|
using NPOI.XSSF.UserModel; |
|
|
|
|
using Tiobon.Core.Model.Models; |
|
|
|
|
using static System.Runtime.InteropServices.JavaScript.JSType; |
|
|
|
|
using static Tiobon.Core.DataAccess.ReportHelper; |
|
|
|
|
using static Tiobon.Core.Model.Consts; |
|
|
|
|
|
|
|
|
@ -268,12 +265,6 @@ public class Ghre_StudyRecordServices : BaseServices<Ghre_StudyRecord, Ghre_Stud |
|
|
|
|
|
|
|
|
|
public override async Task<long> Add(InsertGhre_StudyRecordInput entity) |
|
|
|
|
{ |
|
|
|
|
if (await Db.Queryable<Ghre_StudyRecord>() |
|
|
|
|
.WhereIF(!entity.CourseId.IsNullOrEmpty(), x => x.CourseId == entity.CourseId) |
|
|
|
|
.WhereIF(!entity.CourseSceneId.IsNullOrEmpty(), x => x.CourseSceneId == entity.CourseSceneId) |
|
|
|
|
.AnyAsync(x => x.StaffId == entity.StaffId)) |
|
|
|
|
throw new Exception("该用户存在相同学习记录!"); |
|
|
|
|
|
|
|
|
|
if (entity.BeginTime != null && entity.EndTime != null) |
|
|
|
|
{ |
|
|
|
|
if (entity.EndTime < entity.BeginTime) |
|
|
|
@ -287,6 +278,14 @@ public class Ghre_StudyRecordServices : BaseServices<Ghre_StudyRecord, Ghre_Stud |
|
|
|
|
entity.CourseBeginTime = entity.BeginTime; |
|
|
|
|
entity.CourseEndTime = entity.EndTime; |
|
|
|
|
} |
|
|
|
|
if (await Db.Queryable<Ghre_StudyRecord>() |
|
|
|
|
.WhereIF(!entity.CourseId.IsNullOrEmpty(), x => x.CourseId == entity.CourseId) |
|
|
|
|
.WhereIF(!entity.CourseSceneId.IsNullOrEmpty(), x => x.CourseSceneId == entity.CourseSceneId) |
|
|
|
|
.Where(x => (x.CourseBeginTime <= entity.CourseBeginTime && x.CourseEndTime >= entity.CourseBeginTime) || (x.CourseBeginTime <= entity.CourseEndTime && x.CourseEndTime >= entity.CourseEndTime)) |
|
|
|
|
.AnyAsync(x => x.StaffId == entity.StaffId)) |
|
|
|
|
throw new Exception("该用户存在相同学习记录!"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
entity.StudyStatus = "HasFinish"; |
|
|
|
|
|
|
|
|
|
var snap = await Db.Queryable<Ghre_CourseSnap>().FirstAsync(x => x.CourseId == entity.CourseId); |
|
|
|
@ -719,8 +718,8 @@ public class Ghre_StudyRecordServices : BaseServices<Ghre_StudyRecord, Ghre_Stud |
|
|
|
|
AdjustScore = AdjustScore ?? 0, |
|
|
|
|
IsPass = isPass == "是" ? true : false, |
|
|
|
|
ExamDate = dtExamDate, |
|
|
|
|
BeginTime = dtCourseBeginTime, |
|
|
|
|
EndTime = dtCourseEndTime, |
|
|
|
|
CourseBeginTime = dtCourseBeginTime, |
|
|
|
|
CourseEndTime = dtCourseEndTime, |
|
|
|
|
RemarkSz = remarkSz, |
|
|
|
|
CourseType = "ExcelImport" |
|
|
|
|
}; |
|
|
|
|