diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs index 5c0db85a..2e2d4e17 100644 --- a/SGGL/BLL/Common/Const.cs +++ b/SGGL/BLL/Common/Const.cs @@ -5358,6 +5358,9 @@ namespace BLL /// public const string CQMS_MeetingMenuId = "30754DF1-CB18-4F53-BB66-2B2A398D7180"; - + /// + /// 质量会议 + /// + public const string EntryEducationTrainTypeId = "8920c9cc-fa92-49b2-9493-775a55da27bb"; } } \ No newline at end of file diff --git a/SGGL/BLL/HSSE/EduTrain/TestRecordService.cs b/SGGL/BLL/HSSE/EduTrain/TestRecordService.cs index c2ed027b..8426c8a6 100644 --- a/SGGL/BLL/HSSE/EduTrain/TestRecordService.cs +++ b/SGGL/BLL/HSSE/EduTrain/TestRecordService.cs @@ -197,5 +197,24 @@ namespace BLL } return icount; } + + /// + /// 根据人员id、日期获取入场教育合格考试记录 + /// + /// + /// + public static Model.Training_TestRecord GetOKTestRecordByPersonIdAndDate(string testManId, DateTime? date) + { + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + var testRecord = (from x in db.Training_TestRecord + join y in db.Training_TestPlan on x.TestPlanId equals y.TestPlanId + join z in db.Training_Plan on y.PlanId equals z.PlanId + where x.TestManId == testManId && x.TestStartTime >= date && x.TestScores >= 60 + && z.TrainTypeId == BLL.Const.EntryEducationTrainTypeId + select x).FirstOrDefault(); + return testRecord; + } + } } } diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index bd3dc5dd..3a71b2bd 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -17035,7 +17035,7 @@ - + diff --git a/SGGL/WebAPI/Controllers/PersonController.cs b/SGGL/WebAPI/Controllers/PersonController.cs index 06edabf8..35243ee1 100644 --- a/SGGL/WebAPI/Controllers/PersonController.cs +++ b/SGGL/WebAPI/Controllers/PersonController.cs @@ -436,7 +436,7 @@ namespace WebAPI.Controllers /// /// /// - public Model.ResponeData getTrainingPersonListByTrainTypeId(string projectId, string unitIds, string workPostIds, string trainTypeId, string name, int pageIndex, string startDate, string endDate,string isRepeat) + public Model.ResponeData getTrainingPersonListByTrainTypeId(string projectId, string unitIds, string workPostIds, string trainTypeId, string name, int pageIndex, string startDate, string endDate, string isRepeat) { var responeData = new Model.ResponeData(); try @@ -546,7 +546,20 @@ namespace WebAPI.Controllers var responeData = new Model.ResponeData(); try { - SitePerson_PersonService.SetSitePerson_PersonStates(sitePersonId, states, DateTime.Now); + var getSitePerson = SitePerson_PersonService.GetSitePersonById(sitePersonId); + if (getSitePerson != null) + { + var testRecord = BLL.TestRecordService.GetOKTestRecordByPersonIdAndDate(getSitePerson.PersonId, getSitePerson.InTime); + if (testRecord != null) + { + SitePerson_PersonService.SetSitePerson_PersonStates(sitePersonId, states, DateTime.Now); + } + else + { + responeData.code = 0; + responeData.message = "入场教育考试未合格,无法审核入场!"; + } + } } catch (Exception ex) {