From 044a779da02103b6840e33795fd01022f99864f4 Mon Sep 17 00:00:00 2001 From: wyw <571921741@qq.com> Date: Sun, 23 Nov 2025 20:29:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=89=E7=BA=A7=E5=AE=89=E5=85=A8=E6=95=99?= =?UTF-8?q?=E8=82=B2=20=E4=BF=AE=E6=94=B9=E4=B8=BA=20=E4=B8=8D=E4=B8=80?= =?UTF-8?q?=E5=AE=9A=E5=B0=B1=E6=AF=8F=E5=A4=A9=E8=A7=A6=E5=8F=91=20=20?= =?UTF-8?q?=E6=8C=89=E5=B0=8F=E6=97=B6=E8=BD=AE=E8=AF=A2=208=E3=80=819=20?= =?UTF-8?q?=E5=B0=8F=E6=97=B6=20=E5=8F=AF=E4=BB=A5=E6=9C=89=E8=A7=A6?= =?UTF-8?q?=E5=8F=91=E5=8D=95=E5=AD=90=20=E4=BD=86=E6=98=AF=E6=AF=8F?= =?UTF-8?q?=E5=A4=A9=E5=8F=AA=E6=9C=89=E4=B8=80=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/Api/SEController.cs | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/APT.MicroApi/APT.PP.WebApi/Controllers/Api/SEController.cs b/APT.MicroApi/APT.PP.WebApi/Controllers/Api/SEController.cs index 8d0f629..9892269 100644 --- a/APT.MicroApi/APT.PP.WebApi/Controllers/Api/SEController.cs +++ b/APT.MicroApi/APT.PP.WebApi/Controllers/Api/SEController.cs @@ -218,19 +218,29 @@ namespace APT.PP.WebApi.Controllers.Api.PP catch { } } - if (currTime.Hour < 15) + //金源培训 9 ~ 15 可以触发一次 + if (currTime.Hour == 8 || currTime.Hour == 9) { return true; } + + var orgId = filter.GetOrgId(); + var newUsers = GetEntities(t => t.IS_SEND == 0, new BaseFilter(orgId)); + if (!newUsers.Any() || newUsers.Count() < 1) + { + return true; + } + //如果今天触发过三级安全教育 直接返回 + var NewCheck = GetEntity(e => !e.IS_DELETED && e.TRAIN_STATUS == SEThreeLevelSafeTrainType.公司级 && e.CREATE_TIME.HasValue && e.CREATE_TIME.Value.Date == currTime.Date); + if (NewCheck != null) + { + return true; + } + T_SE_NEW_USERS eduCard = null; List sendNotice = new List(); List userDetails = new List(); - var orgId = filter.GetOrgId(); - var newUsers = GetEntities(t => t.IS_SEND == 0, new BaseFilter(orgId)); - if (!newUsers.Any()) - { - return true; - } + var newUsersId = newUsers.Select(t => t.USER_ID); var newAllUsers = GetEntities(t => newUsersId.Contains(t.ID), new BaseFilter(orgId)); var sendUser = GetEntity(t => t.Nav_ApproveRole != null && t.Nav_ApproveRole.NAME == "安环部安全员" && t.IS_DELETED == false && t.ENABLE_STATUS == 0); @@ -241,6 +251,7 @@ namespace APT.PP.WebApi.Controllers.Api.PP eduCard.USER_ID = sendUser.ID; eduCard.ORG_ID = orgId; eduCard.TRAIN_STATUS = SEThreeLevelSafeTrainType.公司级; + eduCard.CREATE_TIME = currTime; if (train_contents != null) { eduCard.CONTENT_ID = train_contents.ID;