From 9f8e9f74c31630cd84bbbed14e2a50edb4e6b5e8 Mon Sep 17 00:00:00 2001 From: ChenYi <296215406@outlook.com> Date: Tue, 22 Jul 2025 16:55:59 +0800 Subject: [PATCH] =?UTF-8?q?IoTDB=E6=95=B0=E6=8D=AE=E5=AD=98=E5=82=A8?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/JiShe.IoT.DbMigrator/appsettings.json | 8 +- .../EntityFrameworkCore/IoTDbContext.cs | 8 + ... 20250722081519_InitialCreate.Designer.cs} | 612 ++++++++++++++++-- ...ate.cs => 20250722081519_InitialCreate.cs} | 283 +++++++- .../Migrations/IoTDbContextModelSnapshot.cs | 610 +++++++++++++++-- 5 files changed, 1410 insertions(+), 111 deletions(-) rename src/JiShe.IoT.EntityFrameworkCore/Migrations/{20250714034934_InitialCreate.Designer.cs => 20250722081519_InitialCreate.Designer.cs} (82%) rename src/JiShe.IoT.EntityFrameworkCore/Migrations/{20250714034934_InitialCreate.cs => 20250722081519_InitialCreate.cs} (83%) diff --git a/src/JiShe.IoT.DbMigrator/appsettings.json b/src/JiShe.IoT.DbMigrator/appsettings.json index 31b801d..4b26633 100644 --- a/src/JiShe.IoT.DbMigrator/appsettings.json +++ b/src/JiShe.IoT.DbMigrator/appsettings.json @@ -5,10 +5,10 @@ "IoTDBOptions": { "UserName": "root", "Password": "Lixiao@1980", - //"TreeModelClusterList": [ "47.110.53.196:6667", "47.110.60.222:6667", "47.110.62.104:6667" ], - //"TableModelClusterList": [ "47.110.53.196:6667", "47.110.60.222:6667", "47.110.62.104:6667" ], - "TreeModelClusterList": [ "192.168.111.37:6667" ], - "TableModelClusterList": [ "192.168.111.37:6667" ], + "TreeModelClusterList": [ "47.110.53.196:6667", "47.110.60.222:6667", "47.110.62.104:6667" ], + "TableModelClusterList": [ "47.110.53.196:6667", "47.110.60.222:6667", "47.110.62.104:6667" ], + //"TreeModelClusterList": [ "192.168.111.37:6667" ], + //"TableModelClusterList": [ "192.168.111.37:6667" ], "PoolSize": 32, "TableModelDataBaseName": "energy", "OpenDebugMode": true, diff --git a/src/JiShe.IoT.EntityFrameworkCore/EntityFrameworkCore/IoTDbContext.cs b/src/JiShe.IoT.EntityFrameworkCore/EntityFrameworkCore/IoTDbContext.cs index 8fbf798..c205cfe 100644 --- a/src/JiShe.IoT.EntityFrameworkCore/EntityFrameworkCore/IoTDbContext.cs +++ b/src/JiShe.IoT.EntityFrameworkCore/EntityFrameworkCore/IoTDbContext.cs @@ -1,4 +1,6 @@ using JiShe.ServicePro.BasicManagement.UserRefreshTokens; +using JiShe.ServicePro.CTWingManagement.CTWingAccount; +using JiShe.ServicePro.CTWingManagement.CTWingProduct; using JiShe.ServicePro.CTWingManagement.EntityFrameworkCore; using JiShe.ServicePro.DeviceManagement.EntityFrameworkCore; using JiShe.ServicePro.DeviceManagement.Focuses; @@ -8,6 +10,8 @@ using JiShe.ServicePro.DynamicMenuManagement.Menus; using JiShe.ServicePro.FileManagement.EntityFrameworkCore; using JiShe.ServicePro.FileManagement.Files; using JiShe.ServicePro.OneNETManagement.EntityFrameworkCore; +using JiShe.ServicePro.OneNETManagement.OneNETAccounts; +using JiShe.ServicePro.OneNETManagement.OneNETProducts; using JiShe.ServicePro.TemplateManagement.EntityFrameworkCore; using JiShe.ServicePro.TemplateManagement.TextTemplates; @@ -66,8 +70,12 @@ namespace JiShe.IoT.EntityFrameworkCore public DbSet MeterInfo { get; set; } // CTWing管理 + public DbSet CTWingAccountInfo { get; set; } + public DbSet CTWingPrivateProductInfo { get; set; } // OneNET管理 + public DbSet OneNETAccountInfo { get; set; } + public DbSet OneNETProductInfo { get; set; } diff --git a/src/JiShe.IoT.EntityFrameworkCore/Migrations/20250714034934_InitialCreate.Designer.cs b/src/JiShe.IoT.EntityFrameworkCore/Migrations/20250722081519_InitialCreate.Designer.cs similarity index 82% rename from src/JiShe.IoT.EntityFrameworkCore/Migrations/20250714034934_InitialCreate.Designer.cs rename to src/JiShe.IoT.EntityFrameworkCore/Migrations/20250722081519_InitialCreate.Designer.cs index dc15401..9c4583b 100644 --- a/src/JiShe.IoT.EntityFrameworkCore/Migrations/20250714034934_InitialCreate.Designer.cs +++ b/src/JiShe.IoT.EntityFrameworkCore/Migrations/20250722081519_InitialCreate.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace JiShe.IoT.Migrations { [DbContext(typeof(IoTDbContext))] - [Migration("20250714034934_InitialCreate")] + [Migration("20250722081519_InitialCreate")] partial class InitialCreate { /// @@ -109,6 +109,280 @@ namespace JiShe.IoT.Migrations b.ToTable("ServiceProUserRefreshTokens", (string)null); }); + modelBuilder.Entity("JiShe.ServicePro.CTWingManagement.CTWingAccount.CTWingAccountInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("AccountId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasComment("账号ID"); + + b.Property("AccountName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasComment("账号名称"); + + b.Property("CommunicationAddress") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasComment("通讯服务地址"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties") + .HasComment("扩展属性,用于存储自定义字段,JSON格式"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("OSACreatorId") + .HasColumnType("int") + .HasComment("旧系统授权创建者Id"); + + b.Property("OSADeleterId") + .HasColumnType("int") + .HasComment("旧系统授权最后删除者Id"); + + b.Property("OSALastModifierId") + .HasColumnType("int") + .HasComment("旧系统授权最后修改者Id"); + + b.Property("PhoneNumber") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasComment("手机号码"); + + b.Property("PlatformTenantId") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasComment("平台租户ID"); + + b.Property("ProductCount") + .HasColumnType("int"); + + b.Property("Remark") + .HasColumnType("longtext") + .HasComment("备注"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId") + .HasComment("租户ID"); + + b.HasKey("Id"); + + b.HasIndex("CreationTime"); + + b.HasIndex(new[] { "Id", "AccountId", "AccountName", "CreationTime" }, "IX_ServiceProCTWingAccountInfo_IsNotUniqueKey") + .IsDescending(); + + b.ToTable("ServiceProCTWingAccountInfo", (string)null); + }); + + modelBuilder.Entity("JiShe.ServicePro.CTWingManagement.CTWingProduct.CTWingPrivateProductInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("AccessType") + .HasColumnType("int"); + + b.Property("AuthType") + .HasColumnType("int"); + + b.Property("CTWingAccountId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasComment("账号ID"); + + b.Property("CommunicationAddress") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasComment("通讯服务地址"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DataEncryption") + .HasColumnType("int"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("DeviceCount") + .HasColumnType("int"); + + b.Property("DeviceThingModelUrl") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasComment("设备物模型文件管理地址"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties") + .HasComment("扩展属性,用于存储自定义字段,JSON格式"); + + b.Property("IoTPlatformProductId") + .HasColumnType("int"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("MasterKey") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasComment("主密钥"); + + b.Property("NetworkType") + .HasColumnType("int"); + + b.Property("NodeType") + .HasColumnType("int"); + + b.Property("OSACreatorId") + .HasColumnType("int") + .HasComment("旧系统授权创建者Id"); + + b.Property("OSADeleterId") + .HasColumnType("int") + .HasComment("旧系统授权最后删除者Id"); + + b.Property("OSALastModifierId") + .HasColumnType("int") + .HasComment("旧系统授权最后修改者Id"); + + b.Property("ProductDesc") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasComment("必填,产品描述"); + + b.Property("ProductName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasComment("产品名称"); + + b.Property("ProductProtocol") + .HasColumnType("int"); + + b.Property("ProductType") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasComment("一级分类名"); + + b.Property("Protocol") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("通讯协议"); + + b.Property("Remark") + .HasColumnType("longtext") + .HasComment("备注"); + + b.Property("SecondaryType") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasComment("二级分类名"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId") + .HasComment("租户ID"); + + b.Property("ThirdType") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasComment("三级分类名"); + + b.Property("TupDeviceModel") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasComment("设备型号"); + + b.Property("TupIsThrough") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CreationTime"); + + b.HasIndex(new[] { "Id", "IoTPlatformProductId", "ProductName", "CreationTime" }, "IX_ServiceProCTWingPrivateProductInfo_IsNotUniqueKey") + .IsDescending(); + + b.ToTable("ServiceProCTWingPrivateProductInfo", (string)null); + }); + modelBuilder.Entity("JiShe.ServicePro.DataDictionaryManagement.DataDictionaries.Aggregates.DataDictionary", b => { b.Property("Id") @@ -288,10 +562,6 @@ namespace JiShe.IoT.Migrations .HasColumnType("varchar(128)") .HasComment("集中器型号"); - b.Property("FocusId") - .HasColumnType("bigint") - .HasComment("集中器ID"); - b.Property("HardwareReleaseDate") .HasMaxLength(80) .HasColumnType("varchar(80)") @@ -310,13 +580,15 @@ namespace JiShe.IoT.Migrations .HasColumnType("int") .HasComment("物联网平台类型,默认没有指定"); - b.Property("IoTPlatformDeviceOpenId") - .HasMaxLength(50) - .HasColumnType("varchar(50)") + b.Property("IoTPlatformDeviceOpenInfo") + .HasMaxLength(128) + .HasColumnType("varchar(128)") .HasComment("集中器在物联网平台中的设备ID"); b.Property("IoTPlatformProductId") - .HasColumnType("longtext"); + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasComment("集中器在物联网平台中对应的产品Id"); b.Property("IsDeleted") .ValueGeneratedOnAdd() @@ -365,14 +637,10 @@ namespace JiShe.IoT.Migrations .HasComment("旧系统授权最后修改者Id"); b.Property("PlatformPassword") - .HasMaxLength(80) - .HasColumnType("varchar(80)") + .HasMaxLength(256) + .HasColumnType("varchar(256)") .HasComment("物联网平台设备密码"); - b.Property("ProjectID") - .HasColumnType("int") - .HasComment("项目ID"); - b.Property("Remark") .HasColumnType("longtext") .HasComment("备注"); @@ -418,7 +686,7 @@ namespace JiShe.IoT.Migrations b.HasIndex("CreationTime"); - b.HasIndex(new[] { "Id", "FocusAddress", "ProjectID", "FocusId", "CreationTime" }, "IX_ServiceProFocusInfo_IsNotUniqueKey") + b.HasIndex(new[] { "Id", "FocusAddress", "CreationTime" }, "IX_ServiceProFocusInfo_IsNotUniqueKey") .IsDescending(); b.ToTable("ServiceProFocusInfo", (string)null); @@ -475,15 +743,6 @@ namespace JiShe.IoT.Migrations .HasColumnType("char(36)") .HasColumnName("CreatorId"); - b.Property("DataTypes") - .HasMaxLength(5000) - .HasColumnType("varchar(5000)") - .HasComment("采集项编号ID"); - - b.Property("DatabaseBusiID") - .HasColumnType("int") - .HasComment("业务库ID"); - b.Property("DeleterId") .HasColumnType("char(36)") .HasColumnName("DeleterId"); @@ -511,10 +770,6 @@ namespace JiShe.IoT.Migrations .HasColumnType("varchar(20)") .HasComment("集中器地址"); - b.Property("FocusId") - .HasColumnType("int") - .HasComment("集中器ID"); - b.Property("FunctionCount") .HasColumnType("int") .HasComment("功能数量(包含采集项和阀控等)"); @@ -527,17 +782,24 @@ namespace JiShe.IoT.Migrations .HasColumnType("tinyint(1)") .HasComment("是否带阀控"); + b.Property("IoTPlatformDeviceOpenInfo") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasComment("集中器在物联网平台中对应的设备Id或者名称"); + + b.Property("IoTPlatformProductId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasComment("集中器在物联网平台中对应的产品Id"); + b.Property("IsDeleted") .ValueGeneratedOnAdd() .HasColumnType("tinyint(1)") .HasDefaultValue(false) .HasColumnName("IsDeleted"); - b.Property("ItemCodes") - .HasMaxLength(5000) - .HasColumnType("varchar(5000)") - .HasComment("采集项编码"); - b.Property("LastModificationTime") .HasColumnType("datetime(6)") .HasColumnName("LastModificationTime"); @@ -557,10 +819,6 @@ namespace JiShe.IoT.Migrations .HasColumnType("varchar(40)") .HasComment("表计地址"); - b.Property("MeterId") - .HasColumnType("int") - .HasComment("表计ID"); - b.Property("MeterName") .IsRequired() .HasMaxLength(128) @@ -602,9 +860,6 @@ namespace JiShe.IoT.Migrations .HasColumnType("varchar(128)") .HasComment("密码"); - b.Property("ProjectID") - .HasColumnType("int"); - b.Property("Protocol") .HasColumnType("int") .HasComment("协议类型"); @@ -617,10 +872,6 @@ namespace JiShe.IoT.Migrations .HasColumnType("tinyint(1)") .HasComment("是否自研"); - b.Property("SingleRate") - .HasColumnType("tinyint(1)") - .HasComment("是否单倍率"); - b.Property("Special") .HasColumnType("int") .HasComment("是否特殊表"); @@ -655,7 +906,7 @@ namespace JiShe.IoT.Migrations b.HasIndex("MeterAddress"); - b.HasIndex(new[] { "Id", "MeterAddress", "FocusAddress", "ProjectID", "FocusId", "CreationTime" }, "IX_ServiceProMeterInfo_IsNotUniqueKey") + b.HasIndex(new[] { "Id", "MeterAddress", "FocusAddress", "CreationTime" }, "IX_ServiceProMeterInfo_IsNotUniqueKey") .IsDescending(); b.ToTable("ServiceProMeterInfo", (string)null); @@ -1196,6 +1447,275 @@ namespace JiShe.IoT.Migrations b.ToTable("AbpNotificationSubscriptions", (string)null); }); + modelBuilder.Entity("JiShe.ServicePro.OneNETManagement.OneNETAccounts.OneNETAccountInfos", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Accesskey") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasComment("账户通信密钥,平台可以重置密钥"); + + b.Property("AccountName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasComment("账号名称"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties") + .HasComment("扩展属性,用于存储自定义字段,JSON格式"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("OSACreatorId") + .HasColumnType("int") + .HasComment("旧系统授权创建者Id"); + + b.Property("OSADeleterId") + .HasColumnType("int") + .HasComment("旧系统授权最后删除者Id"); + + b.Property("OSALastModifierId") + .HasColumnType("int") + .HasComment("旧系统授权最后修改者Id"); + + b.Property("OneNETAccountId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasComment("账户Id"); + + b.Property("PhoneNumber") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasComment("手机号码"); + + b.Property("ProductCount") + .HasColumnType("int"); + + b.Property("Remark") + .HasColumnType("longtext") + .HasComment("备注"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId") + .HasComment("租户ID"); + + b.HasKey("Id"); + + b.HasIndex("CreationTime"); + + b.HasIndex(new[] { "Id", "OneNETAccountId", "AccountName", "PhoneNumber", "CreationTime" }, "IX_ServiceProOneNETAccountInfo_IsNotUniqueKey") + .IsDescending(); + + b.ToTable("ServiceProOneNETAccountInfo", (string)null); + }); + + modelBuilder.Entity("JiShe.ServicePro.OneNETManagement.OneNETProducts.OneNETProductInfos", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("AccessProtocol") + .HasColumnType("int"); + + b.Property("Brand") + .HasColumnType("longtext"); + + b.Property("CommunicationAddress") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasComment("通讯服务地址"); + + b.Property("CommunicationAddressTLS") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasComment("TLS通讯服务地址"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DataProtocol") + .HasColumnType("int"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("DeviceThingModelUrl") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasComment("设备物模型文件管理地址"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties") + .HasComment("扩展属性,用于存储自定义字段,JSON格式"); + + b.Property("IoTPlatformProductId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasComment("物联网平台对应的产品Id"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("IsEncrypted") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Manufacturer") + .HasColumnType("longtext"); + + b.Property("Model") + .HasColumnType("longtext"); + + b.Property("Network") + .HasColumnType("longtext"); + + b.Property("NodeType") + .HasColumnType("int"); + + b.Property("NotActiveDeviceCount") + .HasColumnType("int"); + + b.Property("OSACreatorId") + .HasColumnType("int") + .HasComment("旧系统授权创建者Id"); + + b.Property("OSADeleterId") + .HasColumnType("int") + .HasComment("旧系统授权最后删除者Id"); + + b.Property("OSALastModifierId") + .HasColumnType("int") + .HasComment("旧系统授权最后修改者Id"); + + b.Property("OfflineDeviceCount") + .HasColumnType("int"); + + b.Property("OneNETAccountId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasComment("账户Id"); + + b.Property("OnlineDeviceCount") + .HasColumnType("int"); + + b.Property("OwnDeviceCount") + .HasColumnType("int"); + + b.Property("ProductAccesskey") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasComment("产品访问密钥"); + + b.Property("ProductCreateTime") + .HasColumnType("datetime(6)"); + + b.Property("ProductName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasComment("产品名称"); + + b.Property("ProductUpdateTime") + .HasColumnType("datetime(6)"); + + b.Property("Remark") + .HasColumnType("longtext") + .HasComment("备注"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId") + .HasComment("租户ID"); + + b.HasKey("Id"); + + b.HasIndex("CreationTime"); + + b.HasIndex(new[] { "Id", "IoTPlatformProductId", "ProductName", "CreationTime" }, "IX_ServiceProOneNETProductInfo_IsNotUniqueKey") + .IsDescending(); + + b.ToTable("ServiceProOneNETProductInfo", (string)null); + }); + modelBuilder.Entity("JiShe.ServicePro.TemplateManagement.TextTemplates.TextTemplate", b => { b.Property("Id") diff --git a/src/JiShe.IoT.EntityFrameworkCore/Migrations/20250714034934_InitialCreate.cs b/src/JiShe.IoT.EntityFrameworkCore/Migrations/20250722081519_InitialCreate.cs similarity index 83% rename from src/JiShe.IoT.EntityFrameworkCore/Migrations/20250714034934_InitialCreate.cs rename to src/JiShe.IoT.EntityFrameworkCore/Migrations/20250722081519_InitialCreate.cs index 4d3bf76..5927aef 100644 --- a/src/JiShe.IoT.EntityFrameworkCore/Migrations/20250714034934_InitialCreate.cs +++ b/src/JiShe.IoT.EntityFrameworkCore/Migrations/20250722081519_InitialCreate.cs @@ -734,6 +734,107 @@ namespace JiShe.IoT.Migrations }) .Annotation("MySql:CharSet", "utf8mb4"); + migrationBuilder.CreateTable( + name: "ServiceProCTWingAccountInfo", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + AccountName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "账号名称") + .Annotation("MySql:CharSet", "utf8mb4"), + AccountId = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "账号ID") + .Annotation("MySql:CharSet", "utf8mb4"), + PlatformTenantId = table.Column(type: "varchar(128)", maxLength: 128, nullable: true, comment: "平台租户ID") + .Annotation("MySql:CharSet", "utf8mb4"), + CommunicationAddress = table.Column(type: "varchar(128)", maxLength: 128, nullable: true, comment: "通讯服务地址") + .Annotation("MySql:CharSet", "utf8mb4"), + PhoneNumber = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "手机号码") + .Annotation("MySql:CharSet", "utf8mb4"), + ProductCount = table.Column(type: "int", nullable: false), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + CreationTime = table.Column(type: "datetime(6)", nullable: false), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + LastModificationTime = table.Column(type: "datetime(6)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + DeletionTime = table.Column(type: "datetime(6)", nullable: true), + TenantId = table.Column(type: "char(36)", nullable: true, comment: "租户ID", collation: "ascii_general_ci"), + Remark = table.Column(type: "longtext", nullable: true, comment: "备注") + .Annotation("MySql:CharSet", "utf8mb4"), + OSACreatorId = table.Column(type: "int", nullable: true, comment: "旧系统授权创建者Id"), + OSALastModifierId = table.Column(type: "int", nullable: true, comment: "旧系统授权最后修改者Id"), + OSADeleterId = table.Column(type: "int", nullable: true, comment: "旧系统授权最后删除者Id"), + ExtraProperties = table.Column(type: "longtext", nullable: true, comment: "扩展属性,用于存储自定义字段,JSON格式") + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_ServiceProCTWingAccountInfo", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ServiceProCTWingPrivateProductInfo", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + CTWingAccountId = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "账号ID") + .Annotation("MySql:CharSet", "utf8mb4"), + CommunicationAddress = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "通讯服务地址") + .Annotation("MySql:CharSet", "utf8mb4"), + MasterKey = table.Column(type: "varchar(128)", maxLength: 128, nullable: true, comment: "主密钥") + .Annotation("MySql:CharSet", "utf8mb4"), + IoTPlatformProductId = table.Column(type: "int", nullable: false), + ProductName = table.Column(type: "varchar(128)", maxLength: 128, nullable: true, comment: "产品名称") + .Annotation("MySql:CharSet", "utf8mb4"), + Protocol = table.Column(type: "varchar(20)", maxLength: 20, nullable: true, comment: "通讯协议") + .Annotation("MySql:CharSet", "utf8mb4"), + ProductDesc = table.Column(type: "varchar(128)", maxLength: 128, nullable: true, comment: "必填,产品描述") + .Annotation("MySql:CharSet", "utf8mb4"), + ProductType = table.Column(type: "varchar(128)", maxLength: 128, nullable: true, comment: "一级分类名") + .Annotation("MySql:CharSet", "utf8mb4"), + SecondaryType = table.Column(type: "varchar(128)", maxLength: 128, nullable: true, comment: "二级分类名") + .Annotation("MySql:CharSet", "utf8mb4"), + ThirdType = table.Column(type: "varchar(128)", maxLength: 128, nullable: true, comment: "三级分类名") + .Annotation("MySql:CharSet", "utf8mb4"), + NodeType = table.Column(type: "int", nullable: false), + AccessType = table.Column(type: "int", nullable: false), + NetworkType = table.Column(type: "int", nullable: false), + ProductProtocol = table.Column(type: "int", nullable: false), + AuthType = table.Column(type: "int", nullable: false), + DataEncryption = table.Column(type: "int", nullable: false), + TupIsThrough = table.Column(type: "int", nullable: false), + TupDeviceModel = table.Column(type: "varchar(128)", maxLength: 128, nullable: true, comment: "设备型号") + .Annotation("MySql:CharSet", "utf8mb4"), + DeviceCount = table.Column(type: "int", nullable: false), + DeviceThingModelUrl = table.Column(type: "varchar(256)", maxLength: 256, nullable: true, comment: "设备物模型文件管理地址") + .Annotation("MySql:CharSet", "utf8mb4"), + IsEnabled = table.Column(type: "tinyint(1)", nullable: false), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + CreationTime = table.Column(type: "datetime(6)", nullable: false), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + LastModificationTime = table.Column(type: "datetime(6)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + DeletionTime = table.Column(type: "datetime(6)", nullable: true), + TenantId = table.Column(type: "char(36)", nullable: true, comment: "租户ID", collation: "ascii_general_ci"), + Remark = table.Column(type: "longtext", nullable: true, comment: "备注") + .Annotation("MySql:CharSet", "utf8mb4"), + OSACreatorId = table.Column(type: "int", nullable: true, comment: "旧系统授权创建者Id"), + OSALastModifierId = table.Column(type: "int", nullable: true, comment: "旧系统授权最后修改者Id"), + OSADeleterId = table.Column(type: "int", nullable: true, comment: "旧系统授权最后删除者Id"), + ExtraProperties = table.Column(type: "longtext", nullable: true, comment: "扩展属性,用于存储自定义字段,JSON格式") + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_ServiceProCTWingPrivateProductInfo", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + migrationBuilder.CreateTable( name: "ServiceProFocusInfo", columns: table => new @@ -756,8 +857,6 @@ namespace JiShe.IoT.Migrations HeartbeatInterval = table.Column(type: "int", nullable: false, comment: "心跳间隔"), LastRefreshTime = table.Column(type: "datetime(6)", nullable: true, comment: "最后刷新时间"), TimeDensity = table.Column(type: "int", nullable: false, comment: "采集密度"), - FocusId = table.Column(type: "bigint", nullable: false, comment: "集中器ID"), - ProjectID = table.Column(type: "int", nullable: false, comment: "项目ID"), Enabled = table.Column(type: "tinyint(1)", nullable: false, comment: "是否启用"), SimCard = table.Column(type: "varchar(80)", maxLength: 80, nullable: true, comment: "通讯SIM卡卡号") .Annotation("MySql:CharSet", "utf8mb4"), @@ -773,12 +872,12 @@ namespace JiShe.IoT.Migrations .Annotation("MySql:CharSet", "utf8mb4"), HardwareReleaseDate = table.Column(type: "varchar(80)", maxLength: 80, nullable: true, comment: "硬件软件发布日期:日月年") .Annotation("MySql:CharSet", "utf8mb4"), - IoTPlatformDeviceOpenId = table.Column(type: "varchar(50)", maxLength: 50, nullable: true, comment: "集中器在物联网平台中的设备ID") + IoTPlatformDeviceOpenInfo = table.Column(type: "varchar(128)", maxLength: 128, nullable: true, comment: "集中器在物联网平台中的设备ID") .Annotation("MySql:CharSet", "utf8mb4"), IoTPlatform = table.Column(type: "int", nullable: false, comment: "物联网平台类型,默认没有指定"), - PlatformPassword = table.Column(type: "varchar(80)", maxLength: 80, nullable: true, comment: "物联网平台设备密码") + PlatformPassword = table.Column(type: "varchar(256)", maxLength: 256, nullable: true, comment: "物联网平台设备密码") .Annotation("MySql:CharSet", "utf8mb4"), - IoTPlatformProductId = table.Column(type: "longtext", nullable: true) + IoTPlatformProductId = table.Column(type: "varchar(128)", maxLength: 128, nullable: true, comment: "集中器在物联网平台中对应的产品Id") .Annotation("MySql:CharSet", "utf8mb4"), ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), @@ -871,7 +970,6 @@ namespace JiShe.IoT.Migrations Password = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "密码") .Annotation("MySql:CharSet", "utf8mb4"), DynamicPassword = table.Column(type: "tinyint(1)", nullable: false, comment: "是否动态密码"), - SingleRate = table.Column(type: "tinyint(1)", nullable: false, comment: "是否单倍率"), TypeName = table.Column(type: "int", maxLength: 128, nullable: false, comment: "表计类型名称"), SelfDevelop = table.Column(type: "tinyint(1)", nullable: false, comment: "是否自研"), BrandType = table.Column(type: "varchar(128)", maxLength: 128, nullable: true, comment: "品牌类型") @@ -881,17 +979,9 @@ namespace JiShe.IoT.Migrations TimesA = table.Column(type: "decimal(18,4)", nullable: false, comment: "倍率A"), Timev = table.Column(type: "decimal(18,4)", nullable: false, comment: "倍率V"), HaveValve = table.Column(type: "tinyint(1)", nullable: true, comment: "是否带阀控"), - FocusId = table.Column(type: "int", nullable: false, comment: "集中器ID"), - MeterId = table.Column(type: "int", nullable: false, comment: "表计ID"), - ProjectID = table.Column(type: "int", nullable: false), - DatabaseBusiID = table.Column(type: "int", nullable: false, comment: "业务库ID"), Enabled = table.Column(type: "tinyint(1)", nullable: false, comment: "是否启用"), GatherCount = table.Column(type: "int", nullable: false, comment: "采集项数量"), FunctionCount = table.Column(type: "int", nullable: false, comment: "功能数量(包含采集项和阀控等)"), - ItemCodes = table.Column(type: "varchar(5000)", maxLength: 5000, nullable: true, comment: "采集项编码") - .Annotation("MySql:CharSet", "utf8mb4"), - DataTypes = table.Column(type: "varchar(5000)", maxLength: 5000, nullable: true, comment: "采集项编号ID") - .Annotation("MySql:CharSet", "utf8mb4"), Address = table.Column(type: "varchar(20)", maxLength: 20, nullable: true, comment: "表计地址") .Annotation("MySql:CharSet", "utf8mb4"), AreaCode = table.Column(type: "varchar(20)", maxLength: 20, nullable: true, comment: "表计区域编码") @@ -902,6 +992,10 @@ namespace JiShe.IoT.Migrations .Annotation("MySql:CharSet", "utf8mb4"), Special = table.Column(type: "int", nullable: false, comment: "是否特殊表"), AutomaticReport = table.Column(type: "int", nullable: false, comment: "是否自动采集"), + IoTPlatformProductId = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "集中器在物联网平台中对应的产品Id") + .Annotation("MySql:CharSet", "utf8mb4"), + IoTPlatformDeviceOpenInfo = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "集中器在物联网平台中对应的设备Id或者名称") + .Annotation("MySql:CharSet", "utf8mb4"), ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), CreationTime = table.Column(type: "datetime(6)", nullable: false), @@ -926,6 +1020,107 @@ namespace JiShe.IoT.Migrations }) .Annotation("MySql:CharSet", "utf8mb4"); + migrationBuilder.CreateTable( + name: "ServiceProOneNETAccountInfo", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + AccountName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "账号名称") + .Annotation("MySql:CharSet", "utf8mb4"), + OneNETAccountId = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "账户Id") + .Annotation("MySql:CharSet", "utf8mb4"), + PhoneNumber = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "手机号码") + .Annotation("MySql:CharSet", "utf8mb4"), + Accesskey = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "账户通信密钥,平台可以重置密钥") + .Annotation("MySql:CharSet", "utf8mb4"), + ProductCount = table.Column(type: "int", nullable: false), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + CreationTime = table.Column(type: "datetime(6)", nullable: false), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + LastModificationTime = table.Column(type: "datetime(6)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + DeletionTime = table.Column(type: "datetime(6)", nullable: true), + TenantId = table.Column(type: "char(36)", nullable: true, comment: "租户ID", collation: "ascii_general_ci"), + Remark = table.Column(type: "longtext", nullable: true, comment: "备注") + .Annotation("MySql:CharSet", "utf8mb4"), + OSACreatorId = table.Column(type: "int", nullable: true, comment: "旧系统授权创建者Id"), + OSALastModifierId = table.Column(type: "int", nullable: true, comment: "旧系统授权最后修改者Id"), + OSADeleterId = table.Column(type: "int", nullable: true, comment: "旧系统授权最后删除者Id"), + ExtraProperties = table.Column(type: "longtext", nullable: true, comment: "扩展属性,用于存储自定义字段,JSON格式") + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_ServiceProOneNETAccountInfo", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ServiceProOneNETProductInfo", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + OneNETAccountId = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "账户Id") + .Annotation("MySql:CharSet", "utf8mb4"), + IoTPlatformProductId = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "物联网平台对应的产品Id") + .Annotation("MySql:CharSet", "utf8mb4"), + ProductName = table.Column(type: "varchar(128)", maxLength: 128, nullable: true, comment: "产品名称") + .Annotation("MySql:CharSet", "utf8mb4"), + ProductAccesskey = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "产品访问密钥") + .Annotation("MySql:CharSet", "utf8mb4"), + DeviceThingModelUrl = table.Column(type: "varchar(256)", maxLength: 256, nullable: true, comment: "设备物模型文件管理地址") + .Annotation("MySql:CharSet", "utf8mb4"), + IsEncrypted = table.Column(type: "tinyint(1)", nullable: false), + IsEnabled = table.Column(type: "tinyint(1)", nullable: false), + AccessProtocol = table.Column(type: "int", nullable: false), + DataProtocol = table.Column(type: "int", nullable: false), + NodeType = table.Column(type: "int", nullable: false), + ProductCreateTime = table.Column(type: "datetime(6)", nullable: false), + ProductUpdateTime = table.Column(type: "datetime(6)", nullable: false), + Network = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Manufacturer = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Model = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Brand = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Status = table.Column(type: "int", nullable: false), + OwnDeviceCount = table.Column(type: "int", nullable: false), + OnlineDeviceCount = table.Column(type: "int", nullable: false), + OfflineDeviceCount = table.Column(type: "int", nullable: false), + NotActiveDeviceCount = table.Column(type: "int", nullable: false), + CommunicationAddress = table.Column(type: "varchar(256)", maxLength: 256, nullable: true, comment: "通讯服务地址") + .Annotation("MySql:CharSet", "utf8mb4"), + CommunicationAddressTLS = table.Column(type: "varchar(256)", maxLength: 256, nullable: true, comment: "TLS通讯服务地址") + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + CreationTime = table.Column(type: "datetime(6)", nullable: false), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + LastModificationTime = table.Column(type: "datetime(6)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + DeletionTime = table.Column(type: "datetime(6)", nullable: true), + TenantId = table.Column(type: "char(36)", nullable: true, comment: "租户ID", collation: "ascii_general_ci"), + Remark = table.Column(type: "longtext", nullable: true, comment: "备注") + .Annotation("MySql:CharSet", "utf8mb4"), + OSACreatorId = table.Column(type: "int", nullable: true, comment: "旧系统授权创建者Id"), + OSALastModifierId = table.Column(type: "int", nullable: true, comment: "旧系统授权最后修改者Id"), + OSADeleterId = table.Column(type: "int", nullable: true, comment: "旧系统授权最后删除者Id"), + ExtraProperties = table.Column(type: "longtext", nullable: true, comment: "扩展属性,用于存储自定义字段,JSON格式") + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_ServiceProOneNETProductInfo", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + migrationBuilder.CreateTable( name: "ServiceProTextTemplates", columns: table => new @@ -1553,6 +1748,28 @@ namespace JiShe.IoT.Migrations table: "AbpUsers", column: "UserName"); + migrationBuilder.CreateIndex( + name: "IX_ServiceProCTWingAccountInfo_CreationTime", + table: "ServiceProCTWingAccountInfo", + column: "CreationTime"); + + migrationBuilder.CreateIndex( + name: "IX_ServiceProCTWingAccountInfo_IsNotUniqueKey", + table: "ServiceProCTWingAccountInfo", + columns: new[] { "Id", "AccountId", "AccountName", "CreationTime" }, + descending: new bool[0]); + + migrationBuilder.CreateIndex( + name: "IX_ServiceProCTWingPrivateProductInfo_CreationTime", + table: "ServiceProCTWingPrivateProductInfo", + column: "CreationTime"); + + migrationBuilder.CreateIndex( + name: "IX_ServiceProCTWingPrivateProductInfo_IsNotUniqueKey", + table: "ServiceProCTWingPrivateProductInfo", + columns: new[] { "Id", "IoTPlatformProductId", "ProductName", "CreationTime" }, + descending: new bool[0]); + migrationBuilder.CreateIndex( name: "IX_ServiceProFocusInfo_CreationTime", table: "ServiceProFocusInfo", @@ -1561,7 +1778,7 @@ namespace JiShe.IoT.Migrations migrationBuilder.CreateIndex( name: "IX_ServiceProFocusInfo_IsNotUniqueKey", table: "ServiceProFocusInfo", - columns: new[] { "Id", "FocusAddress", "ProjectID", "FocusId", "CreationTime" }, + columns: new[] { "Id", "FocusAddress", "CreationTime" }, descending: new bool[0]); migrationBuilder.CreateIndex( @@ -1577,7 +1794,7 @@ namespace JiShe.IoT.Migrations migrationBuilder.CreateIndex( name: "IX_ServiceProMeterInfo_IsNotUniqueKey", table: "ServiceProMeterInfo", - columns: new[] { "Id", "MeterAddress", "FocusAddress", "ProjectID", "FocusId", "CreationTime" }, + columns: new[] { "Id", "MeterAddress", "FocusAddress", "CreationTime" }, descending: new bool[0]); migrationBuilder.CreateIndex( @@ -1585,6 +1802,28 @@ namespace JiShe.IoT.Migrations table: "ServiceProMeterInfo", column: "MeterAddress"); + migrationBuilder.CreateIndex( + name: "IX_ServiceProOneNETAccountInfo_CreationTime", + table: "ServiceProOneNETAccountInfo", + column: "CreationTime"); + + migrationBuilder.CreateIndex( + name: "IX_ServiceProOneNETAccountInfo_IsNotUniqueKey", + table: "ServiceProOneNETAccountInfo", + columns: new[] { "Id", "OneNETAccountId", "AccountName", "PhoneNumber", "CreationTime" }, + descending: new bool[0]); + + migrationBuilder.CreateIndex( + name: "IX_ServiceProOneNETProductInfo_CreationTime", + table: "ServiceProOneNETProductInfo", + column: "CreationTime"); + + migrationBuilder.CreateIndex( + name: "IX_ServiceProOneNETProductInfo_IsNotUniqueKey", + table: "ServiceProOneNETProductInfo", + columns: new[] { "Id", "IoTPlatformProductId", "ProductName", "CreationTime" }, + descending: new bool[0]); + migrationBuilder.CreateIndex( name: "IX_ServiceProTextTemplates_Code", table: "ServiceProTextTemplates", @@ -1689,6 +1928,12 @@ namespace JiShe.IoT.Migrations migrationBuilder.DropTable( name: "AbpUserTokens"); + migrationBuilder.DropTable( + name: "ServiceProCTWingAccountInfo"); + + migrationBuilder.DropTable( + name: "ServiceProCTWingPrivateProductInfo"); + migrationBuilder.DropTable( name: "ServiceProFocusInfo"); @@ -1698,6 +1943,12 @@ namespace JiShe.IoT.Migrations migrationBuilder.DropTable( name: "ServiceProMeterInfo"); + migrationBuilder.DropTable( + name: "ServiceProOneNETAccountInfo"); + + migrationBuilder.DropTable( + name: "ServiceProOneNETProductInfo"); + migrationBuilder.DropTable( name: "ServiceProTextTemplates"); diff --git a/src/JiShe.IoT.EntityFrameworkCore/Migrations/IoTDbContextModelSnapshot.cs b/src/JiShe.IoT.EntityFrameworkCore/Migrations/IoTDbContextModelSnapshot.cs index 4169eed..f057721 100644 --- a/src/JiShe.IoT.EntityFrameworkCore/Migrations/IoTDbContextModelSnapshot.cs +++ b/src/JiShe.IoT.EntityFrameworkCore/Migrations/IoTDbContextModelSnapshot.cs @@ -106,6 +106,280 @@ namespace JiShe.IoT.Migrations b.ToTable("ServiceProUserRefreshTokens", (string)null); }); + modelBuilder.Entity("JiShe.ServicePro.CTWingManagement.CTWingAccount.CTWingAccountInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("AccountId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasComment("账号ID"); + + b.Property("AccountName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasComment("账号名称"); + + b.Property("CommunicationAddress") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasComment("通讯服务地址"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties") + .HasComment("扩展属性,用于存储自定义字段,JSON格式"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("OSACreatorId") + .HasColumnType("int") + .HasComment("旧系统授权创建者Id"); + + b.Property("OSADeleterId") + .HasColumnType("int") + .HasComment("旧系统授权最后删除者Id"); + + b.Property("OSALastModifierId") + .HasColumnType("int") + .HasComment("旧系统授权最后修改者Id"); + + b.Property("PhoneNumber") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasComment("手机号码"); + + b.Property("PlatformTenantId") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasComment("平台租户ID"); + + b.Property("ProductCount") + .HasColumnType("int"); + + b.Property("Remark") + .HasColumnType("longtext") + .HasComment("备注"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId") + .HasComment("租户ID"); + + b.HasKey("Id"); + + b.HasIndex("CreationTime"); + + b.HasIndex(new[] { "Id", "AccountId", "AccountName", "CreationTime" }, "IX_ServiceProCTWingAccountInfo_IsNotUniqueKey") + .IsDescending(); + + b.ToTable("ServiceProCTWingAccountInfo", (string)null); + }); + + modelBuilder.Entity("JiShe.ServicePro.CTWingManagement.CTWingProduct.CTWingPrivateProductInfo", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("AccessType") + .HasColumnType("int"); + + b.Property("AuthType") + .HasColumnType("int"); + + b.Property("CTWingAccountId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasComment("账号ID"); + + b.Property("CommunicationAddress") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasComment("通讯服务地址"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DataEncryption") + .HasColumnType("int"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("DeviceCount") + .HasColumnType("int"); + + b.Property("DeviceThingModelUrl") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasComment("设备物模型文件管理地址"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties") + .HasComment("扩展属性,用于存储自定义字段,JSON格式"); + + b.Property("IoTPlatformProductId") + .HasColumnType("int"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("MasterKey") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasComment("主密钥"); + + b.Property("NetworkType") + .HasColumnType("int"); + + b.Property("NodeType") + .HasColumnType("int"); + + b.Property("OSACreatorId") + .HasColumnType("int") + .HasComment("旧系统授权创建者Id"); + + b.Property("OSADeleterId") + .HasColumnType("int") + .HasComment("旧系统授权最后删除者Id"); + + b.Property("OSALastModifierId") + .HasColumnType("int") + .HasComment("旧系统授权最后修改者Id"); + + b.Property("ProductDesc") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasComment("必填,产品描述"); + + b.Property("ProductName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasComment("产品名称"); + + b.Property("ProductProtocol") + .HasColumnType("int"); + + b.Property("ProductType") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasComment("一级分类名"); + + b.Property("Protocol") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("通讯协议"); + + b.Property("Remark") + .HasColumnType("longtext") + .HasComment("备注"); + + b.Property("SecondaryType") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasComment("二级分类名"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId") + .HasComment("租户ID"); + + b.Property("ThirdType") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasComment("三级分类名"); + + b.Property("TupDeviceModel") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasComment("设备型号"); + + b.Property("TupIsThrough") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CreationTime"); + + b.HasIndex(new[] { "Id", "IoTPlatformProductId", "ProductName", "CreationTime" }, "IX_ServiceProCTWingPrivateProductInfo_IsNotUniqueKey") + .IsDescending(); + + b.ToTable("ServiceProCTWingPrivateProductInfo", (string)null); + }); + modelBuilder.Entity("JiShe.ServicePro.DataDictionaryManagement.DataDictionaries.Aggregates.DataDictionary", b => { b.Property("Id") @@ -285,10 +559,6 @@ namespace JiShe.IoT.Migrations .HasColumnType("varchar(128)") .HasComment("集中器型号"); - b.Property("FocusId") - .HasColumnType("bigint") - .HasComment("集中器ID"); - b.Property("HardwareReleaseDate") .HasMaxLength(80) .HasColumnType("varchar(80)") @@ -307,13 +577,15 @@ namespace JiShe.IoT.Migrations .HasColumnType("int") .HasComment("物联网平台类型,默认没有指定"); - b.Property("IoTPlatformDeviceOpenId") - .HasMaxLength(50) - .HasColumnType("varchar(50)") + b.Property("IoTPlatformDeviceOpenInfo") + .HasMaxLength(128) + .HasColumnType("varchar(128)") .HasComment("集中器在物联网平台中的设备ID"); b.Property("IoTPlatformProductId") - .HasColumnType("longtext"); + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasComment("集中器在物联网平台中对应的产品Id"); b.Property("IsDeleted") .ValueGeneratedOnAdd() @@ -362,14 +634,10 @@ namespace JiShe.IoT.Migrations .HasComment("旧系统授权最后修改者Id"); b.Property("PlatformPassword") - .HasMaxLength(80) - .HasColumnType("varchar(80)") + .HasMaxLength(256) + .HasColumnType("varchar(256)") .HasComment("物联网平台设备密码"); - b.Property("ProjectID") - .HasColumnType("int") - .HasComment("项目ID"); - b.Property("Remark") .HasColumnType("longtext") .HasComment("备注"); @@ -415,7 +683,7 @@ namespace JiShe.IoT.Migrations b.HasIndex("CreationTime"); - b.HasIndex(new[] { "Id", "FocusAddress", "ProjectID", "FocusId", "CreationTime" }, "IX_ServiceProFocusInfo_IsNotUniqueKey") + b.HasIndex(new[] { "Id", "FocusAddress", "CreationTime" }, "IX_ServiceProFocusInfo_IsNotUniqueKey") .IsDescending(); b.ToTable("ServiceProFocusInfo", (string)null); @@ -472,15 +740,6 @@ namespace JiShe.IoT.Migrations .HasColumnType("char(36)") .HasColumnName("CreatorId"); - b.Property("DataTypes") - .HasMaxLength(5000) - .HasColumnType("varchar(5000)") - .HasComment("采集项编号ID"); - - b.Property("DatabaseBusiID") - .HasColumnType("int") - .HasComment("业务库ID"); - b.Property("DeleterId") .HasColumnType("char(36)") .HasColumnName("DeleterId"); @@ -508,10 +767,6 @@ namespace JiShe.IoT.Migrations .HasColumnType("varchar(20)") .HasComment("集中器地址"); - b.Property("FocusId") - .HasColumnType("int") - .HasComment("集中器ID"); - b.Property("FunctionCount") .HasColumnType("int") .HasComment("功能数量(包含采集项和阀控等)"); @@ -524,17 +779,24 @@ namespace JiShe.IoT.Migrations .HasColumnType("tinyint(1)") .HasComment("是否带阀控"); + b.Property("IoTPlatformDeviceOpenInfo") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasComment("集中器在物联网平台中对应的设备Id或者名称"); + + b.Property("IoTPlatformProductId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasComment("集中器在物联网平台中对应的产品Id"); + b.Property("IsDeleted") .ValueGeneratedOnAdd() .HasColumnType("tinyint(1)") .HasDefaultValue(false) .HasColumnName("IsDeleted"); - b.Property("ItemCodes") - .HasMaxLength(5000) - .HasColumnType("varchar(5000)") - .HasComment("采集项编码"); - b.Property("LastModificationTime") .HasColumnType("datetime(6)") .HasColumnName("LastModificationTime"); @@ -554,10 +816,6 @@ namespace JiShe.IoT.Migrations .HasColumnType("varchar(40)") .HasComment("表计地址"); - b.Property("MeterId") - .HasColumnType("int") - .HasComment("表计ID"); - b.Property("MeterName") .IsRequired() .HasMaxLength(128) @@ -599,9 +857,6 @@ namespace JiShe.IoT.Migrations .HasColumnType("varchar(128)") .HasComment("密码"); - b.Property("ProjectID") - .HasColumnType("int"); - b.Property("Protocol") .HasColumnType("int") .HasComment("协议类型"); @@ -614,10 +869,6 @@ namespace JiShe.IoT.Migrations .HasColumnType("tinyint(1)") .HasComment("是否自研"); - b.Property("SingleRate") - .HasColumnType("tinyint(1)") - .HasComment("是否单倍率"); - b.Property("Special") .HasColumnType("int") .HasComment("是否特殊表"); @@ -652,7 +903,7 @@ namespace JiShe.IoT.Migrations b.HasIndex("MeterAddress"); - b.HasIndex(new[] { "Id", "MeterAddress", "FocusAddress", "ProjectID", "FocusId", "CreationTime" }, "IX_ServiceProMeterInfo_IsNotUniqueKey") + b.HasIndex(new[] { "Id", "MeterAddress", "FocusAddress", "CreationTime" }, "IX_ServiceProMeterInfo_IsNotUniqueKey") .IsDescending(); b.ToTable("ServiceProMeterInfo", (string)null); @@ -1193,6 +1444,275 @@ namespace JiShe.IoT.Migrations b.ToTable("AbpNotificationSubscriptions", (string)null); }); + modelBuilder.Entity("JiShe.ServicePro.OneNETManagement.OneNETAccounts.OneNETAccountInfos", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Accesskey") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasComment("账户通信密钥,平台可以重置密钥"); + + b.Property("AccountName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasComment("账号名称"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties") + .HasComment("扩展属性,用于存储自定义字段,JSON格式"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("OSACreatorId") + .HasColumnType("int") + .HasComment("旧系统授权创建者Id"); + + b.Property("OSADeleterId") + .HasColumnType("int") + .HasComment("旧系统授权最后删除者Id"); + + b.Property("OSALastModifierId") + .HasColumnType("int") + .HasComment("旧系统授权最后修改者Id"); + + b.Property("OneNETAccountId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasComment("账户Id"); + + b.Property("PhoneNumber") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasComment("手机号码"); + + b.Property("ProductCount") + .HasColumnType("int"); + + b.Property("Remark") + .HasColumnType("longtext") + .HasComment("备注"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId") + .HasComment("租户ID"); + + b.HasKey("Id"); + + b.HasIndex("CreationTime"); + + b.HasIndex(new[] { "Id", "OneNETAccountId", "AccountName", "PhoneNumber", "CreationTime" }, "IX_ServiceProOneNETAccountInfo_IsNotUniqueKey") + .IsDescending(); + + b.ToTable("ServiceProOneNETAccountInfo", (string)null); + }); + + modelBuilder.Entity("JiShe.ServicePro.OneNETManagement.OneNETProducts.OneNETProductInfos", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("AccessProtocol") + .HasColumnType("int"); + + b.Property("Brand") + .HasColumnType("longtext"); + + b.Property("CommunicationAddress") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasComment("通讯服务地址"); + + b.Property("CommunicationAddressTLS") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasComment("TLS通讯服务地址"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DataProtocol") + .HasColumnType("int"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("DeviceThingModelUrl") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasComment("设备物模型文件管理地址"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties") + .HasComment("扩展属性,用于存储自定义字段,JSON格式"); + + b.Property("IoTPlatformProductId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasComment("物联网平台对应的产品Id"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("IsEncrypted") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Manufacturer") + .HasColumnType("longtext"); + + b.Property("Model") + .HasColumnType("longtext"); + + b.Property("Network") + .HasColumnType("longtext"); + + b.Property("NodeType") + .HasColumnType("int"); + + b.Property("NotActiveDeviceCount") + .HasColumnType("int"); + + b.Property("OSACreatorId") + .HasColumnType("int") + .HasComment("旧系统授权创建者Id"); + + b.Property("OSADeleterId") + .HasColumnType("int") + .HasComment("旧系统授权最后删除者Id"); + + b.Property("OSALastModifierId") + .HasColumnType("int") + .HasComment("旧系统授权最后修改者Id"); + + b.Property("OfflineDeviceCount") + .HasColumnType("int"); + + b.Property("OneNETAccountId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasComment("账户Id"); + + b.Property("OnlineDeviceCount") + .HasColumnType("int"); + + b.Property("OwnDeviceCount") + .HasColumnType("int"); + + b.Property("ProductAccesskey") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasComment("产品访问密钥"); + + b.Property("ProductCreateTime") + .HasColumnType("datetime(6)"); + + b.Property("ProductName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasComment("产品名称"); + + b.Property("ProductUpdateTime") + .HasColumnType("datetime(6)"); + + b.Property("Remark") + .HasColumnType("longtext") + .HasComment("备注"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId") + .HasComment("租户ID"); + + b.HasKey("Id"); + + b.HasIndex("CreationTime"); + + b.HasIndex(new[] { "Id", "IoTPlatformProductId", "ProductName", "CreationTime" }, "IX_ServiceProOneNETProductInfo_IsNotUniqueKey") + .IsDescending(); + + b.ToTable("ServiceProOneNETProductInfo", (string)null); + }); + modelBuilder.Entity("JiShe.ServicePro.TemplateManagement.TextTemplates.TextTemplate", b => { b.Property("Id")