菜单更新

This commit is contained in:
ChenYi 2025-12-01 12:00:51 +08:00
parent ff7e33a568
commit 2e66968e86
4 changed files with 695 additions and 30 deletions

View File

@ -4,7 +4,7 @@
"CorsOrigins": "https://*.IoT.com,http://localhost:4200,http://localhost:3100,http://localhost:80,http://10.10.90.3:4200" "CorsOrigins": "https://*.IoT.com,http://localhost:4200,http://localhost:3100,http://localhost:80,http://10.10.90.3:4200"
}, },
"ConnectionStrings": { "ConnectionStrings": {
"Default": "Data Source=192.168.111.174;Port=13306;Database=JiSheIoTProDB;uid=root;pwd=JiShe!aqG#5kGgh&0;charset=utf8mb4;Allow User Variables=true;AllowLoadLocalInfile=true;TreatTinyAsBoolean=false;SslMode=None;Pooling=true;" "Default": "Data Source=192.168.111.174;Port=13306;Database=JiSheIoTProDB2;uid=root;pwd=JiShe!aqG#5kGgh&0;charset=utf8mb4;Allow User Variables=true;AllowLoadLocalInfile=true;TreatTinyAsBoolean=false;SslMode=None;Pooling=true;"
}, },
"Hangfire": { "Hangfire": {
"Redis": { "Redis": {

View File

@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore;
namespace JiShe.IoT.Migrations namespace JiShe.IoT.Migrations
{ {
[DbContext(typeof(IoTDbContext))] [DbContext(typeof(IoTDbContext))]
[Migration("20251029012420_InitialCreate")] [Migration("20251201031653_InitialCreate")]
partial class InitialCreate partial class InitialCreate
{ {
/// <inheritdoc /> /// <inheritdoc />
@ -607,10 +607,14 @@ namespace JiShe.IoT.Migrations
.HasColumnType("int") .HasColumnType("int")
.HasComment("设备在线状态"); .HasComment("设备在线状态");
b.Property<int>("DeviceSourceTypeEnum") b.Property<int>("DeviceSource")
.HasColumnType("int") .HasColumnType("int")
.HasComment("设备来源类型"); .HasComment("设备来源类型");
b.Property<int>("DeviceType")
.HasColumnType("int")
.HasComment("设备类型,与业务系统无关,主要区分是网关设备、直连设备");
b.Property<string>("ExtraProperties") b.Property<string>("ExtraProperties")
.HasColumnType("longtext") .HasColumnType("longtext")
.HasColumnName("ExtraProperties") .HasColumnName("ExtraProperties")
@ -654,8 +658,8 @@ namespace JiShe.IoT.Migrations
.HasDefaultValue(false) .HasDefaultValue(false)
.HasColumnName("IsDeleted"); .HasColumnName("IsDeleted");
b.Property<bool>("IsPlatformPushSuccess") b.Property<sbyte>("IsPlatformPushSuccess")
.HasColumnType("bit(1)") .HasColumnType("tinyint(1)")
.HasComment("物联网平台推送是否成功"); .HasComment("物联网平台推送是否成功");
b.Property<DateTime?>("LastModificationTime") b.Property<DateTime?>("LastModificationTime")
@ -716,7 +720,266 @@ namespace JiShe.IoT.Migrations
}); });
}); });
modelBuilder.Entity("JiShe.ServicePro.DeviceManagement.ThingModelInfos.DeviceThingModelInfo", b => modelBuilder.Entity("JiShe.ServicePro.DeviceManagement.ThingModelInfos.DeviceThingModelDetailInfo", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.IsRequired()
.HasMaxLength(40)
.HasColumnType("varchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("char(36)")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime(6)")
.HasColumnName("DeletionTime");
b.Property<string>("DeviceRawFieldName")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64)")
.HasComment("设备端物模型属性或者事件名称");
b.Property<Guid>("DeviceThingModelId")
.HasColumnType("char(36)")
.HasComment("设备端物模型Id");
b.Property<string>("ExtraProperties")
.HasColumnType("longtext")
.HasColumnName("ExtraProperties")
.HasComment("扩展属性,用于存储自定义字段,JSON格式");
b.Property<string>("FiledType")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasComment("物联网平台中对应产品物模型属性或者事件类型");
b.Property<string>("IoTPlatformProductId")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasComment("物联网平台中对应的产品Id");
b.Property<string>("IoTPlatformRawFieldDataType")
.HasColumnType("longtext");
b.Property<string>("IoTPlatformRawFieldName")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64)")
.HasComment("物联网平台中对应的产品物模型属性或者事件名称");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit(1)")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<sbyte>("IsValueNeedConvert")
.HasColumnType("tinyint(1)")
.HasComment("是否需要值类型转换");
b.Property<string>("IssueCommand")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("varchar(256)")
.HasComment("下发指令");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("char(36)")
.HasColumnName("LastModifierId");
b.Property<int?>("OSACreatorId")
.HasColumnType("int")
.HasComment("旧系统授权创建者Id");
b.Property<int?>("OSADeleterId")
.HasColumnType("int")
.HasComment("旧系统授权最后删除者Id");
b.Property<int?>("OSALastModifierId")
.HasColumnType("int")
.HasComment("旧系统授权最后修改者Id");
b.Property<int>("ParsingSequence")
.HasColumnType("int")
.HasComment("解析顺序1234或者3412(高低位反转)");
b.Property<string>("Remark")
.HasColumnType("longtext")
.HasComment("备注");
b.Property<string>("StandardFieldDisplayName")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64)")
.HasComment("管理后台产品标准的物模型属性或者事件名称");
b.Property<string>("StandardFieldName")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64)")
.HasComment("管理后台产品标准的物模型属性或者事件名称");
b.Property<string>("StandardFieldValueType")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("varchar(20)")
.HasComment("标准物模型字段值类型");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)")
.HasColumnName("TenantId")
.HasComment("租户ID");
b.HasKey("Id");
b.HasIndex("CreationTime");
b.HasIndex("IoTPlatformProductId");
b.HasIndex(new[] { "Id", "IoTPlatformProductId", "IoTPlatformRawFieldName", "StandardFieldName", "CreationTime" }, "IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey")
.IsDescending();
b.ToTable("ServiceProDeviceThingModelDetailInfo", null, t =>
{
t.HasComment("设备端物模型详情信息");
});
});
modelBuilder.Entity("JiShe.ServicePro.DeviceManagement.ThingModelInfos.DeviceThingModelManagement", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.IsRequired()
.HasMaxLength(40)
.HasColumnType("varchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("char(36)")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime(6)")
.HasColumnName("DeletionTime");
b.Property<string>("DeviceModelName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasComment("设备端物模型名称");
b.Property<string>("ExtraProperties")
.HasColumnType("longtext")
.HasColumnName("ExtraProperties")
.HasComment("扩展属性,用于存储自定义字段,JSON格式");
b.Property<string>("FunctionScript")
.IsRequired()
.HasColumnType("text")
.HasComment("脚本函数体");
b.Property<int>("IoTPlatform")
.HasColumnType("int")
.HasComment("物联网平台类型,默认没有指定");
b.Property<string>("IoTPlatformProductId")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasComment("物联网平台中对应的产品Id");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit(1)")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("char(36)")
.HasColumnName("LastModifierId");
b.Property<int?>("OSACreatorId")
.HasColumnType("int")
.HasComment("旧系统授权创建者Id");
b.Property<int?>("OSADeleterId")
.HasColumnType("int")
.HasComment("旧系统授权最后删除者Id");
b.Property<int?>("OSALastModifierId")
.HasColumnType("int")
.HasComment("旧系统授权最后修改者Id");
b.Property<string>("Remark")
.HasColumnType("longtext")
.HasComment("备注");
b.Property<string>("ScriptName")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64)")
.HasComment("脚本函数名称");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)")
.HasColumnName("TenantId")
.HasComment("租户ID");
b.HasKey("Id");
b.HasIndex("CreationTime");
b.HasIndex("IoTPlatformProductId");
b.HasIndex(new[] { "Id", "DeviceModelName", "IoTPlatformProductId", "CreationTime" }, "IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey")
.IsDescending()
.HasDatabaseName("IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey1");
b.ToTable("ServiceProDeviceThingModelManagement", null, t =>
{
t.HasComment("设备端物模型管理");
});
});
modelBuilder.Entity("JiShe.ServicePro.DeviceManagement.ThingModelInfos.IoTPlatformThingModelInfo", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")
.HasColumnType("char(36)"); .HasColumnType("char(36)");
@ -834,12 +1097,13 @@ namespace JiShe.IoT.Migrations
b.HasIndex("IoTPlatformProductId"); b.HasIndex("IoTPlatformProductId");
b.HasIndex(new[] { "Id", "IoTPlatformProductId", "IoTPlatformRawFieldName", "StandardFieldName", "CreationTime" }, "IX_ServiceProDeviceThingModelInfo_IsNotUniqueKey") b.HasIndex(new[] { "Id", "IoTPlatformProductId", "IoTPlatformRawFieldName", "StandardFieldName", "CreationTime" }, "IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey")
.IsDescending(); .IsDescending()
.HasDatabaseName("IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey2");
b.ToTable("ServiceProDeviceThingModelInfo", null, t => b.ToTable("ServiceProIoTPlatformThingModelInfo", null, t =>
{ {
t.HasComment("设备物模型信息"); t.HasComment("平台端物模型信息");
}); });
}); });
@ -1687,6 +1951,9 @@ namespace JiShe.IoT.Migrations
.HasColumnName("TenantId") .HasColumnName("TenantId")
.HasComment("租户ID"); .HasComment("租户ID");
b.Property<string>("ThingModelInfos")
.HasColumnType("longtext");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("CreationTime"); b.HasIndex("CreationTime");

