合并代码

This commit is contained in:
ChenYi 2025-06-09 10:47:43 +08:00
commit e2cf4fb91e
6 changed files with 3087 additions and 2 deletions

View File

@ -1,6 +1,7 @@
using JiShe.ServicePro.BasicManagement.UserRefreshTokens; using JiShe.ServicePro.BasicManagement.UserRefreshTokens;
using JiShe.ServicePro.DeviceManagement.EntityFrameworkCore; using JiShe.ServicePro.DeviceManagement.EntityFrameworkCore;
using JiShe.ServicePro.DeviceManagement.Focuses; using JiShe.ServicePro.DeviceManagement.Focuses;
using JiShe.ServicePro.DeviceManagement.Meters;
using JiShe.ServicePro.DynamicMenuManagement.EntityFrameworkCore; using JiShe.ServicePro.DynamicMenuManagement.EntityFrameworkCore;
using JiShe.ServicePro.DynamicMenuManagement.Menus; using JiShe.ServicePro.DynamicMenuManagement.Menus;
using JiShe.ServicePro.FileManagement.EntityFrameworkCore; using JiShe.ServicePro.FileManagement.EntityFrameworkCore;
@ -55,7 +56,10 @@ namespace JiShe.IoT.EntityFrameworkCore
//文件管理 //文件管理
public DbSet<FileObject> FileObjects { get; set; } public DbSet<FileObject> FileObjects { get; set; }
public DbSet<FocusInfo> Focus { get; set; }
// 设备管理
public DbSet<FocusInfo> FocusInfo { get; set; }
public DbSet<MeterInfo> MeterInfo { get; set; }
public IoTDbContext(DbContextOptions<IoTDbContext> options) public IoTDbContext(DbContextOptions<IoTDbContext> options)
: base(options) : base(options)

View File

@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore;
namespace JiShe.IoT.Migrations namespace JiShe.IoT.Migrations
{ {
[DbContext(typeof(IoTDbContext))] [DbContext(typeof(IoTDbContext))]
[Migration("20250605034725_initCreate")] [Migration("20250605065931_initCreate")]
partial class initCreate partial class initCreate
{ {
/// <inheritdoc /> /// <inheritdoc />

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,90 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace JiShe.IoT.Migrations
{
/// <inheritdoc />
public partial class meterinfo_table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "ServiceProMeterInfo",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
MeterName = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: false, comment: "表计名称")
.Annotation("MySql:CharSet", "utf8mb4"),
MeterAddress = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "表计地址")
.Annotation("MySql:CharSet", "utf8mb4"),
MeterType = table.Column<int>(type: "int", nullable: false, comment: "表计类型"),
Protocol = table.Column<int>(type: "int", nullable: false, comment: "协议类型"),
Baudrate = table.Column<int>(type: "int", nullable: false, comment: "波特率"),
MeteringCode = table.Column<int>(type: "int", nullable: false, comment: "表计编码"),
MeteringPort = table.Column<int>(type: "int", nullable: false, comment: "表计端口"),
Password = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: false, comment: "密码")
.Annotation("MySql:CharSet", "utf8mb4"),
DynamicPassword = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "是否动态密码"),
SingleRate = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "是否单倍率"),
TypeName = table.Column<int>(type: "int", maxLength: 128, nullable: false, comment: "表计类型名称"),
SelfDevelop = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "是否自研"),
BrandType = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: true, comment: "品牌类型")
.Annotation("MySql:CharSet", "utf8mb4"),
ArchiveStatus = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "归档状态"),
TripState = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "是否跳闸"),
TimesA = table.Column<decimal>(type: "decimal(65,30)", nullable: false, comment: "倍率A"),
Timev = table.Column<decimal>(type: "decimal(65,30)", nullable: false, comment: "倍率V"),
HaveValve = table.Column<bool>(type: "tinyint(1)", nullable: true, comment: "是否带阀控"),
FocusId = table.Column<int>(type: "int", nullable: false, comment: "集中器ID"),
MeterId = table.Column<int>(type: "int", nullable: false, comment: "表计ID"),
ProjectID = table.Column<int>(type: "int", nullable: false),
DatabaseBusiID = table.Column<int>(type: "int", nullable: false, comment: "业务库ID"),
Enabled = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "是否启用"),
GatherCount = table.Column<int>(type: "int", nullable: false, comment: "采集项数量"),
FunctionCount = table.Column<int>(type: "int", nullable: false, comment: "功能数量(包含采集项和阀控等)"),
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
DeletionTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
TenantId = table.Column<Guid>(type: "char(36)", nullable: true, comment: "租户ID", collation: "ascii_general_ci"),
Remark = table.Column<string>(type: "longtext", nullable: true, comment: "备注")
.Annotation("MySql:CharSet", "utf8mb4"),
OSACreatorId = table.Column<int>(type: "int", nullable: true, comment: "旧系统授权创建者Id"),
OSALastModifierId = table.Column<int>(type: "int", nullable: true, comment: "旧系统授权最后修改者Id"),
OSADeleterId = table.Column<int>(type: "int", nullable: true, comment: "旧系统授权最后删除者Id"),
ExtraProperties = table.Column<string>(type: "longtext", nullable: true, comment: "扩展属性,用于存储自定义字段,JSON格式")
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_ServiceProMeterInfo", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_ServiceProMeterInfo_MeterAddress",
table: "ServiceProMeterInfo",
column: "MeterAddress");
migrationBuilder.CreateIndex(
name: "IX_ServiceProMeterInfo_MeterId",
table: "ServiceProMeterInfo",
column: "MeterId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ServiceProMeterInfo");
}
}
}

