Compare commits
	
		
			No commits in common. "1c9f67e3dd95d70017564687072973e61eeec6f3" and "ce170e30770fedc754655e9c4d202723a422852b" have entirely different histories.
		
	
	
		
			1c9f67e3dd
			...
			ce170e3077
		
	
		
@ -300,10 +300,5 @@
 | 
				
			|||||||
        /// 首页 BI/BIStatiscialAnalysisController/GetJobCompletionSort Key
 | 
					        /// 首页 BI/BIStatiscialAnalysisController/GetJobCompletionSort Key
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        public const string HomeJobCompletion = "HomeJobCompletion_{0}";
 | 
					        public const string HomeJobCompletion = "HomeJobCompletion_{0}";
 | 
				
			||||||
 | 
					 | 
				
			||||||
        /// <summary>
 | 
					 | 
				
			||||||
        /// 所有数据库链接
 | 
					 | 
				
			||||||
        /// </summary>
 | 
					 | 
				
			||||||
        public const string ConnAll = "OPConn";
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -51,14 +51,5 @@ namespace APT.MS.Domain.Entities.PF
 | 
				
			|||||||
        public Guid? ROLE_ID { get; set; }
 | 
					        public Guid? ROLE_ID { get; set; }
 | 
				
			||||||
        [Description("导航属性:审批角色")]
 | 
					        [Description("导航属性:审批角色")]
 | 
				
			||||||
        public virtual T_FM_ROLE Nav_Role { get; set; }
 | 
					        public virtual T_FM_ROLE Nav_Role { get; set; }
 | 
				
			||||||
 | 
					 | 
				
			||||||
        /// <summary>
 | 
					 | 
				
			||||||
        /// 是否总部
 | 
					 | 
				
			||||||
        /// </summary>
 | 
					 | 
				
			||||||
        [Description("是否总部")]
 | 
					 | 
				
			||||||
        [FormFieldTable]
 | 
					 | 
				
			||||||
        [FormFieldQuery]
 | 
					 | 
				
			||||||
        [FormFieldEdit]
 | 
					 | 
				
			||||||
        public bool ISHEAD { get; set; }=false;
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -76,14 +76,5 @@ namespace APT.BaseData.Domain.Entities
 | 
				
			|||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        [Description("是否取消")]
 | 
					        [Description("是否取消")]
 | 
				
			||||||
        public bool ISCANCEL { get; set; }
 | 
					        public bool ISCANCEL { get; set; }
 | 
				
			||||||
 | 
					 | 
				
			||||||
        /// <summary>
 | 
					 | 
				
			||||||
        /// 是否总部
 | 
					 | 
				
			||||||
        /// </summary>
 | 
					 | 
				
			||||||
        [Description("是否总部")]
 | 
					 | 
				
			||||||
        [FormFieldTable]
 | 
					 | 
				
			||||||
        [FormFieldQuery]
 | 
					 | 
				
			||||||
        [FormFieldEdit]
 | 
					 | 
				
			||||||
        public bool ISHEAD { get; set; } = false;
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -1,10 +1,8 @@
 | 
				
			|||||||
using APT.BaseData.Domain.ApiModel.Platform;
 | 
					using APT.BaseData.Domain.Entities.FM;
 | 
				
			||||||
using APT.BaseData.Domain.Entities.FM;
 | 
					 | 
				
			||||||
using APT.BaseData.Domain.Entities.OP;
 | 
					using APT.BaseData.Domain.Entities.OP;
 | 
				
			||||||
using APT.BaseData.Domain.Enums.OP;
 | 
					using APT.BaseData.Domain.Enums.OP;
 | 
				
			||||||
using APT.BaseData.Domain.IServices.OP;
 | 
					using APT.BaseData.Domain.IServices.OP;
 | 
				
			||||||
using APT.Infrastructure.Api;
 | 
					using APT.Infrastructure.Api;
 | 
				
			||||||
using APT.Infrastructure.Api.Redis;
 | 
					 | 
				
			||||||
using APT.Infrastructure.Core;
 | 
					using APT.Infrastructure.Core;
 | 
				
			||||||
using APT.Migrations;
 | 
					using APT.Migrations;
 | 
				
			||||||
using Newtonsoft.Json;
 | 
					using Newtonsoft.Json;
 | 
				
			||||||
