设备物模型指令

This commit is contained in:
ChenYi 2025-12-04 17:28:30 +08:00
parent 0e2ad4c2d3
commit 4a3df734ed
5 changed files with 542 additions and 90 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{ {
"ConnectionStrings": { "ConnectionStrings": {
"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;" "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;"
}, },
"IoTDBOptions": { "IoTDBOptions": {
"UserName": "root", "UserName": "root",

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("20251202092656_InitialCreate")] [Migration("20251204073801_InitialCreate")]
partial class InitialCreate partial class InitialCreate
{ {
/// <inheritdoc /> /// <inheritdoc />
@ -611,6 +611,10 @@ namespace JiShe.IoT.Migrations
.HasColumnType("int") .HasColumnType("int")
.HasComment("设备来源类型"); .HasComment("设备来源类型");
b.Property<Guid?>("DeviceThingModelDataId")
.HasColumnType("char(36)")
.HasComment("设备物模型数据Id");
b.Property<int>("DeviceType") b.Property<int>("DeviceType")
.HasColumnType("int") .HasColumnType("int")
.HasComment("设备类型,与业务系统无关,主要区分是网关设备、直连设备"); .HasComment("设备类型,与业务系统无关,主要区分是网关设备、直连设备");
@ -658,6 +662,10 @@ namespace JiShe.IoT.Migrations
.HasDefaultValue(false) .HasDefaultValue(false)
.HasColumnName("IsDeleted"); .HasColumnName("IsDeleted");
b.Property<bool>("IsNeedConfigDevicMdoel")
.HasColumnType("bit(1)")
.HasComment("是否需要配置设备模型");
b.Property<sbyte>("IsPlatformPushSuccess") b.Property<sbyte>("IsPlatformPushSuccess")
.HasColumnType("tinyint(1)") .HasColumnType("tinyint(1)")
.HasComment("物联网平台推送是否成功"); .HasComment("物联网平台推送是否成功");
@ -720,6 +728,121 @@ namespace JiShe.IoT.Migrations
}); });
}); });
modelBuilder.Entity("JiShe.ServicePro.DeviceManagement.ThingModelInfos.DeviceThingModelCommandInfo", b =>
{
b.Property<Guid>("Id")
.HasColumnType("char(36)");
b.Property<string>("CommandName")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("varchar(256)")
.HasComment("指令名称");
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<Guid>("DeviceThingModelId")
.HasColumnType("char(36)")
.HasComment("设备端物模型Id");
b.Property<string>("ExtraProperties")
.HasColumnType("longtext")
.HasColumnName("ExtraProperties")
.HasComment("扩展属性,用于存储自定义字段,JSON格式");
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<string>("IssueCommand")
.IsRequired()
.HasMaxLength(512)
.HasColumnType("varchar(512)")
.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<string>("PropertyArray")
.IsRequired()
.HasMaxLength(1024)
.HasColumnType("varchar(1024)")
.HasComment("指令设备端物模型的属性名称集合,JSON格式字符串数组");
b.Property<string>("Remark")
.HasColumnType("longtext")
.HasComment("备注");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)")
.HasColumnName("TenantId")
.HasComment("租户ID");
b.HasKey("Id");
b.HasIndex("CreationTime");
b.HasIndex("DeviceThingModelId");
b.HasIndex(new[] { "Id", "DeviceThingModelId", "IoTPlatformProductId", "CreationTime" }, "IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey")
.IsDescending();
b.ToTable("ServiceProDeviceThingModelCommandInfo", null, t =>
{
t.HasComment("设备端透传指令详情");
});
});
modelBuilder.Entity("JiShe.ServicePro.DeviceManagement.ThingModelInfos.DeviceThingModelDetailInfo", b => modelBuilder.Entity("JiShe.ServicePro.DeviceManagement.ThingModelInfos.DeviceThingModelDetailInfo", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")
@ -748,12 +871,6 @@ namespace JiShe.IoT.Migrations
.HasColumnType("datetime(6)") .HasColumnType("datetime(6)")
.HasColumnName("DeletionTime"); .HasColumnName("DeletionTime");
b.Property<string>("DeviceRawFieldName")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64)")
.HasComment("设备端物模型属性或者事件名称");
b.Property<Guid>("DeviceThingModelId") b.Property<Guid>("DeviceThingModelId")
.HasColumnType("char(36)") .HasColumnType("char(36)")
.HasComment("设备端物模型Id"); .HasComment("设备端物模型Id");
@ -769,6 +886,10 @@ namespace JiShe.IoT.Migrations
.HasColumnType("varchar(50)") .HasColumnType("varchar(50)")
.HasComment("物联网平台中对应产品物模型属性或者事件类型"); .HasComment("物联网平台中对应产品物模型属性或者事件类型");
b.Property<int>("IoTPlatform")
.HasColumnType("int")
.HasComment("物联网平台类型");
b.Property<string>("IoTPlatformProductId") b.Property<string>("IoTPlatformProductId")
.IsRequired() .IsRequired()
.HasMaxLength(50) .HasMaxLength(50)
@ -776,7 +897,10 @@ namespace JiShe.IoT.Migrations
.HasComment("物联网平台中对应的产品Id"); .HasComment("物联网平台中对应的产品Id");
b.Property<string>("IoTPlatformRawFieldDataType") b.Property<string>("IoTPlatformRawFieldDataType")
.HasColumnType("longtext"); .IsRequired()
.HasMaxLength(20)
.HasColumnType("varchar(20)")
.HasComment("物联网平台中对应的产品物模型属性或者事件数据类型");
b.Property<string>("IoTPlatformRawFieldName") b.Property<string>("IoTPlatformRawFieldName")
.IsRequired() .IsRequired()
@ -794,12 +918,6 @@ namespace JiShe.IoT.Migrations
.HasColumnType("tinyint(1)") .HasColumnType("tinyint(1)")
.HasComment("是否需要值类型转换"); .HasComment("是否需要值类型转换");
b.Property<string>("IssueCommand")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("varchar(256)")
.HasComment("下发指令");
b.Property<DateTime?>("LastModificationTime") b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)") .HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime"); .HasColumnName("LastModificationTime");
@ -820,14 +938,14 @@ namespace JiShe.IoT.Migrations
.HasColumnType("int") .HasColumnType("int")
.HasComment("旧系统授权最后修改者Id"); .HasComment("旧系统授权最后修改者Id");
b.Property<int>("ParsingSequence")
.HasColumnType("int")
.HasComment("解析顺序1234或者3412(高低位反转)");
b.Property<string>("Remark") b.Property<string>("Remark")
.HasColumnType("longtext") .HasColumnType("longtext")
.HasComment("备注"); .HasComment("备注");
b.Property<int>("SkipNumber")
.HasColumnType("int")
.HasComment("跳过数量");
b.Property<string>("StandardFieldDisplayName") b.Property<string>("StandardFieldDisplayName")
.IsRequired() .IsRequired()
.HasMaxLength(64) .HasMaxLength(64)
@ -846,6 +964,10 @@ namespace JiShe.IoT.Migrations
.HasColumnType("varchar(20)") .HasColumnType("varchar(20)")
.HasComment("标准物模型字段值类型"); .HasComment("标准物模型字段值类型");
b.Property<int>("TakeNumber")
.HasColumnType("int")
.HasComment("获取数量");
b.Property<Guid?>("TenantId") b.Property<Guid?>("TenantId")
.HasColumnType("char(36)") .HasColumnType("char(36)")
.HasColumnName("TenantId") .HasColumnName("TenantId")
@ -858,11 +980,12 @@ namespace JiShe.IoT.Migrations
b.HasIndex("IoTPlatformProductId"); b.HasIndex("IoTPlatformProductId");
b.HasIndex(new[] { "Id", "IoTPlatformProductId", "IoTPlatformRawFieldName", "StandardFieldName", "CreationTime" }, "IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey") b.HasIndex(new[] { "Id", "IoTPlatformProductId", "IoTPlatformRawFieldName", "StandardFieldName", "CreationTime" }, "IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey")
.IsDescending(); .IsDescending()
.HasDatabaseName("IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey1");
b.ToTable("ServiceProDeviceThingModelDetailInfo", null, t => b.ToTable("ServiceProDeviceThingModelDetailInfo", null, t =>
{ {
t.HasComment("设备端物模型详情信息"); t.HasComment("设备端物模型详情信息,是指设备端支持的属性或者事件");
}); });
}); });
@ -946,6 +1069,10 @@ namespace JiShe.IoT.Migrations
.HasColumnType("int") .HasColumnType("int")
.HasComment("旧系统授权最后修改者Id"); .HasComment("旧系统授权最后修改者Id");
b.Property<int>("ParsingSequence")
.HasColumnType("int")
.HasComment("解析顺序1234或者3412(高低位反转)");
b.Property<string>("Remark") b.Property<string>("Remark")
.HasColumnType("longtext") .HasColumnType("longtext")
.HasComment("备注"); .HasComment("备注");
@ -969,7 +1096,7 @@ namespace JiShe.IoT.Migrations
b.HasIndex(new[] { "Id", "DeviceModelName", "IoTPlatformProductId", "CreationTime" }, "IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey") b.HasIndex(new[] { "Id", "DeviceModelName", "IoTPlatformProductId", "CreationTime" }, "IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey")
.IsDescending() .IsDescending()
.HasDatabaseName("IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey1"); .HasDatabaseName("IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey2");
b.ToTable("ServiceProDeviceThingModelManagement", null, t => b.ToTable("ServiceProDeviceThingModelManagement", null, t =>
{ {
@ -1097,7 +1224,7 @@ namespace JiShe.IoT.Migrations
b.HasIndex(new[] { "Id", "IoTPlatformProductId", "IoTPlatformRawFieldName", "StandardFieldName", "CreationTime" }, "IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey") b.HasIndex(new[] { "Id", "IoTPlatformProductId", "IoTPlatformRawFieldName", "StandardFieldName", "CreationTime" }, "IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey")
.IsDescending() .IsDescending()
.HasDatabaseName("IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey2"); .HasDatabaseName("IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey3");
b.ToTable("ServiceProIoTPlatformThingModelInfo", null, t => b.ToTable("ServiceProIoTPlatformThingModelInfo", null, t =>
{ {

View File

@ -888,6 +888,8 @@ namespace JiShe.IoT.Migrations
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: "最后离线时间"),
DeviceSource = table.Column<int>(type: "int", nullable: false, comment: "设备来源类型"), DeviceSource = table.Column<int>(type: "int", nullable: false, comment: "设备来源类型"),
IsNeedConfigDevicMdoel = table.Column<bool>(type: "bit(1)", nullable: false, comment: "是否需要配置设备模型"),
DeviceThingModelDataId = table.Column<Guid>(type: "char(36)", nullable: true, comment: "设备物模型数据Id", collation: "ascii_general_ci"),
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,19 +915,60 @@ namespace JiShe.IoT.Migrations
comment: "设备信息") comment: "设备信息")
.Annotation("MySql:CharSet", "utf8mb4"); .Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "ServiceProDeviceThingModelCommandInfo",
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"),
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"),
CommandName = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: false, comment: "指令名称")
.Annotation("MySql:CharSet", "utf8mb4"),
IssueCommand = table.Column<string>(type: "varchar(512)", maxLength: 512, nullable: false, comment: "完整的单个下发指令")
.Annotation("MySql:CharSet", "utf8mb4"),
PropertyArray = table.Column<string>(type: "varchar(1024)", maxLength: 1024, nullable: false, comment: "指令设备端物模型的属性名称集合,JSON格式字符串数组")
.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_ServiceProDeviceThingModelCommandInfo", x => x.Id);
},
comment: "设备端透传指令详情")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable( migrationBuilder.CreateTable(
name: "ServiceProDeviceThingModelDetailInfo", name: "ServiceProDeviceThingModelDetailInfo",
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"),
DeviceThingModelId = table.Column<Guid>(type: "char(36)", nullable: false, comment: "设备端物模型Id", collation: "ascii_general_ci"), DeviceThingModelId = table.Column<Guid>(type: "char(36)", nullable: false, comment: "设备端物模型Id", collation: "ascii_general_ci"),
IoTPlatform = table.Column<int>(type: "int", nullable: false, comment: "物联网平台类型"),
IoTPlatformProductId = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "物联网平台中对应的产品Id") IoTPlatformProductId = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "物联网平台中对应的产品Id")
.Annotation("MySql:CharSet", "utf8mb4"), .Annotation("MySql:CharSet", "utf8mb4"),
FiledType = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "物联网平台中对应产品物模型属性或者事件类型") FiledType = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "物联网平台中对应产品物模型属性或者事件类型")
.Annotation("MySql:CharSet", "utf8mb4"), .Annotation("MySql:CharSet", "utf8mb4"),
IoTPlatformRawFieldName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false, comment: "物联网平台中对应的产品物模型属性或者事件名称") IoTPlatformRawFieldName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false, comment: "物联网平台中对应的产品物模型属性或者事件名称")
.Annotation("MySql:CharSet", "utf8mb4"), .Annotation("MySql:CharSet", "utf8mb4"),
IoTPlatformRawFieldDataType = table.Column<string>(type: "longtext", nullable: true) IoTPlatformRawFieldDataType = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: false, comment: "物联网平台中对应的产品物模型属性或者事件数据类型")
.Annotation("MySql:CharSet", "utf8mb4"), .Annotation("MySql:CharSet", "utf8mb4"),
StandardFieldName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false, comment: "管理后台产品标准的物模型属性或者事件名称") StandardFieldName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false, comment: "管理后台产品标准的物模型属性或者事件名称")
.Annotation("MySql:CharSet", "utf8mb4"), .Annotation("MySql:CharSet", "utf8mb4"),
@ -934,11 +977,8 @@ namespace JiShe.IoT.Migrations
StandardFieldDisplayName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false, comment: "管理后台产品标准的物模型属性或者事件名称") StandardFieldDisplayName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false, comment: "管理后台产品标准的物模型属性或者事件名称")
.Annotation("MySql:CharSet", "utf8mb4"), .Annotation("MySql:CharSet", "utf8mb4"),
IsValueNeedConvert = table.Column<sbyte>(type: "tinyint(1)", nullable: false, comment: "是否需要值类型转换"), IsValueNeedConvert = table.Column<sbyte>(type: "tinyint(1)", nullable: false, comment: "是否需要值类型转换"),
DeviceRawFieldName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false, comment: "设备端物模型属性或者事件名称") SkipNumber = table.Column<int>(type: "int", nullable: false, comment: "跳过数量"),
.Annotation("MySql:CharSet", "utf8mb4"), TakeNumber = table.Column<int>(type: "int", nullable: false, comment: "获取数量"),
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) 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),
@ -961,7 +1001,7 @@ namespace JiShe.IoT.Migrations
{ {
table.PrimaryKey("PK_ServiceProDeviceThingModelDetailInfo", x => x.Id); table.PrimaryKey("PK_ServiceProDeviceThingModelDetailInfo", x => x.Id);
}, },
comment: "设备端物模型详情信息") comment: "设备端物模型详情信息,是指设备端支持的属性或者事件")
.Annotation("MySql:CharSet", "utf8mb4"); .Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable( migrationBuilder.CreateTable(
@ -978,6 +1018,7 @@ namespace JiShe.IoT.Migrations
.Annotation("MySql:CharSet", "utf8mb4"), .Annotation("MySql:CharSet", "utf8mb4"),
FunctionScript = table.Column<string>(type: "text", nullable: false, comment: "脚本函数体") FunctionScript = table.Column<string>(type: "text", nullable: false, comment: "脚本函数体")
.Annotation("MySql:CharSet", "utf8mb4"), .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) 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),
@ -1873,6 +1914,22 @@ namespace JiShe.IoT.Migrations
columns: new[] { "Id", "DeviceName", "DeviceAddress", "IoTPlatformProductId", "CreationTime" }, columns: new[] { "Id", "DeviceName", "DeviceAddress", "IoTPlatformProductId", "CreationTime" },
descending: new bool[0]); descending: new bool[0]);
migrationBuilder.CreateIndex(
name: "IX_ServiceProDeviceThingModelCommandInfo_CreationTime",
table: "ServiceProDeviceThingModelCommandInfo",
column: "CreationTime");
migrationBuilder.CreateIndex(
name: "IX_ServiceProDeviceThingModelCommandInfo_DeviceThingModelId",
table: "ServiceProDeviceThingModelCommandInfo",
column: "DeviceThingModelId");
migrationBuilder.CreateIndex(
name: "IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey",
table: "ServiceProDeviceThingModelCommandInfo",
columns: new[] { "Id", "DeviceThingModelId", "IoTPlatformProductId", "CreationTime" },
descending: new bool[0]);
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_ServiceProDeviceThingModelDetailInfo_CreationTime", name: "IX_ServiceProDeviceThingModelDetailInfo_CreationTime",
table: "ServiceProDeviceThingModelDetailInfo", table: "ServiceProDeviceThingModelDetailInfo",
@ -1884,7 +1941,7 @@ namespace JiShe.IoT.Migrations
column: "IoTPlatformProductId"); column: "IoTPlatformProductId");
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey", name: "IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey1",
table: "ServiceProDeviceThingModelDetailInfo", table: "ServiceProDeviceThingModelDetailInfo",
columns: new[] { "Id", "IoTPlatformProductId", "IoTPlatformRawFieldName", "StandardFieldName", "CreationTime" }, columns: new[] { "Id", "IoTPlatformProductId", "IoTPlatformRawFieldName", "StandardFieldName", "CreationTime" },
descending: new bool[0]); descending: new bool[0]);
@ -1900,7 +1957,7 @@ namespace JiShe.IoT.Migrations
column: "IoTPlatformProductId"); column: "IoTPlatformProductId");
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey1", name: "IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey2",
table: "ServiceProDeviceThingModelManagement", table: "ServiceProDeviceThingModelManagement",
columns: new[] { "Id", "DeviceModelName", "IoTPlatformProductId", "CreationTime" }, columns: new[] { "Id", "DeviceModelName", "IoTPlatformProductId", "CreationTime" },
descending: new bool[0]); descending: new bool[0]);
@ -1916,7 +1973,7 @@ namespace JiShe.IoT.Migrations
column: "IoTPlatformProductId"); column: "IoTPlatformProductId");
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey2", name: "IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey3",
table: "ServiceProIoTPlatformThingModelInfo", table: "ServiceProIoTPlatformThingModelInfo",
columns: new[] { "Id", "IoTPlatformProductId", "IoTPlatformRawFieldName", "StandardFieldName", "CreationTime" }, columns: new[] { "Id", "IoTPlatformProductId", "IoTPlatformRawFieldName", "StandardFieldName", "CreationTime" },
descending: new bool[0]); descending: new bool[0]);
@ -2078,6 +2135,9 @@ namespace JiShe.IoT.Migrations
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "ServiceProDeviceInfo"); name: "ServiceProDeviceInfo");
migrationBuilder.DropTable(
name: "ServiceProDeviceThingModelCommandInfo");
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "ServiceProDeviceThingModelDetailInfo"); name: "ServiceProDeviceThingModelDetailInfo");

