剥离lr
This commit is contained in:
parent
96f4f10cbb
commit
365222e5ca
@ -13,7 +13,6 @@ using APT.MS.Domain.Entities.BS;
|
||||
using APT.MS.Domain.Entities.DM;
|
||||
using APT.MS.Domain.Entities.FO;
|
||||
using APT.MS.Domain.Entities.HM;
|
||||
using APT.MS.Domain.Entities.LR;
|
||||
using APT.MS.Domain.Entities.PF;
|
||||
using APT.MS.Domain.Entities.SC.DM;
|
||||
using APT.MS.Domain.Entities.SC.PE;
|
||||
@ -2917,18 +2916,6 @@ namespace APT.BaseData.Services.DomainServices
|
||||
{
|
||||
sendNotice = null;
|
||||
}
|
||||
T_LR_LAW_SC_SYSTEM sys = null;
|
||||
if (!string.IsNullOrEmpty(entity.LAW_NAME))
|
||||
{
|
||||
var law = this.GetEntity<T_LR_LAW>(t => t.NAME == entity.LAW_NAME && t.ID == entity.LAW_ID);
|
||||
if (law != null)
|
||||
{
|
||||
sys = new T_LR_LAW_SC_SYSTEM();
|
||||
sys.LAW_ID = law.ID;
|
||||
sys.SC_SYSTEM_ID = entity.ID;
|
||||
sys.ORG_ID = entity.ORG_ID;
|
||||
}
|
||||
}
|
||||
UnifiedCommit(() =>
|
||||
{
|
||||
if (entity != null)
|
||||
@ -2937,8 +2924,6 @@ namespace APT.BaseData.Services.DomainServices
|
||||
this.UpdateEntityNoCommit(oldEntity);
|
||||
if (sendNotice != null)
|
||||
this.UpdateEntityNoCommit(sendNotice);
|
||||
if (sys != null)
|
||||
this.UpdateEntityNoCommit(sys);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
97825
APT.Data.Migrations/Migrations/20240125070821_wjn202401-2501.Designer.cs
generated
Normal file
97825
APT.Data.Migrations/Migrations/20240125070821_wjn202401-2501.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
1427
APT.Data.Migrations/Migrations/20240125070821_wjn202401-2501.cs
Normal file
1427
APT.Data.Migrations/Migrations/20240125070821_wjn202401-2501.cs
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -21,7 +21,6 @@ using APT.MS.Domain.Entities.SC.BI;
|
||||
using APT.MS.Domain.Entities.CM;
|
||||
using APT.MS.Domain.Entities.DM;
|
||||
using APT.MS.Domain.Entities.SC.DM;
|
||||
using APT.MS.Domain.Entities.LR;
|
||||
using APT.MS.Domain.Entities.SC;
|
||||
using APT.MS.Domain.Entities.OG;
|
||||
using APT.MS.Domain.Entities.SC.OG;
|
||||
@ -4869,302 +4868,6 @@ builder.HasOne(t => t.Nav_ImgFile).WithMany().HasForeignKey(t => t.IMG_FILE_ID).
|
||||
base.Configure(builder);
|
||||
builder.Property(t => t.NAME).HasMaxLength(500);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region Lrconfig
|
||||
public partial class LRLrconfigMap :APTEntityBaseMap<T_LR_LRCONFIG>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<T_LR_LRCONFIG> builder)
|
||||
{
|
||||
base.Configure(builder);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region IntegrateUpdateTime
|
||||
public partial class LRIntegrateUpdateTimeMap :APTEntityBaseMap<T_LR_INTEGRATE_UPDATE_TIME>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<T_LR_INTEGRATE_UPDATE_TIME> builder)
|
||||
{
|
||||
base.Configure(builder);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region DemandDistinguish
|
||||
public partial class LRDemandDistinguishMap :APTEntityBaseMap<T_LR_DEMAND_DISTINGUISH>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<T_LR_DEMAND_DISTINGUISH> builder)
|
||||
{
|
||||
base.Configure(builder);
|
||||
builder.Property(t => t.NAME).HasMaxLength(200);
|
||||
builder.HasOne(t => t.Nav_Department).WithMany().HasForeignKey(t => t.DEPARTMENT_ID).OnDelete(DeleteBehavior.Restrict);
|
||||
builder.HasOne(t => t.Nav_User).WithMany().HasForeignKey(t => t.USER_ID).OnDelete(DeleteBehavior.Restrict);
|
||||
builder.Property(t => t.demandTypeStr).HasMaxLength(200);
|
||||
builder.Ignore(t => t.PUBLISH);
|
||||
builder.Ignore(t => t.IS_OVERTIME);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region DemandType
|
||||
public partial class LRDemandTypeMap :APTEntityBaseMap<T_LR_DEMAND_TYPE>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<T_LR_DEMAND_TYPE> builder)
|
||||
{
|
||||
base.Configure(builder);
|
||||
builder.HasOne(t => t.Nav_DemandDistinguish).WithMany(t=>t.Nav_DemandTypes).HasForeignKey(t => t.DISTINGUISH_ID).OnDelete(DeleteBehavior.Restrict);
|
||||
builder.HasOne(t => t.Nav_DemandType).WithMany().HasForeignKey(t => t.DEMANDTYPE_ID).OnDelete(DeleteBehavior.Restrict);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region DemandLaw
|
||||
public partial class LRDemandLawMap :APTEntityBaseMap<T_LR_DEMAND_LAW>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<T_LR_DEMAND_LAW> builder)
|
||||
{
|
||||
base.Configure(builder);
|
||||
builder.HasOne(t => t.Nav_DemandDistinguish).WithMany(t=>t.Nav_DemandLaw).HasForeignKey(t => t.DISTINGUISH_ID).OnDelete(DeleteBehavior.Restrict);
|
||||
builder.HasOne(t => t.Nav_Law).WithMany().HasForeignKey(t => t.LAW_ID).OnDelete(DeleteBehavior.Restrict);
|
||||
builder.Property(t => t.REMARK).HasMaxLength(100);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region DemandOther
|
||||
public partial class LRDemandOtherMap :APTEntityBaseMap<T_LR_DEMAND_OTHER>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<T_LR_DEMAND_OTHER> builder)
|
||||
{
|
||||
base.Configure(builder);
|
||||
builder.HasOne(t => t.Nav_DemandDistinguish).WithMany(t=>t.Nav_DemandOther).HasForeignKey(t => t.DISTINGUISH_ID).OnDelete(DeleteBehavior.Restrict);
|
||||
builder.HasOne(t => t.Nav_OtherDistinguish).WithMany().HasForeignKey(t => t.OTHER_ID).OnDelete(DeleteBehavior.Restrict);
|
||||
builder.Property(t => t.REMARK).HasMaxLength(200);
|
||||
builder.Property(t => t.NAME).HasMaxLength(500);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region DemandDistinguishReport
|
||||
public partial class LRDemandDistinguishReportMap :APTEntityBaseMap<T_LR_DEMAND_DISTINGUISH_REPORT>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<T_LR_DEMAND_DISTINGUISH_REPORT> builder)
|
||||
{
|
||||
base.Configure(builder);
|
||||
builder.Property(t => t.FEEDBACK_RATE).HasMaxLength(500);
|
||||
builder.HasOne(t => t.Nav_Department).WithMany().HasForeignKey(t => t.DEPARTMENT_ID).OnDelete(DeleteBehavior.Restrict);
|
||||
builder.Ignore(t => t.PUBLISH);
|
||||
builder.Ignore(t => t.IS_OVERTIME);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region DemandDistinguishReportDetail
|
||||
public partial class LRDemandDistinguishReportDetailMap :APTEntityBaseMap<T_LR_DEMAND_DISTINGUISH_REPORT_DETAIL>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<T_LR_DEMAND_DISTINGUISH_REPORT_DETAIL> builder)
|
||||
{
|
||||
base.Configure(builder);
|
||||
builder.HasOne(t => t.Nav_DemandReport).WithMany(t=>t.Nav_DemandReportDetail).HasForeignKey(t => t.REPORT_ID).OnDelete(DeleteBehavior.Restrict);
|
||||
builder.Property(t => t.DEMAND_NAME).HasMaxLength(500);
|
||||
builder.Property(t => t.DEMAND_PERSON).HasMaxLength(500);
|
||||
builder.Property(t => t.DEMAND_DEPARTMENT).HasMaxLength(500);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region LegalList
|
||||
public partial class LRLegalListMap :APTEntityBaseMap<T_LR_LEGAL_LIST>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<T_LR_LEGAL_LIST> builder)
|
||||
{
|
||||
base.Configure(builder);
|
||||
builder.Property(t => t.CODE).HasMaxLength(500);
|
||||
builder.Property(t => t.NAME).HasMaxLength(500);
|
||||
builder.HasOne(t => t.Nav_Department).WithMany().HasForeignKey(t => t.DEPARTMENT_ID).OnDelete(DeleteBehavior.Restrict);
|
||||
builder.HasOne(t => t.Nav_User).WithMany().HasForeignKey(t => t.USER_ID).OnDelete(DeleteBehavior.Restrict);
|
||||
builder.Ignore(t => t.PUBLISH);
|
||||
builder.Ignore(t => t.IS_OVERTIME);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region LegalListDetail
|
||||
public partial class LRLegalListDetailMap :APTEntityBaseMap<T_LR_LEGAL_LIST_DETAIL>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<T_LR_LEGAL_LIST_DETAIL> builder)
|
||||
{
|
||||
base.Configure(builder);
|
||||
builder.HasOne(t => t.Nav_LegalList).WithMany(t=>t.Nav_LegalListDetail).HasForeignKey(t => t.LEGAL_ID).OnDelete(DeleteBehavior.Restrict);
|
||||
builder.HasOne(t => t.Nav_OtherDistinguish).WithMany().HasForeignKey(t => t.OTHER_ID).OnDelete(DeleteBehavior.Restrict);
|
||||
builder.HasOne(t => t.Nav_DemandType).WithMany().HasForeignKey(t => t.DEMANDTYPE_ID).OnDelete(DeleteBehavior.Restrict);
|
||||
builder.Property(t => t.FILE_NAME).HasMaxLength(500);
|
||||
builder.Property(t => t.VERSION_NUM).HasMaxLength(500);
|
||||
builder.HasOne(t => t.Nav_User).WithMany().HasForeignKey(t => t.USER_ID).OnDelete(DeleteBehavior.Restrict);
|
||||
builder.Ignore(t => t.PUBLISH);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region LegalListDetailUser
|
||||
public partial class LRLegalListDetailUserMap :APTEntityBaseMap<T_LR_LEGAL_LIST_DETAIL_USER>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<T_LR_LEGAL_LIST_DETAIL_USER> builder)
|
||||
{
|
||||
base.Configure(builder);
|
||||
builder.HasOne(t => t.Nav_LegalListDetail).WithMany(t=>t.Nav_LegalListDetailUser).HasForeignKey(t => t.LEGAL_LIST_DETAIL).OnDelete(DeleteBehavior.Restrict);
|
||||
builder.HasOne(t => t.Nav_User).WithMany().HasForeignKey(t => t.USER_ID).OnDelete(DeleteBehavior.Restrict);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region LegalListDetailFile
|
||||
public partial class LRLegalListDetailFileMap :APTEntityBaseMap<T_LR_LEGAL_LIST_DETAIL_FILE>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<T_LR_LEGAL_LIST_DETAIL_FILE> builder)
|
||||
{
|
||||
base.Configure(builder);
|
||||
builder.HasOne(t => t.Nav_LegalListDetail).WithMany(t=>t.Nav_Files).HasForeignKey(t => t.LEGAL_LIST_DETAIL).OnDelete(DeleteBehavior.Restrict);
|
||||
builder.HasOne(t => t.Nav_ImgFile).WithMany().HasForeignKey(t => t.IMG_FILE_ID).OnDelete(DeleteBehavior.Restrict);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region LawIntegrate
|
||||
public partial class LRLawIntegrateMap :APTEntityBaseMap<T_LR_LAW_INTEGRATE>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<T_LR_LAW_INTEGRATE> builder)
|
||||
{
|
||||
base.Configure(builder);
|
||||
builder.Property(t => t.RATE).HasMaxLength(500);
|
||||
builder.Ignore(t => t.PUBLISH);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region LawIntegrateDetail
|
||||
public partial class LRLawIntegrateDetailMap :APTEntityBaseMap<T_LR_LAW_INTEGRATE_DETAIL>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<T_LR_LAW_INTEGRATE_DETAIL> builder)
|
||||
{
|
||||
base.Configure(builder);
|
||||
builder.HasOne(t => t.Nav_LawIntegrate).WithMany(t=>t.Nav_IntegrateDetail).HasForeignKey(t => t.LAW_INTEGRATE_ID).OnDelete(DeleteBehavior.Restrict);
|
||||
builder.HasOne(t => t.Nav_Law).WithMany().HasForeignKey(t => t.LAW_ID).OnDelete(DeleteBehavior.Restrict);
|
||||
builder.HasOne(t => t.Nav_SCSystem).WithMany().HasForeignKey(t => t.SYSTEM_ID).OnDelete(DeleteBehavior.Restrict);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region LawIntegrateUpdate
|
||||
public partial class LRLawIntegrateUpdateMap :APTEntityBaseMap<T_LR_LAW_INTEGRATE_UPDATE>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<T_LR_LAW_INTEGRATE_UPDATE> builder)
|
||||
{
|
||||
base.Configure(builder);
|
||||
builder.Property(t => t.RATE).HasMaxLength(500);
|
||||
builder.Ignore(t => t.PUBLISH);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region LawIntegrateUpdateDetail
|
||||
public partial class LRLawIntegrateUpdateDetailMap :APTEntityBaseMap<T_LR_LAW_INTEGRATE_UPDATE_DETAIL>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<T_LR_LAW_INTEGRATE_UPDATE_DETAIL> builder)
|
||||
{
|
||||
base.Configure(builder);
|
||||
builder.HasOne(t => t.Nav_LawIntegrateUpdate).WithMany(t=>t.Nav_IntegrateUpdateDetail).HasForeignKey(t => t.INTEGRATE_UPDATE_ID).OnDelete(DeleteBehavior.Restrict);
|
||||
builder.HasOne(t => t.Nav_Law).WithMany().HasForeignKey(t => t.LAW_ID).OnDelete(DeleteBehavior.Restrict);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region Law
|
||||
public partial class LRLawMap :APTEntityBaseMap<T_LR_LAW>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<T_LR_LAW> builder)
|
||||
{
|
||||
base.Configure(builder);
|
||||
builder.Property(t => t.CODE).HasMaxLength(500);
|
||||
builder.HasIndex("NAME").IsUnique();
|
||||
builder.Property(t => t.NAME).HasMaxLength(200);
|
||||
builder.Property(t => t.VERSION_NUM).HasMaxLength(500);
|
||||
builder.HasOne(t => t.Nav_LawType).WithMany().HasForeignKey(t => t.TYPE_ID).OnDelete(DeleteBehavior.Restrict);
|
||||
builder.Property(t => t.PREPARED_DEPARTMENT).HasMaxLength(500);
|
||||
builder.HasOne(t => t.Nav_User).WithMany().HasForeignKey(t => t.USER_ID).OnDelete(DeleteBehavior.Restrict);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region LawVersion
|
||||
public partial class LRLawVersionMap :APTEntityBaseMap<T_LR_LAW_VERSION>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<T_LR_LAW_VERSION> builder)
|
||||
{
|
||||
base.Configure(builder);
|
||||
builder.HasOne(t => t.Nav_Law).WithMany(t=>t.Nav_LawVersion).HasForeignKey(t => t.LAW_ID).OnDelete(DeleteBehavior.Restrict);
|
||||
builder.Property(t => t.VERSION_NUM).HasMaxLength(500);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region LawVersionFile
|
||||
public partial class LRLawVersionFileMap :APTEntityBaseMap<T_LR_LAW_VERSION_FILE>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<T_LR_LAW_VERSION_FILE> builder)
|
||||
{
|
||||
base.Configure(builder);
|
||||
builder.HasOne(t => t.Nav_Version).WithMany(t=>t.Nav_Files).HasForeignKey(t => t.VERSION_ID).OnDelete(DeleteBehavior.Restrict);
|
||||
builder.HasOne(t => t.Nav_ImgFile).WithMany().HasForeignKey(t => t.IMG_FILE_ID).OnDelete(DeleteBehavior.Restrict);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region LawScSystem
|
||||
public partial class LRLawScSystemMap :APTEntityBaseMap<T_LR_LAW_SC_SYSTEM>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<T_LR_LAW_SC_SYSTEM> builder)
|
||||
{
|
||||
base.Configure(builder);
|
||||
builder.HasOne(t => t.Nav_Law).WithMany(t=>t.Nav_LawSCSystem).HasForeignKey(t => t.LAW_ID).OnDelete(DeleteBehavior.Restrict);
|
||||
builder.HasOne(t => t.Nav_SCSystem).WithMany().HasForeignKey(t => t.SC_SYSTEM_ID).OnDelete(DeleteBehavior.Restrict);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region LawType
|
||||
public partial class LRLawTypeMap :APTEntityBaseMap<T_LR_LAW_TYPE>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<T_LR_LAW_TYPE> builder)
|
||||
{
|
||||
base.Configure(builder);
|
||||
builder.HasIndex("NAME").IsUnique();
|
||||
builder.Property(t => t.NAME).HasMaxLength(500);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region DemandUser
|
||||
public partial class LRDemandUserMap :APTEntityBaseMap<T_LR_DEMAND_USER>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<T_LR_DEMAND_USER> builder)
|
||||
{
|
||||
base.Configure(builder);
|
||||
builder.HasOne(t => t.Nav_OtherDistinguish).WithMany(t=>t.Nav_DemandUser).HasForeignKey(t => t.OTHER_ID).OnDelete(DeleteBehavior.Restrict);
|
||||
builder.HasOne(t => t.Nav_User).WithMany().HasForeignKey(t => t.USER_ID).OnDelete(DeleteBehavior.Restrict);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region LawInstitution
|
||||
public partial class LRLawInstitutionMap :APTEntityBaseMap<T_LR_LAW_INSTITUTION>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<T_LR_LAW_INSTITUTION> builder)
|
||||
{
|
||||
base.Configure(builder);
|
||||
builder.HasOne(t => t.Nav_LawIntegrateUpdateDetail).WithMany(t=>t.Nav_LRLawInstitution).HasForeignKey(t => t.UPDATE_DETAIL_ID).OnDelete(DeleteBehavior.Restrict);
|
||||
builder.HasOne(t => t.Nav_SCSystem).WithMany().HasForeignKey(t => t.SC_SYSTEM_ID).OnDelete(DeleteBehavior.Restrict);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region LawUpdate
|
||||
public partial class LRLawUpdateMap :APTEntityBaseMap<T_LR_LAW_UPDATE>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<T_LR_LAW_UPDATE> builder)
|
||||
{
|
||||
base.Configure(builder);
|
||||
builder.HasOne(t => t.Nav_Law).WithMany().HasForeignKey(t => t.LAW_ID).OnDelete(DeleteBehavior.Restrict);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region OtherDistinguish
|
||||
public partial class LROtherDistinguishMap :APTEntityBaseMap<T_LR_OTHER_DISTINGUISH>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<T_LR_OTHER_DISTINGUISH> builder)
|
||||
{
|
||||
base.Configure(builder);
|
||||
builder.Property(t => t.CODE).HasMaxLength(500);
|
||||
builder.Property(t => t.NAME).HasMaxLength(100);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region MtConfig
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
using APT.BaseData.Domain.Entities.FM;
|
||||
using APT.Infrastructure.Core;
|
||||
using APT.MS.Domain.Entities.HM;
|
||||
using APT.MS.Domain.Entities.LR;
|
||||
using APT.MS.Domain.Entities.SC.SC;
|
||||
using APT.MS.Domain.Enums;
|
||||
using System;
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
using APT.BaseData.Domain.Entities.FM;
|
||||
using APT.Infrastructure.Core;
|
||||
using APT.MS.Domain.Entities.HM;
|
||||
using APT.MS.Domain.Entities.LR;
|
||||
using APT.MS.Domain.Entities.SC.SC;
|
||||
using APT.MS.Domain.Enums;
|
||||
using System;
|
||||
|
||||
@ -1,34 +0,0 @@
|
||||
|
||||
using APT.Infrastructure.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace APT.MS.Domain.Entities.LR
|
||||
{
|
||||
/// <summary>
|
||||
/// 法律法规配置
|
||||
/// </summary>
|
||||
[Description("法律法规配置")]
|
||||
public class T_LR_LRCONFIG : MesEntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 需求识别开始时间
|
||||
/// </summary>
|
||||
[Description("需求识别开始时间")]
|
||||
[FormFieldTable]
|
||||
[FormFieldEdit]
|
||||
public DateTime DEMAND_START_TIME { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 需求识别结束时间
|
||||
/// </summary>
|
||||
[Description("需求识别结束时间")]
|
||||
[FormFieldTable]
|
||||
[FormFieldEdit]
|
||||
public DateTime DEMAND_END_TIME { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,26 +0,0 @@
|
||||
|
||||
using APT.Infrastructure.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace APT.MS.Domain.Entities.LR
|
||||
{
|
||||
/// <summary>
|
||||
/// 法律法规更新与融入时间
|
||||
/// </summary>
|
||||
[Description("法律法规更新与融入时间")]
|
||||
public class T_LR_INTEGRATE_UPDATE_TIME : MesEntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 法律法规更新与融入时间
|
||||
/// </summary>
|
||||
[Description("法律法规更新与融入时间")]
|
||||
[FormFieldTable]
|
||||
[FormFieldEdit]
|
||||
public DateTime INTEGRATE_UPDATE_TIME { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,126 +0,0 @@
|
||||
using APT.BaseData.Domain.Entities.FM;
|
||||
using APT.BaseData.Domain.Enums;
|
||||
using APT.Infrastructure.Core;
|
||||
using APT.MS.Domain.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace APT.MS.Domain.Entities.LR
|
||||
{
|
||||
/// <summary>
|
||||
/// 安全生产法律法规需求识别表
|
||||
/// </summary>
|
||||
[Description("安全生产法律法规需求识别表")]
|
||||
public class T_LR_DEMAND_DISTINGUISH : MesEntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
[Description("名称")]
|
||||
[DataFieldLength(200)]
|
||||
public string NAME { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 统计年份
|
||||
/// </summary>
|
||||
[Description("统计年份")]
|
||||
[FormFieldTable]
|
||||
[FormFieldQuery]
|
||||
public int YEARS { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 识别时间
|
||||
/// </summary>
|
||||
[Description("识别时间")]
|
||||
[FormFieldTable]
|
||||
[FormFieldQuery]
|
||||
[FormFieldEdit]
|
||||
public DateTime? DISTINGUISH_TIME { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 触发时间
|
||||
/// </summary>
|
||||
[Description("触发时间")]
|
||||
public DateTime? TRIGGER_TIME { get; set; }
|
||||
/// <summary>
|
||||
/// 截止时间
|
||||
/// </summary>
|
||||
[Description("截止时间")]
|
||||
public DateTime? END_TIME { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 识别状态 未识别 = 0,已识别 = 1,
|
||||
/// </summary>
|
||||
[Description("识别状态")]
|
||||
[EnumName("LRDistinguishEnum")]
|
||||
public LRDistinguishEnum DISTINGUISH_TYPE { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 识别部门ID
|
||||
/// </summary>
|
||||
[Description("识别部门")]
|
||||
[FormFieldTable]
|
||||
[FormFieldQuery]
|
||||
[FormFieldEdit]
|
||||
[DataFieldForeignKey("Nav_Department")]
|
||||
public Guid DEPARTMENT_ID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 导航属性:识别部门
|
||||
/// </summary>
|
||||
[Description("导航属性:识别部门")]
|
||||
public T_FM_DEPARTMENT Nav_Department { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 识别人员ID
|
||||
/// </summary>
|
||||
[Description("识别人员")]
|
||||
[FormFieldTable]
|
||||
[FormFieldQuery]
|
||||
[FormFieldEdit]
|
||||
[DataFieldForeignKey("Nav_User")]
|
||||
public Guid USER_ID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 导航属性:识别人员
|
||||
/// </summary>
|
||||
[Description("导航属性:识别人员")]
|
||||
public T_FM_USER Nav_User { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 导航:识别法律法规
|
||||
/// </summary>
|
||||
[Description("导航:识别法律法规")]
|
||||
[FormFieldEdit]
|
||||
public ICollection<T_LR_DEMAND_LAW> Nav_DemandLaw { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 导航:识别其他
|
||||
/// </summary>
|
||||
[Description("导航:识别其他")]
|
||||
[FormFieldEdit]
|
||||
public ICollection<T_LR_DEMAND_OTHER> Nav_DemandOther { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 导航:需求类别
|
||||
/// </summary>
|
||||
[Description("导航:需求类别")]
|
||||
[FormFieldEdit]
|
||||
public ICollection<T_LR_DEMAND_TYPE> Nav_DemandTypes { get; set; }
|
||||
/// <summary>
|
||||
/// 需求类别
|
||||
/// </summary>
|
||||
[Description("需求类别")]
|
||||
[DataFieldLength(200)]
|
||||
public string demandTypeStr { get; set; }
|
||||
[Description("是否发布")]
|
||||
[DataFieldIngore]
|
||||
public string PUBLISH { get; set; }
|
||||
[DataFieldIngore]
|
||||
public int IS_OVERTIME { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,42 +0,0 @@
|
||||
|
||||
using APT.Infrastructure.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace APT.MS.Domain.Entities.LR
|
||||
{
|
||||
/// <summary>
|
||||
/// 法律识别需求类别
|
||||
/// </summary>
|
||||
[Description("法律识别需求类别")]
|
||||
public class T_LR_DEMAND_TYPE : MesEntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 法律法规需求识别表
|
||||
/// </summary>
|
||||
[Description("法律法规需求识别表")]
|
||||
[DataFieldForeignKey("Nav_DemandDistinguish", "Nav_DemandTypes")]
|
||||
public Guid DISTINGUISH_ID { get; set; }
|
||||
/// <summary>
|
||||
/// 导航:法律法规需求识别表
|
||||
/// </summary>
|
||||
[Description("导航:法律法规需求识别表")]
|
||||
public T_LR_DEMAND_DISTINGUISH Nav_DemandDistinguish { get; set; }
|
||||
/// <summary>
|
||||
/// 需求类别表
|
||||
/// </summary>
|
||||
[Description("需求类别表")]
|
||||
[DataFieldForeignKey("Nav_DemandType")]
|
||||
[FormFieldEdit]
|
||||
public Guid DEMANDTYPE_ID { get; set; }
|
||||
/// <summary>
|
||||
/// 导航:需求类别表
|
||||
/// </summary>
|
||||
[Description("导航:需求类别表")]
|
||||
public T_LR_LAW_TYPE Nav_DemandType { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,49 +0,0 @@
|
||||
|
||||
using APT.Infrastructure.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace APT.MS.Domain.Entities.LR
|
||||
{
|
||||
/// <summary>
|
||||
/// 识别法律法规
|
||||
/// </summary>
|
||||
[Description("识别法律法规")]
|
||||
public class T_LR_DEMAND_LAW : MesEntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 法律法规需求识别表
|
||||
/// </summary>
|
||||
[Description("法律法规需求识别表")]
|
||||
[DataFieldForeignKey("Nav_DemandDistinguish","Nav_DemandLaw")]
|
||||
public Guid DISTINGUISH_ID { get; set; }
|
||||
/// <summary>
|
||||
/// 导航:法律法规需求识别表
|
||||
/// </summary>
|
||||
[Description("导航:法律法规需求识别表")]
|
||||
public T_LR_DEMAND_DISTINGUISH Nav_DemandDistinguish { get; set; }
|
||||
/// <summary>
|
||||
/// 法律法规表
|
||||
/// </summary>
|
||||
[Description("法律法规表")]
|
||||
[DataFieldForeignKey("Nav_Law")]
|
||||
[FormFieldEdit]
|
||||
public Guid LAW_ID { get; set; }
|
||||
/// <summary>
|
||||
/// 导航:法律法规表
|
||||
/// </summary>
|
||||
[Description("导航:法律法规表")]
|
||||
public T_LR_LAW Nav_Law { get; set; }
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[Description("备注")]
|
||||
[FormFieldEdit]
|
||||
[DataFieldLength(100)]
|
||||
public string REMARK { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,54 +0,0 @@
|
||||
using APT.Infrastructure.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace APT.MS.Domain.Entities.LR
|
||||
{
|
||||
/// <summary>
|
||||
/// 识别其他
|
||||
/// </summary>
|
||||
[Description("识别其他")]
|
||||
public class T_LR_DEMAND_OTHER : MesEntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 法律法规需求识别表
|
||||
/// </summary>
|
||||
[Description("法律法规需求识别表")]
|
||||
[DataFieldForeignKey("Nav_DemandDistinguish","Nav_DemandOther")]
|
||||
public Guid DISTINGUISH_ID { get; set; }
|
||||
/// <summary>
|
||||
/// 导航:法律法规需求识别表
|
||||
/// </summary>
|
||||
[Description("导航:法律法规需求识别表")]
|
||||
public T_LR_DEMAND_DISTINGUISH Nav_DemandDistinguish { get; set; }
|
||||
/// <summary>
|
||||
/// 其他识别表
|
||||
/// </summary>
|
||||
[Description("其他识别表")]
|
||||
[DataFieldForeignKey("Nav_OtherDistinguish")]
|
||||
[FormFieldEdit]
|
||||
public Guid OTHER_ID { get; set; }
|
||||
/// <summary>
|
||||
/// 导航:其他识别表
|
||||
/// </summary>
|
||||
[Description("导航:其他识别表")]
|
||||
public T_LR_OTHER_DISTINGUISH Nav_OtherDistinguish { get; set; }
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[Description("备注")]
|
||||
[FormFieldEdit]
|
||||
[DataFieldLength(200)]
|
||||
public string REMARK { get; set; }
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
[Description("名称")]
|
||||
[FormFieldEdit]
|
||||
public string NAME { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,88 +0,0 @@
|
||||
using APT.BaseData.Domain.Entities.FM;
|
||||
using APT.Infrastructure.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace APT.MS.Domain.Entities.LR
|
||||
{
|
||||
/// <summary>
|
||||
/// 法律法规需求分析表
|
||||
/// </summary>
|
||||
[Description("法律法规需求分析表")]
|
||||
public class T_LR_DEMAND_DISTINGUISH_REPORT : MesEntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 统计年份
|
||||
/// </summary>
|
||||
[Description("统计年份")]
|
||||
[FormFieldTable]
|
||||
[FormFieldQuery]
|
||||
[FormFieldEdit]
|
||||
public int YEARS { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 统计时间
|
||||
/// </summary>
|
||||
[Description("统计时间")]
|
||||
[FormFieldTable]
|
||||
[FormFieldQuery]
|
||||
[FormFieldEdit]
|
||||
public DateTime REPORT_TIME { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 调查份数
|
||||
/// </summary>
|
||||
[Description("调查份数")]
|
||||
[FormFieldTable]
|
||||
[FormFieldEdit]
|
||||
public int INVESTIGATE_TIMES { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 反馈份数
|
||||
/// </summary>
|
||||
[Description("反馈份数")]
|
||||
[FormFieldTable]
|
||||
[FormFieldEdit]
|
||||
public int FEEDBACK_TIMES { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 反馈比例
|
||||
/// </summary>
|
||||
[Description("反馈比例")]
|
||||
[FormFieldTable]
|
||||
[FormFieldEdit]
|
||||
public string FEEDBACK_RATE { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 统计部门ID
|
||||
/// </summary>
|
||||
[Description("统计部门")]
|
||||
[DataFieldForeignKey("Nav_Department")]
|
||||
[FormFieldTable]
|
||||
[FormFieldQuery]
|
||||
[FormFieldEdit]
|
||||
public Guid DEPARTMENT_ID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 导航属性:识别部门
|
||||
/// </summary>
|
||||
[Description("导航属性:识别部门")]
|
||||
public T_FM_DEPARTMENT Nav_Department { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 导航:识别报表明细
|
||||
/// </summary>
|
||||
[Description("导航:识别报表明细")]
|
||||
[FormFieldEdit]
|
||||
public ICollection<T_LR_DEMAND_DISTINGUISH_REPORT_DETAIL> Nav_DemandReportDetail { get; set; }
|
||||
[Description("是否发布")]
|
||||
[DataFieldIngore]
|
||||
public string PUBLISH { get; set; }
|
||||
[DataFieldIngore]
|
||||
public int IS_OVERTIME { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,58 +0,0 @@
|
||||
using APT.Infrastructure.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace APT.MS.Domain.Entities.LR
|
||||
{
|
||||
/// <summary>
|
||||
/// 导航:识别报表明细
|
||||
/// </summary>
|
||||
[Description("导航:识别报表明细")]
|
||||
public class T_LR_DEMAND_DISTINGUISH_REPORT_DETAIL : MesEntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 识别报表
|
||||
/// </summary>
|
||||
[Description("识别报表")]
|
||||
[DataFieldForeignKey("Nav_DemandReport","Nav_DemandReportDetail")]
|
||||
public Guid? REPORT_ID { get; set; }
|
||||
/// <summary>
|
||||
/// 导航:识别报表
|
||||
/// </summary>
|
||||
[Description("导航:识别报表")]
|
||||
public T_LR_DEMAND_DISTINGUISH_REPORT Nav_DemandReport { get; set; }
|
||||
/// <summary>
|
||||
/// 需求法律法规
|
||||
/// </summary>
|
||||
[Description("需求法律法规")]
|
||||
[FormFieldEdit]
|
||||
public string DEMAND_NAME { get; set; }
|
||||
/// <summary>
|
||||
/// 需求人数
|
||||
/// </summary>
|
||||
[Description("需求人数")]
|
||||
[FormFieldEdit]
|
||||
public int DEMAND_TIMES { get; set; }
|
||||
/// <summary>
|
||||
/// 提出人
|
||||
/// </summary>
|
||||
[Description("提出人")]
|
||||
[FormFieldEdit]
|
||||
public string DEMAND_PERSON { get; set; }
|
||||
/// <summary>
|
||||
/// 需求部门
|
||||
/// </summary>
|
||||
[Description("需求部门")]
|
||||
[FormFieldEdit]
|
||||
public string DEMAND_DEPARTMENT { get; set; }
|
||||
/// <summary>
|
||||
/// 是否来自其他 0:否 1:是
|
||||
/// </summary>
|
||||
[Description("是否其他")]
|
||||
public int IS_OTHER { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,109 +0,0 @@
|
||||
using APT.BaseData.Domain.Entities.FM;
|
||||
using APT.BaseData.Domain.Enums.PF;
|
||||
using APT.Infrastructure.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace APT.MS.Domain.Entities.LR
|
||||
{
|
||||
/// <summary>
|
||||
/// 法律法规获取清单表
|
||||
/// </summary>
|
||||
[Description("法律法规获取清单表")]
|
||||
public class T_LR_LEGAL_LIST : MesEntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 编码
|
||||
/// </summary>
|
||||
[Description("编码")]
|
||||
public string CODE { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
[Description("名称")]
|
||||
public string NAME { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 年度
|
||||
/// </summary>
|
||||
[Description("年度")]
|
||||
[FormFieldTable]
|
||||
[FormFieldQuery]
|
||||
[FormFieldEdit]
|
||||
public int YEARS { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取状态
|
||||
/// </summary>
|
||||
[Description("获取状态")]
|
||||
[EnumName("PFStandardStatus")]
|
||||
public PFStandardStatus LEGAL_STATUS { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 发起时间
|
||||
/// </summary>
|
||||
[Description("发起时间")]
|
||||
[FormFieldTable]
|
||||
[FormFieldQuery]
|
||||
[FormFieldEdit]
|
||||
public DateTime DISTINGUISH_TIME { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 截止时间
|
||||
/// </summary>
|
||||
[Description("截止时间")]
|
||||
[FormFieldTable]
|
||||
[FormFieldQuery]
|
||||
[FormFieldEdit]
|
||||
public DateTime? LEGAL_END_TIME { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 发起部门ID
|
||||
/// </summary>
|
||||
[Description("发起部门")]
|
||||
[DataFieldForeignKey("Nav_Department")]
|
||||
[FormFieldTable]
|
||||
[FormFieldQuery]
|
||||
[FormFieldEdit]
|
||||
public Guid DEPARTMENT_ID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 导航属性:发起部门
|
||||
/// </summary>
|
||||
[Description("导航属性:发起部门")]
|
||||
public T_FM_DEPARTMENT Nav_Department { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 发起人员ID
|
||||
/// </summary>
|
||||
[Description("发起人员")]
|
||||
[DataFieldForeignKey("Nav_User")]
|
||||
[FormFieldTable]
|
||||
[FormFieldQuery]
|
||||
[FormFieldEdit]
|
||||
public Guid USER_ID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 导航属性:发起人员
|
||||
/// </summary>
|
||||
[Description("导航属性:发起人员")]
|
||||
public T_FM_USER Nav_User { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 导航属性:获取清单明细表
|
||||
/// </summary>
|
||||
[Description("导航属性:获取清单明细表")]
|
||||
[FormFieldEdit]
|
||||
public ICollection<T_LR_LEGAL_LIST_DETAIL> Nav_LegalListDetail { get; set; }
|
||||
[Description("是否发布")]
|
||||
[DataFieldIngore]
|
||||
public string PUBLISH { get; set; }
|
||||
[DataFieldIngore]
|
||||
public int IS_OVERTIME { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,114 +0,0 @@
|
||||
|
||||
|
||||
using APT.BaseData.Domain.Entities.FM;
|
||||
using APT.Infrastructure.Core;
|
||||
using APT.MS.Domain.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace APT.MS.Domain.Entities.LR
|
||||
{
|
||||
/// <summary>
|
||||
/// 导航属性:获取清单明细表
|
||||
/// </summary>
|
||||
[Description("导航属性:获取清单明细表")]
|
||||
public class T_LR_LEGAL_LIST_DETAIL : MesEntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 法律法规获取清单表
|
||||
/// </summary>
|
||||
[Description("法律法规获取清单表")]
|
||||
[DataFieldForeignKey("Nav_LegalList","Nav_LegalListDetail")]
|
||||
public Guid LEGAL_ID { get; set; }
|
||||
/// <summary>
|
||||
/// 导航:法律法规获取清单表
|
||||
/// </summary>
|
||||
[Description("导航:法律法规获取清单表")]
|
||||
public T_LR_LEGAL_LIST Nav_LegalList { get; set; }
|
||||
/// <summary>
|
||||
/// 需求描述
|
||||
/// </summary>
|
||||
[Description("需求描述")]
|
||||
[DataFieldForeignKey("Nav_OtherDistinguish")]
|
||||
[FormFieldEdit]
|
||||
public Guid OTHER_ID { get; set; }
|
||||
/// <summary>
|
||||
/// 导航:需求描述
|
||||
/// </summary>
|
||||
[Description("导航:需求描述")]
|
||||
public T_LR_OTHER_DISTINGUISH Nav_OtherDistinguish { get; set; }
|
||||
/// <summary>
|
||||
/// 文件类型
|
||||
/// </summary>
|
||||
[Description("文件类型")]
|
||||
[DataFieldForeignKey("Nav_DemandType")]
|
||||
[FormFieldEdit]
|
||||
public Guid? DEMANDTYPE_ID { get; set; }
|
||||
/// <summary>
|
||||
/// 导航:文件类型
|
||||
/// </summary>
|
||||
[Description("导航:文件类型")]
|
||||
public T_LR_LAW_TYPE Nav_DemandType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 文件名称
|
||||
/// </summary>
|
||||
[Description("文件名称")]
|
||||
[FormFieldEdit]
|
||||
public string FILE_NAME { get; set; }
|
||||
/// <summary>
|
||||
/// 文件在库状态 0:否;1:是.
|
||||
/// </summary>
|
||||
[Description("文件在库状态")]
|
||||
[EnumName("LRLegalFileStatusEnum")]
|
||||
[FormFieldEdit]
|
||||
public LRLegalFileStatusEnum FILE_STATUS { get; set; }
|
||||
/// <summary>
|
||||
/// 制修订日期
|
||||
/// </summary>
|
||||
[Description("制修订日期")]
|
||||
[FormFieldEdit]
|
||||
public DateTime UPDATE_TIME { get; set; }
|
||||
/// <summary>
|
||||
/// 施行日期
|
||||
/// </summary>
|
||||
[Description("施行日期")]
|
||||
[FormFieldEdit]
|
||||
public DateTime EXECUTE_TIME { get; set; }
|
||||
/// <summary>
|
||||
/// 标准号/发文字号
|
||||
/// </summary>
|
||||
[Description("标准号/发文字号")]
|
||||
[FormFieldEdit]
|
||||
public string VERSION_NUM { get; set; }
|
||||
/// <summary>
|
||||
/// 责任人员ID
|
||||
/// </summary>
|
||||
[Description("责任人员")]
|
||||
[DataFieldForeignKey("Nav_User")]
|
||||
[FormFieldEdit]
|
||||
public Guid? USER_ID { get; set; }
|
||||
/// <summary>
|
||||
/// 导航属性:责任人员
|
||||
/// </summary>
|
||||
[Description("导航属性:责任人员")]
|
||||
public T_FM_USER Nav_User { get; set; }
|
||||
/// <summary>
|
||||
/// 导航:需求人员
|
||||
/// </summary>
|
||||
[Description("需求人员")]
|
||||
public ICollection<T_LR_LEGAL_LIST_DETAIL_USER> Nav_LegalListDetailUser { get; set; }
|
||||
/// <summary>
|
||||
/// 导航:附件上传
|
||||
/// </summary>
|
||||
[Description("附件上传")]
|
||||
public ICollection<T_LR_LEGAL_LIST_DETAIL_FILE> Nav_Files { get; set; }
|
||||
[Description("是否发布")]
|
||||
[DataFieldIngore]
|
||||
public string PUBLISH { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,45 +0,0 @@
|
||||
using APT.BaseData.Domain.Entities.FM;
|
||||
using APT.Infrastructure.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace APT.MS.Domain.Entities.LR
|
||||
{
|
||||
/// <summary>
|
||||
/// 导航:需求人员
|
||||
/// </summary>
|
||||
[Description("导航:需求人员")]
|
||||
public class T_LR_LEGAL_LIST_DETAIL_USER : MesEntityBase
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 其他识别表
|
||||
/// </summary>
|
||||
[Description("其他识别表")]
|
||||
[DataFieldForeignKey("Nav_LegalListDetail", "Nav_LegalListDetailUser")]
|
||||
public Guid LEGAL_LIST_DETAIL { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 需求人员表
|
||||
/// </summary>
|
||||
[Description("需求人员表")]
|
||||
[DataFieldForeignKey("Nav_User")]
|
||||
public Guid USER_ID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 导航:其他识别表
|
||||
/// </summary>
|
||||
[Description("导航:其他识别表")]
|
||||
public T_LR_LEGAL_LIST_DETAIL Nav_LegalListDetail { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 导航:需求人员表
|
||||
/// </summary>
|
||||
[Description("导航:需求人员表")]
|
||||
public T_FM_USER Nav_User { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,39 +0,0 @@
|
||||
using APT.BaseData.Domain.Entities;
|
||||
using APT.Infrastructure.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace APT.MS.Domain.Entities.LR
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取清单附件
|
||||
/// </summary>
|
||||
[Description("获取清单附件")]
|
||||
public class T_LR_LEGAL_LIST_DETAIL_FILE : MesEntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 其他识别表
|
||||
/// </summary>
|
||||
[Description("其他识别表")]
|
||||
[DataFieldForeignKey("Nav_LegalListDetail", "Nav_Files")]
|
||||
public Guid LEGAL_LIST_DETAIL { get; set; }
|
||||
/// <summary>
|
||||
/// 导航:其他识别表
|
||||
/// </summary>
|
||||
[Description("导航:其他识别表")]
|
||||
public T_LR_LEGAL_LIST_DETAIL Nav_LegalListDetail { get; set; }
|
||||
/// 文件ID
|
||||
/// </summary>
|
||||
[Description("文件ID")]
|
||||
[DataFieldForeignKey("Nav_ImgFile")]
|
||||
public Guid IMG_FILE_ID { get; set; }
|
||||
/// 文件
|
||||
/// </summary>
|
||||
[Description("文件")]
|
||||
public T_PF_IMG_FILE Nav_ImgFile { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,54 +0,0 @@
|
||||
using APT.BaseData.Domain.Enums.PF;
|
||||
using APT.Infrastructure.Core;
|
||||
using APT.MS.Domain.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace APT.MS.Domain.Entities.LR
|
||||
{
|
||||
/// <summary>
|
||||
/// 法律法规融入表
|
||||
/// </summary>
|
||||
[Description("法律法规融入表")]
|
||||
public class T_LR_LAW_INTEGRATE : MesEntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 年份
|
||||
/// </summary>
|
||||
[Description("年份")]
|
||||
[FormFieldTable]
|
||||
[FormFieldQuery]
|
||||
[FormFieldEdit]
|
||||
public int YEAR { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 融入比例
|
||||
/// </summary>
|
||||
[Description("融入比例")]
|
||||
[FormFieldTable]
|
||||
[FormFieldEdit]
|
||||
public string RATE { get; set; }
|
||||
/// <summary>
|
||||
/// 状态
|
||||
/// </summary>
|
||||
[Description("状态")]
|
||||
[EnumName("PFStandardStatus")]
|
||||
[FormFieldTable]
|
||||
[FormFieldQuery]
|
||||
[FormFieldEdit]
|
||||
public PFStandardStatus STATUS { get; set; }
|
||||
/// <summary>
|
||||
/// 导航:法律法规融入明细表
|
||||
/// </summary>
|
||||
[Description("导航:法律法规融入明细表")]
|
||||
[FormFieldEdit]
|
||||
public ICollection<T_LR_LAW_INTEGRATE_DETAIL> Nav_IntegrateDetail { get; set; }
|
||||
[Description("是否发布")]
|
||||
[DataFieldIngore]
|
||||
public string PUBLISH { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,55 +0,0 @@
|
||||
using APT.Infrastructure.Core;
|
||||
using APT.MS.Domain.Entities.SC;
|
||||
using APT.MS.Domain.Entities.SC.SC;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace APT.MS.Domain.Entities.LR
|
||||
{
|
||||
/// <summary>
|
||||
/// 导航:法律法规融入明细表
|
||||
/// </summary>
|
||||
[Description("导航:法律法规融入明细表")]
|
||||
public class T_LR_LAW_INTEGRATE_DETAIL : MesEntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 法律法规融入
|
||||
/// </summary>
|
||||
[Description("法律法规融入")]
|
||||
[DataFieldForeignKey("Nav_LawIntegrate", "Nav_IntegrateDetail")]
|
||||
public Guid? LAW_INTEGRATE_ID { get; set; }
|
||||
/// <summary>
|
||||
/// 导航:法律法规融入表
|
||||
/// </summary>
|
||||
[Description("导航:法律法规融入表")]
|
||||
public T_LR_LAW_INTEGRATE Nav_LawIntegrate { get; set; }
|
||||
/// <summary>
|
||||
/// 法律法规
|
||||
/// </summary>
|
||||
[Description("法律法规")]
|
||||
[DataFieldForeignKey("Nav_Law")]
|
||||
[FormFieldEdit]
|
||||
public Guid LAW_ID { get; set; }
|
||||
/// <summary>
|
||||
/// 导航:法律法规表
|
||||
/// </summary>
|
||||
[Description("导航:法律法规表")]
|
||||
public T_LR_LAW Nav_Law { get; set; }
|
||||
/// <summary>
|
||||
/// 企业规章制度
|
||||
/// </summary>
|
||||
[Description("企业规章制度")]
|
||||
[DataFieldForeignKey("Nav_SCSystem")]
|
||||
[FormFieldEdit]
|
||||
public Guid? SYSTEM_ID { get; set; }
|
||||
/// <summary>
|
||||
/// 导航:企业规章制度表
|
||||
/// </summary>
|
||||
[Description("导航:企业规章制度表")]
|
||||
public T_SC_STANDARD_CREATE Nav_SCSystem { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,46 +0,0 @@
|
||||
|
||||
using APT.Infrastructure.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace APT.MS.Domain.Entities.LR
|
||||
{
|
||||
/// <summary>
|
||||
/// 法律法规更新与融入表
|
||||
/// </summary>
|
||||
[Description("法律法规更新与融入表")]
|
||||
public class T_LR_LAW_INTEGRATE_UPDATE : MesEntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 年份
|
||||
/// </summary>
|
||||
[Description("年份")]
|
||||
[FormFieldTable]
|
||||
[FormFieldQuery]
|
||||
[FormFieldEdit]
|
||||
public DateTime YEAR { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 融入比例
|
||||
/// </summary>
|
||||
[Description("融入比例")]
|
||||
[FormFieldTable]
|
||||
[FormFieldQuery]
|
||||
[FormFieldEdit]
|
||||
public string RATE { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 导航:法律法规更新与融入明细表
|
||||
/// </summary>
|
||||
[Description("导航:法律法规更新与融入明细表")]
|
||||
[FormFieldEdit]
|
||||
public ICollection<T_LR_LAW_INTEGRATE_UPDATE_DETAIL> Nav_IntegrateUpdateDetail { get; set; }
|
||||
[Description("是否发布")]
|
||||
[DataFieldIngore]
|
||||
public string PUBLISH { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,56 +0,0 @@
|
||||
|
||||
using APT.Infrastructure.Core;
|
||||
using APT.MS.Domain.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace APT.MS.Domain.Entities.LR
|
||||
{
|
||||
/// <summary>
|
||||
/// 导航:法律法规更新与融入明细表
|
||||
/// </summary>
|
||||
[Description("导航:法律法规更新与融入明细表")]
|
||||
public class T_LR_LAW_INTEGRATE_UPDATE_DETAIL : MesEntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 法律法规更新与融入
|
||||
/// </summary>
|
||||
[Description("法律法规更新与融入")]
|
||||
[DataFieldForeignKey("Nav_LawIntegrateUpdate","Nav_IntegrateUpdateDetail")]
|
||||
public Guid INTEGRATE_UPDATE_ID { get; set; }
|
||||
/// <summary>
|
||||
/// 导航:法律法规更新与融入表
|
||||
/// </summary>
|
||||
[Description("导航:法律法规更新与融入表")]
|
||||
public T_LR_LAW_INTEGRATE_UPDATE Nav_LawIntegrateUpdate { get; set; }
|
||||
/// <summary>
|
||||
/// 法律法规
|
||||
/// </summary>
|
||||
[Description("法律法规")]
|
||||
[DataFieldForeignKey("Nav_Law")]
|
||||
[FormFieldEdit]
|
||||
public Guid LAW_ID { get; set; }
|
||||
/// <summary>
|
||||
/// 导航:法律法规表
|
||||
/// </summary>
|
||||
[Description("导航:法律法规表")]
|
||||
public T_LR_LAW Nav_Law { get; set; }
|
||||
/// <summary>
|
||||
/// 导航:关联标准化制度库
|
||||
/// </summary>
|
||||
[Description("导航:关联标准化制度库")]
|
||||
public ICollection<T_LR_LAW_INSTITUTION> Nav_LRLawInstitution { get; set; }
|
||||
/// <summary>
|
||||
/// 法律法规更新与融入更新状态 0:未更新;1:已更新;2:无需更新;
|
||||
/// </summary>
|
||||
[Description("法律法规更新与融入更新状态")]
|
||||
[EnumName("LRLawIntegrateUpdateStatusEnum")]
|
||||
public LRLawIntegrateUpdateStatusEnum UPDATE_STATUS { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,105 +0,0 @@
|
||||
using APT.BaseData.Domain.Entities.FM;
|
||||
using APT.BaseData.Domain.Enums;
|
||||
using APT.Infrastructure.Core;
|
||||
using APT.MS.Domain.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
namespace APT.MS.Domain.Entities.LR
|
||||
{
|
||||
/// <summary>
|
||||
/// 法律法规
|
||||
/// </summary>
|
||||
[Description("法律法规")]
|
||||
public class T_LR_LAW : MesEntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 类型编号
|
||||
/// </summary>
|
||||
[Description("类型编号")]
|
||||
public string CODE { get; set; }
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
[Description("名称")]
|
||||
[DataFieldIndex(true)]
|
||||
[FormFieldTable]
|
||||
[FormFieldQuery]
|
||||
[FormFieldEdit]
|
||||
[DataFieldLength(200)]
|
||||
public string NAME { get; set; }
|
||||
/// <summary>
|
||||
/// 版本号
|
||||
/// </summary>
|
||||
[Description("版本号")]
|
||||
[FormFieldTable]
|
||||
[FormFieldQuery]
|
||||
[FormFieldEdit]
|
||||
[DataFieldLength(500)]
|
||||
public string VERSION_NUM { get; set; }
|
||||
/// <summary>
|
||||
/// 状态 0:废止;1:现行;
|
||||
/// </summary>
|
||||
[Description("状态")]
|
||||
[EnumName("BSLawStatusEnum")]
|
||||
[FormFieldTable]
|
||||
[FormFieldQuery]
|
||||
[FormFieldEdit]
|
||||
public BSLawStatusEnum LAW_STATUS { get; set; }
|
||||
/// <summary>
|
||||
/// 制修订日期
|
||||
/// </summary>
|
||||
[Description("制修订日期")]
|
||||
[FormFieldTable]
|
||||
[FormFieldQuery]
|
||||
[FormFieldEdit]
|
||||
public DateTime UPDATE_TIME { get; set; }
|
||||
/// <summary>
|
||||
/// 需求类别
|
||||
/// </summary>
|
||||
[Description("需求类别")]
|
||||
[FormFieldEdit]
|
||||
[DataFieldForeignKey("Nav_LawType")]
|
||||
public Guid TYPE_ID { get; set; }
|
||||
/// <summary>
|
||||
/// 需求类别
|
||||
/// </summary>
|
||||
[Description("需求类别")]
|
||||
public T_LR_LAW_TYPE Nav_LawType { get; set; }
|
||||
/// <summary>
|
||||
/// 编制单位
|
||||
/// </summary>
|
||||
[Description("编制单位")]
|
||||
public string PREPARED_DEPARTMENT { get; set; }
|
||||
/// <summary>
|
||||
/// 融入人员
|
||||
/// </summary>
|
||||
[Description("融入人员")]
|
||||
[FormFieldTable]
|
||||
[FormFieldQuery]
|
||||
[FormFieldEdit]
|
||||
[DataFieldForeignKey("Nav_User")]
|
||||
public Guid USER_ID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 导航属性:识别人员
|
||||
/// </summary>
|
||||
[Description("导航属性:融入人员")]
|
||||
public T_FM_USER Nav_User { get; set; }
|
||||
/// <summary>
|
||||
/// 导航:版本号
|
||||
/// </summary>
|
||||
[Description("版本号")]
|
||||
[FormFieldEdit]
|
||||
public ICollection<T_LR_LAW_VERSION> Nav_LawVersion { get; set; }
|
||||
/// <summary>
|
||||
/// 导航:关联标准化制度库
|
||||
/// </summary>
|
||||
[Description("标准化制度")]
|
||||
[FormFieldEdit]
|
||||
public ICollection<T_LR_LAW_SC_SYSTEM> Nav_LawSCSystem { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,66 +0,0 @@
|
||||
using APT.Infrastructure.Core;
|
||||
using APT.MS.Domain.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace APT.MS.Domain.Entities.LR
|
||||
{
|
||||
/// <summary>
|
||||
/// 导航:版本号
|
||||
/// </summary>
|
||||
[Description("导航:版本号")]
|
||||
public class T_LR_LAW_VERSION : MesEntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 法律法规表
|
||||
/// </summary>
|
||||
[Description("法律法规表")]
|
||||
[DataFieldForeignKey("Nav_Law","Nav_LawVersion")]
|
||||
public Guid LAW_ID { get; set; }
|
||||
/// <summary>
|
||||
/// 导航:法律法规表
|
||||
/// </summary>
|
||||
[Description("导航:法律法规")]
|
||||
public T_LR_LAW Nav_Law { get; set; }
|
||||
/// <summary>
|
||||
/// 标准号/发文字号
|
||||
/// </summary>
|
||||
[Description("标准号/发文字号")]
|
||||
[FormFieldEdit]
|
||||
public string VERSION_NUM { get; set; }
|
||||
/// <summary>
|
||||
/// 制修订日期
|
||||
/// </summary>
|
||||
[Description("制修订日期")]
|
||||
[FormFieldEdit]
|
||||
public DateTime UPDATE_TIME { get; set; }
|
||||
/// <summary>
|
||||
/// 施行日期
|
||||
/// </summary>
|
||||
[Description("施行日期")]
|
||||
[FormFieldEdit]
|
||||
public DateTime EXECUTE_TIME { get; set; }
|
||||
/// <summary>
|
||||
/// 入库时间
|
||||
/// </summary>
|
||||
[Description("入库时间")]
|
||||
[FormFieldEdit]
|
||||
public DateTime ENTER_TIME { get; set; }
|
||||
/// <summary>
|
||||
/// 状态 0:废止;1:现行;
|
||||
/// </summary>
|
||||
[Description("状态")]
|
||||
[EnumName("BSLawStatusEnum")]
|
||||
[FormFieldEdit]
|
||||
public BSLawStatusEnum VERSION_STATUS { get; set; }
|
||||
/// <summary>
|
||||
/// 附件
|
||||
/// </summary>
|
||||
[Description("附件")]
|
||||
public List<T_LR_LAW_VERSION_FILE> Nav_Files { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,39 +0,0 @@
|
||||
using APT.BaseData.Domain.Entities;
|
||||
using APT.Infrastructure.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace APT.MS.Domain.Entities.LR
|
||||
{
|
||||
/// <summary>
|
||||
/// 法律法规附件
|
||||
/// </summary>
|
||||
[Description("法律法规附件")]
|
||||
public class T_LR_LAW_VERSION_FILE : MesEntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 版本ID
|
||||
/// </summary>
|
||||
[Description("版本ID")]
|
||||
[DataFieldForeignKey("Nav_Version","Nav_Files")]
|
||||
public Guid VERSION_ID { get; set; }
|
||||
/// 版本
|
||||
/// </summary>
|
||||
[Description("版本")]
|
||||
public T_LR_LAW_VERSION Nav_Version { get; set; }
|
||||
/// 文件ID
|
||||
/// </summary>
|
||||
[Description("文件ID")]
|
||||
[DataFieldForeignKey("Nav_ImgFile")]
|
||||
public Guid IMG_FILE_ID { get; set; }
|
||||
/// 文件
|
||||
/// </summary>
|
||||
[Description("文件")]
|
||||
public T_PF_IMG_FILE Nav_ImgFile { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,45 +0,0 @@
|
||||
using APT.Infrastructure.Core;
|
||||
using APT.MS.Domain.Entities.SC;
|
||||
using APT.MS.Domain.Entities.SC.SC;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace APT.MS.Domain.Entities.LR
|
||||
{
|
||||
/// <summary>
|
||||
/// 导航:关联标准化制度库
|
||||
/// </summary>
|
||||
[Description("导航:关联标准化制度库")]
|
||||
public class T_LR_LAW_SC_SYSTEM : MesEntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 法律法规表
|
||||
/// </summary>
|
||||
[Description("法律法规表")]
|
||||
[DataFieldForeignKey("Nav_Law","Nav_LawSCSystem")]
|
||||
public Guid LAW_ID { get; set; }
|
||||
/// <summary>
|
||||
/// 导航:法律法规表
|
||||
/// </summary>
|
||||
[Description("导航:法律法规")]
|
||||
public T_LR_LAW Nav_Law { get; set; }
|
||||
/// <summary>
|
||||
/// 标准化制度
|
||||
/// </summary>
|
||||
[Description("标准化制度")]
|
||||
[DataFieldForeignKey("Nav_SCSystem")]
|
||||
[FormFieldEdit]
|
||||
public Guid SC_SYSTEM_ID { get; set; }
|
||||
/// <summary>
|
||||
/// 导航:标准化制度
|
||||
/// </summary>
|
||||
[Description("导航:标准化制度")]
|
||||
public T_SC_STANDARD_CREATE Nav_SCSystem { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,24 +0,0 @@
|
||||
using APT.Infrastructure.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace APT.MS.Domain.Entities.LR
|
||||
{
|
||||
/// <summary>
|
||||
/// 法律法规知识类别
|
||||
/// </summary>
|
||||
[Description("法律法规知识类别")]
|
||||
public class T_LR_LAW_TYPE : MesEntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 类型名称
|
||||
/// </summary>
|
||||
[Description("类型名称")]
|
||||
[DataFieldIndex(true)]
|
||||
public string NAME { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,45 +0,0 @@
|
||||
using APT.BaseData.Domain.Entities.FM;
|
||||
using APT.Infrastructure.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace APT.MS.Domain.Entities.LR
|
||||
{
|
||||
/// <summary>
|
||||
/// 导航:需求人员
|
||||
/// </summary>
|
||||
[Description("导航:需求人员")]
|
||||
public class T_LR_DEMAND_USER : MesEntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 其他识别表
|
||||
/// </summary>
|
||||
[Description("其他识别表")]
|
||||
[DataFieldForeignKey("Nav_OtherDistinguish", "Nav_DemandUser")]
|
||||
public Guid OTHER_ID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 需求人员表
|
||||
/// </summary>
|
||||
[Description("需求人员表")]
|
||||
[DataFieldForeignKey("Nav_User")]
|
||||
[FormFieldEdit]
|
||||
public Guid USER_ID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 导航:其他识别表
|
||||
/// </summary>
|
||||
[Description("导航:其他识别表")]
|
||||
public T_LR_OTHER_DISTINGUISH Nav_OtherDistinguish { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 导航:需求人员表
|
||||
/// </summary>
|
||||
[Description("导航:需求人员表")]
|
||||
public T_FM_USER Nav_User { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,53 +0,0 @@
|
||||
|
||||
using APT.Infrastructure.Core;
|
||||
using APT.MS.Domain.Entities.SC;
|
||||
using APT.MS.Domain.Entities.SC.SC;
|
||||
using APT.MS.Domain.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace APT.MS.Domain.Entities.LR
|
||||
{
|
||||
/// <summary>
|
||||
/// 导航:法律法规更新与融入制度文件
|
||||
/// </summary>
|
||||
[Description("导航:法律法规更新与融入明细制度文件")]
|
||||
public class T_LR_LAW_INSTITUTION : MesEntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 法律法规更新与融入明细表
|
||||
/// </summary>
|
||||
[Description("法律法规更新与融入明细表")]
|
||||
[DataFieldForeignKey("Nav_LawIntegrateUpdateDetail", "Nav_LRLawInstitution")]
|
||||
public Guid UPDATE_DETAIL_ID { get; set; }
|
||||
/// <summary>
|
||||
/// 导航:法律法规更新与融入明细表
|
||||
/// </summary>
|
||||
[Description("导航:法律法规更新与融入明细表")]
|
||||
public T_LR_LAW_INTEGRATE_UPDATE_DETAIL Nav_LawIntegrateUpdateDetail { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 标准化制度
|
||||
/// </summary>
|
||||
[Description("标准化制度")]
|
||||
[DataFieldForeignKey("Nav_SCSystem")]
|
||||
public Guid? SC_SYSTEM_ID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 导航:标准化制度
|
||||
/// </summary>
|
||||
[Description("导航:标准化制度")]
|
||||
public T_SC_STANDARD_CREATE Nav_SCSystem { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 法律法规更新与融入更新状态 0:未更新;1:已更新;2:无需更新;
|
||||
/// </summary>
|
||||
[Description("法律法规更新与融入更新状态")]
|
||||
[EnumName("LRLawIntegrateUpdateStatusEnum")]
|
||||
public LRLawIntegrateUpdateStatusEnum UPDATE_STATUS { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,43 +0,0 @@
|
||||
|
||||
using APT.Infrastructure.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace APT.MS.Domain.Entities.LR
|
||||
{
|
||||
/// <summary>
|
||||
/// 导航:法律法规更新与融入表
|
||||
/// </summary>
|
||||
[Description("导航:法律法规更新与融入表")]
|
||||
public class T_LR_LAW_UPDATE : MesEntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 法律法规表
|
||||
/// </summary>
|
||||
[Description("法律法规表")]
|
||||
[DataFieldForeignKey("Nav_Law")]
|
||||
public Guid LAW_ID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 法律法规更新与融入明细表
|
||||
/// </summary>
|
||||
//[Description("法律法规更新与融入明细表")]
|
||||
//public Guid UPDATE_DETAIL_ID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 导航:法律法规表
|
||||
/// </summary>
|
||||
[Description("导航:法律法规表")]
|
||||
public T_LR_LAW Nav_Law { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 导航:法律法规更新与融入明细表
|
||||
/// </summary>
|
||||
//[Description("导航:法律法规更新与融入明细表")]
|
||||
//public T_LR_LAW_INTEGRATE_UPDATE_DETAIL Nav_UpdateDetail { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,41 +0,0 @@
|
||||
using APT.BaseData.Domain.Enums;
|
||||
using APT.Infrastructure.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace APT.MS.Domain.Entities.LR
|
||||
{
|
||||
/// <summary>
|
||||
/// 法律法规识别其他表
|
||||
/// </summary>
|
||||
[Description("法律法规识别其他表")]
|
||||
public class T_LR_OTHER_DISTINGUISH : MesEntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 类型编号
|
||||
/// </summary>
|
||||
[Description("类型编号")]
|
||||
public string CODE { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 类型名称
|
||||
/// </summary>
|
||||
[Description("类型名称")]
|
||||
[FormFieldEdit]
|
||||
[FormFieldQuery]
|
||||
[FormFieldTable]
|
||||
[DataFieldLength(100)]
|
||||
public string NAME { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 导航:需求人员
|
||||
/// </summary>
|
||||
[Description("导航:需求人员")]
|
||||
[FormFieldEdit]
|
||||
public ICollection<T_LR_DEMAND_USER> Nav_DemandUser { get; set; }
|
||||
}
|
||||
}
|
||||
@ -8,7 +8,7 @@
|
||||
"ASPNETCORE_ENVIRONMENT": "Test"
|
||||
},
|
||||
"nativeDebugging": true,
|
||||
"applicationUrl": "http://localhost:3101"
|
||||
"applicationUrl": "http://localhost:7101"
|
||||
},
|
||||
"Docker": {
|
||||
"commandName": "Docker",
|
||||
|
||||
@ -10,7 +10,6 @@ using APT.Migrations;
|
||||
using APT.MS.Domain.ApiModel.BS;
|
||||
using APT.MS.Domain.Entities.BS;
|
||||
using APT.MS.Domain.Entities.HM;
|
||||
using APT.MS.Domain.Entities.LR;
|
||||
using APT.MS.Domain.Entities.SC.SC;
|
||||
using APT.MS.Domain.Enums;
|
||||
using APT.Utility;
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
"ASPNETCORE_ENVIRONMENT": "Test"
|
||||
},
|
||||
"nativeDebugging": true,
|
||||
"applicationUrl": "http://localhost:3178"
|
||||
"applicationUrl": "http://localhost:7178"
|
||||
},
|
||||
"Docker": {
|
||||
"commandName": "Docker",
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
"ASPNETCORE_ENVIRONMENT": "Test"
|
||||
},
|
||||
"nativeDebugging": false,
|
||||
"applicationUrl": "http://localhost:3107"
|
||||
"applicationUrl": "http://localhost:7107"
|
||||
},
|
||||
"Docker": {
|
||||
"commandName": "Docker",
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Test"
|
||||
},
|
||||
"applicationUrl": "http://localhost:3119",
|
||||
"applicationUrl": "http://localhost:7119",
|
||||
"nativeDebugging": false
|
||||
},
|
||||
"Docker": {
|
||||
|
||||
@ -4,7 +4,6 @@ using APT.BaseData.Domain.Entities.FM;
|
||||
using APT.BaseData.Domain.Enums;
|
||||
using APT.Infrastructure.Core;
|
||||
using APT.MS.Domain.Entities.HM;
|
||||
using APT.MS.Domain.Entities.LR;
|
||||
using APT.MS.Domain.Entities.PF;
|
||||
using APT.MS.Domain.Enums;
|
||||
using APT.Utility;
|
||||
|
||||
@ -6,7 +6,7 @@ using APT.BaseData.Domain.IServices.FM;
|
||||
using APT.Infrastructure.Core;
|
||||
using APT.MS.Domain.Entities.BS;
|
||||
using APT.MS.Domain.Entities.HM;
|
||||
using APT.MS.Domain.Entities.LR;
|
||||
|
||||
using APT.MS.Domain.Enums;
|
||||
using APT.Utility;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
"ASPNETCORE_ENVIRONMENT": "Test"
|
||||
},
|
||||
"nativeDebugging": true,
|
||||
"applicationUrl": "http://localhost:3117"
|
||||
"applicationUrl": "http://localhost:7117"
|
||||
},
|
||||
"Docker": {
|
||||
"commandName": "Docker",
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
"ASPNETCORE_ENVIRONMENT": "Test"
|
||||
},
|
||||
"nativeDebugging": false,
|
||||
"applicationUrl": "http://localhost:3109"
|
||||
"applicationUrl": "http://localhost:7109"
|
||||
},
|
||||
"Docker": {
|
||||
"commandName": "Docker",
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
"ASPNETCORE_ENVIRONMENT": "Test"
|
||||
},
|
||||
"nativeDebugging": false,
|
||||
"applicationUrl": "http://localhost:3111"
|
||||
"applicationUrl": "http://localhost:7111"
|
||||
},
|
||||
"Docker": {
|
||||
"commandName": "Docker",
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
"ASPNETCORE_ENVIRONMENT": "Test"
|
||||
},
|
||||
"nativeDebugging": false,
|
||||
"applicationUrl": "http://localhost:3116"
|
||||
"applicationUrl": "http://localhost:7116"
|
||||
},
|
||||
"Docker": {
|
||||
"commandName": "Docker",
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
"ASPNETCORE_ENVIRONMENT": "Test"
|
||||
},
|
||||
"nativeDebugging": false,
|
||||
"applicationUrl": "http://localhost:3112"
|
||||
"applicationUrl": "http://localhost:7112"
|
||||
},
|
||||
"Docker": {
|
||||
"commandName": "Docker",
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
"isSqlLog": "false",
|
||||
"IdentityServer": "http://172.21.157.142:3153/",
|
||||
"WebSocketPort": "3140",
|
||||
"ConnApiUrl": "http://localhost:3116/api/OP/TenantInfo/GetDbConn",
|
||||
"AllConnApiUrl": "http://localhost:3116/api/OP/TenantInfo/GetAllDbConn",
|
||||
"ConnApiUrl": "http://localhost:7116/api/OP/TenantInfo/GetDbConn",
|
||||
"AllConnApiUrl": "http://localhost:7116/api/OP/TenantInfo/GetAllDbConn",
|
||||
"ConnDataKey": "MHKSAQ1212010101",
|
||||
"TenantConnKey": "MHSMS",
|
||||
"RedisFormConfig": "false",
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
"isSqlLog": "false",
|
||||
"IdentityServer": "http://120.25.146.51:3153/",
|
||||
"WebSocketPort": "3140",
|
||||
"ConnApiUrl": "http://localhost:3116/api/OP/TenantInfo/GetDbConn",
|
||||
"AllConnApiUrl": "http://localhost:3116/api/OP/TenantInfo/GetAllDbConn",
|
||||
"ConnApiUrl": "http://localhost:7116/api/OP/TenantInfo/GetDbConn",
|
||||
"AllConnApiUrl": "http://localhost:7116/api/OP/TenantInfo/GetAllDbConn",
|
||||
"ConnDataKey": "MHKSAQ1212010101",
|
||||
"TenantConnKey": "PDEV1212",
|
||||
"RedisFormConfig": "true",
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
"isSqlLog": "false",
|
||||
"IdentityServer": "http://172.26.13.0:3153/",
|
||||
"WebSocketPort": "3140",
|
||||
"ConnApiUrl": "http://172.26.13.0:3116/api/OP/TenantInfo/GetDbConn",
|
||||
"AllConnApiUrl": "http://172.26.13.0:3116/api/OP/TenantInfo/GetAllDbConn",
|
||||
"ConnApiUrl": "http://172.26.13.0:7116/api/OP/TenantInfo/GetDbConn",
|
||||
"AllConnApiUrl": "http://172.26.13.0:7116/api/OP/TenantInfo/GetAllDbConn",
|
||||
"ConnDataKey": "MHKSAQ1212010101",
|
||||
"TenantConnKey": "MHSMS",
|
||||
"RedisFormConfig": "true",
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
"isSqlLog": "false",
|
||||
"IdentityServer": "http://47.122.43.22:3153/",
|
||||
"WebSocketPort": "3140",
|
||||
"ConnApiUrl": "http://localhost:3116/api/OP/TenantInfo/GetDbConn",
|
||||
"AllConnApiUrl": "http://localhost:3116/api/OP/TenantInfo/GetAllDbConn",
|
||||
"ConnApiUrl": "http://localhost:7116/api/OP/TenantInfo/GetDbConn",
|
||||
"AllConnApiUrl": "http://localhost:7116/api/OP/TenantInfo/GetAllDbConn",
|
||||
"ConnDataKey": "MHKSAQ1212010101",
|
||||
"TenantConnKey": "MHSMS",
|
||||
"RedisFormConfig": "false",
|
||||
|
||||
@ -20,7 +20,7 @@ using System.Runtime.Intrinsics.Arm;
|
||||
using NPOI.SS.Formula.Atp;
|
||||
using NPOI.Util;
|
||||
using APT.BaseData.Services.Services.FM;
|
||||
using APT.MS.Domain.Entities.LR;
|
||||
|
||||
using InfluxData.Net.InfluxDb.Models.Responses;
|
||||
using System.Threading.Tasks;
|
||||
using log4net.Core;
|
||||
@ -74,12 +74,6 @@ namespace APT.PP.WebApi.Controllers.Api.PP
|
||||
//换证培训触发
|
||||
CreateRenewalTrain(filter);
|
||||
#endregion
|
||||
#region LR法律法规
|
||||
//触发需求识别
|
||||
NoticeStartDemandDistinguish(filter);
|
||||
//通知安环部负责人安全生产法律法规更新与融入
|
||||
NoticeLRLawIntegrateUpdate(filter);
|
||||
#endregion
|
||||
return true;
|
||||
});
|
||||
}
|
||||
@ -102,10 +96,6 @@ namespace APT.PP.WebApi.Controllers.Api.PP
|
||||
//培训需求调查结束汇总
|
||||
CheckTrainSuveyFinishByDepartment(filter);
|
||||
#endregion
|
||||
#region LR法律法规
|
||||
//触发需求分析,通知安环部负责人安全生产法律法规获取清单
|
||||
NoticeEndDemandDistinguish(filter);
|
||||
#endregion
|
||||
return true;
|
||||
});
|
||||
}
|
||||
@ -269,499 +259,6 @@ namespace APT.PP.WebApi.Controllers.Api.PP
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 触发给所有人法律法规识别
|
||||
/// </summary>
|
||||
/// <param name="filter"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet, Route("NoticeStartDemandDistinguish")]
|
||||
public JsonActionResult<bool> NoticeStartDemandDistinguish([FromBody] KeywordFilter filter)
|
||||
{
|
||||
return SafeExecute<bool>(() =>
|
||||
{
|
||||
List<T_LR_DEMAND_DISTINGUISH> demandDistinguishes = new List<T_LR_DEMAND_DISTINGUISH>();
|
||||
List<T_FM_NOTIFICATION_TASK> sendNotices = new List<T_FM_NOTIFICATION_TASK>();
|
||||
DateTime nowTime = DateTime.Now;
|
||||
BaseFilter baseFilter = new BaseFilter(filter.GetOrgId());
|
||||
var config = GetEntity<T_LR_LRCONFIG>(t => t.IS_DELETED == false);
|
||||
var isRun = false;
|
||||
if (config != null)
|
||||
{
|
||||
if (config.DEMAND_START_TIME.Month == nowTime.Month && config.DEMAND_START_TIME.Day == nowTime.Day)
|
||||
{
|
||||
isRun = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (nowTime.Month == 12 && nowTime.Day == 1)
|
||||
{
|
||||
isRun = true;
|
||||
}
|
||||
}
|
||||
if (isRun)
|
||||
{
|
||||
var entity = GetEntity<T_LR_DEMAND_DISTINGUISH>(t => t.TRIGGER_TIME.Value.Month == DateTime.Now.Month && t.TRIGGER_TIME.Value.Day == DateTime.Now.Day, baseFilter);
|
||||
var allSendUserTitles = new List<string>();
|
||||
var allSendDataIds = new List<Guid>();
|
||||
var allSendUserIds = new List<Guid>();
|
||||
var allSendUserNames = new List<string>();
|
||||
if (entity == null)
|
||||
{
|
||||
var users = GetEntities<T_FM_USER>(t => t.ENABLE_STATUS == 0 && !t.CODE.Contains("admin"), baseFilter);
|
||||
if (users != null && users.Count() > 0)
|
||||
{
|
||||
users.ForEach(user =>
|
||||
{
|
||||
if (user.DEPARTMENT_ID != null)
|
||||
{
|
||||
// 触发安全生产责任制个人签订表
|
||||
T_LR_DEMAND_DISTINGUISH record = new T_LR_DEMAND_DISTINGUISH
|
||||
{
|
||||
ID = Guid.NewGuid(),
|
||||
USER_ID = user.ID,
|
||||
TRIGGER_TIME = DateTime.Now,
|
||||
YEARS = DateTime.Now.Year,
|
||||
DEPARTMENT_ID = user.DEPARTMENT_ID.Value,
|
||||
ORG_ID = filter.GetOrgId(),
|
||||
END_TIME = config.DEMAND_END_TIME,
|
||||
};
|
||||
demandDistinguishes.Add(record);
|
||||
allSendUserTitles.Add("安全生产法律法规需求识别");
|
||||
allSendDataIds.Add(record.ID);
|
||||
allSendUserIds.Add(user.ID);
|
||||
allSendUserNames.Add(user.NAME);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
sendNotices = NotificationTaskService.InsertUserNoticeTaskModels(allSendUserTitles, allSendDataIds, filter.GetOrgId(), allSendUserIds, allSendUserNames, DateTime.Now, config.DEMAND_END_TIME, 1, "LR002");
|
||||
}
|
||||
UnifiedCommit(() =>
|
||||
{
|
||||
if (demandDistinguishes.Any())
|
||||
BantchAddEntityNoCommit(demandDistinguishes);
|
||||
if (sendNotices.Any())
|
||||
BantchAddEntityNoCommit(sendNotices);
|
||||
});
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 通知安环部所有人员和各个部门安全员相关的安全生产法律法规需求分析表
|
||||
/// </summary>
|
||||
/// <param name="filter"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet, Route("NoticeEndDemandDistinguish")]
|
||||
public JsonActionResult<bool> NoticeEndDemandDistinguish([FromBody] KeywordFilter filter)
|
||||
{
|
||||
return SafeExecute<bool>(() =>
|
||||
{
|
||||
//需求识别
|
||||
List<T_LR_DEMAND_DISTINGUISH> demandDistinguishes = new List<T_LR_DEMAND_DISTINGUISH>();
|
||||
//需求分析
|
||||
List<T_LR_DEMAND_DISTINGUISH_REPORT> demandDistinguishReports = new List<T_LR_DEMAND_DISTINGUISH_REPORT>();
|
||||
List<T_LR_DEMAND_DISTINGUISH_REPORT_DETAIL> demandDistinguishReportDetails = new List<T_LR_DEMAND_DISTINGUISH_REPORT_DETAIL>();
|
||||
//获取清单明细
|
||||
List<T_LR_LEGAL_LIST_DETAIL> legalListDetails = new List<T_LR_LEGAL_LIST_DETAIL>();
|
||||
List<T_LR_LAW_INTEGRATE_UPDATE_DETAIL> integrateUpdateDetails = new List<T_LR_LAW_INTEGRATE_UPDATE_DETAIL>();
|
||||
List<T_LR_LAW_INSTITUTION> lawInstitutions = new List<T_LR_LAW_INSTITUTION>();
|
||||
List<T_LR_LEGAL_LIST_DETAIL_USER> lrDemandUsers = new List<T_LR_LEGAL_LIST_DETAIL_USER>();
|
||||
List<T_FM_NOTIFICATION_TASK> sendNotices = null;
|
||||
T_LR_LEGAL_LIST legalList = null;
|
||||
DateTime nowTime = DateTime.Now;
|
||||
BaseFilter baseFilter = new BaseFilter(filter.GetOrgId());
|
||||
var config = GetEntity<T_LR_LRCONFIG>(null, baseFilter);
|
||||
if (config != null)
|
||||
{
|
||||
if (config.DEMAND_END_TIME.Month == nowTime.Month && config.DEMAND_END_TIME.Day == nowTime.Day)
|
||||
{
|
||||
var allDepartMents = GetEntities<T_FM_DEPARTMENT>(t => t.IS_DELETED == false, baseFilter, new string[] { "Nav_User" }).ToList();
|
||||
|
||||
var AHDepartMent = GetEntity<T_FM_USER>(t => t.Nav_ApproveRole.NAME == "安环部负责人" && t.ENABLE_STATUS == 0);
|
||||
if (AHDepartMent == null)
|
||||
{
|
||||
AHDepartMent = GetEntity<T_FM_USER>(t => t.Nav_ApproveRole.NAME == "安环部安全员" && t.ENABLE_STATUS == 0);
|
||||
}
|
||||
var allSafeUsers = GetEntities<T_FM_USER>(t => t.Nav_ApproveRole.NAME.Contains("安全员") && t.ENABLE_STATUS == 0, baseFilter);
|
||||
#region 通知安环部所有人员和各个部门安全员相关的安全生产法律法规需求分析表
|
||||
|
||||
//法律法规需求识别
|
||||
var demandDistinguishs = GetEntities<T_LR_DEMAND_DISTINGUISH>(t => t.YEARS == config.DEMAND_END_TIME.Year, baseFilter, new string[] { "Nav_Department", "Nav_User", "Nav_DemandLaw.Nav_Law", "Nav_DemandOther.Nav_OtherDistinguish" }).ToList();
|
||||
//识别法律法规
|
||||
var demandLaws = GetEntities<T_LR_DEMAND_LAW>(t => t.Nav_DemandDistinguish.YEARS == config.DEMAND_END_TIME.Year, baseFilter, new string[] { "Nav_DemandDistinguish.Nav_Department", "Nav_DemandDistinguish.Nav_User", "Nav_Law" }).ToList();
|
||||
//识别其他
|
||||
var demandOthers = GetEntities<T_LR_DEMAND_OTHER>(t => t.Nav_DemandDistinguish.YEARS == config.DEMAND_END_TIME.Year, baseFilter, new string[] { "Nav_OtherDistinguish.Nav_DemandUser", "Nav_DemandDistinguish.Nav_Department", "Nav_DemandDistinguish.Nav_User" }).ToList();
|
||||
var allSendUserTitles = new List<string>();
|
||||
var allSendDataIds = new List<Guid>();
|
||||
var allSendUserIds = new List<Guid>();
|
||||
var allSendUserNames = new List<string>();
|
||||
var allFormCodes = new List<string>();
|
||||
if (demandDistinguishs != null && demandDistinguishs.Count() > 0)
|
||||
{
|
||||
var hasDemandDistinguishs = demandDistinguishs.Where(t => t.DISTINGUISH_TYPE == LRDistinguishEnum.已识别).ToList();
|
||||
var hasDemandLaws = demandLaws.Where(t => t.Nav_DemandDistinguish.DISTINGUISH_TYPE == LRDistinguishEnum.已识别).OrderBy(t => t.Nav_DemandDistinguish.Nav_Department.DEPARTMENT_TYPE).ToList();
|
||||
var hasDemandOthers = demandOthers.Where(t => t.Nav_DemandDistinguish.DISTINGUISH_TYPE == LRDistinguishEnum.已识别).OrderBy(t => t.Nav_DemandDistinguish.Nav_Department.DEPARTMENT_TYPE).ToList();
|
||||
//公司级
|
||||
var company = allDepartMents.Where(l => l.DEPARTMENT_TYPE == 3).FirstOrDefault();
|
||||
T_LR_DEMAND_DISTINGUISH_REPORT demandDistinguishReport = new T_LR_DEMAND_DISTINGUISH_REPORT();
|
||||
demandDistinguishReport.ID = Guid.NewGuid();
|
||||
demandDistinguishReport.INVESTIGATE_TIMES = demandDistinguishs.Count();
|
||||
demandDistinguishReport.ORG_ID = config.ORG_ID;
|
||||
demandDistinguishReport.REPORT_TIME = config.DEMAND_END_TIME;
|
||||
demandDistinguishReport.YEARS = nowTime.Year;
|
||||
demandDistinguishReport.DEPARTMENT_ID = company.ID;
|
||||
demandDistinguishReport.FEEDBACK_TIMES = hasDemandDistinguishs.Count();
|
||||
double hasDemandDistinguishsCount = hasDemandDistinguishs.Count();
|
||||
double demandDistinguishsCount = demandDistinguishs.Count();
|
||||
demandDistinguishReport.FEEDBACK_RATE = (hasDemandDistinguishsCount / demandDistinguishsCount * 100).ToString("#0.00");
|
||||
demandDistinguishReports.Add(demandDistinguishReport);
|
||||
if (hasDemandLaws != null && hasDemandLaws.Count() > 0)
|
||||
{
|
||||
//法律法规
|
||||
var lawDemandDistinguishs = hasDemandLaws.Distinct(t => t.LAW_ID).ToList();//法律法规去重
|
||||
if (lawDemandDistinguishs != null && lawDemandDistinguishs.Count() > 0)
|
||||
{
|
||||
lawDemandDistinguishs.ForEach(ddd =>
|
||||
{
|
||||
var demandLaw = hasDemandLaws.Where(hdl => hdl.LAW_ID == ddd.LAW_ID).ToList();
|
||||
if (demandLaw != null && demandLaw.Count() > 0)
|
||||
{
|
||||
T_LR_DEMAND_DISTINGUISH_REPORT_DETAIL demandDistinguishReportDetail = new T_LR_DEMAND_DISTINGUISH_REPORT_DETAIL();
|
||||
demandDistinguishReportDetail.REPORT_ID = demandDistinguishReport.ID;
|
||||
demandDistinguishReportDetail.DEMAND_NAME = ddd.Nav_Law.NAME;//需求法律法规
|
||||
demandDistinguishReportDetail.DEMAND_TIMES = demandLaw.Count();//需求人数
|
||||
demandDistinguishReportDetail.IS_OTHER = 0;
|
||||
demandLaw.ForEach(dl =>
|
||||
{
|
||||
if (string.IsNullOrEmpty(demandDistinguishReportDetail.DEMAND_DEPARTMENT))//需求部门
|
||||
{ demandDistinguishReportDetail.DEMAND_DEPARTMENT += dl.Nav_DemandDistinguish.Nav_Department.NAME; }
|
||||
else { demandDistinguishReportDetail.DEMAND_DEPARTMENT += ";" + dl.Nav_DemandDistinguish.Nav_Department.NAME; }
|
||||
if (string.IsNullOrEmpty(demandDistinguishReportDetail.DEMAND_PERSON))//提出人
|
||||
{ demandDistinguishReportDetail.DEMAND_PERSON += dl.Nav_DemandDistinguish.Nav_User.NAME; }
|
||||
else { demandDistinguishReportDetail.DEMAND_PERSON += ";" + dl.Nav_DemandDistinguish.Nav_User.NAME; }
|
||||
});
|
||||
demandDistinguishReportDetail.ORG_ID = ddd.ORG_ID;
|
||||
demandDistinguishReportDetails.Add(demandDistinguishReportDetail);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
if (hasDemandOthers != null && hasDemandOthers.Count() > 0)
|
||||
{
|
||||
//需求识别其他
|
||||
var lawDemandOthers = hasDemandOthers.Distinct(t => t.OTHER_ID).ToList();//需求识别其他去重
|
||||
if (lawDemandOthers != null && lawDemandOthers.Count() > 0)
|
||||
{
|
||||
lawDemandOthers.ForEach(ddd =>
|
||||
{
|
||||
var demandOther = hasDemandOthers.Where(hdl => hdl.OTHER_ID == ddd.OTHER_ID).ToList();
|
||||
if (demandOther != null && demandOther.Count() > 0)
|
||||
{
|
||||
T_LR_DEMAND_DISTINGUISH_REPORT_DETAIL demandDistinguishReportDetail = new T_LR_DEMAND_DISTINGUISH_REPORT_DETAIL();
|
||||
demandDistinguishReportDetail.REPORT_ID = demandDistinguishReport.ID;
|
||||
demandDistinguishReportDetail.DEMAND_NAME = ddd.Nav_OtherDistinguish.NAME;//需求识别其他
|
||||
demandDistinguishReportDetail.DEMAND_TIMES = demandOther.Count();//需求人数
|
||||
demandDistinguishReportDetail.IS_OTHER = 1;
|
||||
demandOther.ForEach(dl =>
|
||||
{
|
||||
if (string.IsNullOrEmpty(demandDistinguishReportDetail.DEMAND_DEPARTMENT))//需求部门
|
||||
{ demandDistinguishReportDetail.DEMAND_DEPARTMENT += dl.Nav_DemandDistinguish.Nav_Department.NAME; }
|
||||
else { demandDistinguishReportDetail.DEMAND_DEPARTMENT += ";" + dl.Nav_DemandDistinguish.Nav_Department.NAME; }
|
||||
if (string.IsNullOrEmpty(demandDistinguishReportDetail.DEMAND_PERSON))//提出人
|
||||
{ demandDistinguishReportDetail.DEMAND_PERSON += dl.Nav_DemandDistinguish.Nav_User.NAME; }
|
||||
else { demandDistinguishReportDetail.DEMAND_PERSON += ";" + dl.Nav_DemandDistinguish.Nav_User.NAME; }
|
||||
});
|
||||
demandDistinguishReportDetail.ORG_ID = ddd.ORG_ID;
|
||||
demandDistinguishReportDetails.Add(demandDistinguishReportDetail);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
var ahUser = GetEntities<T_FM_USER>(t => t.Nav_ApproveRole.NAME.Contains("安环部") && t.ENABLE_STATUS == 0, baseFilter).ToList();
|
||||
if (ahUser != null && ahUser.Count() > 0)
|
||||
{
|
||||
ahUser.ForEach(t =>
|
||||
{
|
||||
allSendUserTitles.Add("公司级安全生产法律法规需求分析表");
|
||||
allSendDataIds.Add(demandDistinguishReport.ID);
|
||||
allSendUserIds.Add(t.ID);
|
||||
allSendUserNames.Add(t.NAME);
|
||||
allFormCodes.Add("LR003_SHOWPRINT");
|
||||
});
|
||||
}
|
||||
//部门级
|
||||
var alldepartments = allDepartMents.Where(t => t.DEPARTMENT_TYPE == 0 && t.ID != AHDepartMent.DEPARTMENT_ID && t.IS_DELETED == false).ToList();
|
||||
foreach (var department in alldepartments)
|
||||
{
|
||||
var deps = new List<Guid>();
|
||||
DepartmentService.GetDepartmentIds(filter.GetOrgId(), new List<Guid>() { department.ID }, ref deps);
|
||||
deps.Add(department.ID);
|
||||
|
||||
Guid depSafeUserId = Guid.Empty;
|
||||
string depSafeUserName = "";
|
||||
|
||||
var chargeUser = allSafeUsers.FirstOrDefault(t => t.DEPARTMENT_ID == department.ID);
|
||||
if (chargeUser != null)
|
||||
{
|
||||
depSafeUserId = chargeUser.ID;
|
||||
depSafeUserName = chargeUser.NAME;
|
||||
}
|
||||
else
|
||||
{
|
||||
depSafeUserId = (Guid)department.USER_ID;
|
||||
depSafeUserName = department.Nav_User.NAME;
|
||||
}
|
||||
var departmentDemandDistinguishs = demandDistinguishs.Where(d => deps.Contains(d.DEPARTMENT_ID)).ToList();//筛选出不同部门,排除公司级
|
||||
if (departmentDemandDistinguishs != null && departmentDemandDistinguishs.Count() > 0)
|
||||
{
|
||||
var hasDepartmentDemandDistinguish = departmentDemandDistinguishs.Where(d => d.DISTINGUISH_TYPE == LRDistinguishEnum.已识别).ToList();
|
||||
|
||||
T_LR_DEMAND_DISTINGUISH_REPORT departmentDemandDistinguishReport = new T_LR_DEMAND_DISTINGUISH_REPORT();
|
||||
departmentDemandDistinguishReport.ID = Guid.NewGuid();
|
||||
departmentDemandDistinguishReport.INVESTIGATE_TIMES = departmentDemandDistinguishs.Count();
|
||||
departmentDemandDistinguishReport.ORG_ID = config.ORG_ID;
|
||||
departmentDemandDistinguishReport.REPORT_TIME = config.DEMAND_END_TIME;
|
||||
departmentDemandDistinguishReport.YEARS = nowTime.Year;
|
||||
departmentDemandDistinguishReport.DEPARTMENT_ID = department.ID;
|
||||
double hasDepartmentDemandDistinguishCount = hasDepartmentDemandDistinguish.Count();
|
||||
double departmentDemandDistinguishCount = departmentDemandDistinguishs.Count();
|
||||
departmentDemandDistinguishReport.FEEDBACK_TIMES = hasDepartmentDemandDistinguish.Count();
|
||||
departmentDemandDistinguishReport.FEEDBACK_RATE = (hasDepartmentDemandDistinguishCount / departmentDemandDistinguishCount * 100).ToString("#0.00");
|
||||
demandDistinguishReports.Add(departmentDemandDistinguishReport);
|
||||
if (hasDepartmentDemandDistinguish != null && hasDepartmentDemandDistinguish.Count() > 0)
|
||||
{
|
||||
hasDepartmentDemandDistinguish.ForEach(hddd =>
|
||||
{
|
||||
var hasDepartmentDemandLaws = demandLaws.Where(t => t.DISTINGUISH_ID == hddd.ID).ToList();//该部门的法律法规需求
|
||||
var hasDepartmentDemandOthers = demandOthers.Where(t => t.DISTINGUISH_ID == hddd.ID).ToList();//该部门的其他需求
|
||||
if (hasDepartmentDemandLaws != null && hasDepartmentDemandLaws.Count() > 0)
|
||||
{
|
||||
//法律法规
|
||||
var lawDemandDistinguishs = hasDepartmentDemandLaws.Where(t => deps.Contains(t.Nav_DemandDistinguish.DEPARTMENT_ID)).Distinct(t => t.LAW_ID).ToList();//法律法规去重
|
||||
if (lawDemandDistinguishs != null && lawDemandDistinguishs.Count() > 0)
|
||||
{
|
||||
foreach (var lddd in lawDemandDistinguishs)
|
||||
{
|
||||
var demandLaw = hasDepartmentDemandLaws.Where(hdl => hdl.LAW_ID == lddd.LAW_ID).ToList();
|
||||
if (demandLaw != null && demandLaw.Count() > 0)
|
||||
{
|
||||
T_LR_DEMAND_DISTINGUISH_REPORT_DETAIL demandDistinguishReportDetail = new T_LR_DEMAND_DISTINGUISH_REPORT_DETAIL();
|
||||
demandDistinguishReportDetail.REPORT_ID = departmentDemandDistinguishReport.ID;
|
||||
demandDistinguishReportDetail.DEMAND_NAME = lddd.Nav_Law.NAME;//需求法律法规
|
||||
demandDistinguishReportDetail.DEMAND_TIMES = demandLaw.Count();//需求人数
|
||||
demandDistinguishReportDetail.IS_OTHER = 0;
|
||||
demandLaw.ForEach(dl =>
|
||||
{
|
||||
if (string.IsNullOrEmpty(demandDistinguishReportDetail.DEMAND_DEPARTMENT))//需求部门
|
||||
{ demandDistinguishReportDetail.DEMAND_DEPARTMENT += dl.Nav_DemandDistinguish.Nav_Department.NAME; }
|
||||
else { demandDistinguishReportDetail.DEMAND_DEPARTMENT += ";" + dl.Nav_DemandDistinguish.Nav_Department.NAME; }
|
||||
if (string.IsNullOrEmpty(demandDistinguishReportDetail.DEMAND_PERSON))//提出人
|
||||
{ demandDistinguishReportDetail.DEMAND_PERSON += dl.Nav_DemandDistinguish.Nav_User.NAME; }
|
||||
else { demandDistinguishReportDetail.DEMAND_PERSON += ";" + dl.Nav_DemandDistinguish.Nav_User.NAME; }
|
||||
});
|
||||
demandDistinguishReportDetail.ORG_ID = lddd.ORG_ID;
|
||||
demandDistinguishReportDetails.Add(demandDistinguishReportDetail);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
if (hasDemandOthers != null && hasDemandOthers.Count() > 0)
|
||||
{
|
||||
//需求识别其他
|
||||
var lawDemandOthers = hasDemandOthers.Where(t => deps.Contains(t.Nav_DemandDistinguish.DEPARTMENT_ID)).Distinct(t => t.OTHER_ID).ToList();//需求识别其他去重
|
||||
if (lawDemandOthers != null && lawDemandOthers.Count() > 0)
|
||||
{
|
||||
lawDemandOthers.ForEach(ldo =>
|
||||
{
|
||||
var demandOther = hasDemandOthers.Where(hdl => hdl.OTHER_ID == ldo.OTHER_ID).ToList();
|
||||
if (demandOther != null && demandOther.Count() > 0)
|
||||
{
|
||||
T_LR_DEMAND_DISTINGUISH_REPORT_DETAIL demandDistinguishReportDetail = new T_LR_DEMAND_DISTINGUISH_REPORT_DETAIL();
|
||||
demandDistinguishReportDetail.REPORT_ID = departmentDemandDistinguishReport.ID;
|
||||
demandDistinguishReportDetail.DEMAND_NAME = ldo.Nav_OtherDistinguish.NAME;//需求识别其他
|
||||
demandDistinguishReportDetail.DEMAND_TIMES = demandOther.Count();//需求人数
|
||||
demandDistinguishReportDetail.IS_OTHER = 1;
|
||||
demandOther.ForEach(dl =>
|
||||
{
|
||||
if (string.IsNullOrEmpty(demandDistinguishReportDetail.DEMAND_DEPARTMENT))//需求部门
|
||||
{ demandDistinguishReportDetail.DEMAND_DEPARTMENT += dl.Nav_DemandDistinguish.Nav_Department.NAME; }
|
||||
else { demandDistinguishReportDetail.DEMAND_DEPARTMENT += ";" + dl.Nav_DemandDistinguish.Nav_Department.NAME; }
|
||||
if (string.IsNullOrEmpty(demandDistinguishReportDetail.DEMAND_PERSON))//提出人
|
||||
{ demandDistinguishReportDetail.DEMAND_PERSON += dl.Nav_DemandDistinguish.Nav_User.NAME; }
|
||||
else { demandDistinguishReportDetail.DEMAND_PERSON += ";" + dl.Nav_DemandDistinguish.Nav_User.NAME; }
|
||||
});
|
||||
demandDistinguishReportDetail.ORG_ID = ldo.ORG_ID;
|
||||
demandDistinguishReportDetails.Add(demandDistinguishReportDetail);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
allSendUserTitles.Add("部门级安全生产法律法规需求分析表");
|
||||
allSendDataIds.Add(departmentDemandDistinguishReport.ID);
|
||||
allSendUserIds.Add(depSafeUserId);
|
||||
allSendUserNames.Add(depSafeUserName);
|
||||
allFormCodes.Add("LR003_SHOWPRINT");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion 通知安环部所有人员和各个部门安全员相关的安全生产法律法规需求分析表
|
||||
|
||||
#region 通知安环部负责人安全生产法律法规获取清单
|
||||
|
||||
if (demandOthers != null && demandOthers.Count() > 0)
|
||||
{
|
||||
legalList = new T_LR_LEGAL_LIST();
|
||||
legalList.ID = Guid.NewGuid();
|
||||
legalList.DISTINGUISH_TIME = nowTime;
|
||||
legalList.ORG_ID = config.ORG_ID;
|
||||
legalList.YEARS = nowTime.Year;
|
||||
legalList.DEPARTMENT_ID = (Guid)AHDepartMent.DEPARTMENT_ID;
|
||||
legalList.USER_ID = AHDepartMent.ID;
|
||||
allSendUserTitles.Add("安全生产法律法规获取清单");
|
||||
allSendDataIds.Add(legalList.ID);
|
||||
allSendUserIds.Add(AHDepartMent.ID);
|
||||
allSendUserNames.Add(AHDepartMent.NAME);
|
||||
allFormCodes.Add("LR006");
|
||||
//需求识别其他
|
||||
var lawDemandOthers = demandOthers.Distinct(t => t.OTHER_ID).ToList();//需求识别其他去重
|
||||
if (lawDemandOthers != null && lawDemandOthers.Count() > 0)
|
||||
{
|
||||
lawDemandOthers.ForEach(ddd =>
|
||||
{
|
||||
T_LR_LEGAL_LIST_DETAIL legalListDetail = new T_LR_LEGAL_LIST_DETAIL();
|
||||
legalListDetail.ID = Guid.NewGuid();
|
||||
legalListDetail.LEGAL_ID = legalList.ID;
|
||||
legalListDetail.OTHER_ID = ddd.OTHER_ID;//需求识别其他
|
||||
legalListDetail.ORG_ID = ddd.ORG_ID;
|
||||
if (ddd.Nav_OtherDistinguish != null && ddd.Nav_OtherDistinguish.Nav_DemandUser != null && ddd.Nav_OtherDistinguish.Nav_DemandUser.Count() > 0)
|
||||
{
|
||||
ddd.Nav_OtherDistinguish.Nav_DemandUser.ForEach(od =>
|
||||
{
|
||||
T_LR_LEGAL_LIST_DETAIL_USER t_LR_LEGAL_LIST_DETAIL_USER = new T_LR_LEGAL_LIST_DETAIL_USER();
|
||||
t_LR_LEGAL_LIST_DETAIL_USER.ORG_ID = ddd.ORG_ID;
|
||||
t_LR_LEGAL_LIST_DETAIL_USER.LEGAL_LIST_DETAIL = legalListDetail.ID;
|
||||
t_LR_LEGAL_LIST_DETAIL_USER.USER_ID = od.USER_ID;
|
||||
lrDemandUsers.Add(t_LR_LEGAL_LIST_DETAIL_USER);
|
||||
});
|
||||
}
|
||||
legalListDetails.Add(legalListDetail);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
#endregion 通知安环部负责人安全生产法律法规获取清单
|
||||
sendNotices = NotificationTaskService.InsertUserNoticeTaskModels(allSendUserTitles, allSendDataIds, filter.GetOrgId(), allSendUserIds, allSendUserNames, DateTime.Now, DateTime.Now.AddDays(1), 1, allFormCodes);
|
||||
}
|
||||
|
||||
}
|
||||
UnifiedCommit(() =>
|
||||
{
|
||||
if (demandDistinguishReports.Any())
|
||||
BantchAddEntityNoCommit(demandDistinguishReports);
|
||||
if (demandDistinguishReportDetails.Any())
|
||||
BantchAddEntityNoCommit(demandDistinguishReportDetails);
|
||||
if (legalList != null)
|
||||
AddEntityNoCommit(legalList);
|
||||
if (legalListDetails.Any())
|
||||
BantchAddEntityNoCommit(legalListDetails);
|
||||
if (lrDemandUsers.Any())
|
||||
BantchAddEntityNoCommit(lrDemandUsers);
|
||||
if (sendNotices != null && sendNotices.Any())
|
||||
BantchAddEntityNoCommit(sendNotices);
|
||||
});
|
||||
return true;
|
||||
});
|
||||
}
|
||||
/// <summary>
|
||||
/// 通知安环部负责人安全生产法律法规更新与融入
|
||||
/// </summary>
|
||||
/// <param name="filter"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet, Route("NoticeLRLawIntegrateUpdate")]
|
||||
public JsonActionResult<bool> NoticeLRLawIntegrateUpdate([FromBody] KeywordFilter filter)
|
||||
{
|
||||
return SafeExecute<bool>(() =>
|
||||
{
|
||||
List<T_LR_LAW_INSTITUTION> lawInstitutions = new List<T_LR_LAW_INSTITUTION>();
|
||||
T_LR_LAW_INTEGRATE_UPDATE lawIntegrateUpdate = null;
|
||||
List<T_LR_LAW_INTEGRATE_UPDATE_DETAIL> integrateUpdateDetails = new List<T_LR_LAW_INTEGRATE_UPDATE_DETAIL>();
|
||||
T_FM_NOTIFICATION_TASK sendNotice = null;
|
||||
DateTime nowTime = DateTime.Now;
|
||||
BaseFilter baseFilter = new BaseFilter(filter.GetOrgId());
|
||||
var config = GetEntities<T_LR_INTEGRATE_UPDATE_TIME>(t => t.IS_DELETED == false, baseFilter);
|
||||
if (config != null && config.Any())
|
||||
{
|
||||
bool isTime = false;
|
||||
config.ForEach(t =>
|
||||
{
|
||||
if (t.INTEGRATE_UPDATE_TIME.Month == nowTime.Month && t.INTEGRATE_UPDATE_TIME.Day == nowTime.Day)
|
||||
{
|
||||
isTime = true;
|
||||
}
|
||||
});
|
||||
if (isTime)
|
||||
{
|
||||
lawIntegrateUpdate = new T_LR_LAW_INTEGRATE_UPDATE();
|
||||
lawIntegrateUpdate.ID = Guid.NewGuid();
|
||||
lawIntegrateUpdate.YEAR = nowTime;
|
||||
lawIntegrateUpdate.ORG_ID = filter.GetOrgId();
|
||||
lawIntegrateUpdate.RATE = "0";
|
||||
var laws = GetEntities<T_LR_LAW>(t => t.LAW_STATUS == BSLawStatusEnum.现行, baseFilter, new string[] { "Nav_LawVersion", "Nav_LawSCSystem" }).ToList();
|
||||
if (laws != null && laws.Count() > 0)
|
||||
{
|
||||
laws.ForEach(t =>
|
||||
{
|
||||
T_LR_LAW_INTEGRATE_UPDATE_DETAIL integrateUpdateDetail = new T_LR_LAW_INTEGRATE_UPDATE_DETAIL();
|
||||
integrateUpdateDetail.ID = Guid.NewGuid();
|
||||
integrateUpdateDetail.LAW_ID = t.ID;
|
||||
integrateUpdateDetail.INTEGRATE_UPDATE_ID = lawIntegrateUpdate.ID;
|
||||
integrateUpdateDetail.UPDATE_STATUS = (int)LRLawIntegrateUpdateStatusEnum.未更新;
|
||||
integrateUpdateDetail.ORG_ID = filter.GetOrgId();
|
||||
integrateUpdateDetails.Add(integrateUpdateDetail);
|
||||
if (t.Nav_LawSCSystem != null && t.Nav_LawSCSystem.Count() > 0)
|
||||
{
|
||||
t.Nav_LawSCSystem.ForEach(li =>
|
||||
{
|
||||
T_LR_LAW_INSTITUTION lawInstitution = new T_LR_LAW_INSTITUTION();
|
||||
lawInstitution.UPDATE_DETAIL_ID = integrateUpdateDetail.ID;
|
||||
lawInstitution.SC_SYSTEM_ID = li.SC_SYSTEM_ID;
|
||||
lawInstitution.ORG_ID = filter.GetOrgId();
|
||||
lawInstitutions.Add(lawInstitution);
|
||||
});
|
||||
}
|
||||
});
|
||||
var safeUser = GetEntity<T_FM_USER>(t => t.Nav_ApproveRole.NAME == "安环部负责人" && t.ENABLE_STATUS == 0);
|
||||
if (safeUser == null)
|
||||
{
|
||||
safeUser = GetEntity<T_FM_USER>(t => t.Nav_ApproveRole.NAME == "安环部安全员" && t.ENABLE_STATUS == 0);
|
||||
}
|
||||
sendNotice = NotificationTaskService.InsertUserNoticeTaskModel("法律法规更新与融入", lawIntegrateUpdate.ID, filter.GetOrgId(), safeUser.ID, safeUser.NAME, DateTime.Now, DateTime.Now.AddDays(10), 0, "LR010");
|
||||
}
|
||||
}
|
||||
UnifiedCommit(() =>
|
||||
{
|
||||
if (lawIntegrateUpdate != null)
|
||||
AddEntityNoCommit(lawIntegrateUpdate);
|
||||
if (integrateUpdateDetails.Any())
|
||||
BantchAddEntityNoCommit(integrateUpdateDetails);
|
||||
if (lawInstitutions.Any())
|
||||
BantchAddEntityNoCommit(lawInstitutions);
|
||||
if (sendNotice != null)
|
||||
AddEntityNoCommit(sendNotice);
|
||||
});
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
/// <summary>
|
||||
/// 触发安全意识调查
|
||||
/// </summary>
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Test"
|
||||
},
|
||||
"applicationUrl": "http://localhost:3118",
|
||||
"applicationUrl": "http://localhost:7118",
|
||||
"nativeDebugging": false
|
||||
},
|
||||
"Docker": {
|
||||
|
||||
@ -12,7 +12,7 @@ using APT.MS.Domain.Entities.BI;
|
||||
using APT.MS.Domain.Entities.BS;
|
||||
using APT.MS.Domain.Entities.FO;
|
||||
using APT.MS.Domain.Entities.HM;
|
||||
using APT.MS.Domain.Entities.LR;
|
||||
|
||||
using APT.MS.Domain.Entities.OG;
|
||||
using APT.MS.Domain.Entities.PF;
|
||||
using APT.MS.Domain.Entities.SC;
|
||||
@ -3586,139 +3586,6 @@ namespace APT.SC.WebApi.Controllers.Api.BIController
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
if (!string.IsNullOrEmpty(filter.Parameter3) && filter.Parameter3 == "法律法规与其他要求")
|
||||
{
|
||||
//法律法规与其他要求
|
||||
newFilter.SelectField = new List<string> { "ID", "DISTINGUISH_TYPE", "DEPARTMENT_ID" };
|
||||
//安全生产法律法规需求识别表
|
||||
var delayApply = this.GetEntities<T_LR_DEMAND_DISTINGUISH>(t => t.CREATE_TIME >= startTime && t.CREATE_TIME <= endTime, newFilter).ToList();
|
||||
//法律法规需求分析表
|
||||
newFilter.SelectField = new List<string> { "ID", "DEPARTMENT_ID" };
|
||||
var classRecord = this.GetEntities<T_LR_DEMAND_DISTINGUISH_REPORT>(t => t.CREATE_TIME >= startTime && t.CREATE_TIME <= endTime, newFilter).ToList();
|
||||
//获取清单
|
||||
newFilter.SelectField = new List<string> { "ID", "LEGAL_STATUS", "DEPARTMENT_ID" };
|
||||
var shiftRecord = this.GetEntities<T_LR_LEGAL_LIST>(t => t.CREATE_TIME >= startTime && t.CREATE_TIME <= endTime, newFilter).ToList();
|
||||
//只取待办超期的
|
||||
newFilter.SelectField = new List<string> { "SOURCE_DATA_ID" };
|
||||
var tasks = this.GetEntities<T_FM_NOTIFICATION_TASK>(t => t.NOTICE_STATUS == 2 && t.CREATE_TIME >= startTime && t.CREATE_TIME <= endTime, newFilter).ToList();
|
||||
#region 法律法规与其他要求
|
||||
if (delayApply.Any())
|
||||
{
|
||||
foreach (var item in delayApply)
|
||||
{
|
||||
var task = tasks.FirstOrDefault(t => t.SOURCE_DATA_ID == item.ID);
|
||||
if (task == null)
|
||||
item.IS_OVERTIME = 0;
|
||||
else
|
||||
item.IS_OVERTIME = 1;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(filter.Keyword))
|
||||
{
|
||||
delayApply = delayApply.Where(t => outPartmentIds.Contains((Guid)t.DEPARTMENT_ID)).ToList();
|
||||
}
|
||||
var count = delayApply.Count();
|
||||
var finish = delayApply.Count(t => t.IS_OVERTIME == 0 && t.DISTINGUISH_TYPE == LRDistinguishEnum.已识别);
|
||||
var overfinish = delayApply.Count(t => t.IS_OVERTIME == 1 && t.DISTINGUISH_TYPE == LRDistinguishEnum.已识别);
|
||||
var unfinish = count - finish - overfinish;
|
||||
var temp = count == 0 ? 0 : (double)(finish + overfinish) / count * 100;
|
||||
var finishRate = temp.ToString("0") + "%";
|
||||
var temp2 = count == 0 ? 0 : (double)finish / count * 100;
|
||||
var normalFinishRate = temp2.ToString("0") + "%";
|
||||
T_BI_FORM_RUN_ANALYSIS analysis = new T_BI_FORM_RUN_ANALYSIS();
|
||||
analysis.MOUDLE_NAME = "法律法规";
|
||||
analysis.FORM_NAME = "法律法规与其他要求";
|
||||
analysis.NUM = 22;
|
||||
analysis.ORG_ID = filter.OrgId;
|
||||
analysis.TOTAL_QTY = count;
|
||||
analysis.FINISH_QTY = finish;
|
||||
analysis.OVER_FINISH_QTY = overfinish;
|
||||
analysis.UNFINISH_QTY = unfinish;
|
||||
analysis.FINISH_RATE = finishRate;
|
||||
analysis.NORMAL_FINISH_RATE = normalFinishRate;
|
||||
formAnalysis.Add(analysis);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 法律法规需求分析表
|
||||
if (classRecord.Any())
|
||||
{
|
||||
foreach (var item in classRecord)
|
||||
{
|
||||
var task = tasks.FirstOrDefault(t => t.SOURCE_DATA_ID == item.ID);
|
||||
if (task == null)
|
||||
item.IS_OVERTIME = 0;
|
||||
else
|
||||
item.IS_OVERTIME = 1;
|
||||
//var department = GetDepartmentId(item.Nav_CreateUser.DEPARTMENT_ID.Value);
|
||||
//item.DEPARTMENT_ID = department == null ? null : department.ID;
|
||||
//var department = parentDepartments.FirstOrDefault(t => t.departmentId == item.Nav_CreateUser.DEPARTMENT_ID);
|
||||
//item.DEPARTMENT_ID = department == null ? null : department.parent_departmentId;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(filter.Keyword))
|
||||
{
|
||||
classRecord = classRecord.Where(t => outPartmentIds.Contains((Guid)t.DEPARTMENT_ID)).ToList();
|
||||
}
|
||||
var count = classRecord.Count();
|
||||
var finish = classRecord.Count(t => t.IS_OVERTIME == 0);
|
||||
var overfinish = classRecord.Count(t => t.IS_OVERTIME == 1);
|
||||
var unfinish = count - finish - overfinish;
|
||||
var temp = count == 0 ? 0 : (double)(finish + overfinish) / count * 100;
|
||||
var finishRate = temp.ToString("0") + "%";
|
||||
var temp2 = count == 0 ? 0 : (double)finish / count * 100;
|
||||
var normalFinishRate = temp2.ToString("0") + "%";
|
||||
T_BI_FORM_RUN_ANALYSIS analysis = new T_BI_FORM_RUN_ANALYSIS();
|
||||
analysis.MOUDLE_NAME = "法律法规";
|
||||
analysis.FORM_NAME = "法律法规需求分析表";
|
||||
analysis.NUM = 23;
|
||||
analysis.ORG_ID = filter.OrgId;
|
||||
analysis.TOTAL_QTY = count;
|
||||
analysis.FINISH_QTY = finish;
|
||||
analysis.OVER_FINISH_QTY = overfinish;
|
||||
analysis.UNFINISH_QTY = unfinish;
|
||||
analysis.FINISH_RATE = finishRate;
|
||||
analysis.NORMAL_FINISH_RATE = normalFinishRate;
|
||||
formAnalysis.Add(analysis);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取清单
|
||||
if (shiftRecord.Any())
|
||||
{
|
||||
foreach (var item in shiftRecord)
|
||||
{
|
||||
var task = tasks.FirstOrDefault(t => t.SOURCE_DATA_ID == item.ID);
|
||||
if (task == null)
|
||||
item.IS_OVERTIME = 0;
|
||||
else
|
||||
item.IS_OVERTIME = 1;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(filter.Keyword))
|
||||
{
|
||||
shiftRecord = shiftRecord.Where(t => outPartmentIds.Contains((Guid)t.DEPARTMENT_ID)).ToList();
|
||||
}
|
||||
var count = shiftRecord.Count();
|
||||
var finish = shiftRecord.Count(t => t.IS_OVERTIME == 0 && t.LEGAL_STATUS == PFStandardStatus.Archived);
|
||||
var overfinish = shiftRecord.Count(t => t.IS_OVERTIME == 1 && t.LEGAL_STATUS == PFStandardStatus.Archived);
|
||||
var unfinish = count - finish - overfinish;
|
||||
var temp = count == 0 ? 0 : (double)(finish + overfinish) / count * 100;
|
||||
var finishRate = temp.ToString("0") + "%";
|
||||
var temp2 = count == 0 ? 0 : (double)finish / count * 100;
|
||||
var normalFinishRate = temp2.ToString("0") + "%";
|
||||
T_BI_FORM_RUN_ANALYSIS analysis = new T_BI_FORM_RUN_ANALYSIS();
|
||||
analysis.MOUDLE_NAME = "法律法规";
|
||||
analysis.FORM_NAME = "获取清单";
|
||||
analysis.NUM = 24;
|
||||
analysis.ORG_ID = filter.OrgId;
|
||||
analysis.TOTAL_QTY = count;
|
||||
analysis.FINISH_QTY = finish;
|
||||
analysis.OVER_FINISH_QTY = overfinish;
|
||||
analysis.UNFINISH_QTY = unfinish;
|
||||
analysis.FINISH_RATE = finishRate;
|
||||
analysis.NORMAL_FINISH_RATE = normalFinishRate;
|
||||
formAnalysis.Add(analysis);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
if (!string.IsNullOrEmpty(filter.Parameter3) && filter.Parameter3 == "安全生产组织保障")
|
||||
{
|
||||
newFilter.SelectField = new List<string> { "ID", "STATUS" };
|
||||
@ -4307,21 +4174,6 @@ namespace APT.SC.WebApi.Controllers.Api.BIController
|
||||
//培训效果评估表
|
||||
newFilter.SelectField = new List<string> { "ID", "STATUS", "Nav_User" };
|
||||
var riskDeal = this.GetEntities<T_SE_TRAINING_EFFECT_EVALUATION_SURVEY>(t => t.CREATE_TIME >= startTime && t.CREATE_TIME <= endTime && t.Nav_User != null && t.Nav_User.DEPARTMENT_ID != null, newFilter).ToList();
|
||||
//法律法规与其他要求
|
||||
newFilter.SelectField = new List<string> { "ID", "DISTINGUISH_TYPE", "DEPARTMENT_ID" };
|
||||
//安全生产法律法规需求识别表
|
||||
var delayApply = this.GetEntities<T_LR_DEMAND_DISTINGUISH>(t => t.CREATE_TIME >= startTime && t.CREATE_TIME <= endTime, newFilter).ToList();
|
||||
//法律法规需求分析表
|
||||
newFilter.SelectField = new List<string> { "ID", "DEPARTMENT_ID" };
|
||||
var classRecord = this.GetEntities<T_LR_DEMAND_DISTINGUISH_REPORT>(t => t.CREATE_TIME >= startTime && t.CREATE_TIME <= endTime, newFilter).ToList();
|
||||
//获取清单
|
||||
newFilter.SelectField = new List<string> { "ID", "LEGAL_STATUS", "DEPARTMENT_ID" };
|
||||
var shiftRecord = this.GetEntities<T_LR_LEGAL_LIST>(t => t.CREATE_TIME >= startTime && t.CREATE_TIME <= endTime, newFilter).ToList();
|
||||
//法律法规融入
|
||||
//var teamActive = this.GetEntities<T_LR_LAW_INTEGRATE>(t => t.CREATE_TIME >= startTime && t.CREATE_TIME <= endTime, newFilter).ToList();
|
||||
//法律法规更新与融入表
|
||||
//var shiftMeeting = this.GetEntities<T_LR_LAW_INTEGRATE_UPDATE>(t => t.CREATE_TIME >= startTime && t.CREATE_TIME <= endTime, newFilter).ToList();
|
||||
newFilter.SelectField = new List<string> { "ID", "STATUS" };
|
||||
//安全生产组织保障。安全生产责任制签订表
|
||||
var ogSafe = this.GetEntities<T_OG_SAFE_PDT_SIGNED>(t => t.CREATE_TIME >= startTime && t.CREATE_TIME <= endTime && t.Nav_CreateUser!=null && t.Nav_CreateUser.DEPARTMENT_ID != null, newFilter).ToList();
|
||||
//安全生产责任制考核方案审核表
|
||||
@ -5173,124 +5025,6 @@ namespace APT.SC.WebApi.Controllers.Api.BIController
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 法律法规与其他要求
|
||||
if (delayApply.Any())
|
||||
{
|
||||
foreach (var item in delayApply)
|
||||
{
|
||||
var task = tasks.FirstOrDefault(t => t.SOURCE_DATA_ID == item.ID);
|
||||
if (task == null)
|
||||
item.IS_OVERTIME = 0;
|
||||
else
|
||||
item.IS_OVERTIME = 1;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(filter.Keyword))
|
||||
{
|
||||
delayApply = delayApply.Where(t => outPartmentIds.Contains((Guid)t.DEPARTMENT_ID)).ToList();
|
||||
}
|
||||
var count = hazardTask.Count();
|
||||
var finish = hazardTask.Count(t => t.IS_OVERTIME == 0 && t.STATUS == PFStandardStatus.Archived);
|
||||
var overfinish = hazardTask.Count(t => t.IS_OVERTIME == 1 && t.STATUS == PFStandardStatus.Archived);
|
||||
var unfinish = count - finish - overfinish;
|
||||
var temp = count == 0 ? 0 : (double)(finish + overfinish) / count * 100;
|
||||
var finishRate = temp.ToString("0") + "%";
|
||||
var temp2 = count == 0 ? 0 : (double)finish / count * 100;
|
||||
var normalFinishRate = temp2.ToString("0") + "%";
|
||||
T_BI_FORM_RUN_ANALYSIS analysis = new T_BI_FORM_RUN_ANALYSIS();
|
||||
analysis.MOUDLE_NAME = "法律法规";
|
||||
analysis.FORM_NAME = "法律法规与其他要求";
|
||||
analysis.NUM = 22;
|
||||
analysis.ORG_ID = filter.OrgId;
|
||||
analysis.TOTAL_QTY = count;
|
||||
analysis.FINISH_QTY = finish;
|
||||
analysis.OVER_FINISH_QTY = overfinish;
|
||||
analysis.UNFINISH_QTY = unfinish;
|
||||
analysis.FINISH_RATE = finishRate;
|
||||
analysis.NORMAL_FINISH_RATE = normalFinishRate;
|
||||
formAnalysis.Add(analysis);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 法律法规需求分析表
|
||||
if (classRecord.Any())
|
||||
{
|
||||
foreach (var item in classRecord)
|
||||
{
|
||||
var task = tasks.FirstOrDefault(t => t.SOURCE_DATA_ID == item.ID);
|
||||
if (task == null)
|
||||
item.IS_OVERTIME = 0;
|
||||
else
|
||||
item.IS_OVERTIME = 1;
|
||||
//var department = GetDepartmentId(item.Nav_CreateUser.DEPARTMENT_ID.Value);
|
||||
//item.DEPARTMENT_ID = department == null ? null : department.ID;
|
||||
//var department = parentDepartments.FirstOrDefault(t => t.departmentId == item.Nav_CreateUser.DEPARTMENT_ID);
|
||||
//item.DEPARTMENT_ID = department == null ? null : department.parent_departmentId;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(filter.Keyword))
|
||||
{
|
||||
classRecord = classRecord.Where(t => outPartmentIds.Contains((Guid)t.DEPARTMENT_ID)).ToList();
|
||||
}
|
||||
var count = classRecord.Count();
|
||||
var finish = classRecord.Count(t => t.IS_OVERTIME == 0);
|
||||
var overfinish = classRecord.Count(t => t.IS_OVERTIME == 1);
|
||||
var unfinish = count - finish - overfinish;
|
||||
var temp = count == 0 ? 0 : (double)(finish + overfinish) / count * 100;
|
||||
var finishRate = temp.ToString("0") + "%";
|
||||
var temp2 = count == 0 ? 0 : (double)finish / count * 100;
|
||||
var normalFinishRate = temp2.ToString("0") + "%";
|
||||
T_BI_FORM_RUN_ANALYSIS analysis = new T_BI_FORM_RUN_ANALYSIS();
|
||||
analysis.MOUDLE_NAME = "法律法规";
|
||||
analysis.FORM_NAME = "法律法规需求分析表";
|
||||
analysis.NUM = 23;
|
||||
analysis.ORG_ID = filter.OrgId;
|
||||
analysis.TOTAL_QTY = count;
|
||||
analysis.FINISH_QTY = finish;
|
||||
analysis.OVER_FINISH_QTY = overfinish;
|
||||
analysis.UNFINISH_QTY = unfinish;
|
||||
analysis.FINISH_RATE = finishRate;
|
||||
analysis.NORMAL_FINISH_RATE = normalFinishRate;
|
||||
formAnalysis.Add(analysis);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取清单
|
||||
if (shiftRecord.Any())
|
||||
{
|
||||
foreach (var item in shiftRecord)
|
||||
{
|
||||
var task = tasks.FirstOrDefault(t => t.SOURCE_DATA_ID == item.ID);
|
||||
if (task == null)
|
||||
item.IS_OVERTIME = 0;
|
||||
else
|
||||
item.IS_OVERTIME = 1;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(filter.Keyword))
|
||||
{
|
||||
shiftRecord = shiftRecord.Where(t => outPartmentIds.Contains((Guid)t.DEPARTMENT_ID)).ToList();
|
||||
}
|
||||
var count = shiftRecord.Count();
|
||||
var finish = shiftRecord.Count(t => t.IS_OVERTIME == 0 && t.LEGAL_STATUS == PFStandardStatus.Archived);
|
||||
var overfinish = shiftRecord.Count(t => t.IS_OVERTIME == 1 && t.LEGAL_STATUS == PFStandardStatus.Archived);
|
||||
var unfinish = count - finish - overfinish;
|
||||
var temp = count == 0 ? 0 : (double)(finish + overfinish) / count * 100;
|
||||
var finishRate = temp.ToString("0") + "%";
|
||||
var temp2 = count == 0 ? 0 : (double)finish / count * 100;
|
||||
var normalFinishRate = temp2.ToString("0") + "%";
|
||||
T_BI_FORM_RUN_ANALYSIS analysis = new T_BI_FORM_RUN_ANALYSIS();
|
||||
analysis.MOUDLE_NAME = "法律法规";
|
||||
analysis.FORM_NAME = "获取清单";
|
||||
analysis.NUM = 24;
|
||||
analysis.ORG_ID = filter.OrgId;
|
||||
analysis.TOTAL_QTY = count;
|
||||
analysis.FINISH_QTY = finish;
|
||||
analysis.OVER_FINISH_QTY = overfinish;
|
||||
analysis.UNFINISH_QTY = unfinish;
|
||||
analysis.FINISH_RATE = finishRate;
|
||||
analysis.NORMAL_FINISH_RATE = normalFinishRate;
|
||||
formAnalysis.Add(analysis);
|
||||
}
|
||||
#endregion
|
||||
|
||||
//#region 班组安全活动
|
||||
//if (teamActive.Any())
|
||||
//{
|
||||
@ -7491,68 +7225,6 @@ namespace APT.SC.WebApi.Controllers.Api.BIController
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(filter.Parameter3) && !string.IsNullOrEmpty(filter.Parameter4)
|
||||
&& filter.Parameter3 == "法律法规与其他要求" && filter.Parameter4 == "安全生产法律法规需求识别表")
|
||||
{
|
||||
//法律法规与其他要求
|
||||
newFilter.SelectField = new List<string> { "ID", "NAME", "DISTINGUISH_TYPE", "DEPARTMENT_ID", "CREATER_ID", "CREATE_TIME" };
|
||||
//安全生产法律法规需求识别表
|
||||
var delayApply = this.GetEntities<T_LR_DEMAND_DISTINGUISH>(t => t.CREATE_TIME >= startTime && t.CREATE_TIME <= endTime && t.DEPARTMENT_ID!=null
|
||||
&& t.DISTINGUISH_TYPE != LRDistinguishEnum.已识别, newFilter).ToList();
|
||||
if (!string.IsNullOrEmpty(filter.Keyword))
|
||||
{
|
||||
delayApply = delayApply.Where(t => outPartmentIds.Contains((Guid)t.DEPARTMENT_ID)).ToList();
|
||||
}
|
||||
//人员
|
||||
newFilter.SelectField = new List<string> { "NAME", "Nav_Department" };
|
||||
var userInfo = this.GetEntities<T_FM_USER>(t => t.ENABLE_STATUS == 0, newFilter).ToList();
|
||||
#region 安全生产法律法规需求识别表
|
||||
if (delayApply.Any())
|
||||
{
|
||||
delayApply.ForEach(t =>
|
||||
{
|
||||
UnFinishInfo analysis = new UnFinishInfo();
|
||||
analysis.NAME = t.NAME;
|
||||
analysis.CREATE_NAME = userInfo.FirstOrDefault(m => m.ID == t.CREATER_ID)?.NAME;
|
||||
analysis.DEPARTMENT_NAME = userInfo.FirstOrDefault(m => m.ID == t.CREATER_ID)?.Nav_Department?.NAME;
|
||||
analysis.CREATE_TIME = t.CREATE_TIME;
|
||||
analysis.STATUS_NAME = Enum.GetName(typeof(LRDistinguishEnum), t.DISTINGUISH_TYPE);
|
||||
formAnalysis.Add(analysis);
|
||||
});
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
if (!string.IsNullOrEmpty(filter.Parameter3) && !string.IsNullOrEmpty(filter.Parameter4)
|
||||
&& filter.Parameter3 == "法律法规与其他要求" && filter.Parameter4 == "获取清单")
|
||||
{
|
||||
//获取清单
|
||||
newFilter.SelectField = new List<string> { "ID", "NAME", "LEGAL_STATUS", "DEPARTMENT_ID", "CREATER_ID", "CREATE_TIME" };
|
||||
var shiftRecord = this.GetEntities<T_LR_LEGAL_LIST>(t => t.CREATE_TIME >= startTime && t.CREATE_TIME <= endTime && t.DEPARTMENT_ID!=null
|
||||
&& t.LEGAL_STATUS != PFStandardStatus.Archived, newFilter).ToList();
|
||||
if (!string.IsNullOrEmpty(filter.Keyword))
|
||||
{
|
||||
shiftRecord = shiftRecord.Where(t => outPartmentIds.Contains((Guid)t.DEPARTMENT_ID)).ToList();
|
||||
}
|
||||
//人员
|
||||
newFilter.SelectField = new List<string> { "NAME", "Nav_Department" };
|
||||
var userInfo = this.GetEntities<T_FM_USER>(t => t.ENABLE_STATUS == 0, newFilter).ToList();
|
||||
#region 获取清单
|
||||
if (shiftRecord.Any())
|
||||
{
|
||||
shiftRecord.ForEach(t =>
|
||||
{
|
||||
UnFinishInfo analysis = new UnFinishInfo();
|
||||
analysis.NAME = t.NAME;
|
||||
analysis.CREATE_NAME = userInfo.FirstOrDefault(m => m.ID == t.CREATER_ID)?.NAME;
|
||||
analysis.DEPARTMENT_NAME = userInfo.FirstOrDefault(m => m.ID == t.CREATER_ID)?.Nav_Department?.NAME;
|
||||
analysis.CREATE_TIME = t.CREATE_TIME;
|
||||
analysis.STATUS_NAME = Enum.GetName(typeof(PFStandardStatus), t.LEGAL_STATUS);
|
||||
formAnalysis.Add(analysis);
|
||||
});
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
if (!string.IsNullOrEmpty(filter.Parameter3) && !string.IsNullOrEmpty(filter.Parameter4)
|
||||
&& filter.Parameter3 == "安全生产组织保障" && filter.Parameter4 == "安全生产责任制签订表")
|
||||
{
|
||||
|
||||
@ -1,147 +0,0 @@
|
||||
using APT.BaseData.Domain.Entities;
|
||||
using APT.BaseData.Domain.Enums;
|
||||
using APT.BaseData.Domain.IServices.FM;
|
||||
using APT.Infrastructure.Core;
|
||||
using APT.MS.Domain.Entities.LR;
|
||||
using APT.MS.Domain.Enums;
|
||||
using APT.Utility;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace APT.LR.WebApi.Controllers.Api
|
||||
{
|
||||
[Route("api/LR/LRDemandDistinguish")]
|
||||
public class DemandDistinguishController : AuthorizeApiController<T_LR_DEMAND_DISTINGUISH>
|
||||
{
|
||||
IFMNotificationTaskService NotificationTaskService { get; set; }
|
||||
public DemandDistinguishController(IFMNotificationTaskService notificationTaskService)
|
||||
{
|
||||
NotificationTaskService = notificationTaskService;
|
||||
}
|
||||
/// <summary>
|
||||
/// 保存
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost, Route("FullUpdate")]
|
||||
public JsonActionResult<bool> FullUpdate([FromBody] T_LR_DEMAND_DISTINGUISH entity)
|
||||
{
|
||||
return SafeExecute<bool>(() =>
|
||||
{
|
||||
T_FM_NOTIFICATION_TASK finishNotice = null;
|
||||
if (DateTime.Now > entity.END_TIME)
|
||||
{
|
||||
finishNotice = NotificationTaskService.GetTaskFinishModel(entity.TaskID, "LR001_SHOWPRINT");
|
||||
UpdateEntity(finishNotice);
|
||||
throw new Exception("已过截止时间!");
|
||||
}
|
||||
if (entity.Nav_DemandLaw.Count() == 0)
|
||||
{
|
||||
throw new Exception("请对法律法规识别再进行提交!");
|
||||
}
|
||||
var userID = APT.Infrastructure.Api.AppContext.CurrentSession.UserID;
|
||||
if (entity.USER_ID.Equals(Guid.Empty))
|
||||
{
|
||||
entity.USER_ID = (Guid)userID;
|
||||
}
|
||||
if (entity.YEARS == 0)
|
||||
{
|
||||
entity.YEARS = DateTime.Now.Year;
|
||||
}
|
||||
if (entity.DISTINGUISH_TIME==null)
|
||||
{
|
||||
entity.DISTINGUISH_TIME = DateTime.Now;
|
||||
}
|
||||
BaseFilter basefilter = new BaseFilter(entity.ORG_ID);
|
||||
List<T_LR_OTHER_DISTINGUISH> otherDistinguishList = new List<T_LR_OTHER_DISTINGUISH>();
|
||||
List<T_LR_DEMAND_USER> DemandUserList = new List<T_LR_DEMAND_USER>();
|
||||
var demandLaw = entity.Nav_DemandLaw;
|
||||
var demandOther = entity.Nav_DemandOther;
|
||||
var demandType = entity.Nav_DemandTypes;
|
||||
basefilter.SelectField = new string[] { "ID", "NAME" };
|
||||
var demandIds = demandType.Where(x => x.IS_DELETED == false).Select(x => x.DEMANDTYPE_ID);
|
||||
var alldemands = GetEntities<T_LR_LAW_TYPE>(t => demandIds.Contains(t.ID), basefilter);
|
||||
foreach (var item in demandType)
|
||||
{
|
||||
item.Nav_DemandType = null;
|
||||
}
|
||||
foreach (var demand in alldemands)
|
||||
{
|
||||
entity.demandTypeStr += demand.NAME+",";
|
||||
}
|
||||
entity.Nav_DemandLaw = null;
|
||||
entity.Nav_DemandOther = null;
|
||||
entity.Nav_DemandTypes = null;
|
||||
if (demandOther != null && demandOther.Count() > 0)
|
||||
{
|
||||
var otherDistinguishs = GetEntities<T_LR_OTHER_DISTINGUISH>(t => t.IS_DELETED == false, new BaseFilter(entity.ORG_ID)).ToList();
|
||||
demandOther.ForEach(t =>
|
||||
{
|
||||
t.Nav_DemandDistinguish = null;
|
||||
if (t.NAME != null)
|
||||
{
|
||||
var otherDistinguish = otherDistinguishs.Where(o => o.NAME == t.NAME).FirstOrDefault();
|
||||
if (otherDistinguish == null)//不存在则需要新增
|
||||
{
|
||||
T_LR_OTHER_DISTINGUISH newOtherDistinguish = new T_LR_OTHER_DISTINGUISH();
|
||||
newOtherDistinguish.ID = Guid.NewGuid();
|
||||
newOtherDistinguish.NAME = t.NAME;
|
||||
newOtherDistinguish.ORG_ID = entity.ORG_ID;
|
||||
otherDistinguishList.Add(newOtherDistinguish);
|
||||
t.OTHER_ID = newOtherDistinguish.ID;
|
||||
T_LR_DEMAND_USER user = new T_LR_DEMAND_USER();
|
||||
user.ID = Guid.NewGuid();
|
||||
user.OTHER_ID = t.OTHER_ID;
|
||||
user.USER_ID = userID.Value;
|
||||
user.ORG_ID = entity.ORG_ID;
|
||||
DemandUserList.Add(user);
|
||||
}
|
||||
else//存在则需要判断是否新增当前用户到其他识别表中
|
||||
{
|
||||
t.OTHER_ID = otherDistinguish.ID;
|
||||
var demand = GetEntity<T_LR_DEMAND_USER>(d => d.USER_ID == userID && d.OTHER_ID == t.OTHER_ID, new BaseFilter());
|
||||
if (demand == null) //没有该用户则需要新增
|
||||
{
|
||||
T_LR_DEMAND_USER user = new T_LR_DEMAND_USER();
|
||||
user.ID = Guid.NewGuid();
|
||||
user.OTHER_ID = t.OTHER_ID;
|
||||
user.USER_ID = userID.Value;
|
||||
user.ORG_ID = entity.ORG_ID;
|
||||
DemandUserList.Add(user);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
if (entity.PUBLISH != null && entity.PUBLISH.Equals("SaveAndNotify"))
|
||||
{
|
||||
entity.DISTINGUISH_TYPE = LRDistinguishEnum.已识别;
|
||||
if (entity.TaskID != Guid.Empty)
|
||||
{
|
||||
finishNotice = NotificationTaskService.GetTaskFinishModel(entity.TaskID, "LR001_SHOWPRINT");
|
||||
}
|
||||
}
|
||||
UnifiedCommit(() =>
|
||||
{
|
||||
UpdateEntityNoCommit(entity);
|
||||
if (demandLaw != null && demandLaw.Any())
|
||||
BantchSaveEntityNoCommit(demandLaw);
|
||||
if (demandOther != null && demandOther.Any())
|
||||
BantchSaveEntityNoCommit(demandOther);
|
||||
if (demandType != null && demandType.Any())
|
||||
BantchSaveEntityNoCommit(demandType);
|
||||
//插入其他识别用户
|
||||
if (otherDistinguishList.Any())
|
||||
BantchSaveEntityNoCommit(otherDistinguishList);
|
||||
if (DemandUserList.Any())
|
||||
BantchSaveEntityNoCommit(DemandUserList);
|
||||
if (finishNotice != null)
|
||||
UpdateEntityNoCommit(finishNotice);
|
||||
});
|
||||
return true;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,374 +0,0 @@
|
||||
using APT.BaseData.Domain.Entities;
|
||||
using APT.BaseData.Domain.Entities.FM;
|
||||
using APT.BaseData.Domain.IServices.FM;
|
||||
using APT.Infrastructure.Core;
|
||||
using APT.MS.Domain.Entities.LR;
|
||||
using APT.MS.Domain.Enums;
|
||||
using APT.Utility;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace APT.LR.WebApi.Controllers.Api
|
||||
{
|
||||
[Route("api/LR/LRDemandDistinguishReport")]
|
||||
public class DemandDistinguishReportController : AuthorizeApiController<T_LR_DEMAND_DISTINGUISH_REPORT>
|
||||
{
|
||||
IFMNotificationTaskService NotificationTaskService { get; set; }
|
||||
public DemandDistinguishReportController(IFMNotificationTaskService notificationTaskService)
|
||||
{
|
||||
NotificationTaskService = notificationTaskService;
|
||||
}
|
||||
/// <summary>
|
||||
/// 保存
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost, Route("FullUpdate")]
|
||||
public JsonActionResult<bool> FullUpdate([FromBody] T_LR_DEMAND_DISTINGUISH_REPORT entity)
|
||||
{
|
||||
return SafeExecute<bool>(() =>
|
||||
{
|
||||
var demandReportDetail = entity.Nav_DemandReportDetail;
|
||||
entity.Nav_DemandReportDetail = null;
|
||||
T_FM_NOTIFICATION_TASK finishNotice = null;
|
||||
if (entity.PUBLISH != null && entity.PUBLISH.Equals("SaveAndNotify"))
|
||||
{
|
||||
if (entity.TaskID != Guid.Empty)
|
||||
{
|
||||
finishNotice = NotificationTaskService.GetTaskFinishModel(entity.TaskID);
|
||||
}
|
||||
}
|
||||
UnifiedCommit(() =>
|
||||
{
|
||||
UpdateEntityNoCommit(entity);
|
||||
if (demandReportDetail != null && demandReportDetail.Any())
|
||||
BantchSaveEntityNoCommit(demandReportDetail);
|
||||
if (finishNotice != null)
|
||||
UpdateEntityNoCommit(finishNotice);
|
||||
});
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 由“安全生产法律法规需求识别“形成部门、公司级分析表
|
||||
/// </summary>
|
||||
/// <param name="filter"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet, Route("DistinguishReport")]
|
||||
public JsonActionResult<bool> DistinguishReport()
|
||||
{
|
||||
return SafeExecute<bool>(() =>
|
||||
{
|
||||
List<T_LR_DEMAND_DISTINGUISH_REPORT_DETAIL> demandReportDetails = new List<T_LR_DEMAND_DISTINGUISH_REPORT_DETAIL>();
|
||||
List<T_LR_DEMAND_DISTINGUISH_REPORT> demandReports = new List<T_LR_DEMAND_DISTINGUISH_REPORT>();
|
||||
DateTime dateTimeNow = DateTime.Now;
|
||||
List<T_LR_DEMAND_DISTINGUISH> demandDistinguish = GetEntities<T_LR_DEMAND_DISTINGUISH>(t => t.DISTINGUISH_TYPE == LRDistinguishEnum.未识别 && t.YEARS == dateTimeNow.Year, new BaseFilter(), new string[] { "Nav_DemandLaw.Nav_Law", "Nav_DemandOther.Nav_OtherDistinguish.Nav_DemandUser.Nav_User", "Nav_Department" }).ToList();
|
||||
var department = GetEntities<T_FM_DEPARTMENT>(null, new BaseFilter()).ToList();
|
||||
var user = GetEntities<T_FM_USER>(null, new BaseFilter()).ToList();
|
||||
var allDistinguish = GetEntities<T_LR_DEMAND_DISTINGUISH_REPORT>(c => c.YEARS == dateTimeNow.Year, new BaseFilter()).ToList();
|
||||
var config = GetEntity<T_LR_LRCONFIG>(null, new BaseFilter());
|
||||
if (config != null && config.DEMAND_END_TIME != null)
|
||||
{
|
||||
if (config.DEMAND_END_TIME.Date == dateTimeNow.Date)//日期相同则
|
||||
{
|
||||
if (department != null && department.Count() > 0)
|
||||
{
|
||||
department.ForEach(t =>
|
||||
{
|
||||
if (t.PARENT_ID == null)//公司
|
||||
{
|
||||
var distinguishCompany = allDistinguish.Where(c => c.DEPARTMENT_ID == t.ID).ToList();
|
||||
if (distinguishCompany == null || distinguishCompany.Count() == 0)
|
||||
{
|
||||
T_LR_DEMAND_DISTINGUISH_REPORT distinguishReportCompany = new T_LR_DEMAND_DISTINGUISH_REPORT();
|
||||
distinguishReportCompany.ID = Guid.NewGuid();
|
||||
distinguishReportCompany.DEPARTMENT_ID = t.ID;
|
||||
distinguishReportCompany.YEARS = dateTimeNow.Year;
|
||||
distinguishReportCompany.REPORT_TIME = dateTimeNow;
|
||||
distinguishReportCompany.INVESTIGATE_TIMES = user.Count();
|
||||
distinguishReportCompany.FEEDBACK_TIMES = demandDistinguish.Count();
|
||||
if (user.Count() >= 0 && demandDistinguish.Count() >= 0)
|
||||
{
|
||||
double demandDistinguishCount = demandDistinguish.Count();
|
||||
double userCount = user.Count();
|
||||
distinguishReportCompany.FEEDBACK_RATE = ((demandDistinguishCount / userCount) * 100).ToString("#0.00");
|
||||
}
|
||||
else
|
||||
{
|
||||
distinguishReportCompany.FEEDBACK_RATE = "0";
|
||||
}
|
||||
distinguishReportCompany.ORG_ID = t.ORG_ID;
|
||||
demandReports.Add(distinguishReportCompany);
|
||||
demandDistinguish.ForEach(d =>
|
||||
{
|
||||
if (d.Nav_DemandLaw != null && d.Nav_DemandLaw.Count() > 0)//法律法规
|
||||
{
|
||||
d.Nav_DemandLaw.ForEach(l =>
|
||||
{
|
||||
if (l.Nav_DemandDistinguish != null && l.Nav_DemandDistinguish.NAME != null)
|
||||
{
|
||||
if (demandReportDetails.Any(r => r.DEMAND_NAME.Contains(l.Nav_DemandDistinguish.NAME) && r.IS_OTHER == 0))//已经存在则加人数和部门
|
||||
{
|
||||
demandReportDetails.ForEach(s =>
|
||||
{
|
||||
if (s.DEMAND_NAME == l.Nav_DemandDistinguish.NAME && s.IS_OTHER == 0)
|
||||
{
|
||||
s.DEMAND_TIMES += 1;
|
||||
if (d.Nav_Department != null && d.Nav_Department.NAME != null)
|
||||
{
|
||||
if (string.IsNullOrEmpty(s.DEMAND_DEPARTMENT))
|
||||
{
|
||||
s.DEMAND_DEPARTMENT = d.Nav_Department.NAME;
|
||||
}
|
||||
else
|
||||
{
|
||||
s.DEMAND_DEPARTMENT += "|" + d.Nav_Department.NAME;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
if (d.Nav_Department != null && d.Nav_Department.NAME != null)
|
||||
{
|
||||
T_LR_DEMAND_DISTINGUISH_REPORT_DETAIL newDemandReportDetail = new T_LR_DEMAND_DISTINGUISH_REPORT_DETAIL();
|
||||
newDemandReportDetail.DEMAND_DEPARTMENT = d.Nav_Department.NAME;
|
||||
newDemandReportDetail.DEMAND_NAME = l.Nav_DemandDistinguish.NAME;
|
||||
newDemandReportDetail.DEMAND_PERSON = "无";
|
||||
newDemandReportDetail.DEMAND_TIMES = 1;
|
||||
newDemandReportDetail.IS_OTHER = 0;
|
||||
newDemandReportDetail.ORG_ID = d.ORG_ID;
|
||||
newDemandReportDetail.REPORT_ID = distinguishReportCompany.ID;
|
||||
demandReportDetails.Add(newDemandReportDetail);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
if (d.Nav_DemandOther != null && d.Nav_DemandOther.Count() > 0)//其他
|
||||
{
|
||||
d.Nav_DemandOther.ForEach(o =>
|
||||
{
|
||||
if (o.Nav_OtherDistinguish != null && o.Nav_OtherDistinguish.NAME != null)
|
||||
{
|
||||
if (demandReportDetails.Any(r => r.DEMAND_NAME.Contains(o.Nav_OtherDistinguish.NAME) && r.IS_OTHER == 1))//已经存在则加人数和部门
|
||||
{
|
||||
demandReportDetails.ForEach(s =>
|
||||
{
|
||||
if (s.DEMAND_NAME == o.Nav_OtherDistinguish.NAME && s.IS_OTHER == 1)
|
||||
{
|
||||
s.DEMAND_TIMES += 1;
|
||||
if (d.Nav_Department != null && d.Nav_Department.NAME != null)
|
||||
{
|
||||
if (string.IsNullOrEmpty(s.DEMAND_DEPARTMENT))
|
||||
{
|
||||
s.DEMAND_DEPARTMENT = d.Nav_Department.NAME;
|
||||
}
|
||||
else
|
||||
{
|
||||
s.DEMAND_DEPARTMENT += "|" + d.Nav_Department.NAME;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
if (d.Nav_Department != null && d.Nav_Department.NAME != null)
|
||||
{
|
||||
T_LR_DEMAND_DISTINGUISH_REPORT_DETAIL newDemandReportDetail = new T_LR_DEMAND_DISTINGUISH_REPORT_DETAIL();
|
||||
newDemandReportDetail.DEMAND_DEPARTMENT = d.Nav_Department.NAME;
|
||||
newDemandReportDetail.DEMAND_NAME = o.Nav_OtherDistinguish.NAME;
|
||||
string DEMAND_PERSON = string.Empty;
|
||||
if (o.Nav_OtherDistinguish.Nav_DemandUser != null && o.Nav_OtherDistinguish.Nav_DemandUser.Count() > 0)
|
||||
{
|
||||
o.Nav_OtherDistinguish.Nav_DemandUser.ForEach(od =>
|
||||
{
|
||||
if (od.Nav_User != null && od.Nav_User.NAME != null)
|
||||
{
|
||||
if (string.IsNullOrEmpty(DEMAND_PERSON))
|
||||
{
|
||||
DEMAND_PERSON = od.Nav_User.NAME;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEMAND_PERSON += "|" + od.Nav_User.NAME;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
newDemandReportDetail.DEMAND_PERSON = DEMAND_PERSON;
|
||||
newDemandReportDetail.DEMAND_TIMES = 1;
|
||||
newDemandReportDetail.IS_OTHER = 1;
|
||||
newDemandReportDetail.ORG_ID = d.ORG_ID;
|
||||
newDemandReportDetail.REPORT_ID = distinguishReportCompany.ID;
|
||||
demandReportDetails.Add(newDemandReportDetail);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
var distinguishDepartment = allDistinguish.Where(c => c.DEPARTMENT_ID == t.ID).ToList();
|
||||
if (distinguishDepartment == null || distinguishDepartment.Count() == 0)
|
||||
{
|
||||
var demandDistinguishDepartment = demandDistinguish.Where(d => d.DEPARTMENT_ID == t.ID).ToList();
|
||||
T_LR_DEMAND_DISTINGUISH_REPORT distinguishReportDepartment = new T_LR_DEMAND_DISTINGUISH_REPORT();
|
||||
distinguishReportDepartment.ID = Guid.NewGuid();
|
||||
distinguishReportDepartment.DEPARTMENT_ID = t.ID;
|
||||
distinguishReportDepartment.YEARS = dateTimeNow.Year;
|
||||
distinguishReportDepartment.REPORT_TIME = dateTimeNow;
|
||||
distinguishReportDepartment.INVESTIGATE_TIMES = user.Count();
|
||||
distinguishReportDepartment.FEEDBACK_TIMES = demandDistinguishDepartment.Count();
|
||||
if (user.Count() >= 0 && demandDistinguishDepartment.Count() >= 0)
|
||||
{
|
||||
double demandDistinguishDepartmentCount = demandDistinguishDepartment.Count();
|
||||
double userCount = user.Count();
|
||||
distinguishReportDepartment.FEEDBACK_RATE = ((demandDistinguishDepartmentCount / userCount) * 100).ToString("#0.00");
|
||||
}
|
||||
else
|
||||
{
|
||||
distinguishReportDepartment.FEEDBACK_RATE = "0";
|
||||
}
|
||||
distinguishReportDepartment.ORG_ID = t.ORG_ID;
|
||||
demandReports.Add(distinguishReportDepartment);
|
||||
demandDistinguishDepartment.ForEach(d =>
|
||||
{
|
||||
if (d.Nav_DemandLaw != null && d.Nav_DemandLaw.Count() > 0)//法律法规
|
||||
{
|
||||
d.Nav_DemandLaw.ForEach(l =>
|
||||
{
|
||||
if (l.Nav_DemandDistinguish != null && l.Nav_DemandDistinguish.NAME != null)
|
||||
{
|
||||
if (demandReportDetails.Any(r => r.DEMAND_NAME.Contains(l.Nav_DemandDistinguish.NAME) && r.IS_OTHER == 0))//已经存在则加人数和部门
|
||||
{
|
||||
demandReportDetails.ForEach(s =>
|
||||
{
|
||||
if (s.DEMAND_NAME == l.Nav_DemandDistinguish.NAME && s.IS_OTHER == 0)
|
||||
{
|
||||
s.DEMAND_TIMES += 1;
|
||||
if (d.Nav_Department != null && d.Nav_Department.NAME != null)
|
||||
{
|
||||
if (string.IsNullOrEmpty(s.DEMAND_DEPARTMENT))
|
||||
{
|
||||
s.DEMAND_DEPARTMENT = d.Nav_Department.NAME;
|
||||
}
|
||||
else
|
||||
{
|
||||
s.DEMAND_DEPARTMENT += "|" + d.Nav_Department.NAME;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
if (d.Nav_Department != null && d.Nav_Department.NAME != null)
|
||||
{
|
||||
T_LR_DEMAND_DISTINGUISH_REPORT_DETAIL newDemandReportDetail = new T_LR_DEMAND_DISTINGUISH_REPORT_DETAIL();
|
||||
newDemandReportDetail.DEMAND_DEPARTMENT = d.Nav_Department.NAME;
|
||||
newDemandReportDetail.DEMAND_NAME = l.Nav_DemandDistinguish.NAME;
|
||||
newDemandReportDetail.DEMAND_PERSON = "无";
|
||||
newDemandReportDetail.DEMAND_TIMES = 1;
|
||||
newDemandReportDetail.IS_OTHER = 0;
|
||||
newDemandReportDetail.ORG_ID = d.ORG_ID;
|
||||
newDemandReportDetail.REPORT_ID = distinguishReportDepartment.ID;
|
||||
demandReportDetails.Add(newDemandReportDetail);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
if (d.Nav_DemandOther != null && d.Nav_DemandOther.Count() > 0)//其他
|
||||
{
|
||||
d.Nav_DemandOther.ForEach(o =>
|
||||
{
|
||||
if (o.Nav_OtherDistinguish != null && o.Nav_OtherDistinguish.NAME != null)
|
||||
{
|
||||
if (demandReportDetails.Any(r => r.DEMAND_NAME.Contains(o.Nav_OtherDistinguish.NAME) && r.IS_OTHER == 1))//已经存在则加人数和部门
|
||||
{
|
||||
demandReportDetails.ForEach(s =>
|
||||
{
|
||||
if (s.DEMAND_NAME == o.Nav_OtherDistinguish.NAME && s.IS_OTHER == 1)
|
||||
{
|
||||
s.DEMAND_TIMES += 1;
|
||||
if (d.Nav_Department != null && d.Nav_Department.NAME != null)
|
||||
{
|
||||
if (string.IsNullOrEmpty(s.DEMAND_DEPARTMENT))
|
||||
{
|
||||
s.DEMAND_DEPARTMENT = d.Nav_Department.NAME;
|
||||
}
|
||||
else
|
||||
{
|
||||
s.DEMAND_DEPARTMENT += "|" + d.Nav_Department.NAME;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
if (d.Nav_Department != null && d.Nav_Department.NAME != null)
|
||||
{
|
||||
T_LR_DEMAND_DISTINGUISH_REPORT_DETAIL newDemandReportDetail = new T_LR_DEMAND_DISTINGUISH_REPORT_DETAIL();
|
||||
newDemandReportDetail.DEMAND_DEPARTMENT = d.Nav_Department.NAME;
|
||||
newDemandReportDetail.DEMAND_NAME = o.Nav_OtherDistinguish.NAME;
|
||||
string DEMAND_PERSON = string.Empty;
|
||||
if (o.Nav_OtherDistinguish.Nav_DemandUser != null && o.Nav_OtherDistinguish.Nav_DemandUser.Count() > 0)
|
||||
{
|
||||
o.Nav_OtherDistinguish.Nav_DemandUser.ForEach(od =>
|
||||
{
|
||||
if (od.Nav_User != null && od.Nav_User.NAME != null)
|
||||
{
|
||||
if (string.IsNullOrEmpty(DEMAND_PERSON))
|
||||
{
|
||||
DEMAND_PERSON = od.Nav_User.NAME;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEMAND_PERSON += "|" + od.Nav_User.NAME;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
newDemandReportDetail.DEMAND_PERSON = DEMAND_PERSON;
|
||||
newDemandReportDetail.DEMAND_TIMES = 1;
|
||||
newDemandReportDetail.IS_OTHER = 1;
|
||||
newDemandReportDetail.ORG_ID = d.ORG_ID;
|
||||
newDemandReportDetail.REPORT_ID = distinguishReportDepartment.ID;
|
||||
demandReportDetails.Add(newDemandReportDetail);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
UnifiedCommit(() =>
|
||||
{
|
||||
if (demandReportDetails.Any())
|
||||
BantchAddEntity(demandReportDetails);
|
||||
if (demandReports.Any())
|
||||
BantchAddEntity(demandReports);
|
||||
});
|
||||
}
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,380 +0,0 @@
|
||||
using APT.BaseData.Domain.Entities;
|
||||
using APT.BaseData.Domain.Entities.FM;
|
||||
using APT.BaseData.Domain.Enums.PF;
|
||||
using APT.BaseData.Domain.IServices;
|
||||
using APT.BaseData.Domain.IServices.FM;
|
||||
using APT.BaseData.Services.DomainServices;
|
||||
using APT.BaseData.Services.Services.FM;
|
||||
using APT.Infrastructure.Core;
|
||||
using APT.MS.Domain.Entities.HM;
|
||||
using APT.MS.Domain.Entities.LR;
|
||||
using APT.MS.Domain.Enums;
|
||||
using APT.Utility;
|
||||
using ICSharpCode.SharpZipLib.Core;
|
||||
using InfluxData.Net.InfluxDb.Models.Responses;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using static NPOI.HSSF.Util.HSSFColor;
|
||||
|
||||
namespace APT.LR.WebApi.Controllers.Api
|
||||
{
|
||||
[Route("api/LR/LRLegalList")]
|
||||
public class LegalListController : AuthorizeApiController<T_LR_LEGAL_LIST>
|
||||
{
|
||||
IFMNotificationTaskService NotificationTaskService { get; set; }
|
||||
public LegalListController(IFMNotificationTaskService notificationTaskService)
|
||||
{
|
||||
NotificationTaskService = notificationTaskService;
|
||||
}
|
||||
/// <summary>
|
||||
/// 保存
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost, Route("FullUpdate")]
|
||||
public JsonActionResult<bool> FullUpdate([FromBody] T_LR_LEGAL_LIST entity)
|
||||
{
|
||||
return SafeExecute<bool>(() =>
|
||||
{
|
||||
var legalListDetail = entity.Nav_LegalListDetail;
|
||||
entity.Nav_LegalListDetail = null;
|
||||
entity.YEARS = entity.DISTINGUISH_TIME.Year;
|
||||
List<T_LR_LEGAL_LIST_DETAIL_USER> users = new List<T_LR_LEGAL_LIST_DETAIL_USER>();
|
||||
List<T_LR_LEGAL_LIST_DETAIL_FILE> files = new List<T_LR_LEGAL_LIST_DETAIL_FILE>();
|
||||
entity.LEGAL_STATUS = PFStandardStatus.Sign;
|
||||
legalListDetail.ForEach(detail =>
|
||||
{
|
||||
if (detail.Nav_LegalListDetailUser != null)
|
||||
{
|
||||
users.AddRange(detail.Nav_LegalListDetailUser);
|
||||
detail.Nav_LegalListDetailUser = null;
|
||||
}
|
||||
if (detail.Nav_Files != null)
|
||||
{
|
||||
files.AddRange(detail.Nav_Files);
|
||||
detail.Nav_Files = null;
|
||||
}
|
||||
});
|
||||
|
||||
if (entity.USER_ID == Guid.Empty)
|
||||
{
|
||||
entity.USER_ID = (Guid)APT.Infrastructure.Api.AppContext.CurrentSession.UserID;
|
||||
}
|
||||
if (entity.DEPARTMENT_ID == Guid.Empty)
|
||||
{
|
||||
entity.DEPARTMENT_ID = (Guid)GetEntity<T_FM_USER>(entity.USER_ID).DEPARTMENT_ID;
|
||||
}
|
||||
List<T_FM_NOTIFICATION_TASK> sendNotices = null;
|
||||
T_FM_NOTIFICATION_TASK finishNotice = null;
|
||||
|
||||
if (entity.PUBLISH != null && entity.PUBLISH.Equals("SaveAndNotify"))
|
||||
{
|
||||
List<Guid> userIds = new List<Guid>();
|
||||
List<string> userNames = new List<string>();
|
||||
List<string> titles = new List<string>();
|
||||
List<Guid> dataIds = new List<Guid>();
|
||||
if (legalListDetail == null && legalListDetail.Any())
|
||||
{
|
||||
throw new Exception("获取清单明细不能为空!");
|
||||
}
|
||||
var allChargeUsers = legalListDetail.Select(t => t.USER_ID).Distinct();
|
||||
BaseFilter basefilter = new BaseFilter(entity.ORG_ID);
|
||||
var usersNames = GetEntities<T_FM_USER>(t => allChargeUsers.Contains(t.ID), basefilter);
|
||||
allChargeUsers.ForEach(user =>
|
||||
{
|
||||
titles.Add("安全生产法律法规获取清单-待获取");
|
||||
dataIds.Add(entity.ID);
|
||||
userIds.Add((Guid)user);
|
||||
userNames.Add(usersNames.FirstOrDefault(t => t.ID == (Guid)user).NAME);
|
||||
});
|
||||
sendNotices = NotificationTaskService.InsertUserNoticeTaskModels(titles, dataIds, entity.ORG_ID, userIds, userNames, DateTime.Now, entity.LEGAL_END_TIME.Value, 0, "LR023");
|
||||
finishNotice = NotificationTaskService.GetTaskFinishModel(entity.TaskID);
|
||||
}
|
||||
UnifiedCommit(() =>
|
||||
{
|
||||
UpdateEntityNoCommit(entity);
|
||||
if (users != null && users.Any())
|
||||
BantchSaveEntityNoCommit(users);
|
||||
if (files != null && files.Any())
|
||||
BantchSaveEntityNoCommit(files);
|
||||
if (legalListDetail != null && legalListDetail.Any())
|
||||
BantchSaveEntityNoCommit(legalListDetail);
|
||||
if (sendNotices != null)
|
||||
BantchAddEntityNoCommit(sendNotices);
|
||||
if (finishNotice != null)
|
||||
UpdateEntityNoCommit(finishNotice);
|
||||
});
|
||||
|
||||
return true;
|
||||
});
|
||||
}
|
||||
/// <summary>
|
||||
/// 保存
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost, Route("DetailUpdate")]
|
||||
public JsonActionResult<bool> DetailUpdate([FromBody] T_LR_LEGAL_LIST entity)
|
||||
{
|
||||
return SafeExecute<bool>(() =>
|
||||
{
|
||||
var UserID = APT.Infrastructure.Api.AppContext.CurrentSession.UserID;
|
||||
if (entity.USER_ID == Guid.Empty)
|
||||
{
|
||||
entity.USER_ID = (Guid)UserID;
|
||||
}
|
||||
if (entity.DEPARTMENT_ID == Guid.Empty)
|
||||
{
|
||||
entity.DEPARTMENT_ID = (Guid)GetEntity<T_FM_USER>(entity.USER_ID.ToString()).DEPARTMENT_ID;
|
||||
}
|
||||
var legalListDetail = entity.Nav_LegalListDetail;
|
||||
entity.Nav_LegalListDetail = null;
|
||||
List<T_LR_LEGAL_LIST_DETAIL_USER> users = new List<T_LR_LEGAL_LIST_DETAIL_USER>();
|
||||
List<T_LR_LEGAL_LIST_DETAIL_FILE> files = new List<T_LR_LEGAL_LIST_DETAIL_FILE>();
|
||||
List<T_FM_NOTIFICATION_TASK> sendNotices = null;
|
||||
List<T_LR_LAW> laws = new List<T_LR_LAW>();
|
||||
List<T_LR_LAW_VERSION> lawVersions = new List<T_LR_LAW_VERSION>();
|
||||
List<T_LR_LAW_VERSION_FILE> lawVersionFiles = new List<T_LR_LAW_VERSION_FILE>();
|
||||
T_LR_LAW_INTEGRATE lawIntegrate = null;
|
||||
List<T_LR_LAW_INTEGRATE_DETAIL> lawIntegrateDetails = new List<T_LR_LAW_INTEGRATE_DETAIL>();
|
||||
T_FM_NOTIFICATION_TASK finishNotice = new T_FM_NOTIFICATION_TASK();
|
||||
List<T_LR_LAW> existLaws = new List<T_LR_LAW>();
|
||||
if (entity.PUBLISH != null && entity.PUBLISH.Equals("SaveAndNotify"))
|
||||
{
|
||||
if(entity.LEGAL_STATUS== PFStandardStatus.Archived)
|
||||
{
|
||||
throw new Exception("状态已归档不允许修改!");
|
||||
}
|
||||
BaseFilter basefilter = new BaseFilter(entity.ORG_ID);
|
||||
basefilter.SelectField = new string[] { "ID", "NAME", "DEPARTMENT_ID", "Nav_ApproveRole.NAME", "Nav_Department.Nav_User" };
|
||||
var allUsers = GetEntities<T_FM_USER>(t => t.ENABLE_STATUS == 0 && t.IS_DELETED == false, basefilter);
|
||||
var allLaws = GetEntities<T_LR_LAW>(t => t.LAW_STATUS== BSLawStatusEnum.现行, new BaseFilter(entity.ORG_ID),new string[] { "Nav_LawVersion", "Nav_LawSCSystem" });
|
||||
List<Guid> userIds = new List<Guid>();
|
||||
List<string> userNames = new List<string>();
|
||||
List<string> titles = new List<string>();
|
||||
List<Guid> dataIds = new List<Guid>();
|
||||
List<string> formCodes = new List<string>();
|
||||
|
||||
string title = "新增法律法规";
|
||||
|
||||
foreach (var item in legalListDetail)
|
||||
{
|
||||
//1有附件自动更新到法律法规
|
||||
if (item.FILE_STATUS == LRLegalFileStatusEnum.否 && item.Nav_Files == null)
|
||||
{
|
||||
throw new Exception("文件在库状态为否,上传附件不能为空!");
|
||||
}
|
||||
}
|
||||
if(legalListDetail.Count(t=>t.IS_DELETED==false&& t.FILE_STATUS== LRLegalFileStatusEnum.否) > 0)
|
||||
{
|
||||
//2触发给填写人法律法规融入
|
||||
lawIntegrate = new T_LR_LAW_INTEGRATE();
|
||||
lawIntegrate.ID = Guid.NewGuid();
|
||||
lawIntegrate.YEAR = DateTime.Now.Year;
|
||||
lawIntegrate.ORG_ID = entity.ORG_ID;
|
||||
lawIntegrate.RATE = "0";
|
||||
}
|
||||
|
||||
foreach (var item in legalListDetail)
|
||||
{
|
||||
var isExistlaw = allLaws.FirstOrDefault(t => t.NAME == item.FILE_NAME);
|
||||
Guid lawid = Guid.Empty;
|
||||
if (isExistlaw!=null&& isExistlaw.VERSION_NUM==item.VERSION_NUM&& item.FILE_STATUS == LRLegalFileStatusEnum.否)
|
||||
{
|
||||
throw new Exception("该法律已存在!");
|
||||
}
|
||||
if (isExistlaw==null&&item.FILE_STATUS== LRLegalFileStatusEnum.否)
|
||||
{
|
||||
lawid = Guid.NewGuid();
|
||||
T_LR_LAW law = new T_LR_LAW();
|
||||
law.ID = lawid;
|
||||
law.NAME = item.FILE_NAME;
|
||||
law.VERSION_NUM = item.VERSION_NUM;
|
||||
law.LAW_STATUS = BSLawStatusEnum.现行;
|
||||
law.UPDATE_TIME = item.UPDATE_TIME;
|
||||
law.TYPE_ID = (Guid)item.DEMANDTYPE_ID;
|
||||
law.ORG_ID = entity.ORG_ID;
|
||||
law.USER_ID = (Guid)UserID;
|
||||
laws.Add(law);
|
||||
T_LR_LAW_VERSION lawVersion = new T_LR_LAW_VERSION();
|
||||
lawVersion.LAW_ID = law.ID;
|
||||
lawVersion.VERSION_NUM = law.VERSION_NUM;
|
||||
lawVersion.UPDATE_TIME = law.UPDATE_TIME;
|
||||
lawVersion.EXECUTE_TIME = item.EXECUTE_TIME;
|
||||
lawVersion.ENTER_TIME = DateTime.Now;
|
||||
lawVersion.VERSION_STATUS = BSLawStatusEnum.现行;
|
||||
lawVersion.ORG_ID = entity.ORG_ID;
|
||||
lawVersions.Add(lawVersion);
|
||||
foreach (var file in item.Nav_Files)
|
||||
{
|
||||
T_LR_LAW_VERSION_FILE lawVersionFile = new T_LR_LAW_VERSION_FILE();
|
||||
lawVersionFile.ID = Guid.NewGuid();
|
||||
lawVersionFile.VERSION_ID = lawVersion.ID;
|
||||
lawVersionFile.IMG_FILE_ID = file.IMG_FILE_ID;
|
||||
lawVersionFile.ORG_ID = entity.ORG_ID;
|
||||
lawVersionFiles.Add(lawVersionFile);
|
||||
}
|
||||
foreach (var user in item.Nav_LegalListDetailUser)
|
||||
{
|
||||
titles.Add("新增法律法规《" + item.FILE_NAME + "》");
|
||||
dataIds.Add(entity.ID);
|
||||
userIds.Add(user.USER_ID);
|
||||
userNames.Add(allUsers.FirstOrDefault(t => t.ID == user.USER_ID).NAME);
|
||||
formCodes.Add("PF135");
|
||||
}
|
||||
|
||||
T_LR_LAW_INTEGRATE_DETAIL lawIntegrateDetail = new T_LR_LAW_INTEGRATE_DETAIL();
|
||||
lawIntegrateDetail.ID = Guid.NewGuid();
|
||||
lawIntegrateDetail.LAW_INTEGRATE_ID = lawIntegrate.ID;
|
||||
lawIntegrateDetail.LAW_ID = lawid;
|
||||
lawIntegrateDetail.ORG_ID = entity.ORG_ID;
|
||||
lawIntegrateDetails.Add(lawIntegrateDetail);
|
||||
}
|
||||
else if(isExistlaw != null && item.FILE_STATUS == LRLegalFileStatusEnum.否)
|
||||
{
|
||||
lawid = isExistlaw.ID;
|
||||
var Nav_LawVersion = isExistlaw.Nav_LawVersion;
|
||||
isExistlaw.Nav_LawVersion=null;
|
||||
foreach ( var law in Nav_LawVersion)
|
||||
{
|
||||
law.VERSION_STATUS = (int)BSLawStatusEnum.废止;
|
||||
}
|
||||
isExistlaw.VERSION_NUM = item.VERSION_NUM;
|
||||
isExistlaw.UPDATE_TIME = item.UPDATE_TIME;
|
||||
isExistlaw.USER_ID = (Guid)UserID;
|
||||
BantchSaveEntity(Nav_LawVersion);
|
||||
existLaws.Add(isExistlaw);
|
||||
T_LR_LAW_VERSION lawVersion = new T_LR_LAW_VERSION();
|
||||
lawVersion.LAW_ID = isExistlaw.ID;
|
||||
lawVersion.VERSION_NUM = item.VERSION_NUM;
|
||||
lawVersion.UPDATE_TIME = item.UPDATE_TIME;
|
||||
lawVersion.EXECUTE_TIME = item.EXECUTE_TIME;
|
||||
lawVersion.ENTER_TIME = DateTime.Now;
|
||||
lawVersion.VERSION_STATUS = BSLawStatusEnum.现行;
|
||||
lawVersion.ORG_ID = entity.ORG_ID;
|
||||
lawVersions.Add(lawVersion);
|
||||
|
||||
foreach (var file in item.Nav_Files)
|
||||
{
|
||||
T_LR_LAW_VERSION_FILE lawVersionFile = new T_LR_LAW_VERSION_FILE();
|
||||
lawVersionFile.ID = Guid.NewGuid();
|
||||
lawVersionFile.VERSION_ID = lawVersion.ID;
|
||||
lawVersionFile.IMG_FILE_ID = file.IMG_FILE_ID;
|
||||
lawVersionFile.ORG_ID = entity.ORG_ID;
|
||||
lawVersionFiles.Add(lawVersionFile);
|
||||
}
|
||||
title = "新增法律法规《" + item.FILE_NAME + "》," ;
|
||||
T_LR_LAW_INTEGRATE_DETAIL lawIntegrateDetail = new T_LR_LAW_INTEGRATE_DETAIL();
|
||||
lawIntegrateDetail.ID = Guid.NewGuid();
|
||||
lawIntegrateDetail.LAW_INTEGRATE_ID = lawIntegrate.ID;
|
||||
lawIntegrateDetail.LAW_ID = lawid;
|
||||
if(isExistlaw.Nav_LawSCSystem.Count > 0)
|
||||
{
|
||||
lawIntegrateDetail.SYSTEM_ID = isExistlaw.Nav_LawSCSystem.FirstOrDefault().SC_SYSTEM_ID;
|
||||
}
|
||||
lawIntegrateDetail.ORG_ID = entity.ORG_ID;
|
||||
lawIntegrateDetails.Add(lawIntegrateDetail);
|
||||
}
|
||||
}
|
||||
//foreach (var user in chargeUsers)
|
||||
//{
|
||||
// //3触发给需求人员,需求人员部门负责人,安环负责人
|
||||
// titles.Add(title);
|
||||
// dataIds.Add(entity.ID);
|
||||
// var currUser = allUsers.FirstOrDefault(t => t.ID == user);
|
||||
// userIds.Add(currUser.Nav_Department.Nav_User.ID);
|
||||
// userNames.Add(currUser.Nav_Department.Nav_User.NAME);
|
||||
// formCodes.Add("PF135");
|
||||
//}
|
||||
var currentDetial = legalListDetail.Select(t => t.ID);
|
||||
var legaldetailAll = GetEntities<T_LR_LEGAL_LIST_DETAIL>(t => t.LEGAL_ID==entity.ID&&t.IS_DELETED==false && !currentDetial.Contains(t.ID), new BaseFilter(entity.ORG_ID));
|
||||
var countlegalDetail = legaldetailAll.Where(t => t.FILE_NAME == null);
|
||||
//全部完成后发送给安环部负责人
|
||||
if (countlegalDetail.Count()==0)
|
||||
{
|
||||
// string title1 = String.Join("》,《", legaldetailAll.Where(t => t.FILE_STATUS == LRLegalFileStatusEnum.否).Select(t => t.FILE_NAME).ToList());
|
||||
string title2 = String.Join("》,《", legalListDetail.Where(t => t.FILE_STATUS == LRLegalFileStatusEnum.否).Select(t => t.FILE_NAME).ToList());
|
||||
|
||||
entity.LEGAL_STATUS = PFStandardStatus.Archived;
|
||||
var ahUser = allUsers.FirstOrDefault(t => t.Nav_ApproveRole != null && t.Nav_ApproveRole.NAME == "安环部负责人");
|
||||
//titles.Add("新增法律法规《" + title1+ "》,《" + title2+ "》");
|
||||
titles.Add("新增法律法规《" + title2+ "》");
|
||||
dataIds.Add(entity.ID);
|
||||
userIds.Add(ahUser.ID);
|
||||
userNames.Add(ahUser.NAME);
|
||||
formCodes.Add("PF135");
|
||||
}
|
||||
sendNotices = NotificationTaskService.InsertUserNoticeTaskModels(titles, dataIds, entity.ORG_ID, userIds, userNames, DateTime.Now, entity.LEGAL_END_TIME.Value, (int)FMNoticeTypeEnum.今日提醒, formCodes);
|
||||
if (lawIntegrate != null)
|
||||
{
|
||||
sendNotices.Add(NotificationTaskService.InsertUserNoticeTaskModel("安全生产法律法规融入", lawIntegrate.ID, entity.ORG_ID, (Guid)UserID, allUsers.FirstOrDefault(t => t.ID == UserID).NAME, DateTime.Now, DateTime.Now.AddDays(30), 0, "LR008"));
|
||||
}
|
||||
finishNotice = NotificationTaskService.GetTaskFinishModel(entity.TaskID);
|
||||
}
|
||||
legalListDetail.ForEach(detail =>
|
||||
{
|
||||
if (detail.Nav_LegalListDetailUser != null)
|
||||
{
|
||||
users.AddRange(detail.Nav_LegalListDetailUser);
|
||||
detail.Nav_LegalListDetailUser = null;
|
||||
}
|
||||
if (detail.Nav_Files != null)
|
||||
{
|
||||
files.AddRange(detail.Nav_Files);
|
||||
detail.Nav_Files = null;
|
||||
}
|
||||
});
|
||||
UnifiedCommit(() =>
|
||||
{
|
||||
UpdateEntityNoCommit(entity);
|
||||
if (laws != null && laws.Any())
|
||||
BantchAddEntityNoCommit(laws);
|
||||
if (lawVersions != null && lawVersions.Any())
|
||||
BantchAddEntityNoCommit(lawVersions);
|
||||
if (lawVersionFiles != null && lawVersionFiles.Any())
|
||||
BantchAddEntityNoCommit(lawVersionFiles);
|
||||
if (legalListDetail != null && legalListDetail.Any())
|
||||
BantchSaveEntityNoCommit(legalListDetail);
|
||||
if (lawIntegrate != null)
|
||||
AddEntityNoCommit(lawIntegrate);
|
||||
if (lawIntegrateDetails != null && lawIntegrateDetails.Any())
|
||||
BantchAddEntityNoCommit(lawIntegrateDetails);
|
||||
if (files != null && files.Any())
|
||||
BantchSaveEntityNoCommit(files);
|
||||
if (sendNotices != null&&sendNotices.Any())
|
||||
BantchAddEntityNoCommit(sendNotices);
|
||||
if (finishNotice != null)
|
||||
UpdateEntityNoCommit(finishNotice);
|
||||
if(existLaws.Any())
|
||||
BantchSaveEntityNoCommit(existLaws);
|
||||
});
|
||||
|
||||
return true;
|
||||
});
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据当前用户过滤子表
|
||||
/// </summary>
|
||||
/// <param name="filter"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost, Route("FullGet")]
|
||||
public JsonActionResult<T_LR_LEGAL_LIST> FullGet([FromBody] KeywordFilter filter)
|
||||
{
|
||||
JsonActionResult<T_LR_LEGAL_LIST> jsonActionResult = new JsonActionResult<T_LR_LEGAL_LIST>();
|
||||
var data = WitEntity(null, filter);
|
||||
T_LR_LEGAL_LIST model = data.Data;
|
||||
if (model != null && model.Nav_LegalListDetail != null && model.Nav_LegalListDetail.Count() > 0)
|
||||
{
|
||||
var Nav_LegalListDetail = model.Nav_LegalListDetail;
|
||||
var user_id = APT.Infrastructure.Api.AppContext.CurrentSession.UserID;
|
||||
model.Nav_LegalListDetail = Nav_LegalListDetail.Where(t => t.USER_ID == user_id).ToList();
|
||||
}
|
||||
jsonActionResult.Data = model;
|
||||
return jsonActionResult;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,138 +0,0 @@
|
||||
using APT.BaseData.Domain.Entities;
|
||||
using APT.BaseData.Domain.Enums.PF;
|
||||
using APT.BaseData.Domain.IServices.FM;
|
||||
using APT.Infrastructure.Core;
|
||||
using APT.MS.Domain.Entities.LR;
|
||||
using APT.MS.Domain.Enums;
|
||||
using APT.Utility;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace APT.LR.WebApi.Controllers.Api
|
||||
{
|
||||
[Route("api/LR/LRLawIntegrate")]
|
||||
public class LawIntegrateController : AuthorizeApiController<T_LR_LAW_INTEGRATE>
|
||||
{
|
||||
IFMNotificationTaskService NotificationTaskService { get; set; }
|
||||
public LawIntegrateController(IFMNotificationTaskService notificationTaskService)
|
||||
{
|
||||
NotificationTaskService = notificationTaskService;
|
||||
}
|
||||
/// <summary>
|
||||
/// 保存
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost, Route("FullUpdate")]
|
||||
public JsonActionResult<bool> FullUpdate([FromBody] T_LR_LAW_INTEGRATE entity)
|
||||
{
|
||||
return SafeExecute<bool>(() =>
|
||||
{
|
||||
List<T_LR_LAW_SC_SYSTEM> lawSystems = new List<T_LR_LAW_SC_SYSTEM>();
|
||||
T_FM_NOTIFICATION_TASK finishNotice = null;
|
||||
var integrateDetails = entity.Nav_IntegrateDetail;
|
||||
if (entity.PUBLISH != null && entity.PUBLISH.Equals("SaveAndNotify"))
|
||||
{
|
||||
entity.STATUS = PFStandardStatus.Archived;
|
||||
if (!entity.RATE.StartsWith("100"))
|
||||
{
|
||||
throw new Exception("融入比例不为100%");
|
||||
}
|
||||
var lawsystemsAll = GetEntities<T_LR_LAW_SC_SYSTEM>(t => t.IS_DELETED == false, new BaseFilter(entity.ORG_ID));
|
||||
foreach (var item in integrateDetails)
|
||||
{
|
||||
var isSystem = lawsystemsAll.Where(t => t.LAW_ID == item.LAW_ID);
|
||||
if (!isSystem.Any())
|
||||
{
|
||||
T_LR_LAW_SC_SYSTEM lawsystem = new T_LR_LAW_SC_SYSTEM
|
||||
{
|
||||
ID = Guid.NewGuid(),
|
||||
LAW_ID = item.LAW_ID,
|
||||
ORG_ID = item.ORG_ID,
|
||||
SC_SYSTEM_ID = (Guid)item.SYSTEM_ID
|
||||
};
|
||||
lawSystems.Add(lawsystem);
|
||||
}
|
||||
}
|
||||
finishNotice = NotificationTaskService.GetTaskFinishModel(entity.TaskID);
|
||||
}
|
||||
entity.Nav_IntegrateDetail = null;
|
||||
UnifiedCommit(() =>
|
||||
{
|
||||
UpdateEntityNoCommit(entity);
|
||||
if (integrateDetails != null && integrateDetails.Any())
|
||||
BantchSaveEntityNoCommit(integrateDetails);
|
||||
if (lawSystems != null && lawSystems.Any())
|
||||
BantchSaveEntityNoCommit(lawSystems);
|
||||
});
|
||||
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获得单条实体数据
|
||||
/// </summary>
|
||||
/// <param name="filter"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost, Route("Get")]
|
||||
public JsonActionResult<T_LR_LAW_INTEGRATE> Get([FromBody] KeywordFilter filter)
|
||||
{
|
||||
return SafeExecute<T_LR_LAW_INTEGRATE>(() =>
|
||||
{
|
||||
var entity = GetEntity<T_LR_LAW_INTEGRATE>(null, filter);
|
||||
if (entity == null)
|
||||
{
|
||||
entity = new T_LR_LAW_INTEGRATE();
|
||||
entity.YEAR = DateTime.Now.Year;
|
||||
}
|
||||
double lawCount = 0;
|
||||
double institutionsCount = 0;
|
||||
BaseFilter baseFilter = new BaseFilter();
|
||||
baseFilter.OrgType = FilterOrgTypeEnum.忽略组织;
|
||||
var laws = GetEntities<T_LR_LAW>(t => t.LAW_STATUS == BSLawStatusEnum.现行, baseFilter, new string[] { "Nav_LawVersion", "Nav_LawSCSystem.Nav_SCSystem" }).ToList();
|
||||
if (laws != null && laws.Count() > 0)
|
||||
{
|
||||
List<T_LR_LAW_INTEGRATE_DETAIL> LawInstitutions = new List<T_LR_LAW_INTEGRATE_DETAIL>();
|
||||
laws.ForEach(t =>
|
||||
{
|
||||
lawCount++;
|
||||
T_LR_LAW_INTEGRATE_DETAIL lawInstitution = new T_LR_LAW_INTEGRATE_DETAIL();
|
||||
lawInstitution.LAW_ID = t.ID;
|
||||
lawInstitution.LAW_INTEGRATE_ID = entity.ID;
|
||||
if (t.Nav_LawSCSystem != null && t.Nav_LawSCSystem.Count() > 0)
|
||||
{
|
||||
var lawSCSystem = t.Nav_LawSCSystem.Where(li => li.Nav_SCSystem.FILE_STATUS == SCSystemFileStatus.有效).FirstOrDefault();
|
||||
if (lawSCSystem != null)
|
||||
{
|
||||
lawInstitution.SYSTEM_ID = lawSCSystem.SC_SYSTEM_ID;
|
||||
lawInstitution.Nav_Law = lawSCSystem.Nav_Law;
|
||||
lawInstitution.Nav_SCSystem = lawSCSystem.Nav_SCSystem;
|
||||
institutionsCount++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lawInstitution.Nav_Law = t;
|
||||
}
|
||||
LawInstitutions.Add(lawInstitution);
|
||||
});
|
||||
entity.Nav_IntegrateDetail = LawInstitutions;
|
||||
}
|
||||
if (lawCount == 0)
|
||||
{
|
||||
entity.RATE = "0";
|
||||
}
|
||||
else
|
||||
{
|
||||
entity.RATE = ((institutionsCount / lawCount) * 100).ToString("#0.00");
|
||||
}
|
||||
|
||||
return entity;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,187 +0,0 @@
|
||||
using APT.BaseData.Domain.Entities;
|
||||
using APT.BaseData.Domain.IServices.FM;
|
||||
using APT.Infrastructure.Core;
|
||||
using APT.MS.Domain.Entities.LR;
|
||||
using APT.MS.Domain.Entities.SC.SC;
|
||||
using APT.MS.Domain.Enums;
|
||||
using APT.Utility;
|
||||
using InfluxData.Net.InfluxDb.Models.Responses;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace APT.LR.WebApi.Controllers.Api
|
||||
{
|
||||
[Route("api/LR/LRLawIntegrateUpdate")]
|
||||
public class LawIntegrateUpdateController : AuthorizeApiController<T_LR_LAW_INTEGRATE_UPDATE>
|
||||
{
|
||||
IFMNotificationTaskService NotificationTaskService { get; set; }
|
||||
public LawIntegrateUpdateController(IFMNotificationTaskService notificationTaskService)
|
||||
{
|
||||
NotificationTaskService = notificationTaskService;
|
||||
}
|
||||
/// <summary>
|
||||
/// 保存
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost, Route("FullUpdate")]
|
||||
public JsonActionResult<bool> FullUpdate([FromBody] T_LR_LAW_INTEGRATE_UPDATE entity)
|
||||
{
|
||||
return SafeExecute<bool>(() =>
|
||||
{
|
||||
var lrLawInstitution = new List<T_LR_LAW_INSTITUTION>();
|
||||
var integrateUpdateDetail = entity.Nav_IntegrateUpdateDetail;
|
||||
entity.Nav_IntegrateUpdateDetail = null;
|
||||
T_FM_NOTIFICATION_TASK finishNotice = null;
|
||||
List<T_FM_NOTIFICATION_TASK> sendNotices = null;
|
||||
List<T_SC_STANDARD_CREATE> standards = new List<T_SC_STANDARD_CREATE>();
|
||||
List<T_LR_LAW_SC_SYSTEM> addLawSystems = null;
|
||||
List<T_LR_LAW_SC_SYSTEM> deleteSystems = null;
|
||||
integrateUpdateDetail.ForEach(detail =>
|
||||
{
|
||||
if (detail.Nav_LRLawInstitution != null)
|
||||
{
|
||||
lrLawInstitution.AddRange(detail.Nav_LRLawInstitution);
|
||||
detail.Nav_LRLawInstitution = null;
|
||||
}
|
||||
});
|
||||
if (entity.PUBLISH != null && entity.PUBLISH.Equals("SaveAndNotify"))
|
||||
{
|
||||
if (entity.TaskID != Guid.Empty)
|
||||
{
|
||||
finishNotice = NotificationTaskService.GetTaskFinishModel(entity.TaskID, "LR009_SHOWPRINT");
|
||||
}
|
||||
//2023-07-31更新与融入时建立关联,先把之前的都删了,再新建
|
||||
var newintegrateUpdateDetail = integrateUpdateDetail.Where(t => t.IS_DELETED == false);
|
||||
var newlrLawInstitution = lrLawInstitution.Where(t => t.IS_DELETED == false);
|
||||
var alllawids = newintegrateUpdateDetail.Select(t => t.LAW_ID);
|
||||
deleteSystems = GetEntities<T_LR_LAW_SC_SYSTEM>(t => alllawids.Contains(t.LAW_ID), new BaseFilter(entity.ORG_ID)).ToList();
|
||||
addLawSystems = new List<T_LR_LAW_SC_SYSTEM>();
|
||||
foreach (var detail in newlrLawInstitution)
|
||||
{
|
||||
var newsystem = new T_LR_LAW_SC_SYSTEM();
|
||||
newsystem.ID = Guid.NewGuid();
|
||||
newsystem.LAW_ID = integrateUpdateDetail.FirstOrDefault(t => t.ID == detail.UPDATE_DETAIL_ID).LAW_ID;
|
||||
newsystem.SC_SYSTEM_ID = (Guid)detail.SC_SYSTEM_ID;
|
||||
newsystem.ORG_ID = entity.ORG_ID;
|
||||
addLawSystems.Add(newsystem);
|
||||
}
|
||||
var updateDetail = newintegrateUpdateDetail.Where(t => t.UPDATE_STATUS == LRLawIntegrateUpdateStatusEnum.未更新);
|
||||
if (updateDetail != null && updateDetail.Any())
|
||||
{
|
||||
var lawids = updateDetail.Select(t => t.LAW_ID);
|
||||
var laws = GetEntities<T_LR_LAW>(t => lawids.Contains(t.ID), new BaseFilter(entity.ORG_ID), new string[] { "Nav_User" });
|
||||
|
||||
var noticeTitles = new List<string>();
|
||||
var noticeUserIds = new List<Guid>();
|
||||
var noticeUserNames = new List<string>();
|
||||
var noticeDataIds = new List<Guid>();
|
||||
//取标准化最新code
|
||||
KeywordFilter filter = new KeywordFilter();
|
||||
filter.OrgId = entity.ORG_ID;
|
||||
filter.Keyword = "0";
|
||||
var code = GetFileCode(filter).Data;
|
||||
if (string.IsNullOrEmpty(code))
|
||||
throw new Exception("获取制度编号错误,请联系管理员");
|
||||
else
|
||||
{
|
||||
if (code.Length <= 5)
|
||||
throw new Exception("获取制度编号错误,请联系管理员");
|
||||
}
|
||||
int i = 0;
|
||||
foreach (var law in laws)
|
||||
{
|
||||
// 取最后五位序列号
|
||||
var serial = code.Substring(code.Length - 5);
|
||||
//序列号+1,不足五位补0
|
||||
var num = (int.Parse(serial) + i).ToString().PadLeft(5, '0');
|
||||
var temp = code.Substring(0, code.Length - 5);
|
||||
var entityCode = temp + num;
|
||||
T_SC_STANDARD_CREATE standard = new T_SC_STANDARD_CREATE();
|
||||
standard.ID = Guid.NewGuid();
|
||||
standard.USER_ID = law.USER_ID;
|
||||
standard.ORG_ID = entity.ORG_ID;
|
||||
standard.LAW_NAME = law.NAME;
|
||||
standard.LAW_ID = law.ID;
|
||||
standard.USER_ID = law.USER_ID;
|
||||
standard.TYPE = SCType.制度;
|
||||
standard.CODE = entityCode;
|
||||
standards.Add(standard);
|
||||
noticeUserIds.Add(law.USER_ID);
|
||||
noticeUserNames.Add(law.Nav_User.NAME);
|
||||
noticeTitles.Add("标准化制度创建");
|
||||
noticeDataIds.Add(standard.ID);
|
||||
i++;
|
||||
}
|
||||
sendNotices = NotificationTaskService.InsertUserNoticeTaskModels(noticeTitles, noticeDataIds, entity.ORG_ID, noticeUserIds, noticeUserNames, DateTime.Now, DateTime.Now.AddDays(10), 0, "SC046");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
UnifiedCommit(() =>
|
||||
{
|
||||
UpdateEntityNoCommit(entity);
|
||||
if (lrLawInstitution.Any())
|
||||
BantchSaveEntityNoCommit(lrLawInstitution);
|
||||
if (integrateUpdateDetail.Any())
|
||||
BantchSaveEntityNoCommit(integrateUpdateDetail);
|
||||
if (finishNotice != null)
|
||||
UpdateEntityNoCommit(finishNotice);
|
||||
if (sendNotices != null && sendNotices.Any())
|
||||
BantchAddEntityNoCommit(sendNotices);
|
||||
if (standards != null && standards.Any())
|
||||
BantchAddEntityNoCommit(standards);
|
||||
if (deleteSystems != null && deleteSystems.Any())
|
||||
DeleteEntityNoCommit(deleteSystems);
|
||||
if (addLawSystems != null && addLawSystems.Any())
|
||||
BantchAddEntityNoCommit(addLawSystems);
|
||||
});
|
||||
return true;
|
||||
});
|
||||
}
|
||||
/// <summary>
|
||||
/// 自动生成CODE
|
||||
/// </summary>
|
||||
/// <param name="filter"></param>
|
||||
[HttpPost, Route("GetFileCode")]
|
||||
public JsonActionResult<string> GetFileCode([FromBody] KeywordFilter filter)
|
||||
{
|
||||
return SafeExecute<string>(() =>
|
||||
{
|
||||
var fileCode = "";
|
||||
var nextCodeInfo = this.GetEntities<T_SC_STANDARD_CREATE>(t => !t.IS_DELETED && (int)t.TYPE == int.Parse(filter.Keyword), new BaseFilter(filter.OrgId)).OrderByDescending(t => t.CREATE_TIME).FirstOrDefault();
|
||||
var year = DateTime.Now.Year;
|
||||
var month = DateTime.Now.Month.PadLeft(2, '0');
|
||||
var day = DateTime.Now.Day.PadLeft(2, '0');
|
||||
var prefix = "ZD";
|
||||
if (filter.Keyword == "1")
|
||||
prefix = "ZRZ";
|
||||
if (filter.Keyword == "2")
|
||||
prefix = "GWGC";
|
||||
if (filter.Keyword == "3")
|
||||
prefix = "YJYA";
|
||||
if (nextCodeInfo == null)
|
||||
{
|
||||
fileCode = prefix + year + month + day + "00001";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (nextCodeInfo.CODE.Length <= 5)
|
||||
{
|
||||
fileCode = prefix + year + month + day + "00001";
|
||||
}
|
||||
//取最后五位序列号
|
||||
var serial = nextCodeInfo.CODE.Substring(nextCodeInfo.CODE.Length - 5);
|
||||
//序列号+1,不足五位补0
|
||||
var num = (int.Parse(serial) + 1).ToString().PadLeft(5, '0');
|
||||
fileCode = prefix + year + month + day + num;
|
||||
}
|
||||
return fileCode;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,321 +0,0 @@
|
||||
using APT.BaseData.Domain.ApiModel;
|
||||
using APT.BaseData.Domain.Entities.FM;
|
||||
using APT.Infrastructure.Core;
|
||||
using APT.MS.Domain.Entities.BS;
|
||||
using APT.MS.Domain.Entities.FO;
|
||||
using APT.MS.Domain.Entities.LR;
|
||||
using APT.MS.Domain.Entities.SC.SC;
|
||||
using APT.MS.Domain.Enums;
|
||||
using APT.Utility;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.CodeAnalysis;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Web;
|
||||
using static NPOI.HSSF.Util.HSSFColor;
|
||||
|
||||
namespace APT.LR.WebApi.Controllers.Api
|
||||
{
|
||||
[Route("api/LR/LRLaw")]
|
||||
public class LawController : AuthorizeApiController<T_LR_LAW>
|
||||
{
|
||||
/// <summary>
|
||||
/// 保存
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost, Route("FullUpdate")]
|
||||
public JsonActionResult<bool> FullUpdate([FromBody] T_LR_LAW entity)
|
||||
{
|
||||
return SafeExecute<bool>(() =>
|
||||
{
|
||||
List<T_LR_LAW_VERSION_FILE> lawVersionFiles = new List<T_LR_LAW_VERSION_FILE>();
|
||||
var lawSCSystem = entity.Nav_LawSCSystem;
|
||||
var lawVersion = entity.Nav_LawVersion;
|
||||
if (entity.USER_ID == Guid.Empty)
|
||||
{
|
||||
entity.USER_ID = (Guid)APT.Infrastructure.Api.AppContext.CurrentSession.UserID;
|
||||
}
|
||||
entity.Nav_LawSCSystem = null;
|
||||
entity.Nav_LawVersion = null;
|
||||
|
||||
if (lawVersion != null)
|
||||
{
|
||||
int noVersionCount = lawVersion.Count(t => t.VERSION_STATUS == 0);
|
||||
if (lawVersion.Count() == noVersionCount)//都是废除状态
|
||||
{
|
||||
entity.LAW_STATUS = 0;
|
||||
entity.VERSION_NUM = lawVersion.Where(t => t.UPDATE_TIME == lawVersion.Max(m => m.UPDATE_TIME)).FirstOrDefault().VERSION_NUM;//现行版本号
|
||||
}
|
||||
else //现行法律
|
||||
{
|
||||
int versionCount = lawVersion.Count(t => t.VERSION_STATUS == BSLawStatusEnum.现行 && t.IS_DELETED == false);
|
||||
if (versionCount > 1)
|
||||
{
|
||||
throw new Exception("该法律为现行法律,必须只有一个版本现行!");
|
||||
}
|
||||
entity.LAW_STATUS = BSLawStatusEnum.现行;
|
||||
entity.VERSION_NUM = lawVersion.Where(t => t.VERSION_STATUS == BSLawStatusEnum.现行).FirstOrDefault().VERSION_NUM;//现行版本号
|
||||
entity.UPDATE_TIME = lawVersion.Where(t => t.VERSION_STATUS == BSLawStatusEnum.现行).FirstOrDefault().UPDATE_TIME;//现行版本制修订日期
|
||||
}
|
||||
lawVersion.ForEach(t =>
|
||||
{
|
||||
if (t.Nav_Files != null && t.Nav_Files.Count() > 0)
|
||||
{
|
||||
t.Nav_Files.ForEach(nf =>
|
||||
{
|
||||
nf.VERSION_ID = t.ID;
|
||||
});
|
||||
lawVersionFiles.AddRange(t.Nav_Files);
|
||||
t.Nav_Files = null;
|
||||
}
|
||||
else if (entity.LAW_STATUS == BSLawStatusEnum.现行)
|
||||
{
|
||||
throw new Exception("状态为现行,请上传法律法规附件!");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
#region 安全检查库
|
||||
|
||||
bool isUndateBSMain = false;
|
||||
string oldLAWName = string.Empty;
|
||||
ICollection<Guid> listMainID = null;
|
||||
|
||||
//var checkLaw = GetEntity<T_LR_LAW>(entity.ID);
|
||||
var checkLaw = GetEntity<T_SC_STANDARD_CREATE>(entity.ID);
|
||||
if (checkLaw != null && checkLaw.NAME != entity.NAME)
|
||||
{
|
||||
BaseFilter filterCheck = new BaseFilter();
|
||||
filterCheck.SelectField = new List<string> { "CHECK_MAIN_ID" };
|
||||
var listMain = GetEntities<T_BS_CHECK_MAIN_LAW>(e => e.STANDARD_ID == entity.ID, filterCheck, null);
|
||||
if (listMain != null && listMain.Any())
|
||||
{
|
||||
oldLAWName = checkLaw.NAME;
|
||||
listMainID = listMain.Select(e => e.CHECK_MAIN_ID).Distinct().ToList();
|
||||
isUndateBSMain = true;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
UnifiedCommit(() =>
|
||||
{
|
||||
UpdateEntityNoCommit(entity);
|
||||
if (lawSCSystem != null)
|
||||
BantchSaveEntityNoCommit(lawSCSystem);
|
||||
if (lawVersion != null)
|
||||
BantchSaveEntityNoCommit(lawVersion);
|
||||
if (lawVersionFiles.Any())
|
||||
BantchSaveEntityNoCommit(lawVersionFiles);
|
||||
});
|
||||
|
||||
|
||||
#region 同步修改 依据
|
||||
|
||||
if (isUndateBSMain)
|
||||
{
|
||||
try
|
||||
{
|
||||
var listCheckMain = GetEntities<T_BS_CHECK_MAIN>(e => listMainID.Contains(e.ID), null, null);
|
||||
List<string> listRoot = null;
|
||||
foreach (var item in listCheckMain)
|
||||
{
|
||||
listRoot = item.CHECKPROOF.Split(',', StringSplitOptions.RemoveEmptyEntries).ToList();
|
||||
for (int i = 0; i < listRoot.Count; i++)
|
||||
{
|
||||
if (listRoot[i] == oldLAWName)
|
||||
{
|
||||
listRoot[i] = entity.NAME;
|
||||
}
|
||||
}
|
||||
item.CHECKPROOF = String.Join(',', listRoot);
|
||||
}
|
||||
|
||||
if (listCheckMain != null && listCheckMain.Any())
|
||||
{
|
||||
UnifiedCommit(() =>
|
||||
{
|
||||
BantchSaveEntityNoCommit(listCheckMain);
|
||||
});
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
return true;
|
||||
});
|
||||
}
|
||||
/// <summary>
|
||||
/// 排序分页查询数据
|
||||
/// </summary>
|
||||
/// <param name="pageFilter">分页过滤实体</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost, Route("OrderPaged")]
|
||||
public PagedActionResult<T_LR_LAW> OrderPaged([FromBody] KeywordPageFilter pageFilter)
|
||||
{
|
||||
Expression<Func<T_LR_LAW, bool>> uExpress = t => t.IS_DELETED == false;
|
||||
if (pageFilter.Keyword != "")
|
||||
{
|
||||
List<Guid> ids = new List<Guid>();
|
||||
var tempids = pageFilter.Keyword.Split(",");
|
||||
foreach (var id in tempids)
|
||||
{
|
||||
ids.Add(Guid.Parse(id));
|
||||
}
|
||||
uExpress = uExpress.And(t => ids.Contains(t.TYPE_ID));
|
||||
}
|
||||
|
||||
return WitOrderPaged(uExpress, pageFilter);
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取导入数据
|
||||
/// 参考 [Route("api/PF/Import")]
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost, Route("GetImportData")]
|
||||
public JsonActionResult<ImportDataModel> GetImportData()
|
||||
{
|
||||
return SafeExecute<ImportDataModel>(() =>
|
||||
{
|
||||
var orgId = APT.Infrastructure.Api.AppContext.CurrentSession.OrgId;
|
||||
var httpRequest = this.HttpContext.Request;
|
||||
string orgIdStr = httpRequest.Form["OrgId"];// 获取 组织
|
||||
ImportDataModel result = new ImportDataModel();
|
||||
var dic = Path.Combine(System.AppContext.BaseDirectory, "tempImportFiles");
|
||||
if (!Directory.Exists(dic))
|
||||
Directory.CreateDirectory(dic);
|
||||
foreach (var key in httpRequest.Form.Files) // 文件键
|
||||
{
|
||||
var postedFile = key; // 获取文件键对应的文件对象
|
||||
string filePath = Path.Combine(dic, DateTime.Now.ToString("yyyy_MM_dd_hh_mm_ss") + "_" + postedFile.FileName);
|
||||
Byte[] fileData = new Byte[postedFile.Length];
|
||||
Stream sr = postedFile.OpenReadStream();//创建数据流对象
|
||||
sr.Read(fileData, 0, (int)postedFile.Length);
|
||||
using (FileStream fs = new FileStream(filePath, FileMode.CreateNew))
|
||||
{
|
||||
fs.Write(fileData, 0, fileData.Length);
|
||||
fs.Flush();
|
||||
fs.Close();
|
||||
}
|
||||
|
||||
//获取数据
|
||||
Dictionary<int, int> startRowIndexs = new Dictionary<int, int>();
|
||||
startRowIndexs.Add(0, 1);//根据Excel格式数据赋值
|
||||
var dataTables = FileUtils.ReadExcelByOledb(filePath, startRowIndexs);
|
||||
string Msg = string.Empty;
|
||||
|
||||
bool isOK = InsertModel(dataTables.Tables[0], orgId, ref Msg);
|
||||
|
||||
try
|
||||
{
|
||||
System.IO.File.Delete(filePath);
|
||||
}
|
||||
catch { }
|
||||
|
||||
result.Data = Msg;
|
||||
result.MessageList = new List<string> { Msg };
|
||||
}
|
||||
|
||||
return result;
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 数据插入
|
||||
/// </summary>
|
||||
/// <param name="dtSource"></param>
|
||||
/// <param name="OrgID"></param>
|
||||
/// <param name="Msg"></param>
|
||||
/// <param name="rowIndex"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
public bool InsertModel(DataTable dtSource, Guid? orgId, ref string Msg, int rowIndex = 1)
|
||||
{
|
||||
var userId = APT.Infrastructure.Api.AppContext.CurrentSession.UserID;
|
||||
if (dtSource == null || dtSource.Rows.Count < rowIndex)
|
||||
{
|
||||
Msg = "未获取到导入数据";
|
||||
throw new Exception(Msg);
|
||||
}
|
||||
int rowAll = dtSource.Rows.Count;
|
||||
if (!string.IsNullOrEmpty(Msg))
|
||||
{
|
||||
throw new Exception(Msg);
|
||||
}
|
||||
List<T_LR_LAW> laws = new List<T_LR_LAW>();
|
||||
List<T_LR_LAW_VERSION> lawVersions = new List<T_LR_LAW_VERSION>();
|
||||
var lawTypess = GetEntities<T_LR_LAW_TYPE>(t => t.IS_DELETED == false, new BaseFilter(orgId));
|
||||
DateTime dtNow = DateTime.Now;
|
||||
for (int i = 0; i < rowAll; i++)
|
||||
{
|
||||
T_LR_LAW law = new T_LR_LAW();
|
||||
law.ID = Guid.NewGuid();
|
||||
law.VERSION_NUM = dtSource.Rows[i][2].ToString().Trim();
|
||||
law.USER_ID = (Guid)userId;
|
||||
if (!string.IsNullOrEmpty(dtSource.Rows[i][0].ToString().Trim()))
|
||||
{
|
||||
law.NAME = dtSource.Rows[i][0].ToString().Trim();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception("名称不能为空!");
|
||||
}
|
||||
if (!string.IsNullOrEmpty(dtSource.Rows[i][3].ToString().Trim()))
|
||||
{
|
||||
law.UPDATE_TIME = DateTime.Parse(dtSource.Rows[i][3].ToString().Trim());
|
||||
}
|
||||
if (lawTypess.FirstOrDefault(t => t.NAME == dtSource.Rows[i][1].ToString().Trim()) != null)
|
||||
{
|
||||
law.TYPE_ID = lawTypess.FirstOrDefault(t => t.NAME == dtSource.Rows[i][1].ToString().Trim()).ID;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception("需求类别:" + dtSource.Rows[i][1].ToString().Trim() + "未找到");
|
||||
}
|
||||
law.LAW_STATUS = BSLawStatusEnum.现行;
|
||||
law.ORG_ID = orgId;
|
||||
T_LR_LAW_VERSION lawVersion = new T_LR_LAW_VERSION
|
||||
{
|
||||
ID = Guid.NewGuid(),
|
||||
LAW_ID = law.ID,
|
||||
VERSION_NUM = dtSource.Rows[i][2].ToString().Trim(),
|
||||
ENTER_TIME = dtNow,
|
||||
VERSION_STATUS = BSLawStatusEnum.现行,
|
||||
ORG_ID = orgId,
|
||||
};
|
||||
if (!string.IsNullOrEmpty(dtSource.Rows[i][3].ToString().Trim()))
|
||||
{
|
||||
lawVersion.UPDATE_TIME = DateTime.Parse(dtSource.Rows[i][3].ToString().Trim());
|
||||
}
|
||||
if (!string.IsNullOrEmpty(dtSource.Rows[i][4].ToString().Trim()))
|
||||
{
|
||||
lawVersion.EXECUTE_TIME = DateTime.Parse(dtSource.Rows[i][4].ToString().Trim());
|
||||
}
|
||||
laws.Add(law);
|
||||
lawVersions.Add(lawVersion);
|
||||
|
||||
}
|
||||
UnifiedCommit(() =>
|
||||
{
|
||||
if (laws != null && laws.Any())
|
||||
BantchAddEntityNoCommit(laws);
|
||||
if (lawVersions != null && lawVersions.Any())
|
||||
BantchAddEntityNoCommit(lawVersions);
|
||||
});
|
||||
Msg = "导入成功!";
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -12,7 +12,7 @@ using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using APT.MS.Domain.Entities.LR;
|
||||
|
||||
|
||||
namespace APT.SC.WebApi.Controllers.Api.OG
|
||||
{
|
||||
|
||||
@ -6,7 +6,7 @@ using APT.BaseData.Services.DomainServices;
|
||||
using APT.BaseData.Services.Services.FM;
|
||||
using APT.Infrastructure.Core;
|
||||
using APT.MS.Domain.Entities.HM;
|
||||
using APT.MS.Domain.Entities.LR;
|
||||
|
||||
using APT.MS.Domain.Entities.SC;
|
||||
using APT.MS.Domain.Entities.SC.SC;
|
||||
using APT.MS.Domain.Enums;
|
||||
|
||||
@ -25,7 +25,7 @@ using Enum = System.Enum;
|
||||
using APT.BaseData.Domain.ApiModel;
|
||||
using System.IO;
|
||||
using System.Data;
|
||||
using APT.MS.Domain.Entities.LR;
|
||||
|
||||
using APT.MS.Domain.Entities.SC;
|
||||
using APT.BaseData.Domain.ApiModel.FM;
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using APT.Infrastructure.Core;
|
||||
using APT.BaseData.Domain.ApiModel;
|
||||
using APT.MS.Domain.Entities.LR;
|
||||
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
using APT.BaseData.Domain.Entities.FM;
|
||||
|
||||
@ -8,7 +8,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using APT.Infrastructure.Core;
|
||||
using APT.BaseData.Domain.ApiModel;
|
||||
using APT.MS.Domain.Entities.LR;
|
||||
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
using APT.BaseData.Domain.Entities.FM;
|
||||
@ -406,6 +406,10 @@ namespace APT.SE.WebApi.Controllers.Api
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(dtSource.Rows[i][11].ToString().Trim()))
|
||||
{
|
||||
mainTable.TRAINNAME = dtSource.Rows[i][11].ToString().Trim();
|
||||
}
|
||||
mainTables.Add(mainTable);
|
||||
}
|
||||
UnifiedCommit(() =>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -8,7 +8,7 @@
|
||||
"ASPNETCORE_ENVIRONMENT": "Test"
|
||||
},
|
||||
"nativeDebugging": true,
|
||||
"applicationUrl": "http://localhost:3179"
|
||||
"applicationUrl": "http://localhost:7179"
|
||||
},
|
||||
"Docker": {
|
||||
"commandName": "Docker",
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
"ASPNETCORE_ENVIRONMENT": "Test"
|
||||
},
|
||||
"nativeDebugging": false,
|
||||
"applicationUrl": "http://localhost:3177"
|
||||
"applicationUrl": "http://localhost:7177"
|
||||
},
|
||||
"Docker": {
|
||||
"commandName": "Docker",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user