@ -25,75 +23,39 @@ namespace APT.BaseData.Services.Services.OP
 | 
				
			|||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// 获取 除 ORG_IDBeside 之外对应的数据库链接字典  ORG_ID  DB_CONN
 | 
					        /// 获取 除 ORG_IDBeside 之外对应的数据库链接字典  ORG_ID  DB_CONN
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        /// <param name="ORG_IDBeside">过滤值 没有就不过滤</param>
 | 
					        /// <param name="ORG_IDBeside"></param>
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public Dictionary<Guid, string> GetConnDictionary(Guid? ORG_IDBeside)
 | 
					        public Dictionary<Guid, string> GetConnDictionary(Guid? ORG_IDBeside)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Dictionary<Guid, string> dicORGCONN = new Dictionary<Guid, string>();
 | 
					            Dictionary<Guid, string> dicORGCONN = new Dictionary<Guid, string>();
 | 
				
			||||||
            //从Redis中获取所有数据库链接值
 | 
					            string conn = string.Empty;
 | 
				
			||||||
 | 
					            IEnumerable<T_OP_TENANT> listTent = null;
 | 
				
			||||||
            bool isRedisConfig = true;
 | 
					            using (var context = new MigrationContext())
 | 
				
			||||||
            var redisConfig = APT.Infrastructure.Api.ConfigurationManager.AppSettings["RedisFormConfig"];
 | 
					 | 
				
			||||||
            if (!string.IsNullOrEmpty(redisConfig))
 | 
					 | 
				
			||||||
                isRedisConfig = bool.Parse(redisConfig);
 | 
					 | 
				
			||||||
            if (isRedisConfig)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                if (CsRedisManager.KeyExists(RedisCacheKey.ConnAll))
 | 
					 | 
				
			||||||
                    dicORGCONN = CsRedisManager.StringGet<Dictionary<Guid, string>>(RedisCacheKey.ConnAll);
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            #region    Redis没找到 去数据库查找
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            if (dicORGCONN == null || dicORGCONN.Count < 1)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                string conn = string.Empty;
 | 
					 | 
				
			||||||
                IEnumerable<T_OP_TENANT> listTent = null;
 | 
					 | 
				
			||||||
                using (var context = new MigrationContext())
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    Expression<Func<T_OP_TENANT, bool>> expression = e => e.DB_CONN_ID.HasValue;
 | 
					 | 
				
			||||||
                    listTent = context.GetEntities(expression, null, null);
 | 
					 | 
				
			||||||
                    List<Guid> listConnID = listTent.Select(e => e.DB_CONN_ID.Value).ToList();
 | 
					 | 
				
			||||||
                    var listDbConn = context.GetEntities<T_OP_TENANT_DB_CONN>(e => listConnID.Contains(e.ID), null, null);
 | 
					 | 
				
			||||||
                    if (listDbConn != null && listDbConn.Count() > 0)
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        var env = ConfigurationManager.AppSettings["Env"];
 | 
					 | 
				
			||||||
                        foreach (var item in listDbConn)
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
                            conn = item.DB_CONN;
 | 
					 | 
				
			||||||
                            if (env == ((int)EnvType.外网).ToString())
 | 
					 | 
				
			||||||
                            {
 | 
					 | 
				
			||||||
                                conn = item.DB_CONN_WAN;
 | 
					 | 
				
			||||||
                            }
 | 
					 | 
				
			||||||
                            if (!dicORGCONN.ContainsKey(item.ID))
 | 
					 | 
				
			||||||
                            {
 | 
					 | 
				
			||||||
                                dicORGCONN.Add(listTent.First(e => e.DB_CONN_ID == item.ID).ID, conn);
 | 
					 | 
				
			||||||
                            }
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                        if (isRedisConfig && dicORGCONN.Count > 0)
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
                            try
 | 
					 | 
				
			||||||
                            {
 | 
					 | 
				
			||||||
                                CsRedisManager.StringSet<Dictionary<Guid, string>>(RedisCacheKey.ConnAll, dicORGCONN);//所有数据库链接 存入 Redis
 | 
					 | 
				
			||||||
                            }
 | 
					 | 
				
			||||||
                            catch { }
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            } 
 | 
					 | 
				
			||||||
            #endregion
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            if (dicORGCONN != null && dicORGCONN.Count > 0)
 | 
					 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
 | 
					                Expression<Func<T_OP_TENANT, bool>> expression = e => e.DB_CONN_ID.HasValue;
 | 
				
			||||||
                if (ORG_IDBeside.HasValue)
 | 
					                if (ORG_IDBeside.HasValue)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    Dictionary<Guid, string> dicORGCONN1 = new Dictionary<Guid, string>();
 | 
					                    expression = expression.And(e => e.ID != ORG_IDBeside);
 | 
				
			||||||
                    foreach (var item in dicORGCONN)
 | 
					                }
 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        if (item.Key == ORG_IDBeside.Value)
 | 
					 | 
				
			||||||
                            continue;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        dicORGCONN1.Add(item.Key, item.Value);
 | 
					                listTent = context.GetEntities(expression, null, null);
 | 
				
			||||||
 | 
					                List<Guid> listConnID = listTent.Select(e => e.DB_CONN_ID.Value).ToList();
 | 
				
			||||||
 | 
					                var listDbConn = context.GetEntities<T_OP_TENANT_DB_CONN>(e => listConnID.Contains(e.ID), null, null);
 | 
				
			||||||
 | 
					                if (listDbConn != null && listDbConn.Count() > 0)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    var env = ConfigurationManager.AppSettings["Env"];
 | 
				
			||||||
 | 
					                    foreach (var item in listDbConn)
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        conn = item.DB_CONN;
 | 
				
			||||||
 | 
					                        if (env == ((int)EnvType.外网).ToString())
 | 
				
			||||||
 | 
					                        {
 | 
				
			||||||
 | 
					                            conn = item.DB_CONN_WAN;
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
 | 
					                        if (!dicORGCONN.ContainsKey(item.ID))
 | 
				
			||||||
 | 
					                        {
 | 
				
			||||||
 | 
					                            dicORGCONN.Add(listTent.First(e => e.DB_CONN_ID == item.ID).ID, conn);
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    dicORGCONN = dicORGCONN1;
 | 
					 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            return dicORGCONN;
 | 
					            return dicORGCONN;
 | 
				
			||||||
 | 
				
			|||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@ -1,24 +0,0 @@
 | 
				
			|||||||
using Microsoft.EntityFrameworkCore.Migrations;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
namespace APT.Data.Migrations.Migrations
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    public partial class wyw2025102101 : Migration
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        protected override void Up(MigrationBuilder migrationBuilder)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            migrationBuilder.AddColumn<bool>(
 | 
					 | 
				
			||||||
                name: "ISHEAD",
 | 
					 | 
				
			||||||
                table: "T_PF_APPROVAL_ROLE",
 | 
					 | 
				
			||||||
                type: "bit",
 | 
					 | 
				
			||||||
                nullable: false,
 | 
					 | 
				
			||||||
                defaultValue: false);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        protected override void Down(MigrationBuilder migrationBuilder)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            migrationBuilder.DropColumn(
 | 
					 | 
				
			||||||
                name: "ISHEAD",
 | 
					 | 
				
			||||||
                table: "T_PF_APPROVAL_ROLE");
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@ -1,24 +0,0 @@
 | 
				
			|||||||
using Microsoft.EntityFrameworkCore.Migrations;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
namespace APT.Data.Migrations.Migrations
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    public partial class wyw2025102201 : Migration
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        protected override void Up(MigrationBuilder migrationBuilder)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            migrationBuilder.AddColumn<bool>(
 | 
					 | 
				
			||||||
                name: "ISHEAD",
 | 
					 | 
				
			||||||
                table: "T_PF_APPROVE_DETAIL",
 | 
					 | 
				
			||||||
                type: "bit",
 | 
					 | 
				
			||||||
                nullable: false,
 | 
					 | 
				
			||||||
                defaultValue: false);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        protected override void Down(MigrationBuilder migrationBuilder)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            migrationBuilder.DropColumn(
 | 
					 | 
				
			||||||
                name: "ISHEAD",
 | 
					 | 
				
			||||||
                table: "T_PF_APPROVE_DETAIL");
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@ -11691,9 +11691,6 @@ namespace APT.Data.Migrations.Migrations
 | 
				
			|||||||
                    b.Property<bool>("ISCANCEL")
 | 
					                    b.Property<bool>("ISCANCEL")
 | 
				
			||||||
                        .HasColumnType("bit");
 | 
					                        .HasColumnType("bit");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    b.Property<bool>("ISHEAD")
 | 
					 | 
				
			||||||
                        .HasColumnType("bit");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    b.Property<bool>("IS_ALLOW_UPDATE")
 | 
					                    b.Property<bool>("IS_ALLOW_UPDATE")
 | 
				
			||||||
                        .HasColumnType("bit");
 | 
					                        .HasColumnType("bit");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -53826,9 +53823,6 @@ namespace APT.Data.Migrations.Migrations
 | 
				
			|||||||
                    b.Property<Guid?>("FORM_ID")
 | 
					                    b.Property<Guid?>("FORM_ID")
 | 
				
			||||||
                        .HasColumnType("uniqueidentifier");
 | 
					                        .HasColumnType("uniqueidentifier");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    b.Property<bool>("ISHEAD")
 | 
					 | 
				
			||||||
                        .HasColumnType("bit");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    b.Property<bool>("IS_DELETED")
 | 
					                    b.Property<bool>("IS_DELETED")
 | 
				
			||||||
                        .HasColumnType("bit");
 | 
					                        .HasColumnType("bit");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@ -2,12 +2,10 @@
 | 
				
			|||||||
using APT.BaseData.Domain.IServices.BS;
 | 
					using APT.BaseData.Domain.IServices.BS;
 | 
				
			||||||
using APT.BaseData.Domain.IServices.EX;
 | 
					using APT.BaseData.Domain.IServices.EX;
 | 
				
			||||||
using APT.BaseData.Domain.IServices.FM;
 | 
					using APT.BaseData.Domain.IServices.FM;
 | 
				
			||||||
using APT.BaseData.Domain.IServices.OP;
 | 
					 | 
				
			||||||
using APT.BaseData.Domain.IServices.Platform;
 | 
					using APT.BaseData.Domain.IServices.Platform;
 | 
				
			||||||
using APT.BaseData.Services.DomainServices;
 | 
					using APT.BaseData.Services.DomainServices;
 | 
				
			||||||
using APT.BaseData.Services.Services.EX;
 | 
					using APT.BaseData.Services.Services.EX;
 | 
				
			||||||
using APT.BaseData.Services.Services.FM;
 | 
					using APT.BaseData.Services.Services.FM;
 | 
				
			||||||
using APT.BaseData.Services.Services.OP;
 | 
					 | 
				
			||||||
using APT.BaseData.Services.Services.Platform;
 | 
					using APT.BaseData.Services.Services.Platform;
 | 
				
			||||||
using APT.BaseData.Services.Sys;
 | 
					using APT.BaseData.Services.Sys;
 | 
				
			||||||
using Autofac;
 | 
					using Autofac;
 | 
				
			||||||
@ -55,7 +53,6 @@ namespace APT.FM.WebApi.App_Start
 | 
				
			|||||||
            builder.RegisterType<PFApproveCallBackSEService>().As<IPFApproveCallBackSEService>().InstancePerLifetimeScope();
 | 
					            builder.RegisterType<PFApproveCallBackSEService>().As<IPFApproveCallBackSEService>().InstancePerLifetimeScope();
 | 
				
			||||||
            builder.RegisterType<FMNotificationTaskService>().As<IFMNotificationTaskService>().InstancePerLifetimeScope();
 | 
					            builder.RegisterType<FMNotificationTaskService>().As<IFMNotificationTaskService>().InstancePerLifetimeScope();
 | 
				
			||||||
            builder.RegisterType<PFApproveCallBackService>().As<IPFApproveCallBackService>().InstancePerLifetimeScope();
 | 
					            builder.RegisterType<PFApproveCallBackService>().As<IPFApproveCallBackService>().InstancePerLifetimeScope();
 | 
				
			||||||
            builder.RegisterType<OPTenantDBConnService>().As<IOPTenantDBConnService>().InstancePerLifetimeScope();
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -54,10 +54,7 @@ namespace APT.FM.WebApi.Controllers.Api
 | 
				
			|||||||
                order2.Field = "TASK_STARTDT";
 | 
					                order2.Field = "TASK_STARTDT";
 | 
				
			||||||
                order2.Order = DbOrder.DESC;
 | 
					                order2.Order = DbOrder.DESC;
 | 
				
			||||||
                pageFilter.Orders.Add(order2);
 | 
					                pageFilter.Orders.Add(order2);
 | 
				
			||||||
                pageFilter.OrgId = null;
 | 
					 | 
				
			||||||
                pageFilter.IgnoreOrgRule = true;
 | 
					 | 
				
			||||||
                var bear = new BaseFilter();
 | 
					                var bear = new BaseFilter();
 | 
				
			||||||
                bear.IgnoreOrgRule = true;
 | 
					 | 
				
			||||||
                var todoCount = GetCount<T_FM_NOTIFICATION_TASK>(s => s.USER_ID == userId && s.NOTICE_STATUS == 0 && s.NOTICE_TYPE != 2 && s.NOTICE_TYPE != 7 && s.TASK_ENDDT >= DateTime.Now.AddMonths(-3), bear);
 | 
					                var todoCount = GetCount<T_FM_NOTIFICATION_TASK>(s => s.USER_ID == userId && s.NOTICE_STATUS == 0 && s.NOTICE_TYPE != 2 && s.NOTICE_TYPE != 7 && s.TASK_ENDDT >= DateTime.Now.AddMonths(-3), bear);
 | 
				
			||||||
                var todayNewCount = GetCount<T_FM_NOTIFICATION_TASK>(s => s.USER_ID == userId && s.NOTICE_STATUS == 0 && (s.NOTICE_TYPE == 2 || s.NOTICE_TYPE == 7), bear);//&& s.TASK_STARTDT > shortToday
 | 
					                var todayNewCount = GetCount<T_FM_NOTIFICATION_TASK>(s => s.USER_ID == userId && s.NOTICE_STATUS == 0 && (s.NOTICE_TYPE == 2 || s.NOTICE_TYPE == 7), bear);//&& s.TASK_STARTDT > shortToday
 | 
				
			||||||
                var doneCount = GetCount<T_FM_NOTIFICATION_TASK>(s => s.USER_ID == userId && (s.NOTICE_STATUS == 1 || s.NOTICE_STATUS == 2) && s.NOTICE_TYPE != 2 && s.NOTICE_TYPE != 7, bear);
 | 
					                var doneCount = GetCount<T_FM_NOTIFICATION_TASK>(s => s.USER_ID == userId && (s.NOTICE_STATUS == 1 || s.NOTICE_STATUS == 2) && s.NOTICE_TYPE != 2 && s.NOTICE_TYPE != 7, bear);
 | 
				
			||||||
 | 
				
			|||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@ -34,7 +34,6 @@ using System.Security.Cryptography;
 | 
				
			|||||||
using APT.MS.Domain.Entities.SC.PT;
 | 
					using APT.MS.Domain.Entities.SC.PT;
 | 
				
			||||||
using Microsoft.Extensions.DependencyModel;
 | 
					using Microsoft.Extensions.DependencyModel;
 | 
				
			||||||
using APT.MS.Domain.Entities.SK;
 | 
					using APT.MS.Domain.Entities.SK;
 | 
				
			||||||
using APT.BaseData.Domain.IServices.OP;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace APT.FM.WebApi.Controllers.Api.FM
 | 
					namespace APT.FM.WebApi.Controllers.Api.FM
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@ -48,18 +47,15 @@ namespace APT.FM.WebApi.Controllers.Api.FM
 | 
				
			|||||||
        IFMUserService UserService { get; set; }
 | 
					        IFMUserService UserService { get; set; }
 | 
				
			||||||
        IFMDepartmentService DepartmentService { get; set; }
 | 
					        IFMDepartmentService DepartmentService { get; set; }
 | 
				
			||||||
        IFMNotificationTaskService NotificationTaskService { get; set; }
 | 
					        IFMNotificationTaskService NotificationTaskService { get; set; }
 | 
				
			||||||
        IOPTenantDBConnService OPTenantDBConnService { get; set; }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// 
 | 
					        /// 
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        /// <param name="personnelService"></param>
 | 
					        /// <param name="personnelService"></param>
 | 
				
			||||||
        public UserController(IFMUserService personnelService, IFMDepartmentService departmentService, IFMNotificationTaskService notificationTaskService, IOPTenantDBConnService opTenantDBConnService)
 | 
					        public UserController(IFMUserService personnelService, IFMDepartmentService departmentService, IFMNotificationTaskService notificationTaskService)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            UserService = personnelService;
 | 
					            UserService = personnelService;
 | 
				
			||||||
            DepartmentService = departmentService;
 | 
					            DepartmentService = departmentService;
 | 
				
			||||||
            NotificationTaskService = notificationTaskService;
 | 
					            NotificationTaskService = notificationTaskService;
 | 
				
			||||||
            OPTenantDBConnService = opTenantDBConnService;
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
@ -487,125 +483,110 @@ namespace APT.FM.WebApi.Controllers.Api.FM
 | 
				
			|||||||
                T_OG_SAFE_PDT_SIGNED_POST signPost = null;
 | 
					                T_OG_SAFE_PDT_SIGNED_POST signPost = null;
 | 
				
			||||||
                T_PT_ASSESSMENT_PLAN_AUDIT_TEMP_DETAIL library = null;
 | 
					                T_PT_ASSESSMENT_PLAN_AUDIT_TEMP_DETAIL library = null;
 | 
				
			||||||
                T_FM_NOTIFICATION_TASK noticeToday = null;
 | 
					                T_FM_NOTIFICATION_TASK noticeToday = null;
 | 
				
			||||||
                if (string.IsNullOrEmpty(entity.CODE))
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    throw new Exception("工号不允许为空!");
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                if (entity.CODE.Length <= 3)
 | 
					 | 
				
			||||||
                    this.ThrowError("050003");
 | 
					 | 
				
			||||||
                if (string.IsNullOrEmpty(entity.NAME))
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    throw new Exception("姓名不允许为空!");
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                if (entity.Nav_Person.POST_ID == null)
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    throw new Exception("岗位不允许为空!");
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                if (!isAdd.Any())
 | 
					                if (!isAdd.Any())
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
 | 
					                    if (entity.CODE.Length <= 3)
 | 
				
			||||||
 | 
					                        this.ThrowError("050003");
 | 
				
			||||||
                    userList = this.GetEntities<T_FM_USER>(t => (t.CODE == entity.CODE || t.APPROVE_ROLE_ID == entity.APPROVE_ROLE_ID) && t.ORG_ID == entity.ORG_ID, null, "Nav_Department").ToList();
 | 
					                    userList = this.GetEntities<T_FM_USER>(t => (t.CODE == entity.CODE || t.APPROVE_ROLE_ID == entity.APPROVE_ROLE_ID) && t.ORG_ID == entity.ORG_ID, null, "Nav_Department").ToList();
 | 
				
			||||||
                    var isRepeat = userList.FirstOrDefault(t => t.CODE == entity.CODE);
 | 
					                    var isRepeat = userList.FirstOrDefault(t => t.CODE == entity.CODE);
 | 
				
			||||||
                    if (isRepeat != null)
 | 
					                    if (isRepeat != null)
 | 
				
			||||||
                        this.ThrowError("050001");
 | 
					                        this.ThrowError("050001");
 | 
				
			||||||
                    if (entity.ORG_ID != Guid.Parse("b043b28b-bbc3-c452-6052-4fba1457abfa"))
 | 
					                    if (entity.ORG_ID != Guid.Parse("b043b28b-bbc3-c452-6052-4fba1457abfa"))
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        #region    //
 | 
					                        #region 新增人员增加三级安全教育
 | 
				
			||||||
                        #region //新增人员增加三级安全教育
 | 
					                        eduCard = new T_SE_THREE_LEVEL_SAFE_EDU_CARD();
 | 
				
			||||||
                        //eduCard = new T_SE_THREE_LEVEL_SAFE_EDU_CARD();
 | 
					                        eduCard.ID = Guid.NewGuid();
 | 
				
			||||||
                        //eduCard.ID = Guid.NewGuid();
 | 
					                        eduCard.ID_CARD_NUMBER = entity.ID_CARD;
 | 
				
			||||||
                        //eduCard.ID_CARD_NUMBER = entity.ID_CARD;
 | 
					                        eduCard.IN_TIME = entity.ENTRYTIME;
 | 
				
			||||||
                        //eduCard.IN_TIME = entity.ENTRYTIME;
 | 
					                        eduCard.USER_ID = entity.ID;
 | 
				
			||||||
                        //eduCard.USER_ID = entity.ID;
 | 
					                        eduCard.DEPARTMENT_ID = entity.DEPARTMENT_ID;
 | 
				
			||||||
                        //eduCard.DEPARTMENT_ID = entity.DEPARTMENT_ID;
 | 
					                        eduCard.LAUNCH_TIME = DateTime.Now;
 | 
				
			||||||
                        //eduCard.LAUNCH_TIME = DateTime.Now;
 | 
					                        eduCard.ORG_ID = entity.ORG_ID;
 | 
				
			||||||
                        //eduCard.ORG_ID = entity.ORG_ID;
 | 
					                        eduCard.POST_ID = entity.Nav_Person.POST_ID;
 | 
				
			||||||
                        //eduCard.POST_ID = entity.Nav_Person.POST_ID;
 | 
					                        eduCard.STATUS = SEThreeLevelSafeTrainStatus.公司培训;
 | 
				
			||||||
                        //eduCard.STATUS = SEThreeLevelSafeTrainStatus.公司培训;
 | 
					                        eduCard.LAUNCH_USER_ID = APT.Infrastructure.Api.AppContext.CurrentSession.UserID;
 | 
				
			||||||
                        //eduCard.LAUNCH_USER_ID = APT.Infrastructure.Api.AppContext.CurrentSession.UserID;
 | 
					                        eduCard.LAUNCH_DEPARTMENT_ID = APT.Infrastructure.Api.AppContext.CurrentSession.DepartmentID;
 | 
				
			||||||
                        //eduCard.LAUNCH_DEPARTMENT_ID = APT.Infrastructure.Api.AppContext.CurrentSession.DepartmentID;
 | 
					                        next_train_record = new T_SE_THREE_LEVEL_SAFE_TRAIN_RECORD
 | 
				
			||||||
                        //next_train_record = new T_SE_THREE_LEVEL_SAFE_TRAIN_RECORD
 | 
					                        {
 | 
				
			||||||
                        //{
 | 
					                            ID = Guid.NewGuid(),
 | 
				
			||||||
                        //    ID = Guid.NewGuid(),
 | 
					                            EDU_CARD_ID = eduCard.ID,
 | 
				
			||||||
                        //    EDU_CARD_ID = eduCard.ID,
 | 
					                            ORG_ID = eduCard.ORG_ID,
 | 
				
			||||||
                        //    ORG_ID = eduCard.ORG_ID,
 | 
					                            THREE_LEVEL_SAFE_TRAIN_TYPE = SEThreeLevelSafeTrainType.公司级
 | 
				
			||||||
                        //    THREE_LEVEL_SAFE_TRAIN_TYPE = SEThreeLevelSafeTrainType.公司级
 | 
					                        };
 | 
				
			||||||
                        //};
 | 
					                        var train_contents = GetEntity<T_SE_THREE_LEVEL_SAFE_CONTENT>(t => t.THREE_LEVEL_SAFE_TRAIN_TYPE == (SEThreeLevelSafeTrainType)eduCard.STATUS.GetInt());
 | 
				
			||||||
                        //var train_contents = GetEntity<T_SE_THREE_LEVEL_SAFE_CONTENT>(t => t.THREE_LEVEL_SAFE_TRAIN_TYPE == (SEThreeLevelSafeTrainType)eduCard.STATUS.GetInt());
 | 
					                        next_train_record.CONTENT_ID = train_contents.ID;
 | 
				
			||||||
                        //next_train_record.CONTENT_ID = train_contents.ID;
 | 
					                        var postName = GetEntity<T_FM_USER_POST>(eduCard.POST_ID ?? Guid.Empty)?.NAME;
 | 
				
			||||||
                        //var postName = GetEntity<T_FM_USER_POST>(eduCard.POST_ID ?? Guid.Empty)?.NAME;
 | 
					                        var sendUser = GetEntity<T_FM_USER>(t => t.Nav_ApproveRole != null && t.Nav_ApproveRole.NAME == "安环部安全员" && t.IS_DELETED == false && t.ENABLE_STATUS == 0);
 | 
				
			||||||
                        //var sendUser = GetEntity<T_FM_USER>(t => t.Nav_ApproveRole != null && t.Nav_ApproveRole.NAME == "安环部安全员" && t.IS_DELETED == false && t.ENABLE_STATUS == 0);
 | 
					                        if (sendUser != null)
 | 
				
			||||||
                        //if (sendUser != null)
 | 
					                        {
 | 
				
			||||||
                        //{
 | 
					                            var endTime = entity.ENTRYTIME.AddMonths(1);
 | 
				
			||||||
                        //    var endTime = entity.ENTRYTIME.AddMonths(1);
 | 
					                            var newEndTime = new DateTime(endTime.Year, endTime.Month, endTime.Day, 23, 59, 59);
 | 
				
			||||||
                        //    var newEndTime = new DateTime(endTime.Year, endTime.Month, endTime.Day, 23, 59, 59);
 | 
					                            sendNotice.Add(NotificationTaskService.InsertUserNoticeTaskModel("三级安全培训记录-" + entity.NAME + "-" + eduCard.STATUS.GetDescription(), next_train_record.ID, entity.ORG_ID, sendUser.ID, sendUser.NAME, DateTime.Now, newEndTime, 1, "SE042"));
 | 
				
			||||||
                        //    sendNotice.Add(NotificationTaskService.InsertUserNoticeTaskModel("三级安全培训记录-" + entity.NAME + "-" + eduCard.STATUS.GetDescription(), next_train_record.ID, entity.ORG_ID, sendUser.ID, sendUser.NAME, DateTime.Now, newEndTime, 1, "SE042"));
 | 
					                        }
 | 
				
			||||||
                        //}
 | 
					 | 
				
			||||||
                        #endregion
 | 
					                        #endregion
 | 
				
			||||||
                        #region //新增人员触发安全生产责任制
 | 
					                        #region 新增人员触发安全生产责任制
 | 
				
			||||||
                        //var post = GetEntity<T_SC_DEPARTMENT_POST>(t => t.Nav_Dept.DEPARTMENT_ID == entity.DEPARTMENT_ID && t.DEPOST_ID == entity.Nav_Person.POST_ID, new string[] { "Nav_Dept.Nav_Post" });
 | 
					                        var post = GetEntity<T_SC_DEPARTMENT_POST>(t => t.Nav_Dept.DEPARTMENT_ID == entity.DEPARTMENT_ID && t.DEPOST_ID == entity.Nav_Person.POST_ID, new string[] { "Nav_Dept.Nav_Post" });
 | 
				
			||||||
                        //if (post != null)
 | 
					                        if (post != null)
 | 
				
			||||||
                        //{
 | 
					                        {
 | 
				
			||||||
                        //    var standardCreate = GetEntity<T_SC_STANDARD_CREATE>(t => t.POST_ID == post.Nav_Dept.POST_ID && t.STATUS == SCSystemEditStatus.已归档 && t.FILE_STATUS == SCSystemFileStatus.有效);
 | 
					                            var standardCreate = GetEntity<T_SC_STANDARD_CREATE>(t => t.POST_ID == post.Nav_Dept.POST_ID && t.STATUS == SCSystemEditStatus.已归档 && t.FILE_STATUS == SCSystemFileStatus.有效);
 | 
				
			||||||
                        //    if (standardCreate != null)
 | 
					                            if (standardCreate != null)
 | 
				
			||||||
                        //    {
 | 
					                            {
 | 
				
			||||||
                        //        var chargeUser = GetEntity<T_FM_USER>(t => t.DEPARTMENT_ID == post.Nav_Dept.Nav_Post.DEPARTMENT_ID && t.Nav_Person.POST_ID == post.Nav_Dept.Nav_Post.DEPOST_ID && t.ENABLE_STATUS == 0);
 | 
					                                var chargeUser = GetEntity<T_FM_USER>(t => t.DEPARTMENT_ID == post.Nav_Dept.Nav_Post.DEPARTMENT_ID && t.Nav_Person.POST_ID == post.Nav_Dept.Nav_Post.DEPOST_ID && t.ENABLE_STATUS == 0);
 | 
				
			||||||
                        //        if (chargeUser != null)
 | 
					                                if (chargeUser != null)
 | 
				
			||||||
                        //        {
 | 
					                                {
 | 
				
			||||||
                        //            signRecord = new T_OG_SAFE_PDT_SIGNED
 | 
					                                    signRecord = new T_OG_SAFE_PDT_SIGNED
 | 
				
			||||||
                        //            {
 | 
					                                    {
 | 
				
			||||||
                        //                ID = Guid.NewGuid(),
 | 
					                                        ID = Guid.NewGuid(),
 | 
				
			||||||
                        //                ORG_ID = entity.ORG_ID,
 | 
					                                        ORG_ID = entity.ORG_ID,
 | 
				
			||||||
                        //                STATUS = (int)PFStandardStatus.Draft,
 | 
					                                        STATUS = (int)PFStandardStatus.Draft,
 | 
				
			||||||
                        //                TRIGGER_TYPE = OGPersonalSignedTriggerType.新员工触发,
 | 
					                                        TRIGGER_TYPE = OGPersonalSignedTriggerType.新员工触发,
 | 
				
			||||||
                        //                //TRIGGER_TYPE = OGPersonalSignedTriggerType.手动新增,
 | 
					                                        //TRIGGER_TYPE = OGPersonalSignedTriggerType.手动新增,
 | 
				
			||||||
                        //                STANDARD_ID = standardCreate.ID,
 | 
					                                        STANDARD_ID = standardCreate.ID,
 | 
				
			||||||
                        //                FILE_CONTENT = standardCreate.FILE_CONTENT,
 | 
					                                        FILE_CONTENT = standardCreate.FILE_CONTENT,
 | 
				
			||||||
                        //                DEPARTMENT_ID = entity.DEPARTMENT_ID,
 | 
					                                        DEPARTMENT_ID = entity.DEPARTMENT_ID,
 | 
				
			||||||
                        //                ANNUAL = DateTime.Now.Year
 | 
					                                        ANNUAL = DateTime.Now.Year
 | 
				
			||||||
                        //            };
 | 
					                                    };
 | 
				
			||||||
                        //            if (chargeUser != null)
 | 
					                                    if (chargeUser != null)
 | 
				
			||||||
                        //            {
 | 
					                                    {
 | 
				
			||||||
                        //                signRecord.CHARGE_USER_ID = chargeUser.ID;
 | 
					                                        signRecord.CHARGE_USER_ID = chargeUser.ID;
 | 
				
			||||||
                        //            }
 | 
					                                    }
 | 
				
			||||||
                        //            signPost = new T_OG_SAFE_PDT_SIGNED_POST
 | 
					                                    signPost = new T_OG_SAFE_PDT_SIGNED_POST
 | 
				
			||||||
                        //            {
 | 
					                                    {
 | 
				
			||||||
                        //                SAFE_PDT_SIGNED_ID = signRecord.ID,
 | 
					                                        SAFE_PDT_SIGNED_ID = signRecord.ID,
 | 
				
			||||||
                        //                ID = Guid.NewGuid(),
 | 
					                                        ID = Guid.NewGuid(),
 | 
				
			||||||
                        //                ORG_ID = entity.ORG_ID,
 | 
					                                        ORG_ID = entity.ORG_ID,
 | 
				
			||||||
                        //                USER_ID = entity.ID,
 | 
					                                        USER_ID = entity.ID,
 | 
				
			||||||
                        //                POST_ID = entity.Nav_Person.POST_ID,
 | 
					                                        POST_ID = entity.Nav_Person.POST_ID,
 | 
				
			||||||
                        //                CHARGE_USER_ID = signRecord.CHARGE_USER_ID
 | 
					                                        CHARGE_USER_ID = signRecord.CHARGE_USER_ID
 | 
				
			||||||
                        //            };
 | 
					                                    };
 | 
				
			||||||
                        //            sendNotice.Add(NotificationTaskService.InsertUserNoticeTaskModel(DateTime.Now.ToShortDateString() + "安全生产责任制个人签订表", signRecord.ID, entity.ORG_ID, entity.ID, entity.NAME, DateTime.Now, DateTime.Now.AddDays(7), 1, "OG001_SHOWPRINT"));
 | 
					                                    sendNotice.Add(NotificationTaskService.InsertUserNoticeTaskModel(DateTime.Now.ToShortDateString() + "安全生产责任制个人签订表", signRecord.ID, entity.ORG_ID, entity.ID, entity.NAME, DateTime.Now, DateTime.Now.AddDays(7), 1, "OG001_SHOWPRINT"));
 | 
				
			||||||
                        //        }
 | 
					                                }
 | 
				
			||||||
                        //    }
 | 
					                            }
 | 
				
			||||||
                        //}
 | 
					                        }
 | 
				
			||||||
                        //else
 | 
					                        else
 | 
				
			||||||
                        //{
 | 
					                        {
 | 
				
			||||||
                        //    if (sendUser != null)
 | 
					                            if (sendUser != null)
 | 
				
			||||||
                        //    {
 | 
					                            {
 | 
				
			||||||
                        //        sendNotice.Add(NotificationTaskService.InsertUserNoticeTaskModel("请为《" + postName + "》绑定责任制岗位并上传责任状", entity.ID, entity.ORG_ID, sendUser.ID, sendUser.NAME, DateTime.Now, DateTime.Now.AddDays(7), (int)FMNoticeTypeEnum.今日提醒, "PF135"));
 | 
					                                sendNotice.Add(NotificationTaskService.InsertUserNoticeTaskModel("请为《" + postName + "》绑定责任制岗位并上传责任状", entity.ID, entity.ORG_ID, sendUser.ID, sendUser.NAME, DateTime.Now, DateTime.Now.AddDays(7), (int)FMNoticeTypeEnum.今日提醒, "PF135"));
 | 
				
			||||||
                        //    }
 | 
					                            }
 | 
				
			||||||
                        //}
 | 
					                        }
 | 
				
			||||||
                        #endregion 
 | 
					 | 
				
			||||||
                        #endregion
 | 
					                        #endregion
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    //#region 增加新增人员到ops表
 | 
					                    #region 增加新增人员到ops表
 | 
				
			||||||
                    //using (var context = new MigrationContext(ConfigurationManager.ConnectionStrings["default"]))
 | 
					                    using (var context = new MigrationContext(ConfigurationManager.ConnectionStrings["default"]))
 | 
				
			||||||
                    //{
 | 
					                    {
 | 
				
			||||||
                    //    var tennant = context.GetEntity<T_OP_TENANT>(t => t.ID == entity.ORG_ID, new string[] { "CODE" }).CODE;
 | 
					                        var tennant = context.GetEntity<T_OP_TENANT>(t => t.ID == entity.ORG_ID, new string[] { "CODE" }).CODE;
 | 
				
			||||||
                    //    T_OP_ALLUSER alluser = new T_OP_ALLUSER();
 | 
					                        T_OP_ALLUSER alluser = new T_OP_ALLUSER();
 | 
				
			||||||
                    //    alluser.ID = entity.ID;
 | 
					                        alluser.ID = entity.ID;
 | 
				
			||||||
                    //    alluser.CODE = entity.CODE;
 | 
					                        alluser.CODE = entity.CODE;
 | 
				
			||||||
                    //    alluser.TENANT = tennant;
 | 
					                        alluser.TENANT = tennant;
 | 
				
			||||||
                    //    alluser.ORG_ID = entity.ORG_ID;
 | 
					                        alluser.ORG_ID = entity.ORG_ID;
 | 
				
			||||||
                    //    alluser.PHONE = entity.PHONE;
 | 
					                        alluser.PHONE = entity.PHONE;
 | 
				
			||||||
                    //    context.AddEntity(alluser);
 | 
					                        context.AddEntity(alluser);
 | 
				
			||||||
                    //    context.SaveChanges();
 | 
					                        context.SaveChanges();
 | 
				
			||||||
                    //}
 | 
					                    }
 | 
				
			||||||
                    //#endregion
 | 
					                    #endregion
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    #region   //wyw 密码初始化  Xyy+code(姓名拼音首字母(第一个大写)  +  工号(取数字)
 | 
					                    #region   //wyw 密码初始化  Xyy+code(姓名拼音首字母(第一个大写)  +  工号(取数字)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -747,8 +728,8 @@ namespace APT.FM.WebApi.Controllers.Api.FM
 | 
				
			|||||||
                            }
 | 
					                            }
 | 
				
			||||||
                            if (roleInfo.DEPARTMENT_TYPE != 3 && roleInfo.DEPARTMENT_TYPE != departmentInfo.DEPARTMENT_TYPE)
 | 
					                            if (roleInfo.DEPARTMENT_TYPE != 3 && roleInfo.DEPARTMENT_TYPE != departmentInfo.DEPARTMENT_TYPE)
 | 
				
			||||||
                            {
 | 
					                            {
 | 
				
			||||||
                                var param = ((FMDepartmentType)departmentInfo.DEPARTMENT_TYPE).GetDescription();
 | 
					                                var param = Enum.GetName(typeof(FMDepartmentType), departmentInfo.DEPARTMENT_TYPE);
 | 
				
			||||||
                                var param2 = ((FMDepartmentType)roleInfo.DEPARTMENT_TYPE).GetDescription();
 | 
					                                var param2 = Enum.GetName(typeof(FMDepartmentType), roleInfo.DEPARTMENT_TYPE);
 | 
				
			||||||
                                throw new Exception(departmentInfo.NAME + "是" + param + "," + roleInfo.NAME + "是" + param2 + ",组织层级不一致");
 | 
					                                throw new Exception(departmentInfo.NAME + "是" + param + "," + roleInfo.NAME + "是" + param2 + ",组织层级不一致");
 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
@ -756,6 +737,10 @@ namespace APT.FM.WebApi.Controllers.Api.FM
 | 
				
			|||||||
                }
 | 
					                }
 | 
				
			||||||
                else
 | 
					                else
 | 
				
			||||||
                    this.ThrowError("060001");
 | 
					                    this.ThrowError("060001");
 | 
				
			||||||
 | 
					                if (entity.Nav_Person.POST_ID == null)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    throw new Exception("岗位不允许为空!");
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
                //else
 | 
					                //else
 | 
				
			||||||
                //{
 | 
					                //{
 | 
				
			||||||
                //    //查双控库是否有该辨识岗位,没有的话触发今日提醒给安全员
 | 
					                //    //查双控库是否有该辨识岗位,没有的话触发今日提醒给安全员
 | 
				
			||||||