View File

@ -608,6 +608,10 @@ namespace JiShe.IoT.Migrations
.HasColumnType("int") .HasColumnType("int")
.HasComment("设备来源类型"); .HasComment("设备来源类型");
b.Property<Guid?>("DeviceThingModelDataId")
.HasColumnType("char(36)")
.HasComment("设备物模型数据Id");
b.Property<int>("DeviceType") b.Property<int>("DeviceType")
.HasColumnType("int") .HasColumnType("int")
.HasComment("设备类型,与业务系统无关,主要区分是网关设备、直连设备"); .HasComment("设备类型,与业务系统无关,主要区分是网关设备、直连设备");
@ -655,6 +659,10 @@ namespace JiShe.IoT.Migrations
.HasDefaultValue(false) .HasDefaultValue(false)
.HasColumnName("IsDeleted"); .HasColumnName("IsDeleted");
b.Property<bool>("IsNeedConfigDevicMdoel")
.HasColumnType("bit(1)")
.HasComment("是否需要配置设备模型");
b.Property<sbyte>("IsPlatformPushSuccess") b.Property<sbyte>("IsPlatformPushSuccess")
.HasColumnType("tinyint(1)") .HasColumnType("tinyint(1)")
.HasComment("物联网平台推送是否成功"); .HasComment("物联网平台推送是否成功");
@ -717,6 +725,121 @@ namespace JiShe.IoT.Migrations
}); });
}); });
modelBuilder.Entity("JiShe.ServicePro.DeviceManagement.ThingModelInfos.DeviceThingModelCommandInfo", b =>
{
b.Property<Guid>("Id")
.HasColumnType("char(36)");
b.Property<string>("CommandName")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("varchar(256)")
.HasComment("指令名称");
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<Guid>("DeviceThingModelId")
.HasColumnType("char(36)")
.HasComment("设备端物模型Id");
b.Property<string>("ExtraProperties")
.HasColumnType("longtext")
.HasColumnName("ExtraProperties")
.HasComment("扩展属性,用于存储自定义字段,JSON格式");
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<string>("IssueCommand")
.IsRequired()
.HasMaxLength(512)
.HasColumnType("varchar(512)")
.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<string>("PropertyArray")
.IsRequired()
.HasMaxLength(1024)
.HasColumnType("varchar(1024)")
.HasComment("指令设备端物模型的属性名称集合,JSON格式字符串数组");
b.Property<string>("Remark")
.HasColumnType("longtext")
.HasComment("备注");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)")
.HasColumnName("TenantId")
.HasComment("租户ID");
b.HasKey("Id");
b.HasIndex("CreationTime");
b.HasIndex("DeviceThingModelId");
b.HasIndex(new[] { "Id", "DeviceThingModelId", "IoTPlatformProductId", "CreationTime" }, "IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey")
.IsDescending();
b.ToTable("ServiceProDeviceThingModelCommandInfo", null, t =>
{
t.HasComment("设备端透传指令详情");
});
});
modelBuilder.Entity("JiShe.ServicePro.DeviceManagement.ThingModelInfos.DeviceThingModelDetailInfo", b => modelBuilder.Entity("JiShe.ServicePro.DeviceManagement.ThingModelInfos.DeviceThingModelDetailInfo", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")
@ -745,12 +868,6 @@ namespace JiShe.IoT.Migrations
.HasColumnType("datetime(6)") .HasColumnType("datetime(6)")
.HasColumnName("DeletionTime"); .HasColumnName("DeletionTime");
b.Property<string>("DeviceRawFieldName")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64)")
.HasComment("设备端物模型属性或者事件名称");
b.Property<Guid>("DeviceThingModelId") b.Property<Guid>("DeviceThingModelId")
.HasColumnType("char(36)") .HasColumnType("char(36)")
.HasComment("设备端物模型Id"); .HasComment("设备端物模型Id");
@ -766,6 +883,10 @@ namespace JiShe.IoT.Migrations
.HasColumnType("varchar(50)") .HasColumnType("varchar(50)")
.HasComment("物联网平台中对应产品物模型属性或者事件类型"); .HasComment("物联网平台中对应产品物模型属性或者事件类型");
b.Property<int>("IoTPlatform")
.HasColumnType("int")
.HasComment("物联网平台类型");
b.Property<string>("IoTPlatformProductId") b.Property<string>("IoTPlatformProductId")
.IsRequired() .IsRequired()
.HasMaxLength(50) .HasMaxLength(50)
@ -773,7 +894,10 @@ namespace JiShe.IoT.Migrations
.HasComment("物联网平台中对应的产品Id"); .HasComment("物联网平台中对应的产品Id");
b.Property<string>("IoTPlatformRawFieldDataType") b.Property<string>("IoTPlatformRawFieldDataType")
.HasColumnType("longtext"); .IsRequired()
.HasMaxLength(20)
.HasColumnType("varchar(20)")
.HasComment("物联网平台中对应的产品物模型属性或者事件数据类型");
b.Property<string>("IoTPlatformRawFieldName") b.Property<string>("IoTPlatformRawFieldName")
.IsRequired() .IsRequired()
@ -791,12 +915,6 @@ namespace JiShe.IoT.Migrations
.HasColumnType("tinyint(1)") .HasColumnType("tinyint(1)")
.HasComment("是否需要值类型转换"); .HasComment("是否需要值类型转换");
b.Property<string>("IssueCommand")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("varchar(256)")
.HasComment("下发指令");
b.Property<DateTime?>("LastModificationTime") b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)") .HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime"); .HasColumnName("LastModificationTime");
@ -817,14 +935,14 @@ namespace JiShe.IoT.Migrations
.HasColumnType("int") .HasColumnType("int")
.HasComment("旧系统授权最后修改者Id"); .HasComment("旧系统授权最后修改者Id");
b.Property<int>("ParsingSequence")
.HasColumnType("int")
.HasComment("解析顺序1234或者3412(高低位反转)");
b.Property<string>("Remark") b.Property<string>("Remark")
.HasColumnType("longtext") .HasColumnType("longtext")
.HasComment("备注"); .HasComment("备注");
b.Property<int>("SkipNumber")
.HasColumnType("int")
.HasComment("跳过数量");
b.Property<string>("StandardFieldDisplayName") b.Property<string>("StandardFieldDisplayName")
.IsRequired() .IsRequired()
.HasMaxLength(64) .HasMaxLength(64)
@ -843,6 +961,10 @@ namespace JiShe.IoT.Migrations
.HasColumnType("varchar(20)") .HasColumnType("varchar(20)")
.HasComment("标准物模型字段值类型"); .HasComment("标准物模型字段值类型");
b.Property<int>("TakeNumber")
.HasColumnType("int")
.HasComment("获取数量");
b.Property<Guid?>("TenantId") b.Property<Guid?>("TenantId")
.HasColumnType("char(36)") .HasColumnType("char(36)")
.HasColumnName("TenantId") .HasColumnName("TenantId")
@ -855,11 +977,12 @@ namespace JiShe.IoT.Migrations
b.HasIndex("IoTPlatformProductId"); b.HasIndex("IoTPlatformProductId");
b.HasIndex(new[] { "Id", "IoTPlatformProductId", "IoTPlatformRawFieldName", "StandardFieldName", "CreationTime" }, "IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey") b.HasIndex(new[] { "Id", "IoTPlatformProductId", "IoTPlatformRawFieldName", "StandardFieldName", "CreationTime" }, "IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey")
.IsDescending(); .IsDescending()
.HasDatabaseName("IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey1");
b.ToTable("ServiceProDeviceThingModelDetailInfo", null, t => b.ToTable("ServiceProDeviceThingModelDetailInfo", null, t =>
{ {
t.HasComment("设备端物模型详情信息"); t.HasComment("设备端物模型详情信息,是指设备端支持的属性或者事件");
}); });
}); });
@ -943,6 +1066,10 @@ namespace JiShe.IoT.Migrations
.HasColumnType("int") .HasColumnType("int")
.HasComment("旧系统授权最后修改者Id"); .HasComment("旧系统授权最后修改者Id");
b.Property<int>("ParsingSequence")
.HasColumnType("int")
.HasComment("解析顺序1234或者3412(高低位反转)");
b.Property<string>("Remark") b.Property<string>("Remark")
.HasColumnType("longtext") .HasColumnType("longtext")
.HasComment("备注"); .HasComment("备注");
@ -966,7 +1093,7 @@ namespace JiShe.IoT.Migrations
b.HasIndex(new[] { "Id", "DeviceModelName", "IoTPlatformProductId", "CreationTime" }, "IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey") b.HasIndex(new[] { "Id", "DeviceModelName", "IoTPlatformProductId", "CreationTime" }, "IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey")
.IsDescending() .IsDescending()
.HasDatabaseName("IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey1"); .HasDatabaseName("IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey2");
b.ToTable("ServiceProDeviceThingModelManagement", null, t => b.ToTable("ServiceProDeviceThingModelManagement", null, t =>
{ {
@ -1094,7 +1221,7 @@ namespace JiShe.IoT.Migrations
b.HasIndex(new[] { "Id", "IoTPlatformProductId", "IoTPlatformRawFieldName", "StandardFieldName", "CreationTime" }, "IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey") b.HasIndex(new[] { "Id", "IoTPlatformProductId", "IoTPlatformRawFieldName", "StandardFieldName", "CreationTime" }, "IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey")
.IsDescending() .IsDescending()
.HasDatabaseName("IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey2"); .HasDatabaseName("IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey3");
b.ToTable("ServiceProIoTPlatformThingModelInfo", null, t => b.ToTable("ServiceProIoTPlatformThingModelInfo", null, t =>
{ {