|
|
|
@ -17,8 +17,7 @@ using MongoDB.Driver.Linq; |
|
|
|
|
using Tiobon.Core.Common.DB.Dapper; |
|
|
|
|
using Tiobon.Core.Common.Helper; |
|
|
|
|
using System.Data; |
|
|
|
|
using Snappier; |
|
|
|
|
using Org.BouncyCastle.Crypto; |
|
|
|
|
using static Tiobon.Core.Model.Consts; |
|
|
|
|
|
|
|
|
|
namespace Tiobon.Core.Services; |
|
|
|
|
|
|
|
|
@ -1187,7 +1186,7 @@ public class Ghre_ExamServices : BaseServices<Ghre_Exam, Ghre_ExamDto, InsertGhr |
|
|
|
|
ent.UpdateIP = ip; |
|
|
|
|
ent.UpdateProg = api; |
|
|
|
|
|
|
|
|
|
if (entity.Status == Consts.DIC_EXAM_STATUS.RELEASED && status == Consts.DIC_EXAM_STATUS.DRAFT && await _ghre_ExamRecordServices.AnyAsync(x => x.ExamId == id && x.Status == "UnderWay")) |
|
|
|
|
if (entity.Status == Consts.DIC_EXAM_STATUS.RELEASED && status == Consts.DIC_EXAM_STATUS.DRAFT && await _ghre_ExamRecordServices.AnyAsync(x => x.ExamId == id && x.Status == DIC_EXAM_RECORD_STATUS.EXAMING)) |
|
|
|
|
return ServiceResult.OprateFailed("已有学员参与考试,不可取消发布!"); |
|
|
|
|
|
|
|
|
|
if (entity.Status == Consts.DIC_EXAM_STATUS.DISABLED && status == Consts.DIC_EXAM_STATUS.RELEASED) |
|
|
|
@ -1208,7 +1207,8 @@ public class Ghre_ExamServices : BaseServices<Ghre_Exam, Ghre_ExamDto, InsertGhr |
|
|
|
|
if (examPaper.Status != Consts.DIC_EXAM_STATUS.RELEASED) |
|
|
|
|
return ServiceResult.OprateFailed($"该考试关联的试卷【{examPaper.PaperName}({examPaper.PaperNo})】状态为【{(examPaper.Status == Consts.DIC_EXAM_STATUS.DISABLED ? "已停用" : "草稿箱")}】,暂不可取消归档!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (status == Consts.DIC_EXAM_STATUS.RELEASED && entity.Status == Consts.DIC_EXAM_STATUS.DRAFT) |
|
|
|
|
{ |
|
|
|
|
if (entity.LinkType == Consts.DIC_EXAM_LINK_TYPE_COURSE) |
|
|
|
|
{ |
|
|
|
|
#region 校验同一个课程下 考试时间不允许重叠 |
|
|
|
@ -1255,6 +1255,7 @@ public class Ghre_ExamServices : BaseServices<Ghre_Exam, Ghre_ExamDto, InsertGhr |
|
|
|
|
} |
|
|
|
|
#endregion |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#region 生成学习记录 |
|
|
|
|
if (status == Consts.DIC_EXAM_STATUS.RELEASED && entity.Status == Consts.DIC_EXAM_STATUS.DRAFT) |
|
|
|
@ -1283,7 +1284,7 @@ public class Ghre_ExamServices : BaseServices<Ghre_Exam, Ghre_ExamDto, InsertGhr |
|
|
|
|
var exist = await Db.Queryable<Ghre_StudyRecord>() |
|
|
|
|
.WhereIF(!entity.CourseId.IsNull(), x => x.CourseId == entity.CourseId) |
|
|
|
|
.WhereIF(!entity.CourseSceneId.IsNull(), x => x.CourseSceneId == entity.CourseSceneId) |
|
|
|
|
.Where(x => x.ExamId == id && x.StaffId == staff.StaffId ).AnyAsync(); |
|
|
|
|
.Where(x => x.ExamId == id && x.StaffId == staff.StaffId).AnyAsync(); |
|
|
|
|
|
|
|
|
|
if (!exist) |
|
|
|
|
inserts.Add(new Ghre_StudyRecord() |
|
|
|
|