三级安全教育 单添加 父级ID 即使数据重复也不会多次添加 下一级三级安全教育记录单数据
This commit is contained in:
parent
f29a5ed071
commit
1c78b649d0
139652
APT.Data.Migrations/Migrations/20260511035652_wyw2026051101.Designer.cs
generated
Normal file
139652
APT.Data.Migrations/Migrations/20260511035652_wyw2026051101.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -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");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -73320,6 +73320,9 @@ namespace APT.Data.Migrations.Migrations
|
|||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasColumnType("uniqueidentifier");
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<Guid?>("PARENT_ID")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
b.Property<DateTime?>("START_TIME")
|
b.Property<DateTime?>("START_TIME")
|
||||||
.HasColumnType("datetime2");
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
|||||||
@ -145,5 +145,10 @@ namespace APT.MS.Domain.Entities.SE
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[Description("培训老师")]
|
[Description("培训老师")]
|
||||||
public ICollection<T_SE_NEW_USERS_TEACHER> Nav_Teachers { get; set; }
|
public ICollection<T_SE_NEW_USERS_TEACHER> Nav_Teachers { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 父项ID
|
||||||
|
/// </summary>
|
||||||
|
[Description("父项ID")]
|
||||||
|
public Guid? PARENT_ID { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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>();
|
List<T_SE_NEW_USER_DETAIL_FILE> detailFiles = new List<T_SE_NEW_USER_DETAIL_FILE>();
|
||||||
T_FM_NOTIFICATION_TASK finishNotice = null;
|
T_FM_NOTIFICATION_TASK finishNotice = null;
|
||||||
var Nav_NewUserDetail = entity.Nav_NewUserDetail;
|
var Nav_NewUserDetail = entity.Nav_NewUserDetail;
|
||||||
|
entity.Nav_NewUserDetail = null;
|
||||||
var Nav_Files = entity.Nav_Files;
|
var Nav_Files = entity.Nav_Files;
|
||||||
entity.Nav_Files = null;
|
entity.Nav_Files = null;
|
||||||
var Nav_Teachers = entity.Nav_Teachers;
|
var Nav_Teachers = entity.Nav_Teachers;
|
||||||
@ -306,7 +307,14 @@ namespace APT.SC.WebApi.Controllers.Api.SE
|
|||||||
BantchUpdateEntity_noneBase(listRoleDel);
|
BantchUpdateEntity_noneBase(listRoleDel);
|
||||||
if (listUT != null && listUT.Any())
|
if (listUT != null && listUT.Any())
|
||||||
BantchUpdateEntity_noneBase(listUT);
|
BantchUpdateEntity_noneBase(listUT);
|
||||||
|
//if (entity.IS_DELETED)
|
||||||
|
//{
|
||||||
BantchUpdateEntity_noneBase(new List<T_SE_NEW_USERS>() { entity });
|
BantchUpdateEntity_noneBase(new List<T_SE_NEW_USERS>() { entity });
|
||||||
|
//}
|
||||||
|
//else
|
||||||
|
//{
|
||||||
|
// UpdateEntityNoCommit(entity);
|
||||||
|
//}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (listUserDel != null && listUserDel.Count() > 0)
|
if (listUserDel != null && listUserDel.Count() > 0)
|
||||||
@ -965,6 +973,9 @@ namespace APT.SC.WebApi.Controllers.Api.SE
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (sendUser != null)
|
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 = new T_SE_NEW_USERS();
|
||||||
newEduCard.ID = Guid.NewGuid();
|
newEduCard.ID = Guid.NewGuid();
|
||||||
@ -1040,13 +1051,13 @@ namespace APT.SC.WebApi.Controllers.Api.SE
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
userDetailList.Add(userDetail);
|
userDetailList.Add(userDetail);
|
||||||
}
|
}
|
||||||
var endTime = DateTime.Now.AddDays(10);
|
var endTime = DateTime.Now.AddDays(10);
|
||||||
var newEndTime = new DateTime(endTime.Year, endTime.Month, endTime.Day, 23, 59, 59);
|
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");
|
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);
|
var isAllDone = userDetails.Count(t => t.STATUS == 0);
|
||||||
if (isAllDone == 0)
|
if (isAllDone == 0)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user