@ -943,38 +928,6 @@ namespace APT.FM.WebApi.Controllers.Api.FM
 | 
				
			|||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                var isHead = HeadHelper.GetIsHead(this.Request.Headers);
 | 
					 | 
				
			||||||
                Dictionary<Guid, string> dicConn = null;
 | 
					 | 
				
			||||||
                if (isHead)
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    dicConn = OPTenantDBConnService.GetConnDictionary(entity.ORG_ID);
 | 
					 | 
				
			||||||
                    if (dicConn == null)
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        throw new Exception("获取子公司链接失败,请关闭页面刷新后再试");
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                #region   总用户库添加
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                if (!isAdd.Any())
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    using (var context = new MigrationContext(ConfigurationManager.ConnectionStrings["default"]))
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        var tennant = context.GetEntity<T_OP_TENANT>(t => t.ID == entity.ORG_ID, new string[] { "CODE" }).CODE;
 | 
					 | 
				
			||||||
                        T_OP_ALLUSER alluser = new T_OP_ALLUSER();
 | 
					 | 
				
			||||||
                        alluser.ID = entity.ID;
 | 
					 | 
				
			||||||
                        alluser.CODE = entity.CODE;
 | 
					 | 
				
			||||||
                        alluser.TENANT = tennant;
 | 
					 | 
				
			||||||
                        alluser.ORG_ID = entity.ORG_ID;
 | 
					 | 
				
			||||||
                        alluser.PHONE = entity.PHONE;
 | 
					 | 
				
			||||||
                        context.AddEntity(alluser);
 | 
					 | 
				
			||||||
                        context.SaveChanges();
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                #endregion
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                UnifiedCommit(() =>
 | 
					                UnifiedCommit(() =>
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    if (person != null)
 | 
					                    if (person != null)
 | 
				
			||||||
@ -1032,68 +985,6 @@ namespace APT.FM.WebApi.Controllers.Api.FM
 | 
				
			|||||||
                    if (noticeToday != null)
 | 
					                    if (noticeToday != null)
 | 
				
			||||||
                        this.UpdateEntityNoCommit(noticeToday);
 | 
					                        this.UpdateEntityNoCommit(noticeToday);
 | 
				
			||||||
                });
 | 
					                });
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                #region    wyw  如果是总部  人员信息同步到子公司
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                if (isHead)
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    entity.Nav_Department = null;
 | 
					 | 
				
			||||||
                    entity.Nav_BelongRoles = null;
 | 
					 | 
				
			||||||
                    entity.Nav_BelongRoleGroups = null;
 | 
					 | 
				
			||||||
                    entity.Nav_BelongUserGroups = null;
 | 
					 | 
				
			||||||
                    entity.Nav_UserPhotoFiles = null;
 | 
					 | 
				
			||||||
                    entity.Nav_UserSignFiles = null;
 | 
					 | 
				
			||||||
                    entity.TEAM_ID = null;
 | 
					 | 
				
			||||||
                    entity.Nav_ApproveRole = null;
 | 
					 | 
				
			||||||
                    entity.PROJECT_ID = null;
 | 
					 | 
				
			||||||
                    entity.PRINTER_ID = null;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    person.Nav_DepartMent = null;
 | 
					 | 
				
			||||||
                    person.Nav_Post = null;
 | 
					 | 
				
			||||||
                    person.POST_ID = null;
 | 
					 | 
				
			||||||
                    person.Nav_TeamPersons = null;
 | 
					 | 
				
			||||||
                    person.Nav_PersonWorks = null;
 | 
					 | 
				
			||||||
                    person.Nav_PersonSkills = null;
 | 
					 | 
				
			||||||
                    person.Nav_PersonIDCardFiles = null;
 | 
					 | 
				
			||||||
                    person.Nav_PersonEducationFiles = null;
 | 
					 | 
				
			||||||
                    person.Nav_PersonCertificateFiles = null;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    int EditC = 0;
 | 
					 | 
				
			||||||
                    foreach (var item in dicConn)
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        try
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
                            entity.ORG_ID = item.Key;
 | 
					 | 
				
			||||||
                            person.ORG_ID = item.Key;
 | 
					 | 
				
			||||||
                            using (var context = new MigrationContext(item.Value))
 | 
					 | 
				
			||||||
                            {
 | 
					 | 
				
			||||||
                                EditC = context.GetCount<T_FM_USER>(e => e.ID == entity.ID);
 | 
					 | 
				
			||||||
                                entity.DEPARTMENT_ID = context.GetEntity<T_FM_DEPARTMENT>(e => e.PARENT_ID == null && !e.IS_DELETED && e.DEPARTMENT_TYPE == 5, null).ID;
 | 
					 | 
				
			||||||
                                person.DEPARTMENT_ID = entity.DEPARTMENT_ID;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                                if (EditC > 0)
 | 
					 | 
				
			||||||
                                {
 | 
					 | 
				
			||||||
                                    context.UpdateEntity(entity);
 | 
					 | 
				
			||||||
                                    context.UpdateEntity(person);
 | 
					 | 
				
			||||||
                                    context.SaveChanges();
 | 
					 | 
				
			||||||
                                }
 | 
					 | 
				
			||||||
                                else
 | 
					 | 
				
			||||||
                                {
 | 
					 | 
				
			||||||
                                    context.AddEntity(person);
 | 
					 | 
				
			||||||
                                    context.AddEntity(entity);
 | 
					 | 
				
			||||||
                                    context.SaveChanges();
 | 
					 | 
				
			||||||
                                }
 | 
					 | 
				
			||||||
                            }
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                        catch (Exception ex)
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                #endregion
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                return true;
 | 
					                return true;
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
				
			|||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@ -1,128 +1,137 @@
 | 
				
			|||||||
 
 | 
					
 | 
				
			||||||
 
 | 
					
 | 
				
			||||||
 
 | 
					 
 | 
				
			||||||
  
 | 
					
 | 
				
			||||||
