diff --git a/src/JiShe.IoT.Application.Contracts/DeviceAggregation/IDeviceAggregationService.cs b/src/JiShe.IoT.Application.Contracts/DeviceAggregation/IDeviceAggregationService.cs
index f3b5820..161b0aa 100644
--- a/src/JiShe.IoT.Application.Contracts/DeviceAggregation/IDeviceAggregationService.cs
+++ b/src/JiShe.IoT.Application.Contracts/DeviceAggregation/IDeviceAggregationService.cs
@@ -3,6 +3,7 @@ using JiShe.IoT.DeviceAggregation.Dto;
using JiShe.ServicePro;
using JiShe.ServicePro.Core;
using JiShe.ServicePro.DeviceManagement.DeviceInfos;
+using JiShe.ServicePro.DeviceManagement.DeviceInfos.Dto;
using JiShe.ServicePro.FileManagement.Files;
using Volo.Abp;
using Volo.Abp.Content;
@@ -104,6 +105,14 @@ namespace JiShe.IoT.DeviceAggregation
///
///
///
- Task BatchCreateDeviceBusinessSystemAsync(BatchCreateDeviceBusinessSystemInput input);
+ Task BatchCreateDeviceBusinessSystemAsync(BatchCreateDeviceBusinessSystemInput input);
+
+
+ ///
+ /// 绑定设备端物模型
+ ///
+ ///
+ ///
+ Task BindingDeviceThingModel(BindingDeviceThingModelInput input);
}
}
diff --git a/src/JiShe.IoT.Application/DeviceAggregation/DeviceAggregationService.cs b/src/JiShe.IoT.Application/DeviceAggregation/DeviceAggregationService.cs
index 79cf149..3596ec7 100644
--- a/src/JiShe.IoT.Application/DeviceAggregation/DeviceAggregationService.cs
+++ b/src/JiShe.IoT.Application/DeviceAggregation/DeviceAggregationService.cs
@@ -14,17 +14,14 @@ using JiShe.ServicePro.Enums;
using JiShe.ServicePro.FileManagement.Files;
using JiShe.ServicePro.FreeRedisProvider;
using JiShe.ServicePro.IoTDBManagement.DataChannels;
-using JiShe.ServicePro.IoTDBManagement.TableModels;
using JiShe.ServicePro.OneNET.Provider.OpenApiModels.Commands;
using JiShe.ServicePro.OneNETManagement.OneNETDevices;
using JiShe.ServicePro.OneNETManagement.OneNETProducts;
using Mapster;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
-using StackExchange.Redis;
using Volo.Abp;
using Volo.Abp.Content;
-using static FreeSql.Internal.GlobalFilter;
namespace JiShe.IoT.DeviceAggregation
{
@@ -699,6 +696,58 @@ namespace JiShe.IoT.DeviceAggregation
}
+ ///
+ /// 绑定设备端物模型
+ ///
+ ///
+ ///
+ public async Task BindingDeviceThingModel(BindingDeviceThingModelInput input)
+ {
+ try
+ {
+ List bindingDeviceList = await deviceAppService.BindingDeviceThingModel(input);
+
+ if (bindingDeviceList == null)
+ {
+ throw new UserFriendlyException($"绑定设备端物模型失败", "-101");
+ }
+ foreach (var item in bindingDeviceList)
+ {
+ if (item.IoTPlatform == ServicePro.Enums.IoTPlatformTypeEnum.CTWing)
+ {
+ logger.LogInformation($"{nameof(BindingDeviceThingModel)} CTWing设备{item.DeviceAddress}绑定设备物模型未实现");
+ continue;
+ }
+ else if (item.IoTPlatform == ServicePro.Enums.IoTPlatformTypeEnum.OneNET)
+ {
+ var platformThingModelInfos = await platformThingModelInfoAppService.FindByPlatformProductIdAsync(new IdInput() { Id = item.IoTPlatformProductId });
+
+
+ return await DeviceCommandInfoToOneNET(item, new ReceiveCommandInfoDto()
+ {
+ DeviceType = item.DeviceType,
+ SourceType = DeviceTelemetrySourceTypeEnum.AdminSystem,
+ DeviceAddress = item.DeviceAddress,
+ IoTPlatform = item.IoTPlatform,
+ Commands = new Dictionary() {
+ {ThingModelFixedTypeConst.SpecialCommand,
+ ""}
+ },
+ }, platformThingModelInfos);
+ }
+ }
+
+ return true;
+
+ }
+ catch (Exception)
+ {
+
+ throw;
+ }
+ }
+
+
#region OneNET 设备操作
///
/// OneNET设备创建
@@ -987,27 +1036,30 @@ namespace JiShe.IoT.DeviceAggregation
///
/// 发送OneNET平台设备指令
///
- ///
- ///
+ /// 设备信息
+ /// 指令信息
+ /// 平台端物模型信息
///
///
- protected async Task DeviceCommandInfoToOneNET(DeviceManagementInfoDto deviceInfo, ReceiveCommandInfoDto input)
+ protected async Task DeviceCommandInfoToOneNET(DeviceManagementInfoDto deviceInfo, ReceiveCommandInfoDto input, List platformThingModelInfos = null)
{
try
{
//获取设备对应的平台端物模型信息,校验前端传入的属性标识集合是否存在不合法的属性标识符
+ if (platformThingModelInfos == null || platformThingModelInfos.Count <= 0)
+ {
+ platformThingModelInfos = await platformThingModelInfoAppService.FindByPlatformProductIdAsync(new IdInput() { Id = deviceInfo.IoTPlatformProductId });
+ }
- var platformThingModelInfo = await platformThingModelInfoAppService.FindByPlatformProductIdAsync(new IdInput() { Id = deviceInfo.IoTPlatformProductId });
-
- if (platformThingModelInfo == null)
+ if (platformThingModelInfos == null || platformThingModelInfos.Count <= 0)
{
throw new UserFriendlyException($"设备{deviceInfo.DeviceAddress}的平台端物模型信息不存在。");
}
foreach (var item in input.Commands)
{
- var tempPlatformThingModelInfo = platformThingModelInfo.Where(d => d.IoTPlatformRawFieldName == item.Key).FirstOrDefault();
+ var tempPlatformThingModelInfo = platformThingModelInfos.Where(d => d.IoTPlatformRawFieldName == item.Key).FirstOrDefault();
if (tempPlatformThingModelInfo == null)
{
throw new UserFriendlyException($"设备{deviceInfo.DeviceAddress}平台端物模型信息不存在属性标识符{item.Key}。");
@@ -1022,8 +1074,7 @@ namespace JiShe.IoT.DeviceAggregation
//检查设备是否有配置设备端物模型信息
//如果有配置,就检查指令字典中是否有SpecialCommand标识符
- //如果有就需要构建 SpecialCommand 的特别指令
-
+ //如果有就需要构建 SpecialCommand 的特别指令
if (deviceInfo.IsNeedConfigDevicMdoel && deviceInfo.DeviceThingModelDataId.HasValue && input.Commands.ContainsKey(ThingModelFixedTypeConst.SpecialCommand))
{
var propertyInfo = await oneNETProductService.GetProductThingModelSpecialCommandDataTypeListAsync(new IdInput() { Id = deviceInfo.IoTPlatformProductId });
@@ -1037,6 +1088,11 @@ namespace JiShe.IoT.DeviceAggregation
input.Commands[ThingModelFixedTypeConst.SpecialCommand] = tempSpecialCommand;
}
+ else if (input.Commands.ContainsKey(ThingModelFixedTypeConst.SpecialCommand))
+ {
+ //非绑定物模型情况下,SpecialCommand还原默认值,设备也会恢复默认采集方式
+ input.Commands[ThingModelFixedTypeConst.SpecialCommand] = CommonConst.SpecialCommandDefaultValue;
+ }
var commandRequest = new OpenApiRequest()
{
@@ -1044,25 +1100,7 @@ namespace JiShe.IoT.DeviceAggregation
};
var packetTaskInfo = GetDeviceTelemetryPacketTaskInfo(ioTDBOptions, commandRequest, deviceInfo.Adapt(), input.Commands.Serialize());
- await ioTDBDataChannelManageService.DeviceTelemetryTaskWriterAsync(DataChannelManage.DeviceTelemetryTaskDataChannel.Writer, (DistributedMessageCenterConst.OneNETCommandIssuedEventName, packetTaskInfo));
-
- ////检查下设备是否在线
- //var deviceOnlineStatus = await oneNETDeviceService.DeviceInfoDetailAsync(new DeviceInfoDetailInput()
- //{
- // DeviceName = deviceInfo.IoTPlatformDeviceOpenInfo,
- // OneNETAccountId = deviceInfo.IoTPlatformAccountId,
- // ProductId = deviceInfo.IoTPlatformProductId,
- //});
-
- //if (deviceOnlineStatus == null || deviceOnlineStatus.Code != ResponeResultEnum.Success)
- //{
- // throw new UserFriendlyException("获取平台设备信息失败");
- //}
-
- //if (deviceOnlineStatus.Data.Status != 1)
- //{
- // throw new UserFriendlyException("设备不在线");
- //}
+ await ioTDBDataChannelManageService.DeviceTelemetryTaskWriterAsync(DataChannelManage.DeviceTelemetryTaskDataChannel.Writer, (DistributedMessageCenterConst.OneNETCommandIssuedEventName, packetTaskInfo));
await redisPubSubService.PublishReliableAsync(DistributedMessageCenterConst.OneNETCommandIssuedEventName, packetTaskInfo);
return true;
diff --git a/src/JiShe.IoT.Application/IoTAppService.cs b/src/JiShe.IoT.Application/IoTAppService.cs
index 91fc03c..06e6eb3 100644
--- a/src/JiShe.IoT.Application/IoTAppService.cs
+++ b/src/JiShe.IoT.Application/IoTAppService.cs
@@ -1,6 +1,5 @@
using JiShe.ServicePro;
using JiShe.ServicePro.ApacheIoTDB.Provider.Options;
-using JiShe.ServicePro.Consts;
using JiShe.ServicePro.Core;
using JiShe.ServicePro.Dto;
using JiShe.ServicePro.Encrypt;
@@ -9,7 +8,6 @@ using JiShe.ServicePro.FreeRedisProvider;
using JiShe.ServicePro.FreeSqlProvider;
using JiShe.ServicePro.IoTDBManagement.TableModels;
using Microsoft.Extensions.Logging;
-using System.Xml.Linq;
using Volo.Abp;
namespace JiShe.IoT
diff --git a/src/JiShe.IoT.EntityFrameworkCore/Migrations/20260120023219_updatetable202601201031.cs b/src/JiShe.IoT.EntityFrameworkCore/Migrations/20260120023219_updatetable202601201031.cs
deleted file mode 100644
index 9de22b4..0000000
--- a/src/JiShe.IoT.EntityFrameworkCore/Migrations/20260120023219_updatetable202601201031.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace JiShe.IoT.Migrations
-{
- ///
- public partial class updatetable202601201031 : Migration
- {
- ///
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropColumn(
- name: "BusinessSystemSubDeviceDataId",
- table: "ServiceProSubDeviceManagementInfo");
-
- migrationBuilder.DropColumn(
- name: "BusinessSystemDeviceDataId",
- table: "ServiceProDeviceInfo");
-
- migrationBuilder.AlterTable(
- name: "ServiceProSubDeviceManagementInfo",
- comment: "子设备信息,需要下发配置的网关设备才用到",
- oldComment: "子设备信息");
-
- migrationBuilder.AddColumn(
- name: "IsSynced",
- table: "ServiceProSubDeviceManagementInfo",
- type: "boolean",
- nullable: false,
- defaultValue: false,
- comment: "是否同步");
-
- migrationBuilder.AddColumn(
- name: "SubDeviceCapacity",
- table: "ServiceProDeviceInfo",
- type: "integer",
- nullable: false,
- defaultValue: 64,
- comment: "子设备容量");
- }
-
- ///
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropColumn(
- name: "IsSynced",
- table: "ServiceProSubDeviceManagementInfo");
-
- migrationBuilder.DropColumn(
- name: "SubDeviceCapacity",
- table: "ServiceProDeviceInfo");
-
- migrationBuilder.AlterTable(
- name: "ServiceProSubDeviceManagementInfo",
- comment: "子设备信息",
- oldComment: "子设备信息,需要下发配置的网关设备才用到");
-
- migrationBuilder.AddColumn(
- name: "BusinessSystemSubDeviceDataId",
- table: "ServiceProSubDeviceManagementInfo",
- type: "bigint",
- nullable: true,
- comment: "业务系统子设备数据Id");
-
- migrationBuilder.AddColumn(
- name: "BusinessSystemDeviceDataId",
- table: "ServiceProDeviceInfo",
- type: "bigint",
- nullable: true,
- comment: "业务系统设备数据Id");
- }
- }
-}
diff --git a/src/JiShe.IoT.EntityFrameworkCore/Migrations/20260120023219_updatetable202601201031.Designer.cs b/src/JiShe.IoT.EntityFrameworkCore/Migrations/20260121015002_InitialCreate.Designer.cs
similarity index 99%
rename from src/JiShe.IoT.EntityFrameworkCore/Migrations/20260120023219_updatetable202601201031.Designer.cs
rename to src/JiShe.IoT.EntityFrameworkCore/Migrations/20260121015002_InitialCreate.Designer.cs
index 45b9075..e0de3d4 100644
--- a/src/JiShe.IoT.EntityFrameworkCore/Migrations/20260120023219_updatetable202601201031.Designer.cs
+++ b/src/JiShe.IoT.EntityFrameworkCore/Migrations/20260121015002_InitialCreate.Designer.cs
@@ -13,8 +13,8 @@ using Volo.Abp.EntityFrameworkCore;
namespace JiShe.IoT.Migrations
{
[DbContext(typeof(IoTDbContext))]
- [Migration("20260120023219_updatetable202601201031")]
- partial class updatetable202601201031
+ [Migration("20260121015002_InitialCreate")]
+ partial class InitialCreate
{
///
protected override void BuildTargetModel(ModelBuilder modelBuilder)
@@ -1590,7 +1590,7 @@ namespace JiShe.IoT.Migrations
b.Property("IoTPlatformRawFieldExtension")
.HasColumnType("text")
- .HasComment("物联网平台中对应产品物模型标识符扩展,用于扩展结构体类型");
+ .HasComment("物联网平台中对应产品物模型标识符扩展,结构体或者数组的时候,是参数的名称与长度的键值对,其他类型就是长度或者值范围");
b.Property("IoTPlatformRawFieldName")
.IsRequired()
@@ -1604,6 +1604,10 @@ namespace JiShe.IoT.Migrations
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
+ b.Property("IsOperableIdentifier")
+ .HasColumnType("boolean")
+ .HasComment("是否可操作物模型标识符");
+
b.Property("IsSpecialIdentifier")
.HasColumnType("boolean")
.HasComment("是否是特殊物模型标识符");
diff --git a/src/JiShe.IoT.EntityFrameworkCore/Migrations/20260116085116_InitialCreate.cs b/src/JiShe.IoT.EntityFrameworkCore/Migrations/20260121015002_InitialCreate.cs
similarity index 99%
rename from src/JiShe.IoT.EntityFrameworkCore/Migrations/20260116085116_InitialCreate.cs
rename to src/JiShe.IoT.EntityFrameworkCore/Migrations/20260121015002_InitialCreate.cs
index f284aa9..704e242 100644
--- a/src/JiShe.IoT.EntityFrameworkCore/Migrations/20260116085116_InitialCreate.cs
+++ b/src/JiShe.IoT.EntityFrameworkCore/Migrations/20260121015002_InitialCreate.cs
@@ -739,7 +739,7 @@ namespace JiShe.IoT.Migrations
DeviceThingModelDataId = table.Column(type: "uuid", nullable: true, comment: "设备物模型数据Id"),
FirmwareVersion = table.Column(type: "character varying(50)", maxLength: 50, nullable: true, comment: "固件版本"),
UpgradeDate = table.Column(type: "timestamp with time zone", nullable: true, comment: "升级日期"),
- BusinessSystemDeviceDataId = table.Column(type: "bigint", nullable: true, comment: "业务系统设备数据Id"),
+ SubDeviceCapacity = table.Column(type: "integer", nullable: false, defaultValue: 64, comment: "子设备容量"),
ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false),
CreationTime = table.Column(type: "timestamp with time zone", nullable: false),
CreatorId = table.Column(type: "uuid", nullable: true),
@@ -920,7 +920,8 @@ namespace JiShe.IoT.Migrations
StandardFieldDisplayName = table.Column(type: "character varying(64)", maxLength: 64, nullable: false, comment: "管理后台产品标准的物模型属性或者事件名称"),
IsValueNeedConvert = table.Column(type: "boolean", nullable: false, comment: "是否需要值类型转换"),
IsSpecialIdentifier = table.Column(type: "boolean", nullable: false, comment: "是否是特殊物模型标识符"),
- IoTPlatformRawFieldExtension = table.Column(type: "text", nullable: true, comment: "物联网平台中对应产品物模型标识符扩展,用于扩展结构体类型"),
+ IoTPlatformRawFieldExtension = table.Column(type: "text", nullable: true, comment: "物联网平台中对应产品物模型标识符扩展,结构体或者数组的时候,是参数的名称与长度的键值对,其他类型就是长度或者值范围"),
+ IsOperableIdentifier = table.Column(type: "boolean", nullable: false, comment: "是否可操作物模型标识符"),
ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false),
CreationTime = table.Column(type: "timestamp with time zone", nullable: false),
CreatorId = table.Column(type: "uuid", nullable: true),
@@ -1072,7 +1073,7 @@ namespace JiShe.IoT.Migrations
SubDeviceAddress = table.Column(type: "character varying(40)", maxLength: 40, nullable: false, comment: "子设备地址"),
SubDeviceIndex = table.Column(type: "integer", nullable: false, comment: "子设备索引,抑或是主设备下唯一标识符、计量代码"),
SubDeviceBrandCode = table.Column(type: "character varying(50)", maxLength: 50, nullable: false, comment: "子设备品牌编码"),
- BusinessSystemSubDeviceDataId = table.Column(type: "bigint", nullable: true, comment: "业务系统子设备数据Id"),
+ IsSynced = table.Column(type: "boolean", nullable: false, comment: "是否同步"),
ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false),
CreationTime = table.Column(type: "timestamp with time zone", nullable: false),
CreatorId = table.Column(type: "uuid", nullable: true),
@@ -1092,7 +1093,7 @@ namespace JiShe.IoT.Migrations
{
table.PrimaryKey("PK_ServiceProSubDeviceManagementInfo", x => x.Id);
},
- comment: "子设备信息");
+ comment: "子设备信息,需要下发配置的网关设备才用到");
migrationBuilder.CreateTable(
name: "ServiceProTextTemplates",
diff --git a/src/JiShe.IoT.EntityFrameworkCore/Migrations/20260116085116_InitialCreate.Designer.cs b/src/JiShe.IoT.EntityFrameworkCore/Migrations/20260121062322_updatethingmodel.Designer.cs
similarity index 99%
rename from src/JiShe.IoT.EntityFrameworkCore/Migrations/20260116085116_InitialCreate.Designer.cs
rename to src/JiShe.IoT.EntityFrameworkCore/Migrations/20260121062322_updatethingmodel.Designer.cs
index 4371121..ab2c39a 100644
--- a/src/JiShe.IoT.EntityFrameworkCore/Migrations/20260116085116_InitialCreate.Designer.cs
+++ b/src/JiShe.IoT.EntityFrameworkCore/Migrations/20260121062322_updatethingmodel.Designer.cs
@@ -13,8 +13,8 @@ using Volo.Abp.EntityFrameworkCore;
namespace JiShe.IoT.Migrations
{
[DbContext(typeof(IoTDbContext))]
- [Migration("20260116085116_InitialCreate")]
- partial class InitialCreate
+ [Migration("20260121062322_updatethingmodel")]
+ partial class updatethingmodel
{
///
protected override void BuildTargetModel(ModelBuilder modelBuilder)
@@ -698,10 +698,6 @@ namespace JiShe.IoT.Migrations
.HasColumnType("character varying(50)")
.HasComment("账户手机号");
- b.Property("BusinessSystemDeviceDataId")
- .HasColumnType("bigint")
- .HasComment("业务系统设备数据Id");
-
b.Property("ConcurrencyStamp")
.IsConcurrencyToken()
.IsRequired()
@@ -847,6 +843,12 @@ namespace JiShe.IoT.Migrations
.HasColumnType("text")
.HasComment("备注");
+ b.Property("SubDeviceCapacity")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasDefaultValue(64)
+ .HasComment("子设备容量");
+
b.Property("TenantId")
.HasColumnType("uuid")
.HasColumnName("TenantId")
@@ -1024,10 +1026,6 @@ namespace JiShe.IoT.Migrations
b.Property("Id")
.HasColumnType("uuid");
- b.Property("BusinessSystemSubDeviceDataId")
- .HasColumnType("bigint")
- .HasComment("业务系统子设备数据Id");
-
b.Property("ConcurrencyStamp")
.IsConcurrencyToken()
.IsRequired()
@@ -1072,6 +1070,10 @@ namespace JiShe.IoT.Migrations
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
+ b.Property("IsSynced")
+ .HasColumnType("boolean")
+ .HasComment("是否同步");
+
b.Property("LastModificationTime")
.HasColumnType("timestamp with time zone")
.HasColumnName("LastModificationTime");
@@ -1138,7 +1140,7 @@ namespace JiShe.IoT.Migrations
b.ToTable("ServiceProSubDeviceManagementInfo", null, t =>
{
- t.HasComment("子设备信息");
+ t.HasComment("子设备信息,需要下发配置的网关设备才用到");
});
});
@@ -1537,6 +1539,13 @@ namespace JiShe.IoT.Migrations
b.Property("Id")
.HasColumnType("uuid");
+ b.Property("AccessMode")
+ .IsRequired()
+ .ValueGeneratedOnAdd()
+ .HasColumnType("text")
+ .HasDefaultValue("r")
+ .HasComment("物模型标识符访问模式");
+
b.Property("ConcurrencyStamp")
.IsConcurrencyToken()
.IsRequired()
@@ -1588,7 +1597,7 @@ namespace JiShe.IoT.Migrations
b.Property("IoTPlatformRawFieldExtension")
.HasColumnType("text")
- .HasComment("物联网平台中对应产品物模型标识符扩展,用于扩展结构体类型");
+ .HasComment("物联网平台中对应产品物模型标识符扩展,结构体或者数组的时候,是参数的名称与长度的键值对,其他类型就是长度或者值范围");
b.Property("IoTPlatformRawFieldName")
.IsRequired()
@@ -1602,6 +1611,10 @@ namespace JiShe.IoT.Migrations
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
+ b.Property("IsOperableIdentifier")
+ .HasColumnType("boolean")
+ .HasComment("是否可操作物模型标识符");
+
b.Property("IsSpecialIdentifier")
.HasColumnType("boolean")
.HasComment("是否是特殊物模型标识符");
diff --git a/src/JiShe.IoT.EntityFrameworkCore/Migrations/20260121062322_updatethingmodel.cs b/src/JiShe.IoT.EntityFrameworkCore/Migrations/20260121062322_updatethingmodel.cs
new file mode 100644
index 0000000..5a962f4
--- /dev/null
+++ b/src/JiShe.IoT.EntityFrameworkCore/Migrations/20260121062322_updatethingmodel.cs
@@ -0,0 +1,30 @@
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace JiShe.IoT.Migrations
+{
+ ///
+ public partial class updatethingmodel : Migration
+ {
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.AddColumn(
+ name: "AccessMode",
+ table: "ServiceProIoTPlatformThingModelInfo",
+ type: "text",
+ nullable: false,
+ defaultValue: "r",
+ comment: "物模型标识符访问模式");
+ }
+
+ ///
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropColumn(
+ name: "AccessMode",
+ table: "ServiceProIoTPlatformThingModelInfo");
+ }
+ }
+}
diff --git a/src/JiShe.IoT.EntityFrameworkCore/Migrations/20260121062614_updatethingmodel2.Designer.cs b/src/JiShe.IoT.EntityFrameworkCore/Migrations/20260121062614_updatethingmodel2.Designer.cs
new file mode 100644
index 0000000..41f6412
--- /dev/null
+++ b/src/JiShe.IoT.EntityFrameworkCore/Migrations/20260121062614_updatethingmodel2.Designer.cs
@@ -0,0 +1,4291 @@
+//
+using System;
+using JiShe.IoT.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+using Volo.Abp.EntityFrameworkCore;
+
+#nullable disable
+
+namespace JiShe.IoT.Migrations
+{
+ [DbContext(typeof(IoTDbContext))]
+ [Migration("20260121062614_updatethingmodel2")]
+ partial class updatethingmodel2
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.PostgreSql)
+ .HasAnnotation("ProductVersion", "10.0.2")
+ .HasAnnotation("Relational:MaxIdentifierLength", 63);
+
+ NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
+
+ modelBuilder.Entity("JiShe.ServicePro.BasicManagement.UserRefreshTokens.UserRefreshToken", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uuid");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("character varying(40)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uuid")
+ .HasColumnName("CreatorId");
+
+ b.Property("DeleterId")
+ .HasColumnType("uuid")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("DeletionTime");
+
+ b.Property("ExpirationTime")
+ .HasColumnType("timestamp with time zone")
+ .HasComment("过期时间");
+
+ b.Property("ExtraProperties")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("boolean")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("IsUsed")
+ .HasColumnType("boolean")
+ .HasComment("是否使用");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uuid")
+ .HasColumnName("LastModifierId");
+
+ b.Property("RefreshToken")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)")
+ .HasComment("刷新token");
+
+ b.Property("TenantId")
+ .HasColumnType("uuid")
+ .HasColumnName("TenantId");
+
+ b.Property("Token")
+ .IsRequired()
+ .HasMaxLength(1024)
+ .HasColumnType("character varying(1024)")
+ .HasComment("Token");
+
+ b.Property("UserId")
+ .HasColumnType("uuid")
+ .HasComment("用户id");
+
+ b.HasKey("Id");
+
+ b.HasIndex("RefreshToken");
+
+ b.ToTable("ServiceProUserRefreshTokens", null, t =>
+ {
+ t.HasComment("刷新Token");
+ });
+ });
+
+ modelBuilder.Entity("JiShe.ServicePro.CTWingManagement.CTWingAccount.CTWingAccountInfo", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uuid");
+
+ b.Property("AccountId")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("character varying(50)")
+ .HasComment("账号ID");
+
+ b.Property("AccountName")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)")
+ .HasComment("账号名称");
+
+ b.Property("AppId")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("character varying(50)")
+ .HasComment("应用 ID");
+
+ b.Property("AppKey")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)")
+ .HasComment("应用 AppKey");
+
+ b.Property("AppSecret")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)")
+ .HasComment("应用 AppSecret");
+
+ b.Property("CommunicationAddress")
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)")
+ .HasComment("通讯服务地址");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("character varying(40)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uuid")
+ .HasColumnName("CreatorId");
+
+ b.Property("DeleterId")
+ .HasColumnType("uuid")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("DeletionTime");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("text")
+ .HasColumnName("ExtraProperties")
+ .HasComment("扩展属性,用于存储自定义字段,JSON格式");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("boolean")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uuid")
+ .HasColumnName("LastModifierId");
+
+ b.Property("OSACreatorId")
+ .HasColumnType("integer")
+ .HasComment("旧系统授权创建者Id");
+
+ b.Property("OSADeleterId")
+ .HasColumnType("integer")
+ .HasComment("旧系统授权最后删除者Id");
+
+ b.Property("OSALastModifierId")
+ .HasColumnType("integer")
+ .HasComment("旧系统授权最后修改者Id");
+
+ b.Property("PhoneNumber")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("character varying(50)")
+ .HasComment("手机号码");
+
+ b.Property("PlatformTenantId")
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)")
+ .HasComment("平台租户ID");
+
+ b.Property("ProductCount")
+ .HasColumnType("integer");
+
+ b.Property("Remark")
+ .HasColumnType("text")
+ .HasComment("备注");
+
+ b.Property("TenantId")
+ .HasColumnType("uuid")
+ .HasColumnName("TenantId")
+ .HasComment("租户ID");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreationTime");
+
+ b.HasIndex(new[] { "Id", "AccountId", "AccountName", "CreationTime" }, "IX_ServiceProCTWingAccountInfo_IsNotUniqueKey")
+ .IsDescending();
+
+ b.ToTable("ServiceProCTWingAccountInfo", null, t =>
+ {
+ t.HasComment("CTWing账号信息");
+ });
+ });
+
+ modelBuilder.Entity("JiShe.ServicePro.CTWingManagement.CTWingProduct.CTWingPrivateProductInfo", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uuid");
+
+ b.Property("AccessType")
+ .HasColumnType("integer");
+
+ b.Property("AccountPhoneNumber")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("character varying(50)")
+ .HasComment("账户手机号");
+
+ b.Property("AuthType")
+ .HasColumnType("integer");
+
+ b.Property("CTWingAccountId")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("character varying(50)")
+ .HasComment("账号ID");
+
+ b.Property("CommunicationAddress")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)")
+ .HasComment("通讯服务地址");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("character varying(40)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uuid")
+ .HasColumnName("CreatorId");
+
+ b.Property("DataEncryption")
+ .HasColumnType("integer");
+
+ b.Property("DeleterId")
+ .HasColumnType("uuid")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("DeletionTime");
+
+ b.Property("DeviceCount")
+ .HasColumnType("integer");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("text")
+ .HasColumnName("ExtraProperties")
+ .HasComment("扩展属性,用于存储自定义字段,JSON格式");
+
+ b.Property("FeatureAccesskey")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)")
+ .HasComment("设备访问密钥");
+
+ b.Property("IoTPlatformProductId")
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)")
+ .HasComment("产品ID");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("boolean")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("IsEnabled")
+ .HasColumnType("boolean")
+ .HasComment("是否启用");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uuid")
+ .HasColumnName("LastModifierId");
+
+ b.Property("MasterKey")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)")
+ .HasComment("OpenAPI 通信主密钥");
+
+ b.Property("NetworkType")
+ .HasColumnType("integer");
+
+ b.Property("NodeType")
+ .HasColumnType("integer");
+
+ b.Property("OSACreatorId")
+ .HasColumnType("integer")
+ .HasComment("旧系统授权创建者Id");
+
+ b.Property("OSADeleterId")
+ .HasColumnType("integer")
+ .HasComment("旧系统授权最后删除者Id");
+
+ b.Property("OSALastModifierId")
+ .HasColumnType("integer")
+ .HasComment("旧系统授权最后修改者Id");
+
+ b.Property("ProductDesc")
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)")
+ .HasComment("必填,产品描述");
+
+ b.Property("ProductName")
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)")
+ .HasComment("产品名称");
+
+ b.Property("ProductProtocol")
+ .HasColumnType("integer");
+
+ b.Property("ProductType")
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)")
+ .HasComment("一级分类名");
+
+ b.Property("Protocol")
+ .HasMaxLength(20)
+ .HasColumnType("character varying(20)")
+ .HasComment("通讯协议");
+
+ b.Property("Remark")
+ .HasColumnType("text")
+ .HasComment("备注");
+
+ b.Property("SecondaryType")
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)")
+ .HasComment("二级分类名");
+
+ b.Property("TenantId")
+ .HasColumnType("uuid")
+ .HasColumnName("TenantId")
+ .HasComment("租户ID");
+
+ b.Property("ThingModelFileId")
+ .HasColumnType("uuid")
+ .HasComment("物模型文件Id");
+
+ b.Property("ThingModelFileName")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)")
+ .HasComment("物模型文件名称");
+
+ b.Property("ThirdType")
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)")
+ .HasComment("三级分类名");
+
+ b.Property("TupDeviceModel")
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)")
+ .HasComment("设备型号");
+
+ b.Property("TupIsThrough")
+ .HasColumnType("integer");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreationTime");
+
+ b.HasIndex(new[] { "Id", "IoTPlatformProductId", "ProductName", "CreationTime" }, "IX_ServiceProCTWingPrivateProductInfo_IsNotUniqueKey")
+ .IsDescending();
+
+ b.ToTable("ServiceProCTWingPrivateProductInfo", null, t =>
+ {
+ t.HasComment("CTWing产品信息");
+ });
+ });
+
+ modelBuilder.Entity("JiShe.ServicePro.DataDictionaryManagement.DataDictionaries.Aggregates.DataDictionary", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uuid");
+
+ b.Property("Code")
+ .IsRequired()
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("character varying(40)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uuid")
+ .HasColumnName("CreatorId");
+
+ b.Property("DeleterId")
+ .HasColumnType("uuid")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("DeletionTime");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasMaxLength(1024)
+ .HasColumnType("character varying(1024)");
+
+ b.Property("DisplayText")
+ .IsRequired()
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
+
+ b.Property("ExtraProperties")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("boolean")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uuid")
+ .HasColumnName("LastModifierId");
+
+ b.Property("TenantId")
+ .HasColumnType("uuid")
+ .HasColumnName("TenantId");
+
+ b.HasKey("Id");
+
+ b.ToTable("AbpDataDictionaries", null, t =>
+ {
+ t.HasComment("数据字典");
+ });
+ });
+
+ modelBuilder.Entity("JiShe.ServicePro.DataDictionaryManagement.DataDictionaries.Aggregates.DataDictionaryDetail", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uuid");
+
+ b.Property("Code")
+ .IsRequired()
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
+
+ b.Property("CreationTime")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uuid")
+ .HasColumnName("CreatorId");
+
+ b.Property("DataDictionaryId")
+ .HasColumnType("uuid");
+
+ b.Property("Description")
+ .HasMaxLength(1024)
+ .HasColumnType("character varying(1024)");
+
+ b.Property("DisplayText")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
+
+ b.Property("ExtendedAttribute")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
+
+ b.Property("IsEnabled")
+ .HasColumnType("boolean");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uuid")
+ .HasColumnName("LastModifierId");
+
+ b.Property("Order")
+ .HasColumnType("integer");
+
+ b.HasKey("Id");
+
+ b.HasIndex("DataDictionaryId");
+
+ b.ToTable("AbpDataDictionaryDetails", null, t =>
+ {
+ t.HasComment("数据字典详情");
+ });
+ });
+
+ modelBuilder.Entity("JiShe.ServicePro.DeviceManagement.DeviceInfos.DeviceFirmwareInfo", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uuid");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("character varying(40)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uuid")
+ .HasColumnName("CreatorId");
+
+ b.Property("DeleterId")
+ .HasColumnType("uuid")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("DeletionTime");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("text")
+ .HasColumnName("ExtraProperties")
+ .HasComment("扩展属性,用于存储自定义字段,JSON格式");
+
+ b.Property("FirmwareFileId")
+ .HasColumnType("uuid")
+ .HasComment("固件文件Id");
+
+ b.Property("FirmwareFileName")
+ .IsRequired()
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)")
+ .HasComment("固件文件名称");
+
+ b.Property("FirmwareHashCode")
+ .IsRequired()
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)")
+ .HasComment("固件哈希值");
+
+ b.Property("FirmwareLength")
+ .HasColumnType("bigint");
+
+ b.Property("FirmwareVersion")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("character varying(50)")
+ .HasComment("固件版本");
+
+ b.Property("IoTPlatform")
+ .HasColumnType("integer")
+ .HasComment("物联网平台类型");
+
+ b.Property("IoTPlatformProductId")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("character varying(50)")
+ .HasComment("物联网平台中对应的产品Id");
+
+ b.Property("IoTPlatformProductName")
+ .IsRequired()
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)")
+ .HasComment("物联网平台中对应的产品名称");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("boolean")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("IsEnable")
+ .HasColumnType("boolean")
+ .HasComment("是否启用");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uuid")
+ .HasColumnName("LastModifierId");
+
+ b.Property("OSACreatorId")
+ .HasColumnType("integer")
+ .HasComment("旧系统授权创建者Id");
+
+ b.Property("OSADeleterId")
+ .HasColumnType("integer")
+ .HasComment("旧系统授权最后删除者Id");
+
+ b.Property("OSALastModifierId")
+ .HasColumnType("integer")
+ .HasComment("旧系统授权最后修改者Id");
+
+ b.Property("Remark")
+ .HasColumnType("text")
+ .HasComment("备注");
+
+ b.Property("TenantId")
+ .HasColumnType("uuid")
+ .HasColumnName("TenantId")
+ .HasComment("租户ID");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreationTime");
+
+ b.HasIndex("IoTPlatformProductId");
+
+ b.HasIndex(new[] { "Id", "IoTPlatformProductId", "FirmwareVersion", "CreationTime" }, "IX_ServiceProDeviceFirmwareInfo_IsNotUniqueKey")
+ .IsDescending();
+
+ b.ToTable("ServiceProDeviceFirmwareInfo", null, t =>
+ {
+ t.HasComment("设备固件信息");
+ });
+ });
+
+ modelBuilder.Entity("JiShe.ServicePro.DeviceManagement.DeviceInfos.DeviceManagementInfo", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uuid");
+
+ b.Property("AccountPhoneNumber")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("character varying(50)")
+ .HasComment("账户手机号");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("character varying(40)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uuid")
+ .HasColumnName("CreatorId");
+
+ b.Property("DeleterId")
+ .HasColumnType("uuid")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("DeletionTime");
+
+ b.Property("DeviceAddress")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("character varying(40)")
+ .HasComment("设备地址");
+
+ b.Property("DeviceName")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)")
+ .HasComment("设备名称");
+
+ b.Property("DeviceOnlineStatus")
+ .HasColumnType("integer")
+ .HasComment("设备在线状态");
+
+ b.Property("DeviceSource")
+ .HasColumnType("integer")
+ .HasComment("设备来源类型");
+
+ b.Property("DeviceThingModelDataId")
+ .HasColumnType("uuid")
+ .HasComment("设备物模型数据Id");
+
+ b.Property("DeviceType")
+ .HasColumnType("integer")
+ .HasComment("设备类型,与业务系统无关,主要区分是网关设备、直连设备");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("text")
+ .HasColumnName("ExtraProperties")
+ .HasComment("扩展属性,用于存储自定义字段,JSON格式");
+
+ b.Property("FirmwareVersion")
+ .HasMaxLength(50)
+ .HasColumnType("character varying(50)")
+ .HasComment("固件版本");
+
+ b.Property("IoTPlatform")
+ .HasColumnType("integer")
+ .HasComment("物联网平台类型,默认没有指定");
+
+ b.Property("IoTPlatformAccountId")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("character varying(50)")
+ .HasComment("物联网平台中对应的账号Id");
+
+ b.Property("IoTPlatformDeviceOpenInfo")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)")
+ .HasComment("物联网平台中对应的设备Id或者名称");
+
+ b.Property("IoTPlatformProductId")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("character varying(50)")
+ .HasComment("物联网平台中对应的产品Id");
+
+ b.Property("IoTPlatformProductName")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)")
+ .HasComment("物联网平台中对应的产品Name");
+
+ b.Property("IoTPlatformResponse")
+ .HasColumnType("text")
+ .HasComment("物联网平台返回的响应信息");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("boolean")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("IsNeedConfigDevicMdoel")
+ .HasColumnType("boolean")
+ .HasComment("是否需要配置设备模型");
+
+ b.Property("IsPlatformPushSuccess")
+ .HasColumnType("boolean")
+ .HasComment("物联网平台推送是否成功");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uuid")
+ .HasColumnName("LastModifierId");
+
+ b.Property("LastOfflineTime")
+ .HasColumnType("timestamp with time zone")
+ .HasComment("最后离线时间");
+
+ b.Property("LastOnlineTime")
+ .HasColumnType("timestamp with time zone")
+ .HasComment("最后在线时间");
+
+ b.Property("OSACreatorId")
+ .HasColumnType("integer")
+ .HasComment("旧系统授权创建者Id");
+
+ b.Property("OSADeleterId")
+ .HasColumnType("integer")
+ .HasComment("旧系统授权最后删除者Id");
+
+ b.Property("OSALastModifierId")
+ .HasColumnType("integer")
+ .HasComment("旧系统授权最后修改者Id");
+
+ b.Property("PlatformPassword")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)")
+ .HasComment("物联网平台设备密码");
+
+ b.Property("Remark")
+ .HasColumnType("text")
+ .HasComment("备注");
+
+ b.Property("SubDeviceCapacity")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasDefaultValue(64)
+ .HasComment("子设备容量");
+
+ b.Property("TenantId")
+ .HasColumnType("uuid")
+ .HasColumnName("TenantId")
+ .HasComment("租户ID");
+
+ b.Property("UpgradeDate")
+ .HasColumnType("timestamp with time zone")
+ .HasComment("升级日期");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreationTime");
+
+ b.HasIndex("DeviceAddress");
+
+ b.HasIndex(new[] { "Id", "DeviceName", "DeviceAddress", "IoTPlatformProductId", "CreationTime" }, "IX_ServiceProDeviceInfo_IsNotUniqueKey")
+ .IsDescending();
+
+ b.ToTable("ServiceProDeviceInfo", null, t =>
+ {
+ t.HasComment("设备信息");
+ });
+ });
+
+ modelBuilder.Entity("JiShe.ServicePro.DeviceManagement.DeviceInfos.DeviceUpgradeRecord", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uuid");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("character varying(40)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uuid")
+ .HasColumnName("CreatorId");
+
+ b.Property("DeleterId")
+ .HasColumnType("uuid")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("DeletionTime");
+
+ b.Property("DeviceAddress")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("character varying(50)")
+ .HasComment("设备地址");
+
+ b.Property("DeviceName")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("character varying(50)")
+ .HasComment("设备名称");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("text")
+ .HasColumnName("ExtraProperties")
+ .HasComment("扩展属性,用于存储自定义字段,JSON格式");
+
+ b.Property("FirmwareSignature")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("character varying(50)")
+ .HasComment("签名校验值");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("boolean")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uuid")
+ .HasColumnName("LastModifierId");
+
+ b.Property("NowFirmwareVersion")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("character varying(50)")
+ .HasComment("当前固件版本");
+
+ b.Property("OSACreatorId")
+ .HasColumnType("integer")
+ .HasComment("旧系统授权创建者Id");
+
+ b.Property("OSADeleterId")
+ .HasColumnType("integer")
+ .HasComment("旧系统授权最后删除者Id");
+
+ b.Property("OSALastModifierId")
+ .HasColumnType("integer")
+ .HasComment("旧系统授权最后修改者Id");
+
+ b.Property("OldFirmwareVersion")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("character varying(50)")
+ .HasComment("旧的固件版本");
+
+ b.Property("Remark")
+ .HasColumnType("text")
+ .HasComment("备注");
+
+ b.Property("TenantId")
+ .HasColumnType("uuid")
+ .HasColumnName("TenantId")
+ .HasComment("租户ID");
+
+ b.Property("UpgradeDate")
+ .HasColumnType("timestamp with time zone")
+ .HasComment("升级日期");
+
+ b.Property("UpgradeDescription")
+ .IsRequired()
+ .HasMaxLength(512)
+ .HasColumnType("character varying(512)")
+ .HasComment("升级描述");
+
+ b.Property("UpgradeIdentifier")
+ .HasColumnType("bigint")
+ .HasComment("升级标识符号");
+
+ b.Property("UpgradeMessage")
+ .IsRequired()
+ .HasMaxLength(512)
+ .HasColumnType("character varying(512)")
+ .HasComment("升级信息");
+
+ b.Property