添加集中器,表计同步到mysql并缓存集中器和表计到reids

添加定时任务执行
This commit is contained in:
zenghongyao 2025-06-12 17:55:19 +08:00
parent e835765466
commit ba2927a3af
14 changed files with 372 additions and 18 deletions

View File

@ -2,7 +2,7 @@
<!-- 定义项目加载属性 --> <!-- 定义项目加载属性 -->
<PropertyGroup> <PropertyGroup>
<!--JiShe.ServicePro版本--> <!--JiShe.ServicePro版本-->
<ServiceProVersion>1.0.5.22</ServiceProVersion> <ServiceProVersion>1.0.5.26</ServiceProVersion>
<!--Volo Abp 版本--> <!--Volo Abp 版本-->
<VoloAbpVersion>9.1.1</VoloAbpVersion> <VoloAbpVersion>9.1.1</VoloAbpVersion>

View File

@ -5,8 +5,12 @@
}, },
"ConnectionStrings": { "ConnectionStrings": {
"Default": "Data Source=47.110.60.222;Port=13306;Database=JiSheIoTProDB;uid=root;pwd=JiShe!aqG#5kGgh&0;charset=utf8mb4;Allow User Variables=true;AllowLoadLocalInfile=true;", "Default": "Data Source=47.110.60.222;Port=13306;Database=JiSheIoTProDB;uid=root;pwd=JiShe!aqG#5kGgh&0;charset=utf8mb4;Allow User Variables=true;AllowLoadLocalInfile=true;",
"PrepayDB": "server=118.190.144.92;database=jishe.sysdb;uid=sa;pwd=admin@2023;Encrypt=False;Trust Server Certificate=False", //"PrepayDB": "server=118.190.144.92;database=jishe.sysdb;uid=sa;pwd=admin@2023;Encrypt=False;Trust Server Certificate=False",
"EnergyDB": "server=118.190.144.92;database=db_energy;uid=sa;pwd=admin@2023;Encrypt=False;Trust Server Certificate=False" //"EnergyDB": "server=118.190.144.92;database=db_energy;uid=sa;pwd=admin@2023;Encrypt=False;Trust Server Certificate=False"
//
"PrepayDB": "server=rm-m5el3d1u1k0wzk70n2o.sqlserver.rds.aliyuncs.com,3433;database=jishe.sysdb;uid=v3sa;pwd=JiShe123;Encrypt=False;Trust Server Certificate=False",
"EnergyDB": "server=rm-wz9hw529i3j1e3b5fbo.sqlserver.rds.aliyuncs.com,3433;database=db_energy;uid=yjdb;pwd=Kdjdhf+9*7ad222LL;Encrypt=False;Trust Server Certificate=False"
}, },
"Hangfire": { "Hangfire": {
"Redis": { "Redis": {
@ -63,12 +67,12 @@
} }
}, },
"FreeRedisOptions": { "FreeRedisOptions": {
"ConnectionString": "47.110.53.196:6379,password=1q3J@BGf!yhTaD46nS#,abortConnect=false,connectTimeout=30000,allowAdmin=true,maxPoolSize=50,defaultdatabase=14", "ConnectionString": "47.110.53.196:6379,password=1q3J@BGf!yhTaD46nS#,abortConnect=false,connectTimeout=30000,allowAdmin=true,maxPoolSize=500,defaultdatabase=10",
"UseDistributedCache": true "UseDistributedCache": true
}, },
"FreeSqlProviderOptions": { "FreeSqlProviderOptions": {
"UsePrepayDB": true, "UsePrepayDB": true,
"UseEnergyDB": false, "UseEnergyDB": true,
"PrintLog": false "PrintLog": false
} }
} }

View File