//------------------------------------------------------------------------------
 | 
					
 | 
				
			||||||
//     T4模板文件:基础接口类
 | 
					
 | 
				
			||||||
//     此代码由T4模板自动生成
 | 
					 
 | 
				
			||||||
//     对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
 | 
					 
 | 
				
			||||||
//------------------------------------------------------------------------------
 | 
					  
 | 
				
			||||||
using APT.Infrastructure.Core;
 | 
					
 | 
				
			||||||
using Microsoft.AspNetCore.Mvc;
 | 
					//------------------------------------------------------------------------------
 | 
				
			||||||
using System.Collections.Generic;
 | 
					//     T4模板文件:基础接口类
 | 
				
			||||||
using APT.Utility;
 | 
					//     此代码由T4模板自动生成
 | 
				
			||||||
using APT.Infrastructure.Api;
 | 
					//     对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
 | 
				
			||||||
using APT.BaseData.Domain.ApiModel.PF;
 | 
					//------------------------------------------------------------------------------
 | 
				
			||||||
namespace APT.LG.WebApi.Controllers.Api
 | 
					using APT.Infrastructure.Core;
 | 
				
			||||||
{
 | 
					using Microsoft.AspNetCore.Mvc;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using APT.Utility;
 | 
				
			||||||
 | 
					using APT.Infrastructure.Api;
 | 
				
			||||||
 | 
					using APT.BaseData.Domain.ApiModel.PF;
 | 
				
			||||||
 | 
					namespace APT.LG.WebApi.Controllers.Api
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
	using APT.BaseData.Domain.Entities.LG;
 | 
						using APT.BaseData.Domain.Entities.LG;
 | 
				
			||||||
	#region  Oprate-表单操作日志表
 | 
					
 | 
				
			||||||
	/// <summary>
 | 
						#region  Oprate-表单操作日志表
 | 
				
			||||||
    ///  表单操作日志表
 | 
						/// <summary>
 | 
				
			||||||
    /// </summary>
 | 
					    ///  表单操作日志表
 | 
				
			||||||
	[Route("api/LG/Oprate")]
 | 
					    /// </summary>
 | 
				
			||||||
    public partial class OprateController : AuthorizeApiController<T_LG_OPRATE>
 | 
						[Route("api/LG/Oprate")]
 | 
				
			||||||
    {   
 | 
					    public partial class OprateController : AuthorizeApiController<T_LG_OPRATE>
 | 
				
			||||||
       /// <summary>
 | 
					    {   
 | 
				
			||||||
       /// 查询所有数据
 | 
					       /// <summary>
 | 
				
			||||||
       /// </summary>
 | 
					       /// 查询所有数据
 | 
				
			||||||
       /// <param name="filter">过滤实体</param>
 | 
					       /// </summary>
 | 
				
			||||||
       /// <returns></returns>
 | 
					       /// <param name="filter">过滤实体</param>
 | 
				
			||||||
       [HttpPost, Route("Entities")]
 | 
					       /// <returns></returns>
 | 
				
			||||||
       public JsonActionResult<IEnumerable<T_LG_OPRATE>> Entities([FromBody]KeywordFilter filter)
 | 
					       [HttpPost, Route("Entities")]
 | 
				
			||||||
       {
 | 
					       public JsonActionResult<IEnumerable<T_LG_OPRATE>> Entities([FromBody]KeywordFilter filter)
 | 
				
			||||||
           return WitEntities(null, filter);
 | 
					       {
 | 
				
			||||||
       }
 | 
					           return WitEntities(null, filter);
 | 
				
			||||||
 | 
					       }
 | 
				
			||||||
        /// <summary>
 | 
					
 | 
				
			||||||
       /// 排序查询所有数据
 | 
					        /// <summary>
 | 
				
			||||||
       /// </summary>
 | 
					       /// 排序查询所有数据
 | 
				
			||||||
       /// <param name="filter">过滤实体</param>
 | 
					       /// </summary>
 | 
				
			||||||
       /// <returns></returns>
 | 
					       /// <param name="filter">过滤实体</param>
 | 
				
			||||||
 | 
					       /// <returns></returns>
 | 
				
			||||||
       [HttpPost, Route("OrderEntities")]
 | 
					
 | 
				
			||||||
       public JsonActionResult<IEnumerable<T_LG_OPRATE>> OrderEntities([FromBody]KeywordFilter filter)
 | 
					       [HttpPost, Route("OrderEntities")]
 | 
				
			||||||
       {
 | 
					       public JsonActionResult<IEnumerable<T_LG_OPRATE>> OrderEntities([FromBody]KeywordFilter filter)
 | 
				
			||||||
           return WitOrderEntities(null, filter);
 | 
					       {
 | 
				
			||||||
       }
 | 
					           return WitOrderEntities(null, filter);
 | 
				
			||||||
 | 
					       }
 | 
				
			||||||
       /// <summary>
 | 
					
 | 
				
			||||||
       /// 分页查询数据
 | 
					       /// <summary>
 | 
				
			||||||
       /// </summary>
 | 
					       /// 分页查询数据
 | 
				
			||||||
       /// <param name="pageFilter">分页过滤实体</param>
 | 
					       /// </summary>
 | 
				
			||||||
       /// <returns></returns>
 | 
					       /// <param name="pageFilter">分页过滤实体</param>
 | 
				
			||||||
       [HttpPost, Route("Paged")]
 | 
					       /// <returns></returns>
 | 
				
			||||||
       public PagedActionResult<T_LG_OPRATE> Paged([FromBody]KeywordPageFilter pageFilter)
 | 
					       [HttpPost, Route("Paged")]
 | 
				
			||||||
       {
 | 
					       public PagedActionResult<T_LG_OPRATE> Paged([FromBody]KeywordPageFilter pageFilter)
 | 
				
			||||||
           return WitPaged(null, pageFilter);
 | 
					       {
 | 
				
			||||||
       }
 | 
					           return WitPaged(null, pageFilter);
 | 
				
			||||||
 | 
					       }
 | 
				
			||||||
       /// <summary>
 | 
					
 | 
				
			||||||
       /// 排序分页查询数据
 | 
					       /// <summary>
 | 
				
			||||||
       /// </summary>
 | 
					       /// 排序分页查询数据
 | 
				
			||||||
       /// <param name="pageFilter">分页过滤实体</param>
 | 
					       /// </summary>
 | 
				
			||||||
       /// <returns></returns>
 | 
					       /// <param name="pageFilter">分页过滤实体</param>
 | 
				
			||||||
       [HttpPost, Route("OrderPaged")]
 | 
					       /// <returns></returns>
 | 
				
			||||||
       public PagedActionResult<T_LG_OPRATE> OrderPaged([FromBody]KeywordPageFilter pageFilter)
 | 
					       [HttpPost, Route("OrderPaged")]
 | 
				
			||||||
       {
 | 
					       public PagedActionResult<T_LG_OPRATE> OrderPaged([FromBody]KeywordPageFilter pageFilter)
 | 
				
			||||||
           return WitOrderPaged(null, pageFilter);
 | 
					       {
 | 
				
			||||||
       }
 | 
					           return WitOrderPaged(null, pageFilter);
 | 
				
			||||||
 | 
					       }
 | 
				
			||||||
       /// <summary>
 | 
					
 | 
				
			||||||
       /// 根据主键删除数据
 | 
					       /// <summary>
 | 
				
			||||||
       /// </summary>
 | 
					       /// 根据主键删除数据
 | 
				
			||||||
       /// <param name="id">主键ID</param>
 | 
					       /// </summary>
 | 
				
			||||||
       /// <returns></returns>
 | 
					       /// <param name="id">主键ID</param>
 | 
				
			||||||
       [HttpGet, Route("Delete")]
 | 
					       /// <returns></returns>
 | 
				
			||||||
       public JsonActionResult<bool> Delete(string id)
 | 
					       [HttpGet, Route("Delete")]
 | 
				
			||||||
       {
 | 
					       public JsonActionResult<bool> Delete(string id)
 | 
				
			||||||
           return WitRealDelete(id);
 | 
					       {
 | 
				
			||||||
       }
 | 
					           return WitRealDelete(id);
 | 
				
			||||||
 | 
					       }
 | 
				
			||||||
       /// <summary>
 | 
					
 | 
				
			||||||
       /// 更新或新增数据
 | 
					       /// <summary>
 | 
				
			||||||
       /// </summary>
 | 
					       /// 更新或新增数据
 | 
				
			||||||
       /// <param name="entity">对象实体</param>
 | 
					       /// </summary>
 | 
				
			||||||
       /// <returns></returns>
 | 
					       /// <param name="entity">对象实体</param>
 | 
				
			||||||
       [HttpPost, Route("Update")]
 | 
					       /// <returns></returns>
 | 
				
			||||||
       public JsonActionResult<bool> Update([FromBody]T_LG_OPRATE entity)
 | 
					       [HttpPost, Route("Update")]
 | 
				
			||||||
       {
 | 
					       public JsonActionResult<bool> Update([FromBody]T_LG_OPRATE entity)
 | 
				
			||||||
           return WitUpdate(entity);
 | 
					       {
 | 
				
			||||||
       }
 | 
					           return WitUpdate(entity);
 | 
				
			||||||
 | 
					       }
 | 
				
			||||||
       /// <summary>
 | 
					
 | 
				
			||||||
       /// 批量更新
 | 
					       /// <summary>
 | 
				
			||||||
       /// </summary>
 | 
					       /// 批量更新
 | 
				
			||||||
       /// <param name="entity">对象实体</param>
 | 
					       /// </summary>
 | 
				
			||||||
       /// <returns></returns>
 | 
					       /// <param name="entity">对象实体</param>
 | 
				
			||||||
       [HttpPost, Route("BatchUpdate")]
 | 
					       /// <returns></returns>
 | 
				
			||||||
       public JsonActionResult<bool> BatchUpdate([FromBody] BatchUpdateModel<T_LG_OPRATE> entity)
 | 
					       [HttpPost, Route("BatchUpdate")]
 | 
				
			||||||
       {
 | 
					       public JsonActionResult<bool> BatchUpdate([FromBody] BatchUpdateModel<T_LG_OPRATE> entity)
 | 
				
			||||||
             return WitBantchUpdate(entity?.Data);
 | 
					       {
 | 
				
			||||||
       }
 | 
					             return WitBantchUpdate(entity?.Data);
 | 
				
			||||||
 | 
					       }
 | 
				
			||||||
       /// <summary>
 | 
					
 | 
				
			||||||
       /// 批量删除数据
 | 
					       /// <summary>
 | 
				
			||||||
       /// </summary>
 | 
					       /// 批量删除数据
 | 
				
			||||||
       /// <param name="ids">id字符串(id用逗号分隔)</param>
 | 
					       /// </summary>
 | 
				
			||||||
       /// <returns></returns>
 | 
					       /// <param name="ids">id字符串(id用逗号分隔)</param>
 | 
				
			||||||
       [HttpGet, Route("BatchDelete")]
 | 
					       /// <returns></returns>
 | 
				
			||||||
       public JsonActionResult<bool> BatchDelete(string ids)
 | 
					       [HttpGet, Route("BatchDelete")]
 | 
				
			||||||
       {
 | 
					       public JsonActionResult<bool> BatchDelete(string ids)
 | 
				
			||||||
           return WitRealBatchDelete(ids);
 | 
					       {
 | 
				
			||||||
       }
 | 
					           return WitRealBatchDelete(ids);
 | 
				
			||||||
 | 
					       }
 | 
				
			||||||
       /// <summary>
 | 
					
 | 
				
			||||||
       /// 获得单条实体数据
 | 
					       /// <summary>
 | 
				
			||||||
       /// </summary>
 | 
					       /// 获得单条实体数据
 | 
				
			||||||
       /// <param name="filter">过滤实体</param>
 | 
					       /// </summary>
 | 
				
			||||||
       /// <returns></returns>
 | 
					       /// <param name="filter">过滤实体</param>
 | 
				
			||||||
       [HttpPost, Route("Get")]
 | 
					       /// <returns></returns>
 | 
				
			||||||
       public JsonActionResult<T_LG_OPRATE> Get([FromBody] KeywordFilter filter)
 | 
					       [HttpPost, Route("Get")]
 | 
				
			||||||
       {
 | 
					       public JsonActionResult<T_LG_OPRATE> Get([FromBody] KeywordFilter filter)
 | 
				
			||||||
           return WitEntity(null, filter);
 | 
					       {
 | 
				
			||||||
       }
 | 
					           return WitEntity(null, filter);
 | 
				
			||||||
       
 | 
					       }
 | 
				
			||||||
    }
 | 
					       
 | 
				
			||||||
	#endregion
 | 
					
 | 
				
			||||||
 }
 | 
					    }
 | 
				
			||||||
 | 
						#endregion
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 }
 | 
				
			||||||
 | 
				
			|||||||
@ -1,356 +1,370 @@
 | 
				
			|||||||
 
 | 
					
 | 
				
			||||||
 
 | 
					
 | 
				
			||||||
 
 | 
					 
 | 
				
			||||||
  
 | 
					
 | 
				
			||||||
//------------------------------------------------------------------------------
 | 
					
 | 
				
			||||||
//     T4模板文件:基础接口类
 | 
					
 | 
				
			||||||
//     此代码由T4模板自动生成
 | 
					 
 | 
				
			||||||
//     对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
 | 
					 
 | 
				
			||||||
//------------------------------------------------------------------------------
 | 
					  
 | 
				
			||||||
using APT.Infrastructure.Core;
 | 
					
 | 
				
			||||||
using Microsoft.AspNetCore.Mvc;
 | 
					//------------------------------------------------------------------------------
 | 
				
			||||||
using System.Collections.Generic;
 | 
					//     T4模板文件:基础接口类
 | 
				
			||||||
