diff --git a/Tiobon.Core.Api/Properties/launchSettings.json b/Tiobon.Core.Api/Properties/launchSettings.json index d0430e5f..e9622e9c 100644 --- a/Tiobon.Core.Api/Properties/launchSettings.json +++ b/Tiobon.Core.Api/Properties/launchSettings.json @@ -16,7 +16,7 @@ "ASPNETCORE_ENVIRONMENT": "Development" //"ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "SkyAPM.Agent.AspNetCore"// 如果要开始skywalking,请取消此行注释 }, - "applicationUrl": "http://localhost:9291" + "applicationUrl": "http://localhost:9292" }, "IIS Express": { "commandName": "IISExpress", diff --git a/Tiobon.Core.Model/View/Ghre/Ghre_ExamRecord.Dto.View.cs b/Tiobon.Core.Model/View/Ghre/Ghre_ExamRecord.Dto.View.cs index 7ca08d0d..67b53c8f 100644 --- a/Tiobon.Core.Model/View/Ghre/Ghre_ExamRecord.Dto.View.cs +++ b/Tiobon.Core.Model/View/Ghre/Ghre_ExamRecord.Dto.View.cs @@ -37,7 +37,7 @@ public class Ghre_ExamRecordDto : Ghre_ExamRecord public string StaffName { get; set; } public string DeptNo { get; set; } - public string DepteName { get; set; } + public string DeptName { get; set; } public string DeptFullPateName { get; set; } public string TitleName { get; set; } diff --git a/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs b/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs index 7da62d68..f1ebf063 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs @@ -307,7 +307,7 @@ public class Ghre_ExamRecordServices : BaseServices() .Where(x => x.Id == studyRecord.ExamId) - .FirstAsync(x => x.Status == Consts.DIC_EXAM_STATUS.RELEASED); + .FirstAsync(x => x.Status == Consts.DIC_EXAM_STATUS.RELEASED || x.Status == Consts.DIC_EXAM_STATUS.DISABLED); if (exam.IsNull()) return ServiceResult.OprateFailed("该门课程尚未开启考试,请联系HR !"); + + if (exam.Status == Consts.DIC_EXAM_STATUS.DISABLED) + return ServiceResult.OprateFailed("该考试已归档,暂不可考试 !"); + var dt = Db.GetDate(); if (exam.DateType == Consts.DicExamDateType.AFTER_HOW_LONG) { @@ -606,8 +610,8 @@ public class Ghre_ExamRecordServices : BaseServices().ToListAsync(); - for (int i = 0; i < Ghre_Courses.Count; i++) - { - #region 课程ID 同步至课件 - if (!Ghre_Courses[i].CourseWareId.IsNull()) - { - var wares = await Db.Queryable().Where(x => x.CourseIds.Contains(Ghre_Courses[i].Id.ToString()) && x.Id != Ghre_Courses[i].CourseWareId).ToListAsync(); - for (int j = 0; j < wares.Count; j++) - { - var courseIds2 = new List(); - if (!string.IsNullOrWhiteSpace(wares[j].CourseIds)) - courseIds2 = JsonConvert.DeserializeObject>(wares[j].CourseIds); - courseIds2 = courseIds2.Where(x=>x!= Ghre_Courses[i].Id).ToList(); - wares[j].CourseIds = JsonConvert.SerializeObject(courseIds2); - } - await Db.Updateable(wares).UpdateColumns(it => new { it.CourseIds }).ExecuteCommandAsync(); - - var ware = await Db.Queryable().FirstAsync(x => x.Id == Ghre_Courses[i].CourseWareId); - if (ware != null) - { - var courseIds2 = new List(); - if (!string.IsNullOrWhiteSpace(ware.CourseIds)) - courseIds2 = JsonConvert.DeserializeObject>(ware.CourseIds); - - if (!courseIds2.Any(x => x == Ghre_Courses[i].Id)) - { - courseIds2.Add(Ghre_Courses[i].Id); - - ware.CourseIds = JsonConvert.SerializeObject(courseIds2); - await Db.Updateable().SetColumns(it => it.CourseIds == ware.CourseIds).Where(it => it.Id == ware.Id).ExecuteCommandAsync(); - } - } - } - #endregion - } + //var Ghre_Courses = await Db.Queryable().ToListAsync(); + //for (int i = 0; i < Ghre_Courses.Count; i++) + //{ + // #region 课程ID 同步至课件 + // if (!Ghre_Courses[i].CourseWareId.IsNull()) + // { + // var wares = await Db.Queryable().Where(x => x.CourseIds.Contains(Ghre_Courses[i].Id.ToString()) && x.Id != Ghre_Courses[i].CourseWareId).ToListAsync(); + // for (int j = 0; j < wares.Count; j++) + // { + // var courseIds2 = new List(); + // if (!string.IsNullOrWhiteSpace(wares[j].CourseIds)) + // courseIds2 = JsonConvert.DeserializeObject>(wares[j].CourseIds); + // courseIds2 = courseIds2.Where(x=>x!= Ghre_Courses[i].Id).ToList(); + // wares[j].CourseIds = JsonConvert.SerializeObject(courseIds2); + // } + // await Db.Updateable(wares).UpdateColumns(it => new { it.CourseIds }).ExecuteCommandAsync(); + + // var ware = await Db.Queryable().FirstAsync(x => x.Id == Ghre_Courses[i].CourseWareId); + // if (ware != null) + // { + // var courseIds2 = new List(); + // if (!string.IsNullOrWhiteSpace(ware.CourseIds)) + // courseIds2 = JsonConvert.DeserializeObject>(ware.CourseIds); + + // if (!courseIds2.Any(x => x == Ghre_Courses[i].Id)) + // { + // courseIds2.Add(Ghre_Courses[i].Id); + + // ware.CourseIds = JsonConvert.SerializeObject(courseIds2); + // await Db.Updateable().SetColumns(it => it.CourseIds == ware.CourseIds).Where(it => it.Id == ware.Id).ExecuteCommandAsync(); + // } + // } + // } + // #endregion + //} return ServiceResult.OprateSuccess("执行成功!"); } } \ No newline at end of file diff --git a/Tiobon.Core.Services/Ghre/Ghre_StudyRuleServices.cs b/Tiobon.Core.Services/Ghre/Ghre_StudyRuleServices.cs index d5ac987a..c2cff760 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_StudyRuleServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_StudyRuleServices.cs @@ -382,12 +382,13 @@ public class Ghre_StudyRuleServices : BaseServices() + var record = await Db.Queryable() .Where(x => x.StudyRuleId != ruleId && x.StaffId == staff.StaffID) .WhereIF(!string.IsNullOrWhiteSpace(rule.Year), x => x.Year == rule.Year) .WhereIF(rule.CourseId != null, x => x.CourseId == rule.CourseId) .WhereIF(rule.CourseSceneId != null, x => x.CourseSceneId == rule.CourseSceneId) - .AS("Ghre_StudyRecord_V").FirstAsync(); + //.AS("Ghre_StudyRecord_V") + .FirstAsync(); if (record is null) { inserts.Add(new Ghre_StudyRecord() @@ -460,10 +461,13 @@ public class Ghre_StudyRuleServices : BaseServices().Where(x => x.Id == ruleId) + .SetColumns(it => new Ghre_StudyRule() { Result = E.Message })//类只能在表达示里面不能提取 + .ExecuteCommandAsync(); } return true; }