冲突
This commit is contained in:
commit
66986befb9
@ -300,5 +300,10 @@
|
|||||||
/// 首页 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,5 +51,14 @@ 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,5 +76,14 @@ 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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,5 +15,12 @@ namespace APT.BaseData.Domain.IServices.OP
|
|||||||
/// <param name="ORG_IDBeside"></param>
|
/// <param name="ORG_IDBeside"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Dictionary<Guid, string> GetConnDictionary(Guid? ORG_IDBeside);
|
Dictionary<Guid, string> GetConnDictionary(Guid? ORG_IDBeside);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取 ORG_ID的数据库链接
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ORG_ID">过滤值</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
string GetConnByORGID(Guid ORG_ID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +1,10 @@
|
|||||||
using APT.BaseData.Domain.Entities.FM;
|
using APT.BaseData.Domain.ApiModel.Platform;
|
||||||
|
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;
|
||||||
@ -23,42 +25,144 @@ 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>();
|
||||||
string conn = string.Empty;
|
//从Redis中获取所有数据库链接值
|
||||||
IEnumerable<T_OP_TENANT> listTent = null;
|
|
||||||
using (var context = new MigrationContext())
|
|
||||||
{
|
|
||||||
Expression<Func<T_OP_TENANT, bool>> expression = e => e.DB_CONN_ID.HasValue;
|
|
||||||
if (ORG_IDBeside.HasValue)
|
|
||||||
{
|
|
||||||
expression = expression.And(e => e.ID != ORG_IDBeside);
|
|
||||||
}
|
|
||||||
|
|
||||||
listTent = context.GetEntities(expression, null, null);
|
bool isRedisConfig = true;
|
||||||
List<Guid> listConnID = listTent.Select(e => e.DB_CONN_ID.Value).ToList();
|
var redisConfig = APT.Infrastructure.Api.ConfigurationManager.AppSettings["RedisFormConfig"];
|
||||||
var listDbConn = context.GetEntities<T_OP_TENANT_DB_CONN>(e => listConnID.Contains(e.ID), null, null);
|
if (!string.IsNullOrEmpty(redisConfig))
|
||||||
if (listDbConn != null && listDbConn.Count() > 0)
|
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())
|
||||||
{
|
{
|
||||||
var env = ConfigurationManager.AppSettings["Env"];
|
Expression<Func<T_OP_TENANT, bool>> expression = e => e.DB_CONN_ID.HasValue;
|
||||||
foreach (var item in listDbConn)
|
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)
|
||||||
{
|
{
|
||||||
conn = item.DB_CONN;
|
var env = ConfigurationManager.AppSettings["Env"];
|
||||||
if (env == ((int)EnvType.外网).ToString())
|
foreach (var item in listDbConn)
|
||||||
{
|
{
|
||||||
conn = item.DB_CONN_WAN;
|
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 (!dicORGCONN.ContainsKey(item.ID))
|
if (isRedisConfig && dicORGCONN.Count > 0)
|
||||||
{
|
{
|
||||||
dicORGCONN.Add(listTent.First(e => e.DB_CONN_ID == item.ID).ID, conn);
|
try
|
||||||
|
{
|
||||||
|
CsRedisManager.StringSet<Dictionary<Guid, string>>(RedisCacheKey.ConnAll, dicORGCONN);//所有数据库链接 存入 Redis
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
if (dicORGCONN != null && dicORGCONN.Count > 0)
|
||||||
|
{
|
||||||
|
if (ORG_IDBeside.HasValue)
|
||||||
|
{
|
||||||
|
Dictionary<Guid, string> dicORGCONN1 = new Dictionary<Guid, string>();
|
||||||
|
foreach (var item in dicORGCONN)
|
||||||
|
{
|
||||||
|
if (item.Key == ORG_IDBeside.Value)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
dicORGCONN1.Add(item.Key, item.Value);
|
||||||
|
}
|
||||||
|
dicORGCONN = dicORGCONN1;
|
||||||
|
}
|
||||||
|
}
|
||||||
return dicORGCONN;
|
return dicORGCONN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取 ORG_ID的数据库链接
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ORG_ID">过滤值</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public string GetConnByORGID(Guid ORG_ID)
|
||||||
|
{
|
||||||
|
Dictionary<Guid, string> dicORGCONN = new Dictionary<Guid, string>();
|
||||||
|
//从Redis中获取所有数据库链接值
|
||||||
|
|
||||||
|
bool isRedisConfig = true;
|
||||||
|
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 && dicORGCONN.ContainsKey(ORG_ID))
|
||||||
|
{
|
||||||
|
return dicORGCONN[ORG_ID];
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
129162
APT.Data.Migrations/Migrations/20251021094627_wyw2025102101.Designer.cs
generated
Normal file
129162
APT.Data.Migrations/Migrations/20251021094627_wyw2025102101.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,24 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
namespace APT.Data.Migrations.Migrations
|
||||||
|
{
|
||||||
|
public partial class 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");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
129165
APT.Data.Migrations/Migrations/20251022074708_wyw2025102201.Designer.cs
generated
Normal file
129165
APT.Data.Migrations/Migrations/20251022074708_wyw2025102201.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,24 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
namespace APT.Data.Migrations.Migrations
|
||||||
|
{
|
||||||
|
public partial class 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,6 +11691,9 @@ 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");
|
||||||
|
|
||||||
@ -53823,6 +53826,9 @@ 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");
|
||||||
|
|
||||||
|
|||||||
@ -2,10 +2,12 @@
|
|||||||
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;
|
||||||
@ -53,6 +55,7 @@ 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,7 +54,10 @@ 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);
|
||||||
|
|||||||
@ -34,6 +34,7 @@ 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
|
||||||
{
|
{
|
||||||
@ -47,15 +48,18 @@ 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)
|
public UserController(IFMUserService personnelService, IFMDepartmentService departmentService, IFMNotificationTaskService notificationTaskService, IOPTenantDBConnService opTenantDBConnService)
|
||||||
{
|
{
|
||||||
UserService = personnelService;
|
UserService = personnelService;
|
||||||
DepartmentService = departmentService;
|
DepartmentService = departmentService;
|
||||||
NotificationTaskService = notificationTaskService;
|
NotificationTaskService = notificationTaskService;
|
||||||
|
OPTenantDBConnService = opTenantDBConnService;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -483,110 +487,125 @@ 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 //
|
||||||
eduCard = new T_SE_THREE_LEVEL_SAFE_EDU_CARD();
|
#region //新增人员增加三级安全教育
|
||||||
eduCard.ID = Guid.NewGuid();
|
//eduCard = new T_SE_THREE_LEVEL_SAFE_EDU_CARD();
|
||||||
eduCard.ID_CARD_NUMBER = entity.ID_CARD;
|
//eduCard.ID = Guid.NewGuid();
|
||||||
eduCard.IN_TIME = entity.ENTRYTIME;
|
//eduCard.ID_CARD_NUMBER = entity.ID_CARD;
|
||||||
eduCard.USER_ID = entity.ID;
|
//eduCard.IN_TIME = entity.ENTRYTIME;
|
||||||
eduCard.DEPARTMENT_ID = entity.DEPARTMENT_ID;
|
//eduCard.USER_ID = entity.ID;
|
||||||
eduCard.LAUNCH_TIME = DateTime.Now;
|
//eduCard.DEPARTMENT_ID = entity.DEPARTMENT_ID;
|
||||||
eduCard.ORG_ID = entity.ORG_ID;
|
//eduCard.LAUNCH_TIME = DateTime.Now;
|
||||||
eduCard.POST_ID = entity.Nav_Person.POST_ID;
|
//eduCard.ORG_ID = entity.ORG_ID;
|
||||||
eduCard.STATUS = SEThreeLevelSafeTrainStatus.公司培训;
|
//eduCard.POST_ID = entity.Nav_Person.POST_ID;
|
||||||
eduCard.LAUNCH_USER_ID = APT.Infrastructure.Api.AppContext.CurrentSession.UserID;
|
//eduCard.STATUS = SEThreeLevelSafeTrainStatus.公司培训;
|
||||||
eduCard.LAUNCH_DEPARTMENT_ID = APT.Infrastructure.Api.AppContext.CurrentSession.DepartmentID;
|
//eduCard.LAUNCH_USER_ID = APT.Infrastructure.Api.AppContext.CurrentSession.UserID;
|
||||||
next_train_record = new T_SE_THREE_LEVEL_SAFE_TRAIN_RECORD
|
//eduCard.LAUNCH_DEPARTMENT_ID = APT.Infrastructure.Api.AppContext.CurrentSession.DepartmentID;
|
||||||
{
|
//next_train_record = new T_SE_THREE_LEVEL_SAFE_TRAIN_RECORD
|
||||||
ID = Guid.NewGuid(),
|
//{
|
||||||
EDU_CARD_ID = eduCard.ID,
|
// ID = Guid.NewGuid(),
|
||||||
ORG_ID = eduCard.ORG_ID,
|
// EDU_CARD_ID = eduCard.ID,
|
||||||
THREE_LEVEL_SAFE_TRAIN_TYPE = SEThreeLevelSafeTrainType.公司级
|
// ORG_ID = eduCard.ORG_ID,
|
||||||
};
|
// 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());
|
//};
|
||||||
next_train_record.CONTENT_ID = train_contents.ID;
|
//var train_contents = GetEntity<T_SE_THREE_LEVEL_SAFE_CONTENT>(t => t.THREE_LEVEL_SAFE_TRAIN_TYPE == (SEThreeLevelSafeTrainType)eduCard.STATUS.GetInt());
|
||||||
var postName = GetEntity<T_FM_USER_POST>(eduCard.POST_ID ?? Guid.Empty)?.NAME;
|
//next_train_record.CONTENT_ID = train_contents.ID;
|
||||||
var sendUser = GetEntity<T_FM_USER>(t => t.Nav_ApproveRole != null && t.Nav_ApproveRole.NAME == "安环部安全员" && t.IS_DELETED == false && t.ENABLE_STATUS == 0);
|
//var postName = GetEntity<T_FM_USER_POST>(eduCard.POST_ID ?? Guid.Empty)?.NAME;
|
||||||
if (sendUser != null)
|
//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)
|
||||||
var endTime = entity.ENTRYTIME.AddMonths(1);
|
//{
|
||||||
var newEndTime = new DateTime(endTime.Year, endTime.Month, endTime.Day, 23, 59, 59);
|
// var endTime = entity.ENTRYTIME.AddMonths(1);
|
||||||
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"));
|
// 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"));
|
||||||
|
//}
|
||||||
#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(姓名拼音首字母(第一个大写) + 工号(取数字)
|
||||||
|
|
||||||
@ -728,8 +747,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 = Enum.GetName(typeof(FMDepartmentType), departmentInfo.DEPARTMENT_TYPE);
|
var param = ((FMDepartmentType)departmentInfo.DEPARTMENT_TYPE).GetDescription();
|
||||||
var param2 = Enum.GetName(typeof(FMDepartmentType), roleInfo.DEPARTMENT_TYPE);
|
var param2 = ((FMDepartmentType)roleInfo.DEPARTMENT_TYPE).GetDescription();
|
||||||
throw new Exception(departmentInfo.NAME + "是" + param + "," + roleInfo.NAME + "是" + param2 + ",组织层级不一致");
|
throw new Exception(departmentInfo.NAME + "是" + param + "," + roleInfo.NAME + "是" + param2 + ",组织层级不一致");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -737,10 +756,6 @@ 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
|
||||||
//{
|
//{
|
||||||
// //查双控库是否有该辨识岗位,没有的话触发今日提醒给安全员
|
// //查双控库是否有该辨识岗位,没有的话触发今日提醒给安全员
|
||||||
@ -928,6 +943,38 @@ 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)
|
||||||
@ -985,6 +1032,68 @@ 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;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,9 @@
|
|||||||
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;
|
||||||
@ -13,6 +15,7 @@ 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
|
||||||
{
|
{
|
||||||
@ -22,6 +25,13 @@ 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>
|
||||||
@ -31,73 +41,139 @@ 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 orgId = APT.Infrastructure.Api.AppContext.CurrentSession.OrgId;
|
var isHead = HeadHelper.GetIsHead(this.Request.Headers);
|
||||||
//var roleCodes = this.GetEntities<T_PF_APPROVAL_ROLE>(t => true, new BaseFilter(orgId)).Select(x => x.NAME).ToList();
|
if (entity.ISHEAD && !isHead)
|
||||||
//if (roleCodes.Contains(entity.NAME))
|
{
|
||||||
// throw new Exception("系统已存在审批角色编码为" + entity.NAME + "的数据,请勿重复!");
|
throw new Exception("子公司不能修改总公司角色信息!");
|
||||||
var departs = entity.Nav_ApproveDeparts;
|
}
|
||||||
entity.Nav_ApproveDeparts = null;
|
|
||||||
if (departs != null && departs.Any())
|
var orgId = APT.Infrastructure.Api.AppContext.CurrentSession.OrgId;
|
||||||
{
|
//var roleCodes = this.GetEntities<T_PF_APPROVAL_ROLE>(t => true, new BaseFilter(orgId)).Select(x => x.NAME).ToList();
|
||||||
departs = departs.Where(t => !t.IS_DELETED).ToList();
|
//if (roleCodes.Contains(entity.NAME))
|
||||||
}
|
// throw new Exception("系统已存在审批角色编码为" + entity.NAME + "的数据,请勿重复!");
|
||||||
if (departs != null && departs.Any())
|
var departs = entity.Nav_ApproveDeparts;
|
||||||
{
|
entity.Nav_ApproveDeparts = null;
|
||||||
departs.ForEach(t =>
|
if (departs != null && departs.Any())
|
||||||
{
|
{
|
||||||
t.ORG_ID = orgId;
|
departs = departs.Where(t => !t.IS_DELETED).ToList();
|
||||||
t.APPROVAL_ROLE_ID = entity.ID;
|
}
|
||||||
t.Nav_Department = null;
|
if (departs != null && departs.Any())
|
||||||
});
|
{
|
||||||
}
|
departs.ForEach(t =>
|
||||||
List<T_PF_APPROVE_OPERATION_ROLE> listRoles = new List<T_PF_APPROVE_OPERATION_ROLE>();
|
{
|
||||||
var roles = entity.Nav_ApproveRoles;
|
t.ORG_ID = orgId;
|
||||||
entity.Nav_ApproveRoles = null;
|
t.APPROVAL_ROLE_ID = entity.ID;
|
||||||
if (roles == null)
|
t.Nav_Department = null;
|
||||||
{
|
});
|
||||||
var approveRole = this.GetEntity<T_FM_ROLE>(t => t.ENABLE_STATUS == 0 && t.NAME.Contains("负责人"));
|
}
|
||||||
if (approveRole != null)
|
List<T_PF_APPROVE_OPERATION_ROLE> listRoles = new List<T_PF_APPROVE_OPERATION_ROLE>();
|
||||||
{
|
var roles = entity.Nav_ApproveRoles;
|
||||||
var role = new T_PF_APPROVE_OPERATION_ROLE();
|
entity.Nav_ApproveRoles = null;
|
||||||
role.ORG_ID = orgId;
|
if (roles == null)
|
||||||
role.APPROVAL_ROLE_ID = entity.ID;
|
{
|
||||||
role.ROLE_ID = approveRole.ID;
|
var approveRole = this.GetEntity<T_FM_ROLE>(t => t.ENABLE_STATUS == 0 && t.NAME.Contains("负责人"));
|
||||||
listRoles.Add(role);
|
if (approveRole != null)
|
||||||
}
|
{
|
||||||
}
|
var role = new T_PF_APPROVE_OPERATION_ROLE();
|
||||||
List <Guid> deleteIds = new List<Guid>();
|
role.ORG_ID = orgId;
|
||||||
if (entity.ROLE_ID != null)
|
role.APPROVAL_ROLE_ID = entity.ID;
|
||||||
{
|
role.ROLE_ID = approveRole.ID;
|
||||||
var datas = this.GetEntities<T_PF_APPROVE_OPERATION_ROLE>(t => t.APPROVAL_ROLE_ID == entity.ID, new BaseFilter(orgId));
|
listRoles.Add(role);
|
||||||
if (datas.Any())
|
}
|
||||||
{
|
}
|
||||||
var ids=datas.Select(t => t.ID).ToList();
|
List<Guid> deleteIds = new List<Guid>();
|
||||||
deleteIds.AddRange(ids);
|
if (entity.ROLE_ID != null)
|
||||||
}
|
{
|
||||||
var role = new T_PF_APPROVE_OPERATION_ROLE();
|
var datas = this.GetEntities<T_PF_APPROVE_OPERATION_ROLE>(t => t.APPROVAL_ROLE_ID == entity.ID, new BaseFilter(orgId));
|
||||||
role.ORG_ID = orgId;
|
if (datas.Any())
|
||||||
role.APPROVAL_ROLE_ID = entity.ID;
|
{
|
||||||
role.ROLE_ID = entity.ROLE_ID;
|
var ids = datas.Select(t => t.ID).ToList();
|
||||||
listRoles.Add(role);
|
deleteIds.AddRange(ids);
|
||||||
}
|
}
|
||||||
if (listRoles.Any())
|
var role = new T_PF_APPROVE_OPERATION_ROLE();
|
||||||
{
|
role.ORG_ID = orgId;
|
||||||
listRoles = listRoles.Distinct(t => t.ROLE_ID).ToList();
|
role.APPROVAL_ROLE_ID = entity.ID;
|
||||||
}
|
role.ROLE_ID = entity.ROLE_ID;
|
||||||
UnifiedCommit(() =>
|
listRoles.Add(role);
|
||||||
{
|
}
|
||||||
if (entity != null)
|
if (listRoles.Any())
|
||||||
UpdateEntityNoCommit(entity); //保存主表
|
{
|
||||||
if (departs != null && departs.Any())
|
listRoles = listRoles.Distinct(t => t.ROLE_ID).ToList();
|
||||||
BantchSaveEntityNoCommit(departs); //保存子表
|
}
|
||||||
if (listRoles != null && listRoles.Any())
|
Dictionary<Guid, string> dicConn = null;
|
||||||
BantchSaveEntityNoCommit(listRoles); //保存子表
|
if (isHead)
|
||||||
if (deleteIds != null && deleteIds.Any())
|
{
|
||||||
BantchDeleteEntityNoCommit<T_PF_APPROVE_OPERATION_ROLE>(deleteIds); //保存子表
|
dicConn = OPTenantDBConnService.GetConnDictionary(entity.ORG_ID);
|
||||||
});
|
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>
|
||||||
/// 批量添加节点
|
/// 批量添加节点
|
||||||
|
|||||||
@ -31,6 +31,7 @@
|
|||||||
using APT.BaseData.Services.Services.FM;
|
using APT.BaseData.Services.Services.FM;
|
||||||
using APT.BaseData.Services.Sys;
|
using APT.BaseData.Services.Sys;
|
||||||
using APT.MS.Domain.Entities.FO;
|
using APT.MS.Domain.Entities.FO;
|
||||||
|
using APT.BaseData.Domain.IServices.OP;
|
||||||
|
|
||||||
[Route("api/PF/PFApprove")]
|
[Route("api/PF/PFApprove")]
|
||||||
public partial class ApproveController : AuthorizeApiController<T_PF_APPROVE>
|
public partial class ApproveController : AuthorizeApiController<T_PF_APPROVE>
|
||||||
@ -43,8 +44,9 @@
|
|||||||
|
|
||||||
IFMDepartmentService DepartmentService { get; set; }
|
IFMDepartmentService DepartmentService { get; set; }
|
||||||
IFMUserService UserService { get; set; }
|
IFMUserService UserService { get; set; }
|
||||||
|
IOPTenantDBConnService OPTenantDBConnService { get; set; }
|
||||||
|
|
||||||
public ApproveController(IFMNotificationTaskService notificationTaskService, IPFSysLogService sysLogService, IRepository repository, IPFCodeRuleService codeRuleService, IFMDepartmentService departmentService, IFMUserService userService)
|
public ApproveController(IFMNotificationTaskService notificationTaskService, IPFSysLogService sysLogService, IRepository repository, IPFCodeRuleService codeRuleService, IFMDepartmentService departmentService, IFMUserService userService, IOPTenantDBConnService oPTenantDBConnService)
|
||||||
{
|
{
|
||||||
NotificationTaskService = notificationTaskService;
|
NotificationTaskService = notificationTaskService;
|
||||||
SysLogService = sysLogService;
|
SysLogService = sysLogService;
|
||||||
@ -52,6 +54,7 @@
|
|||||||
CodeRuleService = codeRuleService;
|
CodeRuleService = codeRuleService;
|
||||||
DepartmentService = departmentService;
|
DepartmentService = departmentService;
|
||||||
UserService = userService;
|
UserService = userService;
|
||||||
|
OPTenantDBConnService = oPTenantDBConnService;
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 更新或新增数据
|
/// 更新或新增数据
|
||||||
@ -173,7 +176,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 +337,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 +440,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,18 +648,42 @@
|
|||||||
[HttpPost, Route("FullGet")]
|
[HttpPost, Route("FullGet")]
|
||||||
public JsonActionResult<T_PF_APPROVE> FullGet([FromBody] KeywordFilter filter)
|
public JsonActionResult<T_PF_APPROVE> FullGet([FromBody] KeywordFilter filter)
|
||||||
{
|
{
|
||||||
var result = WitEntity(null, filter);
|
return SafeExecute(() =>
|
||||||
if (result.Data != null)
|
|
||||||
{
|
{
|
||||||
if (result.Data.APPROVE_TEMP_ID != null)
|
T_PF_APPROVE result = 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);
|
//集团人员 通过 首页点击 获取对应的数据库链接 返回结果
|
||||||
if (approveTemp != null)
|
//这边怎么调用 原生的 GetEntity 方法
|
||||||
result.Data.REJECT_INTERFACE = approveTemp.REJECT_INTERFACE;
|
|
||||||
|
|
||||||
|
string conn = OPTenantDBConnService.GetConnByORGID(new Guid(filter.Parameter1));
|
||||||
|
//var service = APT.Infrastructure.Api.ServiceLocator.Instance.GetService<IFMNotificatoinService>();
|
||||||
|
filter.IgnoreOrgRule = true;
|
||||||
|
//filter.OrgId = null;
|
||||||
|
filter.SpecifyDbConn = conn;
|
||||||
|
filter.SpecifyTenant = "0005";
|
||||||
|
//var ccc = service.GetEntities<T_PF_APPROVE>(e => !e.IS_DELETED, filter, null);
|
||||||
|
|
||||||
|
|
||||||
|
var aaa = GetEntities<T_PF_APPROVE>(e => !e.IS_DELETED, filter, null);
|
||||||
}
|
}
|
||||||
result.Data.Nav_ApproveDetails = result.Data.Nav_ApproveDetails.OrderBy(t => t.NUM).ThenBy(m => m.MODIFY_TIME).ToList();
|
else
|
||||||
}
|
{
|
||||||
return result;
|
result = GetEntity<T_PF_APPROVE>(null, filter, null);
|
||||||
|
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>
|
||||||
@ -959,7 +986,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
|
||||||
@ -1055,7 +1082,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.已归档;
|
||||||
|
|||||||
22
APT.Utility/HeadHelper.cs
Normal file
22
APT.Utility/HeadHelper.cs
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
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,5 +24,6 @@ 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