@ -4,7 +4,9 @@
"CorsOrigins": "https://*.IoT.com,http://localhost:4200,http://localhost:3100,http://localhost:80,http://localhost" "CorsOrigins": "https://*.IoT.com,http://localhost:4200,http://localhost:3100,http://localhost:80,http://localhost"
}, },
"ConnectionStrings": { "ConnectionStrings": {
"Default": "Data Source=47.110.60.222;Port=13306;Database=JiSheIoTProDB;uid=root;pwd=JiShe!aqG#5kGgh&0;charset=utf8mb4;Allow User Variables=true;AllowLoadLocalInfile=true;" "Default": "Data Source=47.110.60.222;Port=13306;Database=JiSheIoTProDB;uid=root;pwd=JiShe!aqG#5kGgh&0;charset=utf8mb4;Allow User Variables=true;AllowLoadLocalInfile=true;",
"PrepayDB": "server=rm-m5el3d1u1k0wzk70n2o.sqlserver.rds.aliyuncs.com,3433;database=jishe.sysdb;uid=v3sa;pwd=JiShe123;Encrypt=False;Trust Server Certificate=False",
"EnergyDB": "server=rm-wz9hw529i3j1e3b5fbo.sqlserver.rds.aliyuncs.com,3433;database=db_energy;uid=yjdb;pwd=Kdjdhf+9*7ad222LL;Encrypt=False;Trust Server Certificate=False"
}, },
"Redis": { "Redis": {
"Configuration": "localhost,password=1q2w3E*,defaultdatabase=1" "Configuration": "localhost,password=1q2w3E*,defaultdatabase=1"
@ -30,7 +32,7 @@
} }
}, },
"FreeRedisOptions": { "FreeRedisOptions": {
"ConnectionString": "172.21.40.198:6379,password=1q3J@BGf!yhTaD46nS#,syncTimeout=30000,abortConnect=false,connectTimeout=30000,allowAdmin=true,maxPoolSize=50,defaultdatabase=14", "ConnectionString": "172.21.40.198:6379,password=1q3J@BGf!yhTaD46nS#,syncTimeout=30000,abortConnect=false,connectTimeout=30000,allowAdmin=true,maxPoolSize=500,defaultdatabase=14",
"UseDistributedCache": true "UseDistributedCache": true
}, },
"FreeSqlProviderOptions": { "FreeSqlProviderOptions": {

View File

@ -1,3 +1,4 @@
using JiShe.IoT.Jobs;
using JiShe.ServicePro.DeviceManagement; using JiShe.ServicePro.DeviceManagement;
using JiShe.ServicePro.DynamicMenuManagement; using JiShe.ServicePro.DynamicMenuManagement;
using JiShe.ServicePro.FileManagement; using JiShe.ServicePro.FileManagement;
@ -5,6 +6,7 @@ using JiShe.ServicePro.FreeRedisProvider;
using JiShe.ServicePro.FreeSqlProvider; using JiShe.ServicePro.FreeSqlProvider;
using JiShe.ServicePro.IoTDBManagement; using JiShe.ServicePro.IoTDBManagement;
using JiShe.ServicePro.TemplateManagement; using JiShe.ServicePro.TemplateManagement;
using Microsoft.Extensions.DependencyInjection;
namespace JiShe.IoT namespace JiShe.IoT
{ {
@ -20,6 +22,7 @@ namespace JiShe.IoT
typeof(FileManagementApplicationModule), typeof(FileManagementApplicationModule),
typeof(IoTDBManagementApplicationModule), typeof(IoTDBManagementApplicationModule),
typeof(ServiceProFreeRedisProviderModule), typeof(ServiceProFreeRedisProviderModule),
typeof(ServiceProFreeSqlProviderModule),
typeof(DeviceManagementApplicationModule) typeof(DeviceManagementApplicationModule)
)] )]
public class IoTApplicationModule : AbpModule public class IoTApplicationModule : AbpModule
@ -30,7 +33,23 @@ namespace JiShe.IoT
{ {
options.AddMaps<IoTApplicationModule>(); options.AddMaps<IoTApplicationModule>();
}); });
}
public override void PostConfigureServices(ServiceConfigurationContext context)
{
// ¶¨Ê±ÈÎÎñ
ConfigureBackgroundJob(context);
}
private static void ConfigureBackgroundJob(ServiceConfigurationContext context)
{
context.Services.AddHostedService<BathSyncFocusDataToMysqlJob>();
context.Services.AddHostedService<BathSyncAmmeterDataToMysqlJob>();
context.Services.AddHostedService<BathSyncWatermeterDataToMysqlJob>();
context.Services.AddHostedService<CacheDeviceDataToRedisJob>();
context.Services.AddHostedService<CacheFocusDataToRedisJob>();
} }
} }
} }

