三级安全教育 单添加 父级ID 即使数据重复也不会多次添加 下一级三级安全教育记录单数据

This commit is contained in:
wyw 2026-05-11 13:40:54 +08:00
parent f29a5ed071
commit 1c78b649d0
5 changed files with 139757 additions and 62 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,24 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace APT.Data.Migrations.Migrations
{
public partial class wyw2026051101 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<Guid>(
name: "PARENT_ID",
table: "T_SE_NEW_USERS",
type: "uniqueidentifier",
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "PARENT_ID",
table: "T_SE_NEW_USERS");
}
}
}

View File

@ -73320,6 +73320,9 @@ namespace APT.Data.Migrations.Migrations
.IsRequired()
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("PARENT_ID")
.HasColumnType("uniqueidentifier");
b.Property<DateTime?>("START_TIME")
.HasColumnType("datetime2");

View File

@ -145,5 +145,10 @@ namespace APT.MS.Domain.Entities.SE
/// </summary>
[Description("培训老师")]
public ICollection<T_SE_NEW_USERS_TEACHER> Nav_Teachers { get; set; }
/// <summary>
/// 父项ID
/// </summary>
[Description("父项ID")]
public Guid? PARENT_ID { get; set; }
}
}

View File

@ -45,6 +45,7 @@ namespace APT.SC.WebApi.Controllers.Api.SE
List<T_SE_NEW_USER_DETAIL_FILE> detailFiles = new List<T_SE_NEW_USER_DETAIL_FILE>();
T_FM_NOTIFICATION_TASK finishNotice = null;
var Nav_NewUserDetail = entity.Nav_NewUserDetail;
entity.Nav_NewUserDetail = null;
var Nav_Files = entity.Nav_Files;
entity.Nav_Files = null;
var Nav_Teachers = entity.Nav_Teachers;
@ -306,7 +307,14 @@ namespace APT.SC.WebApi.Controllers.Api.SE
BantchUpdateEntity_noneBase(listRoleDel);
if (listUT != null && listUT.Any())
BantchUpdateEntity_noneBase(listUT);
//if (entity.IS_DELETED)
//{
BantchUpdateEntity_noneBase(new List<T_SE_NEW_USERS>() { entity });
//}
//else
//{
// UpdateEntityNoCommit(entity);
//}
});
if (listUserDel != null && listUserDel.Count() > 0)
@ -965,6 +973,9 @@ namespace APT.SC.WebApi.Controllers.Api.SE
}
}
if (sendUser != null)
{
newEduCard = GetEntity<T_SE_NEW_USERS>(e => e.PARENT_ID.HasValue && e.PARENT_ID.Value == EDU_CARD_ID);
if (newEduCard == null || newEduCard.ID == Guid.Empty)
{
newEduCard = new T_SE_NEW_USERS();
newEduCard.ID = Guid.NewGuid();
@ -1040,13 +1051,13 @@ namespace APT.SC.WebApi.Controllers.Api.SE
#endregion
userDetailList.Add(userDetail);
}
var endTime = DateTime.Now.AddDays(10);
var newEndTime = new DateTime(endTime.Year, endTime.Month, endTime.Day, 23, 59, 59);
sendNotice = NotificationTaskService.InsertUserNoticeTaskModel(DateTime.Now.ToShortDateString() + "-三级安全培训-" + newEduCard.TRAIN_STATUS.GetDescription(), newEduCard.ID, orgId, sendUser.ID, sendUser.NAME, DateTime.Now, newEndTime, 1, "SE062");
}
}
var isAllDone = userDetails.Count(t => t.STATUS == 0);
if (isAllDone == 0)
{