通知
This commit is contained in:
parent
6ba4ebeb87
commit
29cefe8d1e
96
APT.BaseData.Domain/Entities/PF/T_PF_NOTICE.cs
Normal file
96
APT.BaseData.Domain/Entities/PF/T_PF_NOTICE.cs
Normal file
@ -0,0 +1,96 @@
|
||||
using APT.BaseData.Domain.Entities.BD;
|
||||
using APT.BaseData.Domain.Enums.PF;
|
||||
using APT.Infrastructure.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
namespace APT.BaseData.Domain.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// 通知
|
||||
/// </summary>
|
||||
[Description("通知")]
|
||||
public partial class T_PF_NOTICE : MesEntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 标题
|
||||
/// </summary>
|
||||
[Description("标题")]
|
||||
[FormFieldEdit]
|
||||
[FormFieldTable]
|
||||
[FormFieldQuery]
|
||||
[DataFieldLength(300)]
|
||||
public string TITLE { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 通知内容
|
||||
/// </summary>
|
||||
[Description("通知内容")]
|
||||
[FormFieldEdit]
|
||||
[FormFieldTable]
|
||||
[FormFieldQuery]
|
||||
[DataFieldLength(2000)]
|
||||
public string CONTENT { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 附件
|
||||
/// </summary>
|
||||
[Description("附件")]
|
||||
public virtual ICollection<T_PF_NOTICE_FILE> Nav_Files { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 发布人
|
||||
/// </summary>
|
||||
[Description("发布人")]
|
||||
[FormFieldEdit]
|
||||
[FormFieldTable]
|
||||
[FormFieldQuery]
|
||||
[DataFieldLength(50)]
|
||||
public string CREATE_NAME { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 发布组织
|
||||
/// </summary>
|
||||
[Description("发布组织")]
|
||||
[FormFieldEdit]
|
||||
[FormFieldTable]
|
||||
[FormFieldQuery]
|
||||
[DataFieldLength(100)]
|
||||
public string CREATE_DEPARTMENT { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 发布组织
|
||||
/// </summary>
|
||||
[Description("发布组织")]
|
||||
[FormFieldEdit]
|
||||
[FormFieldTable]
|
||||
[FormFieldQuery]
|
||||
public Guid? DEPARTMENT_ID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 总部配置
|
||||
/// </summary>
|
||||
[Description("总部配置")]
|
||||
[FormFieldEdit]
|
||||
[FormFieldTable]
|
||||
[FormFieldQuery]
|
||||
public bool ISHEAD { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// 下发到子公司
|
||||
/// </summary>
|
||||
[Description("下发到子公司")]
|
||||
[FormFieldEdit]
|
||||
[FormFieldTable]
|
||||
[FormFieldQuery]
|
||||
public bool ISTOCHILE { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态
|
||||
/// </summary>
|
||||
[Description("状态")]
|
||||
[FormFieldTable]
|
||||
[FormFieldQuery]
|
||||
public PFStandardStatus STATUS { get; set; }
|
||||
}
|
||||
}
|
||||
39
APT.BaseData.Domain/Entities/PF/T_PF_NOTICE_FILE.cs
Normal file
39
APT.BaseData.Domain/Entities/PF/T_PF_NOTICE_FILE.cs
Normal file
@ -0,0 +1,39 @@
|
||||
using APT.Infrastructure.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace APT.BaseData.Domain.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// 通知附件
|
||||
/// </summary>
|
||||
public class T_PF_NOTICE_FILE : MesEntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 通知
|
||||
/// </summary>
|
||||
[Description("通知")]
|
||||
[DataFieldForeignKey("Nav_Notice", "Nav_Files")]
|
||||
public Guid NOTICE_ID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 通知
|
||||
/// </summary>
|
||||
[Description("通知")]
|
||||
public T_PF_NOTICE Nav_Notice { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 文件ID
|
||||
/// </summary>
|
||||
[Description("文件ID")]
|
||||
[DataFieldForeignKey("Nav_ImgFile")]
|
||||
public Guid IMG_FILE_ID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 导航属性:文件
|
||||
/// </summary>
|
||||
[Description("导航属性:文件")]
|
||||
public virtual T_PF_IMG_FILE Nav_ImgFile { get; set; }
|
||||
}
|
||||
}
|
||||
19
APT.BaseData.Domain/IServices/OP/IOPTenantDBConnService.cs
Normal file
19
APT.BaseData.Domain/IServices/OP/IOPTenantDBConnService.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using APT.BaseData.Domain.Entities.FM;
|
||||
using APT.Infrastructure.Api;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace APT.BaseData.Domain.IServices.OP
|
||||
{
|
||||
public interface IOPTenantDBConnService : ICommonService
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 获取 除 ORG_IDBeside 之外对应的数据库链接字典 ORG_ID DB_CONN
|
||||
/// </summary>
|
||||
/// <param name="ORG_IDBeside"></param>
|
||||
/// <returns></returns>
|
||||
Dictionary<Guid, string> GetConnDictionary(Guid? ORG_IDBeside);
|
||||
}
|
||||
}
|
||||
64
APT.BaseData.Services/Services/OP/OPTenantDBConnService.cs
Normal file
64
APT.BaseData.Services/Services/OP/OPTenantDBConnService.cs
Normal file
@ -0,0 +1,64 @@
|
||||
using APT.BaseData.Domain.Entities.FM;
|
||||
using APT.BaseData.Domain.Entities.OP;
|
||||
using APT.BaseData.Domain.Enums.OP;
|
||||
using APT.BaseData.Domain.IServices.OP;
|
||||
using APT.Infrastructure.Api;
|
||||
using APT.Infrastructure.Core;
|
||||
using APT.Migrations;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Net;
|
||||
|
||||
namespace APT.BaseData.Services.Services.OP
|
||||
{
|
||||
public class OPTenantDBConnService : CommonService, IOPTenantDBConnService
|
||||
{
|
||||
public OPTenantDBConnService(IRepository repository) : base(repository)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取 除 ORG_IDBeside 之外对应的数据库链接字典 ORG_ID DB_CONN
|
||||
/// </summary>
|
||||
/// <param name="ORG_IDBeside"></param>
|
||||
/// <returns></returns>
|
||||
public Dictionary<Guid, string> GetConnDictionary(Guid? ORG_IDBeside)
|
||||
{
|
||||
Dictionary<Guid, string> dicORGCONN = new Dictionary<Guid, string>();
|
||||
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;
|
||||
if (ORG_IDBeside.HasValue)
|
||||
{
|
||||
expression = expression.And(e => e.ID != ORG_IDBeside);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return dicORGCONN;
|
||||
}
|
||||
}
|
||||
}
|
||||
128725
APT.Data.Migrations/Migrations/20250923014551_wyw2025092301.Designer.cs
generated
Normal file
128725
APT.Data.Migrations/Migrations/20250923014551_wyw2025092301.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
117
APT.Data.Migrations/Migrations/20250923014551_wyw2025092301.cs
Normal file
117
APT.Data.Migrations/Migrations/20250923014551_wyw2025092301.cs
Normal file
@ -0,0 +1,117 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace APT.Data.Migrations.Migrations
|
||||
{
|
||||
public partial class wyw2025092301 : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "T_PF_NOTICE",
|
||||
columns: table => new
|
||||
{
|
||||
ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
TITLE = table.Column<string>(type: "nvarchar(300)", maxLength: 300, nullable: true),
|
||||
CONTENT = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: true),
|
||||
CREATE_NAME = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||||
CREATE_DEPARTMENT = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
|
||||
DEPARTMENT_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
ISHEAD = table.Column<bool>(type: "bit", nullable: false),
|
||||
ISTOCHILE = table.Column<bool>(type: "bit", nullable: false),
|
||||
IS_DELETED = table.Column<bool>(type: "bit", nullable: false),
|
||||
ORG_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
ENTITY_ORG_TPYE = table.Column<int>(type: "int", nullable: false),
|
||||
FORM_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
FLOW_STATUS = table.Column<int>(type: "int", nullable: false),
|
||||
FLOW_SEND_STATUS = table.Column<int>(type: "int", nullable: false),
|
||||
FLOW_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
CREATE_TIME = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
MODIFY_TIME = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
CREATER_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
MODIFIER_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_T_PF_NOTICE", x => x.ID);
|
||||
table.ForeignKey(
|
||||
name: "FK_T_PF_NOTICE_T_FM_ORGANIZATION_ORG_ID",
|
||||
column: x => x.ORG_ID,
|
||||
principalTable: "T_FM_ORGANIZATION",
|
||||
principalColumn: "ID",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "T_PF_NOTICE_FILE",
|
||||
columns: table => new
|
||||
{
|
||||
ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
NOTICE_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
IMG_FILE_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
IS_DELETED = table.Column<bool>(type: "bit", nullable: false),
|
||||
ORG_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
ENTITY_ORG_TPYE = table.Column<int>(type: "int", nullable: false),
|
||||
FORM_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
FLOW_STATUS = table.Column<int>(type: "int", nullable: false),
|
||||
FLOW_SEND_STATUS = table.Column<int>(type: "int", nullable: false),
|
||||
FLOW_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
CREATE_TIME = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
MODIFY_TIME = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
CREATER_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
MODIFIER_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_T_PF_NOTICE_FILE", x => x.ID);
|
||||
table.ForeignKey(
|
||||
name: "FK_T_PF_NOTICE_FILE_T_FM_ORGANIZATION_ORG_ID",
|
||||
column: x => x.ORG_ID,
|
||||
principalTable: "T_FM_ORGANIZATION",
|
||||
principalColumn: "ID",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "FK_T_PF_NOTICE_FILE_T_PF_IMG_FILE_IMG_FILE_ID",
|
||||
column: x => x.IMG_FILE_ID,
|
||||
principalTable: "T_PF_IMG_FILE",
|
||||
principalColumn: "ID",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "FK_T_PF_NOTICE_FILE_T_PF_NOTICE_NOTICE_ID",
|
||||
column: x => x.NOTICE_ID,
|
||||
principalTable: "T_PF_NOTICE",
|
||||
principalColumn: "ID",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_T_PF_NOTICE_ORG_ID",
|
||||
table: "T_PF_NOTICE",
|
||||
column: "ORG_ID");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_T_PF_NOTICE_FILE_IMG_FILE_ID",
|
||||
table: "T_PF_NOTICE_FILE",
|
||||
column: "IMG_FILE_ID");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_T_PF_NOTICE_FILE_NOTICE_ID",
|
||||
table: "T_PF_NOTICE_FILE",
|
||||
column: "NOTICE_ID");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_T_PF_NOTICE_FILE_ORG_ID",
|
||||
table: "T_PF_NOTICE_FILE",
|
||||
column: "ORG_ID");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "T_PF_NOTICE_FILE");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "T_PF_NOTICE");
|
||||
}
|
||||
}
|
||||
}
|
||||
128728
APT.Data.Migrations/Migrations/20250923024624_wyw2025092302.Designer.cs
generated
Normal file
128728
APT.Data.Migrations/Migrations/20250923024624_wyw2025092302.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 wyw2025092302 : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "STATUS",
|
||||
table: "T_PF_NOTICE",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "STATUS",
|
||||
table: "T_PF_NOTICE");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -15096,6 +15096,138 @@ namespace APT.Data.Migrations.Migrations
|
||||
b.ToTable("T_PF_MQTT_CONFIG_THEME");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("APT.BaseData.Domain.Entities.T_PF_NOTICE", b =>
|
||||
{
|
||||
b.Property<Guid>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("CONTENT")
|
||||
.HasMaxLength(2000)
|
||||
.HasColumnType("nvarchar(2000)");
|
||||
|
||||
b.Property<Guid?>("CREATER_ID")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("CREATE_DEPARTMENT")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<string>("CREATE_NAME")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<DateTime?>("CREATE_TIME")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("DEPARTMENT_ID")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<int>("ENTITY_ORG_TPYE")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<Guid?>("FLOW_ID")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<int>("FLOW_SEND_STATUS")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("FLOW_STATUS")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<Guid?>("FORM_ID")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<bool>("ISHEAD")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("ISTOCHILE")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IS_DELETED")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid?>("MODIFIER_ID")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime?>("MODIFY_TIME")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("ORG_ID")
|
||||
.IsRequired()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<int>("STATUS")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("TITLE")
|
||||
.HasMaxLength(300)
|
||||
.HasColumnType("nvarchar(300)");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("ORG_ID");
|
||||
|
||||
b.ToTable("T_PF_NOTICE");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("APT.BaseData.Domain.Entities.T_PF_NOTICE_FILE", b =>
|
||||
{
|
||||
b.Property<Guid>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("CREATER_ID")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime?>("CREATE_TIME")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("ENTITY_ORG_TPYE")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<Guid?>("FLOW_ID")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<int>("FLOW_SEND_STATUS")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("FLOW_STATUS")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<Guid?>("FORM_ID")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("IMG_FILE_ID")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<bool>("IS_DELETED")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid?>("MODIFIER_ID")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime?>("MODIFY_TIME")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("NOTICE_ID")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("ORG_ID")
|
||||
.IsRequired()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("IMG_FILE_ID");
|
||||
|
||||
b.HasIndex("NOTICE_ID");
|
||||
|
||||
b.HasIndex("ORG_ID");
|
||||
|
||||
b.ToTable("T_PF_NOTICE_FILE");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("APT.BaseData.Domain.Entities.T_PF_PAGE_CHART", b =>
|
||||
{
|
||||
b.Property<Guid>("ID")
|
||||
@ -96488,6 +96620,44 @@ namespace APT.Data.Migrations.Migrations
|
||||
b.Navigation("Nav_Org");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("APT.BaseData.Domain.Entities.T_PF_NOTICE", b =>
|
||||
{
|
||||
b.HasOne("APT.Infrastructure.Core.T_FM_ORGANIZATION", "Nav_Org")
|
||||
.WithMany()
|
||||
.HasForeignKey("ORG_ID")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Nav_Org");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("APT.BaseData.Domain.Entities.T_PF_NOTICE_FILE", b =>
|
||||
{
|
||||
b.HasOne("APT.BaseData.Domain.Entities.T_PF_IMG_FILE", "Nav_ImgFile")
|
||||
.WithMany()
|
||||
.HasForeignKey("IMG_FILE_ID")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("APT.BaseData.Domain.Entities.T_PF_NOTICE", "Nav_Notice")
|
||||
.WithMany("Nav_Files")
|
||||
.HasForeignKey("NOTICE_ID")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("APT.Infrastructure.Core.T_FM_ORGANIZATION", "Nav_Org")
|
||||
.WithMany()
|
||||
.HasForeignKey("ORG_ID")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Nav_ImgFile");
|
||||
|
||||
b.Navigation("Nav_Notice");
|
||||
|
||||
b.Navigation("Nav_Org");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("APT.BaseData.Domain.Entities.T_PF_PAGE_CHART", b =>
|
||||
{
|
||||
b.HasOne("APT.Infrastructure.Core.T_FM_ORGANIZATION", "Nav_Org")
|
||||
@ -126060,6 +126230,11 @@ namespace APT.Data.Migrations.Migrations
|
||||
b.Navigation("Nav_MqttConfigTheme");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("APT.BaseData.Domain.Entities.T_PF_NOTICE", b =>
|
||||
{
|
||||
b.Navigation("Nav_Files");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("APT.BaseData.Domain.Entities.T_PF_PAGE_CHART", b =>
|
||||
{
|
||||
b.Navigation("Nav_Params");
|
||||
|
||||
@ -15671,6 +15671,30 @@ builder.Property(t => t.REMARK).HasMaxLength(100);
|
||||
builder.HasOne(t => t.Nav_MqttConfig).WithMany(t=>t.Nav_MqttConfigTheme).HasForeignKey(t => t.MQTT_CONFIG_ID).OnDelete(DeleteBehavior.Restrict);
|
||||
builder.Property(t => t.NAME).HasMaxLength(20);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region Notice
|
||||
public partial class PFNoticeMap :APTEntityBaseMap<T_PF_NOTICE>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<T_PF_NOTICE> builder)
|
||||
{
|
||||
base.Configure(builder);
|
||||
builder.Property(t => t.TITLE).HasMaxLength(300);
|
||||
builder.Property(t => t.CONTENT).HasMaxLength(2000);
|
||||
builder.Property(t => t.CREATE_NAME).HasMaxLength(50);
|
||||
builder.Property(t => t.CREATE_DEPARTMENT).HasMaxLength(100);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region NoticeFile
|
||||
public partial class PFNoticeFileMap :APTEntityBaseMap<T_PF_NOTICE_FILE>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<T_PF_NOTICE_FILE> builder)
|
||||
{
|
||||
base.Configure(builder);
|
||||
builder.HasOne(t => t.Nav_Notice).WithMany(t=>t.Nav_Files).HasForeignKey(t => t.NOTICE_ID).OnDelete(DeleteBehavior.Restrict);
|
||||
builder.HasOne(t => t.Nav_ImgFile).WithMany().HasForeignKey(t => t.IMG_FILE_ID).OnDelete(DeleteBehavior.Restrict);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region PicFilter
|
||||
|
||||
@ -3,12 +3,12 @@ using APT.BaseData.Domain.IServices.BD;
|
||||
using APT.BaseData.Domain.IServices.BS;
|
||||
using APT.BaseData.Domain.IServices.EX;
|
||||
using APT.BaseData.Domain.IServices.FM;
|
||||
using APT.BaseData.Domain.IServices.OP;
|
||||
using APT.BaseData.Domain.IServices.Platform;
|
||||
using APT.BaseData.Services.DomainServices;
|
||||
using APT.BaseData.Services.Services.BD;
|
||||
using APT.BaseData.Services.Services.BS;
|
||||
using APT.BaseData.Services.Services.EX;
|
||||
using APT.BaseData.Services.Services.FM;
|
||||
using APT.BaseData.Services.Services.OP;
|
||||
using APT.BaseData.Services.Services.Platform;
|
||||
using APT.BaseData.Services.Sys;
|
||||
using Autofac;
|
||||
@ -50,6 +50,7 @@ namespace APT.PF.WebApi.App_Start
|
||||
builder.RegisterType<FMDepartmentService>().As<IFMDepartmentService>().InstancePerLifetimeScope();
|
||||
builder.RegisterType<FMAutoPrintRecordService>().As<IFMAutoPrintRecordService>().InstancePerLifetimeScope();
|
||||
builder.RegisterType<ExtConnConfigService>().As<IExtConnConfigService>().InstancePerLifetimeScope();
|
||||
builder.RegisterType<OPTenantDBConnService>().As<IOPTenantDBConnService>().InstancePerLifetimeScope();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,7 +14,7 @@ using APT.BaseData.Domain.Enums.OP;
|
||||
namespace APT.PF.WebApiControllers.Api.PF
|
||||
{
|
||||
[Route("api/PF/PFHomeTitle")]
|
||||
public class PFHomeTitleController : AuthorizeTreeApiController<T_PF_APPMENU>
|
||||
public class PFHomeTitleController : AuthorizeApiController<T_PF_HOME_TITLE>
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
|
||||
136
APT.MicroApi/APT.PF.WebApi/Controllers/Api/PFNoticeController.cs
Normal file
136
APT.MicroApi/APT.PF.WebApi/Controllers/Api/PFNoticeController.cs
Normal file
@ -0,0 +1,136 @@
|
||||
using APT.BaseData.Domain.Entities;
|
||||
using APT.BaseData.Domain.IServices;
|
||||
using APT.Infrastructure.Core;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using APT.Utility;
|
||||
using APT.Infrastructure.Api;
|
||||
using APT.Migrations;
|
||||
using APT.BaseData.Domain.Entities.OP;
|
||||
using APT.BaseData.Domain.Enums.OP;
|
||||
using APT.BaseData.Domain.Entities.FM;
|
||||
using APT.BaseData.Domain.IServices.OP;
|
||||
using APT.BaseData.Domain.Enums.PF;
|
||||
|
||||
namespace APT.PF.WebApiControllers.Api.PF
|
||||
{
|
||||
/// <summary>
|
||||
/// 通知
|
||||
/// </summary>
|
||||
[Route("api/PF/PFNotice")]
|
||||
public class PFNoticeController : AuthorizeApiController<T_PF_NOTICE>
|
||||
{
|
||||
IOPTenantDBConnService ConnService { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="connService"></param>
|
||||
public PFNoticeController(IOPTenantDBConnService connService)
|
||||
{
|
||||
ConnService = connService;
|
||||
}
|
||||
/// <summary>
|
||||
/// 更新或新增数据
|
||||
/// </summary>
|
||||
/// <param name="entity">对象实体</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost, Route("FullUpdate")]
|
||||
public JsonActionResult<bool> FullUpdate([FromBody] T_PF_NOTICE entity)
|
||||
{
|
||||
return SafeExecute(() =>
|
||||
{
|
||||
//如果是总部 同步修改 子公司
|
||||
var Files = entity.Nav_Files;
|
||||
entity.Nav_Files = null;
|
||||
entity.CREATER_ID = APT.Infrastructure.Api.AppContext.CurrentSession.UserID;
|
||||
|
||||
if (entity.CREATER_ID.HasValue)
|
||||
{
|
||||
var userLogin = GetEntity<T_FM_USER>(entity.CREATER_ID.Value, "Nav_Department");
|
||||
entity.CREATE_NAME = userLogin.NAME;//冗余赋值 给查看
|
||||
entity.DEPARTMENT_ID = userLogin.DEPARTMENT_ID;
|
||||
entity.CREATE_DEPARTMENT = userLogin.Nav_Department?.NAME;//冗余赋值 给子公司查看
|
||||
}
|
||||
|
||||
this.UnifiedCommit(() =>
|
||||
{
|
||||
UpdateEntityNoCommit(entity);
|
||||
if (Files != null && Files.Any())
|
||||
BantchSaveEntityNoCommit(Files);
|
||||
});
|
||||
|
||||
try
|
||||
{
|
||||
if (entity.ISTOCHILE && entity.STATUS == PFStandardStatus.Archived)
|
||||
{
|
||||
IEnumerable<T_PF_IMG_FILE> IlistImgs = null;
|
||||
List<T_PF_FILE> listFile = null;
|
||||
if (Files != null && Files.Count() > 0)
|
||||
{
|
||||
var listIMGIDS = Files.Select(e => e.IMG_FILE_ID);
|
||||
IlistImgs = GetEntities<T_PF_IMG_FILE>(e => listIMGIDS.Contains(e.ID), null, "Nav_File");
|
||||
listFile = new List<T_PF_FILE>();
|
||||
foreach (var item in IlistImgs)
|
||||
{
|
||||
listFile.Add(item.Nav_File);
|
||||
item.Nav_File = null;
|
||||
}
|
||||
}
|
||||
|
||||
Dictionary<Guid, string> dicORGCONN = ConnService.GetConnDictionary(entity.ORG_ID);
|
||||
entity.DEPARTMENT_ID = null; //组织清空 子公司不会有对应的ID 或者改为公司ID?
|
||||
foreach (var itemConn in dicORGCONN)
|
||||
{
|
||||
using (var context = new MigrationContext(itemConn.Value))
|
||||
{
|
||||
entity.ISHEAD = true;
|
||||
entity.ORG_ID = itemConn.Key;
|
||||
if (Files != null && Files.Any())
|
||||
{
|
||||
foreach (var item in Files)
|
||||
{
|
||||
item.ORG_ID = itemConn.Key;
|
||||
}
|
||||
foreach (var item in IlistImgs)
|
||||
{
|
||||
item.ORG_ID = itemConn.Key;
|
||||
}
|
||||
foreach (var item in listFile)
|
||||
{
|
||||
item.ORG_ID = itemConn.Key;
|
||||
}
|
||||
}
|
||||
try
|
||||
{
|
||||
context.AddEntity(entity);
|
||||
if (Files != null && Files.Any())
|
||||
{
|
||||
context.AddEntities(Files);
|
||||
context.AddEntities(IlistImgs);
|
||||
context.AddEntities(listFile);
|
||||
}
|
||||
context.SaveChanges();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
context.Update(entity);
|
||||
if (Files != null && Files.Any())
|
||||
{
|
||||
context.UpdateEntities(Files);
|
||||
context.UpdateEntities(IlistImgs);
|
||||
context.UpdateEntities(listFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
|
||||
return true;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2957,6 +2957,216 @@ using APT.BaseData.Domain.Entities.T4;
|
||||
return WitEntity(null, filter);
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
#region Notice-通知
|
||||
/// <summary>
|
||||
/// 通知
|
||||
/// </summary>
|
||||
[Route("api/PF/Notice")]
|
||||
public partial class NoticeController : AuthorizeApiController<T_PF_NOTICE>
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询所有数据
|
||||
/// </summary>
|
||||
/// <param name="filter">过滤实体</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost, Route("Entities")]
|
||||
public JsonActionResult<IEnumerable<T_PF_NOTICE>> Entities([FromBody]KeywordFilter filter)
|
||||
{
|
||||
return WitEntities(null, filter);
|
||||
}
|
||||
/// <summary>
|
||||
/// 排序查询所有数据
|
||||
/// </summary>
|
||||
/// <param name="filter">过滤实体</param>
|
||||
/// <returns></returns>
|
||||
|
||||
[HttpPost, Route("OrderEntities")]
|
||||
public JsonActionResult<IEnumerable<T_PF_NOTICE>> OrderEntities([FromBody]KeywordFilter filter)
|
||||
{
|
||||
return WitOrderEntities(null, filter);
|
||||
}
|
||||
/// <summary>
|
||||
/// 分页查询数据
|
||||
/// </summary>
|
||||
/// <param name="pageFilter">分页过滤实体</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost, Route("Paged")]
|
||||
public PagedActionResult<T_PF_NOTICE> Paged([FromBody]KeywordPageFilter pageFilter)
|
||||
{
|
||||
return WitPaged(null, pageFilter);
|
||||
}
|
||||
/// <summary>
|
||||
/// 排序分页查询数据
|
||||
/// </summary>
|
||||
/// <param name="pageFilter">分页过滤实体</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost, Route("OrderPaged")]
|
||||
public PagedActionResult<T_PF_NOTICE> OrderPaged([FromBody]KeywordPageFilter pageFilter)
|
||||
{
|
||||
return WitOrderPaged(null, pageFilter);
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据主键删除数据
|
||||
/// </summary>
|
||||
/// <param name="id">主键ID</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet, Route("Delete")]
|
||||
public JsonActionResult<bool> Delete(string id)
|
||||
{
|
||||
return WitRealDelete(id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新或新增数据
|
||||
/// </summary>
|
||||
/// <param name="entity">对象实体</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost, Route("Update")]
|
||||
public JsonActionResult<bool> Update([FromBody]T_PF_NOTICE entity)
|
||||
{
|
||||
return WitUpdate(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量更新
|
||||
/// </summary>
|
||||
/// <param name="entity">对象实体</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost, Route("BatchUpdate")]
|
||||
public JsonActionResult<bool> BatchUpdate([FromBody] BatchUpdateModel<T_PF_NOTICE> entity)
|
||||
{
|
||||
return WitBantchUpdate(entity?.Data);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量删除数据
|
||||
/// </summary>
|
||||
/// <param name="ids">id字符串(id用逗号分隔)</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet, Route("BatchDelete")]
|
||||
public JsonActionResult<bool> BatchDelete(string ids)
|
||||
{
|
||||
return WitRealBatchDelete(ids);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获得单条实体数据
|
||||
/// </summary>
|
||||
/// <param name="filter">过滤实体</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost, Route("Get")]
|
||||
public JsonActionResult<T_PF_NOTICE> Get([FromBody] KeywordFilter filter)
|
||||
{
|
||||
return WitEntity(null, filter);
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
#region NoticeFile-
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[Route("api/PF/NoticeFile")]
|
||||
public partial class NoticeFileController : AuthorizeApiController<T_PF_NOTICE_FILE>
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询所有数据
|
||||
/// </summary>
|
||||
/// <param name="filter">过滤实体</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost, Route("Entities")]
|
||||
public JsonActionResult<IEnumerable<T_PF_NOTICE_FILE>> Entities([FromBody]KeywordFilter filter)
|
||||
{
|
||||
return WitEntities(null, filter);
|
||||
}
|
||||
/// <summary>
|
||||
/// 排序查询所有数据
|
||||
/// </summary>
|
||||
/// <param name="filter">过滤实体</param>
|
||||
/// <returns></returns>
|
||||
|
||||
[HttpPost, Route("OrderEntities")]
|
||||
public JsonActionResult<IEnumerable<T_PF_NOTICE_FILE>> OrderEntities([FromBody]KeywordFilter filter)
|
||||
{
|
||||
return WitOrderEntities(null, filter);
|
||||
}
|
||||
/// <summary>
|
||||
/// 分页查询数据
|
||||
/// </summary>
|
||||
/// <param name="pageFilter">分页过滤实体</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost, Route("Paged")]
|
||||
public PagedActionResult<T_PF_NOTICE_FILE> Paged([FromBody]KeywordPageFilter pageFilter)
|
||||
{
|
||||
return WitPaged(null, pageFilter);
|
||||
}
|
||||
/// <summary>
|
||||
/// 排序分页查询数据
|
||||
/// </summary>
|
||||
/// <param name="pageFilter">分页过滤实体</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost, Route("OrderPaged")]
|
||||
public PagedActionResult<T_PF_NOTICE_FILE> OrderPaged([FromBody]KeywordPageFilter pageFilter)
|
||||
{
|
||||
return WitOrderPaged(null, pageFilter);
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据主键删除数据
|
||||
/// </summary>
|
||||
/// <param name="id">主键ID</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet, Route("Delete")]
|
||||
public JsonActionResult<bool> Delete(string id)
|
||||
{
|
||||
return WitRealDelete(id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新或新增数据
|
||||
/// </summary>
|
||||
/// <param name="entity">对象实体</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost, Route("Update")]
|
||||
public JsonActionResult<bool> Update([FromBody]T_PF_NOTICE_FILE entity)
|
||||
{
|
||||
return WitUpdate(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量更新
|
||||
/// </summary>
|
||||
/// <param name="entity">对象实体</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost, Route("BatchUpdate")]
|
||||
public JsonActionResult<bool> BatchUpdate([FromBody] BatchUpdateModel<T_PF_NOTICE_FILE> entity)
|
||||
{
|
||||
return WitBantchUpdate(entity?.Data);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量删除数据
|
||||
/// </summary>
|
||||
/// <param name="ids">id字符串(id用逗号分隔)</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet, Route("BatchDelete")]
|
||||
public JsonActionResult<bool> BatchDelete(string ids)
|
||||
{
|
||||
return WitRealBatchDelete(ids);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获得单条实体数据
|
||||
/// </summary>
|
||||
/// <param name="filter">过滤实体</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost, Route("Get")]
|
||||
public JsonActionResult<T_PF_NOTICE_FILE> Get([FromBody] KeywordFilter filter)
|
||||
{
|
||||
return WitEntity(null, filter);
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
#region PicFilter-图片条件主表
|
||||
|
||||
Loading…
Reference in New Issue
Block a user