View File

@ -28,5 +28,9 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.BackgroundJobs.HangFire" /> <PackageReference Include="Volo.Abp.BackgroundJobs.HangFire" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="Jobs\新文件夹\" />
</ItemGroup>
</Project> </Project>

View File

@ -0,0 +1,41 @@
using JiShe.ServicePro.Core;
using JiShe.ServicePro.DeviceManagement.Meters;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace JiShe.IoT.Jobs
{
/// <summary>
/// 批量同步电表 ammeter 数据到mysql
/// </summary>
public class BathSyncAmmeterDataToMysqlJob : SystemBackGroundWorkService
{
private readonly ILogger<BathSyncAmmeterDataToMysqlJob> _logger;
public readonly MeterAppService _meterAppService;
public BathSyncAmmeterDataToMysqlJob(ILogger<BathSyncAmmeterDataToMysqlJob> logger, MeterAppService meterAppService) : base(logger)
{
_logger = logger;
_meterAppService = meterAppService;
}
/// <summary>
/// 定时执行
/// </summary>
/// <param name="cancellationToken"></param>
/// <returns></returns>
protected override Task DoWorkAsync(CancellationToken cancellationToken)
{
return _meterAppService.BathSyncAmmeterDataAsync();
}
protected override TimeSpan GetInterval()
{
// 每隔3小时执行一次
return TimeSpan.FromHours(3);
}
}
}

View File

@ -0,0 +1,37 @@
using JiShe.ServicePro.Core;
using JiShe.ServicePro.DeviceManagement.Focuses;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace JiShe.IoT.Jobs
{
/// <summary>
/// 批量同步集中器 Focus数据到Mysql
/// </summary>
public class BathSyncFocusDataToMysqlJob : SystemBackGroundWorkService
{
private readonly ILogger<BathSyncFocusDataToMysqlJob> _logger;
public readonly FocusAppService _focusAppService;
public BathSyncFocusDataToMysqlJob(ILogger<BathSyncFocusDataToMysqlJob> logger, FocusAppService focusAppService) : base(logger)
{
_logger = logger;
_focusAppService = focusAppService;
}
protected override Task DoWorkAsync(CancellationToken cancellationToken)
{
return _focusAppService.BathSyncFocusDataAsync();
}
protected override TimeSpan GetInterval()
{
// 每隔3小时执行一次
return TimeSpan.FromHours(3);
}
}
}

View File

@ -0,0 +1,41 @@
using JiShe.ServicePro.Core;
using JiShe.ServicePro.DeviceManagement.Meters;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace JiShe.IoT.Jobs
{
/// <summary>
/// 批量同步 水表 watermeter 数据到mysql
/// </summary>
public class BathSyncWatermeterDataToMysqlJob : SystemBackGroundWorkService
{
private readonly ILogger<BathSyncWatermeterDataToMysqlJob> _logger;
public readonly MeterAppService _meterAppService;
public BathSyncWatermeterDataToMysqlJob(ILogger<BathSyncWatermeterDataToMysqlJob> logger, MeterAppService meterAppService) : base(logger)
{
_logger = logger;
_meterAppService = meterAppService;
}
/// <summary>
/// 定时执行
/// </summary>
/// <param name="cancellationToken"></param>
/// <returns></returns>
protected override Task DoWorkAsync(CancellationToken cancellationToken)
{
return _meterAppService.BathSyncWatermeterDataAsync();
}
protected override TimeSpan GetInterval()
{
// 每隔3小时执行一次
return TimeSpan.FromHours(3);
}
}
}

View File