using APT.Utility;
 | 
					//     此代码由T4模板自动生成
 | 
				
			||||||
using APT.Infrastructure.Api;
 | 
					//     对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
 | 
				
			||||||
using APT.BaseData.Domain.ApiModel.PF;
 | 
					//------------------------------------------------------------------------------
 | 
				
			||||||
namespace APT.NW.WebApi.Controllers.Api
 | 
					using APT.Infrastructure.Core;
 | 
				
			||||||
{
 | 
					using Microsoft.AspNetCore.Mvc;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using APT.Utility;
 | 
				
			||||||
 | 
					using APT.Infrastructure.Api;
 | 
				
			||||||
 | 
					using APT.BaseData.Domain.ApiModel.PF;
 | 
				
			||||||
 | 
					namespace APT.NW.WebApi.Controllers.Api
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
	using APT.BaseData.Domain.Entities.NW;
 | 
						using APT.BaseData.Domain.Entities.NW;
 | 
				
			||||||
	#region  Enterprise-子企业表
 | 
					
 | 
				
			||||||
	/// <summary>
 | 
						#region  Enterprise-子企业表
 | 
				
			||||||
    ///  子企业表
 | 
						/// <summary>
 | 
				
			||||||
    /// </summary>
 | 
					    ///  子企业表
 | 
				
			||||||
	[Route("api/NW/Enterprise")]
 | 
					    /// </summary>
 | 
				
			||||||
    public partial class EnterpriseController : AuthorizeTreeApiController<T_NW_ENTERPRISE>
 | 
						[Route("api/NW/Enterprise")]
 | 
				
			||||||
    {   
 | 
					    public partial class EnterpriseController : AuthorizeTreeApiController<T_NW_ENTERPRISE>
 | 
				
			||||||
       /// <summary>
 | 
					    {   
 | 
				
			||||||
       /// 查询所有数据
 | 
					       /// <summary>
 | 
				
			||||||
       /// </summary>
 | 
					       /// 查询所有数据
 | 
				
			||||||
       /// <param name="filter">过滤实体</param>
 | 
					       /// </summary>
 | 
				
			||||||
       /// <returns></returns>
 | 
					       /// <param name="filter">过滤实体</param>
 | 
				
			||||||
       [HttpPost, Route("Entities")]
 | 
					       /// <returns></returns>
 | 
				
			||||||
       public JsonActionResult<IEnumerable<T_NW_ENTERPRISE>> Entities([FromBody]KeywordFilter filter)
 | 
					       [HttpPost, Route("Entities")]
 | 
				
			||||||
       {
 | 
					       public JsonActionResult<IEnumerable<T_NW_ENTERPRISE>> Entities([FromBody]KeywordFilter filter)
 | 
				
			||||||
           return WitEntities(null, filter);
 | 
					       {
 | 
				
			||||||
       }
 | 
					           return WitEntities(null, filter);
 | 
				
			||||||
 | 
					       }
 | 
				
			||||||
        /// <summary>
 | 
					
 | 
				
			||||||
       /// 排序查询所有数据
 | 
					        /// <summary>
 | 
				
			||||||
       /// </summary>
 | 
					       /// 排序查询所有数据
 | 
				
			||||||
       /// <param name="filter">过滤实体</param>
 | 
					       /// </summary>
 | 
				
			||||||
       /// <returns></returns>
 | 
					       /// <param name="filter">过滤实体</param>
 | 
				
			||||||
 | 
					       /// <returns></returns>
 | 
				
			||||||
       [HttpPost, Route("OrderEntities")]
 | 
					
 | 
				
			||||||
       public JsonActionResult<IEnumerable<T_NW_ENTERPRISE>> OrderEntities([FromBody]KeywordFilter filter)
 | 
					       [HttpPost, Route("OrderEntities")]
 | 
				
			||||||
       {
 | 
					       public JsonActionResult<IEnumerable<T_NW_ENTERPRISE>> OrderEntities([FromBody]KeywordFilter filter)
 | 
				
			||||||
           return WitOrderEntities(null, filter);
 | 
					       {
 | 
				
			||||||
       }
 | 
					           return WitOrderEntities(null, filter);
 | 
				
			||||||
 | 
					       }
 | 
				
			||||||
       /// <summary>
 | 
					
 | 
				
			||||||
       /// 分页查询数据
 | 
					       /// <summary>
 | 
				
			||||||
       /// </summary>
 | 
					       /// 分页查询数据
 | 
				
			||||||
       /// <param name="pageFilter">分页过滤实体</param>
 | 
					       /// </summary>
 | 
				
			||||||
       /// <returns></returns>
 | 
					       /// <param name="pageFilter">分页过滤实体</param>
 | 
				
			||||||
       [HttpPost, Route("Paged")]
 | 
					       /// <returns></returns>
 | 
				
			||||||
       public PagedActionResult<T_NW_ENTERPRISE> Paged([FromBody]KeywordPageFilter pageFilter)
 | 
					       [HttpPost, Route("Paged")]
 | 
				
			||||||
       {
 | 
					       public PagedActionResult<T_NW_ENTERPRISE> Paged([FromBody]KeywordPageFilter pageFilter)
 | 
				
			||||||
           return WitPaged(null, pageFilter);
 | 
					       {
 | 
				
			||||||
       }
 | 
					           return WitPaged(null, pageFilter);
 | 
				
			||||||
 | 
					       }
 | 
				
			||||||
       /// <summary>
 | 
					
 | 
				
			||||||
       /// 排序分页查询数据
 | 
					       /// <summary>
 | 
				
			||||||
       /// </summary>
 | 
					       /// 排序分页查询数据
 | 
				
			||||||
       /// <param name="pageFilter">分页过滤实体</param>
 | 
					       /// </summary>
 | 
				
			||||||
       /// <returns></returns>
 | 
					       /// <param name="pageFilter">分页过滤实体</param>
 | 
				
			||||||
       [HttpPost, Route("OrderPaged")]
 | 
					       /// <returns></returns>
 | 
				
			||||||
       public PagedActionResult<T_NW_ENTERPRISE> OrderPaged([FromBody]KeywordPageFilter pageFilter)
 | 
					       [HttpPost, Route("OrderPaged")]
 | 
				
			||||||
       {
 | 
					       public PagedActionResult<T_NW_ENTERPRISE> OrderPaged([FromBody]KeywordPageFilter pageFilter)
 | 
				
			||||||
           return WitOrderPaged(null, pageFilter);
 | 
					       {
 | 
				
			||||||
       }
 | 
					           return WitOrderPaged(null, pageFilter);
 | 
				
			||||||
 | 
					       }
 | 
				
			||||||
       /// <summary>
 | 
					
 | 
				
			||||||
       /// 根据主键删除数据
 | 
					       /// <summary>
 | 
				
			||||||
       /// </summary>
 | 
					       /// 根据主键删除数据
 | 
				
			||||||
       /// <param name="id">主键ID</param>
 | 
					       /// </summary>
 | 
				
			||||||
       /// <returns></returns>
 | 
					       /// <param name="id">主键ID</param>
 | 
				
			||||||
       [HttpGet, Route("Delete")]
 | 
					       /// <returns></returns>
 | 
				
			||||||
       public JsonActionResult<bool> Delete(string id)
 | 
					       [HttpGet, Route("Delete")]
 | 
				
			||||||
       {
 | 
					       public JsonActionResult<bool> Delete(string id)
 | 
				
			||||||
           return WitRealDelete(id);
 | 
					       {
 | 
				
			||||||
       }
 | 
					           return WitRealDelete(id);
 | 
				
			||||||
 | 
					       }
 | 
				
			||||||
       /// <summary>
 | 
					
 | 
				
			||||||
       /// 更新或新增数据
 | 
					       /// <summary>
 | 
				
			||||||
       /// </summary>
 | 
					       /// 更新或新增数据
 | 
				
			||||||
       /// <param name="entity">对象实体</param>
 | 
					       /// </summary>
 | 
				
			||||||
       /// <returns></returns>
 | 
					       /// <param name="entity">对象实体</param>
 | 
				
			||||||
       [HttpPost, Route("Update")]
 | 
					       /// <returns></returns>
 | 
				
			||||||
       public JsonActionResult<bool> Update([FromBody]T_NW_ENTERPRISE entity)
 | 
					       [HttpPost, Route("Update")]
 | 
				
			||||||
       {
 | 
					       public JsonActionResult<bool> Update([FromBody]T_NW_ENTERPRISE entity)
 | 
				
			||||||
           return WitUpdate(entity);
 | 
					       {
 | 
				
			||||||
       }
 | 
					           return WitUpdate(entity);
 | 
				
			||||||
 | 
					       }
 | 
				
			||||||
       /// <summary>
 | 
					
 | 
				
			||||||
       /// 批量更新
 | 
					       /// <summary>
 | 
				
			||||||
       /// </summary>
 | 
					       /// 批量更新
 | 
				
			||||||
       /// <param name="entity">对象实体</param>
 | 
					       /// </summary>
 | 
				
			||||||
       /// <returns></returns>
 | 
					       /// <param name="entity">对象实体</param>
 | 
				
			||||||
       [HttpPost, Route("BatchUpdate")]
 | 
					       /// <returns></returns>
 | 
				
			||||||
       public JsonActionResult<bool> BatchUpdate([FromBody] BatchUpdateModel<T_NW_ENTERPRISE> entity)
 | 
					       [HttpPost, Route("BatchUpdate")]
 | 
				
			||||||
       {
 | 
					       public JsonActionResult<bool> BatchUpdate([FromBody] BatchUpdateModel<T_NW_ENTERPRISE> entity)
 | 
				
			||||||
             return WitBantchUpdate(entity?.Data);
 | 
					       {
 | 
				
			||||||
       }
 | 
					             return WitBantchUpdate(entity?.Data);
 | 
				
			||||||
 | 
					       }
 | 
				
			||||||
       /// <summary>
 | 
					
 | 
				
			||||||
       /// 批量删除数据
 | 
					       /// <summary>
 | 
				
			||||||
       /// </summary>
 | 
					       /// 批量删除数据
 | 
				
			||||||
       /// <param name="ids">id字符串(id用逗号分隔)</param>
 | 
					       /// </summary>
 | 
				
			||||||
       /// <returns></returns>
 | 
					       /// <param name="ids">id字符串(id用逗号分隔)</param>
 | 
				
			||||||
       [HttpGet, Route("BatchDelete")]
 | 
					       /// <returns></returns>
 | 
				
			||||||
       public JsonActionResult<bool> BatchDelete(string ids)
 | 
					       [HttpGet, Route("BatchDelete")]
 | 
				
			||||||
       {
 | 
					       public JsonActionResult<bool> BatchDelete(string ids)
 | 
				
			||||||
           return WitRealBatchDelete(ids);
 | 
					       {
 | 
				
			||||||
       }
 | 
					           return WitRealBatchDelete(ids);
 | 
				
			||||||
 | 
					       }
 | 
				
			||||||
       /// <summary>
 | 
					
 | 
				
			||||||
       /// 获得单条实体数据
 | 
					       /// <summary>
 | 
				
			||||||
       /// </summary>
 | 
					       /// 获得单条实体数据
 | 
				
			||||||
       /// <param name="filter">过滤实体</param>
 | 
					       /// </summary>
 | 
				
			||||||
       /// <returns></returns>
 | 
					       /// <param name="filter">过滤实体</param>
 | 
				
			||||||
       [HttpPost, Route("Get")]
 | 
					       /// <returns></returns>
 | 
				
			||||||
       public JsonActionResult<T_NW_ENTERPRISE> Get([FromBody] KeywordFilter filter)
 | 
					       [HttpPost, Route("Get")]
 | 
				
			||||||
       {
 | 
					       public JsonActionResult<T_NW_ENTERPRISE> Get([FromBody] KeywordFilter filter)
 | 
				
			||||||
           return WitEntity(null, filter);
 | 
					       {
 | 
				
			||||||
       }
 | 
					           return WitEntity(null, filter);
 | 
				
			||||||
                     	/// <summary>
 | 
					       }
 | 
				
			||||||
	/// 获得树形实体数据
 | 
					       
 | 
				
			||||||
	/// </summary>
 | 
					              	/// <summary>
 | 
				
			||||||
	/// <param name="filter"></param>
 | 
						/// 获得树形实体数据
 | 
				
			||||||
	/// <returns></returns>
 | 
						/// </summary>
 | 
				
			||||||
	[HttpPost, Route("TreeData")]
 | 
						/// <param name="filter"></param>
 | 
				
			||||||
	public JsonActionResult<IEnumerable<TreeNode<T_NW_ENTERPRISE>>> TreeData([FromBody] KeywordFilter filter)
 | 
						/// <returns></returns>
 | 
				
			||||||
	{
 | 
						[HttpPost, Route("TreeData")]
 | 
				
			||||||
		return WitTreeOrderEntities(null, filter);
 | 
						public JsonActionResult<IEnumerable<TreeNode<T_NW_ENTERPRISE>>> TreeData([FromBody] KeywordFilter filter)
 | 
				
			||||||
	}
 | 
						{
 | 
				
			||||||
               
 | 
							return WitTreeOrderEntities(null, filter);
 | 
				
			||||||
    }
 | 
						}
 | 
				
			||||||
	#endregion
 | 
					               
 | 
				
			||||||
	#region  RoleDataPerm-子企业数据权限表
 | 
					
 | 
				
			||||||
	/// <summary>
 | 
					    }
 | 
				
			||||||
    ///  子企业数据权限表
 | 
						#endregion
 | 
				
			||||||
    /// </summary>
 | 
					
 | 
				
			||||||
	[Route("api/NW/RoleDataPerm")]
 | 
						#region  RoleDataPerm-子企业数据权限表
 | 
				
			||||||
    public partial class RoleDataPermController : AuthorizeApiController<T_NW_ROLE_DATA_PERM>
 | 
						/// <summary>
 | 
				
			||||||
    {   
 | 
					    ///  子企业数据权限表
 | 
				
			||||||
       /// <summary>
 | 
					    /// </summary>
 | 
				
			||||||
       /// 查询所有数据
 | 
						[Route("api/NW/RoleDataPerm")]
 | 
				
			||||||
       /// </summary>
 | 
					    public partial class RoleDataPermController : AuthorizeApiController<T_NW_ROLE_DATA_PERM>
 | 
				
			||||||
       /// <param name="filter">过滤实体</param>
 | 
					    {   
 | 
				
			||||||
       /// <returns></returns>
 | 
					       /// <summary>
 | 
				
			||||||
       [HttpPost, Route("Entities")]
 | 
					       /// 查询所有数据
 | 
				
			||||||
       public JsonActionResult<IEnumerable<T_NW_ROLE_DATA_PERM>> Entities([FromBody]KeywordFilter filter)
 | 
					       /// </summary>
 | 
				
			||||||
       {
 | 
					       /// <param name="filter">过滤实体</param>
 | 
				
			||||||
           return WitEntities(null, filter);
 | 
					       /// <returns></returns>
 | 
				
			||||||
       }
 | 
					       [HttpPost, Route("Entities")]
 | 
				
			||||||
 | 
					       public JsonActionResult<IEnumerable<T_NW_ROLE_DATA_PERM>> Entities([FromBody]KeywordFilter filter)
 | 
				
			||||||
        /// <summary>
 | 
					       {
 | 
				
			||||||
       /// 排序查询所有数据
 | 
					           return WitEntities(null, filter);
 | 
				
			||||||
       /// </summary>
 | 
					       }
 | 
				
			||||||
       /// <param name="filter">过滤实体</param>
 | 
					
 | 
				
			||||||
       /// <returns></returns>
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					       /// 排序查询所有数据
 | 
				
			||||||
       [HttpPost, Route("OrderEntities")]
 | 
					       /// </summary>
 | 
				
			||||||
       public JsonActionResult<IEnumerable<T_NW_ROLE_DATA_PERM>> OrderEntities([FromBody]KeywordFilter filter)
 | 
					       /// <param name="filter">过滤实体</param>
 | 
				
			||||||
       {
 | 
					       /// <returns></returns>
 | 
				
			||||||
           return WitOrderEntities(null, filter);
 | 
					
 | 
				
			||||||
       }
 | 
					       [HttpPost, Route("OrderEntities")]
 | 
				
			||||||
 | 
					       public JsonActionResult<IEnumerable<T_NW_ROLE_DATA_PERM>> OrderEntities([FromBody]KeywordFilter filter)
 | 
				
			||||||
       /// <summary>
 | 
					       {
 | 
				
			||||||
       /// 分页查询数据
 | 
					           return WitOrderEntities(null, filter);
 | 
				
			||||||
       /// </summary>
 | 
					       }
 | 
				
			||||||
       /// <param name="pageFilter">分页过滤实体</param>
 | 
					
 | 
				
			||||||
       /// <returns></returns>
 | 
					       /// <summary>
 | 
				
			||||||
       [HttpPost, Route("Paged")]
 | 
					       /// 分页查询数据
 | 
				
			||||||
       public PagedActionResult<T_NW_ROLE_DATA_PERM> Paged([FromBody]KeywordPageFilter pageFilter)
 | 
					       /// </summary>
 | 
				
			||||||
       {
 | 
					       /// <param name="pageFilter">分页过滤实体</param>
 | 
				
			||||||
           return WitPaged(null, pageFilter);
 | 
					       /// <returns></returns>
 | 
				
			||||||
       }
 | 
					       [HttpPost, Route("Paged")]
 | 
				
			||||||
 | 
					       public PagedActionResult<T_NW_ROLE_DATA_PERM> Paged([FromBody]KeywordPageFilter pageFilter)
 | 
				
			||||||
       /// <summary>
 | 
					       {
 | 
				
			||||||
       /// 排序分页查询数据
 | 
					           return WitPaged(null, pageFilter);
 | 
				
			||||||
       /// </summary>
 | 
					       }
 | 
				
			||||||
       /// <param name="pageFilter">分页过滤实体</param>
 | 
					
 | 
				
			||||||
       /// <returns></returns>
 | 
					       /// <summary>
 | 
				
			||||||
       [HttpPost, Route("OrderPaged")]
 | 
					       /// 排序分页查询数据
 | 
				
			||||||
       public PagedActionResult<T_NW_ROLE_DATA_PERM> OrderPaged([FromBody]KeywordPageFilter pageFilter)
 | 
					       /// </summary>
 | 
				
			||||||
       {
 | 
					       /// <param name="pageFilter">分页过滤实体</param>
 | 
				
			||||||
           return WitOrderPaged(null, pageFilter);
 | 
					       /// <returns></returns>
 | 
				
			||||||
       }
 | 
					       [HttpPost, Route("OrderPaged")]
 | 
				
			||||||
 | 
					       public PagedActionResult<T_NW_ROLE_DATA_PERM> OrderPaged([FromBody]KeywordPageFilter pageFilter)
 | 
				
			||||||
       /// <summary>
 | 
					       {
 | 
				
			||||||
       /// 根据主键删除数据
 | 
					           return WitOrderPaged(null, pageFilter);
 | 
				
			||||||
       /// </summary>
 | 
					       }
 | 
				
			||||||
       /// <param name="id">主键ID</param>
 | 
					
 | 
				
			||||||
       /// <returns></returns>
 | 
					       /// <summary>
 | 
				
			||||||
       [HttpGet, Route("Delete")]
 | 
					       /// 根据主键删除数据
 | 
				
			||||||
       public JsonActionResult<bool> Delete(string id)
 | 
					       /// </summary>
 | 
				
			||||||
       {
 | 
					       /// <param name="id">主键ID</param>
 | 
				
			||||||
           return WitRealDelete(id);
 | 
					       /// <returns></returns>
 | 
				
			||||||
       }
 | 
					       [HttpGet, Route("Delete")]
 | 
				
			||||||
 | 
					       public JsonActionResult<bool> Delete(string id)
 | 
				
			||||||
       /// <summary>
 | 
					       {
 | 
				
			||||||
       /// 更新或新增数据
 | 
					           return WitRealDelete(id);
 | 
				
			||||||
       /// </summary>
 | 
					       }
 | 
				
			||||||
       /// <param name="entity">对象实体</param>
 | 
					
 | 
				
			||||||
       /// <returns></returns>
 | 
					       /// <summary>
 | 
				
			||||||
       [HttpPost, Route("Update")]
 | 
					       /// 更新或新增数据
 | 
				
			||||||
       public JsonActionResult<bool> Update([FromBody]T_NW_ROLE_DATA_PERM entity)
 | 
					       /// </summary>
 | 
				
			||||||
       {
 | 
					       /// <param name="entity">对象实体</param>
 | 
				
			||||||
           return WitUpdate(entity);
 | 
					       /// <returns></returns>
 | 
				
			||||||
       }
 | 
					       [HttpPost, Route("Update")]
 | 
				
			||||||
 | 
					       public JsonActionResult<bool> Update([FromBody]T_NW_ROLE_DATA_PERM entity)
 | 
				
			||||||
       /// <summary>
 | 
					       {
 | 
				
			||||||
       /// 批量更新
 | 
					           return WitUpdate(entity);
 | 
				
			||||||
       /// </summary>
 | 
					       }
 | 
				
			||||||
       /// <param name="entity">对象实体</param>
 | 
					
 | 
				
			||||||
       /// <returns></returns>
 | 
					       /// <summary>
 | 
				
			||||||
       [HttpPost, Route("BatchUpdate")]
 | 
					       /// 批量更新
 | 
				
			||||||
       public JsonActionResult<bool> BatchUpdate([FromBody] BatchUpdateModel<T_NW_ROLE_DATA_PERM> entity)
 | 
					       /// </summary>
 | 
				
			||||||
       {
 | 
					       /// <param name="entity">对象实体</param>
 | 
				
			||||||
             return WitBantchUpdate(entity?.Data);
 | 
					       /// <returns></returns>
 | 
				
			||||||
       }
 | 
					       [HttpPost, Route("BatchUpdate")]
 | 
				
			||||||
 | 
					       public JsonActionResult<bool> BatchUpdate([FromBody] BatchUpdateModel<T_NW_ROLE_DATA_PERM> entity)
 | 
				
			||||||
       /// <summary>
 | 
					       {
 | 
				
			||||||
       /// 批量删除数据
 | 
					             return WitBantchUpdate(entity?.Data);
 | 
				
			||||||
       /// </summary>
 | 
					       }
 | 
				
			||||||
       /// <param name="ids">id字符串(id用逗号分隔)</param>
 | 
					
 | 
				
			||||||
       /// <returns></returns>
 | 
					       /// <summary>
 | 
				
			||||||
       [HttpGet, Route("BatchDelete")]
 | 
					       /// 批量删除数据
 | 
				
			||||||
       public JsonActionResult<bool> BatchDelete(string ids)
 | 
					       /// </summary>
 | 
				
			||||||
       {
 | 
					       /// <param name="ids">id字符串(id用逗号分隔)</param>
 | 
				
			||||||
           return WitRealBatchDelete(ids);
 | 
					       /// <returns></returns>
 | 
				
			||||||
       }
 | 
					       [HttpGet, Route("BatchDelete")]
 | 
				
			||||||
 | 
					       public JsonActionResult<bool> BatchDelete(string ids)
 | 
				
			||||||
       /// <summary>
 | 
					       {
 | 
				
			||||||
       /// 获得单条实体数据
 | 
					           return WitRealBatchDelete(ids);
 | 
				
			||||||
       /// </summary>
 | 
					       }
 | 
				
			||||||
       /// <param name="filter">过滤实体</param>
 | 
					
 | 
				
			||||||
       /// <returns></returns>
 | 
					       /// <summary>
 | 
				
			||||||
       [HttpPost, Route("Get")]
 | 
					       /// 获得单条实体数据
 | 
				
			||||||
       public JsonActionResult<T_NW_ROLE_DATA_PERM> Get([FromBody] KeywordFilter filter)
 | 
					       /// </summary>
 | 
				
			||||||
       {
 | 
					       /// <param name="filter">过滤实体</param>
 | 
				
			||||||
           return WitEntity(null, filter);
 | 
					       /// <returns></returns>
 | 
				
			||||||
       }
 | 
					       [HttpPost, Route("Get")]
 | 
				
			||||||
       
 | 
					       public JsonActionResult<T_NW_ROLE_DATA_PERM> Get([FromBody] KeywordFilter filter)
 | 
				
			||||||
    }
 | 
					       {
 | 
				
			||||||
	#endregion
 | 
					           return WitEntity(null, filter);
 | 
				
			||||||
	#region  RoleMenu-子企业权限表
 | 
					       }
 | 
				
			||||||
	/// <summary>
 | 
					       
 | 
				
			||||||
    ///  子企业权限表
 | 
					
 | 
				
			||||||
    /// </summary>
 | 
					    }
 | 
				
			||||||
	[Route("api/NW/RoleMenu")]
 | 
						#endregion
 | 
				
			||||||
    public partial class RoleMenuController : AuthorizeApiController<T_NW_ROLE_MENU>
 | 
					
 | 
				
			||||||
    {   
 | 
						#region  RoleMenu-子企业权限表
 | 
				
			||||||
       /// <summary>
 | 
						/// <summary>
 | 
				
			||||||
       /// 查询所有数据
 | 
					    ///  子企业权限表
 | 
				
			||||||
       /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
       /// <param name="filter">过滤实体</param>
 | 
						[Route("api/NW/RoleMenu")]
 | 
				
			||||||
       /// <returns></returns>
 | 
					    public partial class RoleMenuController : AuthorizeApiController<T_NW_ROLE_MENU>
 | 
				
			||||||
       [HttpPost, Route("Entities")]
 | 
					    {   
 | 
				
			||||||
       public JsonActionResult<IEnumerable<T_NW_ROLE_MENU>> Entities([FromBody]KeywordFilter filter)
 | 
					       /// <summary>
 | 
				
			||||||
       {
 | 
					       /// 查询所有数据
 | 
				
			||||||
           return WitEntities(null, filter);
 | 
					       /// </summary>
 | 
				
			||||||
       }
 | 
					       /// <param name="filter">过滤实体</param>
 | 
				
			||||||
 | 
					       /// <returns></returns>
 | 
				
			||||||
        /// <summary>
 | 
					       [HttpPost, Route("Entities")]
 | 
				
			||||||
       /// 排序查询所有数据
 | 
					       public JsonActionResult<IEnumerable<T_NW_ROLE_MENU>> Entities([FromBody]KeywordFilter filter)
 | 
				
			||||||
       /// </summary>
 | 
					       {
 | 
				
			||||||
       /// <param name="filter">过滤实体</param>
 | 
					           return WitEntities(null, filter);
 | 
				
			||||||
       /// <returns></returns>
 | 
					       }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
       [HttpPost, Route("OrderEntities")]
 | 
					        /// <summary>
 | 
				
			||||||
       public JsonActionResult<IEnumerable<T_NW_ROLE_MENU>> OrderEntities([FromBody]KeywordFilter filter)
 | 
					       /// 排序查询所有数据
 | 
				
			||||||
       {
 | 
					       /// </summary>
 | 
				
			||||||
           return WitOrderEntities(null, filter);
 | 
					       /// <param name="filter">过滤实体</param>
 | 
				
			||||||
       }
 | 
					       /// <returns></returns>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
       /// <summary>
 | 
					       [HttpPost, Route("OrderEntities")]
 | 
				
			||||||
       /// 分页查询数据
 | 
					       public JsonActionResult<IEnumerable<T_NW_ROLE_MENU>> OrderEntities([FromBody]KeywordFilter filter)
 | 
				
			||||||
       /// </summary>
 | 
					       {
 | 
				
			||||||
       /// <param name="pageFilter">分页过滤实体</param>
 | 
					           return WitOrderEntities(null, filter);
 | 
				
			||||||
       /// <returns></returns>
 | 
					       }
 | 
				
			||||||
       [HttpPost, Route("Paged")]
 | 
					
 | 
				
			||||||
       public PagedActionResult<T_NW_ROLE_MENU> Paged([FromBody]KeywordPageFilter pageFilter)
 | 
					       /// <summary>
 | 
				
			||||||
       {
 | 
					       /// 分页查询数据
 | 
				
			||||||
           return WitPaged(null, pageFilter);
 | 
					       /// </summary>
 | 
				
			||||||
       }
 | 
					       /// <param name="pageFilter">分页过滤实体</param>
 | 
				
			||||||
 | 
					       /// <returns></returns>
 | 
				
			||||||
       /// <summary>
 | 
					       [HttpPost, Route("Paged")]
 | 
				
			||||||
       /// 排序分页查询数据
 | 
					       public PagedActionResult<T_NW_ROLE_MENU> Paged([FromBody]KeywordPageFilter pageFilter)
 | 
				
			||||||
       /// </summary>
 | 
					       {
 | 
				
			||||||
       /// <param name="pageFilter">分页过滤实体</param>
 | 
					           return WitPaged(null, pageFilter);
 | 
				
			||||||
       /// <returns></returns>
 | 
					       }
 | 
				
			||||||
       [HttpPost, Route("OrderPaged")]
 | 
					
 | 
				
			||||||
       public PagedActionResult<T_NW_ROLE_MENU> OrderPaged([FromBody]KeywordPageFilter pageFilter)
 | 
					       /// <summary>
 | 
				
			||||||
       {
 | 
					       /// 排序分页查询数据
 | 
				
			||||||
           return WitOrderPaged(null, pageFilter);
 | 
					       /// </summary>
 | 
				
			||||||
       }
 | 
					       /// <param name="pageFilter">分页过滤实体</param>
 | 
				
			||||||
 | 
					       /// <returns></returns>
 | 
				
			||||||
       /// <summary>
 | 
					       [HttpPost, Route("OrderPaged")]
 | 
				
			||||||
       /// 根据主键删除数据
 | 
					       public PagedActionResult<T_NW_ROLE_MENU> OrderPaged([FromBody]KeywordPageFilter pageFilter)
 | 
				
			||||||
       /// </summary>
 | 
					       {
 | 
				
			||||||
       /// <param name="id">主键ID</param>
 | 
					           return WitOrderPaged(null, pageFilter);
 | 
				
			||||||
       /// <returns></returns>
 | 
					       }
 | 
				
			||||||
       [HttpGet, Route("Delete")]
 | 
					
 | 
				
			||||||
       public JsonActionResult<bool> Delete(string id)
 | 
					       /// <summary>
 | 
				
			||||||
       {
 | 
					       /// 根据主键删除数据
 | 
				
			||||||
           return WitRealDelete(id);
 | 
					       /// </summary>
 | 
				
			||||||
       }
 | 
					       /// <param name="id">主键ID</param>
 | 
				
			||||||
 | 
					       /// <returns></returns>
 | 
				
			||||||
       /// <summary>
 | 
					       [HttpGet, Route("Delete")]
 | 
				
			||||||
       /// 更新或新增数据
 | 
					       public JsonActionResult<bool> Delete(string id)
 | 
				
			||||||
       /// </summary>
 | 
					       {
 | 
				
			||||||
       /// <param name="entity">对象实体</param>
 | 
					           return WitRealDelete(id);
 | 
				
			||||||
       /// <returns></returns>
 | 
					       }
 | 
				
			||||||
       [HttpPost, Route("Update")]
 | 
					
 | 
				
			||||||
       public JsonActionResult<bool> Update([FromBody]T_NW_ROLE_MENU entity)
 | 
					       /// <summary>
 | 
				
			||||||
       {
 | 
					       /// 更新或新增数据
 | 
				
			||||||
           return WitUpdate(entity);
 | 
					       /// </summary>
 | 
				
			||||||
       }
 | 
					       /// <param name="entity">对象实体</param>
 | 
				
			||||||
 | 
					       /// <returns></returns>
 | 
				
			||||||
       /// <summary>
 | 
					       [HttpPost, Route("Update")]
 | 
				
			||||||
       /// 批量更新
 | 
					       public JsonActionResult<bool> Update([FromBody]T_NW_ROLE_MENU entity)
 | 
				
			||||||
       /// </summary>
 | 
					       {
 | 
				
			||||||
       /// <param name="entity">对象实体</param>
 | 
					           return WitUpdate(entity);
 | 
				
			||||||
       /// <returns></returns>
 | 
					       }
 | 
				
			||||||
       [HttpPost, Route("BatchUpdate")]
 | 
					
 | 
				
			||||||
       public JsonActionResult<bool> BatchUpdate([FromBody] BatchUpdateModel<T_NW_ROLE_MENU> entity)
 | 
					       /// <summary>
 | 
				
			||||||
       {
 | 
					       /// 批量更新
 | 
				
			||||||
             return WitBantchUpdate(entity?.Data);
 | 
					       /// </summary>
 | 
				
			||||||
       }
 | 
					       /// <param name="entity">对象实体</param>
 | 
				
			||||||
 | 
					       /// <returns></returns>
 | 
				
			||||||
       /// <summary>
 | 
					       [HttpPost, Route("BatchUpdate")]
 | 
				
			||||||
       /// 批量删除数据
 | 
					       public JsonActionResult<bool> BatchUpdate([FromBody] BatchUpdateModel<T_NW_ROLE_MENU> entity)
 | 
				
			||||||
       /// </summary>
 | 
					       {
 | 
				
			||||||
       /// <param name="ids">id字符串(id用逗号分隔)</param>
 | 
					             return WitBantchUpdate(entity?.Data);
 | 
				
			||||||
       /// <returns></returns>
 | 
					       }
 | 
				
			||||||
       [HttpGet, Route("BatchDelete")]
 | 
					
 | 
				
			||||||
       public JsonActionResult<bool> BatchDelete(string ids)
 | 
					       /// <summary>
 | 
				
			||||||
       {
 | 
					       /// 批量删除数据
 | 
				
			||||||
           return WitRealBatchDelete(ids);
 | 
					       /// </summary>
 | 
				
			||||||
       }
 | 
					       /// <param name="ids">id字符串(id用逗号分隔)</param>
 | 
				
			||||||
 | 
					       /// <returns></returns>
 | 
				
			||||||
       /// <summary>
 | 
					       [HttpGet, Route("BatchDelete")]
 | 
				
			||||||
       /// 获得单条实体数据
 | 
					       public JsonActionResult<bool> BatchDelete(string ids)
 | 
				
			||||||
       /// </summary>
 | 
					       {
 | 
				
			||||||
       /// <param name="filter">过滤实体</param>
 | 
					           return WitRealBatchDelete(ids);
 | 
				
			||||||
       /// <returns></returns>
 | 
					       }
 | 
				
			||||||
       [HttpPost, Route("Get")]
 | 
					
 | 
				
			||||||
       public JsonActionResult<T_NW_ROLE_MENU> Get([FromBody] KeywordFilter filter)
 | 
					       /// <summary>
 | 
				
			||||||
       {
 | 
					       /// 获得单条实体数据
 | 
				
			||||||
           return WitEntity(null, filter);
 | 
					       /// </summary>
 | 
				
			||||||
       }
 | 
					       /// <param name="filter">过滤实体</param>
 | 
				
			||||||
       
 | 
					       /// <returns></returns>
 | 
				
			||||||
    }
 | 
					       [HttpPost, Route("Get")]
 | 
				
			||||||
	#endregion
 | 
					       public JsonActionResult<T_NW_ROLE_MENU> Get([FromBody] KeywordFilter filter)
 | 
				
			||||||
 }
 | 
					       {
 | 
				
			||||||
 | 
					           return WitEntity(null, filter);
 | 
				
			||||||
 | 
					       }
 | 
				
			||||||
 | 
					       
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
						#endregion
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 }
 | 
				
			||||||
 | 
				
			|||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@ -2,9 +2,7 @@
 | 
				
			|||||||