View File

@ -868,6 +868,7 @@ namespace JiShe.IoT.Migrations
DeviceAddress = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "设备地址") DeviceAddress = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "设备地址")
.Annotation("MySql:CharSet", "utf8mb4"), .Annotation("MySql:CharSet", "utf8mb4"),
IoTPlatform = table.Column<int>(type: "int", nullable: false, comment: "物联网平台类型,默认没有指定"), IoTPlatform = table.Column<int>(type: "int", nullable: false, comment: "物联网平台类型,默认没有指定"),
DeviceType = table.Column<int>(type: "int", nullable: false, comment: "设备类型,与业务系统无关,主要区分是网关设备、直连设备"),
IoTPlatformDeviceOpenInfo = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: false, comment: "物联网平台中对应的设备Id或者名称") IoTPlatformDeviceOpenInfo = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: false, comment: "物联网平台中对应的设备Id或者名称")
.Annotation("MySql:CharSet", "utf8mb4"), .Annotation("MySql:CharSet", "utf8mb4"),
PlatformPassword = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: false, comment: "物联网平台设备密码") PlatformPassword = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: false, comment: "物联网平台设备密码")
@ -882,11 +883,11 @@ namespace JiShe.IoT.Migrations
.Annotation("MySql:CharSet", "utf8mb4"), .Annotation("MySql:CharSet", "utf8mb4"),
IoTPlatformResponse = table.Column<string>(type: "text", nullable: true, comment: "物联网平台返回的响应信息") IoTPlatformResponse = table.Column<string>(type: "text", nullable: true, comment: "物联网平台返回的响应信息")
.Annotation("MySql:CharSet", "utf8mb4"), .Annotation("MySql:CharSet", "utf8mb4"),
IsPlatformPushSuccess = table.Column<bool>(type: "bit(1)", nullable: false, comment: "物联网平台推送是否成功"), IsPlatformPushSuccess = table.Column<sbyte>(type: "tinyint(1)", nullable: false, comment: "物联网平台推送是否成功"),
DeviceOnlineStatus = table.Column<int>(type: "int", nullable: true, comment: "设备在线状态"), DeviceOnlineStatus = table.Column<int>(type: "int", nullable: true, comment: "设备在线状态"),
LastOnlineTime = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "最后在线时间"), LastOnlineTime = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "最后在线时间"),
LastOfflineTime = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "最后离线时间"), LastOfflineTime = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "最后离线时间"),
DeviceSourceTypeEnum = table.Column<int>(type: "int", nullable: false, comment: "设备来源类型"), DeviceSource = table.Column<int>(type: "int", nullable: false, comment: "设备来源类型"),
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false) ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"), .Annotation("MySql:CharSet", "utf8mb4"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false), CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
@ -913,7 +914,97 @@ namespace JiShe.IoT.Migrations
.Annotation("MySql:CharSet", "utf8mb4"); .Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable( migrationBuilder.CreateTable(
name: "ServiceProDeviceThingModelInfo", name: "ServiceProDeviceThingModelDetailInfo",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
DeviceThingModelId = table.Column<Guid>(type: "char(36)", nullable: false, comment: "设备端物模型Id", collation: "ascii_general_ci"),
IoTPlatformProductId = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "物联网平台中对应的产品Id")
.Annotation("MySql:CharSet", "utf8mb4"),
FiledType = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "物联网平台中对应产品物模型属性或者事件类型")
.Annotation("MySql:CharSet", "utf8mb4"),
IoTPlatformRawFieldName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false, comment: "物联网平台中对应的产品物模型属性或者事件名称")
.Annotation("MySql:CharSet", "utf8mb4"),
IoTPlatformRawFieldDataType = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
StandardFieldName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false, comment: "管理后台产品标准的物模型属性或者事件名称")
.Annotation("MySql:CharSet", "utf8mb4"),
StandardFieldValueType = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: false, comment: "标准物模型字段值类型")
.Annotation("MySql:CharSet", "utf8mb4"),
StandardFieldDisplayName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false, comment: "管理后台产品标准的物模型属性或者事件名称")
.Annotation("MySql:CharSet", "utf8mb4"),
IsValueNeedConvert = table.Column<sbyte>(type: "tinyint(1)", nullable: false, comment: "是否需要值类型转换"),
DeviceRawFieldName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false, comment: "设备端物模型属性或者事件名称")
.Annotation("MySql:CharSet", "utf8mb4"),
IssueCommand = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: false, comment: "下发指令")
.Annotation("MySql:CharSet", "utf8mb4"),
ParsingSequence = table.Column<int>(type: "int", nullable: false, comment: "解析顺序1234或者3412(高低位反转)"),
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
IsDeleted = table.Column<bool>(type: "bit(1)", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
DeletionTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
TenantId = table.Column<Guid>(type: "char(36)", nullable: true, comment: "租户ID", collation: "ascii_general_ci"),
Remark = table.Column<string>(type: "longtext", nullable: true, comment: "备注")
.Annotation("MySql:CharSet", "utf8mb4"),
OSACreatorId = table.Column<int>(type: "int", nullable: true, comment: "旧系统授权创建者Id"),
OSALastModifierId = table.Column<int>(type: "int", nullable: true, comment: "旧系统授权最后修改者Id"),
OSADeleterId = table.Column<int>(type: "int", nullable: true, comment: "旧系统授权最后删除者Id"),
ExtraProperties = table.Column<string>(type: "longtext", nullable: true, comment: "扩展属性,用于存储自定义字段,JSON格式")
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_ServiceProDeviceThingModelDetailInfo", x => x.Id);
},
comment: "设备端物模型详情信息")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "ServiceProDeviceThingModelManagement",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
DeviceModelName = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "设备端物模型名称")
.Annotation("MySql:CharSet", "utf8mb4"),
IoTPlatform = table.Column<int>(type: "int", nullable: false, comment: "物联网平台类型,默认没有指定"),
IoTPlatformProductId = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "物联网平台中对应的产品Id")
.Annotation("MySql:CharSet", "utf8mb4"),
ScriptName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false, comment: "脚本函数名称")
.Annotation("MySql:CharSet", "utf8mb4"),
FunctionScript = table.Column<string>(type: "text", nullable: false, comment: "脚本函数体")
.Annotation("MySql:CharSet", "utf8mb4"),
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
IsDeleted = table.Column<bool>(type: "bit(1)", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
DeletionTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
TenantId = table.Column<Guid>(type: "char(36)", nullable: true, comment: "租户ID", collation: "ascii_general_ci"),
Remark = table.Column<string>(type: "longtext", nullable: true, comment: "备注")
.Annotation("MySql:CharSet", "utf8mb4"),
OSACreatorId = table.Column<int>(type: "int", nullable: true, comment: "旧系统授权创建者Id"),
OSALastModifierId = table.Column<int>(type: "int", nullable: true, comment: "旧系统授权最后修改者Id"),
OSADeleterId = table.Column<int>(type: "int", nullable: true, comment: "旧系统授权最后删除者Id"),
ExtraProperties = table.Column<string>(type: "longtext", nullable: true, comment: "扩展属性,用于存储自定义字段,JSON格式")
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_ServiceProDeviceThingModelManagement", x => x.Id);
},
comment: "设备端物模型管理")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "ServiceProIoTPlatformThingModelInfo",
columns: table => new columns: table => new
{ {
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
@ -951,9 +1042,9 @@ namespace JiShe.IoT.Migrations
}, },
constraints: table => constraints: table =>
{ {
table.PrimaryKey("PK_ServiceProDeviceThingModelInfo", x => x.Id); table.PrimaryKey("PK_ServiceProIoTPlatformThingModelInfo", x => x.Id);
}, },
comment: "设备物模型信息") comment: "平台端物模型信息")
.Annotation("MySql:CharSet", "utf8mb4"); .Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable( migrationBuilder.CreateTable(
@ -1085,6 +1176,8 @@ namespace JiShe.IoT.Migrations
.Annotation("MySql:CharSet", "utf8mb4"), .Annotation("MySql:CharSet", "utf8mb4"),
CommunicationAddressTLS = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true, comment: "TLS通讯服务地址") CommunicationAddressTLS = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true, comment: "TLS通讯服务地址")
.Annotation("MySql:CharSet", "utf8mb4"), .Annotation("MySql:CharSet", "utf8mb4"),
ThingModelInfos = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false) ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"), .Annotation("MySql:CharSet", "utf8mb4"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false), CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
@ -1781,18 +1874,50 @@ namespace JiShe.IoT.Migrations
descending: new bool[0]); descending: new bool[0]);
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_ServiceProDeviceThingModelInfo_CreationTime", name: "IX_ServiceProDeviceThingModelDetailInfo_CreationTime",
table: "ServiceProDeviceThingModelInfo", table: "ServiceProDeviceThingModelDetailInfo",
column: "CreationTime"); column: "CreationTime");
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_ServiceProDeviceThingModelInfo_IoTPlatformProductId", name: "IX_ServiceProDeviceThingModelDetailInfo_IoTPlatformProductId",
table: "ServiceProDeviceThingModelInfo", table: "ServiceProDeviceThingModelDetailInfo",
column: "IoTPlatformProductId"); column: "IoTPlatformProductId");
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_ServiceProDeviceThingModelInfo_IsNotUniqueKey", name: "IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey",
table: "ServiceProDeviceThingModelInfo", table: "ServiceProDeviceThingModelDetailInfo",
columns: new[] { "Id", "IoTPlatformProductId", "IoTPlatformRawFieldName", "StandardFieldName", "CreationTime" },
descending: new bool[0]);
migrationBuilder.CreateIndex(
name: "IX_ServiceProDeviceThingModelManagement_CreationTime",
table: "ServiceProDeviceThingModelManagement",
column: "CreationTime");
migrationBuilder.CreateIndex(
name: "IX_ServiceProDeviceThingModelManagement_IoTPlatformProductId",
table: "ServiceProDeviceThingModelManagement",
column: "IoTPlatformProductId");
migrationBuilder.CreateIndex(
name: "IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey1",
table: "ServiceProDeviceThingModelManagement",
columns: new[] { "Id", "DeviceModelName", "IoTPlatformProductId", "CreationTime" },
descending: new bool[0]);
migrationBuilder.CreateIndex(
name: "IX_ServiceProIoTPlatformThingModelInfo_CreationTime",
table: "ServiceProIoTPlatformThingModelInfo",
column: "CreationTime");
migrationBuilder.CreateIndex(
name: "IX_ServiceProIoTPlatformThingModelInfo_IoTPlatformProductId",
table: "ServiceProIoTPlatformThingModelInfo",
column: "IoTPlatformProductId");
migrationBuilder.CreateIndex(
name: "IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey2",
table: "ServiceProIoTPlatformThingModelInfo",
columns: new[] { "Id", "IoTPlatformProductId", "IoTPlatformRawFieldName", "StandardFieldName", "CreationTime" }, columns: new[] { "Id", "IoTPlatformProductId", "IoTPlatformRawFieldName", "StandardFieldName", "CreationTime" },
descending: new bool[0]); descending: new bool[0]);
@ -1954,7 +2079,13 @@ namespace JiShe.IoT.Migrations
name: "ServiceProDeviceInfo"); name: "ServiceProDeviceInfo");
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "ServiceProDeviceThingModelInfo"); name: "ServiceProDeviceThingModelDetailInfo");
migrationBuilder.DropTable(
name: "ServiceProDeviceThingModelManagement");
migrationBuilder.DropTable(
name: "ServiceProIoTPlatformThingModelInfo");
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "ServiceProMenus"); name: "ServiceProMenus");