@ -0,0 +1,40 @@
using JiShe.ServicePro.Core;
using JiShe.ServicePro.DeviceManagement.Meters;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace JiShe.IoT.Jobs
{
/// <summary>
/// 缓存设备数据到redis
/// </summary>
public class CacheDeviceDataToRedisJob : SystemBackGroundWorkService
{
private readonly ILogger<CacheDeviceDataToRedisJob> _logger;
public readonly MeterAppService _meterAppService;
public CacheDeviceDataToRedisJob(ILogger<CacheDeviceDataToRedisJob> logger, MeterAppService meterAppService) : base(logger)
{
_logger = logger;
_meterAppService = meterAppService;
}
/// <summary>
/// 定时执行
/// </summary>
/// <param name="cancellationToken"></param>
/// <returns></returns>
protected override Task DoWorkAsync(CancellationToken cancellationToken)
{
return _meterAppService.CacheDeviceDataToRedisAsync();
}
protected override TimeSpan GetInterval()
{
return TimeSpan.FromHours(1);
}
}
}

View File

@ -0,0 +1,37 @@
using JiShe.ServicePro.Core;
using JiShe.ServicePro.DeviceManagement.Focuses;
using JiShe.ServicePro.DeviceManagement.Meters;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace JiShe.IoT.Jobs
{
/// <summary>
/// 缓存集中器数据到Redis
/// </summary>
public class CacheFocusDataToRedisJob : SystemBackGroundWorkService
{
private readonly ILogger<CacheFocusDataToRedisJob> _logger;
public readonly FocusAppService _focusAppService;
public CacheFocusDataToRedisJob(ILogger<CacheFocusDataToRedisJob> logger, FocusAppService focusAppService) : base(logger)
{
_logger = logger;
_focusAppService= focusAppService;
}
protected override Task DoWorkAsync(CancellationToken cancellationToken)
{
return _focusAppService.CacheFocusDataToRedisAsync();
}
protected override TimeSpan GetInterval()
{
return TimeSpan.FromHours(1);
}
}
}

View File