using APT.BaseData.Domain.Entities.FM;
 | 
					using APT.BaseData.Domain.Entities.FM;
 | 
				
			||||||
using APT.BaseData.Domain.Entities.PF;
 | 
					using APT.BaseData.Domain.Entities.PF;
 | 
				
			||||||
using APT.BaseData.Domain.Enums;
 | 
					using APT.BaseData.Domain.Enums;
 | 
				
			||||||
using APT.BaseData.Domain.IServices.OP;
 | 
					 | 
				
			||||||
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.HM;
 | 
					using APT.MS.Domain.Entities.HM;
 | 
				
			||||||
using APT.MS.Domain.Entities.PF;
 | 
					using APT.MS.Domain.Entities.PF;
 | 
				
			||||||
@ -15,7 +13,6 @@ using Microsoft.AspNetCore.Mvc;
 | 
				
			|||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.Linq;
 | 
					using System.Linq;
 | 
				
			||||||
using System.Transactions;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace APT.PF.WebApi.Controllers.Api
 | 
					namespace APT.PF.WebApi.Controllers.Api
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@ -25,13 +22,6 @@ namespace APT.PF.WebApi.Controllers.Api
 | 
				
			|||||||
    [Route("api/PF/PFApprovalRole")]
 | 
					    [Route("api/PF/PFApprovalRole")]
 | 
				
			||||||
    public partial class ApprovalRoleController : AuthorizeApiController<T_PF_APPROVAL_ROLE>
 | 
					    public partial class ApprovalRoleController : AuthorizeApiController<T_PF_APPROVAL_ROLE>
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        IOPTenantDBConnService OPTenantDBConnService { get; set; }
 | 
					 | 
				
			||||||
        public ApprovalRoleController(IOPTenantDBConnService opTenantDBConnService)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            OPTenantDBConnService = opTenantDBConnService;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// 更新或新增数据
 | 
					        /// 更新或新增数据
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
@ -41,139 +31,73 @@ namespace APT.PF.WebApi.Controllers.Api
 | 
				
			|||||||
        public JsonActionResult<bool> FullUpdate([FromBody] T_PF_APPROVAL_ROLE entity)
 | 
					        public JsonActionResult<bool> FullUpdate([FromBody] T_PF_APPROVAL_ROLE entity)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            return SafeExecute<bool>(() =>
 | 
					            return SafeExecute<bool>(() =>
 | 
				
			||||||
          {
 | 
					            {
 | 
				
			||||||
              var isHead = HeadHelper.GetIsHead(this.Request.Headers);
 | 
					                var orgId = APT.Infrastructure.Api.AppContext.CurrentSession.OrgId;
 | 
				
			||||||
              if (entity.ISHEAD && !isHead)
 | 
					                //var roleCodes = this.GetEntities<T_PF_APPROVAL_ROLE>(t => true, new BaseFilter(orgId)).Select(x => x.NAME).ToList();
 | 
				
			||||||
              {
 | 
					                //if (roleCodes.Contains(entity.NAME))
 | 
				
			||||||
                  throw new Exception("子公司不能修改总公司角色信息!");
 | 
					                //    throw new Exception("系统已存在审批角色编码为" + entity.NAME + "的数据,请勿重复!");
 | 
				
			||||||
              }
 | 
					                var departs = entity.Nav_ApproveDeparts;
 | 
				
			||||||
 | 
					                entity.Nav_ApproveDeparts = null;
 | 
				
			||||||
              var orgId = APT.Infrastructure.Api.AppContext.CurrentSession.OrgId;
 | 
					                if (departs != null && departs.Any())
 | 
				
			||||||
              //var roleCodes = this.GetEntities<T_PF_APPROVAL_ROLE>(t => true, new BaseFilter(orgId)).Select(x => x.NAME).ToList();
 | 
					                {
 | 
				
			||||||
              //if (roleCodes.Contains(entity.NAME))
 | 
					                    departs = departs.Where(t => !t.IS_DELETED).ToList();
 | 
				
			||||||
              //    throw new Exception("系统已存在审批角色编码为" + entity.NAME + "的数据,请勿重复!");
 | 
					                }
 | 
				
			||||||
              var departs = entity.Nav_ApproveDeparts;
 | 
					                if (departs != null && departs.Any())
 | 
				
			||||||
              entity.Nav_ApproveDeparts = null;
 | 
					                {
 | 
				
			||||||
              if (departs != null && departs.Any())
 | 
					                    departs.ForEach(t =>
 | 
				
			||||||
              {
 | 
					                    {
 | 
				
			||||||
                  departs = departs.Where(t => !t.IS_DELETED).ToList();
 | 
					                        t.ORG_ID = orgId;
 | 
				
			||||||
              }
 | 
					                        t.APPROVAL_ROLE_ID = entity.ID;
 | 
				
			||||||
              if (departs != null && departs.Any())
 | 
					                        t.Nav_Department = null;
 | 
				
			||||||
              {
 | 
					                    });
 | 
				
			||||||
                  departs.ForEach(t =>
 | 
					                }
 | 
				
			||||||
                  {
 | 
					                List<T_PF_APPROVE_OPERATION_ROLE> listRoles = new List<T_PF_APPROVE_OPERATION_ROLE>();
 | 
				
			||||||
                      t.ORG_ID = orgId;
 | 
					                var roles = entity.Nav_ApproveRoles;
 | 
				
			||||||
                      t.APPROVAL_ROLE_ID = entity.ID;
 | 
					                entity.Nav_ApproveRoles = null;
 | 
				
			||||||
                      t.Nav_Department = null;
 | 
					                if (roles == null)
 | 
				
			||||||
                  });
 | 
					                {
 | 
				
			||||||
              }
 | 
					                    var approveRole = this.GetEntity<T_FM_ROLE>(t => t.ENABLE_STATUS == 0 && t.NAME.Contains("负责人"));
 | 
				
			||||||
              List<T_PF_APPROVE_OPERATION_ROLE> listRoles = new List<T_PF_APPROVE_OPERATION_ROLE>();
 | 
					                    if (approveRole != null)
 | 
				
			||||||
              var roles = entity.Nav_ApproveRoles;
 | 
					                    {
 | 
				
			||||||
              entity.Nav_ApproveRoles = null;
 | 
					                        var role = new T_PF_APPROVE_OPERATION_ROLE();
 | 
				
			||||||
              if (roles == null)
 | 
					                        role.ORG_ID = orgId;
 | 
				
			||||||
              {
 | 
					                        role.APPROVAL_ROLE_ID = entity.ID;
 | 
				
			||||||
                  var approveRole = this.GetEntity<T_FM_ROLE>(t => t.ENABLE_STATUS == 0 && t.NAME.Contains("负责人"));
 | 
					                        role.ROLE_ID = approveRole.ID;
 | 
				
			||||||
                  if (approveRole != null)
 | 
					                        listRoles.Add(role);
 | 
				
			||||||
                  {
 | 
					                    }
 | 
				
			||||||
                      var role = new T_PF_APPROVE_OPERATION_ROLE();
 | 
					                }
 | 
				
			||||||
                      role.ORG_ID = orgId;
 | 
					                List <Guid> deleteIds = new List<Guid>();
 | 
				
			||||||
                      role.APPROVAL_ROLE_ID = entity.ID;
 | 
					                if (entity.ROLE_ID != null)
 | 
				
			||||||
                      role.ROLE_ID = approveRole.ID;
 | 
					                {
 | 
				
			||||||
                      listRoles.Add(role);
 | 
					                    var datas = this.GetEntities<T_PF_APPROVE_OPERATION_ROLE>(t => t.APPROVAL_ROLE_ID == entity.ID, new BaseFilter(orgId));
 | 
				
			||||||
                  }
 | 
					                    if (datas.Any())
 | 
				
			||||||
              }
 | 
					                    { 
 | 
				
			||||||
              List<Guid> deleteIds = new List<Guid>();
 | 
					                        var ids=datas.Select(t => t.ID).ToList();
 | 
				
			||||||
              if (entity.ROLE_ID != null)
 | 
					                        deleteIds.AddRange(ids);
 | 
				
			||||||
              {
 | 
					                    }
 | 
				
			||||||
                  var datas = this.GetEntities<T_PF_APPROVE_OPERATION_ROLE>(t => t.APPROVAL_ROLE_ID == entity.ID, new BaseFilter(orgId));
 | 
					                    var role = new T_PF_APPROVE_OPERATION_ROLE();
 | 
				
			||||||
                  if (datas.Any())
 | 
					                    role.ORG_ID = orgId;
 | 
				
			||||||
                  {
 | 
					                    role.APPROVAL_ROLE_ID = entity.ID;
 | 
				
			||||||
                      var ids = datas.Select(t => t.ID).ToList();
 | 
					                    role.ROLE_ID = entity.ROLE_ID;
 | 
				
			||||||
                      deleteIds.AddRange(ids);
 | 
					                    listRoles.Add(role);
 | 
				
			||||||
                  }
 | 
					                }
 | 
				
			||||||
                  var role = new T_PF_APPROVE_OPERATION_ROLE();
 | 
					                if (listRoles.Any())
 | 
				
			||||||
                  role.ORG_ID = orgId;
 | 
					                {
 | 
				
			||||||
                  role.APPROVAL_ROLE_ID = entity.ID;
 | 
					                    listRoles = listRoles.Distinct(t => t.ROLE_ID).ToList();
 | 
				
			||||||
                  role.ROLE_ID = entity.ROLE_ID;
 | 
					                }
 | 
				
			||||||
                  listRoles.Add(role);
 | 
					                UnifiedCommit(() =>
 | 
				
			||||||
              }
 | 
					                {
 | 
				
			||||||
              if (listRoles.Any())
 | 
					                    if (entity != null)
 | 
				
			||||||
              {
 | 
					                        UpdateEntityNoCommit(entity);   //保存主表
 | 
				
			||||||
                  listRoles = listRoles.Distinct(t => t.ROLE_ID).ToList();
 | 
					                    if (departs != null && departs.Any())
 | 
				
			||||||
              }
 | 
					                        BantchSaveEntityNoCommit(departs);    //保存子表
 | 
				
			||||||
              Dictionary<Guid, string> dicConn = null;
 | 
					                    if (listRoles != null && listRoles.Any())
 | 
				
			||||||
              if (isHead)
 | 
					                        BantchSaveEntityNoCommit(listRoles);    //保存子表
 | 
				
			||||||
              {
 | 
					                    if (deleteIds != null && deleteIds.Any())
 | 
				
			||||||
                  dicConn = OPTenantDBConnService.GetConnDictionary(entity.ORG_ID);
 | 
					                        BantchDeleteEntityNoCommit<T_PF_APPROVE_OPERATION_ROLE>(deleteIds);    //保存子表
 | 
				
			||||||
                  if (dicConn == null)
 | 
					                });
 | 
				
			||||||
                  {
 | 
					                return true;
 | 
				
			||||||
                      throw new Exception("获取子公司链接失败,请关闭页面刷新后再试");
 | 
					            });
 | 
				
			||||||
                  }
 | 
					 | 
				
			||||||
              }
 | 
					 | 
				
			||||||
              UnifiedCommit(() =>
 | 
					 | 
				
			||||||
              {
 | 
					 | 
				
			||||||
                  if (entity != null)
 | 
					 | 
				
			||||||
                      UpdateEntityNoCommit(entity);   //保存主表
 | 
					 | 
				
			||||||
                  if (departs != null && departs.Any())
 | 
					 | 
				
			||||||
                      BantchSaveEntityNoCommit(departs);    //保存子表
 | 
					 | 
				
			||||||
                  if (listRoles != null && listRoles.Any())
 | 
					 | 
				
			||||||
                      BantchSaveEntityNoCommit(listRoles);    //保存子表
 | 
					 | 
				
			||||||
                  if (deleteIds != null && deleteIds.Any())
 | 
					 | 
				
			||||||
                      BantchDeleteEntityNoCommit<T_PF_APPROVE_OPERATION_ROLE>(deleteIds);    //保存子表
 | 
					 | 
				
			||||||
              });
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
              //如果是总部 同时同步到各个子公司
 | 
					 | 
				
			||||||
              if (isHead)
 | 
					 | 
				
			||||||
              {
 | 
					 | 
				
			||||||
                  entity.ISHEAD = true;
 | 
					 | 
				
			||||||
                  entity.ROLE_ID = null;
 | 
					 | 
				
			||||||
                  entity.Nav_Role = null;
 | 
					 | 
				
			||||||
                  entity.Nav_ApproveRoles = null;
 | 
					 | 
				
			||||||
                  int EditC = 0;
 | 
					 | 
				
			||||||
                  //using (var scope = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled))
 | 
					 | 
				
			||||||
                  //{
 | 
					 | 
				
			||||||
                  //    try
 | 
					 | 
				
			||||||
                  //    {
 | 
					 | 
				
			||||||
                  foreach (var item in dicConn)
 | 
					 | 
				
			||||||
                  {
 | 
					 | 
				
			||||||
                      try
 | 
					 | 
				
			||||||
                      {
 | 
					 | 
				
			||||||
                          entity.ORG_ID = item.Key;
 | 
					 | 
				
			||||||
                          using (var context = new MigrationContext(item.Value))
 | 
					 | 
				
			||||||
                          {
 | 
					 | 
				
			||||||
                              EditC = context.GetCount<T_PF_APPROVAL_ROLE>(e => e.ID == entity.ID);
 | 
					 | 
				
			||||||
                              if (EditC > 0)
 | 
					 | 
				
			||||||
                              {
 | 
					 | 
				
			||||||
                                  context.UpdateEntity(entity);
 | 
					 | 
				
			||||||
                                  context.SaveChanges();
 | 
					 | 
				
			||||||
                                  //context.SaveChangesAsync();
 | 
					 | 
				
			||||||
                              }
 | 
					 | 
				
			||||||
                              else
 | 
					 | 
				
			||||||
                              {
 | 
					 | 
				
			||||||
                                  context.AddEntity(entity);
 | 
					 | 
				
			||||||
                                  context.SaveChanges();
 | 
					 | 
				
			||||||
                                  //context.AddAsync(entity);
 | 
					 | 
				
			||||||
                                  //context.SaveChangesAsync();
 | 
					 | 
				
			||||||
                              }
 | 
					 | 
				
			||||||
                          }
 | 
					 | 
				
			||||||
                      }
 | 
					 | 
				
			||||||
                      catch (Exception ex)
 | 
					 | 
				
			||||||
                      {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                      }
 | 
					 | 
				
			||||||
                  }
 | 
					 | 
				
			||||||
                  //        //// 所有操作成功,提交事务
 | 
					 | 
				
			||||||
                  //        scope.Complete();
 | 
					 | 
				
			||||||
                  //    }
 | 
					 | 
				
			||||||
                  //    catch (Exception ex)
 | 
					 | 
				
			||||||
                  //    {
 | 
					 | 
				
			||||||
                  //        // 发生异常,自动回滚(无需手动调用,scope 释放时未 Complete 则回滚)
 | 
					 | 
				
			||||||
                  //        throw;
 | 
					 | 
				
			||||||
                  //    }
 | 
					 | 
				
			||||||
                  //}
 | 
					 | 
				
			||||||
              }
 | 
					 | 
				
			||||||
              return true;
 | 
					 | 
				
			||||||
          });
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// 批量添加节点
 | 
					        /// 批量添加节点
 | 
				
			||||||
 | 
				
			|||||||
