|
|
|
@ -1225,6 +1225,22 @@ public class Ghre_ExamServices : BaseServices<Ghre_Exam, Ghre_ExamDto, InsertGhr |
|
|
|
|
|
|
|
|
|
if (entity.Status == DIC_EXAM_STATUS.DISABLED && status == DIC_EXAM_STATUS.RELEASED) |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
#region 判断相关联课件是否存在 |
|
|
|
|
var sql = $@"SELECT count(0)
|
|
|
|
|
FROM Ghre_CourseWare A |
|
|
|
|
WHERE A.Id IN |
|
|
|
|
(SELECT CourseWareId |
|
|
|
|
FROM Ghre_Course |
|
|
|
|
WHERE (Id = '{entity.CourseId}' OR CourseSceneId = '{entity.CourseSceneId}' OR CourseSceneIds like '%{entity.CourseSceneId}%') AND IsEnable = 1)";
|
|
|
|
|
var count = await Db.Ado.GetIntAsync(sql); |
|
|
|
|
if (count == 0) |
|
|
|
|
{ |
|
|
|
|
if (entity.LinkType == "CourseId") |
|
|
|
|
return ServiceResult.OprateFailed("该考试关联的课程未维护课件,暂不可取消归档!"); |
|
|
|
|
} |
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
if (entity.LinkType == "CourseId") |
|
|
|
|
{ |
|
|
|
|
var course = await _ghre_CourseServices.QueryById(entity.CourseId); |
|
|
|
@ -1244,6 +1260,21 @@ public class Ghre_ExamServices : BaseServices<Ghre_Exam, Ghre_ExamDto, InsertGhr |
|
|
|
|
|
|
|
|
|
if (status == DIC_EXAM_STATUS.RELEASED && entity.Status == DIC_EXAM_STATUS.DRAFT) |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
#region 判断相关联课件是否存在 |
|
|
|
|
var sql = $@"SELECT count(0)
|
|
|
|
|
FROM Ghre_CourseWare A |
|
|
|
|
WHERE A.Id IN |
|
|
|
|
(SELECT CourseWareId |
|
|
|
|
FROM Ghre_Course |
|
|
|
|
WHERE (Id = '{entity.CourseId}' OR CourseSceneId = '{entity.CourseSceneId}' OR CourseSceneIds like '%{entity.CourseSceneId}%') AND IsEnable = 1)";
|
|
|
|
|
var count = await Db.Ado.GetIntAsync(sql); |
|
|
|
|
if (count == 0) |
|
|
|
|
{ |
|
|
|
|
if (entity.LinkType == "CourseId") |
|
|
|
|
return ServiceResult.OprateFailed("该考试关联的课程未维护课件,暂不可发布!"); |
|
|
|
|
} |
|
|
|
|
#endregion |
|
|
|
|
var ids1 = ids.Where(x => id != x).ToList(); |
|
|
|
|
if (entity.LinkType == DIC_EXAM_LINK_TYPE_COURSE) |
|
|
|
|
{ |
|
|
|
|