@ -1,4 +1,4 @@
using JiShe.ServicePro.IoTDBManagement.SessionPools; using JiShe.ServicePro.ApacheIoTDB.Provider.ISessionPools;
namespace JiShe.IoT.Data namespace JiShe.IoT.Data
{ {

View File

@ -13,8 +13,8 @@ using Volo.Abp.EntityFrameworkCore;
namespace JiShe.IoT.Migrations namespace JiShe.IoT.Migrations
{ {
[DbContext(typeof(IoTDbContext))] [DbContext(typeof(IoTDbContext))]
[Migration("20250609070511_initCeate")] [Migration("20250611083124_initCreate")]
partial class initCeate partial class initCreate
{ {
/// <inheritdoc /> /// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder) protected override void BuildTargetModel(ModelBuilder modelBuilder)
@ -352,6 +352,10 @@ namespace JiShe.IoT.Migrations
.HasColumnType("int") .HasColumnType("int")
.HasComment("旧系统授权最后修改者Id"); .HasComment("旧系统授权最后修改者Id");
b.Property<int>("ProjectID")
.HasColumnType("int")
.HasComment("项目ID");
b.Property<string>("Remark") b.Property<string>("Remark")
.HasColumnType("longtext") .HasColumnType("longtext")
.HasComment("备注"); .HasComment("备注");
@ -360,6 +364,11 @@ namespace JiShe.IoT.Migrations
.HasColumnType("tinyint(1)") .HasColumnType("tinyint(1)")
.HasComment("是否自研"); .HasComment("是否自研");
b.Property<string>("SimCard")
.HasMaxLength(80)
.HasColumnType("varchar(80)")
.HasComment("通讯SIM卡卡号");
b.Property<string>("SoftwareReleaseDate") b.Property<string>("SoftwareReleaseDate")
.HasMaxLength(80) .HasMaxLength(80)
.HasColumnType("varchar(80)") .HasColumnType("varchar(80)")
@ -379,6 +388,10 @@ namespace JiShe.IoT.Migrations
.HasColumnName("TenantId") .HasColumnName("TenantId")
.HasComment("租户ID"); .HasComment("租户ID");
b.Property<int>("TimeDensity")
.HasColumnType("int")
.HasComment("采集密度");
b.Property<int>("UpLink") b.Property<int>("UpLink")
.HasMaxLength(20) .HasMaxLength(20)
.HasColumnType("int") .HasColumnType("int")
@ -396,10 +409,24 @@ namespace JiShe.IoT.Migrations
b.Property<Guid>("Id") b.Property<Guid>("Id")
.HasColumnType("char(36)"); .HasColumnType("char(36)");
b.Property<string>("Address")
.HasMaxLength(20)
.HasColumnType("varchar(20)")
.HasComment("表计地址");
b.Property<bool>("ArchiveStatus") b.Property<bool>("ArchiveStatus")
.HasColumnType("tinyint(1)") .HasColumnType("tinyint(1)")
.HasComment("归档状态"); .HasComment("归档状态");
b.Property<string>("AreaCode")
.HasMaxLength(20)
.HasColumnType("varchar(20)")
.HasComment("表计区域编码");
b.Property<int>("AutomaticReport")
.HasColumnType("int")
.HasComment("是否自动采集");
b.Property<int>("Baudrate") b.Property<int>("Baudrate")
.HasColumnType("int") .HasColumnType("int")
.HasComment("波特率"); .HasComment("波特率");
@ -409,6 +436,10 @@ namespace JiShe.IoT.Migrations
.HasColumnType("varchar(128)") .HasColumnType("varchar(128)")
.HasComment("品牌类型"); .HasComment("品牌类型");
b.Property<int>("BusinessSystem")
.HasColumnType("int")
.HasComment("业务系统");
b.Property<string>("ConcurrencyStamp") b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken() .IsConcurrencyToken()
.IsRequired() .IsRequired()
@ -424,6 +455,11 @@ namespace JiShe.IoT.Migrations
.HasColumnType("char(36)") .HasColumnType("char(36)")
.HasColumnName("CreatorId"); .HasColumnName("CreatorId");
b.Property<string>("DataTypes")
.HasMaxLength(5000)
.HasColumnType("varchar(5000)")
.HasComment("采集项编号ID");
b.Property<int>("DatabaseBusiID") b.Property<int>("DatabaseBusiID")
.HasColumnType("int") .HasColumnType("int")
.HasComment("业务库ID"); .HasComment("业务库ID");
@ -471,6 +507,11 @@ namespace JiShe.IoT.Migrations
.HasDefaultValue(false) .HasDefaultValue(false)
.HasColumnName("IsDeleted"); .HasColumnName("IsDeleted");
b.Property<string>("ItemCodes")
.HasMaxLength(5000)
.HasColumnType("varchar(5000)")
.HasComment("采集项编码");
b.Property<DateTime?>("LastModificationTime") b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)") .HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime"); .HasColumnName("LastModificationTime");
@ -479,6 +520,11 @@ namespace JiShe.IoT.Migrations
.HasColumnType("char(36)") .HasColumnType("char(36)")
.HasColumnName("LastModifierId"); .HasColumnName("LastModifierId");
b.Property<string>("LinkType")
.HasMaxLength(128)
.HasColumnType("varchar(128)")
.HasComment("水表通讯方案");
b.Property<string>("MeterAddress") b.Property<string>("MeterAddress")
.IsRequired() .IsRequired()
.HasMaxLength(40) .HasMaxLength(40)
@ -499,6 +545,11 @@ namespace JiShe.IoT.Migrations
.HasColumnType("int") .HasColumnType("int")
.HasComment("表计类型"); .HasComment("表计类型");
b.Property<string>("MeterTypeName")
.HasMaxLength(128)
.HasColumnType("varchar(128)")
.HasComment("水表设备类型");
b.Property<int>("MeteringCode") b.Property<int>("MeteringCode")
.HasColumnType("int") .HasColumnType("int")
.HasComment("表计编码"); .HasComment("表计编码");
@ -544,17 +595,21 @@ namespace JiShe.IoT.Migrations
.HasColumnType("tinyint(1)") .HasColumnType("tinyint(1)")
.HasComment("是否单倍率"); .HasComment("是否单倍率");
b.Property<int>("Special")
.HasColumnType("int")
.HasComment("是否特殊表");
b.Property<Guid?>("TenantId") b.Property<Guid?>("TenantId")
.HasColumnType("char(36)") .HasColumnType("char(36)")
.HasColumnName("TenantId") .HasColumnName("TenantId")
.HasComment("租户ID"); .HasComment("租户ID");
b.Property<decimal>("TimesA") b.Property<decimal>("TimesA")
.HasColumnType("decimal(65,30)") .HasColumnType("decimal(12, 4)")
.HasComment("倍率A"); .HasComment("倍率A");
b.Property<decimal>("Timev") b.Property<decimal>("Timev")
.HasColumnType("decimal(65,30)") .HasColumnType("decimal(12, 4)")
.HasComment("倍率V"); .HasComment("倍率V");
b.Property<bool>("TripState") b.Property<bool>("TripState")

View File

@ -6,7 +6,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
namespace JiShe.IoT.Migrations namespace JiShe.IoT.Migrations
{ {
/// <inheritdoc /> /// <inheritdoc />
public partial class initCeate : Migration public partial class initCreate : Migration
{ {
/// <inheritdoc /> /// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder) protected override void Up(MigrationBuilder migrationBuilder)
@ -755,8 +755,12 @@ namespace JiShe.IoT.Migrations
Status = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "是否在线状态"), Status = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "是否在线状态"),
HeartbeatInterval = table.Column<int>(type: "int", nullable: false, comment: "心跳间隔"), HeartbeatInterval = table.Column<int>(type: "int", nullable: false, comment: "心跳间隔"),
LastRefreshTime = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "最后刷新时间"), LastRefreshTime = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "最后刷新时间"),
TimeDensity = table.Column<int>(type: "int", nullable: false, comment: "采集密度"),
FocusId = table.Column<long>(type: "bigint", nullable: false, comment: "集中器ID"), FocusId = table.Column<long>(type: "bigint", nullable: false, comment: "集中器ID"),
ProjectID = table.Column<int>(type: "int", nullable: false, comment: "项目ID"),
Enabled = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "是否启用"), Enabled = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "是否启用"),
SimCard = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "通讯SIM卡卡号")
.Annotation("MySql:CharSet", "utf8mb4"),
MakerNo = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "厂商代号") MakerNo = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "厂商代号")
.Annotation("MySql:CharSet", "utf8mb4"), .Annotation("MySql:CharSet", "utf8mb4"),
DeviceNo = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "设备编号") DeviceNo = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "设备编号")
@ -845,6 +849,7 @@ namespace JiShe.IoT.Migrations
columns: table => new columns: table => new
{ {
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
BusinessSystem = table.Column<int>(type: "int", nullable: false, comment: "业务系统"),
MeterName = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: false, comment: "表计名称") MeterName = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: false, comment: "表计名称")
.Annotation("MySql:CharSet", "utf8mb4"), .Annotation("MySql:CharSet", "utf8mb4"),
MeterAddress = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "表计地址") MeterAddress = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "表计地址")
@ -864,8 +869,8 @@ namespace JiShe.IoT.Migrations
.Annotation("MySql:CharSet", "utf8mb4"), .Annotation("MySql:CharSet", "utf8mb4"),
ArchiveStatus = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "归档状态"), ArchiveStatus = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "归档状态"),
TripState = 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"), TimesA = table.Column<decimal>(type: "decimal(12,4)", nullable: false, comment: "倍率A"),
Timev = table.Column<decimal>(type: "decimal(65,30)", nullable: false, comment: "倍率V"), Timev = table.Column<decimal>(type: "decimal(12,4)", nullable: false, comment: "倍率V"),
HaveValve = table.Column<bool>(type: "tinyint(1)", nullable: true, comment: "是否带阀控"), HaveValve = table.Column<bool>(type: "tinyint(1)", nullable: true, comment: "是否带阀控"),
FocusId = table.Column<int>(type: "int", nullable: false, comment: "集中器ID"), FocusId = table.Column<int>(type: "int", nullable: false, comment: "集中器ID"),
MeterId = table.Column<int>(type: "int", nullable: false, comment: "表计ID"), MeterId = table.Column<int>(type: "int", nullable: false, comment: "表计ID"),
@ -874,6 +879,20 @@ namespace JiShe.IoT.Migrations
Enabled = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "是否启用"), Enabled = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "是否启用"),
GatherCount = table.Column<int>(type: "int", nullable: false, comment: "采集项数量"), GatherCount = table.Column<int>(type: "int", nullable: false, comment: "采集项数量"),
FunctionCount = table.Column<int>(type: "int", nullable: false, comment: "功能数量(包含采集项和阀控等)"), FunctionCount = table.Column<int>(type: "int", nullable: false, comment: "功能数量(包含采集项和阀控等)"),
ItemCodes = table.Column<string>(type: "varchar(5000)", maxLength: 5000, nullable: true, comment: "采集项编码")
.Annotation("MySql:CharSet", "utf8mb4"),
DataTypes = table.Column<string>(type: "varchar(5000)", maxLength: 5000, nullable: true, comment: "采集项编号ID")
.Annotation("MySql:CharSet", "utf8mb4"),
Address = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true, comment: "表计地址")
.Annotation("MySql:CharSet", "utf8mb4"),
AreaCode = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true, comment: "表计区域编码")
.Annotation("MySql:CharSet", "utf8mb4"),
LinkType = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: true, comment: "水表通讯方案")
.Annotation("MySql:CharSet", "utf8mb4"),
MeterTypeName = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: true, comment: "水表设备类型")
.Annotation("MySql:CharSet", "utf8mb4"),
Special = table.Column<int>(type: "int", nullable: false, comment: "是否特殊表"),
AutomaticReport = table.Column<int>(type: "int", nullable: false, comment: "是否自动采集"),
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false) ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"), .Annotation("MySql:CharSet", "utf8mb4"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false), CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),