@ -173,7 +173,7 @@
 | 
				
			|||||||
                        //    //MethodInfo callbackMethd1 = callBackInterface1.GetMethod("MeetingMinutesBack", BindingFlags.Public | BindingFlags.Instance); // Error lies
 | 
					                        //    //MethodInfo callbackMethd1 = callBackInterface1.GetMethod("MeetingMinutesBack", BindingFlags.Public | BindingFlags.Instance); // Error lies
 | 
				
			||||||
                        //    //callbackMethd1.Invoke(this, new object[] { dbApprove.DATA_ID.ToString() });
 | 
					                        //    //callbackMethd1.Invoke(this, new object[] { dbApprove.DATA_ID.ToString() });
 | 
				
			||||||
                        //}
 | 
					                        //}
 | 
				
			||||||
 | 
					                        
 | 
				
			||||||
                        //查询审批的表单数据
 | 
					                        //查询审批的表单数据
 | 
				
			||||||
                        var form = this.GetEntity<T_PF_FORM>(i => i.CODE == dbApprove.APPROVE_CODE, new BaseFilter(dbApprove.ORG_ID));
 | 
					                        var form = this.GetEntity<T_PF_FORM>(i => i.CODE == dbApprove.APPROVE_CODE, new BaseFilter(dbApprove.ORG_ID));
 | 
				
			||||||
                        var tableName = form?.TABLE_NAME;
 | 
					                        var tableName = form?.TABLE_NAME;
 | 
				
			||||||
