1、子公司从总部同步法律法规库到子公司
2、法律法规类型 添加Code(列表有配置,实际没有对应字段)
This commit is contained in:
parent
e9eb296832
commit
00f5372743
137936
APT.Data.Migrations/Migrations/20260310035228_wyw2026031002.Designer.cs
generated
Normal file
137936
APT.Data.Migrations/Migrations/20260310035228_wyw2026031002.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,24 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
namespace APT.Data.Migrations.Migrations
|
||||||
|
{
|
||||||
|
public partial class wyw2026031002 : Migration
|
||||||
|
{
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "CODE",
|
||||||
|
table: "T_LR_LAW_TYPE",
|
||||||
|
type: "nvarchar(50)",
|
||||||
|
maxLength: 50,
|
||||||
|
nullable: true);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "CODE",
|
||||||
|
table: "T_LR_LAW_TYPE");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -49313,6 +49313,10 @@ namespace APT.Data.Migrations.Migrations
|
|||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("uniqueidentifier");
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<string>("CODE")
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("nvarchar(50)");
|
||||||
|
|
||||||
b.Property<Guid?>("CREATER_ID")
|
b.Property<Guid?>("CREATER_ID")
|
||||||
.HasColumnType("uniqueidentifier");
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
|||||||
@ -6364,7 +6364,8 @@ builder.HasOne(t => t.Nav_SCSystem).WithMany().HasForeignKey(t => t.SC_SYSTEM_ID
|
|||||||
public override void Configure(EntityTypeBuilder<T_LR_LAW_TYPE> builder)
|
public override void Configure(EntityTypeBuilder<T_LR_LAW_TYPE> builder)
|
||||||
{
|
{
|
||||||
base.Configure(builder);
|
base.Configure(builder);
|
||||||
builder.HasIndex("NAME").IsUnique();
|
builder.Property(t => t.CODE).HasMaxLength(50);
|
||||||
|
builder.HasIndex("NAME").IsUnique();
|
||||||
builder.Property(t => t.NAME).HasMaxLength(500);
|
builder.Property(t => t.NAME).HasMaxLength(500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,6 +14,13 @@ namespace APT.MS.Domain.Entities.LR
|
|||||||
[Description("法律法规知识类别")]
|
[Description("法律法规知识类别")]
|
||||||
public class T_LR_LAW_TYPE : MesEntityBase
|
public class T_LR_LAW_TYPE : MesEntityBase
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 类型编号
|
||||||
|
/// </summary>
|
||||||
|
[Description("类型编号")]
|
||||||
|
[DataFieldLength(50)]
|
||||||
|
public string CODE { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 类型名称
|
/// 类型名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -1,11 +1,14 @@
|
|||||||
using APT.BaseData.Domain.ApiModel;
|
using APT.BaseData.Domain.ApiModel;
|
||||||
using APT.BaseData.Domain.Entities;
|
using APT.BaseData.Domain.Entities;
|
||||||
using APT.BaseData.Domain.Entities.FM;
|
using APT.BaseData.Domain.Entities.FM;
|
||||||
|
using APT.BaseData.Domain.Enums.PF;
|
||||||
using APT.BaseData.Domain.IServices;
|
using APT.BaseData.Domain.IServices;
|
||||||
using APT.BaseData.Domain.IServices.FM;
|
using APT.BaseData.Domain.IServices.FM;
|
||||||
|
using APT.BaseData.Domain.IServices.OP;
|
||||||
using APT.BaseData.Services.DomainServices;
|
using APT.BaseData.Services.DomainServices;
|
||||||
using APT.BaseData.Services.Services.FM;
|
using APT.BaseData.Services.Services.FM;
|
||||||
using APT.Infrastructure.Core;
|
using APT.Infrastructure.Core;
|
||||||
|
using APT.Migrations;
|
||||||
using APT.MS.Domain.Entities.BS;
|
using APT.MS.Domain.Entities.BS;
|
||||||
using APT.MS.Domain.Entities.FO;
|
using APT.MS.Domain.Entities.FO;
|
||||||
using APT.MS.Domain.Entities.LR;
|
using APT.MS.Domain.Entities.LR;
|
||||||
@ -31,9 +34,11 @@ namespace APT.LR.WebApi.Controllers.Api
|
|||||||
public class LawController : AuthorizeApiController<T_LR_LAW>
|
public class LawController : AuthorizeApiController<T_LR_LAW>
|
||||||
{
|
{
|
||||||
IFMNotificationTaskService NotificationTaskService { get; set; }
|
IFMNotificationTaskService NotificationTaskService { get; set; }
|
||||||
public LawController(IFMNotificationTaskService notificationTaskService)
|
IOPTenantDBConnService OPTenantDBConnService { get; set; }
|
||||||
|
public LawController(IFMNotificationTaskService notificationTaskService, IOPTenantDBConnService opTenantDBConnService)
|
||||||
{
|
{
|
||||||
NotificationTaskService = notificationTaskService;
|
NotificationTaskService = notificationTaskService;
|
||||||
|
OPTenantDBConnService = opTenantDBConnService;
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 保存
|
/// 保存
|
||||||
@ -119,7 +124,7 @@ namespace APT.LR.WebApi.Controllers.Api
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
//判断法规库修改名称时,触发今日提醒给当前层级安全员
|
//判断法规库修改名称时,触发今日提醒给当前层级安全员
|
||||||
var oldEntity= GetEntity<T_LR_LAW>(entity.ID);
|
var oldEntity = GetEntity<T_LR_LAW>(entity.ID);
|
||||||
if (oldEntity != null && oldEntity.NAME != entity.NAME)
|
if (oldEntity != null && oldEntity.NAME != entity.NAME)
|
||||||
{
|
{
|
||||||
var depart = this.GetEntity<T_FM_DEPARTMENT>(t => t.ID == (Guid)APT.Infrastructure.Api.AppContext.CurrentSession.DepartmentID);
|
var depart = this.GetEntity<T_FM_DEPARTMENT>(t => t.ID == (Guid)APT.Infrastructure.Api.AppContext.CurrentSession.DepartmentID);
|
||||||
@ -135,7 +140,7 @@ namespace APT.LR.WebApi.Controllers.Api
|
|||||||
param = "负责人";
|
param = "负责人";
|
||||||
}
|
}
|
||||||
var user = this.GetEntity<T_FM_USER>(t => t.DEPARTMENT_ID == depart.ID && t.Nav_ApproveRole != null && t.Nav_ApproveRole.NAME.Contains(param));
|
var user = this.GetEntity<T_FM_USER>(t => t.DEPARTMENT_ID == depart.ID && t.Nav_ApproveRole != null && t.Nav_ApproveRole.NAME.Contains(param));
|
||||||
if(user == null)
|
if (user == null)
|
||||||
{
|
{
|
||||||
user = this.GetEntity<T_FM_USER>(t => t.DEPARTMENT_ID == depart.ID && t.Nav_ApproveRole != null && t.Nav_ApproveRole.NAME.Contains("负责人"));
|
user = this.GetEntity<T_FM_USER>(t => t.DEPARTMENT_ID == depart.ID && t.Nav_ApproveRole != null && t.Nav_ApproveRole.NAME.Contains("负责人"));
|
||||||
}
|
}
|
||||||
@ -145,7 +150,7 @@ namespace APT.LR.WebApi.Controllers.Api
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UnifiedCommit(() =>
|
UnifiedCommit(() =>
|
||||||
{
|
{
|
||||||
UpdateEntityNoCommit(entity);
|
UpdateEntityNoCommit(entity);
|
||||||
@ -359,5 +364,422 @@ namespace APT.LR.WebApi.Controllers.Api
|
|||||||
Msg = "导入成功!";
|
Msg = "导入成功!";
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 排序分页查询数据
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="pageFilter">分页过滤实体</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost, Route("OrderPagedHead")]
|
||||||
|
public PagedActionResult<T_LR_LAW> OrderPagedHead([FromBody] KeywordPageFilter pageFilter)
|
||||||
|
{
|
||||||
|
return SafeGetPagedData(delegate (PagedActionResult<T_LR_LAW> result)
|
||||||
|
{
|
||||||
|
string strConn = OPTenantDBConnService.GetConnByORGID(new Guid(FilePathHead.JY.GetDescription()));
|
||||||
|
using (var context = new MigrationContext(strConn))
|
||||||
|
{
|
||||||
|
Expression<Func<T_LR_LAW, bool>> expression = e => !e.IS_DELETED;
|
||||||
|
if (pageFilter.FilterGroup != null && pageFilter.FilterGroup.Rules != null && pageFilter.FilterGroup.Rules.Count() > 0)
|
||||||
|
{
|
||||||
|
foreach (var item in pageFilter.FilterGroup.Rules)
|
||||||
|
{
|
||||||
|
if (item.Field == "NAME")
|
||||||
|
{
|
||||||
|
expression = expression.And(e => e.NAME.Contains(item.Value.ToString()));
|
||||||
|
}
|
||||||
|
else if (item.Field == "LAW_STATUS" && item.Value != null)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
BSLawStatusEnum LAW_STATUS = (BSLawStatusEnum)Convert.ToInt32(item.Value.ToString());
|
||||||
|
expression = expression.And(e => e.LAW_STATUS == LAW_STATUS);
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (pageFilter.FilterGroup != null && pageFilter.FilterGroup.Groups != null && pageFilter.FilterGroup.Groups.Count() > 0)
|
||||||
|
{
|
||||||
|
foreach (var item in pageFilter.FilterGroup.Groups)
|
||||||
|
{
|
||||||
|
DateTime? UPDATE_TIMES = null;
|
||||||
|
DateTime? UPDATE_TIMEE = null;
|
||||||
|
if (item.Rules != null && item.Rules.Any() && item.Rules.Count() > 0)
|
||||||
|
{
|
||||||
|
foreach (var itemR in item.Rules)
|
||||||
|
{
|
||||||
|
if (itemR.Field == "UPDATE_TIME" && itemR.Operate == FilterOperate.GreaterThanOrEqual)
|
||||||
|
{
|
||||||
|
UPDATE_TIMES = Convert.ToDateTime(itemR.Value.ToString());
|
||||||
|
}
|
||||||
|
else if (itemR.Field == "UPDATE_TIME" && itemR.Operate == FilterOperate.LessThanOrEqual)
|
||||||
|
{
|
||||||
|
UPDATE_TIMEE = Convert.ToDateTime(itemR.Value.ToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (UPDATE_TIMES != null)
|
||||||
|
{
|
||||||
|
expression = expression.And(e => e.UPDATE_TIME >= UPDATE_TIMES);
|
||||||
|
}
|
||||||
|
if (UPDATE_TIMEE != null)
|
||||||
|
{
|
||||||
|
expression = expression.And(e => e.UPDATE_TIME <= UPDATE_TIMEE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//pageFilter.SelectField.ToArray()
|
||||||
|
PagedResultDto<T_LR_LAW> data = context.GetOrderPageEntities(expression, null, null, pageFilter.Limit, pageFilter.Start, pageFilter.Include.ToArray());
|
||||||
|
result.TotalCount = data.TotalCount;
|
||||||
|
result.Data = data.Items;
|
||||||
|
List<Guid> ListLawID = null;
|
||||||
|
if (result.TotalCount > 0)
|
||||||
|
{
|
||||||
|
ListLawID = result.Data.Select(e => e.TYPE_ID).ToList();
|
||||||
|
var listLawType = context.GetEntities<T_LR_LAW_TYPE>(e => ListLawID.Contains(e.ID), null, null);
|
||||||
|
|
||||||
|
ListLawID = result.Data.Select(e => e.ID).ToList();
|
||||||
|
var listVersion = context.GetEntities<T_LR_LAW_VERSION>(e => ListLawID.Contains(e.LAW_ID), null, "Nav_Files.Nav_ImgFile.Nav_File");
|
||||||
|
foreach (var item in result.Data)
|
||||||
|
{
|
||||||
|
item.Nav_LawType = listLawType.FirstOrDefault(e => e.ID == item.TYPE_ID);
|
||||||
|
item.Nav_LawVersion = listVersion.Where(e => e.LAW_ID == item.ID).ToList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 集团法律法规同步到本地
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ids"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost, Route("SyncToLocal")]
|
||||||
|
public JsonActionResult<bool> SyncToLocal([FromBody] SyscList list)
|
||||||
|
{
|
||||||
|
return SafeExecute<bool>(() =>
|
||||||
|
{
|
||||||
|
//最终结果数据
|
||||||
|
List<T_LR_LAW> listLaw = new List<T_LR_LAW>();
|
||||||
|
List<T_LR_LAW_TYPE> listLawType = new List<T_LR_LAW_TYPE>();
|
||||||
|
List<T_LR_LAW_VERSION> listLawVersion = new List<T_LR_LAW_VERSION>();
|
||||||
|
List<T_LR_LAW_VERSION_FILE> listFiles = new List<T_LR_LAW_VERSION_FILE>();
|
||||||
|
List<T_PF_IMG_FILE> listImgFile = new List<T_PF_IMG_FILE>();
|
||||||
|
List<T_PF_FILE> listFile = new List<T_PF_FILE>();
|
||||||
|
|
||||||
|
//数据库查找数据
|
||||||
|
List<T_LR_LAW> listSourse = list.ListModel;
|
||||||
|
var listLawID = listSourse.Select(e => e.ID);
|
||||||
|
var listLawTypeID = listSourse.Select(e => e.TYPE_ID);
|
||||||
|
IEnumerable<T_LR_LAW> listLawData = null;
|
||||||
|
IEnumerable<T_LR_LAW_TYPE> listLawTypeData = null;
|
||||||
|
IEnumerable<T_LR_LAW_VERSION> listLawVersionData = null;
|
||||||
|
List<T_LR_LAW_VERSION_FILE> listLawVersionFileData = null;
|
||||||
|
List<T_PF_IMG_FILE> listImgFileData = null;
|
||||||
|
List<T_PF_FILE> listFileData = null;
|
||||||
|
|
||||||
|
if (listLawID != null && listLawID.Any())
|
||||||
|
{
|
||||||
|
listLawData = GetEntities<T_LR_LAW>(e => listLawID.Contains(e.ID), null, null);
|
||||||
|
listLawVersionData = GetEntities<T_LR_LAW_VERSION>(e => listLawID.Contains(e.LAW_ID), null, "Nav_Files.Nav_ImgFile.Nav_File").ToList();
|
||||||
|
}
|
||||||
|
if (listLawTypeID != null && listLawTypeID.Any())
|
||||||
|
{
|
||||||
|
listLawTypeData = GetEntities<T_LR_LAW_TYPE>(e => listLawTypeID.Contains(e.ID), null, null).ToList();
|
||||||
|
}
|
||||||
|
if (listLawVersionData != null && listLawVersionData.Count() > 0)
|
||||||
|
{
|
||||||
|
listLawVersionFileData = new List<T_LR_LAW_VERSION_FILE>();
|
||||||
|
foreach (var item in listLawVersionData)
|
||||||
|
{
|
||||||
|
if (item.Nav_Files == null || item.Nav_Files.Count() < 1)
|
||||||
|
continue;
|
||||||
|
listLawVersionFileData.AddRange(item.Nav_Files);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (listLawVersionFileData != null && listLawVersionFileData.Count() > 0)
|
||||||
|
{
|
||||||
|
listImgFileData = new List<T_PF_IMG_FILE>();
|
||||||
|
foreach (var item in listLawVersionFileData)
|
||||||
|
listImgFileData.Add(item.Nav_ImgFile);
|
||||||
|
}
|
||||||
|
if (listImgFileData != null && listImgFileData.Count() > 0)
|
||||||
|
{
|
||||||
|
listFileData = new List<T_PF_FILE>();
|
||||||
|
foreach (var item in listImgFileData)
|
||||||
|
listFileData.Add(item.Nav_File);
|
||||||
|
}
|
||||||
|
|
||||||
|
Guid? LoginID = APT.Infrastructure.Api.AppContext.CurrentSession.UserID;
|
||||||
|
Guid? OrgID = APT.Infrastructure.Api.AppContext.CurrentSession.OrgId;
|
||||||
|
DateTime dtNow = DateTime.Now.Date;
|
||||||
|
|
||||||
|
///数据组装和查验
|
||||||
|
List<T_LR_LAW_TYPE> Nav_LawType = new List<T_LR_LAW_TYPE>();
|
||||||
|
List<T_LR_LAW_VERSION> Nav_LawVersion = new List<T_LR_LAW_VERSION>();
|
||||||
|
List<T_LR_LAW_VERSION_FILE> Nav_Files = new List<T_LR_LAW_VERSION_FILE>();
|
||||||
|
List<T_PF_IMG_FILE> Nav_ImgFile = new List<T_PF_IMG_FILE>();
|
||||||
|
List<T_PF_FILE> Nav_File = new List<T_PF_FILE>();
|
||||||
|
T_LR_LAW modelCheck = null;
|
||||||
|
T_LR_LAW_TYPE modelCheckType = null;
|
||||||
|
T_LR_LAW_VERSION modelVersion = null;
|
||||||
|
T_LR_LAW_VERSION_FILE modelVersionFile = null;
|
||||||
|
T_PF_IMG_FILE modelImgFile = null;
|
||||||
|
T_PF_FILE modelFile = null;
|
||||||
|
|
||||||
|
#region 全部拆到组合中去再统一处理
|
||||||
|
|
||||||
|
foreach (var item in listSourse)
|
||||||
|
{
|
||||||
|
if (!Nav_LawType.Contains(item.Nav_LawType))
|
||||||
|
Nav_LawType.Add(item.Nav_LawType);
|
||||||
|
if (item.Nav_LawVersion != null && item.Nav_LawVersion.Count() > 0)
|
||||||
|
Nav_LawVersion.AddRange(item.Nav_LawVersion);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var item in Nav_LawVersion)
|
||||||
|
{
|
||||||
|
if (item.Nav_Files != null && item.Nav_Files.Count() > 0)
|
||||||
|
Nav_Files.AddRange(item.Nav_Files);
|
||||||
|
}
|
||||||
|
foreach (var item in Nav_Files)
|
||||||
|
{
|
||||||
|
if (item.Nav_ImgFile != null)
|
||||||
|
Nav_ImgFile.Add(item.Nav_ImgFile);
|
||||||
|
}
|
||||||
|
foreach (var item in Nav_ImgFile)
|
||||||
|
{
|
||||||
|
if (item.Nav_File != null)
|
||||||
|
Nav_File.Add(item.Nav_File);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 数据判断处理
|
||||||
|
|
||||||
|
foreach (var item in listSourse)
|
||||||
|
{
|
||||||
|
modelCheck = listSourse.FirstOrDefault(e => e.ID == item.ID);
|
||||||
|
if (modelCheck == null)
|
||||||
|
{
|
||||||
|
item.CREATER_ID = LoginID;
|
||||||
|
item.CREATE_TIME = dtNow;
|
||||||
|
}
|
||||||
|
listLaw.Add(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var item in Nav_LawType)
|
||||||
|
{
|
||||||
|
if (listLawTypeData != null && listLawTypeData.Count() > 0)
|
||||||
|
{
|
||||||
|
modelCheckType = listLawTypeData.FirstOrDefault(e => e.ID == item.ID);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
modelCheckType = null;
|
||||||
|
}
|
||||||
|
if (modelCheckType == null)
|
||||||
|
{
|
||||||
|
item.CREATER_ID = LoginID;
|
||||||
|
item.CREATE_TIME = dtNow;
|
||||||
|
}
|
||||||
|
listLawType.Add(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var item in Nav_LawVersion)
|
||||||
|
{
|
||||||
|
if (listLawVersionData != null && listLawVersionData.Count() > 0)
|
||||||
|
{
|
||||||
|
modelVersion = listLawVersionData.FirstOrDefault(e => e.ID == item.ID);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
modelVersion = null;
|
||||||
|
}
|
||||||
|
if (modelVersion == null)
|
||||||
|
{
|
||||||
|
item.CREATER_ID = LoginID;
|
||||||
|
item.CREATE_TIME = dtNow;
|
||||||
|
}
|
||||||
|
listLawVersion.Add(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var item in Nav_Files)
|
||||||
|
{
|
||||||
|
if (listLawVersionFileData != null && listLawVersionFileData.Count() > 0)
|
||||||
|
{
|
||||||
|
modelVersionFile = listLawVersionFileData.FirstOrDefault(e => e.ID == item.ID);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
modelVersionFile = null;
|
||||||
|
}
|
||||||
|
if (modelVersion == null)
|
||||||
|
{
|
||||||
|
item.CREATER_ID = LoginID;
|
||||||
|
item.CREATE_TIME = dtNow;
|
||||||
|
}
|
||||||
|
listFiles.Add(item);
|
||||||
|
}
|
||||||
|
foreach (var item in Nav_ImgFile)
|
||||||
|
{
|
||||||
|
if (listImgFileData != null && listImgFileData.Count() > 0)
|
||||||
|
{
|
||||||
|
modelImgFile = listImgFileData.FirstOrDefault(e => e.ID == item.ID);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
modelImgFile = null;
|
||||||
|
}
|
||||||
|
if (modelVersion == null)
|
||||||
|
{
|
||||||
|
item.CREATER_ID = LoginID;
|
||||||
|
item.CREATE_TIME = dtNow;
|
||||||
|
}
|
||||||
|
listImgFile.Add(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var item in Nav_File)
|
||||||
|
{
|
||||||
|
if (listFileData != null && listFileData.Count() > 0)
|
||||||
|
{
|
||||||
|
modelFile = listFileData.FirstOrDefault(e => e.ID == item.ID);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
modelFile = null;
|
||||||
|
}
|
||||||
|
if (modelVersion == null)
|
||||||
|
{
|
||||||
|
item.CREATER_ID = LoginID;
|
||||||
|
item.CREATE_TIME = dtNow;
|
||||||
|
}
|
||||||
|
listFile.Add(item);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
#region 数据统一处理 CREATE_TIME MODIFY_TIME MODIFIER_ID
|
||||||
|
|
||||||
|
if (listLaw != null && listLaw.Count() > 0)
|
||||||
|
{
|
||||||
|
foreach (var item in listLaw)
|
||||||
|
{
|
||||||
|
item.Nav_LawType = null;
|
||||||
|
item.Nav_LawVersion = null;
|
||||||
|
item.ORG_ID = OrgID;
|
||||||
|
if (item.CREATER_ID == LoginID)
|
||||||
|
{
|
||||||
|
item.CREATE_TIME = dtNow;
|
||||||
|
}
|
||||||
|
item.MODIFY_TIME = dtNow;
|
||||||
|
item.MODIFIER_ID = LoginID;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (listLawType != null && listLawType.Count() > 0)
|
||||||
|
{
|
||||||
|
foreach (var item in listLawType)
|
||||||
|
{
|
||||||
|
item.ORG_ID = OrgID;
|
||||||
|
if (item.CREATER_ID == LoginID)
|
||||||
|
{
|
||||||
|
item.CREATE_TIME = dtNow;
|
||||||
|
}
|
||||||
|
item.MODIFY_TIME = dtNow;
|
||||||
|
item.MODIFIER_ID = LoginID;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (listLawVersion != null && listLawVersion.Count() > 0)
|
||||||
|
{
|
||||||
|
foreach (var item in listLawVersion)
|
||||||
|
{
|
||||||
|
item.Nav_Files = null;
|
||||||
|
item.ORG_ID = OrgID;
|
||||||
|
if (item.CREATER_ID == LoginID)
|
||||||
|
{
|
||||||
|
item.CREATE_TIME = dtNow;
|
||||||
|
}
|
||||||
|
item.MODIFY_TIME = dtNow;
|
||||||
|
item.MODIFIER_ID = LoginID;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (listFiles != null && listFiles.Count() > 0)
|
||||||
|
{
|
||||||
|
foreach (var item in listFiles)
|
||||||
|
{
|
||||||
|
item.Nav_ImgFile = null;
|
||||||
|
item.ORG_ID = OrgID;
|
||||||
|
if (item.CREATER_ID == LoginID)
|
||||||
|
{
|
||||||
|
item.CREATE_TIME = dtNow;
|
||||||
|
}
|
||||||
|
item.MODIFY_TIME = dtNow;
|
||||||
|
item.MODIFIER_ID = LoginID;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (listImgFile != null && listImgFile.Count() > 0)
|
||||||
|
{
|
||||||
|
foreach (var item in listImgFile)
|
||||||
|
{
|
||||||
|
item.ORG_ID = OrgID;
|
||||||
|
if (item.CREATER_ID == LoginID)
|
||||||
|
{
|
||||||
|
item.CREATE_TIME = dtNow;
|
||||||
|
}
|
||||||
|
item.MODIFY_TIME = dtNow;
|
||||||
|
item.MODIFIER_ID = LoginID;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (listFile != null && listFile.Count() > 0)
|
||||||
|
{
|
||||||
|
foreach (var item in listFile)
|
||||||
|
{
|
||||||
|
item.ORG_ID = OrgID;
|
||||||
|
if (item.CREATER_ID == LoginID)
|
||||||
|
{
|
||||||
|
item.CREATE_TIME = dtNow;
|
||||||
|
}
|
||||||
|
item.MODIFY_TIME = dtNow;
|
||||||
|
item.MODIFIER_ID = LoginID;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
#region 数据处理
|
||||||
|
|
||||||
|
UnifiedCommit(() =>
|
||||||
|
{
|
||||||
|
if (listLaw != null && listLaw.Any())
|
||||||
|
BantchSaveEntityNoCommit(listLaw);
|
||||||
|
if (listLawType != null && listLawType.Any())
|
||||||
|
BantchSaveEntityNoCommit(listLawType);
|
||||||
|
if (listLawVersion != null && listLawVersion.Any())
|
||||||
|
BantchSaveEntityNoCommit(listLawVersion);
|
||||||
|
if (listFiles != null && listFiles.Any())
|
||||||
|
BantchSaveEntityNoCommit(listFiles);
|
||||||
|
if (listImgFile != null && listImgFile.Any())
|
||||||
|
BantchSaveEntityNoCommit(listImgFile);
|
||||||
|
if (listFile != null && listFile.Any())
|
||||||
|
BantchSaveEntityNoCommit(listFile);
|
||||||
|
});
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 数据同步传参
|
||||||
|
/// </summary>
|
||||||
|
public class SyscList
|
||||||
|
{
|
||||||
|
public List<T_LR_LAW> ListModel { get; set; }//ICollection
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user