View File

@ -349,6 +349,10 @@ namespace JiShe.IoT.Migrations
.HasColumnType("int") .HasColumnType("int")
.HasComment("旧系统授权最后修改者Id"); .HasComment("旧系统授权最后修改者Id");
b.Property<int>("ProjectID")
.HasColumnType("int")
.HasComment("项目ID");
b.Property<string>("Remark") b.Property<string>("Remark")
.HasColumnType("longtext") .HasColumnType("longtext")
.HasComment("备注"); .HasComment("备注");
@ -357,6 +361,11 @@ namespace JiShe.IoT.Migrations
.HasColumnType("tinyint(1)") .HasColumnType("tinyint(1)")
.HasComment("是否自研"); .HasComment("是否自研");
b.Property<string>("SimCard")
.HasMaxLength(80)
.HasColumnType("varchar(80)")
.HasComment("通讯SIM卡卡号");
b.Property<string>("SoftwareReleaseDate") b.Property<string>("SoftwareReleaseDate")
.HasMaxLength(80) .HasMaxLength(80)
.HasColumnType("varchar(80)") .HasColumnType("varchar(80)")
@ -376,6 +385,10 @@ namespace JiShe.IoT.Migrations
.HasColumnName("TenantId") .HasColumnName("TenantId")
.HasComment("租户ID"); .HasComment("租户ID");
b.Property<int>("TimeDensity")
.HasColumnType("int")
.HasComment("采集密度");
b.Property<int>("UpLink") b.Property<int>("UpLink")
.HasMaxLength(20) .HasMaxLength(20)
.HasColumnType("int") .HasColumnType("int")
@ -393,10 +406,24 @@ namespace JiShe.IoT.Migrations
b.Property<Guid>("Id") b.Property<Guid>("Id")
.HasColumnType("char(36)"); .HasColumnType("char(36)");
b.Property<string>("Address")
.HasMaxLength(20)
.HasColumnType("varchar(20)")
.HasComment("表计地址");
b.Property<bool>("ArchiveStatus") b.Property<bool>("ArchiveStatus")
.HasColumnType("tinyint(1)") .HasColumnType("tinyint(1)")
.HasComment("归档状态"); .HasComment("归档状态");
b.Property<string>("AreaCode")
.HasMaxLength(20)
.HasColumnType("varchar(20)")
.HasComment("表计区域编码");
b.Property<int>("AutomaticReport")
.HasColumnType("int")
.HasComment("是否自动采集");
b.Property<int>("Baudrate") b.Property<int>("Baudrate")
.HasColumnType("int") .HasColumnType("int")
.HasComment("波特率"); .HasComment("波特率");
@ -406,6 +433,10 @@ namespace JiShe.IoT.Migrations
.HasColumnType("varchar(128)") .HasColumnType("varchar(128)")
.HasComment("品牌类型"); .HasComment("品牌类型");
b.Property<int>("BusinessSystem")
.HasColumnType("int")
.HasComment("业务系统");
b.Property<string>("ConcurrencyStamp") b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken() .IsConcurrencyToken()
.IsRequired() .IsRequired()
@ -421,6 +452,11 @@ namespace JiShe.IoT.Migrations
.HasColumnType("char(36)") .HasColumnType("char(36)")
.HasColumnName("CreatorId"); .HasColumnName("CreatorId");
b.Property<string>("DataTypes")
.HasMaxLength(5000)
.HasColumnType("varchar(5000)")
.HasComment("采集项编号ID");
b.Property<int>("DatabaseBusiID") b.Property<int>("DatabaseBusiID")
.HasColumnType("int") .HasColumnType("int")
.HasComment("业务库ID"); .HasComment("业务库ID");
@ -468,6 +504,11 @@ namespace JiShe.IoT.Migrations
.HasDefaultValue(false) .HasDefaultValue(false)
.HasColumnName("IsDeleted"); .HasColumnName("IsDeleted");
b.Property<string>("ItemCodes")
.HasMaxLength(5000)
.HasColumnType("varchar(5000)")
.HasComment("采集项编码");
b.Property<DateTime?>("LastModificationTime") b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)") .HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime"); .HasColumnName("LastModificationTime");
@ -476,6 +517,11 @@ namespace JiShe.IoT.Migrations
.HasColumnType("char(36)") .HasColumnType("char(36)")
.HasColumnName("LastModifierId"); .HasColumnName("LastModifierId");
b.Property<string>("LinkType")
.HasMaxLength(128)
.HasColumnType("varchar(128)")
.HasComment("水表通讯方案");
b.Property<string>("MeterAddress") b.Property<string>("MeterAddress")
.IsRequired() .IsRequired()
.HasMaxLength(40) .HasMaxLength(40)
@ -496,6 +542,11 @@ namespace JiShe.IoT.Migrations
.HasColumnType("int") .HasColumnType("int")
.HasComment("表计类型"); .HasComment("表计类型");
b.Property<string>("MeterTypeName")
.HasMaxLength(128)
.HasColumnType("varchar(128)")
.HasComment("水表设备类型");
b.Property<int>("MeteringCode") b.Property<int>("MeteringCode")
.HasColumnType("int") .HasColumnType("int")
.HasComment("表计编码"); .HasComment("表计编码");
@ -541,17 +592,21 @@ namespace JiShe.IoT.Migrations
.HasColumnType("tinyint(1)") .HasColumnType("tinyint(1)")
.HasComment("是否单倍率"); .HasComment("是否单倍率");
b.Property<int>("Special")
.HasColumnType("int")
.HasComment("是否特殊表");
b.Property<Guid?>("TenantId") b.Property<Guid?>("TenantId")
.HasColumnType("char(36)") .HasColumnType("char(36)")
.HasColumnName("TenantId") .HasColumnName("TenantId")
.HasComment("租户ID"); .HasComment("租户ID");
b.Property<decimal>("TimesA") b.Property<decimal>("TimesA")
.HasColumnType("decimal(65,30)") .HasColumnType("decimal(12, 4)")
.HasComment("倍率A"); .HasComment("倍率A");
b.Property<decimal>("Timev") b.Property<decimal>("Timev")
.HasColumnType("decimal(65,30)") .HasColumnType("decimal(12, 4)")
.HasComment("倍率V"); .HasComment("倍率V");
b.Property<bool>("TripState") b.Property<bool>("TripState")