@ -334,8 +334,8 @@
 | 
				
			|||||||
                                        case "关键许可工作票(二级审批)":
 | 
					                                        case "关键许可工作票(二级审批)":
 | 
				
			||||||
                                        case "关键许可工作票(三级审批)":
 | 
					                                        case "关键许可工作票(三级审批)":
 | 
				
			||||||
                                        case "关键许可工作票(四级审批)":
 | 
					                                        case "关键许可工作票(四级审批)":
 | 
				
			||||||
                                            var job = this.GetEntity<T_FO_CRUCIAL_LICENSE_JOB>(t => t.ID == entity.DATA_ID, "Nav_OperationStep");
 | 
					                                            var job = this.GetEntity<T_FO_CRUCIAL_LICENSE_JOB>(t=>t.ID == entity.DATA_ID, "Nav_OperationStep");
 | 
				
			||||||
                                            NoticeTitle = job != null && job.Nav_OperationStep != null ? entity.NAME + "-" + job.Nav_OperationStep?.NAME + "待审批" : NoticeTitle;
 | 
					                                            NoticeTitle = job != null && job.Nav_OperationStep != null ? entity.NAME+"-"+job.Nav_OperationStep?.NAME + "待审批" : NoticeTitle;
 | 
				
			||||||
                                            endTime = Convert.ToDateTime(DateTime.Now.AddDays(1).ToString("D").ToString()).AddSeconds(-1);
 | 
					                                            endTime = Convert.ToDateTime(DateTime.Now.AddDays(1).ToString("D").ToString()).AddSeconds(-1);
 | 
				
			||||||
                                            break;
 | 
					                                            break;
 | 
				
			||||||
                                        default: break;
 | 
					                                        default: break;
 | 
				
			||||||
@ -437,13 +437,13 @@
 | 
				
			|||||||
            var details = dbApprove.Nav_ApproveDetails;
 | 
					            var details = dbApprove.Nav_ApproveDetails;
 | 
				
			||||||
            dbApprove.Nav_ApproveDetails = null;
 | 
					            dbApprove.Nav_ApproveDetails = null;
 | 
				
			||||||
            details.ForEach(i => i.Nav_Approve = null);
 | 
					            details.ForEach(i => i.Nav_Approve = null);
 | 
				
			||||||
            if (task != null)
 | 
					                if (task != null)
 | 
				
			||||||
                this.UpdateEntityNoCommit(task);
 | 
					                    this.UpdateEntityNoCommit(task);
 | 
				
			||||||
            this.UpdateEntityNoCommit(dbApprove);
 | 
					                this.UpdateEntityNoCommit(dbApprove);
 | 
				
			||||||
            this.BantchUpdateEntityNoCommit(details);
 | 
					                this.BantchUpdateEntityNoCommit(details);
 | 
				
			||||||
            //if (methodInfoEnd != null)
 | 
					                //if (methodInfoEnd != null)
 | 
				
			||||||
            //    methodInfoEnd.MakeGenericMethod(new Type[] { dbTypeEnd }).Invoke(this, new object[] { dbApprove.DATA_ID.ToString() });
 | 
					                //    methodInfoEnd.MakeGenericMethod(new Type[] { dbTypeEnd }).Invoke(this, new object[] { dbApprove.DATA_ID.ToString() });
 | 
				
			||||||
 | 
					           
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        private void ChangeApproveStatus(T_PF_APPROVE dbApprove, T_FM_NOTIFICATION_TASK task)//, Type dbTypeEnd = null, MethodInfo methodInfoEnd = null
 | 
					        private void ChangeApproveStatus(T_PF_APPROVE dbApprove, T_FM_NOTIFICATION_TASK task)//, Type dbTypeEnd = null, MethodInfo methodInfoEnd = null
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
@ -645,33 +645,18 @@
 | 
				
			|||||||
        [HttpPost, Route("FullGet")]
 | 
					        [HttpPost, Route("FullGet")]
 | 
				
			||||||
        public JsonActionResult<T_PF_APPROVE> FullGet([FromBody] KeywordFilter filter)
 | 
					        public JsonActionResult<T_PF_APPROVE> FullGet([FromBody] KeywordFilter filter)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            return SafeExecute(() =>
 | 
					            var result = WitEntity(null, filter);
 | 
				
			||||||
 | 
					            if (result.Data != null)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                T_PF_APPROVE result = null;
 | 
					                if (result.Data.APPROVE_TEMP_ID != null)
 | 
				
			||||||
                if (!string.IsNullOrEmpty(filter.Parameter1) && filter.OrgId.HasValue && filter.Parameter1 != filter.OrgId.Value.ToString())
 | 
					 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    //集团人员 通过 首页点击  获取对应的数据库链接 返回结果
 | 
					                    var approveTemp = this.GetEntity<T_PF_APPROVE_TEMP>(t => t.ID == result.Data.APPROVE_TEMP_ID);
 | 
				
			||||||
                    //这边怎么调用 原生的   GetEntity 方法
 | 
					                    if (approveTemp != null)
 | 
				
			||||||
 | 
					                        result.Data.REJECT_INTERFACE = approveTemp.REJECT_INTERFACE;
 | 
				
			||||||
                    //ICommonService service = _serviceLocator.GetService<ICommonService>();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                else
 | 
					                result.Data.Nav_ApproveDetails = result.Data.Nav_ApproveDetails.OrderBy(t => t.NUM).ThenBy(m => m.MODIFY_TIME).ToList();
 | 
				
			||||||
                {
 | 
					            }
 | 
				
			||||||
                    result = GetEntity<T_PF_APPROVE>(null, filter, null);
 | 
					            return result;
 | 
				
			||||||
                    if (result != null)
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        if (result.APPROVE_TEMP_ID != null)
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
                            var approveTemp = this.GetEntity<T_PF_APPROVE_TEMP>(t => t.ID == result.APPROVE_TEMP_ID);
 | 
					 | 
				
			||||||
                            if (approveTemp != null)
 | 
					 | 
				
			||||||
                                result.REJECT_INTERFACE = approveTemp.REJECT_INTERFACE;
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                        result.Nav_ApproveDetails = result.Nav_ApproveDetails.OrderBy(t => t.NUM).ThenBy(m => m.MODIFY_TIME).ToList();
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                return result;
 | 
					 | 
				
			||||||
            });
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
@ -974,7 +959,7 @@
 | 
				
			|||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        /// <param name="id"></param>
 | 
					        /// <param name="id"></param>
 | 
				
			||||||
        /// <returns></returns> 
 | 
					        /// <returns></returns> 
 | 
				
			||||||
        private bool BackUpdate_FOJobCrucialLicense(string id, Action action)
 | 
					        private bool BackUpdate_FOJobCrucialLicense(string id,Action action)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            //var entity = this.GetEntity<T_FO_CRUCIAL_LICENSE_JOB>(id, false, "Nav_OperationStep", "Nav_ApplyUser", "Nav_CrucialLicensePerson");
 | 
					            //var entity = this.GetEntity<T_FO_CRUCIAL_LICENSE_JOB>(id, false, "Nav_OperationStep", "Nav_ApplyUser", "Nav_CrucialLicensePerson");
 | 
				
			||||||
            var entity = this.GetEntity<T_FO_CRUCIAL_LICENSE_JOB>(id, new string[] { "Nav_OperationStep", "Nav_ApplyUser", "Nav_CrucialLicensePerson" });// wyw 
 | 
					            var entity = this.GetEntity<T_FO_CRUCIAL_LICENSE_JOB>(id, new string[] { "Nav_OperationStep", "Nav_ApplyUser", "Nav_CrucialLicensePerson" });// wyw 
 | 
				
			||||||
@ -1070,7 +1055,7 @@
 | 
				
			|||||||
            });
 | 
					            });
 | 
				
			||||||
            return true;
 | 
					            return true;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        private bool BackUpdate_FOJobEventRecord(string id, Action action)
 | 
					        private bool BackUpdate_FOJobEventRecord(string id,Action action)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            var entity = this.GetEntity<T_FO_JOB_EVENT_RECORD>(id, "Nav_Details");
 | 
					            var entity = this.GetEntity<T_FO_JOB_EVENT_RECORD>(id, "Nav_Details");
 | 
				
			||||||
            entity.FORM_STATUS = (int)FOTeamActivityState.已归档;
 | 
					            entity.FORM_STATUS = (int)FOTeamActivityState.已归档;
 | 
				
			||||||
 | 
				
			|||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@ -1,7 +1,13 @@
 | 
				
			|||||||
 
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
					 
 | 
				
			||||||
 
 | 
					 
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//------------------------------------------------------------------------------
 | 
					//------------------------------------------------------------------------------
 | 
				
			||||||
//     T4模板文件:基础接口类
 | 
					//     T4模板文件:基础接口类
 | 
				
			||||||
//     此代码由T4模板自动生成
 | 
					//     此代码由T4模板自动生成
 | 
				
			||||||
@ -15,4 +21,5 @@ using APT.Infrastructure.Api;
 | 
				
			|||||||
using APT.BaseData.Domain.ApiModel.PF;
 | 
					using APT.BaseData.Domain.ApiModel.PF;
 | 
				
			||||||
namespace APT.PP.WebApi.Controllers.Api
 | 
					namespace APT.PP.WebApi.Controllers.Api
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	 }
 | 
						
 | 
				
			||||||
 | 
					 }
 | 
				
			||||||
 | 
				
			|||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@ -1,22 +0,0 @@
 | 
				
			|||||||
using APT.Infrastructure.Core;
 | 
					 | 
				
			||||||
using Microsoft.AspNetCore.Http;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
namespace APT.Utility
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    public class HeadHelper
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        /// <summary>
 | 
					 | 
				
			||||||
        /// 地球半径
 | 
					 | 
				
			||||||
        /// </summary>
 | 
					 | 
				
			||||||
        public const string HeadtelnetCode = "0003";
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        public static bool GetIsHead(IHeaderDictionary Headers)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            if (Headers != null && Headers.ContainsKey("Tenant") && Headers["Tenant"] == HeadtelnetCode)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                return true;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            return false;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@ -24,6 +24,5 @@ namespace APT.Utility
 | 
				
			|||||||
        public string MineType { get; set; }
 | 
					        public string MineType { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public string[] DataRule { get; set; }
 | 
					        public string[] DataRule { get; set; }
 | 
				
			||||||
        public bool IsHead { get; set; }
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user