View File

@ -388,6 +388,190 @@ namespace JiShe.IoT.Migrations
b.ToTable("ServiceProFocusInfo", (string)null); b.ToTable("ServiceProFocusInfo", (string)null);
}); });
modelBuilder.Entity("JiShe.ServicePro.DeviceManagement.Meters.MeterInfo", b =>
{
b.Property<Guid>("Id")
.HasColumnType("char(36)");
b.Property<bool>("ArchiveStatus")
.HasColumnType("tinyint(1)")
.HasComment("归档状态");
b.Property<int>("Baudrate")
.HasColumnType("int")
.HasComment("波特率");
b.Property<string>("BrandType")
.HasMaxLength(128)
.HasColumnType("varchar(128)")
.HasComment("品牌类型");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.IsRequired()
.HasMaxLength(40)
.HasColumnType("varchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<int>("DatabaseBusiID")
.HasColumnType("int")
.HasComment("业务库ID");
b.Property<Guid?>("DeleterId")
.HasColumnType("char(36)")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime(6)")
.HasColumnName("DeletionTime");
b.Property<bool>("DynamicPassword")
.HasColumnType("tinyint(1)")
.HasComment("是否动态密码");
b.Property<bool>("Enabled")
.HasColumnType("tinyint(1)")
.HasComment("是否启用");
b.Property<string>("ExtraProperties")
.HasColumnType("longtext")
.HasColumnName("ExtraProperties")
.HasComment("扩展属性,用于存储自定义字段,JSON格式");
b.Property<int>("FocusId")
.HasColumnType("int")
.HasComment("集中器ID");
b.Property<int>("FunctionCount")
.HasColumnType("int")
.HasComment("功能数量(包含采集项和阀控等)");
b.Property<int>("GatherCount")
.HasColumnType("int")
.HasComment("采集项数量");
b.Property<bool?>("HaveValve")
.HasColumnType("tinyint(1)")
.HasComment("是否带阀控");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("char(36)")
.HasColumnName("LastModifierId");
b.Property<string>("MeterAddress")
.IsRequired()
.HasMaxLength(40)
.HasColumnType("varchar(40)")
.HasComment("表计地址");
b.Property<int>("MeterId")
.HasColumnType("int")
.HasComment("表计ID");
b.Property<string>("MeterName")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("varchar(128)")
.HasComment("表计名称");
b.Property<int>("MeterType")
.HasColumnType("int")
.HasComment("表计类型");
b.Property<int>("MeteringCode")
.HasColumnType("int")
.HasComment("表计编码");
b.Property<int>("MeteringPort")
.HasColumnType("int")
.HasComment("表计端口");
b.Property<int?>("OSACreatorId")
.HasColumnType("int")
.HasComment("旧系统授权创建者Id");
b.Property<int?>("OSADeleterId")
.HasColumnType("int")
.HasComment("旧系统授权最后删除者Id");
b.Property<int?>("OSALastModifierId")
.HasColumnType("int")
.HasComment("旧系统授权最后修改者Id");
b.Property<string>("Password")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("varchar(128)")
.HasComment("密码");
b.Property<int>("ProjectID")
.HasColumnType("int");
b.Property<int>("Protocol")
.HasColumnType("int")
.HasComment("协议类型");
b.Property<string>("Remark")
.HasColumnType("longtext")
.HasComment("备注");
b.Property<bool>("SelfDevelop")
.HasColumnType("tinyint(1)")
.HasComment("是否自研");
b.Property<bool>("SingleRate")
.HasColumnType("tinyint(1)")
.HasComment("是否单倍率");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)")
.HasColumnName("TenantId")
.HasComment("租户ID");
b.Property<decimal>("TimesA")
.HasColumnType("decimal(65,30)")
.HasComment("倍率A");
b.Property<decimal>("Timev")
.HasColumnType("decimal(65,30)")
.HasComment("倍率V");
b.Property<bool>("TripState")
.HasColumnType("tinyint(1)")
.HasComment("是否跳闸");
b.Property<int>("TypeName")
.HasMaxLength(128)
.HasColumnType("int")
.HasComment("表计类型名称");
b.HasKey("Id");
b.HasIndex("MeterAddress");
b.HasIndex("MeterId");
b.ToTable("ServiceProMeterInfo", (string)null);
});
modelBuilder.Entity("JiShe.ServicePro.DynamicMenuManagement.Menus.Menu", b => modelBuilder.Entity("JiShe.ServicePro.DynamicMenuManagement.Menus.Menu", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")