培训计划 加 触发日期
培训角色 跑批 根据 配置获取信息 如果未获取到 按原来的方式 再没获取到就跳过 触发日期 培训角色 必填
This commit is contained in:
parent
100dc5f5f8
commit
7b755b522e
139023
APT.Data.Migrations/Migrations/20260410064633_wyw2026041001.Designer.cs
generated
Normal file
139023
APT.Data.Migrations/Migrations/20260410064633_wyw2026041001.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace APT.Data.Migrations.Migrations
|
||||
{
|
||||
public partial class wyw2026041001 : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "APPROVAL_ROLE_ID",
|
||||
table: "T_SE_TRAIN_PLAN_DETAIL",
|
||||
type: "uniqueidentifier",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_T_SE_TRAIN_PLAN_DETAIL_APPROVAL_ROLE_ID",
|
||||
table: "T_SE_TRAIN_PLAN_DETAIL",
|
||||
column: "APPROVAL_ROLE_ID");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_T_SE_TRAIN_PLAN_DETAIL_T_PF_APPROVAL_ROLE_APPROVAL_ROLE_ID",
|
||||
table: "T_SE_TRAIN_PLAN_DETAIL",
|
||||
column: "APPROVAL_ROLE_ID",
|
||||
principalTable: "T_PF_APPROVAL_ROLE",
|
||||
principalColumn: "ID",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_T_SE_TRAIN_PLAN_DETAIL_T_PF_APPROVAL_ROLE_APPROVAL_ROLE_ID",
|
||||
table: "T_SE_TRAIN_PLAN_DETAIL");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_T_SE_TRAIN_PLAN_DETAIL_APPROVAL_ROLE_ID",
|
||||
table: "T_SE_TRAIN_PLAN_DETAIL");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "APPROVAL_ROLE_ID",
|
||||
table: "T_SE_TRAIN_PLAN_DETAIL");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -75529,6 +75529,9 @@ namespace APT.Data.Migrations.Migrations
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("APPROVAL_ROLE_ID")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<int>("CHECKTYPE")
|
||||
.HasColumnType("int");
|
||||
|
||||
@ -75612,6 +75615,8 @@ namespace APT.Data.Migrations.Migrations
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("APPROVAL_ROLE_ID");
|
||||
|
||||
b.HasIndex("DEPARTMENT_ID");
|
||||
|
||||
b.HasIndex("ORG_ID");
|
||||
@ -126444,6 +126449,11 @@ namespace APT.Data.Migrations.Migrations
|
||||
|
||||
modelBuilder.Entity("APT.MS.Domain.Entities.SE.T_SE_TRAIN_PLAN_DETAIL", b =>
|
||||
{
|
||||
b.HasOne("APT.MS.Domain.Entities.PF.T_PF_APPROVAL_ROLE", "Nav_ApproveRole")
|
||||
.WithMany()
|
||||
.HasForeignKey("APPROVAL_ROLE_ID")
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
|
||||
b.HasOne("APT.BaseData.Domain.Entities.FM.T_FM_DEPARTMENT", "Nav_Department")
|
||||
.WithMany()
|
||||
.HasForeignKey("DEPARTMENT_ID")
|
||||
@ -126466,6 +126476,8 @@ namespace APT.Data.Migrations.Migrations
|
||||
.HasForeignKey("TYPE_ID")
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
|
||||
b.Navigation("Nav_ApproveRole");
|
||||
|
||||
b.Navigation("Nav_Department");
|
||||
|
||||
b.Navigation("Nav_Org");
|
||||
|
||||
@ -11129,6 +11129,7 @@ builder.HasOne(t => t.Nav_TrainTypeEnum).WithMany().HasForeignKey(t => t.TYPE_ID
|
||||
builder.Property(t => t.NAME).HasMaxLength(100);
|
||||
builder.Property(t => t.OBJECT).HasMaxLength(100);
|
||||
builder.HasOne(t => t.Nav_Department).WithMany().HasForeignKey(t => t.DEPARTMENT_ID).OnDelete(DeleteBehavior.Restrict);
|
||||
builder.HasOne(t => t.Nav_ApproveRole).WithMany().HasForeignKey(t => t.APPROVAL_ROLE_ID).OnDelete(DeleteBehavior.Restrict);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
using APT.BaseData.Domain.Enums;
|
||||
using APT.BaseData.Domain.Enums.PF;
|
||||
using APT.Infrastructure.Core;
|
||||
using APT.MS.Domain.Entities.PF;
|
||||
using APT.MS.Domain.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@ -158,5 +159,19 @@ namespace APT.MS.Domain.Entities.SE
|
||||
[FormFieldEdit]
|
||||
[FormFieldQuery]
|
||||
public PFStandardStatus STATUS { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 培训角色
|
||||
/// 与 培训组织 匹配
|
||||
/// </summary>
|
||||
[Description("培训角色")]
|
||||
[DataFieldForeignKey("Nav_ApproveRole")]
|
||||
public Guid? APPROVAL_ROLE_ID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 审批角色
|
||||
/// </summary>
|
||||
[Description("培训角色")]
|
||||
public T_PF_APPROVAL_ROLE Nav_ApproveRole { get; set; }
|
||||
}
|
||||
}
|
||||
@ -27,6 +27,7 @@ using log4net.Core;
|
||||
using APT.WebApi.Models;
|
||||
using APT.MS.Domain.Entities.SC.BI;
|
||||
using Microsoft.Extensions.DependencyModel;
|
||||
using System.Linq.Expressions;
|
||||
|
||||
namespace APT.PP.WebApi.Controllers.Api.PP
|
||||
{
|
||||
@ -2224,7 +2225,18 @@ namespace APT.PP.WebApi.Controllers.Api.PP
|
||||
//培训组织 获取对应安全员 或者负责人 接收培训通知
|
||||
var listDepGetNotice = listRAdd.Select(e => e.DEPARTMENT_ID.Value);
|
||||
|
||||
var approveRole = GetEntities<T_PF_APPROVAL_ROLE>(e => !e.IS_DELETED && e.NAME.Contains("安全员"), null);
|
||||
var listRoleID = listRAdd.Where(e => e.APPROVAL_ROLE_ID.HasValue).Select(e => e.APPROVAL_ROLE_ID.Value);
|
||||
Expression<Func<T_PF_APPROVAL_ROLE, bool>> expression = e => !e.IS_DELETED;
|
||||
if (listRoleID != null && listRoleID.Count() > 0)
|
||||
{
|
||||
expression = expression.And(e => (listRoleID.Contains(e.ID) || e.NAME.Contains("安全员")));
|
||||
}
|
||||
else
|
||||
{
|
||||
expression = expression.And(e => e.NAME.Contains("安全员"));
|
||||
}
|
||||
|
||||
var approveRole = GetEntities(expression, null);
|
||||
var RroleID = approveRole.Select(e => e.ID);
|
||||
//安全员
|
||||
var listUserGet = GetEntities<T_FM_USER>(e => e.APPROVE_ROLE_ID.HasValue && RroleID.Contains(e.APPROVE_ROLE_ID.Value), null);
|
||||
@ -2242,8 +2254,16 @@ namespace APT.PP.WebApi.Controllers.Api.PP
|
||||
var allSendDataIds = new List<Guid>();
|
||||
var alltoDayNotifyTitles = new List<string>();
|
||||
foreach (var item in listRAdd)
|
||||
{
|
||||
if (item.APPROVAL_ROLE_ID.HasValue)
|
||||
{
|
||||
modelDetailPer = listUserGet.FirstOrDefault(e => e.APPROVE_ROLE_ID.Value == item.APPROVAL_ROLE_ID.Value && e.DEPARTMENT_ID.Value == item.DEPARTMENT_ID.Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
modelDetailPer = listUserGet.FirstOrDefault(e => e.DEPARTMENT_ID.Value == item.DEPARTMENT_ID.Value);
|
||||
}
|
||||
|
||||
if (modelDetailPer == null)
|
||||
{
|
||||
modelDetailPer = listDep.FirstOrDefault(e => e.ID == item.DEPARTMENT_ID.Value)?.Nav_User;
|
||||
|
||||
@ -122,6 +122,10 @@ namespace APT.SC.WebApi.Controllers.Api.SE
|
||||
{
|
||||
throw new Exception("请选择培训组织!行:" + rowIndex);
|
||||
}
|
||||
if (!item.APPROVAL_ROLE_ID.HasValue)
|
||||
{
|
||||
throw new Exception("请选择培训角色!行:" + rowIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -167,7 +171,7 @@ namespace APT.SC.WebApi.Controllers.Api.SE
|
||||
{
|
||||
foreach (var item in filter.Include)
|
||||
{
|
||||
if (item.IndexOf("Nav_Approve") > -1)
|
||||
if (item.IndexOf("Nav_Approve.") > -1)
|
||||
{
|
||||
var list = filter.Include.ToList();
|
||||
list.Remove(item);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user