View File

@ -604,10 +604,14 @@ namespace JiShe.IoT.Migrations
.HasColumnType("int") .HasColumnType("int")
.HasComment("设备在线状态"); .HasComment("设备在线状态");
b.Property<int>("DeviceSourceTypeEnum") b.Property<int>("DeviceSource")
.HasColumnType("int") .HasColumnType("int")
.HasComment("设备来源类型"); .HasComment("设备来源类型");
b.Property<int>("DeviceType")
.HasColumnType("int")
.HasComment("设备类型,与业务系统无关,主要区分是网关设备、直连设备");
b.Property<string>("ExtraProperties") b.Property<string>("ExtraProperties")
.HasColumnType("longtext") .HasColumnType("longtext")
.HasColumnName("ExtraProperties") .HasColumnName("ExtraProperties")
@ -651,8 +655,8 @@ namespace JiShe.IoT.Migrations
.HasDefaultValue(false) .HasDefaultValue(false)
.HasColumnName("IsDeleted"); .HasColumnName("IsDeleted");
b.Property<bool>("IsPlatformPushSuccess") b.Property<sbyte>("IsPlatformPushSuccess")
.HasColumnType("bit(1)") .HasColumnType("tinyint(1)")
.HasComment("物联网平台推送是否成功"); .HasComment("物联网平台推送是否成功");
b.Property<DateTime?>("LastModificationTime") b.Property<DateTime?>("LastModificationTime")
@ -713,7 +717,266 @@ namespace JiShe.IoT.Migrations
}); });
}); });
modelBuilder.Entity("JiShe.ServicePro.DeviceManagement.ThingModelInfos.DeviceThingModelInfo", b => modelBuilder.Entity("JiShe.ServicePro.DeviceManagement.ThingModelInfos.DeviceThingModelDetailInfo", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.IsRequired()
.HasMaxLength(40)
.HasColumnType("varchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("char(36)")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime(6)")
.HasColumnName("DeletionTime");
b.Property<string>("DeviceRawFieldName")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64)")
.HasComment("设备端物模型属性或者事件名称");
b.Property<Guid>("DeviceThingModelId")
.HasColumnType("char(36)")
.HasComment("设备端物模型Id");
b.Property<string>("ExtraProperties")
.HasColumnType("longtext")
.HasColumnName("ExtraProperties")
.HasComment("扩展属性,用于存储自定义字段,JSON格式");
b.Property<string>("FiledType")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasComment("物联网平台中对应产品物模型属性或者事件类型");
b.Property<string>("IoTPlatformProductId")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasComment("物联网平台中对应的产品Id");
b.Property<string>("IoTPlatformRawFieldDataType")
.HasColumnType("longtext");
b.Property<string>("IoTPlatformRawFieldName")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64)")
.HasComment("物联网平台中对应的产品物模型属性或者事件名称");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit(1)")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<sbyte>("IsValueNeedConvert")
.HasColumnType("tinyint(1)")
.HasComment("是否需要值类型转换");
b.Property<string>("IssueCommand")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("varchar(256)")
.HasComment("下发指令");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("char(36)")
.HasColumnName("LastModifierId");
b.Property<int?>("OSACreatorId")
.HasColumnType("int")
.HasComment("旧系统授权创建者Id");
b.Property<int?>("OSADeleterId")
.HasColumnType("int")
.HasComment("旧系统授权最后删除者Id");
b.Property<int?>("OSALastModifierId")
.HasColumnType("int")
.HasComment("旧系统授权最后修改者Id");
b.Property<int>("ParsingSequence")
.HasColumnType("int")
.HasComment("解析顺序1234或者3412(高低位反转)");
b.Property<string>("Remark")
.HasColumnType("longtext")
.HasComment("备注");
b.Property<string>("StandardFieldDisplayName")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64)")
.HasComment("管理后台产品标准的物模型属性或者事件名称");
b.Property<string>("StandardFieldName")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64)")
.HasComment("管理后台产品标准的物模型属性或者事件名称");
b.Property<string>("StandardFieldValueType")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("varchar(20)")
.HasComment("标准物模型字段值类型");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)")
.HasColumnName("TenantId")
.HasComment("租户ID");
b.HasKey("Id");
b.HasIndex("CreationTime");
b.HasIndex("IoTPlatformProductId");
b.HasIndex(new[] { "Id", "IoTPlatformProductId", "IoTPlatformRawFieldName", "StandardFieldName", "CreationTime" }, "IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey")
.IsDescending();
b.ToTable("ServiceProDeviceThingModelDetailInfo", null, t =>
{
t.HasComment("设备端物模型详情信息");
});
});
modelBuilder.Entity("JiShe.ServicePro.DeviceManagement.ThingModelInfos.DeviceThingModelManagement", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.IsRequired()
.HasMaxLength(40)
.HasColumnType("varchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("char(36)")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime(6)")
.HasColumnName("DeletionTime");
b.Property<string>("DeviceModelName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasComment("设备端物模型名称");
b.Property<string>("ExtraProperties")
.HasColumnType("longtext")
.HasColumnName("ExtraProperties")
.HasComment("扩展属性,用于存储自定义字段,JSON格式");
b.Property<string>("FunctionScript")
.IsRequired()
.HasColumnType("text")
.HasComment("脚本函数体");
b.Property<int>("IoTPlatform")
.HasColumnType("int")
.HasComment("物联网平台类型,默认没有指定");
b.Property<string>("IoTPlatformProductId")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasComment("物联网平台中对应的产品Id");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit(1)")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("char(36)")
.HasColumnName("LastModifierId");
b.Property<int?>("OSACreatorId")
.HasColumnType("int")
.HasComment("旧系统授权创建者Id");
b.Property<int?>("OSADeleterId")
.HasColumnType("int")
.HasComment("旧系统授权最后删除者Id");
b.Property<int?>("OSALastModifierId")
.HasColumnType("int")
.HasComment("旧系统授权最后修改者Id");
b.Property<string>("Remark")
.HasColumnType("longtext")
.HasComment("备注");
b.Property<string>("ScriptName")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64)")
.HasComment("脚本函数名称");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)")
.HasColumnName("TenantId")
.HasComment("租户ID");
b.HasKey("Id");
b.HasIndex("CreationTime");
b.HasIndex("IoTPlatformProductId");
b.HasIndex(new[] { "Id", "DeviceModelName", "IoTPlatformProductId", "CreationTime" }, "IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey")
.IsDescending()
.HasDatabaseName("IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey1");
b.ToTable("ServiceProDeviceThingModelManagement", null, t =>
{
t.HasComment("设备端物模型管理");
});
});
modelBuilder.Entity("JiShe.ServicePro.DeviceManagement.ThingModelInfos.IoTPlatformThingModelInfo", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")
.HasColumnType("char(36)"); .HasColumnType("char(36)");
@ -831,12 +1094,13 @@ namespace JiShe.IoT.Migrations
b.HasIndex("IoTPlatformProductId"); b.HasIndex("IoTPlatformProductId");
b.HasIndex(new[] { "Id", "IoTPlatformProductId", "IoTPlatformRawFieldName", "StandardFieldName", "CreationTime" }, "IX_ServiceProDeviceThingModelInfo_IsNotUniqueKey") b.HasIndex(new[] { "Id", "IoTPlatformProductId", "IoTPlatformRawFieldName", "StandardFieldName", "CreationTime" }, "IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey")
.IsDescending(); .IsDescending()
.HasDatabaseName("IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey2");
b.ToTable("ServiceProDeviceThingModelInfo", null, t => b.ToTable("ServiceProIoTPlatformThingModelInfo", null, t =>
{ {
t.HasComment("设备物模型信息"); t.HasComment("平台端物模型信息");
}); });
}); });
@ -1684,6 +1948,9 @@ namespace JiShe.IoT.Migrations
.HasColumnName("TenantId") .HasColumnName("TenantId")
.HasComment("租户ID"); .HasComment("租户ID");
b.Property<string>("ThingModelInfos")
.HasColumnType("longtext");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("CreationTime"); b.HasIndex("CreationTime");