diff --git a/OperationsMainSiteGatewayServer/OperationsGatewayAppModule.cs b/OperationsMainSiteGatewayServer/OperationsGatewayAppModule.cs index c34b8f5..a0a0953 100644 --- a/OperationsMainSiteGatewayServer/OperationsGatewayAppModule.cs +++ b/OperationsMainSiteGatewayServer/OperationsGatewayAppModule.cs @@ -41,12 +41,12 @@ namespace Yunda.SOMS.OperationsMainSiteGatewayServer public override void PreInitialize() { // 预初始化阶段,可以进行一些配置 - Console.WriteLine("PreInitialize: ABP Module Setup"); + Debug.WriteLine("PreInitialize: ABP Module Setup"); var _appConfiguration = new ConfigurationBuilder() - .AddJsonFile("appsettings.json") - .Build(); + .AddJsonFile("appsettings.json") + .Build(); // 后初始化阶段 - Console.WriteLine("PostInitialize: ABP Module Post Initialization"); + Debug.WriteLine("PostInitialize: ABP Module Post Initialization"); Configuration.DefaultNameOrConnectionString = _appConfiguration.GetConnectionString( ISASConsts.ConnectionMysqlStringKey ); diff --git a/src/YunDa.Application/YunDa.ISAS.Application.Core/Auditing/ISASAuditingHelper.cs b/src/YunDa.Application/YunDa.ISAS.Application.Core/Auditing/ISASAuditingHelper.cs index c06a73e..7b715cb 100644 --- a/src/YunDa.Application/YunDa.ISAS.Application.Core/Auditing/ISASAuditingHelper.cs +++ b/src/YunDa.Application/YunDa.ISAS.Application.Core/Auditing/ISASAuditingHelper.cs @@ -147,10 +147,21 @@ namespace YunDa.ISAS.Application.Core.Auditing if (method == null) return null; try { - var methodDesc = (DescriptionAttribute)method.GetCustomAttribute(typeof(DescriptionAttribute)); - var typeDesc = (DescriptionAttribute)type?.GetCustomAttribute(typeof(DescriptionAttribute)); - - if (methodDesc == null || typeDesc == null) return null; + // 方法描述处理 + DescriptionAttribute methodDescription = method.GetCustomAttribute(); + if (methodDescription == null) + { + methodDescription = new DescriptionAttribute( + $"未定义描述的方法: {method.Name} (参数: {string.Join(", ", method.GetParameters().Select(p => p.ParameterType.Name))})" + ); + } + // 类型描述处理(带null传播运算符) + DescriptionAttribute typeDescription = type?.GetCustomAttribute(); + typeDescription ??= new DescriptionAttribute( + type != null + ? $"未定义描述的类型: {type.Name}" + : "未指定类型" + ); if (arguments.ContainsKey("password")) arguments["password"] = "******"; @@ -161,8 +172,8 @@ namespace YunDa.ISAS.Application.Core.Auditing UserId = AbpSession.UserId, ImpersonatorUserId = AbpSession.ImpersonatorUserId, ImpersonatorTenantId = AbpSession.ImpersonatorTenantId, - ServiceName = typeDesc.Description, - MethodName = methodDesc.Description, + ServiceName = typeDescription.Description, + MethodName = methodDescription.Description, Parameters = ConvertArgumentsToJson(arguments), ExecutionTime = Clock.Now }; diff --git a/src/YunDa.Application/YunDa.ISAS.Application/DataMonitoring/EnvironmentLiveData/EnvironmentLiveDataAppService.cs b/src/YunDa.Application/YunDa.ISAS.Application/DataMonitoring/EnvironmentLiveData/EnvironmentLiveDataAppService.cs index 5ac85bc..6046c98 100644 --- a/src/YunDa.Application/YunDa.ISAS.Application/DataMonitoring/EnvironmentLiveData/EnvironmentLiveDataAppService.cs +++ b/src/YunDa.Application/YunDa.ISAS.Application/DataMonitoring/EnvironmentLiveData/EnvironmentLiveDataAppService.cs @@ -11,10 +11,10 @@ using YunDa.ISAS.DataTransferObject; using YunDa.ISAS.DataTransferObject.DataMonitoring.DMAlarmCategoryDto; using YunDa.ISAS.DataTransferObject.DataMonitoring.DMAlarmCategoryDto.SearchCondition; using YunDa.ISAS.DataTransferObject.DataMonitoring.EnvironmentLiveDataDto; -using YunDa.ISAS.DataTransferObject.EquipmentLiveData; using YunDa.ISAS.Entities.GeneralInformation; using YunDa.ISAS.Redis.Entities.AlarmCategory; using YunDa.ISAS.Redis.Repositories; +using YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveData; namespace YunDa.ISAS.Application.DataMonitoring { diff --git a/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/EquipmentIndicatorConfig/EquipmentIndicatorConfigAppService.cs b/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/EquipmentIndicatorConfig/EquipmentIndicatorConfigAppService.cs new file mode 100644 index 0000000..fa8bf1e --- /dev/null +++ b/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/EquipmentIndicatorConfig/EquipmentIndicatorConfigAppService.cs @@ -0,0 +1,265 @@ +using Abp.Auditing; +using Abp.Collections.Extensions; +using Abp.Domain.Repositories; +using Abp.Linq.Extensions; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.JsonPatch.Operations; +using Microsoft.AspNetCore.Mvc; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Threading.Tasks; +using ToolLibrary.LogHelper; +using YunDa.ISAS.Application.Core; +using YunDa.ISAS.Application.Core.Session; +using YunDa.ISAS.Application.Core.SwaggerHelper; +using YunDa.ISAS.DataTransferObject; +using YunDa.ISAS.DataTransferObject.CommonDto; +using YunDa.ISAS.DataTransferObject.GeneralInformation.ManufacturerInfoDto; +using YunDa.ISAS.Entities.GeneralInformation; +using YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentIndicatorConfigDto; +using YunDa.SOMS.Entities.GeneralInformation; + +namespace YunDa.ISAS.Application.GeneralInformation +{ + public class EquipmentIndicatorConfigAppService : ISASAppServiceBase, IEquipmentIndicatorConfigAppService + { + private readonly IRepository _equipmentIndicatorConfigRepository; + private readonly IRepository _equipmentIndicatorCommentRepository; + private readonly IRepository _equipmentInfoRepository; + + + public EquipmentIndicatorConfigAppService( + ISessionAppService sessionAppService, + IRepository equipmentIndicatorConfigRepository, + IRepository equipmentIndicatorCommentRepository, + IRepository equipmentInfoRepository + ) : base(sessionAppService) + { + _equipmentIndicatorConfigRepository = equipmentIndicatorConfigRepository; + _equipmentIndicatorCommentRepository = equipmentIndicatorCommentRepository; + _equipmentInfoRepository = equipmentInfoRepository; + } + /// + /// 指标配置增加或修改 + /// + /// + /// + /// + [HttpPost] + [Audited] + [Description("指标配置增加或修改")] + public async Task> CreateOrUpdateAsync(EditEquipmentIndicatorConfigInput input) + { + if (input == null) throw new ArgumentNullException(nameof(input)); + + return input.Id.HasValue + ? await UpdateAsync(input) + : await CreateAsync(input); + } + private async Task> UpdateAsync(EditEquipmentIndicatorConfigInput input) + { + var rst = new RequestResult(); + try + { + var entity = await _equipmentIndicatorConfigRepository.GetAsync(input.Id.Value); + input.CreationTime = entity.CreationTime; + input.CreatorUserId = entity.CreatorUserId; + input.LastModificationTime = DateTime.Now; + input.LastModifierUserId = base.GetCurrentUser().Id; + ObjectMapper.Map(input, entity); + await _equipmentIndicatorConfigRepository.UpdateAsync(entity); + rst.Flag = true; + rst.ResultData = ObjectMapper.Map(entity); + } + catch (Exception ex) + { + HandleException(rst, ex, "更新指标配置"); + } + return rst; + } + private async Task> CreateAsync(EditEquipmentIndicatorConfigInput input) + { + var rst = new RequestResult(); + try + { + var entity = ObjectMapper.Map(input); + entity.CreationTime = DateTime.Now; + entity.CreatorUserId = base.GetCurrentUser().Id; + entity.LastModifierUserId = base.GetCurrentUser().Id; + entity.LastModificationTime = DateTime.Now; + entity = await _equipmentIndicatorConfigRepository.InsertAsync(entity); + rst.ResultData = ObjectMapper.Map(entity); + rst.Flag = true; + } + catch (Exception ex) + { + HandleException(rst, ex, "创建指标配置"); + } + return rst; + } + [HttpPost] + [Audited] + [Description("删除单个配置")] + public async Task DeleteByIdAsync(Guid id) + { + var rst = new RequestEasyResult(); + try + { + await _equipmentIndicatorConfigRepository.DeleteAsync(id); + rst.Flag = true; + } + catch (Exception ex) + { + rst.Message = ex.Message; + rst.Flag = false; + Log4Helper.Error(GetType(), "删除指标配置", ex); + } + return rst; + } + [HttpPost] + [Audited] + [Description("删除多个配置")] + public async Task DeleteByIdsAsync(List ids) + { + var rst = new RequestEasyResult(); + try + { + await _equipmentIndicatorConfigRepository.DeleteAsync(item => ids.Contains(item.Id)); + rst.Flag = true; + } + catch (Exception ex) + { + rst.Message = ex.Message; + rst.Flag = false; + Log4Helper.Error(GetType(), "批量删除指标配置", ex); + } + return rst; + } + [HttpPost] + [Description("指标配置查询")] + public RequestPageResult FindDatas( + PageSearchCondition searchCondition) + { + var rst = new RequestPageResult { Flag = false }; + try + { + var query = _equipmentIndicatorConfigRepository.GetAllIncluding(t=>t.EquipmentType) + .WhereIf(searchCondition.SearchCondition.IsActive.HasValue, + x => x.IsActive == searchCondition.SearchCondition.IsActive) + .WhereIf(!string.IsNullOrWhiteSpace(searchCondition.SearchCondition.Name), + x => x.Name.Contains(searchCondition.SearchCondition.Name)) + .WhereIf(searchCondition.SearchCondition.EquipmentTypeId.HasValue, + x => x.EquipmentTypeId == searchCondition.SearchCondition.EquipmentTypeId); + // 排序处理 + query = query.OrderBy(x => x.SeqNo).ThenBy(x => x.CreationTime); + // 分页处理 + var totalCount = query.Count(); + + int skipCount = searchCondition.PageIndex <= 0 ? -1 : ((searchCondition.PageIndex - 1) * searchCondition.PageSize); + + if (skipCount != -1) + query = query.PageBy(skipCount, searchCondition.PageSize); + + rst.TotalCount = totalCount; + rst.ResultData = ObjectMapper.Map>(query.ToList()); + rst.Flag = true; + } + catch (Exception ex) + { + HandlePageException(rst, ex, "查询指标配置"); + } + return rst; + } + #region 私有方法 + private void HandleException(RequestResult result, Exception ex, string operation) + { + result.Flag = false; + result.Message = ex.Message; + Log4Helper.Error(GetType(), operation, ex); + } + private void HandlePageException(RequestPageResult result, Exception ex, string operation) + { + result.Flag = false; + result.Message = ex.Message; + Log4Helper.Error(GetType(), operation, ex); + } + #endregion + + [HttpPost] + public RequestResult> FindEquipmentIndicatorCommentForSelect() + { + var rst = new RequestResult> { Flag = false }; + + try + { + rst.ResultData = _equipmentIndicatorCommentRepository.GetAll().Select(t=>new SelectModelOutput + { + Key = t.Id, + Text =t.Id, + Value = t.Id + }).ToList(); + rst.Flag = true; + } + catch (Exception ex) + { + rst.Message = ex.Message; + Log4Helper.Error(this.GetType(), "根据查询条件查询设备类型等级数据", ex); + } + + return rst; + } + [HttpPost] + public async Task CreateEquipmentIndicatorCommentAsync(EditEquipmentIndicatorCommentInput input) + { + var rst = new RequestEasyResult(); + try + { + var entity = ObjectMapper.Map(input); + + entity = await _equipmentIndicatorCommentRepository.InsertAsync(entity); + + rst.Flag = true; + } + catch (Exception ex) + { + Log4Helper.Error(this.GetType(), "根据查询条件查询设备类型等级数据", ex); + + } + return rst; + } + + [AllowAnonymous] + [ShowApi] + [HttpGet] + [Description("根据设备ID获取健康评分")] + public RequestResult> GetEquipmentHealthScore(Guid equipmentId) + { + var rst = new RequestResult> { Flag = false }; + try + { + var equipment = _equipmentInfoRepository.GetAll().FirstOrDefault(t=>t.Id == equipmentId); + if (equipment!=null) + { + var query = _equipmentIndicatorConfigRepository.GetAllIncluding() + .Where(t => t.EquipmentTypeId == equipment.EquipmentTypeId); + rst.ResultData = ObjectMapper.Map>(query.ToList()); + foreach (var item in rst.ResultData) + { + if (item.Value<(decimal)0.1) + { + item.Value = 100; + } + } + rst.Flag = true; + } + } + catch (Exception ex) + { + Log4Helper.Error(GetType(), "operation", ex); + } + return rst; + } + } +} diff --git a/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/EquipmentIndicatorConfig/IEquipmentIndicatorConfigAppService.cs b/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/EquipmentIndicatorConfig/IEquipmentIndicatorConfigAppService.cs new file mode 100644 index 0000000..854ecc9 --- /dev/null +++ b/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/EquipmentIndicatorConfig/IEquipmentIndicatorConfigAppService.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using YunDa.ISAS.Application.Core; +using YunDa.ISAS.DataTransferObject; +using YunDa.ISAS.DataTransferObject.CommonDto; +using YunDa.ISAS.DataTransferObject.GeneralInformation.ManufacturerInfoDto; +using YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentIndicatorConfigDto; + +namespace YunDa.ISAS.Application.GeneralInformation +{ + + public interface IEquipmentIndicatorConfigAppService : IAppServiceBase + { + + } +} diff --git a/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/EquipmentInfo/EquipmentInfoExAppService.cs b/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/EquipmentInfo/EquipmentInfoExAppService.cs index 693398a..e5b8b35 100644 --- a/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/EquipmentInfo/EquipmentInfoExAppService.cs +++ b/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/EquipmentInfo/EquipmentInfoExAppService.cs @@ -26,7 +26,6 @@ using Abp.Linq.Extensions; using YunDa.ISAS.DataTransferObject.GeneralInformation.EquipmentDataCategoryDto; using NPOI.SS.Formula.Functions; using YunDa.ISAS.Entities.System; -using YunDa.ISAS.DataTransferObject.EquipmentLiveData; using AutoMapper; using YunDa.SOMS.DataTransferObject.Iec104; using Abp.Auditing; @@ -34,6 +33,7 @@ using Abp.Domain.Uow; using Microsoft.EntityFrameworkCore; using YunDa.SOMS.Entities.GeneralInformation; using YunDa.SOMS.BASE.Entities.Models; +using YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto; namespace YunDa.ISAS.Application.GeneralInformation { diff --git a/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/EquipmentLiveData/EquipmentLiveDataAppService.cs b/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/EquipmentLiveData/EquipmentLiveDataAppService.cs index b7e573e..6cda130 100644 --- a/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/EquipmentLiveData/EquipmentLiveDataAppService.cs +++ b/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/EquipmentLiveData/EquipmentLiveDataAppService.cs @@ -28,7 +28,6 @@ using YunDa.ISAS.Application.Core.SwaggerHelper; using YunDa.ISAS.Core.Helper; using YunDa.ISAS.DataTransferObject; using YunDa.ISAS.DataTransferObject.Account; -using YunDa.ISAS.DataTransferObject.EquipmentLiveData; using YunDa.ISAS.DataTransferObject.GeneralInformation.EquipmentInfoDto; using YunDa.ISAS.DataTransferObject.GeneralInformation.EquipmentInfoDto.SearchCondition; using YunDa.ISAS.DataTransferObject.VideoSurveillance.VideoDevDto; @@ -41,7 +40,7 @@ using YunDa.ISAS.MongoDB.Repositories; using YunDa.ISAS.Redis.Entities.AlarmCategory; using YunDa.ISAS.Redis.Repositories; using YunDa.SOMS.DataTransferObject.AlarmDataDto; -using YunDa.SOMS.DataTransferObject.EquipmentLiveData; +using YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto; using YunDa.SOMS.DataTransferObject.MainStationMaintenanceInfo.OperationReport; using YunDa.SOMS.DataTransferObject.ThirdPartyData.NJJW; using YunDa.SOMS.Entities.GeneralInformation; @@ -1131,5 +1130,126 @@ namespace YunDa.ISAS.Application.GeneralInformation } return rst; } + + [HttpPost] + [AbpAllowAnonymous] + [ShowApi] + [DisableRequestSizeLimit] + [RequestFormLimits(ValueLengthLimit = int.MaxValue, MultipartBodyLengthLimit = int.MaxValue)] + [Route("/soms/api/voiceprint/upload")] + public async Task> UploadVoiceprintAsync( + [FromForm] IFormFile voiceprint_data, + [FromForm] string image_data, + [FromForm] string analysis_result) + { + var result = new RequestResult(); + try + { + // Validate required parameters + if (voiceprint_data == null) + { + result.Message = "缺少必要参数: voiceprint_data"; + return result; + } + + if (string.IsNullOrEmpty(image_data)) + { + result.Message = "缺少必要参数: image_data"; + return result; + } + + if (string.IsNullOrEmpty(analysis_result)) + { + result.Message = "缺少必要参数: analysis_result"; + return result; + } + + // Validate file type + var extension = Path.GetExtension(voiceprint_data.FileName).ToLowerInvariant(); + if (!new[] { ".wav", ".pcm" }.Contains(extension)) + { + result.Message = "不支持的文件类型,仅支持.wav和.pcm格式"; + return result; + } + + // Validate file size (100MB limit) + if (voiceprint_data.Length > 100 * 1024 * 1024) + { + result.Message = "文件大小超过限制(100MB)"; + return result; + } + + // Parse analysis result + VoiceprintData voiceprintData; + try + { + voiceprintData = JsonSerializer.Deserialize(analysis_result); + } + catch (JsonException) + { + result.Message = "JSON解析失败"; + return result; + } + + // Generate unique ID if not provided + if (string.IsNullOrEmpty(voiceprintData.VoiceprintId)) + { + voiceprintData.VoiceprintId = $"VP_{DateTime.Now:yyyyMMdd_HHmmss}"; + } + + // Create storage directory + var uploadDir = Path.Combine( + base.GetAttachmentDirectory(), + "Uploads", + "Voiceprints", + DateTime.Now.ToString("yyyy-MM-dd")); + + Directory.CreateDirectory(uploadDir); + + // Save voiceprint file + var fileName = $"{voiceprintData.VoiceprintId}{extension}"; + var fullPath = Path.Combine(uploadDir, fileName); + using (var stream = new FileStream(fullPath, FileMode.Create)) + { + await voiceprint_data.CopyToAsync(stream); + } + + // Save image if provided + if (image_data.StartsWith("data:image/")) + { + try + { + var base64Data = image_data.Split(',')[1]; + var imageBytes = Convert.FromBase64String(base64Data); + var imagePath = Path.Combine(uploadDir, $"{voiceprintData.VoiceprintId}.png"); + await File.WriteAllBytesAsync(imagePath, imageBytes); + voiceprintData.ImageSaved = true; + } + catch + { + result.Message = "Base64解码失败"; + return result; + } + } + + // Update paths + voiceprintData.SavedPath = fullPath.Replace(base.GetAttachmentDirectory(), ""); + voiceprintData.Timestamp = DateTime.Now; + + // Save to MongoDB + _bsonDocumentResultRepository.CollectionName = nameof(VoiceprintData); + await _bsonDocumentResultRepository.InsertOneAsync(voiceprintData.ToBsonDocument()); + + result.ResultData = voiceprintData; + result.Flag = true; + result.Message = "操作成功"; + } + catch (Exception ex) + { + Log4Helper.Error(this.GetType(), "上传声纹数据失败", ex); + result.Message = "服务器存储失败"; + } + return result; + } } } \ No newline at end of file diff --git a/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/EquipmentLiveData/IEquipmentLiveDataAppService.cs b/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/EquipmentLiveData/IEquipmentLiveDataAppService.cs index e135e37..a1bd1ca 100644 --- a/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/EquipmentLiveData/IEquipmentLiveDataAppService.cs +++ b/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/EquipmentLiveData/IEquipmentLiveDataAppService.cs @@ -6,10 +6,10 @@ using System.Threading.Tasks; using YunDa.ISAS.Application.Core; using YunDa.ISAS.DataTransferObject; using YunDa.ISAS.DataTransferObject.CommonDto; -using YunDa.ISAS.DataTransferObject.EquipmentLiveData; using YunDa.ISAS.DataTransferObject.GeneralInformation.EquipmentInfoDto; using YunDa.ISAS.DataTransferObject.GeneralInformation.EquipmentInfoDto.SearchCondition; using YunDa.ISAS.Entities.GeneralInformation; +using YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto; namespace YunDa.ISAS.Application.GeneralInformation { diff --git a/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/EquipmentLiveData/VoiceprintData.cs b/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/EquipmentLiveData/VoiceprintData.cs new file mode 100644 index 0000000..b3eb698 --- /dev/null +++ b/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/EquipmentLiveData/VoiceprintData.cs @@ -0,0 +1,38 @@ +using System; +using System.Text.Json.Serialization; + +namespace YunDa.ISAS.Application.GeneralInformation +{ + public class VoiceprintData + { + [JsonPropertyName("voiceprint_id")] + public string VoiceprintId { get; set; } + + [JsonPropertyName("saved_path")] + public string SavedPath { get; set; } + + [JsonPropertyName("image_saved")] + public bool ImageSaved { get; set; } + + [JsonPropertyName("timestamp")] + public DateTime Timestamp { get; set; } + + [JsonPropertyName("frequency_peak")] + public int FrequencyPeak { get; set; } + + [JsonPropertyName("amplitude_range")] + public double[] AmplitudeRange { get; set; } + + [JsonPropertyName("metadata")] + public VoiceprintMetadata Metadata { get; set; } + } + + public class VoiceprintMetadata + { + [JsonPropertyName("device_id")] + public string DeviceId { get; set; } + + [JsonPropertyName("sample_rate")] + public int SampleRate { get; set; } + } +} \ No newline at end of file diff --git a/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/TransformerSubstation/TransformerSubstationAppService.cs b/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/TransformerSubstation/TransformerSubstationAppService.cs index be05db9..ee9b2e3 100644 --- a/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/TransformerSubstation/TransformerSubstationAppService.cs +++ b/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/TransformerSubstation/TransformerSubstationAppService.cs @@ -926,7 +926,7 @@ namespace YunDa.ISAS.Application.GeneralInformation /// [HttpPost, Audited, Description("导入遥测、遥信、遥控配置文档,并修改数据库对应配置项")] [UnitOfWork(isTransactional: false)] - public async Task ImportTeleConfigurationExcelAsync([FromForm] IFormCollection formCollection, [FromQuery] Guid? id) + public async Task ImportTeleConfigurationExcelOldAsync([FromForm] IFormCollection formCollection, [FromQuery] Guid? id) { RequestEasyResult requestEasyResult = new RequestEasyResult(); try @@ -1458,6 +1458,592 @@ namespace YunDa.ISAS.Application.GeneralInformation return requestEasyResult; } + + + // ... existing code ... + + [HttpPost, Audited, Description("导入遥测、遥信、遥控配置文档,并修改数据库对应配置项")] + [UnitOfWork(isTransactional: false)] + public async Task ImportTeleConfigurationExcelAsync([FromForm] IFormCollection formCollection, [FromQuery] Guid? id) + { + RequestEasyResult requestEasyResult = new RequestEasyResult(); + try + { + FormFileCollection fileCollection = (FormFileCollection)formCollection.Files; + if (fileCollection == null || fileCollection.Count != 1) + { + return requestEasyResult; + } + + IFormFile file = fileCollection[0]; + ExcelHandler excelRead = new DataConfigurationExcelHandle(); + string ext = file.FileName.Split('.')?.LastOrDefault(); + + // 获取基础数据 + var equipmentRepo = await _equipmentInfoRepository.GetAll().ToListAsync(); + var equipmentTypeRepo = await _equipmentTypeRepository.GetAll().ToListAsync(); + var selfCheckingConfigurationRepo = await _selfCheckingConfigurationResitory.GetAll().ToListAsync(); + var telemeteringRepo = await _telemeteringConfigurationResitory.GetAllIncluding(t => t.EquipmentInfo).ToListAsync(); + var dmalarmCategoryRepo = await _dmalarmCategoryResitory.GetAll().ToListAsync(); + + // 处理遥测配置 + await ProcessTelemeteringConfigurations(file, excelRead, ext, id, equipmentRepo, equipmentTypeRepo, telemeteringRepo); + + // 处理遥测报警配置 + await ProcessTelemeteringAlarmStrategies(file, excelRead, ext, telemeteringRepo, dmalarmCategoryRepo); + + // 处理遥信配置 + await ProcessTelesignalisationConfigurations(file, excelRead, ext, id, equipmentRepo, equipmentTypeRepo, selfCheckingConfigurationRepo, dmalarmCategoryRepo); + + // 处理遥控配置 + await ProcessTelecommandConfigurations(file, excelRead, ext, id, equipmentRepo, equipmentTypeRepo); + + requestEasyResult.Flag = true; + } + catch (Exception ex) + { + Log4Helper.Error(this.GetType(), "变电所管理服务-导入配置", ex); + requestEasyResult.Flag = false; + requestEasyResult.Message = ex.Message; + } + + return requestEasyResult; + } + + private async Task ProcessTelemeteringConfigurations(IFormFile file, ExcelHandler excelRead, string ext, Guid? id, + List equipmentRepo, List equipmentTypeRepo, List telemeteringRepo) + { + try + { + var telemeteringStr = excelRead.ReadExcel(file.OpenReadStream(), "遥测", ext)?.ToString(); + if (telemeteringStr == null) return; + + JObject rss = JObject.Parse(telemeteringStr); + var results = rss["data"].Children().ToList(); + + var entitiesToUpdate = new List(); + var entitiesToInsert = new List(); + + foreach (JToken result in results) + { + var item = result.ToObject(); + if (string.IsNullOrEmpty(item.Name)) continue; + + TelemeteringConfiguration existingConfig = null; + if (item.Id != null) + { + existingConfig = telemeteringRepo.FirstOrDefault(t => t.Id == item.Id); + } + if (existingConfig == null) + { + existingConfig = telemeteringRepo.FirstOrDefault(t => + t.TransformerSubstationId == id && + t.EquipmentInfo?.Name == result["关联监控设备"].ToString() && + t.Name == item.Name); + } + + if (existingConfig != null) + { + // 更新现有记录 + UpdateTelemeteringConfiguration(existingConfig, item, result, equipmentRepo, equipmentTypeRepo); + entitiesToUpdate.Add(existingConfig); + } + else + { + // 创建新记录 + var newConfig = CreateTelemeteringConfiguration(item, result, id, equipmentRepo, equipmentTypeRepo); + if (newConfig != null) + { + entitiesToInsert.Add(newConfig); + } + } + } + + // 批量更新和插入 + if (entitiesToUpdate.Any()) + { + _telemeteringConfigurationResitory.GetDbContext().UpdateRange(entitiesToUpdate); + } + + if (entitiesToInsert.Any()) + { + _telemeteringConfigurationResitory.GetDbContext().AddRange(entitiesToInsert); + } + + await _telemeteringConfigurationResitory.GetDbContext().SaveChangesAsync(); + } + catch (Exception ex) + { + Log4Helper.Error(this.GetType(), "变电所管理服务-遥测导入", ex); + throw; + } + } + + private void UpdateTelemeteringConfiguration(TelemeteringConfiguration config, TelemeteringConfigurationExcel item, + JToken result, List equipmentRepo, List equipmentTypeRepo) + { + config.Name = item.Name; + config.SeqNo = item.SeqNo; + config.IsActive = item.IsActive; + config.IsSave = item.IsSave; + config.IsSendDispatcher = item.IsSendDispatcher; + config.IsVisible = item.IsVisible; + config.DispatcherAddress = item.DispatcherAddress; + config.CPUSector = item.CPUSector; + config.DeviceAddress = item.DeviceAddress; + config.InfoAddress = item.InfoAddress; + config.InfoCPUSector = item.InfoCPUSector; + config.InfoDeviceAddress = item.InfoDeviceAddress; + config.IsVirtualDevice = item.IsVirtualDevice; + config.IsSelfCheckingValue = item.IsSelfCheckingValue; + config.DecimalDigits = item.DecimalDigits; + config.Coefficient = item.Coefficient; + config.UpperLimit = item.UpperLimit; + config.LowerLimit = item.LowerLimit; + config.Unit = item.Unit; + config.DataSourceCategory = (DataSourceCategoryEnum)item.DataSourceCategory; + + var equipment = equipmentRepo.FirstOrDefault(t => t.Name == result["关联监控设备"].ToString()); + var equipmentType = equipmentTypeRepo.FirstOrDefault(t => t.Name == result["关联监控设备类型"].ToString()); + + if (equipment != null && equipmentType != null && equipment.EquipmentTypeId == equipmentType.Id) + { + config.EquipmentInfoId = equipment.Id; + config.EquipmentTypeId = equipmentType.Id; + } + } + + private TelemeteringConfiguration CreateTelemeteringConfiguration(TelemeteringConfigurationExcel item, + JToken result, Guid? id, List equipmentRepo, List equipmentTypeRepo) + { + var config = new TelemeteringConfiguration + { + Name = item.Name, + DispatcherAddress = item.DispatcherAddress, + CPUSector = item.CPUSector, + DeviceAddress = item.DeviceAddress, + InfoAddress = item.InfoAddress, + InfoCPUSector = item.InfoCPUSector, + InfoDeviceAddress = item.InfoDeviceAddress, + IsVirtualDevice = item.IsVirtualDevice, + IsSelfCheckingValue = item.IsSelfCheckingValue, + SeqNo = item.SeqNo, + IsActive = item.IsActive, + IsSave = item.IsSave, + IsSendDispatcher = item.IsSendDispatcher, + IsVisible = item.IsVisible, + UpperLimit = item.UpperLimit, + LowerLimit = item.LowerLimit, + DecimalDigits = item.DecimalDigits, + Coefficient = item.Coefficient, + Unit = item.Unit, + TransformerSubstationId = id, + DataSourceCategory = (DataSourceCategoryEnum)item.DataSourceCategory + }; + + var equipment = equipmentRepo.FirstOrDefault(t => t.Name == result["关联监控设备"].ToString()); + var equipmentType = equipmentTypeRepo.FirstOrDefault(t => t.Name == result["关联监控设备类型"].ToString()); + if (equipment != null && equipmentType != null && equipment.EquipmentTypeId == equipmentType.Id) + { + config.EquipmentInfoId = equipment.Id; + config.EquipmentTypeId = equipmentType.Id; + return config; + } + + return null; + } + + private async Task ProcessTelemeteringAlarmStrategies(IFormFile file, ExcelHandler excelRead, string ext, + List telemeteringRepo, List dmalarmCategoryRepo) + { + try + { + var telemeteringAlarmStr = excelRead.ReadExcel(file.OpenReadStream(), "遥测报警", ext)?.ToString(); + if (telemeteringAlarmStr == null) return; + + JObject rss = JObject.Parse(telemeteringAlarmStr); + var results = rss["data"].Children().ToList(); + var existingStrategies = await _telemeteringAlarmStrategyResitory.GetAll().ToListAsync(); + + foreach (JToken result in results) + { + var item = result.ToObject(); + if (!item.TelemeteringConfigurationId.HasValue && !string.IsNullOrWhiteSpace(item.TelemeteringConfigurationName)) + { + var telemeterItem = telemeteringRepo.FirstOrDefault(t => + t.Name == item.TelemeteringConfigurationName && + t.EquipmentInfo?.Name == item.EquipmentInfoName); + if (telemeterItem != null) + { + item.TelemeteringConfigurationId = telemeterItem.Id; + } + } + + if (item.Id != null) + { + var entity = existingStrategies.FirstOrDefault(t => t.Id == item.Id); + if (entity != null) + { + UpdateTelemeteringAlarmStrategy(entity, item); + await _telemeteringAlarmStrategyResitory.UpdateAsync(entity); + } + } + else + { + await CreateTelemeteringAlarmStrategy(item, telemeteringRepo, dmalarmCategoryRepo); + } + } + } + catch (Exception ex) + { + Log4Helper.Error(this.GetType(), "变电所管理服务-遥测报警导入", ex); + throw; + } + } + + private void UpdateTelemeteringAlarmStrategy(TelemeteringAlarmStrategy entity, TelemeteringAlarmStrategyExcel item) + { + entity.SeqNo = (int)item.SeqNo; + entity.IsActive = (bool)item.IsActive; + entity.LastModificationTime = DateTime.Now; + entity.LastModifierUserId = base.GetCurrentUser().Id; + entity.MaxValue = (float)item.MaxValue; + entity.MinValue = (float)item.MinValue; + } + + private async Task CreateTelemeteringAlarmStrategy(TelemeteringAlarmStrategyExcel item, + List telemeteringRepo, List dmalarmCategoryRepo) + { + if (item.AlarmLevel == null || string.IsNullOrEmpty(item.AlarmName)) return; + + var telemetering = telemeteringRepo.FirstOrDefault(t => t.Id == item.TelemeteringConfigurationId); + if (telemetering == null) return; + + var entity = new TelemeteringAlarmStrategy + { + SeqNo = (int)item.SeqNo, + IsActive = (bool)item.IsActive, + CreationTime = DateTime.Now, + CreatorUserId = base.GetCurrentUser().Id, + MaxValue = (float)item.MaxValue, + MinValue = (float)item.MinValue, + TelemeteringConfigurationId = telemetering.Id, + Id = Guid.NewGuid() + }; + + var dma = dmalarmCategoryRepo.FirstOrDefault(t => t.Name == item.AlarmName && t.Level == item.AlarmLevel); + if (dma != null) + { + entity.DMAlarmCategoryId = dma.Id; + await _telemeteringAlarmStrategyResitory.InsertAsync(entity); + } + } + + private async Task ProcessTelesignalisationConfigurations(IFormFile file, ExcelHandler excelRead, string ext, Guid? id, + List equipmentRepo, List equipmentTypeRepo, + List selfCheckingConfigurationRepo, List dmalarmCategoryRepo) + { + try + { + var telesignalStr = excelRead.ReadExcel(file.OpenReadStream(), "遥信", ext)?.ToString(); + if (telesignalStr == null) return; + + JObject rss = JObject.Parse(telesignalStr); + var results = rss["data"].Children().ToList(); + var existingConfigs = await _telesignalisationConfigurationResitory.GetAll().ToListAsync(); + + var entitiesToUpdate = new List(); + var entitiesToInsert = new List(); + + foreach (JToken result in results) + { + var item = result.ToObject(); + if (string.IsNullOrEmpty(item.Name)) continue; + + // 查找现有配置 + var existingConfig = existingConfigs.FirstOrDefault(t => + t.TransformerSubstationId == id && + t.EquipmentInfo?.Name == result["关联监控设备"].ToString() && + t.Name == item.Name); + + if (existingConfig != null) + { + UpdateTelesignalisationConfiguration(existingConfig, item, result, equipmentRepo, + equipmentTypeRepo, selfCheckingConfigurationRepo, dmalarmCategoryRepo); + entitiesToUpdate.Add(existingConfig); + } + else + { + var newConfig = CreateTelesignalisationConfiguration(item, result, id, equipmentRepo, + equipmentTypeRepo, selfCheckingConfigurationRepo, dmalarmCategoryRepo); + if (newConfig != null) + { + entitiesToInsert.Add(newConfig); + } + } + } + + if (entitiesToUpdate.Any()) + { + _telesignalisationConfigurationResitory.GetDbContext().UpdateRange(entitiesToUpdate); + } + + if (entitiesToInsert.Any()) + { + _telesignalisationConfigurationResitory.GetDbContext().AddRange(entitiesToInsert); + } + + await _telesignalisationConfigurationResitory.GetDbContext().SaveChangesAsync(); + } + catch (Exception ex) + { + Log4Helper.Error(this.GetType(), "变电所管理服务-遥信导入", ex); + throw; + } + } + + private void UpdateTelesignalisationConfiguration(TelesignalisationConfiguration config, + TelesignalisationConfigurationExcel item, JToken result, List equipmentRepo, + List equipmentTypeRepo, List selfCheckingConfigurationRepo, + List dmalarmCategoryRepo) + { + config.Name = item.Name; + config.DispatcherAddress = item.DispatcherAddress; + config.CPUSector = item.CPUSector; + config.DeviceAddress = item.DeviceAddress; + config.InfoAddress = item.InfoAddress; + config.InfoCPUSector = item.InfoCPUSector; + config.InfoDeviceAddress = item.InfoDeviceAddress; + config.IsVirtualDevice = item.IsVirtualDevice; + config.IsSelfCheckingValue = item.IsSelfCheckingValue; + config.SeqNo = item.SeqNo; + config.IsActive = item.IsActive; + config.IsSave = item.IsSave; + config.IsSendDispatcher = item.IsSendDispatcher; + config.IsVisible = item.IsVisible; + config.RemoteType = item.RemoteType; + config.YesContent = item.YesContent; + config.NoContent = item.NoContent; + config.UnsurenessContent = string.IsNullOrWhiteSpace(item.UnsurenessContent) ? "不定" : item.UnsurenessContent; + config.IsCommStatus = item.IsCommStatus; + config.DataSourceCategory = (DataSourceCategoryEnum)item.DataSourceCategory; + + if (item.DMAlarmCategoryId.HasValue) + { + var dm = dmalarmCategoryRepo.FirstOrDefault(t => t.Id == item.DMAlarmCategoryId); + config.DMAlarmCategoryId = dm?.Id; + } + else + { + var dm = dmalarmCategoryRepo.FirstOrDefault(t => t.Name == item.AlarmName && t.Level == item.AlarmLevel); + config.DMAlarmCategoryId = dm?.Id; + } + + var selfChecking = selfCheckingConfigurationRepo.FirstOrDefault(t => t.Name == result["自检策略名称"].ToString()); + if (selfChecking != null) + { + config.SelfCheckingConfigurationId = selfChecking.Id; + } + + var equipment = equipmentRepo.FirstOrDefault(t => t.Name == result["关联监控设备"].ToString()); + var equipmentType = equipmentTypeRepo.FirstOrDefault(t => t.Name == result["关联监控设备类型"].ToString()); + if (equipment != null && equipmentType != null && equipment.EquipmentTypeId == equipmentType.Id) + { + config.EquipmentInfoId = equipment.Id; + config.EquipmentTypeId = equipmentType.Id; + } + } + + private TelesignalisationConfiguration CreateTelesignalisationConfiguration(TelesignalisationConfigurationExcel item, + JToken result, Guid? id, List equipmentRepo, List equipmentTypeRepo, + List selfCheckingConfigurationRepo, List dmalarmCategoryRepo) + { + var config = new TelesignalisationConfiguration + { + Name = item.Name, + DispatcherAddress = item.DispatcherAddress, + CPUSector = item.CPUSector, + DeviceAddress = item.DeviceAddress, + InfoAddress = item.InfoAddress, + InfoCPUSector = item.InfoCPUSector, + InfoDeviceAddress = item.InfoDeviceAddress, + IsVirtualDevice = item.IsVirtualDevice, + IsSelfCheckingValue = item.IsSelfCheckingValue, + SeqNo = item.SeqNo, + IsActive = item.IsActive, + IsSave = item.IsSave, + IsSendDispatcher = item.IsSendDispatcher, + IsVisible = item.IsVisible, + RemoteType = item.RemoteType, + YesContent = item.YesContent, + NoContent = item.NoContent, + UnsurenessContent = string.IsNullOrWhiteSpace(item.UnsurenessContent) ? "不定" : item.UnsurenessContent, + IsCommStatus = item.IsCommStatus, + TransformerSubstationId = id, + DataSourceCategory = (DataSourceCategoryEnum)item.DataSourceCategory + }; + + if (item.DMAlarmCategoryId.HasValue) + { + var dm = dmalarmCategoryRepo.FirstOrDefault(t => t.Id == item.DMAlarmCategoryId); + config.DMAlarmCategoryId = dm?.Id; + } + else + { + var dm = dmalarmCategoryRepo.FirstOrDefault(t => t.Name == item.AlarmName && t.Level == item.AlarmLevel); + config.DMAlarmCategoryId = dm?.Id; + } + + var equipment = equipmentRepo.FirstOrDefault(t => t.Name == result["关联监控设备"].ToString()); + var equipmentType = equipmentTypeRepo.FirstOrDefault(t => t.Name == result["关联监控设备类型"].ToString()); + if (equipment != null && equipmentType != null && equipment.EquipmentTypeId == equipmentType.Id) + { + config.EquipmentInfoId = equipment.Id; + config.EquipmentTypeId = equipmentType.Id; + } + + var selfChecking = selfCheckingConfigurationRepo.FirstOrDefault(t => t.Name == result["自检策略名称"].ToString()); + if (selfChecking != null) + { + config.SelfCheckingConfigurationId = selfChecking.Id; + } + + return config; + } + + private async Task ProcessTelecommandConfigurations(IFormFile file, ExcelHandler excelRead, string ext, Guid? id, + List equipmentRepo, List equipmentTypeRepo) + { + try + { + var telecommandStr = excelRead.ReadExcel(file.OpenReadStream(), "遥控", ext)?.ToString(); + if (telecommandStr == null) return; + + JObject rss = JObject.Parse(telecommandStr); + var results = rss["data"].Children().ToList(); + var existingConfigs = await _telecommandConfigurationResitory.GetAll().ToListAsync(); + + foreach (JToken result in results) + { + var item = result.ToObject(); + if (string.IsNullOrEmpty(item.Name)) continue; + + // 查找现有配置 + var existingConfig = existingConfigs.FirstOrDefault(t => + t.TransformerSubstationId == id && + t.EquipmentInfo?.Name == result["关联监控设备"].ToString() && + t.Name == item.Name); + + if (existingConfig != null) + { + UpdateTelecommandConfiguration(existingConfig, item, result, equipmentRepo, equipmentTypeRepo); + await _telecommandConfigurationResitory.UpdateAsync(existingConfig); + } + else + { + var newConfig = CreateTelecommandConfiguration(item, result, id, equipmentRepo, equipmentTypeRepo); + if (newConfig != null) + { + await _telecommandConfigurationResitory.InsertAsync(newConfig); + } + } + } + } + catch (Exception ex) + { + Log4Helper.Error(this.GetType(), "变电所管理服务-遥控导入", ex); + throw; + } + } + + private void UpdateTelecommandConfiguration(TelecommandConfiguration config, TelecommandConfigurationExcel item, + JToken result, List equipmentRepo, List equipmentTypeRepo) + { + config.Name = item.Name; + config.DispatcherAddress = item.DispatcherAddress; + config.CPUSector = item.CPUSector; + config.DeviceAddress = item.DeviceAddress; + config.InfoAddress = item.InfoAddress; + config.InfoCPUSector = item.InfoCPUSector; + config.InfoDeviceAddress = item.InfoDeviceAddress; + config.IsVirtualDevice = item.IsVirtualDevice; + config.SeqNo = item.SeqNo; + config.IsActive = item.IsActive; + config.IsSave = item.IsSave; + config.IsSendDispatcher = item.IsSendDispatcher; + config.IsVisible = item.IsVisible; + config.RemoteType = item.RemoteType; + config.YesContent = item.YesContent; + config.NoContent = item.NoContent; + config.UnsurenessContent = string.IsNullOrWhiteSpace(item.UnsurenessContent) ? "不定" : item.UnsurenessContent; + config.RelatedTelesignalisationId = item.RelatedTelesignalisationId; + + var equipment = equipmentRepo.FirstOrDefault(t => t.Name == result["关联监控设备"].ToString()); + var equipmentType = equipmentTypeRepo.FirstOrDefault(t => t.Name == result["关联监控设备类型"].ToString()); + if (equipment != null && equipmentType != null) + { + if (equipment.EquipmentTypeId == equipmentType.Id) + { + if (config.EquipmentInfoId != equipment.Id) + { + config.EquipmentInfoId = equipment.Id; + } + if (config.EquipmentTypeId != equipmentType.Id) + { + config.EquipmentTypeId = equipmentType.Id; + } + } + } + } + + private TelecommandConfiguration CreateTelecommandConfiguration(TelecommandConfigurationExcel item, + JToken result, Guid? id, List equipmentRepo, List equipmentTypeRepo) + { + var config = new TelecommandConfiguration + { + Name = item.Name, + DispatcherAddress = item.DispatcherAddress, + CPUSector = item.CPUSector, + DeviceAddress = item.DeviceAddress, + InfoAddress = item.InfoAddress, + InfoCPUSector = item.InfoCPUSector, + InfoDeviceAddress = item.InfoDeviceAddress, + IsVirtualDevice = item.IsVirtualDevice, + SeqNo = item.SeqNo, + IsActive = item.IsActive, + IsSave = item.IsSave, + IsSendDispatcher = item.IsSendDispatcher, + IsVisible = item.IsVisible, + RemoteType = item.RemoteType, + YesContent = item.YesContent, + NoContent = item.NoContent, + UnsurenessContent = item.UnsurenessContent, + RelatedTelesignalisationId = item.RelatedTelesignalisationId, + TransformerSubstationId = id + }; + + var equipment = equipmentRepo.FirstOrDefault(t => t.Name == result["关联监控设备"].ToString()); + var equipmentType = equipmentTypeRepo.FirstOrDefault(t => t.Name == result["关联监控设备类型"].ToString()); + if (equipment != null && equipmentType != null) + { + if (equipment.EquipmentTypeId == equipmentType.Id) + { + if (config.EquipmentInfoId != equipment.Id) + { + config.EquipmentInfoId = equipment.Id; + } + if (config.EquipmentTypeId != equipmentType.Id) + { + config.EquipmentTypeId = equipmentType.Id; + } + return config; + } + } + + return null; + } + + // ... existing code ... #endregion 数据配置导入导出 #region 基础数据文件 diff --git a/src/YunDa.Application/YunDa.ISAS.Application/VideoSurveillance/VideoDev/VideoDevAppService.cs b/src/YunDa.Application/YunDa.ISAS.Application/VideoSurveillance/VideoDev/VideoDevAppService.cs index 8bfa95b..753ffe5 100644 --- a/src/YunDa.Application/YunDa.ISAS.Application/VideoSurveillance/VideoDev/VideoDevAppService.cs +++ b/src/YunDa.Application/YunDa.ISAS.Application/VideoSurveillance/VideoDev/VideoDevAppService.cs @@ -5,6 +5,7 @@ using Abp.Domain.Repositories; using Abp.Domain.Uow; using Abp.Extensions; using Abp.Linq.Extensions; +using Abp.UI; using Castle.Core.Resource; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; @@ -874,7 +875,7 @@ namespace YunDa.ISAS.Application.VideoSurveillance /// /// [HttpPost, Audited, Description("导入摄像头信息")] - public RequestEasyResult ImportExcelData([FromForm] IFormCollection formCollection, [FromQuery] Guid? id) + public RequestEasyResult ImportExcelDataOld([FromForm] IFormCollection formCollection, [FromQuery] Guid? id) { RequestEasyResult requestEasyResult = new RequestEasyResult(); FormFileCollection fileCollection = (FormFileCollection)formCollection.Files; @@ -1100,6 +1101,357 @@ namespace YunDa.ISAS.Application.VideoSurveillance return requestEasyResult; } + [HttpPost, Audited, Description("导入摄像头信息与预置位信息")] + public RequestEasyResult ImportExcelData([FromForm] IFormCollection formCollection, [FromQuery] Guid? id) + { + var requestEasyResult = new RequestEasyResult { Flag = false }; + var currentUser = base.GetCurrentUser(); + + try + { + // 参数验证 + if (formCollection?.Files == null || !(formCollection.Files is FormFileCollection fileCollection) || fileCollection.Count == 0) + { + requestEasyResult.Message = "请上传有效的Excel文件"; + return requestEasyResult; + } + + var excelFile = fileCollection[0]; + var fileExtension = Path.GetExtension(excelFile.FileName).TrimStart('.'); + + // 处理摄像头数据 + ProcessCameraData(excelFile.OpenReadStream(), id, currentUser, fileExtension); + + // 处理预置位数据 + ProcessPresetPointData(excelFile.OpenReadStream(), id, currentUser, fileExtension); + + requestEasyResult.Flag = true; + UpdateRedisVideoData(); + } + catch (UserFriendlyException ex) + { + requestEasyResult.Message = ex.Message; + Log4Helper.Warn(GetType(), $"业务校验异常: {ex.Message}", ex); + } + catch (Exception ex) + { + requestEasyResult.Message = "系统处理过程中发生错误"; + Log4Helper.Error(GetType(), "导入数据异常", ex); + } + + return requestEasyResult; + } + + #region 摄像头处理 + private void ProcessCameraData(Stream excelStream, Guid? substationId, LoginUserOutput currentUser, string fileExtension) + { + excelStream.Position = 0; + var excelHandler = new VideoCameraImportExcelHandle(); + var jsonData = excelHandler.ReadExcel(excelStream, "摄像头表格", fileExtension)?.ToString(); + + if (string.IsNullOrWhiteSpace(jsonData)) return; + + var cameraList = JObject.Parse(jsonData)["data"]? + .ToObject>() + .Where(IsValidCameraRecord) + .ToList(); + + if (cameraList == null || cameraList.Count == 0) return; + + // 预加载数据 + var existingCameras = _videoDevRepository.GetAll() + .Where(x => x.TransformerSubstationId == substationId) + .ToList(); + + var cameraById = existingCameras.ToDictionary(x => x.Id); + var cameraByName = existingCameras.ToDictionary(x => x.DevName, StringComparer.OrdinalIgnoreCase); + var manufacturers = _manufacturerInfoRepository.GetAll() + .ToDictionary(x => x.ManufacturerName, StringComparer.OrdinalIgnoreCase); + + foreach (var excelItem in cameraList) + { + VideoDev targetCamera = null; + + // 优先通过ID查找 + if (excelItem.Id.HasValue) + { + cameraById.TryGetValue(excelItem.Id.Value, out targetCamera); + } + if (targetCamera==null) + { + cameraByName.TryGetValue(excelItem.DevName, out targetCamera); + + } + + if (targetCamera != null) + { + UpdateExistingCamera(targetCamera, excelItem, manufacturers); + } + else + { + CreateNewCamera(excelItem, substationId, manufacturers); + } + } + } + + private bool IsValidCameraRecord(VideoCameraExcel item) + { + return !string.IsNullOrWhiteSpace(item.ManufacturerInfoName) + && !string.IsNullOrWhiteSpace(item.VideoDevName) + && !string.IsNullOrWhiteSpace(item.DevName) + && !string.IsNullOrWhiteSpace(item.DevTypeName) + && !string.IsNullOrWhiteSpace(item.CodeStreamTypeName) + && item.ChannelNo.HasValue + && item.DevNo.HasValue; + } + + private void UpdateExistingCamera(VideoDev entity, VideoCameraExcel item, Dictionary manufacturerDict) + { + var nvrDevice = FindNvrDevice(item.VideoDevName); + if (nvrDevice == null) return; + + entity.VideoDevId = nvrDevice.Id; + entity.IP = item.IP; + entity.SeqNo = item.SeqNo; + entity.Port = item.Port; + entity.InstallationArea = item.InstallationArea; + entity.ChannelNo = item.ChannelNo; + entity.DevName = item.DevName; + entity.DevCode = item.DevCode; + entity.DevNo = item.DevNo; + entity.DevPassword = item.DevPassword; + entity.DevUserName = item.DevUserName; + entity.IsActive = item.IsActive; + entity.PostionDescription = item.PostionDescription; + entity.IsPTZ = item.IsPTZ; + + if (manufacturerDict.TryGetValue(item.ManufacturerInfoName, out var manufacturer)) + { + entity.ManufacturerInfoId = manufacturer.Id; + } + + entity.CodeStreamType = GetEnumByDescription(item.CodeStreamTypeName); + entity.DevType = GetEnumByDescription(item.DevTypeName); + + _videoDevRepository.Update(entity); + } + + private void CreateNewCamera(VideoCameraExcel item, Guid? substationId, Dictionary manufacturerDict) + { + var nvrDevice = FindNvrDevice(item.VideoDevName); + if (nvrDevice == null) return; + + var newCamera = new VideoDev + { + VideoDevId = nvrDevice.Id, + TransformerSubstationId = substationId, + IP = item.IP, + SeqNo = item.SeqNo, + Port = item.Port, + InstallationArea = item.InstallationArea, + ChannelNo = item.ChannelNo, + DevName = item.DevName, + DevCode = item.DevCode, + DevNo = item.DevNo, + DevPassword = item.DevPassword, + DevUserName = item.DevUserName, + IsActive = item.IsActive, + PostionDescription = item.PostionDescription, + IsPTZ = item.IsPTZ, + CodeStreamType = GetEnumByDescription(item.CodeStreamTypeName), + DevType = GetEnumByDescription(item.DevTypeName) + }; + + if (manufacturerDict.TryGetValue(item.ManufacturerInfoName, out var manufacturer)) + { + newCamera.ManufacturerInfoId = manufacturer.Id; + } + + _videoDevRepository.Insert(newCamera); + } + + private VideoDev FindNvrDevice(string videoDevName) + { + if (string.IsNullOrWhiteSpace(videoDevName)) return null; + return _videoDevRepository.FirstOrDefault(x => x.DevName == videoDevName); + } + #endregion + + #region 预置位处理 + private void ProcessPresetPointData(Stream excelStream, Guid? substationId, LoginUserOutput currentUser, string fileExtension) + { + excelStream.Position = 0; + var excelHandler = new VideoCameraImportExcelHandle(); + var jsonData = excelHandler.ReadExcel(excelStream, "预置位表", fileExtension)?.ToString(); + + if (string.IsNullOrWhiteSpace(jsonData)) return; + + var presetList = JObject.Parse(jsonData)["data"]? + .ToObject>() + .Where(IsValidPresetPoint) + .ToList(); + + if (presetList == null || presetList.Count == 0) return; + + // 预加载数据 + var existingPresetPoints = _presetPointRepository.GetAllIncluding( + p => p.VideoDev, + p => p.EquipmentInfo, + p => p.EquipmentType, + p => p.EquipmentViewPoint + ).ToList(); + + var cameras = _videoDevRepository.GetAll() + .Where(x => x.TransformerSubstationId == substationId) + .ToList(); + + var presetById = existingPresetPoints.ToDictionary(x => x.Id); + var presetByCameraAndNumber = existingPresetPoints + .Where(x => x.VideoDev != null) + .ToDictionary(x => new PresetKey(x.VideoDev.DevName, x.Number)); + + var equipmentDict = _equipmentInfoRepository.GetAll() + .Where(x => x.TransformerSubstationId == substationId) + .ToDictionary(x => x.Name, StringComparer.OrdinalIgnoreCase); + + var equipmentTypeDict = _equipmentTypeRepository.GetAll() + .ToDictionary(x => x.Name, StringComparer.OrdinalIgnoreCase); + + var viewPointDict = _equipmentViewPointRepository.GetAll() + .ToDictionary(x => x.Name, StringComparer.OrdinalIgnoreCase); + + foreach (var excelItem in presetList) + { + PresetPoint targetPreset = null; + + // 优先通过ID查找 + if (excelItem.Id.HasValue) + { + presetById.TryGetValue(excelItem.Id.Value, out targetPreset); + } + if (targetPreset == null) + { + var key = new PresetKey(excelItem.CameraName, excelItem.Number.Value); + presetByCameraAndNumber.TryGetValue(key, out targetPreset); + } + + + if (targetPreset != null) + { + UpdateExistingPreset(targetPreset, excelItem, equipmentDict, equipmentTypeDict, viewPointDict, currentUser); + } + else + { + CreateNewPreset(excelItem, cameras, equipmentDict, equipmentTypeDict, viewPointDict, currentUser); + } + } + } + + private class PresetKey + { + public string CameraName { get; } + public int Number { get; } + + public PresetKey(string cameraName, int number) + { + CameraName = cameraName; + Number = number; + } + + public override bool Equals(object obj) + { + return obj is PresetKey other && + CameraName == other.CameraName && + Number == other.Number; + } + + public override int GetHashCode() + { + return HashCode.Combine(CameraName, Number); + } + } + + private bool IsValidPresetPoint(PresetPointExcel item) + { + return !string.IsNullOrWhiteSpace(item.CameraName) + && item.Number.HasValue + ; + } + + private void UpdateExistingPreset(PresetPoint entity, PresetPointExcel item, + Dictionary equipmentDict, + Dictionary equipmentTypeDict, + Dictionary viewPointDict, + LoginUserOutput currentUser) + { + entity.Name = item.PresetName; + entity.Number = item.Number.Value; + entity.IsImageRecognition = item.IsImageRecognition.Value; + entity.SeqNo = int.TryParse(item.SeqNo, out int seqNo) ? seqNo : 0; + entity.LastModificationTime = DateTime.Now; + entity.LastModifierUserId = currentUser.Id; + entity.Remark = "批量修改"; + + if (!string.IsNullOrWhiteSpace(item.EquipmentInfoName) && equipmentDict.TryGetValue(item.EquipmentInfoName, out var equipment)) + { + entity.EquipmentInfoId = equipment.Id; + } + + if (!string.IsNullOrWhiteSpace(item.EquipmentTypeName) && equipmentTypeDict.TryGetValue(item.EquipmentTypeName, out var equipmentType)) + { + entity.EquipmentTypeId = equipmentType.Id; + } + + if (!string.IsNullOrWhiteSpace(item.ViewPointName) && viewPointDict.TryGetValue(item.ViewPointName, out var viewPoint)) + { + entity.EquipmentViewPointId = viewPoint.Id; + } + + _presetPointRepository.Update(entity); + } + + private void CreateNewPreset(PresetPointExcel item, List cameras, + Dictionary equipmentDict, + Dictionary equipmentTypeDict, + Dictionary viewPointDict, + LoginUserOutput currentUser) + { + var camera = cameras.FirstOrDefault(x => x.DevName == item.CameraName); + if (camera == null) return; + + var newPreset = new PresetPoint + { + VideoDevId = camera.Id, + Name = item.PresetName, + Number = item.Number.Value, + IsImageRecognition = item.IsImageRecognition.Value, + SeqNo = int.TryParse(item.SeqNo, out int seqNo) ? seqNo : 0, + CreationTime = DateTime.Now, + CreatorUserId = currentUser.Id, + Remark = "批量新增", + IsActive = true + }; + + if (!string.IsNullOrWhiteSpace(item.EquipmentInfoName) && equipmentDict.TryGetValue(item.EquipmentInfoName, out var equipment)) + { + newPreset.EquipmentInfoId = equipment.Id; + } + + if (!string.IsNullOrWhiteSpace(item.EquipmentTypeName) && equipmentTypeDict.TryGetValue(item.EquipmentTypeName, out var equipmentType)) + { + newPreset.EquipmentTypeId = equipmentType.Id; + } + + if (!string.IsNullOrWhiteSpace(item.ViewPointName) && viewPointDict.TryGetValue(item.ViewPointName, out var viewPoint)) + { + newPreset.EquipmentViewPointId = viewPoint.Id; + } + + _presetPointRepository.Insert(newPreset); + } + #endregion + + /// /// 导出摄像头数据 /// diff --git a/src/YunDa.Application/YunDa.ISAS.Application/YunDa.ISAS.Application.xml b/src/YunDa.Application/YunDa.ISAS.Application/YunDa.ISAS.Application.xml index 9b4c83f..f7e61c1 100644 --- a/src/YunDa.Application/YunDa.ISAS.Application/YunDa.ISAS.Application.xml +++ b/src/YunDa.Application/YunDa.ISAS.Application/YunDa.ISAS.Application.xml @@ -2565,7 +2565,7 @@ - + 导入摄像头信息 @@ -2645,6 +2645,14 @@ + + + 指标配置增加或修改 + + + + + 设备信息 @@ -3871,18 +3879,6 @@ - - - 填充出厂编号 - - - - - - 填充出厂编号 - - - 生成装置的初始历史记录 @@ -3998,12 +3994,6 @@ - - - 生成10个测试回路信息 - - - 二次回路逻辑表达式类 @@ -4315,7 +4305,7 @@ - + 导入遥测、遥信、遥控配置文档,并修改数据库对应配置项 diff --git a/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/EquipmentIndicatorConfigDto/EditEquipmentIndicatorCommentInput.cs b/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/EquipmentIndicatorConfigDto/EditEquipmentIndicatorCommentInput.cs new file mode 100644 index 0000000..759c186 --- /dev/null +++ b/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/EquipmentIndicatorConfigDto/EditEquipmentIndicatorCommentInput.cs @@ -0,0 +1,30 @@ +using Abp.AutoMapper; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Text; +using YunDa.ISAS.Entities.AuditCommon; +using YunDa.ISAS.Entities.CommonDto; +using YunDa.SOMS.Entities.GeneralInformation; + +namespace YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentIndicatorConfigDto +{ + [AutoMapTo(typeof(EquipmentIndicatorComment))] + public class EditEquipmentIndicatorCommentInput + { + public string Id { get; set; } + /// + /// 顺序号 + /// + public virtual int SeqNo { get; set; } + public string Description { get; set; } + /// + /// 备注 + /// + public virtual string Remark { get; set; } + /// + /// 是否在用 + /// + public virtual bool IsActive { get; set; } + } +} diff --git a/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/EquipmentIndicatorConfigDto/EditEquipmentIndicatorConfigInput.cs b/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/EquipmentIndicatorConfigDto/EditEquipmentIndicatorConfigInput.cs new file mode 100644 index 0000000..436ba31 --- /dev/null +++ b/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/EquipmentIndicatorConfigDto/EditEquipmentIndicatorConfigInput.cs @@ -0,0 +1,30 @@ +using Abp.AutoMapper; +using System; +using System.Collections.Generic; +using System.Text; +using YunDa.ISAS.Entities.AuditCommon; +using YunDa.ISAS.Entities.CommonDto; +using YunDa.SOMS.Entities.GeneralInformation; + +namespace YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentIndicatorConfigDto +{ + [AutoMapTo(typeof(EquipmentIndicatorConfig))] + public class EditEquipmentIndicatorConfigInput : ISASAuditedEntityDto + { + /// + /// 顺序号 + /// + public virtual int SeqNo { get; set; } + public virtual string Name { get; set; } + public virtual string CalculationFormula { get; set; } + public virtual decimal Weight { get; set; } + public virtual decimal DataPrecision { get; set; } + public virtual decimal Value { get; set; } + /// + /// 所属设别类别 + /// + public virtual Guid? EquipmentTypeId { get; set; } + public virtual bool IsActive { get; set; } + public virtual string Remark { get; set; } + } +} diff --git a/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/EquipmentIndicatorConfigDto/EquipmentIndicatorConfigOutput.cs b/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/EquipmentIndicatorConfigDto/EquipmentIndicatorConfigOutput.cs new file mode 100644 index 0000000..c1a26c2 --- /dev/null +++ b/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/EquipmentIndicatorConfigDto/EquipmentIndicatorConfigOutput.cs @@ -0,0 +1,31 @@ +using Abp.AutoMapper; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; +using System.Text; +using YunDa.ISAS.Entities.GeneralInformation; +using YunDa.SOMS.Entities.GeneralInformation; +using Abp.Application.Services.Dto; +namespace YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentIndicatorConfigDto +{ + [AutoMapFrom(typeof(EquipmentIndicatorConfig))] + public class EquipmentIndicatorConfigOutput : EntityDto + { + /// + /// 顺序号 + /// + public virtual int SeqNo { get; set; } + public virtual string Name { get; set; } + public virtual string CalculationFormula { get; set; } + public virtual decimal Weight { get; set; } + public virtual decimal DataPrecision { get; set; } + public virtual decimal Value { get; set; } + /// + /// 所属设别类别 + /// + public virtual Guid? EquipmentTypeId { get; set; } + public virtual bool IsActive { get; set; } + public virtual string Remark { get; set; } + } +} diff --git a/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/EquipmentIndicatorConfigDto/EquipmentIndicatorConfigSearchConditionInput.cs b/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/EquipmentIndicatorConfigDto/EquipmentIndicatorConfigSearchConditionInput.cs new file mode 100644 index 0000000..675e8fc --- /dev/null +++ b/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/EquipmentIndicatorConfigDto/EquipmentIndicatorConfigSearchConditionInput.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Text; +using YunDa.ISAS.DataTransferObject.CommonDto; + +namespace YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentIndicatorConfigDto +{ + public class EquipmentIndicatorConfigSearchConditionInput : ISASMySQLSearchInput + { + /// + /// 设备名称 + /// + public virtual string Name { get; set; } + + /// + /// 所属设备类别Id + /// + public virtual Guid? EquipmentTypeId { get; set; } + public bool? IsActive { get; set; } + } +} diff --git a/src/YunDa.Application/YunDa.ISAS.DataTransferObject/EquipmentLiveData/ConstantModel.cs b/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/EquipmentLiveDataDto/ConstantModel.cs similarity index 80% rename from src/YunDa.Application/YunDa.ISAS.DataTransferObject/EquipmentLiveData/ConstantModel.cs rename to src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/EquipmentLiveDataDto/ConstantModel.cs index 0765157..917e5e8 100644 --- a/src/YunDa.Application/YunDa.ISAS.DataTransferObject/EquipmentLiveData/ConstantModel.cs +++ b/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/EquipmentLiveDataDto/ConstantModel.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace YunDa.ISAS.DataTransferObject.EquipmentLiveData +namespace YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto { public class ConstantModel { diff --git a/src/YunDa.Application/YunDa.ISAS.DataTransferObject/EquipmentLiveData/EquimentOverviewOutput.cs b/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/EquipmentLiveDataDto/EquimentOverviewOutput.cs similarity index 91% rename from src/YunDa.Application/YunDa.ISAS.DataTransferObject/EquipmentLiveData/EquimentOverviewOutput.cs rename to src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/EquipmentLiveDataDto/EquimentOverviewOutput.cs index 93be06e..0e8bc21 100644 --- a/src/YunDa.Application/YunDa.ISAS.DataTransferObject/EquipmentLiveData/EquimentOverviewOutput.cs +++ b/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/EquipmentLiveDataDto/EquimentOverviewOutput.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace YunDa.ISAS.DataTransferObject.EquipmentLiveData +namespace YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto { public class EquimentOverviewOutput { diff --git a/src/YunDa.Application/YunDa.ISAS.DataTransferObject/EquipmentLiveData/EquipmentDataModel.cs b/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/EquipmentLiveDataDto/EquipmentDataModel.cs similarity index 87% rename from src/YunDa.Application/YunDa.ISAS.DataTransferObject/EquipmentLiveData/EquipmentDataModel.cs rename to src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/EquipmentLiveDataDto/EquipmentDataModel.cs index c221615..4c5b30d 100644 --- a/src/YunDa.Application/YunDa.ISAS.DataTransferObject/EquipmentLiveData/EquipmentDataModel.cs +++ b/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/EquipmentLiveDataDto/EquipmentDataModel.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; using YunDa.ISAS.DataTransferObject.GeneralInformation.EquipmentInfoDto; -namespace YunDa.ISAS.DataTransferObject.EquipmentLiveData +namespace YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto { public class EquipmentDataModel : MonitoringEquipmentInfoOutput { diff --git a/src/YunDa.Application/YunDa.ISAS.DataTransferObject/EquipmentLiveData/EquipmentInfoDiagnoseResult.cs b/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/EquipmentLiveDataDto/EquipmentInfoDiagnoseResult.cs similarity index 94% rename from src/YunDa.Application/YunDa.ISAS.DataTransferObject/EquipmentLiveData/EquipmentInfoDiagnoseResult.cs rename to src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/EquipmentLiveDataDto/EquipmentInfoDiagnoseResult.cs index 8b1020f..fef3782 100644 --- a/src/YunDa.Application/YunDa.ISAS.DataTransferObject/EquipmentLiveData/EquipmentInfoDiagnoseResult.cs +++ b/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/EquipmentLiveDataDto/EquipmentInfoDiagnoseResult.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace YunDa.SOMS.DataTransferObject.EquipmentLiveData +namespace YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto { /// /// 诊断结果 @@ -52,7 +52,7 @@ namespace YunDa.SOMS.DataTransferObject.EquipmentLiveData /// 建议内容 /// public string Suggest { get; set; } - + } /// /// 点位数据 diff --git a/src/YunDa.Application/YunDa.ISAS.DataTransferObject/EquipmentLiveData/NJJWPP.cs b/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/EquipmentLiveDataDto/NJJWPP.cs similarity index 64% rename from src/YunDa.Application/YunDa.ISAS.DataTransferObject/EquipmentLiveData/NJJWPP.cs rename to src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/EquipmentLiveDataDto/NJJWPP.cs index 8a99fe7..0aa6518 100644 --- a/src/YunDa.Application/YunDa.ISAS.DataTransferObject/EquipmentLiveData/NJJWPP.cs +++ b/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/EquipmentLiveDataDto/NJJWPP.cs @@ -5,11 +5,11 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace YunDa.SOMS.DataTransferObject.EquipmentLiveData +namespace YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto { public class NJJWPP { - [JsonProperty("设备名称")]public string DeviceName { get; set; } + [JsonProperty("设备名称")] public string DeviceName { get; set; } public int UID { get; set; } [JsonProperty("描述")] public string Description { get; set; } } diff --git a/src/YunDa.Application/YunDa.ISAS.DataTransferObject/EquipmentLiveData/TelemeteringHourStatisticsModel.cs b/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/EquipmentLiveDataDto/TelemeteringHourStatisticsModel.cs similarity index 97% rename from src/YunDa.Application/YunDa.ISAS.DataTransferObject/EquipmentLiveData/TelemeteringHourStatisticsModel.cs rename to src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/EquipmentLiveDataDto/TelemeteringHourStatisticsModel.cs index 32f1f4c..8278e84 100644 --- a/src/YunDa.Application/YunDa.ISAS.DataTransferObject/EquipmentLiveData/TelemeteringHourStatisticsModel.cs +++ b/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/EquipmentLiveDataDto/TelemeteringHourStatisticsModel.cs @@ -8,7 +8,7 @@ using System.Threading.Tasks; using static Google.Protobuf.WellKnownTypes.Field.Types; using Yunda.ISAS.MongoDB.Entities.DataMonitoring; -namespace YunDa.ISAS.DataTransferObject.EquipmentLiveData +namespace YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto { [AutoMapTo(typeof(TelemeteringHourStatisticsResult))] public class TelemeteringHourStatisticsModel diff --git a/src/YunDa.Application/YunDa.ISAS.DataTransferObject/EquipmentLiveData/TelemeteringModel.cs b/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/EquipmentLiveDataDto/TelemeteringModel.cs similarity index 97% rename from src/YunDa.Application/YunDa.ISAS.DataTransferObject/EquipmentLiveData/TelemeteringModel.cs rename to src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/EquipmentLiveDataDto/TelemeteringModel.cs index c16ce31..2d714d9 100644 --- a/src/YunDa.Application/YunDa.ISAS.DataTransferObject/EquipmentLiveData/TelemeteringModel.cs +++ b/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/EquipmentLiveDataDto/TelemeteringModel.cs @@ -6,7 +6,7 @@ using YunDa.ISAS.DataTransferObject.DataMonitoring.TelemeteringAlarmStrategyDto; using YunDa.ISAS.DataTransferObject.DataMonitoring.TelemeteringConfigurationDto; using YunDa.SOMS.DataTransferObject; -namespace YunDa.ISAS.DataTransferObject.EquipmentLiveData +namespace YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto { [MessagePackObject(keyAsPropertyName: true)] public class TelemeteringModel : TelemeteringConfigurationProperty @@ -73,7 +73,7 @@ namespace YunDa.ISAS.DataTransferObject.EquipmentLiveData /// 获取当前 值 触发的报警策略 /// /// - + public TelemeteringAlarmStrategyProperty AnalysisAlarm() { TelemeteringAlarmStrategyProperty alarmStrategy = null; diff --git a/src/YunDa.Application/YunDa.ISAS.DataTransferObject/EquipmentLiveData/TelesignalisationModel.cs b/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/EquipmentLiveDataDto/TelesignalisationModel.cs similarity index 94% rename from src/YunDa.Application/YunDa.ISAS.DataTransferObject/EquipmentLiveData/TelesignalisationModel.cs rename to src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/EquipmentLiveDataDto/TelesignalisationModel.cs index 56b14dc..27f2b89 100644 --- a/src/YunDa.Application/YunDa.ISAS.DataTransferObject/EquipmentLiveData/TelesignalisationModel.cs +++ b/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/EquipmentLiveDataDto/TelesignalisationModel.cs @@ -4,7 +4,7 @@ using YunDa.ISAS.DataTransferObject.DataMonitoring.TelesignalisationConfiguratio using YunDa.ISAS.Entities.DataMonitoring; using YunDa.SOMS.DataTransferObject; -namespace YunDa.ISAS.DataTransferObject.EquipmentLiveData +namespace YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto { [MessagePackObject(keyAsPropertyName: true)] public class TelesignalisationModel : TelesignalisationConfigurationProperty @@ -15,7 +15,7 @@ namespace YunDa.ISAS.DataTransferObject.EquipmentLiveData /// /// public int ResultValue { get; set; } = ConstantModel.DegaultValue; - public bool IsSendSelfCheck { get; set; } + public bool IsSendSelfCheck { get; set; } public virtual string ResultValueStr { @@ -73,7 +73,7 @@ namespace YunDa.ISAS.DataTransferObject.EquipmentLiveData /// /// 遥信是否报警 /// - + public bool IsAlarm { get diff --git a/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/EquipmentLiveDataDto/VoiceprintData.cs b/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/EquipmentLiveDataDto/VoiceprintData.cs new file mode 100644 index 0000000..1b330cb --- /dev/null +++ b/src/YunDa.Application/YunDa.ISAS.DataTransferObject/GeneralInformation/EquipmentLiveDataDto/VoiceprintData.cs @@ -0,0 +1,38 @@ +using System; +using System.Text.Json.Serialization; + +namespace YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveDataDto +{ + public class VoiceprintData + { + [JsonPropertyName("voiceprint_id")] + public string VoiceprintId { get; set; } + + [JsonPropertyName("saved_path")] + public string SavedPath { get; set; } + + [JsonPropertyName("image_saved")] + public bool ImageSaved { get; set; } + + [JsonPropertyName("timestamp")] + public DateTime Timestamp { get; set; } + + [JsonPropertyName("frequency_peak")] + public int FrequencyPeak { get; set; } + + [JsonPropertyName("amplitude_range")] + public double[] AmplitudeRange { get; set; } + + [JsonPropertyName("metadata")] + public VoiceprintMetadata Metadata { get; set; } + } + + public class VoiceprintMetadata + { + [JsonPropertyName("device_id")] + public string DeviceId { get; set; } + + [JsonPropertyName("sample_rate")] + public int SampleRate { get; set; } + } +} \ No newline at end of file diff --git a/src/YunDa.Application/YunDa.ISAS.DataTransferObject/YunDa.ISAS.DataTransferObject.xml b/src/YunDa.Application/YunDa.ISAS.DataTransferObject/YunDa.ISAS.DataTransferObject.xml index e160155..d90fb8b 100644 --- a/src/YunDa.Application/YunDa.ISAS.DataTransferObject/YunDa.ISAS.DataTransferObject.xml +++ b/src/YunDa.Application/YunDa.ISAS.DataTransferObject/YunDa.ISAS.DataTransferObject.xml @@ -5639,140 +5639,6 @@ 是否在用 - - - 序号 - - - - - 类型名称 - - - - - 总数量 - - - - - 在线数量 - - - - - 描述 - - - - - 是否显示 - - - - - 遥测数据List - - - - - 遥信数据 - - - - - 结果最小值 - - - - - 结果最大值 - - - - - 小时之内第一个值 - - - - - 小时之内最后一个值 - - - - - 小时之内平均值 - - - - - 统计数量 - - - - - 时间,格式("yyyy-MM-dd HH") - - - - - - 初始化数据 - - - - - 测量结果值 - - - - - 上次结果值测量结果值 - - - - - 测量时间 - - - - - 报警等级 - - - - - 上次报警等级 - - - - - 报警策略 - - - - - 获取当前 值 触发的报警策略 - - - - - - 单点 测量结果值1:合;0:分;其它:非法值 - 双点 测量结果值0:不定;1:分;2:合;其它:非法值 - - - - - - 测量时间 - - - - - 遥信是否报警 - - 顺序号 @@ -14572,51 +14438,230 @@ 诊断数据 - + + + 顺序号 + + + + + 备注 + + + + + 是否在用 + + + + + 顺序号 + + + + + 所属设别类别 + + + + + 顺序号 + + + + + 所属设别类别 + + + + + 设备名称 + + + + + 所属设备类别Id + + + + + 序号 + + + + + 类型名称 + + + + + 总数量 + + + + + 在线数量 + + + + + 描述 + + + + + 是否显示 + + + + + 遥测数据List + + + + + 遥信数据 + + + 诊断结果 - + 诊断名称 - + 评分 - + 诊断状态 - + 错误代码 - + 错误类型 - + 建议代码 - + 建议内容 - + 点位数据 + + + 结果最小值 + + + + + 结果最大值 + + + + + 小时之内第一个值 + + + + + 小时之内最后一个值 + + + + + 小时之内平均值 + + + + + 统计数量 + + + + + 时间,格式("yyyy-MM-dd HH") + + + + + + 初始化数据 + + + + + 测量结果值 + + + + + 上次结果值测量结果值 + + + + + 测量时间 + + + + + 报警等级 + + + + + 上次报警等级 + + + + + 报警策略 + + + + + 获取当前 值 触发的报警策略 + + + + + + 单点 测量结果值1:合;0:分;其它:非法值 + 双点 测量结果值0:不定;1:分;2:合;其它:非法值 + + + + + + 测量时间 + + + + + 遥信是否报警 + + 保护装置输出接口 diff --git a/src/YunDa.Domain/YunDa.ISAS.Entities/GeneralInformation/EquipmentDataCategory.cs b/src/YunDa.Domain/YunDa.ISAS.Entities/GeneralInformation/EquipmentDataCategory.cs index f32fd30..eb6c453 100644 --- a/src/YunDa.Domain/YunDa.ISAS.Entities/GeneralInformation/EquipmentDataCategory.cs +++ b/src/YunDa.Domain/YunDa.ISAS.Entities/GeneralInformation/EquipmentDataCategory.cs @@ -27,7 +27,7 @@ namespace YunDa.ISAS.Entities.GeneralInformation public virtual int SeqNo { get; set; } /// - /// 设备名称,命名规则:运行编号_安装区域_位置描述_设备子类。 + /// 设备名称 /// [Required] [StringLength(MaxNameLength)] diff --git a/src/YunDa.Domain/YunDa.ISAS.Entities/GeneralInformation/EquipmentIndicatorComment.cs b/src/YunDa.Domain/YunDa.ISAS.Entities/GeneralInformation/EquipmentIndicatorComment.cs new file mode 100644 index 0000000..877ec1b --- /dev/null +++ b/src/YunDa.Domain/YunDa.ISAS.Entities/GeneralInformation/EquipmentIndicatorComment.cs @@ -0,0 +1,35 @@ +using Abp.Domain.Entities; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel; +using System.Text; +using System.ComponentModel.DataAnnotations.Schema; +using YunDa.ISAS.Entities.AuditCommon.IAdudit; + +namespace YunDa.SOMS.Entities.GeneralInformation +{ + [Table("gi_equipment_indicator_comment")] + + public class EquipmentIndicatorComment : Entity, IISASPassivable + { + /// + /// 顺序号 + /// + public virtual int SeqNo { get; set; } + public string Description { get; set; } + + /// + /// 备注 + /// + public virtual string Remark { get; set; } + + /// + /// 是否在用 + /// + [DefaultValue(true)] + public virtual bool IsActive { get; set; } + + + } +} diff --git a/src/YunDa.Domain/YunDa.ISAS.Entities/GeneralInformation/EquipmentIndicatorConfig.cs b/src/YunDa.Domain/YunDa.ISAS.Entities/GeneralInformation/EquipmentIndicatorConfig.cs new file mode 100644 index 0000000..16a8383 --- /dev/null +++ b/src/YunDa.Domain/YunDa.ISAS.Entities/GeneralInformation/EquipmentIndicatorConfig.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations.Schema; +using System.Text; +using YunDa.ISAS.Entities.AuditCommon.IAdudit; +using YunDa.ISAS.Entities.AuditCommon; +using YunDa.ISAS.Entities.GeneralInformation; +using System.ComponentModel.DataAnnotations; + +namespace YunDa.SOMS.Entities.GeneralInformation +{ + [Table("gi_equipment_indicator_config")] + public class EquipmentIndicatorConfig : ISASAuditedEntity, IISASPassivable + { + private const int MaxNameLength = 200; + /// + /// 顺序号 + /// + public virtual int SeqNo { get; set; } + [Required] + [StringLength(MaxNameLength)] + public virtual string Name { get; set; } + public virtual string CalculationFormula { get; set; } + public virtual decimal Weight { get; set; } + public virtual decimal DataPrecision { get; set; } + public virtual decimal Value { get; set; } + /// + /// 所属设别类别 + /// + public virtual Guid? EquipmentTypeId { get; set; } + [ForeignKey("EquipmentTypeId")] + public virtual EquipmentType EquipmentType { get; set; } + public virtual bool IsActive { get; set; } + public virtual string Remark { get; set; } + [ForeignKey("Name")] + public virtual EquipmentIndicatorComment EquipmentIndicatorComment { get; set; } + } +} diff --git a/src/YunDa.Domain/YunDa.ISAS.EntityFrameworkCore/EntityFrameworkCore/DbContextOptionsConfigurer.cs b/src/YunDa.Domain/YunDa.ISAS.EntityFrameworkCore/EntityFrameworkCore/DbContextOptionsConfigurer.cs index 76bdf3b..ccbd7cf 100644 --- a/src/YunDa.Domain/YunDa.ISAS.EntityFrameworkCore/EntityFrameworkCore/DbContextOptionsConfigurer.cs +++ b/src/YunDa.Domain/YunDa.ISAS.EntityFrameworkCore/EntityFrameworkCore/DbContextOptionsConfigurer.cs @@ -2,10 +2,6 @@ using Pomelo.EntityFrameworkCore.MySql.Storage; using Pomelo.EntityFrameworkCore.MySql.Storage.Internal; using System; - -//using Pomelo.EntityFrameworkCore.MySql.Infrastructure; -//using System; - namespace YunDa.ISAS.EntityFrameworkCore.EntityFrameworkCore { public static class DbContextOptionsConfigurer diff --git a/src/YunDa.Domain/YunDa.ISAS.EntityFrameworkCore/EntityFrameworkCore/ISASDbContext.cs b/src/YunDa.Domain/YunDa.ISAS.EntityFrameworkCore/EntityFrameworkCore/ISASDbContext.cs index 350414d..514d88e 100644 --- a/src/YunDa.Domain/YunDa.ISAS.EntityFrameworkCore/EntityFrameworkCore/ISASDbContext.cs +++ b/src/YunDa.Domain/YunDa.ISAS.EntityFrameworkCore/EntityFrameworkCore/ISASDbContext.cs @@ -326,7 +326,9 @@ namespace YunDa.ISAS.EntityFrameworkCore.EntityFrameworkCore #endregion public virtual DbSet EquipmentDataCategoryBaseDbSet { get; set; } - + public virtual DbSet EquipmentIndicatorCommentDbSet { get; set; } + public virtual DbSet EquipmentIndicatorConfigDbSet { get; set; } + } } \ No newline at end of file diff --git a/src/YunDa.Domain/YunDa.ISAS.EntityFrameworkCore/EntityFrameworkCore/Seed/InitialHostDbBuilder.cs b/src/YunDa.Domain/YunDa.ISAS.EntityFrameworkCore/EntityFrameworkCore/Seed/InitialHostDbBuilder.cs index 1b8f9f6..8e4f2d0 100644 --- a/src/YunDa.Domain/YunDa.ISAS.EntityFrameworkCore/EntityFrameworkCore/Seed/InitialHostDbBuilder.cs +++ b/src/YunDa.Domain/YunDa.ISAS.EntityFrameworkCore/EntityFrameworkCore/Seed/InitialHostDbBuilder.cs @@ -330,6 +330,7 @@ namespace YunDa.ISAS.EntityFrameworkCore.EntityFrameworkCore.Seed } } #endregion + #region 运维客户端 int seq = 0; string code = "02" + seq.ToString("00"); fun = funs.FirstOrDefault(f => f.Code == code && f.Type == FunctionType.MaintenanceSystemClient); @@ -379,8 +380,13 @@ namespace YunDa.ISAS.EntityFrameworkCore.EntityFrameworkCore.Seed { AddMaintenanceSystemFunction(seq, "版本管理与板卡诊断", code); } - #region 运维客户端 - + seq = 07; + code = "02" + seq.ToString("00"); + fun = funs.FirstOrDefault(f => f.Code == code && f.Type == FunctionType.MaintenanceSystemClient); + if (fun == null) + { + AddMaintenanceSystemFunction(seq, "主动安全", code); + } #endregion _context.SaveChanges(); } @@ -799,7 +805,24 @@ namespace YunDa.ISAS.EntityFrameworkCore.EntityFrameworkCore.Seed { fun.Name = "二次回路"; } - + sysFunction = new SysFunction + { + Id = Guid.NewGuid(), + SeqNo = 13, + Name = "设备诊断指标", + Code = code + 13, + Type = FunctionType.Web, + LoadUrl = @"/GeneralInformation/EquipmentIndicatorConfig", + IsActive = true, + IsOperatorPage = true, + SysFunctionId = ID + }; + fun = funs.FirstOrDefault(f => f.Code == sysFunction.Code && f.Type == FunctionType.Web); + if (fun == null) + { + _context.SysFunctionDbSet.Add(sysFunction); + } + } /// /// 添加视频监控模块 diff --git a/src/YunDa.Domain/YunDa.ISAS.EntityFrameworkCore/EntityFrameworkCore/Seed/SeedHelper.cs b/src/YunDa.Domain/YunDa.ISAS.EntityFrameworkCore/EntityFrameworkCore/Seed/SeedHelper.cs index 2e7921a..6f27f18 100644 --- a/src/YunDa.Domain/YunDa.ISAS.EntityFrameworkCore/EntityFrameworkCore/Seed/SeedHelper.cs +++ b/src/YunDa.Domain/YunDa.ISAS.EntityFrameworkCore/EntityFrameworkCore/Seed/SeedHelper.cs @@ -30,8 +30,8 @@ namespace YunDa.ISAS.EntityFrameworkCore.EntityFrameworkCore.Seed { try { - //var context = uowManager.Object.Current.GetDbContext(); - //contextAction(context); + var context = uowManager.Object.Current.GetDbContext(); + contextAction(context); uow.Complete(); } catch (Exception ex) diff --git a/src/YunDa.Domain/YunDa.ISAS.EntityFrameworkCore/Migrations/20250417030739_update_table_v100.Designer.cs b/src/YunDa.Domain/YunDa.ISAS.EntityFrameworkCore/Migrations/20250417030739_update_table_v100.Designer.cs new file mode 100644 index 0000000..446167b --- /dev/null +++ b/src/YunDa.Domain/YunDa.ISAS.EntityFrameworkCore/Migrations/20250417030739_update_table_v100.Designer.cs @@ -0,0 +1,5198 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using YunDa.ISAS.EntityFrameworkCore.EntityFrameworkCore; + +namespace YunDa.ISAS.Migrations +{ + [DbContext(typeof(ISASDbContext))] + [Migration("20250417030739_update_table_v100")] + partial class update_table_v100 + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "3.1.32") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("YunDa.ISAS.Entities.ClientConfiguration.ThreeDimension.CCThreeDimension", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("EquipmentInfoId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("ModelId") + .HasColumnType("int"); + + b.Property("ModelName") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("TelecommandConfigurationId") + .HasColumnType("char(36)"); + + b.Property("TelemeteringConfigurationId") + .HasColumnType("char(36)"); + + b.Property("TelesignalisationConfigurationId") + .HasColumnType("char(36)"); + + b.Property("ThreeDimensionDataCategory") + .HasColumnType("int"); + + b.Property("TransformerSubstationId") + .HasColumnType("char(36)"); + + b.Property("VideoDevId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("EquipmentInfoId"); + + b.HasIndex("TelecommandConfigurationId"); + + b.HasIndex("TelemeteringConfigurationId"); + + b.HasIndex("TelesignalisationConfigurationId"); + + b.HasIndex("TransformerSubstationId"); + + b.HasIndex("VideoDevId"); + + b.ToTable("cc_three_dimension"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.DataMonitoring.MultidimensionalCheck", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("EquipmentInfoId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.Property("PatternRecognitionConfigutrationId1") + .HasColumnType("char(36)"); + + b.Property("PatternRecognitionConfigutrationId2") + .HasColumnType("char(36)"); + + b.Property("PresetPointId1") + .HasColumnType("char(36)"); + + b.Property("PresetPointId2") + .HasColumnType("char(36)"); + + b.Property("Remark") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("SeqNo") + .HasColumnType("int"); + + b.Property("TelesignalisationConfigurationId") + .HasColumnType("char(36)"); + + b.Property("TransformerSubstationId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("EquipmentInfoId"); + + b.HasIndex("PatternRecognitionConfigutrationId1"); + + b.HasIndex("PatternRecognitionConfigutrationId2"); + + b.HasIndex("PresetPointId1"); + + b.HasIndex("PresetPointId2"); + + b.HasIndex("TelesignalisationConfigurationId"); + + b.HasIndex("TransformerSubstationId"); + + b.ToTable("dm_multidimensional_check"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.DataMonitoring.MultidimensionalCheckSchedule", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("EndTime") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("IntervalMinute") + .HasColumnType("int"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("Remark") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("StartTime") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Week") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("dm_multidimensional_check_schedule"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.DataMonitoring.SelfCheckingConfiguration", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("DataType") + .HasColumnType("int"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("JudgmentMode") + .HasColumnType("int"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("LowerLimit") + .HasColumnType("float"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("RepetitiveDisplacementTimes") + .HasColumnType("int"); + + b.Property("RepetitiveSendTimes") + .HasColumnType("int"); + + b.Property("SendTelemeteringValue") + .HasColumnType("float"); + + b.Property("SendTelesignalisationValue") + .HasColumnType("int"); + + b.Property("SeqNo") + .HasColumnType("int"); + + b.Property("TimeOfJudgment") + .HasColumnType("int"); + + b.Property("TransformerSubstationId") + .HasColumnType("char(36)"); + + b.Property("UpperLimit") + .HasColumnType("float"); + + b.HasKey("Id"); + + b.HasIndex("TransformerSubstationId"); + + b.ToTable("dm_self_checking_configuration"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.DataMonitoring.TeleCommandPlanSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.Property("Remark") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("SeqNo") + .HasColumnType("int"); + + b.Property("TransformerSubstationId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TransformerSubstationId"); + + b.ToTable("dm_telecommand_plan_setting"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.DataMonitoring.TeleCommandPlanTime", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ByDays") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("Freq") + .HasColumnType("int"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("Remark") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("SendTelecommandTime") + .HasColumnType("datetime(6)"); + + b.Property("SeqNo") + .HasColumnType("int"); + + b.Property("StartTime") + .HasColumnType("datetime(6)"); + + b.Property("TeleCommandPlanSettingId") + .HasColumnType("char(36)"); + + b.Property("TransformerSubstationId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TeleCommandPlanSettingId"); + + b.HasIndex("TransformerSubstationId"); + + b.ToTable("dm_telecommand_plan_time"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.DataMonitoring.TeleCommandSettingItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("Name") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Remark") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("SeqNo") + .HasColumnType("int"); + + b.Property("TeleCommandPlanSettingId") + .HasColumnType("char(36)"); + + b.Property("TeleCommandValue") + .HasColumnType("int"); + + b.Property("TelecommandConfigurationId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TeleCommandPlanSettingId"); + + b.HasIndex("TelecommandConfigurationId"); + + b.ToTable("dm_telecommand_setting_item"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.DataMonitoring.TelecommandConfiguration", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CPUSector") + .HasColumnType("int"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("DataSourceCategory") + .HasColumnType("int"); + + b.Property("DeviceAddress") + .HasColumnType("int"); + + b.Property("DispatcherAddress") + .HasColumnType("int"); + + b.Property("EquipmentInfoId") + .HasColumnType("char(36)"); + + b.Property("EquipmentTypeId") + .HasColumnType("char(36)"); + + b.Property("InfoAddress") + .HasColumnType("int"); + + b.Property("InfoCPUSector") + .HasColumnType("int"); + + b.Property("InfoDeviceAddress") + .HasColumnType("int"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsSave") + .HasColumnType("tinyint(1)"); + + b.Property("IsSendDispatcher") + .HasColumnType("tinyint(1)"); + + b.Property("IsVirtualDevice") + .HasColumnType("tinyint(1)"); + + b.Property("IsVisible") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.Property("NoContent") + .IsRequired() + .HasColumnType("varchar(20) CHARACTER SET utf8mb4") + .HasMaxLength(20); + + b.Property("RelatedTelesignalisationId") + .HasColumnType("char(36)"); + + b.Property("RemoteType") + .HasColumnType("int"); + + b.Property("SeqNo") + .HasColumnType("int"); + + b.Property("TransformerSubstationId") + .HasColumnType("char(36)"); + + b.Property("UnsurenessContent") + .HasColumnType("varchar(20) CHARACTER SET utf8mb4") + .HasMaxLength(20); + + b.Property("YesContent") + .IsRequired() + .HasColumnType("varchar(20) CHARACTER SET utf8mb4") + .HasMaxLength(20); + + b.HasKey("Id"); + + b.HasIndex("EquipmentInfoId"); + + b.HasIndex("EquipmentTypeId"); + + b.HasIndex("RelatedTelesignalisationId"); + + b.HasIndex("TransformerSubstationId"); + + b.ToTable("dm_telecommand_configuration"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.DataMonitoring.TelecommandTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("EquipmentTypeId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsSave") + .HasColumnType("tinyint(1)"); + + b.Property("IsSendDispatcher") + .HasColumnType("tinyint(1)"); + + b.Property("IsVisible") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.Property("NoContent") + .IsRequired() + .HasColumnType("varchar(20) CHARACTER SET utf8mb4") + .HasMaxLength(20); + + b.Property("RelatedTelesignalisationId") + .HasColumnType("char(36)"); + + b.Property("RemoteType") + .HasColumnType("int"); + + b.Property("SeqNo") + .HasColumnType("int"); + + b.Property("UnsurenessContent") + .HasColumnType("varchar(20) CHARACTER SET utf8mb4") + .HasMaxLength(20); + + b.Property("YesContent") + .IsRequired() + .HasColumnType("varchar(20) CHARACTER SET utf8mb4") + .HasMaxLength(20); + + b.HasKey("Id"); + + b.HasIndex("EquipmentTypeId"); + + b.ToTable("dm_telecommand_template"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.DataMonitoring.TelemeteringAlarmTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("DMAlarmCategoryId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("MaxValue") + .HasColumnType("float"); + + b.Property("MinValue") + .HasColumnType("float"); + + b.Property("SeqNo") + .HasColumnType("int"); + + b.Property("TelemeteringTemplateId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("DMAlarmCategoryId"); + + b.HasIndex("TelemeteringTemplateId"); + + b.ToTable("dm_telemetering_alarm_template"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.DataMonitoring.TelemeteringConfiguration", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CPUSector") + .HasColumnType("int"); + + b.Property("Coefficient") + .HasColumnType("float"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("DataSourceCategory") + .HasColumnType("int"); + + b.Property("DecimalDigits") + .HasColumnType("int"); + + b.Property("DeviceAddress") + .HasColumnType("int"); + + b.Property("DispatcherAddress") + .HasColumnType("int"); + + b.Property("EquipmentInfoId") + .HasColumnType("char(36)"); + + b.Property("EquipmentTypeId") + .HasColumnType("char(36)"); + + b.Property("InfoAddress") + .HasColumnType("int"); + + b.Property("InfoCPUSector") + .HasColumnType("int"); + + b.Property("InfoDeviceAddress") + .HasColumnType("int"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsEnvironmentTemp") + .HasColumnType("tinyint(1)"); + + b.Property("IsSave") + .HasColumnType("tinyint(1)"); + + b.Property("IsSelfCheckingValue") + .HasColumnType("tinyint(1)"); + + b.Property("IsSendDispatcher") + .HasColumnType("tinyint(1)"); + + b.Property("IsVirtualDevice") + .HasColumnType("tinyint(1)"); + + b.Property("IsVisible") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("LowerLimit") + .HasColumnType("float"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.Property("SelfCheckingConfigurationId") + .HasColumnType("char(36)"); + + b.Property("SeqNo") + .HasColumnType("int"); + + b.Property("TransformerSubstationId") + .HasColumnType("char(36)"); + + b.Property("Unit") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("UpperLimit") + .HasColumnType("float"); + + b.Property("ismsbaseYCId") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.HasIndex("EquipmentInfoId"); + + b.HasIndex("EquipmentTypeId"); + + b.HasIndex("SelfCheckingConfigurationId"); + + b.HasIndex("TransformerSubstationId"); + + b.ToTable("dm_telemetering_Configuration"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.DataMonitoring.TelemeteringTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Coefficient") + .HasColumnType("float"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("DecimalDigits") + .HasColumnType("int"); + + b.Property("EquipmentTypeId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsSave") + .HasColumnType("tinyint(1)"); + + b.Property("IsSendDispatcher") + .HasColumnType("tinyint(1)"); + + b.Property("IsVisible") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.Property("SeqNo") + .HasColumnType("int"); + + b.Property("Unit") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.HasIndex("EquipmentTypeId"); + + b.ToTable("dm_telemetering_template"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.DataMonitoring.TelesignalisationConfiguration", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CPUSector") + .HasColumnType("int"); + + b.Property("CommValue") + .HasColumnType("int"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("DMAlarmCategoryId") + .HasColumnType("char(36)"); + + b.Property("DataSourceCategory") + .HasColumnType("int"); + + b.Property("DeviceAddress") + .HasColumnType("int"); + + b.Property("DispatcherAddress") + .HasColumnType("int"); + + b.Property("EquipmentInfoId") + .HasColumnType("char(36)"); + + b.Property("EquipmentTypeId") + .HasColumnType("char(36)"); + + b.Property("InfoAddress") + .HasColumnType("int"); + + b.Property("InfoCPUSector") + .HasColumnType("int"); + + b.Property("InfoDeviceAddress") + .HasColumnType("int"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsCommStatus") + .HasColumnType("tinyint(1)"); + + b.Property("IsSave") + .HasColumnType("tinyint(1)"); + + b.Property("IsSelfCheckingValue") + .HasColumnType("tinyint(1)"); + + b.Property("IsSendDispatcher") + .HasColumnType("tinyint(1)"); + + b.Property("IsVirtualDevice") + .HasColumnType("tinyint(1)"); + + b.Property("IsVisible") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.Property("NoContent") + .IsRequired() + .HasColumnType("varchar(20) CHARACTER SET utf8mb4") + .HasMaxLength(20); + + b.Property("RemoteType") + .HasColumnType("int"); + + b.Property("SelfCheckingConfigurationId") + .HasColumnType("char(36)"); + + b.Property("SeqNo") + .HasColumnType("int"); + + b.Property("TransformerSubstationId") + .HasColumnType("char(36)"); + + b.Property("UnsurenessContent") + .HasColumnType("varchar(20) CHARACTER SET utf8mb4") + .HasMaxLength(20); + + b.Property("YesContent") + .IsRequired() + .HasColumnType("varchar(20) CHARACTER SET utf8mb4") + .HasMaxLength(20); + + b.Property("ismsbaseYXId") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.HasIndex("DMAlarmCategoryId"); + + b.HasIndex("EquipmentInfoId"); + + b.HasIndex("EquipmentTypeId"); + + b.HasIndex("SelfCheckingConfigurationId"); + + b.HasIndex("TransformerSubstationId"); + + b.ToTable("dm_telesignalisation_configuration"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.DataMonitoring.TelesignalisationTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CommValue") + .HasColumnType("int"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("DMAlarmCategoryId") + .HasColumnType("char(36)"); + + b.Property("EquipmentTypeId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsCommStatus") + .HasColumnType("tinyint(1)"); + + b.Property("IsSave") + .HasColumnType("tinyint(1)"); + + b.Property("IsSendDispatcher") + .HasColumnType("tinyint(1)"); + + b.Property("IsVisible") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.Property("NoContent") + .IsRequired() + .HasColumnType("varchar(20) CHARACTER SET utf8mb4") + .HasMaxLength(20); + + b.Property("RemoteType") + .HasColumnType("int"); + + b.Property("SeqNo") + .HasColumnType("int"); + + b.Property("UnsurenessContent") + .HasColumnType("varchar(20) CHARACTER SET utf8mb4") + .HasMaxLength(20); + + b.Property("YesContent") + .IsRequired() + .HasColumnType("varchar(20) CHARACTER SET utf8mb4") + .HasMaxLength(20); + + b.HasKey("Id"); + + b.HasIndex("DMAlarmCategoryId"); + + b.HasIndex("EquipmentTypeId"); + + b.ToTable("dm_telesignalisation_template"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.Foundation.NameDateText", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Content") + .HasColumnType("longtext CHARACTER SET utf8mb4") + .HasMaxLength(65535); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("Name") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Remark") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("TransformerSubstationId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TransformerSubstationId"); + + b.ToTable("fd_name_date_text"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.GeneralInformation.EquipmentDataCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("DataSourceCategory") + .HasColumnType("int"); + + b.Property("Description") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("EquipmentTypeId") + .HasColumnType("char(36)"); + + b.Property("Icon") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("Remark") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("SeqNo") + .HasColumnType("int"); + + b.Property("TransformerSubstationId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("EquipmentTypeId"); + + b.HasIndex("Name"); + + b.HasIndex("TransformerSubstationId"); + + b.ToTable("gi_equipment_data_category"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.GeneralInformation.EquipmentDataCategoryExactly", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("EquipmentDataCategoryId") + .HasColumnType("char(36)"); + + b.Property("EquipmentInfoId") + .HasColumnType("char(36)"); + + b.Property("EquipmentTypeId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("Remark") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("TransformerSubstationId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("EquipmentDataCategoryId"); + + b.HasIndex("EquipmentInfoId"); + + b.HasIndex("EquipmentTypeId"); + + b.HasIndex("TransformerSubstationId"); + + b.ToTable("gi_equipment_data_category_exactly"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.GeneralInformation.EquipmentInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("BelongEquipmentInfoId") + .HasColumnType("char(36)"); + + b.Property("Code") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("EquipmentTypeId") + .HasColumnType("char(36)"); + + b.Property("FactorySerialNumber") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("InstallationArea") + .HasColumnType("varchar(40) CHARACTER SET utf8mb4") + .HasMaxLength(40); + + b.Property("InstallationDate") + .HasColumnType("datetime(6)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsRemoteControl") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("MaintenanceRecord") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("ManufacturerInfoId") + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("PostionDescription") + .HasColumnType("varchar(40) CHARACTER SET utf8mb4") + .HasMaxLength(40); + + b.Property("ProductionDate") + .HasColumnType("datetime(6)"); + + b.Property("Remark") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("RunNumber") + .HasColumnType("varchar(40) CHARACTER SET utf8mb4") + .HasMaxLength(40); + + b.Property("SafetyPlanStateType") + .HasColumnType("int"); + + b.Property("SafetyPlanTime") + .HasColumnType("datetime(6)"); + + b.Property("SafetyStateType") + .HasColumnType("int"); + + b.Property("SeqNo") + .HasColumnType("int"); + + b.Property("TransformerSubstationId") + .HasColumnType("char(36)"); + + b.Property("VerificationDate") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("VerificationPerson") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("VerificationRecords") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.HasIndex("BelongEquipmentInfoId"); + + b.HasIndex("EquipmentTypeId"); + + b.HasIndex("ManufacturerInfoId"); + + b.HasIndex("TransformerSubstationId"); + + b.ToTable("gi_equipment_info"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.GeneralInformation.EquipmentLinkTeledata", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("DataEquipmentInfoId") + .HasColumnType("char(36)"); + + b.Property("EquipmentDataCategoryExactlyId") + .HasColumnType("char(36)"); + + b.Property("EquipmentInfoId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsVisable") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("Remark") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("TeleDataProperty") + .HasColumnType("int"); + + b.Property("TelemeteringConfigurationId") + .HasColumnType("char(36)"); + + b.Property("TelesignalisationConfigurationId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("DataEquipmentInfoId"); + + b.HasIndex("EquipmentDataCategoryExactlyId"); + + b.HasIndex("EquipmentInfoId"); + + b.HasIndex("TelemeteringConfigurationId"); + + b.HasIndex("TelesignalisationConfigurationId"); + + b.ToTable("gi_equipment_link_Teledata"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.GeneralInformation.EquipmentLocation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("Remark") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("SeqNo") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("gi_equipment_location"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.GeneralInformation.EquipmentType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("EquipmentTypeId") + .HasColumnType("char(36)"); + + b.Property("EquipmentTypeLevel") + .HasColumnType("int"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.Property("SeqNo") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("gi_equipment_type"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.GeneralInformation.EquipmentTypeViewPoint", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("EquipmentTypeId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("Remark") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("SeqNo") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("EquipmentTypeId"); + + b.ToTable("gi_equipment_type_view_point"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.GeneralInformation.EquipmentViewPoint", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("EquipmentInfoId") + .HasColumnType("char(36)"); + + b.Property("EquipmentTypeViewPointId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("Remark") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("SeqNo") + .HasColumnType("int"); + + b.Property("TransformerSubstationId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("EquipmentInfoId"); + + b.HasIndex("EquipmentTypeViewPointId"); + + b.HasIndex("TransformerSubstationId"); + + b.ToTable("gi_equipment_view_point"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.GeneralInformation.ManufacturerInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("DeleterUserId") + .HasColumnType("char(36)"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)"); + + b.Property("EmailAddress") + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("ManufacturerAddress") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("ManufacturerCode") + .IsRequired() + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("ManufacturerName") + .IsRequired() + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("PhoneNumber") + .HasColumnType("varchar(29) CHARACTER SET utf8mb4") + .HasMaxLength(29); + + b.Property("Remark") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.ToTable("gi_manufacturer_info"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.GeneralInformation.MasterStation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("MasterStationAddress") + .HasColumnType("varchar(250) CHARACTER SET utf8mb4") + .HasMaxLength(250); + + b.Property("MasterStationIp") + .HasColumnType("varchar(250) CHARACTER SET utf8mb4") + .HasMaxLength(250); + + b.Property("MasterStationLevel") + .HasColumnType("int"); + + b.Property("MasterStationPort") + .HasColumnType("int"); + + b.Property("MasterStationType") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("Remark") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("SeqNo") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("gi_master_station"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.GeneralInformation.PowerSupplyLine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("LineName") + .IsRequired() + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("Remark") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.ToTable("gi_power_supply_line"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.GeneralInformation.SubMasterStationRelation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("MasterStationId") + .HasColumnType("char(36)"); + + b.Property("Remark") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("TransformerSubstationId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("MasterStationId"); + + b.HasIndex("TransformerSubstationId"); + + b.ToTable("gi_submasterstation_relation"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.GeneralInformation.TransformerSubstation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CommMgrIP") + .HasColumnType("varchar(20) CHARACTER SET utf8mb4") + .HasMaxLength(20); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("DataMonitoringAddress") + .HasColumnType("varchar(250) CHARACTER SET utf8mb4") + .HasMaxLength(250); + + b.Property("ExternalCommAddress") + .HasColumnType("varchar(250) CHARACTER SET utf8mb4") + .HasMaxLength(250); + + b.Property("Iec104ServerUrl") + .HasColumnType("varchar(250) CHARACTER SET utf8mb4") + .HasMaxLength(250); + + b.Property("InspectionServiceBaseUrl") + .HasColumnType("varchar(250) CHARACTER SET utf8mb4") + .HasMaxLength(250); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("Latitude") + .HasColumnType("double"); + + b.Property("Longitude") + .HasColumnType("double"); + + b.Property("MasterStationAddress") + .HasColumnType("varchar(250) CHARACTER SET utf8mb4") + .HasMaxLength(250); + + b.Property("MasterStationType") + .HasColumnType("int"); + + b.Property("PowerSupplyLineId") + .HasColumnType("char(36)"); + + b.Property("Remark") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("RobotServerAddress") + .HasColumnType("varchar(250) CHARACTER SET utf8mb4") + .HasMaxLength(250); + + b.Property("RobotServiceBaseUrl") + .HasColumnType("varchar(250) CHARACTER SET utf8mb4") + .HasMaxLength(250); + + b.Property("SeqNo") + .HasColumnType("int"); + + b.Property("SubstationName") + .IsRequired() + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.HasKey("Id"); + + b.HasIndex("PowerSupplyLineId"); + + b.ToTable("gi_transformer_substation"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.MobileSurveillance.RobotDeviceInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AppearanceType") + .HasColumnType("varchar(10) CHARACTER SET utf8mb4") + .HasMaxLength(10); + + b.Property("BayId") + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.Property("BayName") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("DeviceId") + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.Property("DeviceLevel") + .HasColumnType("int"); + + b.Property("DeviceName") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("DeviceType") + .HasColumnType("varchar(10) CHARACTER SET utf8mb4") + .HasMaxLength(10); + + b.Property("FeverType") + .HasColumnType("varchar(10) CHARACTER SET utf8mb4") + .HasMaxLength(10); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("MainDeviceId") + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.Property("MainDeviceName") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("MeterType") + .HasColumnType("varchar(10) CHARACTER SET utf8mb4") + .HasMaxLength(10); + + b.Property("Phase") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("PresetPointId") + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.Property("PresetPointName") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("RecognitionTypeList") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("RobotInfoId") + .HasColumnType("char(36)"); + + b.Property("RobotTaskId") + .HasColumnType("char(36)"); + + b.Property("SaveTypeList") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("SeqNo") + .HasColumnType("int"); + + b.Property("VoltageLevel") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.HasKey("Id"); + + b.HasIndex("RobotInfoId"); + + b.HasIndex("RobotTaskId"); + + b.ToTable("ms_robot_device_info"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.MobileSurveillance.RobotInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Code") + .IsRequired() + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("GeneralCameraId") + .HasColumnType("char(36)"); + + b.Property("IP") + .HasColumnType("varchar(20) CHARACTER SET utf8mb4") + .HasMaxLength(20); + + b.Property("InfraredCameraId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("ManufacturerInfoId") + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("Port") + .HasColumnType("int"); + + b.Property("Remark") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("RobotType") + .HasColumnType("int"); + + b.Property("SeqNo") + .HasColumnType("int"); + + b.Property("TransformerSubstationId") + .HasColumnType("char(36)"); + + b.Property("Url") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.HasIndex("GeneralCameraId"); + + b.HasIndex("InfraredCameraId"); + + b.HasIndex("ManufacturerInfoId"); + + b.HasIndex("TransformerSubstationId"); + + b.ToTable("ms_robot_info"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.MobileSurveillance.RobotTask", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Code") + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("CycleExecuteTime") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("CycleWeek") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("DeviceLevel") + .HasColumnType("int"); + + b.Property("DeviceList") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("FixedStartTime") + .HasColumnType("datetime(6)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsIssue") + .HasColumnType("tinyint(1)"); + + b.Property("IsTemp") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("MasterStationId") + .HasColumnType("char(36)"); + + b.Property("Name") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("RobotAction") + .HasColumnType("int"); + + b.Property("RobotInfoId") + .HasColumnType("char(36)"); + + b.Property("SeqNo") + .HasColumnType("int"); + + b.Property("TaskId") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("TempId") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("MasterStationId"); + + b.HasIndex("RobotInfoId"); + + b.ToTable("ms_robot_task"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.MobileSurveillance.RobotTaskItemLink", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("RobotDeviceInfoId") + .HasColumnType("char(36)"); + + b.Property("RobotTaskId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("RobotDeviceInfoId"); + + b.HasIndex("RobotTaskId"); + + b.ToTable("ms_robot_task_item_link"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.MySQL.DataMonitoring.DMAlarmCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Color") + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("Ico") + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.Property("Remark") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.ToTable("dm_alarm_category"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.MySQL.DataMonitoring.LinkageCondition", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CameraAuthenticationId") + .HasColumnType("char(36)"); + + b.Property("CompareType") + .HasColumnType("int"); + + b.Property("ComparisonValue") + .HasColumnType("float"); + + b.Property("ConditionType") + .HasColumnType("int"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("DeterminationTime") + .HasColumnType("datetime(6)"); + + b.Property("EquipmentInfoId") + .HasColumnType("char(36)"); + + b.Property("EquipmentTypeId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("LinkageStrategyId") + .HasColumnType("char(36)"); + + b.Property("LogicalOperator") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("SeqNo") + .HasColumnType("int"); + + b.Property("TelemeteringConfigurationId") + .HasColumnType("char(36)"); + + b.Property("TelesignalisationConfigurationId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("CameraAuthenticationId"); + + b.HasIndex("EquipmentInfoId"); + + b.HasIndex("EquipmentTypeId"); + + b.HasIndex("LinkageStrategyId"); + + b.HasIndex("TelemeteringConfigurationId"); + + b.HasIndex("TelesignalisationConfigurationId"); + + b.ToTable("dm_linkage_condition"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.MySQL.DataMonitoring.LinkageExecuteActivity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ActivityType") + .HasColumnType("int"); + + b.Property("CameraAuthenticationId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("EquipmentInfoId") + .HasColumnType("char(36)"); + + b.Property("EquipmentTypeId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsCapturePicture") + .HasColumnType("tinyint(1)"); + + b.Property("IsRecordVideo") + .HasColumnType("tinyint(1)"); + + b.Property("KeepTime") + .HasColumnType("int"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("LinkageStrategyId") + .HasColumnType("char(36)"); + + b.Property("PresetPointId") + .HasColumnType("char(36)"); + + b.Property("RecordDuration") + .HasColumnType("int"); + + b.Property("SeqNo") + .HasColumnType("int"); + + b.Property("TelecommandConfigurationId") + .HasColumnType("char(36)"); + + b.Property("TelecommandValue") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CameraAuthenticationId"); + + b.HasIndex("EquipmentInfoId"); + + b.HasIndex("EquipmentTypeId"); + + b.HasIndex("LinkageStrategyId"); + + b.HasIndex("PresetPointId"); + + b.HasIndex("TelecommandConfigurationId"); + + b.ToTable("dm_linkage_execute_activity"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.MySQL.DataMonitoring.LinkageStrategy", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConditionIds") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("DMAlarmCategoryId") + .HasColumnType("char(36)"); + + b.Property("ForceLinkageSeconds") + .HasColumnType("int"); + + b.Property("ForceLinkageTimes") + .HasColumnType("int"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsPatternRecognize") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.Property("RepeatLinkageInterval") + .HasColumnType("int"); + + b.Property("Rule") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("SeqNo") + .HasColumnType("int"); + + b.Property("TimeOfWithRelationship") + .HasColumnType("int"); + + b.Property("TransformerSubstationId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("DMAlarmCategoryId"); + + b.HasIndex("TransformerSubstationId"); + + b.ToTable("dm_linkage_strategy"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.MySQL.DataMonitoring.TelemeteringAlarmStrategy", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("DMAlarmCategoryId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("MaxValue") + .HasColumnType("float"); + + b.Property("MinValue") + .HasColumnType("float"); + + b.Property("SeqNo") + .HasColumnType("int"); + + b.Property("TelemeteringConfigurationId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("DMAlarmCategoryId"); + + b.HasIndex("TelemeteringConfigurationId"); + + b.ToTable("dm_telemetering_alarm_strategy"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.System.SysConfiguration", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Code") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Content") + .IsRequired() + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.Property("SysConfigurationType") + .HasColumnType("int"); + + b.Property("TransformerSubstationId") + .HasColumnType("char(36)") + .HasMaxLength(36); + + b.HasKey("Id"); + + b.HasIndex("TransformerSubstationId"); + + b.ToTable("sys_configuration"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.System.SysFunction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Code") + .IsRequired() + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("Icon") + .HasColumnType("varchar(40) CHARACTER SET utf8mb4") + .HasMaxLength(40); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsOperatorPage") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("LoadUrl") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.Property("Remark") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("SeqNo") + .HasColumnType("int"); + + b.Property("SysFunctionId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("sys_function"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.System.SysRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("Remark") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("RoleName") + .IsRequired() + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.HasKey("Id"); + + b.ToTable("sys_role"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.System.SysRoleFunction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsEdit") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("SysFunctionId") + .HasColumnType("char(36)"); + + b.Property("SysRoleId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("SysFunctionId"); + + b.HasIndex("SysRoleId"); + + b.ToTable("sys_role_function"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.System.SysRoleUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("SysRoleId") + .HasColumnType("char(36)"); + + b.Property("SysUserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("SysRoleId"); + + b.HasIndex("SysUserId"); + + b.ToTable("sys_role_user"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.System.SysUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("EmailAddress") + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.Property("ErrorTimes") + .HasColumnType("int"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsOnline") + .HasColumnType("tinyint(1)"); + + b.Property("LastLoginErrorDate") + .HasColumnType("datetime(6)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("OrganizationalUnit") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Password") + .IsRequired() + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.Property("PhoneNumber") + .HasColumnType("varchar(29) CHARACTER SET utf8mb4") + .HasMaxLength(29); + + b.Property("RealName") + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.Property("UserName") + .IsRequired() + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.Property("UserPriority") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("sys_user"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.VideoSurveillance.CameraAuthentication", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Code") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("Illustration") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("Remark") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("SeqNo") + .HasColumnType("int"); + + b.Property("Source") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("StationLevel") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("vs_camera_authentication"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.VideoSurveillance.InspectionCard", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CardName") + .IsRequired() + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("CenterType") + .HasColumnType("int"); + + b.Property("Code") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsIssue") + .HasColumnType("tinyint(1)"); + + b.Property("IsTemporary") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("MasterStationId") + .HasColumnType("char(36)"); + + b.Property("OpenWiper") + .HasColumnType("tinyint(1)"); + + b.Property("Remark") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("ResidenceTime") + .HasColumnType("int"); + + b.Property("TransformerSubstationId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("MasterStationId"); + + b.HasIndex("TransformerSubstationId"); + + b.ToTable("vs_inspection_card"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.VideoSurveillance.InspectionItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("InspectionCardId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsImageRecognition") + .HasColumnType("tinyint(1)"); + + b.Property("IsRecordVideo") + .HasColumnType("tinyint(1)"); + + b.Property("ItemName") + .IsRequired() + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("PicturesInterval") + .HasColumnType("int"); + + b.Property("PicturesNumber") + .HasColumnType("int"); + + b.Property("PresetPointId") + .HasColumnType("char(36)"); + + b.Property("ProcessAction") + .HasColumnType("int"); + + b.Property("ProcessDuration") + .HasColumnType("int"); + + b.Property("Remark") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("SeqNo") + .HasColumnType("int"); + + b.Property("VideoDevId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("InspectionCardId"); + + b.HasIndex("PresetPointId"); + + b.HasIndex("VideoDevId"); + + b.ToTable("vs_inspection_Item"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.VideoSurveillance.InspectionPlanTask", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("ExecutionDate") + .HasColumnType("varchar(20) CHARACTER SET utf8mb4") + .HasMaxLength(20); + + b.Property("ExecutionTime") + .IsRequired() + .HasColumnType("varchar(20) CHARACTER SET utf8mb4") + .HasMaxLength(20); + + b.Property("ExecutionWeek") + .HasColumnType("int"); + + b.Property("InspectionCardId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("PlanTaskName") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("Remark") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("SeqNo") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("InspectionCardId"); + + b.ToTable("vs_inspection_plan_task"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.VideoSurveillance.LightingControl", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CloseTime") + .HasColumnType("datetime(6)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("LightingOpenRule") + .HasColumnType("int"); + + b.Property("LightingPreheatSeconds") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("OpenTime") + .HasColumnType("datetime(6)"); + + b.Property("PresetPointId") + .HasColumnType("char(36)"); + + b.Property("Remark") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("SeqNo") + .HasColumnType("int"); + + b.Property("TelecommandConfigurationId") + .HasColumnType("char(36)"); + + b.Property("TelemeteringConfigurationId") + .HasColumnType("char(36)"); + + b.Property("TelesignalisationConfigurationId") + .HasColumnType("char(36)"); + + b.Property("TransformerSubstationId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("PresetPointId"); + + b.HasIndex("TelecommandConfigurationId"); + + b.HasIndex("TelemeteringConfigurationId"); + + b.HasIndex("TelesignalisationConfigurationId"); + + b.HasIndex("TransformerSubstationId"); + + b.ToTable("vs_lighting_control"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.VideoSurveillance.MeasureTemperaturePoint", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CoordinateJsonStr") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("Distance") + .HasColumnType("float"); + + b.Property("Emissivity") + .HasColumnType("float"); + + b.Property("EquipmentInfoId") + .HasColumnType("char(36)"); + + b.Property("EquipmentTypeId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("MeasureTemperatureType") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.Property("Number") + .HasColumnType("int"); + + b.Property("PresetPointId") + .HasColumnType("char(36)"); + + b.Property("ReflectedTemperature") + .HasColumnType("float"); + + b.Property("TelemeteringConfigurationId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("EquipmentInfoId"); + + b.HasIndex("EquipmentTypeId"); + + b.HasIndex("PresetPointId"); + + b.HasIndex("TelemeteringConfigurationId"); + + b.ToTable("vs_measures_temperature_point"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.VideoSurveillance.PatternRecognitionConfigutration", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Arg") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("Box") + .HasColumnType("varchar(500) CHARACTER SET utf8mb4") + .HasMaxLength(500); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("Decimal") + .HasColumnType("int"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsNewAlgorithnm") + .HasColumnType("tinyint(1)"); + + b.Property("ItemName") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("Name") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("PresetPointId") + .HasColumnType("char(36)"); + + b.Property("Rect") + .HasColumnType("varchar(500) CHARACTER SET utf8mb4") + .HasMaxLength(500); + + b.Property("Remark") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("ResultsMapping") + .HasColumnType("varchar(500) CHARACTER SET utf8mb4") + .HasMaxLength(500); + + b.Property("SeqNo") + .HasColumnType("int"); + + b.Property("TelemeteringConfigurationId") + .HasColumnType("char(36)"); + + b.Property("TelesignalisationConfigurationId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("Unit") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("VideoDevId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("PresetPointId"); + + b.HasIndex("TelemeteringConfigurationId"); + + b.HasIndex("TelesignalisationConfigurationId"); + + b.HasIndex("VideoDevId"); + + b.ToTable("vs_pattern_recognition_configutration"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.VideoSurveillance.PresetPoint", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("EquipmentInfoId") + .HasColumnType("char(36)"); + + b.Property("EquipmentTypeId") + .HasColumnType("char(36)"); + + b.Property("EquipmentViewPointId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsImageRecognition") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("Number") + .HasColumnType("int"); + + b.Property("Remark") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("SeqNo") + .HasColumnType("int"); + + b.Property("VideoDevId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("EquipmentInfoId"); + + b.HasIndex("EquipmentTypeId"); + + b.HasIndex("EquipmentViewPointId"); + + b.HasIndex("VideoDevId"); + + b.ToTable("vs_preset_point"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.VideoSurveillance.VideoDev", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ChannelNo") + .HasColumnType("int"); + + b.Property("CodeStreamType") + .HasColumnType("int"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("CtrAuPos") + .HasColumnType("int"); + + b.Property("DevCode") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("DevName") + .IsRequired() + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("DevNo") + .HasColumnType("int"); + + b.Property("DevPassword") + .HasColumnType("varchar(30) CHARACTER SET utf8mb4") + .HasMaxLength(30); + + b.Property("DevType") + .HasColumnType("int"); + + b.Property("DevUserName") + .HasColumnType("varchar(30) CHARACTER SET utf8mb4") + .HasMaxLength(30); + + b.Property("ExternalCommIP") + .HasColumnType("varchar(20) CHARACTER SET utf8mb4") + .HasMaxLength(20); + + b.Property("IP") + .HasColumnType("varchar(20) CHARACTER SET utf8mb4") + .HasMaxLength(20); + + b.Property("InstallationArea") + .IsRequired() + .HasColumnType("varchar(40) CHARACTER SET utf8mb4") + .HasMaxLength(40); + + b.Property("InstallationDate") + .HasColumnType("datetime(6)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsPTZ") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("LinkVideoDevId") + .HasColumnType("char(36)"); + + b.Property("ManufacturerInfoId") + .HasColumnType("char(36)"); + + b.Property("MasterStationId") + .HasColumnType("char(36)"); + + b.Property("Port") + .HasColumnType("int"); + + b.Property("PostionDescription") + .IsRequired() + .HasColumnType("varchar(40) CHARACTER SET utf8mb4") + .HasMaxLength(40); + + b.Property("ProductionDate") + .HasColumnType("datetime(6)"); + + b.Property("Remark") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("SafetyPlanStateType") + .HasColumnType("int"); + + b.Property("SafetyPlanTime") + .HasColumnType("datetime(6)"); + + b.Property("SafetyStateType") + .HasColumnType("int"); + + b.Property("SeqNo") + .HasColumnType("int"); + + b.Property("TransformerSubstationId") + .HasColumnType("char(36)"); + + b.Property("VideoDevId") + .HasColumnType("char(36)"); + + b.Property("VoiceType") + .HasColumnType("int"); + + b.Property("X") + .HasColumnType("float"); + + b.Property("Y") + .HasColumnType("float"); + + b.Property("Z") + .HasColumnType("float"); + + b.HasKey("Id"); + + b.HasIndex("LinkVideoDevId"); + + b.HasIndex("ManufacturerInfoId"); + + b.HasIndex("MasterStationId"); + + b.HasIndex("TransformerSubstationId"); + + b.HasIndex("VideoDevId"); + + b.ToTable("vs_video_dev"); + }); + + modelBuilder.Entity("YunDa.SOMS.Entities.GeneralInformation.BoardCardHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("BoardCardInfoId") + .HasColumnType("char(36)"); + + b.Property("BoardId") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("ContentJson") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("ContentNewJson") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("DeleterUserId") + .HasColumnType("char(36)"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)"); + + b.Property("EventDescription") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("EventRecordType") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("IsSend") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("Name") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("ProtectionDeviceInfoId") + .HasColumnType("char(36)"); + + b.Property("RecodeDate") + .HasColumnType("datetime(6)"); + + b.Property("Remark") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("SeqNo") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("gi_board_card_history"); + }); + + modelBuilder.Entity("YunDa.SOMS.Entities.GeneralInformation.BoardCardInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("BoardId") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("BoardType") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("BoardTypeId") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("BootVersion") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("CcdChecksum") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("CidChecksum") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("DeleterUserId") + .HasColumnType("char(36)"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)"); + + b.Property("FpgaVersion") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("HardwareVersion") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("IOCrc") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("IOVersion") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Iec61850Version") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("InstallationDate") + .HasColumnType("datetime(6)"); + + b.Property("InterfaceChecksum") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("InterfaceDatabaseVersion") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("InterfaceVersion") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("MaintenanceRecord") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("ManufacturerInfoId") + .HasColumnType("char(36)"); + + b.Property("OsVersion") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("ProductionDate") + .HasColumnType("datetime(6)"); + + b.Property("ProgramVersion") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("ProgramVersionCrc") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("ProtectionChecksum") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("ProtectionDatabaseVersion") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("ProtectionDeviceInfoId") + .HasColumnType("char(36)"); + + b.Property("ProtectionVersion") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Remark") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("SeqNo") + .HasColumnType("int"); + + b.Property("SerialNumber") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("SystemVersion") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("VerificationDate") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("VerificationPerson") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("VerificationRecords") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("YjCrc") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("YjVersion") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.HasIndex("ManufacturerInfoId"); + + b.HasIndex("ProtectionDeviceInfoId"); + + b.ToTable("gi_board_card_info"); + }); + + modelBuilder.Entity("YunDa.SOMS.Entities.GeneralInformation.EquipmentDataCategoryBase", b => + { + b.Property("Id") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Remark") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("SeqNo") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("gi_equipment_data_category_base"); + }); + + modelBuilder.Entity("YunDa.SOMS.Entities.GeneralInformation.EquipmentIndicatorComment", b => + { + b.Property("Id") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("Description") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("Remark") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("SeqNo") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("gi_equipment_indicator_comment"); + }); + + modelBuilder.Entity("YunDa.SOMS.Entities.GeneralInformation.EquipmentIndicatorConfig", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CalculationFormula") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("DataPrecision") + .HasColumnType("decimal(65,30)"); + + b.Property("EquipmentTypeId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("Remark") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("SeqNo") + .HasColumnType("int"); + + b.Property("Value") + .HasColumnType("decimal(65,30)"); + + b.Property("Weight") + .HasColumnType("decimal(65,30)"); + + b.HasKey("Id"); + + b.HasIndex("EquipmentTypeId"); + + b.HasIndex("Name"); + + b.ToTable("gi_equipment_indicator_config"); + }); + + modelBuilder.Entity("YunDa.SOMS.Entities.GeneralInformation.IntervalEquipmentInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("EquipmentInfoId") + .HasColumnType("char(36)"); + + b.Property("ProtectionDeviceInfoId") + .HasColumnType("char(36)"); + + b.Property("SubstationIntervalId") + .HasColumnType("char(36)"); + + b.Property("TransformerSubstationId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("EquipmentInfoId"); + + b.HasIndex("ProtectionDeviceInfoId"); + + b.HasIndex("SubstationIntervalId"); + + b.HasIndex("TransformerSubstationId"); + + b.ToTable("gi_interval_equipmentInfo"); + }); + + modelBuilder.Entity("YunDa.SOMS.Entities.GeneralInformation.ProtectionDeviceGateway", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("GatewayIP1") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("GatewayIP2") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("GatewayPort1") + .HasColumnType("int"); + + b.Property("GatewayPort2") + .HasColumnType("int"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("Name") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("PhysicalAddress") + .HasColumnType("int"); + + b.Property("ProtectionDeviceInfoId") + .HasColumnType("char(36)"); + + b.Property("Protocol") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("TransformerSubstationId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProtectionDeviceInfoId"); + + b.HasIndex("TransformerSubstationId"); + + b.ToTable("gi_protection_device_gateway"); + }); + + modelBuilder.Entity("YunDa.SOMS.Entities.GeneralInformation.ProtectionDeviceHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ContentJson") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("ContentNewJson") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("DeleterUserId") + .HasColumnType("char(36)"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)"); + + b.Property("EventDescription") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("EventRecordType") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("IsSend") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("Name") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("ProtectionDeviceInfoId") + .HasColumnType("char(36)"); + + b.Property("RecodeDate") + .HasColumnType("datetime(6)"); + + b.Property("Remark") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("SeqNo") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ProtectionDeviceInfoId"); + + b.ToTable("gi_protection_device_history"); + }); + + modelBuilder.Entity("YunDa.SOMS.Entities.GeneralInformation.ProtectionDeviceInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("BaselineBoardVersion") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("BayName") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("CanSwitchDZZone") + .HasColumnType("tinyint(1)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("DeviceAddress") + .HasColumnType("int"); + + b.Property("DeviceState") + .HasColumnType("int"); + + b.Property("EndOfDKJL") + .HasColumnType("int"); + + b.Property("EquipmentInfoId") + .HasColumnType("char(36)"); + + b.Property("HardwareVersion") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("ISMS_DeviceId") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsIncludeDz") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("ProtectionDeviceGatewayId") + .HasColumnType("char(36)"); + + b.Property("ProtectionDeviceTypeId") + .HasColumnType("char(36)"); + + b.Property("SeqNo") + .HasColumnType("int"); + + b.Property("Specification") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("StartOfDKJL") + .HasColumnType("int"); + + b.Property("SupportDKJL") + .HasColumnType("tinyint(1)"); + + b.Property("SupportVersion") + .HasColumnType("int"); + + b.Property("SupportsDualCurrent") + .HasColumnType("int"); + + b.Property("TransformerSubstationId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("EquipmentInfoId"); + + b.HasIndex("ProtectionDeviceGatewayId"); + + b.HasIndex("ProtectionDeviceTypeId"); + + b.HasIndex("TransformerSubstationId"); + + b.ToTable("gi_protection_device_info"); + }); + + modelBuilder.Entity("YunDa.SOMS.Entities.GeneralInformation.ProtectionDeviceType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AnalogParseMode") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("CanSwitchDZZone") + .HasColumnType("tinyint(1)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("DZReadOnly") + .HasColumnType("tinyint(1)"); + + b.Property("DZZoneCount") + .HasColumnType("int"); + + b.Property("EndOfDKJL") + .HasColumnType("int"); + + b.Property("EventParseMode") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Generation") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsCRCC") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("ManufacturerInfoId") + .HasColumnType("char(36)"); + + b.Property("Model") + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.Property("Name") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("PUCtgyCode") + .HasColumnType("int"); + + b.Property("Specification") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("StartOfDKJL") + .HasColumnType("int"); + + b.Property("Support12YC") + .HasColumnType("tinyint(1)"); + + b.Property("SupportDKJL") + .HasColumnType("tinyint(1)"); + + b.Property("SupportDZ") + .HasColumnType("tinyint(1)"); + + b.Property("SupportEventReport") + .HasColumnType("tinyint(1)"); + + b.Property("SupportFaultReport") + .HasColumnType("tinyint(1)"); + + b.Property("SupportLoadRecording") + .HasColumnType("tinyint(1)"); + + b.Property("SupportRecordingFiles") + .HasColumnType("tinyint(1)"); + + b.Property("SupportSelfTestReport") + .HasColumnType("tinyint(1)"); + + b.Property("SupportVersion") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.HasIndex("ManufacturerInfoId"); + + b.ToTable("gi_protection_device_type"); + }); + + modelBuilder.Entity("YunDa.SOMS.Entities.GeneralInformation.ProtectionSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CpuIndex") + .HasColumnType("int"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("CtrlWordTypeId") + .HasColumnType("int"); + + b.Property("EnumTypeId") + .HasColumnType("int"); + + b.Property("EquipmentInfoId") + .HasColumnType("char(36)"); + + b.Property("ISMS_DeviceDZId") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("ISMS_DeviceId") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsHidden") + .HasColumnType("tinyint(1)"); + + b.Property("IsReadOnly") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("Max") + .HasColumnType("float"); + + b.Property("Min") + .HasColumnType("float"); + + b.Property("Name") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("ProtectionDeviceInfoId") + .HasColumnType("char(36)"); + + b.Property("ProtectionSettingTypeId") + .HasColumnType("char(36)"); + + b.Property("RelatedCtId") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("RelatedPtId") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("SettingCoeff") + .HasColumnType("double"); + + b.Property("SettingCoeff1") + .HasColumnType("double"); + + b.Property("SettingComment") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("SettingIndex") + .HasColumnType("int"); + + b.Property("SettingPrecision") + .HasColumnType("int"); + + b.Property("SettingPrecision1") + .HasColumnType("int"); + + b.Property("SettingRange") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("SettingUnit") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("SettingUnit1") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("UnitConversionCoeff") + .HasColumnType("double"); + + b.HasKey("Id"); + + b.HasIndex("EquipmentInfoId"); + + b.HasIndex("ProtectionDeviceInfoId"); + + b.HasIndex("ProtectionSettingTypeId"); + + b.ToTable("gi_protection_setting"); + }); + + modelBuilder.Entity("YunDa.SOMS.Entities.GeneralInformation.ProtectionSettingType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("Description") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("Name") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Remark") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.ToTable("gi_protection_setting_type"); + }); + + modelBuilder.Entity("YunDa.SOMS.Entities.GeneralInformation.SecondaryCircuit", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CircuitType") + .HasColumnType("int"); + + b.Property("Code") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("DeleterUserId") + .HasColumnType("char(36)"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)"); + + b.Property("Description") + .HasColumnType("varchar(500) CHARACTER SET utf8mb4") + .HasMaxLength(500); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("Name") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("PictureBase64") + .HasColumnType("nvarchar(max)"); + + b.Property("PicturePath") + .HasColumnType("varchar(500) CHARACTER SET utf8mb4") + .HasMaxLength(500); + + b.Property("Remark") + .HasColumnType("varchar(500) CHARACTER SET utf8mb4") + .HasMaxLength(500); + + b.Property("SeqNo") + .HasColumnType("int"); + + b.Property("TransformerSubstationId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TransformerSubstationId"); + + b.ToTable("gi_secondary_circuit"); + }); + + modelBuilder.Entity("YunDa.SOMS.Entities.GeneralInformation.SecondaryCircuitLogicExpression", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("DeleterUserId") + .HasColumnType("char(36)"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsCompleteExpression") + .HasColumnType("tinyint(1)"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("LogicalExpression") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Name") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("PicturePath") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Remark") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("SecondaryCircuitId") + .HasColumnType("char(36)"); + + b.Property("TelemeteringConfigurationId") + .HasColumnType("char(36)"); + + b.Property("TelesignalisationConfigurationId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("SecondaryCircuitId"); + + b.HasIndex("TelemeteringConfigurationId"); + + b.HasIndex("TelesignalisationConfigurationId"); + + b.ToTable("gi_secondary_circuit_logic_expression"); + }); + + modelBuilder.Entity("YunDa.SOMS.Entities.GeneralInformation.SecondaryCircuitProtectionDevice", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("ProtectionDeviceId") + .HasColumnType("char(36)"); + + b.Property("Remark") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("SecondaryCircuitId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProtectionDeviceId"); + + b.HasIndex("SecondaryCircuitId"); + + b.ToTable("gi_secondary_circuit_protection_device"); + }); + + modelBuilder.Entity("YunDa.SOMS.Entities.GeneralInformation.SubstationInterval", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") + .HasColumnType("char(36)"); + + b.Property("CurrentCapacity") + .HasColumnType("int"); + + b.Property("DeleterUserId") + .HasColumnType("char(36)"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)"); + + b.Property("IntervalType") + .HasColumnType("int"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("ProtectionType") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("TransformerSubstationId") + .HasColumnType("char(36)"); + + b.Property("VoltageLevel") + .IsRequired() + .HasColumnType("varchar(20) CHARACTER SET utf8mb4") + .HasMaxLength(20); + + b.HasKey("Id"); + + b.HasIndex("TransformerSubstationId"); + + b.ToTable("gi_substation_interval"); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.ClientConfiguration.ThreeDimension.CCThreeDimension", b => + { + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.EquipmentInfo", "EquipmentInfo") + .WithMany() + .HasForeignKey("EquipmentInfoId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.DataMonitoring.TelecommandConfiguration", "TelecommandConfiguration") + .WithMany() + .HasForeignKey("TelecommandConfigurationId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.DataMonitoring.TelemeteringConfiguration", "TelemeteringConfiguration") + .WithMany() + .HasForeignKey("TelemeteringConfigurationId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.DataMonitoring.TelesignalisationConfiguration", "TelesignalisationConfiguration") + .WithMany() + .HasForeignKey("TelesignalisationConfigurationId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.TransformerSubstation", "TransformerSubstation") + .WithMany() + .HasForeignKey("TransformerSubstationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("YunDa.ISAS.Entities.VideoSurveillance.VideoDev", "VideoInfo") + .WithMany() + .HasForeignKey("VideoDevId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.DataMonitoring.MultidimensionalCheck", b => + { + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.EquipmentInfo", "EquipmentInfo") + .WithMany() + .HasForeignKey("EquipmentInfoId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.VideoSurveillance.PatternRecognitionConfigutration", "PatternRecognitionConfigutration1") + .WithMany() + .HasForeignKey("PatternRecognitionConfigutrationId1") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.VideoSurveillance.PatternRecognitionConfigutration", "PatternRecognitionConfigutration2") + .WithMany() + .HasForeignKey("PatternRecognitionConfigutrationId2") + .HasConstraintName("FK_dm_multidimensional_check_vs_pattern_recognition_configutra~1") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.VideoSurveillance.PresetPoint", "PresetPoint1") + .WithMany() + .HasForeignKey("PresetPointId1") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.VideoSurveillance.PresetPoint", "PresetPoint2") + .WithMany() + .HasForeignKey("PresetPointId2") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.DataMonitoring.TelesignalisationConfiguration", "TelesignalisationConfiguration") + .WithMany() + .HasForeignKey("TelesignalisationConfigurationId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.TransformerSubstation", "TransformerSubstation") + .WithMany() + .HasForeignKey("TransformerSubstationId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.DataMonitoring.SelfCheckingConfiguration", b => + { + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.TransformerSubstation", "TransformerSubstation") + .WithMany() + .HasForeignKey("TransformerSubstationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.DataMonitoring.TeleCommandPlanSetting", b => + { + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.TransformerSubstation", "TransformerSubstation") + .WithMany() + .HasForeignKey("TransformerSubstationId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.DataMonitoring.TeleCommandPlanTime", b => + { + b.HasOne("YunDa.ISAS.Entities.DataMonitoring.TeleCommandPlanSetting", "TeleCommandPlanSetting") + .WithMany() + .HasForeignKey("TeleCommandPlanSettingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.TransformerSubstation", "TransformerSubstation") + .WithMany() + .HasForeignKey("TransformerSubstationId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.DataMonitoring.TeleCommandSettingItem", b => + { + b.HasOne("YunDa.ISAS.Entities.DataMonitoring.TeleCommandPlanSetting", "TeleCommandPlanSetting") + .WithMany("TeleCommandSettingItems") + .HasForeignKey("TeleCommandPlanSettingId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.DataMonitoring.TelecommandConfiguration", "TelecommandConfiguration") + .WithMany() + .HasForeignKey("TelecommandConfigurationId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.DataMonitoring.TelecommandConfiguration", b => + { + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.EquipmentInfo", "EquipmentInfo") + .WithMany() + .HasForeignKey("EquipmentInfoId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.EquipmentType", "EquipmentType") + .WithMany() + .HasForeignKey("EquipmentTypeId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.DataMonitoring.TelesignalisationConfiguration", "RelatedTelesignalisation") + .WithMany() + .HasForeignKey("RelatedTelesignalisationId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.TransformerSubstation", "TransformerSubstation") + .WithMany() + .HasForeignKey("TransformerSubstationId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.DataMonitoring.TelecommandTemplate", b => + { + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.EquipmentType", "EquipmentType") + .WithMany("TelecommandTemplates") + .HasForeignKey("EquipmentTypeId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.DataMonitoring.TelemeteringAlarmTemplate", b => + { + b.HasOne("YunDa.ISAS.Entities.MySQL.DataMonitoring.DMAlarmCategory", "DMAlarmCategory") + .WithMany() + .HasForeignKey("DMAlarmCategoryId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.DataMonitoring.TelemeteringTemplate", "TelemeteringTemplate") + .WithMany("TelemeteringAlarmTemplates") + .HasForeignKey("TelemeteringTemplateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.DataMonitoring.TelemeteringConfiguration", b => + { + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.EquipmentInfo", "EquipmentInfo") + .WithMany() + .HasForeignKey("EquipmentInfoId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.EquipmentType", "EquipmentType") + .WithMany() + .HasForeignKey("EquipmentTypeId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.DataMonitoring.SelfCheckingConfiguration", "SelfCheckingConfiguration") + .WithMany() + .HasForeignKey("SelfCheckingConfigurationId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.TransformerSubstation", "TransformerSubstation") + .WithMany() + .HasForeignKey("TransformerSubstationId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.DataMonitoring.TelemeteringTemplate", b => + { + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.EquipmentType", "EquipmentType") + .WithMany("TelemeteringTemplates") + .HasForeignKey("EquipmentTypeId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.DataMonitoring.TelesignalisationConfiguration", b => + { + b.HasOne("YunDa.ISAS.Entities.MySQL.DataMonitoring.DMAlarmCategory", "DMAlarmCategory") + .WithMany() + .HasForeignKey("DMAlarmCategoryId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.EquipmentInfo", "EquipmentInfo") + .WithMany() + .HasForeignKey("EquipmentInfoId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.EquipmentType", "EquipmentType") + .WithMany() + .HasForeignKey("EquipmentTypeId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.DataMonitoring.SelfCheckingConfiguration", "SelfCheckingConfiguration") + .WithMany() + .HasForeignKey("SelfCheckingConfigurationId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.TransformerSubstation", "TransformerSubstation") + .WithMany() + .HasForeignKey("TransformerSubstationId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.DataMonitoring.TelesignalisationTemplate", b => + { + b.HasOne("YunDa.ISAS.Entities.MySQL.DataMonitoring.DMAlarmCategory", "DMAlarmCategory") + .WithMany() + .HasForeignKey("DMAlarmCategoryId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.EquipmentType", "EquipmentType") + .WithMany("TelesignalisationTemplates") + .HasForeignKey("EquipmentTypeId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.Foundation.NameDateText", b => + { + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.TransformerSubstation", "TransformerSubstation") + .WithMany() + .HasForeignKey("TransformerSubstationId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.GeneralInformation.EquipmentDataCategory", b => + { + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.EquipmentType", "EquipmentType") + .WithMany() + .HasForeignKey("EquipmentTypeId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.SOMS.Entities.GeneralInformation.EquipmentDataCategoryBase", "EquipmentDataCategoryBase") + .WithMany() + .HasForeignKey("Name") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.TransformerSubstation", "TransformerSubstation") + .WithMany() + .HasForeignKey("TransformerSubstationId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.GeneralInformation.EquipmentDataCategoryExactly", b => + { + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.EquipmentDataCategory", "EquipmentDataCategory") + .WithMany() + .HasForeignKey("EquipmentDataCategoryId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.EquipmentInfo", "EquipmentInfo") + .WithMany() + .HasForeignKey("EquipmentInfoId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.EquipmentType", "EquipmentType") + .WithMany() + .HasForeignKey("EquipmentTypeId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.TransformerSubstation", "TransformerSubstation") + .WithMany() + .HasForeignKey("TransformerSubstationId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.GeneralInformation.EquipmentInfo", b => + { + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.EquipmentInfo", "BelongEquipmentInfo") + .WithMany() + .HasForeignKey("BelongEquipmentInfoId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.EquipmentType", "EquipmentType") + .WithMany("EquipmentInfos") + .HasForeignKey("EquipmentTypeId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.ManufacturerInfo", "ManufacturerInfo") + .WithMany() + .HasForeignKey("ManufacturerInfoId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.TransformerSubstation", "TransformerSubstation") + .WithMany() + .HasForeignKey("TransformerSubstationId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.GeneralInformation.EquipmentLinkTeledata", b => + { + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.EquipmentInfo", "DataEquipmentInfo") + .WithMany() + .HasForeignKey("DataEquipmentInfoId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.EquipmentDataCategoryExactly", "EquipmentDataCategoryExactly") + .WithMany() + .HasForeignKey("EquipmentDataCategoryExactlyId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.EquipmentInfo", "EquipmentInfo") + .WithMany() + .HasForeignKey("EquipmentInfoId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.DataMonitoring.TelemeteringConfiguration", "TelemeteringConfiguration") + .WithMany() + .HasForeignKey("TelemeteringConfigurationId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.DataMonitoring.TelesignalisationConfiguration", "TelesignalisationConfiguration") + .WithMany() + .HasForeignKey("TelesignalisationConfigurationId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.GeneralInformation.EquipmentTypeViewPoint", b => + { + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.EquipmentType", "EquipmentType") + .WithMany() + .HasForeignKey("EquipmentTypeId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.GeneralInformation.EquipmentViewPoint", b => + { + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.EquipmentInfo", "EquipmentInfo") + .WithMany() + .HasForeignKey("EquipmentInfoId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.EquipmentTypeViewPoint", "EquipmentTypeViewPoint") + .WithMany() + .HasForeignKey("EquipmentTypeViewPointId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.TransformerSubstation", "TransformerSubstation") + .WithMany() + .HasForeignKey("TransformerSubstationId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.GeneralInformation.SubMasterStationRelation", b => + { + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.TransformerSubstation", "MasterStation") + .WithMany() + .HasForeignKey("MasterStationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.TransformerSubstation", "TransformerSubstation") + .WithMany() + .HasForeignKey("TransformerSubstationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.GeneralInformation.TransformerSubstation", b => + { + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.PowerSupplyLine", "PowerSupplyLine") + .WithMany("TransformerSubstations") + .HasForeignKey("PowerSupplyLineId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.MobileSurveillance.RobotDeviceInfo", b => + { + b.HasOne("YunDa.ISAS.Entities.MobileSurveillance.RobotInfo", "RobotInfo") + .WithMany() + .HasForeignKey("RobotInfoId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("YunDa.ISAS.Entities.MobileSurveillance.RobotTask", null) + .WithMany("RobotDeviceInfos") + .HasForeignKey("RobotTaskId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.MobileSurveillance.RobotInfo", b => + { + b.HasOne("YunDa.ISAS.Entities.VideoSurveillance.VideoDev", "GeneralCamera") + .WithMany() + .HasForeignKey("GeneralCameraId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.VideoSurveillance.VideoDev", "InfraredCamera") + .WithMany() + .HasForeignKey("InfraredCameraId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.ManufacturerInfo", "ManufacturerInfo") + .WithMany() + .HasForeignKey("ManufacturerInfoId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.TransformerSubstation", "TransformerSubstation") + .WithMany() + .HasForeignKey("TransformerSubstationId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.MobileSurveillance.RobotTask", b => + { + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.MasterStation", "MasterStation") + .WithMany() + .HasForeignKey("MasterStationId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.MobileSurveillance.RobotInfo", "RobotInfo") + .WithMany() + .HasForeignKey("RobotInfoId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.MobileSurveillance.RobotTaskItemLink", b => + { + b.HasOne("YunDa.ISAS.Entities.MobileSurveillance.RobotDeviceInfo", "RobotDeviceInfo") + .WithMany() + .HasForeignKey("RobotDeviceInfoId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("YunDa.ISAS.Entities.MobileSurveillance.RobotTask", "RobotTask") + .WithMany() + .HasForeignKey("RobotTaskId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.MySQL.DataMonitoring.LinkageCondition", b => + { + b.HasOne("YunDa.ISAS.Entities.VideoSurveillance.CameraAuthentication", "CameraAuthentication") + .WithMany() + .HasForeignKey("CameraAuthenticationId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.EquipmentInfo", "EquipmentInfo") + .WithMany() + .HasForeignKey("EquipmentInfoId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.EquipmentType", "EquipmentType") + .WithMany() + .HasForeignKey("EquipmentTypeId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.MySQL.DataMonitoring.LinkageStrategy", "LinkageStrategy") + .WithMany("LinkageConditions") + .HasForeignKey("LinkageStrategyId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.DataMonitoring.TelemeteringConfiguration", "TelemeteringConfiguration") + .WithMany() + .HasForeignKey("TelemeteringConfigurationId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.DataMonitoring.TelesignalisationConfiguration", "TelesignalisationConfiguration") + .WithMany() + .HasForeignKey("TelesignalisationConfigurationId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.MySQL.DataMonitoring.LinkageExecuteActivity", b => + { + b.HasOne("YunDa.ISAS.Entities.VideoSurveillance.CameraAuthentication", "CameraAuthentication") + .WithMany() + .HasForeignKey("CameraAuthenticationId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.EquipmentInfo", "EquipmentInfo") + .WithMany() + .HasForeignKey("EquipmentInfoId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.EquipmentType", "EquipmentType") + .WithMany() + .HasForeignKey("EquipmentTypeId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.MySQL.DataMonitoring.LinkageStrategy", "LinkageStrategy") + .WithMany("LinkageExecuteActivities") + .HasForeignKey("LinkageStrategyId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.VideoSurveillance.PresetPoint", "PresetPoint") + .WithMany() + .HasForeignKey("PresetPointId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.DataMonitoring.TelecommandConfiguration", "TelecommandConfiguration") + .WithMany() + .HasForeignKey("TelecommandConfigurationId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.MySQL.DataMonitoring.LinkageStrategy", b => + { + b.HasOne("YunDa.ISAS.Entities.MySQL.DataMonitoring.DMAlarmCategory", "DMAlarmCategory") + .WithMany() + .HasForeignKey("DMAlarmCategoryId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.TransformerSubstation", "TransformerSubstation") + .WithMany() + .HasForeignKey("TransformerSubstationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.MySQL.DataMonitoring.TelemeteringAlarmStrategy", b => + { + b.HasOne("YunDa.ISAS.Entities.MySQL.DataMonitoring.DMAlarmCategory", "DMAlarmCategory") + .WithMany() + .HasForeignKey("DMAlarmCategoryId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.DataMonitoring.TelemeteringConfiguration", "TelemeteringConfiguration") + .WithMany("TelemeteringAlarmStrategys") + .HasForeignKey("TelemeteringConfigurationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.System.SysConfiguration", b => + { + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.TransformerSubstation", "TransformerSubstation") + .WithMany() + .HasForeignKey("TransformerSubstationId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.System.SysRoleFunction", b => + { + b.HasOne("YunDa.ISAS.Entities.System.SysFunction", "SysFunction") + .WithMany() + .HasForeignKey("SysFunctionId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.System.SysRole", "SysRole") + .WithMany() + .HasForeignKey("SysRoleId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.System.SysRoleUser", b => + { + b.HasOne("YunDa.ISAS.Entities.System.SysRole", "SysRole") + .WithMany() + .HasForeignKey("SysRoleId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.System.SysUser", "SysUser") + .WithMany() + .HasForeignKey("SysUserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.VideoSurveillance.InspectionCard", b => + { + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.MasterStation", "MasterStation") + .WithMany() + .HasForeignKey("MasterStationId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.TransformerSubstation", "TransformerSubstation") + .WithMany("InspectionCards") + .HasForeignKey("TransformerSubstationId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.VideoSurveillance.InspectionItem", b => + { + b.HasOne("YunDa.ISAS.Entities.VideoSurveillance.InspectionCard", "InspectionCard") + .WithMany("InspectionItems") + .HasForeignKey("InspectionCardId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.VideoSurveillance.PresetPoint", "PresetPoint") + .WithMany("InspectionItems") + .HasForeignKey("PresetPointId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.VideoSurveillance.VideoDev", "VideoDev") + .WithMany("InspectionItems") + .HasForeignKey("VideoDevId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.VideoSurveillance.InspectionPlanTask", b => + { + b.HasOne("YunDa.ISAS.Entities.VideoSurveillance.InspectionCard", "InspectionCard") + .WithMany("InspectionPlanTasks") + .HasForeignKey("InspectionCardId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.VideoSurveillance.LightingControl", b => + { + b.HasOne("YunDa.ISAS.Entities.VideoSurveillance.PresetPoint", "PresetPoint") + .WithMany() + .HasForeignKey("PresetPointId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.DataMonitoring.TelecommandConfiguration", "TelecommandConfiguration") + .WithMany() + .HasForeignKey("TelecommandConfigurationId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.DataMonitoring.TelemeteringConfiguration", "TelemeteringConfiguration") + .WithMany() + .HasForeignKey("TelemeteringConfigurationId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.DataMonitoring.TelesignalisationConfiguration", "TelesignalisationConfiguration") + .WithMany() + .HasForeignKey("TelesignalisationConfigurationId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.TransformerSubstation", "TransformerSubstation") + .WithMany() + .HasForeignKey("TransformerSubstationId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.VideoSurveillance.MeasureTemperaturePoint", b => + { + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.EquipmentInfo", "EquipmentInfo") + .WithMany() + .HasForeignKey("EquipmentInfoId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.EquipmentType", "EquipmentType") + .WithMany() + .HasForeignKey("EquipmentTypeId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.VideoSurveillance.PresetPoint", "PresetPoint") + .WithMany("MeasureTemperaturePoints") + .HasForeignKey("PresetPointId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.DataMonitoring.TelemeteringConfiguration", "TelemeteringConfiguration") + .WithMany() + .HasForeignKey("TelemeteringConfigurationId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.VideoSurveillance.PatternRecognitionConfigutration", b => + { + b.HasOne("YunDa.ISAS.Entities.VideoSurveillance.PresetPoint", "PresetPoint") + .WithMany() + .HasForeignKey("PresetPointId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.DataMonitoring.TelemeteringConfiguration", "Telemetering") + .WithMany() + .HasForeignKey("TelemeteringConfigurationId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.DataMonitoring.TelesignalisationConfiguration", "Telesignalisation") + .WithMany() + .HasForeignKey("TelesignalisationConfigurationId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.VideoSurveillance.VideoDev", "VideoDev") + .WithMany() + .HasForeignKey("VideoDevId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.VideoSurveillance.PresetPoint", b => + { + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.EquipmentInfo", "EquipmentInfo") + .WithMany() + .HasForeignKey("EquipmentInfoId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.EquipmentType", "EquipmentType") + .WithMany() + .HasForeignKey("EquipmentTypeId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.EquipmentViewPoint", "EquipmentViewPoint") + .WithMany() + .HasForeignKey("EquipmentViewPointId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.VideoSurveillance.VideoDev", "VideoDev") + .WithMany("PresetPoints") + .HasForeignKey("VideoDevId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("YunDa.ISAS.Entities.VideoSurveillance.VideoDev", b => + { + b.HasOne("YunDa.ISAS.Entities.VideoSurveillance.VideoDev", "LinkVideoDev") + .WithMany() + .HasForeignKey("LinkVideoDevId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.ManufacturerInfo", "ManufacturerInfo") + .WithMany() + .HasForeignKey("ManufacturerInfoId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.MasterStation", "MasterStation") + .WithMany() + .HasForeignKey("MasterStationId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.TransformerSubstation", "TransformerSubstation") + .WithMany("VideoDevs") + .HasForeignKey("TransformerSubstationId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.VideoSurveillance.VideoDev", "Parent") + .WithMany() + .HasForeignKey("VideoDevId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("YunDa.SOMS.Entities.GeneralInformation.BoardCardInfo", b => + { + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.ManufacturerInfo", "ManufacturerInfo") + .WithMany() + .HasForeignKey("ManufacturerInfoId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.SOMS.Entities.GeneralInformation.ProtectionDeviceInfo", "ProtectionDeviceInfo") + .WithMany() + .HasForeignKey("ProtectionDeviceInfoId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("YunDa.SOMS.Entities.GeneralInformation.EquipmentIndicatorConfig", b => + { + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.EquipmentType", "EquipmentType") + .WithMany() + .HasForeignKey("EquipmentTypeId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.SOMS.Entities.GeneralInformation.EquipmentIndicatorComment", "EquipmentIndicatorComment") + .WithMany() + .HasForeignKey("Name") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("YunDa.SOMS.Entities.GeneralInformation.IntervalEquipmentInfo", b => + { + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.EquipmentInfo", "EquipmentInfo") + .WithMany() + .HasForeignKey("EquipmentInfoId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("YunDa.SOMS.Entities.GeneralInformation.ProtectionDeviceInfo", "ProtectionDeviceInfo") + .WithMany() + .HasForeignKey("ProtectionDeviceInfoId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("YunDa.SOMS.Entities.GeneralInformation.SubstationInterval", "SubstationInterval") + .WithMany() + .HasForeignKey("SubstationIntervalId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.TransformerSubstation", "TransformerSubstation") + .WithMany() + .HasForeignKey("TransformerSubstationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("YunDa.SOMS.Entities.GeneralInformation.ProtectionDeviceGateway", b => + { + b.HasOne("YunDa.SOMS.Entities.GeneralInformation.ProtectionDeviceInfo", "ProtectionDeviceInfo") + .WithMany() + .HasForeignKey("ProtectionDeviceInfoId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.TransformerSubstation", "TransformerSubstation") + .WithMany() + .HasForeignKey("TransformerSubstationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("YunDa.SOMS.Entities.GeneralInformation.ProtectionDeviceHistory", b => + { + b.HasOne("YunDa.SOMS.Entities.GeneralInformation.ProtectionDeviceInfo", "ProtectionDeviceInfo") + .WithMany() + .HasForeignKey("ProtectionDeviceInfoId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("YunDa.SOMS.Entities.GeneralInformation.ProtectionDeviceInfo", b => + { + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.EquipmentInfo", "EquipmentInfo") + .WithMany() + .HasForeignKey("EquipmentInfoId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("YunDa.SOMS.Entities.GeneralInformation.ProtectionDeviceGateway", "ProtectionDeviceGateway") + .WithMany() + .HasForeignKey("ProtectionDeviceGatewayId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.SOMS.Entities.GeneralInformation.ProtectionDeviceType", "ProtectionDeviceType") + .WithMany() + .HasForeignKey("ProtectionDeviceTypeId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.TransformerSubstation", "TransformerSubstation") + .WithMany() + .HasForeignKey("TransformerSubstationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("YunDa.SOMS.Entities.GeneralInformation.ProtectionDeviceType", b => + { + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.ManufacturerInfo", "ManufacturerInfo") + .WithMany() + .HasForeignKey("ManufacturerInfoId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("YunDa.SOMS.Entities.GeneralInformation.ProtectionSetting", b => + { + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.EquipmentInfo", "EquipmentInfo") + .WithMany() + .HasForeignKey("EquipmentInfoId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("YunDa.SOMS.Entities.GeneralInformation.ProtectionDeviceInfo", "ProtectionDeviceInfo") + .WithMany() + .HasForeignKey("ProtectionDeviceInfoId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("YunDa.SOMS.Entities.GeneralInformation.ProtectionSettingType", "ProtectionSettingType") + .WithMany() + .HasForeignKey("ProtectionSettingTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("YunDa.SOMS.Entities.GeneralInformation.SecondaryCircuit", b => + { + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.TransformerSubstation", "TransformerSubstation") + .WithMany() + .HasForeignKey("TransformerSubstationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("YunDa.SOMS.Entities.GeneralInformation.SecondaryCircuitLogicExpression", b => + { + b.HasOne("YunDa.SOMS.Entities.GeneralInformation.SecondaryCircuit", "SecondaryCircuit") + .WithMany() + .HasForeignKey("SecondaryCircuitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("YunDa.ISAS.Entities.DataMonitoring.TelemeteringConfiguration", "TelemeteringConfiguration") + .WithMany() + .HasForeignKey("TelemeteringConfigurationId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.ISAS.Entities.DataMonitoring.TelesignalisationConfiguration", "TelesignalisationConfiguration") + .WithMany() + .HasForeignKey("TelesignalisationConfigurationId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("YunDa.SOMS.Entities.GeneralInformation.SecondaryCircuitProtectionDevice", b => + { + b.HasOne("YunDa.SOMS.Entities.GeneralInformation.ProtectionDeviceInfo", "ProtectionDevice") + .WithMany() + .HasForeignKey("ProtectionDeviceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("YunDa.SOMS.Entities.GeneralInformation.SecondaryCircuit", "SecondaryCircuit") + .WithMany() + .HasForeignKey("SecondaryCircuitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("YunDa.SOMS.Entities.GeneralInformation.SubstationInterval", b => + { + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.TransformerSubstation", "TransformerSubstation") + .WithMany() + .HasForeignKey("TransformerSubstationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/YunDa.Domain/YunDa.ISAS.EntityFrameworkCore/Migrations/20250417030739_update_table_v100.cs b/src/YunDa.Domain/YunDa.ISAS.EntityFrameworkCore/Migrations/20250417030739_update_table_v100.cs new file mode 100644 index 0000000..f3dc20d --- /dev/null +++ b/src/YunDa.Domain/YunDa.ISAS.EntityFrameworkCore/Migrations/20250417030739_update_table_v100.cs @@ -0,0 +1,73 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace YunDa.ISAS.Migrations +{ + public partial class update_table_v100 : Migration + { + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "gi_equipment_indicator_config"); + + migrationBuilder.DropTable( + name: "gi_equipment_indicator_comment"); + + } + protected override void Up(MigrationBuilder migrationBuilder) + { + + migrationBuilder.CreateTable( + name: "gi_equipment_indicator_comment", + columns: table => new + { + Id = table.Column(nullable: false), + SeqNo = table.Column(nullable: false), + Description = table.Column(nullable: true), + Remark = table.Column(nullable: true), + IsActive = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_gi_equipment_indicator_comment", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "gi_equipment_indicator_config", + columns: table => new + { + Id = table.Column(nullable: false, type: "char(36) CHARACTER SET utf8mb4", maxLength: 36), + CreatorUserId = table.Column(nullable: true, type: "char(36) CHARACTER SET utf8mb4", maxLength: 36), + CreationTime = table.Column(nullable: false), + LastModificationTime = table.Column(nullable: true), + LastModifierUserId = table.Column(type: "char(36) CHARACTER SET utf8mb4", maxLength: 36), + SeqNo = table.Column(nullable: false), + Name = table.Column(maxLength: 200, nullable: false), + CalculationFormula = table.Column(nullable: true), + Weight = table.Column(nullable: false), + DataPrecision = table.Column(nullable: false), + Value = table.Column(nullable: false), + EquipmentTypeId = table.Column(nullable: true, type: "char(36) CHARACTER SET utf8mb4", maxLength: 36), + IsActive = table.Column(nullable: false), + Remark = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_gi_equipment_indicator_config", x => x.Id); + table.ForeignKey( + name: "FK_gi_equipment_indicator_config_gi_equipment_type_EquipmentTyp~", + column: x => x.EquipmentTypeId, + principalTable: "gi_equipment_type", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_gi_equipment_indicator_config_gi_equipment_indicator_comment~", + column: x => x.Name, + principalTable: "gi_equipment_indicator_comment", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + } + } +} diff --git a/src/YunDa.Domain/YunDa.ISAS.EntityFrameworkCore/Migrations/ISASDbContextModelSnapshot.cs b/src/YunDa.Domain/YunDa.ISAS.EntityFrameworkCore/Migrations/ISASDbContextModelSnapshot.cs index 32bb2f5..0004177 100644 --- a/src/YunDa.Domain/YunDa.ISAS.EntityFrameworkCore/Migrations/ISASDbContextModelSnapshot.cs +++ b/src/YunDa.Domain/YunDa.ISAS.EntityFrameworkCore/Migrations/ISASDbContextModelSnapshot.cs @@ -19,11 +19,11 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.ClientConfiguration.ThreeDimension.CCThreeDimension", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); - b.Property("EquipmentInfoId") + b.Property("EquipmentInfoId") .HasColumnType("char(36)"); b.Property("IsActive") @@ -35,22 +35,23 @@ namespace YunDa.ISAS.Migrations b.Property("ModelName") .HasColumnType("longtext CHARACTER SET utf8mb4"); - b.Property("TelecommandConfigurationId") + b.Property("TelecommandConfigurationId") .HasColumnType("char(36)"); - b.Property("TelemeteringConfigurationId") + b.Property("TelemeteringConfigurationId") .HasColumnType("char(36)"); - b.Property("TelesignalisationConfigurationId") + b.Property("TelesignalisationConfigurationId") .HasColumnType("char(36)"); b.Property("ThreeDimensionDataCategory") .HasColumnType("int"); - b.Property("TransformerSubstationId") + b.Property("TransformerSubstationId") + .IsRequired() .HasColumnType("char(36)"); - b.Property("VideoDevId") + b.Property("VideoDevId") .HasColumnType("char(36)"); b.HasKey("Id"); @@ -72,17 +73,17 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.DataMonitoring.MultidimensionalCheck", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); - b.Property("EquipmentInfoId") + b.Property("EquipmentInfoId") .HasColumnType("char(36)"); b.Property("IsActive") @@ -91,7 +92,7 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("Name") @@ -99,16 +100,16 @@ namespace YunDa.ISAS.Migrations .HasColumnType("varchar(50) CHARACTER SET utf8mb4") .HasMaxLength(50); - b.Property("PatternRecognitionConfigutrationId1") + b.Property("PatternRecognitionConfigutrationId1") .HasColumnType("char(36)"); - b.Property("PatternRecognitionConfigutrationId2") + b.Property("PatternRecognitionConfigutrationId2") .HasColumnType("char(36)"); - b.Property("PresetPointId1") + b.Property("PresetPointId1") .HasColumnType("char(36)"); - b.Property("PresetPointId2") + b.Property("PresetPointId2") .HasColumnType("char(36)"); b.Property("Remark") @@ -118,10 +119,10 @@ namespace YunDa.ISAS.Migrations b.Property("SeqNo") .HasColumnType("int"); - b.Property("TelesignalisationConfigurationId") + b.Property("TelesignalisationConfigurationId") .HasColumnType("char(36)"); - b.Property("TransformerSubstationId") + b.Property("TransformerSubstationId") .HasColumnType("char(36)"); b.HasKey("Id"); @@ -145,7 +146,7 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.DataMonitoring.MultidimensionalCheckSchedule", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); @@ -175,14 +176,14 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.DataMonitoring.SelfCheckingConfiguration", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); b.Property("DataType") @@ -197,7 +198,7 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("LowerLimit") @@ -226,7 +227,8 @@ namespace YunDa.ISAS.Migrations b.Property("TimeOfJudgment") .HasColumnType("int"); - b.Property("TransformerSubstationId") + b.Property("TransformerSubstationId") + .IsRequired() .HasColumnType("char(36)"); b.Property("UpperLimit") @@ -241,14 +243,14 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.DataMonitoring.TeleCommandPlanSetting", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); b.Property("IsActive") @@ -257,7 +259,7 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("Name") @@ -271,7 +273,7 @@ namespace YunDa.ISAS.Migrations b.Property("SeqNo") .HasColumnType("int"); - b.Property("TransformerSubstationId") + b.Property("TransformerSubstationId") .HasColumnType("char(36)"); b.HasKey("Id"); @@ -283,7 +285,7 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.DataMonitoring.TeleCommandPlanTime", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); @@ -293,7 +295,7 @@ namespace YunDa.ISAS.Migrations b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); b.Property("Freq") @@ -305,7 +307,7 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("Remark") @@ -320,10 +322,11 @@ namespace YunDa.ISAS.Migrations b.Property("StartTime") .HasColumnType("datetime(6)"); - b.Property("TeleCommandPlanSettingId") + b.Property("TeleCommandPlanSettingId") + .IsRequired() .HasColumnType("char(36)"); - b.Property("TransformerSubstationId") + b.Property("TransformerSubstationId") .HasColumnType("char(36)"); b.HasKey("Id"); @@ -337,14 +340,14 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.DataMonitoring.TeleCommandSettingItem", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); b.Property("IsActive") @@ -353,7 +356,7 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("Name") @@ -365,13 +368,13 @@ namespace YunDa.ISAS.Migrations b.Property("SeqNo") .HasColumnType("int"); - b.Property("TeleCommandPlanSettingId") + b.Property("TeleCommandPlanSettingId") .HasColumnType("char(36)"); b.Property("TeleCommandValue") .HasColumnType("int"); - b.Property("TelecommandConfigurationId") + b.Property("TelecommandConfigurationId") .HasColumnType("char(36)"); b.HasKey("Id"); @@ -385,7 +388,7 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.DataMonitoring.TelecommandConfiguration", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); @@ -395,7 +398,7 @@ namespace YunDa.ISAS.Migrations b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); b.Property("DataSourceCategory") @@ -407,10 +410,10 @@ namespace YunDa.ISAS.Migrations b.Property("DispatcherAddress") .HasColumnType("int"); - b.Property("EquipmentInfoId") + b.Property("EquipmentInfoId") .HasColumnType("char(36)"); - b.Property("EquipmentTypeId") + b.Property("EquipmentTypeId") .HasColumnType("char(36)"); b.Property("InfoAddress") @@ -440,7 +443,7 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("Name") @@ -453,7 +456,7 @@ namespace YunDa.ISAS.Migrations .HasColumnType("varchar(20) CHARACTER SET utf8mb4") .HasMaxLength(20); - b.Property("RelatedTelesignalisationId") + b.Property("RelatedTelesignalisationId") .HasColumnType("char(36)"); b.Property("RemoteType") @@ -462,7 +465,7 @@ namespace YunDa.ISAS.Migrations b.Property("SeqNo") .HasColumnType("int"); - b.Property("TransformerSubstationId") + b.Property("TransformerSubstationId") .HasColumnType("char(36)"); b.Property("UnsurenessContent") @@ -489,17 +492,17 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.DataMonitoring.TelecommandTemplate", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); - b.Property("EquipmentTypeId") + b.Property("EquipmentTypeId") .HasColumnType("char(36)"); b.Property("IsActive") @@ -517,7 +520,7 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("Name") @@ -530,7 +533,7 @@ namespace YunDa.ISAS.Migrations .HasColumnType("varchar(20) CHARACTER SET utf8mb4") .HasMaxLength(20); - b.Property("RelatedTelesignalisationId") + b.Property("RelatedTelesignalisationId") .HasColumnType("char(36)"); b.Property("RemoteType") @@ -557,17 +560,17 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.DataMonitoring.TelemeteringAlarmTemplate", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); - b.Property("DMAlarmCategoryId") + b.Property("DMAlarmCategoryId") .HasColumnType("char(36)"); b.Property("IsActive") @@ -576,7 +579,7 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("MaxValue") @@ -588,7 +591,8 @@ namespace YunDa.ISAS.Migrations b.Property("SeqNo") .HasColumnType("int"); - b.Property("TelemeteringTemplateId") + b.Property("TelemeteringTemplateId") + .IsRequired() .HasColumnType("char(36)"); b.HasKey("Id"); @@ -602,7 +606,7 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.DataMonitoring.TelemeteringConfiguration", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); @@ -615,7 +619,7 @@ namespace YunDa.ISAS.Migrations b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); b.Property("DataSourceCategory") @@ -630,10 +634,10 @@ namespace YunDa.ISAS.Migrations b.Property("DispatcherAddress") .HasColumnType("int"); - b.Property("EquipmentInfoId") + b.Property("EquipmentInfoId") .HasColumnType("char(36)"); - b.Property("EquipmentTypeId") + b.Property("EquipmentTypeId") .HasColumnType("char(36)"); b.Property("InfoAddress") @@ -669,7 +673,7 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("LowerLimit") @@ -680,13 +684,13 @@ namespace YunDa.ISAS.Migrations .HasColumnType("varchar(50) CHARACTER SET utf8mb4") .HasMaxLength(50); - b.Property("SelfCheckingConfigurationId") + b.Property("SelfCheckingConfigurationId") .HasColumnType("char(36)"); b.Property("SeqNo") .HasColumnType("int"); - b.Property("TransformerSubstationId") + b.Property("TransformerSubstationId") .HasColumnType("char(36)"); b.Property("Unit") @@ -713,7 +717,7 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.DataMonitoring.TelemeteringTemplate", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); @@ -723,13 +727,13 @@ namespace YunDa.ISAS.Migrations b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); b.Property("DecimalDigits") .HasColumnType("int"); - b.Property("EquipmentTypeId") + b.Property("EquipmentTypeId") .HasColumnType("char(36)"); b.Property("IsActive") @@ -747,7 +751,7 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("Name") @@ -770,7 +774,7 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.DataMonitoring.TelesignalisationConfiguration", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); @@ -783,10 +787,10 @@ namespace YunDa.ISAS.Migrations b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); - b.Property("DMAlarmCategoryId") + b.Property("DMAlarmCategoryId") .HasColumnType("char(36)"); b.Property("DataSourceCategory") @@ -798,10 +802,10 @@ namespace YunDa.ISAS.Migrations b.Property("DispatcherAddress") .HasColumnType("int"); - b.Property("EquipmentInfoId") + b.Property("EquipmentInfoId") .HasColumnType("char(36)"); - b.Property("EquipmentTypeId") + b.Property("EquipmentTypeId") .HasColumnType("char(36)"); b.Property("InfoAddress") @@ -837,7 +841,7 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("Name") @@ -853,13 +857,13 @@ namespace YunDa.ISAS.Migrations b.Property("RemoteType") .HasColumnType("int"); - b.Property("SelfCheckingConfigurationId") + b.Property("SelfCheckingConfigurationId") .HasColumnType("char(36)"); b.Property("SeqNo") .HasColumnType("int"); - b.Property("TransformerSubstationId") + b.Property("TransformerSubstationId") .HasColumnType("char(36)"); b.Property("UnsurenessContent") @@ -891,7 +895,7 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.DataMonitoring.TelesignalisationTemplate", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); @@ -901,13 +905,13 @@ namespace YunDa.ISAS.Migrations b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); - b.Property("DMAlarmCategoryId") + b.Property("DMAlarmCategoryId") .HasColumnType("char(36)"); - b.Property("EquipmentTypeId") + b.Property("EquipmentTypeId") .HasColumnType("char(36)"); b.Property("IsActive") @@ -928,7 +932,7 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("Name") @@ -967,7 +971,7 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.Foundation.NameDateText", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); @@ -978,7 +982,7 @@ namespace YunDa.ISAS.Migrations b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); b.Property("IsActive") @@ -987,7 +991,7 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("Name") @@ -997,7 +1001,7 @@ namespace YunDa.ISAS.Migrations .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); - b.Property("TransformerSubstationId") + b.Property("TransformerSubstationId") .HasColumnType("char(36)"); b.HasKey("Id"); @@ -1009,14 +1013,14 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.GeneralInformation.EquipmentDataCategory", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); b.Property("DataSourceCategory") @@ -1025,7 +1029,7 @@ namespace YunDa.ISAS.Migrations b.Property("Description") .HasColumnType("longtext CHARACTER SET utf8mb4"); - b.Property("EquipmentTypeId") + b.Property("EquipmentTypeId") .HasColumnType("char(36)"); b.Property("Icon") @@ -1037,7 +1041,7 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("Name") @@ -1052,7 +1056,7 @@ namespace YunDa.ISAS.Migrations b.Property("SeqNo") .HasColumnType("int"); - b.Property("TransformerSubstationId") + b.Property("TransformerSubstationId") .HasColumnType("char(36)"); b.HasKey("Id"); @@ -1068,17 +1072,17 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.GeneralInformation.EquipmentDataCategoryExactly", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); - b.Property("EquipmentDataCategoryId") + b.Property("EquipmentDataCategoryId") .HasColumnType("char(36)"); - b.Property("EquipmentInfoId") + b.Property("EquipmentInfoId") .HasColumnType("char(36)"); - b.Property("EquipmentTypeId") + b.Property("EquipmentTypeId") .HasColumnType("char(36)"); b.Property("IsActive") @@ -1087,7 +1091,7 @@ namespace YunDa.ISAS.Migrations b.Property("Remark") .HasColumnType("longtext CHARACTER SET utf8mb4"); - b.Property("TransformerSubstationId") + b.Property("TransformerSubstationId") .HasColumnType("char(36)"); b.HasKey("Id"); @@ -1105,11 +1109,11 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.GeneralInformation.EquipmentInfo", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); - b.Property("BelongEquipmentInfoId") + b.Property("BelongEquipmentInfoId") .HasColumnType("char(36)"); b.Property("Code") @@ -1118,10 +1122,10 @@ namespace YunDa.ISAS.Migrations b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); - b.Property("EquipmentTypeId") + b.Property("EquipmentTypeId") .HasColumnType("char(36)"); b.Property("FactorySerialNumber") @@ -1143,13 +1147,13 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("MaintenanceRecord") .HasColumnType("longtext CHARACTER SET utf8mb4"); - b.Property("ManufacturerInfoId") + b.Property("ManufacturerInfoId") .HasColumnType("char(36)"); b.Property("Name") @@ -1184,7 +1188,7 @@ namespace YunDa.ISAS.Migrations b.Property("SeqNo") .HasColumnType("int"); - b.Property("TransformerSubstationId") + b.Property("TransformerSubstationId") .HasColumnType("char(36)"); b.Property("VerificationDate") @@ -1211,23 +1215,23 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.GeneralInformation.EquipmentLinkTeledata", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); - b.Property("DataEquipmentInfoId") + b.Property("DataEquipmentInfoId") .HasColumnType("char(36)"); - b.Property("EquipmentDataCategoryExactlyId") + b.Property("EquipmentDataCategoryExactlyId") .HasColumnType("char(36)"); - b.Property("EquipmentInfoId") + b.Property("EquipmentInfoId") .HasColumnType("char(36)"); b.Property("IsActive") @@ -1239,7 +1243,7 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("Remark") @@ -1249,10 +1253,10 @@ namespace YunDa.ISAS.Migrations b.Property("TeleDataProperty") .HasColumnType("int"); - b.Property("TelemeteringConfigurationId") + b.Property("TelemeteringConfigurationId") .HasColumnType("char(36)"); - b.Property("TelesignalisationConfigurationId") + b.Property("TelesignalisationConfigurationId") .HasColumnType("char(36)"); b.HasKey("Id"); @@ -1272,14 +1276,14 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.GeneralInformation.EquipmentLocation", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); b.Property("IsActive") @@ -1288,7 +1292,7 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("Name") @@ -1310,17 +1314,17 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.GeneralInformation.EquipmentType", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); - b.Property("EquipmentTypeId") + b.Property("EquipmentTypeId") .HasColumnType("char(36)"); b.Property("EquipmentTypeLevel") @@ -1332,7 +1336,7 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("Name") @@ -1350,17 +1354,17 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.GeneralInformation.EquipmentTypeViewPoint", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); - b.Property("EquipmentTypeId") + b.Property("EquipmentTypeId") .HasColumnType("char(36)"); b.Property("IsActive") @@ -1369,7 +1373,7 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("Name") @@ -1393,20 +1397,20 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.GeneralInformation.EquipmentViewPoint", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); - b.Property("EquipmentInfoId") + b.Property("EquipmentInfoId") .HasColumnType("char(36)"); - b.Property("EquipmentTypeViewPointId") + b.Property("EquipmentTypeViewPointId") .HasColumnType("char(36)"); b.Property("IsActive") @@ -1415,7 +1419,7 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("Name") @@ -1430,7 +1434,7 @@ namespace YunDa.ISAS.Migrations b.Property("SeqNo") .HasColumnType("int"); - b.Property("TransformerSubstationId") + b.Property("TransformerSubstationId") .HasColumnType("char(36)"); b.HasKey("Id"); @@ -1446,17 +1450,17 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.GeneralInformation.ManufacturerInfo", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); - b.Property("DeleterUserId") + b.Property("DeleterUserId") .HasColumnType("char(36)"); b.Property("DeletionTime") @@ -1475,7 +1479,7 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("ManufacturerAddress") @@ -1507,14 +1511,14 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.GeneralInformation.MasterStation", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); b.Property("IsActive") @@ -1523,7 +1527,7 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("MasterStationAddress") @@ -1562,14 +1566,14 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.GeneralInformation.PowerSupplyLine", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); b.Property("IsActive") @@ -1578,7 +1582,7 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("LineName") @@ -1597,18 +1601,20 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.GeneralInformation.SubMasterStationRelation", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); - b.Property("MasterStationId") + b.Property("MasterStationId") + .IsRequired() .HasColumnType("char(36)"); b.Property("Remark") .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); - b.Property("TransformerSubstationId") + b.Property("TransformerSubstationId") + .IsRequired() .HasColumnType("char(36)"); b.HasKey("Id"); @@ -1622,7 +1628,7 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.GeneralInformation.TransformerSubstation", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); @@ -1633,7 +1639,7 @@ namespace YunDa.ISAS.Migrations b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); b.Property("DataMonitoringAddress") @@ -1658,7 +1664,7 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("Latitude") @@ -1674,7 +1680,7 @@ namespace YunDa.ISAS.Migrations b.Property("MasterStationType") .HasColumnType("int"); - b.Property("PowerSupplyLineId") + b.Property("PowerSupplyLineId") .HasColumnType("char(36)"); b.Property("Remark") @@ -1706,7 +1712,7 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.MobileSurveillance.RobotDeviceInfo", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); @@ -1725,7 +1731,7 @@ namespace YunDa.ISAS.Migrations b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); b.Property("DeviceId") @@ -1753,7 +1759,7 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("MainDeviceId") @@ -1784,10 +1790,11 @@ namespace YunDa.ISAS.Migrations .HasColumnType("varchar(100) CHARACTER SET utf8mb4") .HasMaxLength(100); - b.Property("RobotInfoId") + b.Property("RobotInfoId") + .IsRequired() .HasColumnType("char(36)"); - b.Property("RobotTaskId") + b.Property("RobotTaskId") .HasColumnType("char(36)"); b.Property("SaveTypeList") @@ -1812,7 +1819,7 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.MobileSurveillance.RobotInfo", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); @@ -1824,17 +1831,17 @@ namespace YunDa.ISAS.Migrations b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); - b.Property("GeneralCameraId") + b.Property("GeneralCameraId") .HasColumnType("char(36)"); b.Property("IP") .HasColumnType("varchar(20) CHARACTER SET utf8mb4") .HasMaxLength(20); - b.Property("InfraredCameraId") + b.Property("InfraredCameraId") .HasColumnType("char(36)"); b.Property("IsActive") @@ -1843,10 +1850,10 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); - b.Property("ManufacturerInfoId") + b.Property("ManufacturerInfoId") .HasColumnType("char(36)"); b.Property("Name") @@ -1867,7 +1874,7 @@ namespace YunDa.ISAS.Migrations b.Property("SeqNo") .HasColumnType("int"); - b.Property("TransformerSubstationId") + b.Property("TransformerSubstationId") .HasColumnType("char(36)"); b.Property("Url") @@ -1888,7 +1895,7 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.MobileSurveillance.RobotTask", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); @@ -1899,7 +1906,7 @@ namespace YunDa.ISAS.Migrations b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); b.Property("CycleExecuteTime") @@ -1931,10 +1938,10 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); - b.Property("MasterStationId") + b.Property("MasterStationId") .HasColumnType("char(36)"); b.Property("Name") @@ -1947,7 +1954,8 @@ namespace YunDa.ISAS.Migrations b.Property("RobotAction") .HasColumnType("int"); - b.Property("RobotInfoId") + b.Property("RobotInfoId") + .IsRequired() .HasColumnType("char(36)"); b.Property("SeqNo") @@ -1973,14 +1981,16 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.MobileSurveillance.RobotTaskItemLink", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); - b.Property("RobotDeviceInfoId") + b.Property("RobotDeviceInfoId") + .IsRequired() .HasColumnType("char(36)"); - b.Property("RobotTaskId") + b.Property("RobotTaskId") + .IsRequired() .HasColumnType("char(36)"); b.HasKey("Id"); @@ -1994,7 +2004,7 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.MySQL.DataMonitoring.DMAlarmCategory", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); @@ -2005,7 +2015,7 @@ namespace YunDa.ISAS.Migrations b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); b.Property("Ico") @@ -2018,7 +2028,7 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("Level") @@ -2040,11 +2050,11 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.MySQL.DataMonitoring.LinkageCondition", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); - b.Property("CameraAuthenticationId") + b.Property("CameraAuthenticationId") .HasColumnType("char(36)"); b.Property("CompareType") @@ -2059,16 +2069,16 @@ namespace YunDa.ISAS.Migrations b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); b.Property("DeterminationTime") .HasColumnType("datetime(6)"); - b.Property("EquipmentInfoId") + b.Property("EquipmentInfoId") .HasColumnType("char(36)"); - b.Property("EquipmentTypeId") + b.Property("EquipmentTypeId") .HasColumnType("char(36)"); b.Property("IsActive") @@ -2077,10 +2087,10 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); - b.Property("LinkageStrategyId") + b.Property("LinkageStrategyId") .HasColumnType("char(36)"); b.Property("LogicalOperator") @@ -2089,10 +2099,10 @@ namespace YunDa.ISAS.Migrations b.Property("SeqNo") .HasColumnType("int"); - b.Property("TelemeteringConfigurationId") + b.Property("TelemeteringConfigurationId") .HasColumnType("char(36)"); - b.Property("TelesignalisationConfigurationId") + b.Property("TelesignalisationConfigurationId") .HasColumnType("char(36)"); b.HasKey("Id"); @@ -2114,26 +2124,26 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.MySQL.DataMonitoring.LinkageExecuteActivity", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("ActivityType") .HasColumnType("int"); - b.Property("CameraAuthenticationId") + b.Property("CameraAuthenticationId") .HasColumnType("char(36)"); b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); - b.Property("EquipmentInfoId") + b.Property("EquipmentInfoId") .HasColumnType("char(36)"); - b.Property("EquipmentTypeId") + b.Property("EquipmentTypeId") .HasColumnType("char(36)"); b.Property("IsActive") @@ -2151,13 +2161,13 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); - b.Property("LinkageStrategyId") + b.Property("LinkageStrategyId") .HasColumnType("char(36)"); - b.Property("PresetPointId") + b.Property("PresetPointId") .HasColumnType("char(36)"); b.Property("RecordDuration") @@ -2166,7 +2176,7 @@ namespace YunDa.ISAS.Migrations b.Property("SeqNo") .HasColumnType("int"); - b.Property("TelecommandConfigurationId") + b.Property("TelecommandConfigurationId") .HasColumnType("char(36)"); b.Property("TelecommandValue") @@ -2191,7 +2201,7 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.MySQL.DataMonitoring.LinkageStrategy", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); @@ -2201,10 +2211,10 @@ namespace YunDa.ISAS.Migrations b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); - b.Property("DMAlarmCategoryId") + b.Property("DMAlarmCategoryId") .HasColumnType("char(36)"); b.Property("ForceLinkageSeconds") @@ -2222,7 +2232,7 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("Name") @@ -2242,7 +2252,8 @@ namespace YunDa.ISAS.Migrations b.Property("TimeOfWithRelationship") .HasColumnType("int"); - b.Property("TransformerSubstationId") + b.Property("TransformerSubstationId") + .IsRequired() .HasColumnType("char(36)"); b.HasKey("Id"); @@ -2256,17 +2267,17 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.MySQL.DataMonitoring.TelemeteringAlarmStrategy", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); - b.Property("DMAlarmCategoryId") + b.Property("DMAlarmCategoryId") .HasColumnType("char(36)"); b.Property("IsActive") @@ -2275,7 +2286,7 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("MaxValue") @@ -2287,7 +2298,8 @@ namespace YunDa.ISAS.Migrations b.Property("SeqNo") .HasColumnType("int"); - b.Property("TelemeteringConfigurationId") + b.Property("TelemeteringConfigurationId") + .IsRequired() .HasColumnType("char(36)"); b.HasKey("Id"); @@ -2301,7 +2313,7 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.System.SysConfiguration", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); @@ -2320,7 +2332,7 @@ namespace YunDa.ISAS.Migrations b.Property("SysConfigurationType") .HasColumnType("int"); - b.Property("TransformerSubstationId") + b.Property("TransformerSubstationId") .HasColumnType("char(36)") .HasMaxLength(36); @@ -2333,7 +2345,7 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.System.SysFunction", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); @@ -2345,7 +2357,7 @@ namespace YunDa.ISAS.Migrations b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); b.Property("Icon") @@ -2361,7 +2373,7 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("LoadUrl") @@ -2380,7 +2392,7 @@ namespace YunDa.ISAS.Migrations b.Property("SeqNo") .HasColumnType("int"); - b.Property("SysFunctionId") + b.Property("SysFunctionId") .HasColumnType("char(36)"); b.Property("Type") @@ -2393,14 +2405,14 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.System.SysRole", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); b.Property("IsActive") @@ -2409,7 +2421,7 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("Remark") @@ -2428,14 +2440,14 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.System.SysRoleFunction", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); b.Property("IsActive") @@ -2447,13 +2459,13 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); - b.Property("SysFunctionId") + b.Property("SysFunctionId") .HasColumnType("char(36)"); - b.Property("SysRoleId") + b.Property("SysRoleId") .HasColumnType("char(36)"); b.HasKey("Id"); @@ -2467,14 +2479,14 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.System.SysRoleUser", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); b.Property("IsActive") @@ -2483,13 +2495,13 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); - b.Property("SysRoleId") + b.Property("SysRoleId") .HasColumnType("char(36)"); - b.Property("SysUserId") + b.Property("SysUserId") .HasColumnType("char(36)"); b.HasKey("Id"); @@ -2503,14 +2515,14 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.System.SysUser", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); b.Property("EmailAddress") @@ -2532,7 +2544,7 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("OrganizationalUnit") @@ -2566,7 +2578,7 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.VideoSurveillance.CameraAuthentication", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); @@ -2577,7 +2589,7 @@ namespace YunDa.ISAS.Migrations b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); b.Property("Illustration") @@ -2590,7 +2602,7 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("Level") @@ -2621,7 +2633,7 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.VideoSurveillance.InspectionCard", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); @@ -2640,7 +2652,7 @@ namespace YunDa.ISAS.Migrations b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); b.Property("IsActive") @@ -2655,10 +2667,10 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); - b.Property("MasterStationId") + b.Property("MasterStationId") .HasColumnType("char(36)"); b.Property("OpenWiper") @@ -2671,7 +2683,7 @@ namespace YunDa.ISAS.Migrations b.Property("ResidenceTime") .HasColumnType("int"); - b.Property("TransformerSubstationId") + b.Property("TransformerSubstationId") .HasColumnType("char(36)"); b.HasKey("Id"); @@ -2685,17 +2697,17 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.VideoSurveillance.InspectionItem", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); - b.Property("InspectionCardId") + b.Property("InspectionCardId") .HasColumnType("char(36)"); b.Property("IsActive") @@ -2715,7 +2727,7 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("PicturesInterval") @@ -2724,7 +2736,7 @@ namespace YunDa.ISAS.Migrations b.Property("PicturesNumber") .HasColumnType("int"); - b.Property("PresetPointId") + b.Property("PresetPointId") .HasColumnType("char(36)"); b.Property("ProcessAction") @@ -2740,7 +2752,7 @@ namespace YunDa.ISAS.Migrations b.Property("SeqNo") .HasColumnType("int"); - b.Property("VideoDevId") + b.Property("VideoDevId") .HasColumnType("char(36)"); b.HasKey("Id"); @@ -2756,14 +2768,14 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.VideoSurveillance.InspectionPlanTask", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); b.Property("ExecutionDate") @@ -2778,7 +2790,7 @@ namespace YunDa.ISAS.Migrations b.Property("ExecutionWeek") .HasColumnType("int"); - b.Property("InspectionCardId") + b.Property("InspectionCardId") .HasColumnType("char(36)"); b.Property("IsActive") @@ -2787,7 +2799,7 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("PlanTaskName") @@ -2810,7 +2822,7 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.VideoSurveillance.LightingControl", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); @@ -2820,7 +2832,7 @@ namespace YunDa.ISAS.Migrations b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); b.Property("IsActive") @@ -2829,7 +2841,7 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("LightingOpenRule") @@ -2846,7 +2858,7 @@ namespace YunDa.ISAS.Migrations b.Property("OpenTime") .HasColumnType("datetime(6)"); - b.Property("PresetPointId") + b.Property("PresetPointId") .HasColumnType("char(36)"); b.Property("Remark") @@ -2856,16 +2868,16 @@ namespace YunDa.ISAS.Migrations b.Property("SeqNo") .HasColumnType("int"); - b.Property("TelecommandConfigurationId") + b.Property("TelecommandConfigurationId") .HasColumnType("char(36)"); - b.Property("TelemeteringConfigurationId") + b.Property("TelemeteringConfigurationId") .HasColumnType("char(36)"); - b.Property("TelesignalisationConfigurationId") + b.Property("TelesignalisationConfigurationId") .HasColumnType("char(36)"); - b.Property("TransformerSubstationId") + b.Property("TransformerSubstationId") .HasColumnType("char(36)"); b.HasKey("Id"); @@ -2885,7 +2897,7 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.VideoSurveillance.MeasureTemperaturePoint", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); @@ -2895,7 +2907,7 @@ namespace YunDa.ISAS.Migrations b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); b.Property("Distance") @@ -2904,10 +2916,10 @@ namespace YunDa.ISAS.Migrations b.Property("Emissivity") .HasColumnType("float"); - b.Property("EquipmentInfoId") + b.Property("EquipmentInfoId") .HasColumnType("char(36)"); - b.Property("EquipmentTypeId") + b.Property("EquipmentTypeId") .HasColumnType("char(36)"); b.Property("IsActive") @@ -2916,7 +2928,7 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("MeasureTemperatureType") @@ -2930,13 +2942,13 @@ namespace YunDa.ISAS.Migrations b.Property("Number") .HasColumnType("int"); - b.Property("PresetPointId") + b.Property("PresetPointId") .HasColumnType("char(36)"); b.Property("ReflectedTemperature") .HasColumnType("float"); - b.Property("TelemeteringConfigurationId") + b.Property("TelemeteringConfigurationId") .HasColumnType("char(36)"); b.HasKey("Id"); @@ -2954,7 +2966,7 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.VideoSurveillance.PatternRecognitionConfigutration", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); @@ -2969,7 +2981,7 @@ namespace YunDa.ISAS.Migrations b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); b.Property("Decimal") @@ -2988,14 +3000,14 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("Name") .HasColumnType("varchar(100) CHARACTER SET utf8mb4") .HasMaxLength(100); - b.Property("PresetPointId") + b.Property("PresetPointId") .HasColumnType("char(36)"); b.Property("Rect") @@ -3013,10 +3025,10 @@ namespace YunDa.ISAS.Migrations b.Property("SeqNo") .HasColumnType("int"); - b.Property("TelemeteringConfigurationId") + b.Property("TelemeteringConfigurationId") .HasColumnType("char(36)"); - b.Property("TelesignalisationConfigurationId") + b.Property("TelesignalisationConfigurationId") .HasColumnType("char(36)"); b.Property("Type") @@ -3026,7 +3038,7 @@ namespace YunDa.ISAS.Migrations b.Property("Unit") .HasColumnType("longtext CHARACTER SET utf8mb4"); - b.Property("VideoDevId") + b.Property("VideoDevId") .HasColumnType("char(36)"); b.HasKey("Id"); @@ -3044,23 +3056,23 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.VideoSurveillance.PresetPoint", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); - b.Property("EquipmentInfoId") + b.Property("EquipmentInfoId") .HasColumnType("char(36)"); - b.Property("EquipmentTypeId") + b.Property("EquipmentTypeId") .HasColumnType("char(36)"); - b.Property("EquipmentViewPointId") + b.Property("EquipmentViewPointId") .HasColumnType("char(36)"); b.Property("IsActive") @@ -3072,7 +3084,7 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("Name") @@ -3090,7 +3102,7 @@ namespace YunDa.ISAS.Migrations b.Property("SeqNo") .HasColumnType("int"); - b.Property("VideoDevId") + b.Property("VideoDevId") .HasColumnType("char(36)"); b.HasKey("Id"); @@ -3108,7 +3120,7 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.ISAS.Entities.VideoSurveillance.VideoDev", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); @@ -3121,7 +3133,7 @@ namespace YunDa.ISAS.Migrations b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); b.Property("CtrAuPos") @@ -3175,16 +3187,16 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); - b.Property("LinkVideoDevId") + b.Property("LinkVideoDevId") .HasColumnType("char(36)"); - b.Property("ManufacturerInfoId") + b.Property("ManufacturerInfoId") .HasColumnType("char(36)"); - b.Property("MasterStationId") + b.Property("MasterStationId") .HasColumnType("char(36)"); b.Property("Port") @@ -3214,10 +3226,10 @@ namespace YunDa.ISAS.Migrations b.Property("SeqNo") .HasColumnType("int"); - b.Property("TransformerSubstationId") + b.Property("TransformerSubstationId") .HasColumnType("char(36)"); - b.Property("VideoDevId") + b.Property("VideoDevId") .HasColumnType("char(36)"); b.Property("VoiceType") @@ -3249,11 +3261,11 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.SOMS.Entities.GeneralInformation.BoardCardHistory", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); - b.Property("BoardCardInfoId") + b.Property("BoardCardInfoId") .HasColumnType("char(36)"); b.Property("BoardId") @@ -3268,10 +3280,10 @@ namespace YunDa.ISAS.Migrations b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); - b.Property("DeleterUserId") + b.Property("DeleterUserId") .HasColumnType("char(36)"); b.Property("DeletionTime") @@ -3292,13 +3304,13 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("Name") .HasColumnType("longtext CHARACTER SET utf8mb4"); - b.Property("ProtectionDeviceInfoId") + b.Property("ProtectionDeviceInfoId") .HasColumnType("char(36)"); b.Property("RecodeDate") @@ -3317,7 +3329,7 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.SOMS.Entities.GeneralInformation.BoardCardInfo", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); @@ -3342,10 +3354,10 @@ namespace YunDa.ISAS.Migrations b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); - b.Property("DeleterUserId") + b.Property("DeleterUserId") .HasColumnType("char(36)"); b.Property("DeletionTime") @@ -3387,13 +3399,13 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("MaintenanceRecord") .HasColumnType("longtext CHARACTER SET utf8mb4"); - b.Property("ManufacturerInfoId") + b.Property("ManufacturerInfoId") .HasColumnType("char(36)"); b.Property("OsVersion") @@ -3414,7 +3426,7 @@ namespace YunDa.ISAS.Migrations b.Property("ProtectionDatabaseVersion") .HasColumnType("longtext CHARACTER SET utf8mb4"); - b.Property("ProtectionDeviceInfoId") + b.Property("ProtectionDeviceInfoId") .HasColumnType("char(36)"); b.Property("ProtectionVersion") @@ -3479,22 +3491,104 @@ namespace YunDa.ISAS.Migrations b.ToTable("gi_equipment_data_category_base"); }); - modelBuilder.Entity("YunDa.SOMS.Entities.GeneralInformation.IntervalEquipmentInfo", b => + modelBuilder.Entity("YunDa.SOMS.Entities.GeneralInformation.EquipmentIndicatorComment", b => { - b.Property("Id") + b.Property("Id") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + + b.Property("Description") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("Remark") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("SeqNo") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("gi_equipment_indicator_comment"); + }); + + modelBuilder.Entity("YunDa.SOMS.Entities.GeneralInformation.EquipmentIndicatorConfig", b => + { + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); - b.Property("EquipmentInfoId") + b.Property("CalculationFormula") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorUserId") .HasColumnType("char(36)"); - b.Property("ProtectionDeviceInfoId") + b.Property("DataPrecision") + .HasColumnType("decimal(65,30)"); + + b.Property("EquipmentTypeId") .HasColumnType("char(36)"); - b.Property("SubstationIntervalId") + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierUserId") .HasColumnType("char(36)"); - b.Property("TransformerSubstationId") + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("Remark") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("SeqNo") + .HasColumnType("int"); + + b.Property("Value") + .HasColumnType("decimal(65,30)"); + + b.Property("Weight") + .HasColumnType("decimal(65,30)"); + + b.HasKey("Id"); + + b.HasIndex("EquipmentTypeId"); + + b.HasIndex("Name"); + + b.ToTable("gi_equipment_indicator_config"); + }); + + modelBuilder.Entity("YunDa.SOMS.Entities.GeneralInformation.IntervalEquipmentInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("EquipmentInfoId") + .IsRequired() + .HasColumnType("char(36)"); + + b.Property("ProtectionDeviceInfoId") + .IsRequired() + .HasColumnType("char(36)"); + + b.Property("SubstationIntervalId") + .IsRequired() + .HasColumnType("char(36)"); + + b.Property("TransformerSubstationId") + .IsRequired() .HasColumnType("char(36)"); b.HasKey("Id"); @@ -3512,14 +3606,14 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.SOMS.Entities.GeneralInformation.ProtectionDeviceGateway", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); b.Property("GatewayIP1") @@ -3540,7 +3634,7 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("Name") @@ -3549,13 +3643,15 @@ namespace YunDa.ISAS.Migrations b.Property("PhysicalAddress") .HasColumnType("int"); - b.Property("ProtectionDeviceInfoId") + b.Property("ProtectionDeviceInfoId") + .IsRequired() .HasColumnType("char(36)"); b.Property("Protocol") .HasColumnType("longtext CHARACTER SET utf8mb4"); - b.Property("TransformerSubstationId") + b.Property("TransformerSubstationId") + .IsRequired() .HasColumnType("char(36)"); b.HasKey("Id"); @@ -3569,7 +3665,7 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.SOMS.Entities.GeneralInformation.ProtectionDeviceHistory", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); @@ -3582,10 +3678,10 @@ namespace YunDa.ISAS.Migrations b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); - b.Property("DeleterUserId") + b.Property("DeleterUserId") .HasColumnType("char(36)"); b.Property("DeletionTime") @@ -3606,13 +3702,13 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("Name") .HasColumnType("longtext CHARACTER SET utf8mb4"); - b.Property("ProtectionDeviceInfoId") + b.Property("ProtectionDeviceInfoId") .HasColumnType("char(36)"); b.Property("RecodeDate") @@ -3633,7 +3729,7 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.SOMS.Entities.GeneralInformation.ProtectionDeviceInfo", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); @@ -3649,7 +3745,7 @@ namespace YunDa.ISAS.Migrations b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); b.Property("DeviceAddress") @@ -3661,7 +3757,8 @@ namespace YunDa.ISAS.Migrations b.Property("EndOfDKJL") .HasColumnType("int"); - b.Property("EquipmentInfoId") + b.Property("EquipmentInfoId") + .IsRequired() .HasColumnType("char(36)"); b.Property("HardwareVersion") @@ -3679,17 +3776,17 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("Name") .IsRequired() .HasColumnType("longtext CHARACTER SET utf8mb4"); - b.Property("ProtectionDeviceGatewayId") + b.Property("ProtectionDeviceGatewayId") .HasColumnType("char(36)"); - b.Property("ProtectionDeviceTypeId") + b.Property("ProtectionDeviceTypeId") .HasColumnType("char(36)"); b.Property("SeqNo") @@ -3710,7 +3807,8 @@ namespace YunDa.ISAS.Migrations b.Property("SupportsDualCurrent") .HasColumnType("int"); - b.Property("TransformerSubstationId") + b.Property("TransformerSubstationId") + .IsRequired() .HasColumnType("char(36)"); b.HasKey("Id"); @@ -3728,7 +3826,7 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.SOMS.Entities.GeneralInformation.ProtectionDeviceType", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); @@ -3741,7 +3839,7 @@ namespace YunDa.ISAS.Migrations b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); b.Property("DZReadOnly") @@ -3768,10 +3866,10 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); - b.Property("ManufacturerInfoId") + b.Property("ManufacturerInfoId") .HasColumnType("char(36)"); b.Property("Model") @@ -3827,7 +3925,7 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.SOMS.Entities.GeneralInformation.ProtectionSetting", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); @@ -3837,7 +3935,7 @@ namespace YunDa.ISAS.Migrations b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); b.Property("CtrlWordTypeId") @@ -3846,7 +3944,8 @@ namespace YunDa.ISAS.Migrations b.Property("EnumTypeId") .HasColumnType("int"); - b.Property("EquipmentInfoId") + b.Property("EquipmentInfoId") + .IsRequired() .HasColumnType("char(36)"); b.Property("ISMS_DeviceDZId") @@ -3867,7 +3966,7 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("Max") @@ -3879,10 +3978,12 @@ namespace YunDa.ISAS.Migrations b.Property("Name") .HasColumnType("longtext CHARACTER SET utf8mb4"); - b.Property("ProtectionDeviceInfoId") + b.Property("ProtectionDeviceInfoId") + .IsRequired() .HasColumnType("char(36)"); - b.Property("ProtectionSettingTypeId") + b.Property("ProtectionSettingTypeId") + .IsRequired() .HasColumnType("char(36)"); b.Property("RelatedCtId") @@ -3934,14 +4035,14 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.SOMS.Entities.GeneralInformation.ProtectionSettingType", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); b.Property("Description") @@ -3953,7 +4054,7 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("Name") @@ -3969,7 +4070,7 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.SOMS.Entities.GeneralInformation.SecondaryCircuit", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); @@ -3982,10 +4083,10 @@ namespace YunDa.ISAS.Migrations b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); - b.Property("DeleterUserId") + b.Property("DeleterUserId") .HasColumnType("char(36)"); b.Property("DeletionTime") @@ -4004,7 +4105,7 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("Name") @@ -4025,7 +4126,8 @@ namespace YunDa.ISAS.Migrations b.Property("SeqNo") .HasColumnType("int"); - b.Property("TransformerSubstationId") + b.Property("TransformerSubstationId") + .IsRequired() .HasColumnType("char(36)"); b.HasKey("Id"); @@ -4037,17 +4139,17 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.SOMS.Entities.GeneralInformation.SecondaryCircuitLogicExpression", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); - b.Property("DeleterUserId") + b.Property("DeleterUserId") .HasColumnType("char(36)"); b.Property("DeletionTime") @@ -4065,7 +4167,7 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("LogicalExpression") @@ -4081,13 +4183,14 @@ namespace YunDa.ISAS.Migrations b.Property("Remark") .HasColumnType("longtext CHARACTER SET utf8mb4"); - b.Property("SecondaryCircuitId") + b.Property("SecondaryCircuitId") + .IsRequired() .HasColumnType("char(36)"); - b.Property("TelemeteringConfigurationId") + b.Property("TelemeteringConfigurationId") .HasColumnType("char(36)"); - b.Property("TelesignalisationConfigurationId") + b.Property("TelesignalisationConfigurationId") .HasColumnType("char(36)"); b.HasKey("Id"); @@ -4103,20 +4206,22 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.SOMS.Entities.GeneralInformation.SecondaryCircuitProtectionDevice", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); - b.Property("ProtectionDeviceId") + b.Property("ProtectionDeviceId") + .IsRequired() .HasColumnType("char(36)"); b.Property("Remark") .HasColumnType("longtext CHARACTER SET utf8mb4"); - b.Property("SecondaryCircuitId") + b.Property("SecondaryCircuitId") + .IsRequired() .HasColumnType("char(36)"); b.HasKey("Id"); @@ -4130,20 +4235,20 @@ namespace YunDa.ISAS.Migrations modelBuilder.Entity("YunDa.SOMS.Entities.GeneralInformation.SubstationInterval", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("CreationTime") .HasColumnType("datetime(6)"); - b.Property("CreatorUserId") + b.Property("CreatorUserId") .HasColumnType("char(36)"); b.Property("CurrentCapacity") .HasColumnType("int"); - b.Property("DeleterUserId") + b.Property("DeleterUserId") .HasColumnType("char(36)"); b.Property("DeletionTime") @@ -4161,7 +4266,7 @@ namespace YunDa.ISAS.Migrations b.Property("LastModificationTime") .HasColumnType("datetime(6)"); - b.Property("LastModifierUserId") + b.Property("LastModifierUserId") .HasColumnType("char(36)"); b.Property("Name") @@ -4173,7 +4278,8 @@ namespace YunDa.ISAS.Migrations .HasColumnType("varchar(100) CHARACTER SET utf8mb4") .HasMaxLength(100); - b.Property("TransformerSubstationId") + b.Property("TransformerSubstationId") + .IsRequired() .HasColumnType("char(36)"); b.Property("VoltageLevel") @@ -4943,6 +5049,20 @@ namespace YunDa.ISAS.Migrations .OnDelete(DeleteBehavior.Cascade); }); + modelBuilder.Entity("YunDa.SOMS.Entities.GeneralInformation.EquipmentIndicatorConfig", b => + { + b.HasOne("YunDa.ISAS.Entities.GeneralInformation.EquipmentType", "EquipmentType") + .WithMany() + .HasForeignKey("EquipmentTypeId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("YunDa.SOMS.Entities.GeneralInformation.EquipmentIndicatorComment", "EquipmentIndicatorComment") + .WithMany() + .HasForeignKey("Name") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + modelBuilder.Entity("YunDa.SOMS.Entities.GeneralInformation.IntervalEquipmentInfo", b => { b.HasOne("YunDa.ISAS.Entities.GeneralInformation.EquipmentInfo", "EquipmentInfo") diff --git a/src/YunDa.Domain/YunDa.ISAS.EntityFrameworkCore/README.md b/src/YunDa.Domain/YunDa.ISAS.EntityFrameworkCore/README.md index 99911a0..401a8ac 100644 --- a/src/YunDa.Domain/YunDa.ISAS.EntityFrameworkCore/README.md +++ b/src/YunDa.Domain/YunDa.ISAS.EntityFrameworkCore/README.md @@ -13,4 +13,8 @@ Get-Migration dotnet ef migrations remove ### 幂等生成SQL -dotnet ef migrations script --idempotent > ../../YunDa.Quick/ISASUpdateProgram/updatescript.sql \ No newline at end of file +dotnet ef migrations script --idempotent > ../../YunDa.Quick/ISASUpdateProgram/updatescript.sql + +解决EF迁移数据报No mapping to a relational type can be found for property 'xxx.FieldName' with the CLR type 'string'.错误一例 + +删除ISASDbContextModelSnapshot.cs;手动处理表 \ No newline at end of file diff --git a/src/YunDa.Domain/YunDa.ISAS.Redis/ISASRedisModule.cs b/src/YunDa.Domain/YunDa.ISAS.Redis/ISASRedisModule.cs index afea000..c2f5a3c 100644 --- a/src/YunDa.Domain/YunDa.ISAS.Redis/ISASRedisModule.cs +++ b/src/YunDa.Domain/YunDa.ISAS.Redis/ISASRedisModule.cs @@ -4,7 +4,6 @@ using Abp.Reflection.Extensions; using System; using System.Collections; using System.Collections.Generic; -using YunDa.ISAS.DataTransferObject.EquipmentLiveData; using YunDa.ISAS.DataTransferObject.GeneralInformation.EquipmentInfoDto; using YunDa.ISAS.DataTransferObject.VideoSurveillance.InspectionPlanTaskDto; using YunDa.ISAS.DataTransferObject.VideoSurveillance.VideoDevDto; @@ -20,7 +19,7 @@ using YunDa.ISAS.Redis.Entities.SortDefines; using YunDa.ISAS.Redis.Factory; using YunDa.ISAS.Redis.Repositories; using YunDa.SOMS.DataTransferObject.CommonDto; -using YunDa.SOMS.DataTransferObject.EquipmentLiveData; +using YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveData; using YunDa.SOMS.DataTransferObject.GeneralInformation.ProtectionDeviceInfoDto; using YunDa.SOMS.DataTransferObject.GeneralInformation.ProtectionSettingDto; using YunDa.SOMS.DataTransferObject.MainStationMaintenanceInfo.OperationReport; diff --git a/src/YunDa.Domain/YunDa.ISMS.BASE.Entities/ISMSDbContextFactory.cs b/src/YunDa.Domain/YunDa.ISMS.BASE.Entities/ISMSDbContextFactory.cs index c1a1ad3..7d365c3 100644 --- a/src/YunDa.Domain/YunDa.ISMS.BASE.Entities/ISMSDbContextFactory.cs +++ b/src/YunDa.Domain/YunDa.ISMS.BASE.Entities/ISMSDbContextFactory.cs @@ -11,30 +11,30 @@ namespace YunDa.ISMS.BASE.Entities { /* This class is needed to run EF Core PMC commands. Not used anywhere else */ - public class ISMSDbContextFactory : IDesignTimeDbContextFactory - { - public static readonly ILoggerFactory MyLoggerFactory - = LoggerFactory.Create(builder => - { - builder - .SetMinimumLevel(LogLevel.Information) - .AddConsole(); // 启用控制台日志输出 + //public class ISMSDbContextFactory : IDesignTimeDbContextFactory + //{ + // public static readonly ILoggerFactory MyLoggerFactory + // = LoggerFactory.Create(builder => + // { + // builder + // .SetMinimumLevel(LogLevel.Information) + // .AddConsole(); // 启用控制台日志输出 - }); - public ISMS_BASEContext CreateDbContext(string[] args) - { + // }); + // public ISMS_BASEContext CreateDbContext(string[] args) + // { - var builder = new DbContextOptionsBuilder(); - string connectionString = "Server=192.168.61.230;User ID=sa;Password=sa;Database=ISMS_BASE;Trusted_Connection=False;TrustServerCertificate=True"; - builder.UseSqlServer(connectionString, builder => { builder.CommandTimeout(60); }) - .UseLoggerFactory(MyLoggerFactory) - .UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking) - .EnableSensitiveDataLogging() - .EnableDetailedErrors() - ; // 启用详细日志 - return new ISMS_BASEContext(builder.Options); - } - } + // var builder = new DbContextOptionsBuilder(); + // string connectionString = "Server=192.168.61.230;User ID=sa;Password=sa;Database=ISMS_BASE;Trusted_Connection=False;TrustServerCertificate=True"; + // builder.UseSqlServer(connectionString, builder => { builder.CommandTimeout(60); }) + // .UseLoggerFactory(MyLoggerFactory) + // .UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking) + // .EnableSensitiveDataLogging() + // .EnableDetailedErrors() + // ; // 启用详细日志 + // return new ISMS_BASEContext(builder.Options); + // } + //} /* This class is needed to run EF Core PMC commands. Not used anywhere else */ } \ No newline at end of file diff --git a/src/YunDa.Domain/YunDa.ISMS.BASE.Entities/ISMS_BASEContext.cs b/src/YunDa.Domain/YunDa.ISMS.BASE.Entities/ISMS_BASEContext.cs index 7b4dab4..94366fa 100644 --- a/src/YunDa.Domain/YunDa.ISMS.BASE.Entities/ISMS_BASEContext.cs +++ b/src/YunDa.Domain/YunDa.ISMS.BASE.Entities/ISMS_BASEContext.cs @@ -7,9 +7,14 @@ using YunDa.SOMS.BASE.Entities.Models; namespace YunDa.SOMS.BASE.Entities { +#if Mysql + public partial class ISMS_BASEContext : DbContext, ISMS_BASE_Dasets + +#else public partial class ISMS_BASEContext : AbpDbContext, ISMS_BASE_Dasets +#endif { - + public ISMS_BASEContext(DbContextOptions options) : base(options) { @@ -7680,7 +7685,9 @@ namespace YunDa.SOMS.BASE.Entities public DbSet ImDeviceYxSrcDevice { get; set; } public DbSet ImDeviceYxTmp { get; set; } public DbSet ImDiagram { get; set; } +#if Mysql public DbSet ImDzcheckrule { get; set; } +#endif public DbSet ImDztype { get; set; } public DbSet ImEventFlag { get; set; } public DbSet ImEventParam { get; set; } diff --git a/src/YunDa.Domain/YunDa.ISMS.BASE.Entities/ISMS_BASEEntityFrameworkCoreModule.cs b/src/YunDa.Domain/YunDa.ISMS.BASE.Entities/ISMS_BASEEntityFrameworkCoreModule.cs index f4c6b43..d6e9462 100644 --- a/src/YunDa.Domain/YunDa.ISMS.BASE.Entities/ISMS_BASEEntityFrameworkCoreModule.cs +++ b/src/YunDa.Domain/YunDa.ISMS.BASE.Entities/ISMS_BASEEntityFrameworkCoreModule.cs @@ -32,7 +32,14 @@ namespace YunDa.ISMS.BASE.Entities Logger.Info("Loading configuration for ISMS_BASEEntityFrameworkCoreModule..."); // 获取数据库连接字符串 + +#if Mysql var connectionString = configuration.GetConnectionString(ISASConsts.ISMS_BASEMysqlSettingStringKey); +#else + var connectionString = configuration.GetConnectionString(ISASConsts.ISMS_BASESqlServerSettingStringKey); + +#endif + if (string.IsNullOrEmpty(connectionString)) { throw new ApplicationException("Database connection string is not configured for ISMS_BASE."); diff --git a/src/YunDa.Domain/YunDa.ISMS.BASE.Entities/ISMS_BASE_Dasets.cs b/src/YunDa.Domain/YunDa.ISMS.BASE.Entities/ISMS_BASE_Dasets.cs index 373731e..02e57b6 100644 --- a/src/YunDa.Domain/YunDa.ISMS.BASE.Entities/ISMS_BASE_Dasets.cs +++ b/src/YunDa.Domain/YunDa.ISMS.BASE.Entities/ISMS_BASE_Dasets.cs @@ -46,8 +46,11 @@ namespace YunDa.SOMS.BASE.Entities public DbSet ImDeviceYxSrcDevice { get; set; } public DbSet ImDeviceYxTmp { get; set; } public DbSet ImDiagram { get; set; } +#if Mysql + public DbSet ImDzcheckrule { get; set; } - public DbSet ImDztype { get; set; } +#endif + public DbSet ImDztype { get; set; } public DbSet ImEventFlag { get; set; } public DbSet ImEventParam { get; set; } public DbSet ImEventType { get; set; } diff --git a/src/YunDa.Domain/YunDa.ISMS.BASE.Entities/ISMS_BASE_Mysql_Context.cs b/src/YunDa.Domain/YunDa.ISMS.BASE.Entities/ISMS_BASE_Mysql_Context.cs index 9ddb8a9..fc45bf5 100644 --- a/src/YunDa.Domain/YunDa.ISMS.BASE.Entities/ISMS_BASE_Mysql_Context.cs +++ b/src/YunDa.Domain/YunDa.ISMS.BASE.Entities/ISMS_BASE_Mysql_Context.cs @@ -3,14 +3,20 @@ using Microsoft.EntityFrameworkCore; using YunDa.SOMS.BASE.Entities.Models; namespace YunDa.SOMS.BASE.Entities { + +#if Mysql public partial class ISMS_BASE_Mysql_Context : AbpDbContext, ISMS_BASE_Dasets +#else + public partial class ISMS_BASE_Mysql_Context : DbContext, ISMS_BASE_Dasets +#endif { - + public ISMS_BASE_Mysql_Context(DbContextOptions options) : base(options) { } + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { @@ -3358,12 +3364,14 @@ namespace YunDa.SOMS.BASE.Entities entity.Property(e => e.SupportVersion) .HasColumnName("supportversion") .HasColumnType("int(11)"); - - entity.Property(e => e.Wavepath) +#if Mysql + entity.Property(e => e.Wavepath) .HasColumnName("wavepath") .HasColumnType("varchar(100)") .HasCharSet("utf8mb4") .HasCollation("utf8mb4_0900_ai_ci"); +#endif + }); @@ -6189,7 +6197,10 @@ namespace YunDa.SOMS.BASE.Entities public DbSet ImDeviceYxSrcDevice { get; set; } public DbSet ImDeviceYxTmp { get; set; } public DbSet ImDiagram { get; set; } +#if Mysql public DbSet ImDzcheckrule { get; set; } + +#endif public DbSet ImDztype { get; set; } public DbSet ImEventFlag { get; set; } public DbSet ImEventParam { get; set; } diff --git a/src/YunDa.Domain/YunDa.ISMS.BASE.Entities/Models/ImProtectDevice.cs b/src/YunDa.Domain/YunDa.ISMS.BASE.Entities/Models/ImProtectDevice.cs index 651de7e..7cea176 100644 --- a/src/YunDa.Domain/YunDa.ISMS.BASE.Entities/Models/ImProtectDevice.cs +++ b/src/YunDa.Domain/YunDa.ISMS.BASE.Entities/Models/ImProtectDevice.cs @@ -27,7 +27,9 @@ namespace YunDa.SOMS.BASE.Entities.Models public int? StartOfDkjl { get; set; } public int? EndOfDkjl { get; set; } public string? DeviceType { get; set; } +#if Mysql public string Wavepath { get; set; } +#endif public virtual ImGateWay GateWay { get; set; } = null!; public virtual ImPuCtgy PuctgyCodeNavigation { get; set; } = null!; diff --git a/src/YunDa.Domain/YunDa.ISMS.BASE.Entities/YunDa.SOMS.BASE.Entities.csproj b/src/YunDa.Domain/YunDa.ISMS.BASE.Entities/YunDa.SOMS.BASE.Entities.csproj index cdd138f..36d0c7b 100644 --- a/src/YunDa.Domain/YunDa.ISMS.BASE.Entities/YunDa.SOMS.BASE.Entities.csproj +++ b/src/YunDa.Domain/YunDa.ISMS.BASE.Entities/YunDa.SOMS.BASE.Entities.csproj @@ -6,13 +6,9 @@ enable - - $(DefineConstants);Mysql - + - - $(DefineConstants);Mysql - + diff --git a/src/YunDa.Quick/ISASUpdateProgram/updatescript.sql b/src/YunDa.Quick/ISASUpdateProgram/updatescript.sql index f8b91ab..d37dd70 100644 Binary files a/src/YunDa.Quick/ISASUpdateProgram/updatescript.sql and b/src/YunDa.Quick/ISASUpdateProgram/updatescript.sql differ diff --git a/src/YunDa.Server/Yunda.ISAS.DataMonitoringServer/DataAnalysis/AlarmAnalysis/AlarmAnalysis.cs b/src/YunDa.Server/Yunda.ISAS.DataMonitoringServer/DataAnalysis/AlarmAnalysis/AlarmAnalysis.cs index 5cb95fa..7535a59 100644 --- a/src/YunDa.Server/Yunda.ISAS.DataMonitoringServer/DataAnalysis/AlarmAnalysis/AlarmAnalysis.cs +++ b/src/YunDa.Server/Yunda.ISAS.DataMonitoringServer/DataAnalysis/AlarmAnalysis/AlarmAnalysis.cs @@ -14,11 +14,11 @@ using Yunda.ISAS.DataMonitoringServer.WebSocket.Model; using Yunda.ISAS.MongoDB.Entities.DataMonitoring; using YunDa.ISAS.DataTransferObject.DataMonitoring.DMAlarmCategoryDto; using YunDa.ISAS.DataTransferObject.DataMonitoring.TelemeteringAlarmStrategyDto; -using YunDa.ISAS.DataTransferObject.EquipmentLiveData; using YunDa.ISAS.DataTransferObject.GeneralInformation.EquipmentInfoDto; using YunDa.ISAS.DataTransferObject.GeneralInformation.EquipmentTypeDto; using YunDa.ISAS.Entities.DataMonitoring; using YunDa.ISAS.Entities.MySQL.DataMonitoring; +using YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveData; namespace Yunda.ISAS.DataMonitoringServer.DataAnalysis { diff --git a/src/YunDa.Server/Yunda.ISAS.DataMonitoringServer/DataAnalysis/AlarmQueue/AlarmQueueDataPublish.cs b/src/YunDa.Server/Yunda.ISAS.DataMonitoringServer/DataAnalysis/AlarmQueue/AlarmQueueDataPublish.cs index 5c7add0..36623c4 100644 --- a/src/YunDa.Server/Yunda.ISAS.DataMonitoringServer/DataAnalysis/AlarmQueue/AlarmQueueDataPublish.cs +++ b/src/YunDa.Server/Yunda.ISAS.DataMonitoringServer/DataAnalysis/AlarmQueue/AlarmQueueDataPublish.cs @@ -13,11 +13,11 @@ using Yunda.ISAS.DataMonitoringServer.WebSocket; using Yunda.ISAS.DataMonitoringServer.WebSocket.Model; using YunDa.ISAS.DataTransferObject.DataMonitoring.LinkageExecuteActivityDto; using YunDa.ISAS.DataTransferObject.DataMonitoring.TelemeteringAlarmStrategyDto; -using YunDa.ISAS.DataTransferObject.EquipmentLiveData; using YunDa.ISAS.DataTransferObject.GeneralInformation.EquipmentTypeDto; using YunDa.ISAS.DataTransferObject.VideoSurveillance.VideoDevDto; using YunDa.ISAS.Entities.DataMonitoring; using YunDa.ISAS.Redis.Entities.AlarmCategory; +using YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveData; namespace Yunda.ISAS.DataMonitoringServer.DataAnalysis.AlarmQueue { diff --git a/src/YunDa.Server/Yunda.ISAS.DataMonitoringServer/DataAnalysis/DataCollection/DataCollectionTask.cs b/src/YunDa.Server/Yunda.ISAS.DataMonitoringServer/DataAnalysis/DataCollection/DataCollectionTask.cs index 1d3799e..dc1a917 100644 --- a/src/YunDa.Server/Yunda.ISAS.DataMonitoringServer/DataAnalysis/DataCollection/DataCollectionTask.cs +++ b/src/YunDa.Server/Yunda.ISAS.DataMonitoringServer/DataAnalysis/DataCollection/DataCollectionTask.cs @@ -16,9 +16,9 @@ using ToolLibrary.LogHelper; using Yunda.ISAS.DataMonitoringServer.DataAnalysis.DataCollection.Dlls; using Yunda.ISAS.DataMonitoringServer.DataCenter; using Yunda.ISAS.DataMonitoringServer.WPF.ViewModel; -using YunDa.ISAS.DataTransferObject.EquipmentLiveData; using YunDa.ISAS.Entities.DataMonitoring; using YunDa.ISAS.Redis.Entities.DataMonitorCategory; +using YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveData; namespace Yunda.ISAS.DataMonitoringServer.DataAnalysis.DataCollection { diff --git a/src/YunDa.Server/Yunda.ISAS.DataMonitoringServer/DataAnalysis/DataCollection/DataSendTask.cs b/src/YunDa.Server/Yunda.ISAS.DataMonitoringServer/DataAnalysis/DataCollection/DataSendTask.cs index 4845ba1..b5f6aca 100644 --- a/src/YunDa.Server/Yunda.ISAS.DataMonitoringServer/DataAnalysis/DataCollection/DataSendTask.cs +++ b/src/YunDa.Server/Yunda.ISAS.DataMonitoringServer/DataAnalysis/DataCollection/DataSendTask.cs @@ -30,7 +30,6 @@ using Yunda.ISAS.MongoDB.Entities.DataMonitoring; using Yunda.SOMS.DataMonitoringServer.DataAnalysis.Model; using Yunda.SOMS.MongoDB.Entities.MainStationMaintenanceInfo; using YunDa.ISAS.DataTransferObject.CommonDto; -using YunDa.ISAS.DataTransferObject.EquipmentLiveData; using YunDa.ISAS.DataTransferObject.Iec104; using YunDa.ISAS.Entities.DataMonitoring; using YunDa.ISAS.Entities.GeneralInformation; @@ -38,6 +37,7 @@ using YunDa.ISAS.Entities.VideoSurveillance; using YunDa.ISAS.Redis.Entities.AlarmCategory; using YunDa.ISAS.Redis.Entities.DataMonitorCategory; using YunDa.ISAS.Redis.Repositories; +using YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveData; using YunDa.SOMS.DataTransferObject.GeneralInformation.SecondaryCircuitDto; using YunDa.SOMS.DataTransferObject.MainStationMaintenanceInfo.OperationReport; using YunDa.SOMS.Entities.GeneralInformation; diff --git a/src/YunDa.Server/Yunda.ISAS.DataMonitoringServer/DataAnalysis/LinkageAnalysis/LinkageAnalysisTask.cs b/src/YunDa.Server/Yunda.ISAS.DataMonitoringServer/DataAnalysis/LinkageAnalysis/LinkageAnalysisTask.cs index b373870..21480e2 100644 --- a/src/YunDa.Server/Yunda.ISAS.DataMonitoringServer/DataAnalysis/LinkageAnalysis/LinkageAnalysisTask.cs +++ b/src/YunDa.Server/Yunda.ISAS.DataMonitoringServer/DataAnalysis/LinkageAnalysis/LinkageAnalysisTask.cs @@ -15,8 +15,8 @@ using Yunda.ISAS.DataMonitoringServer.DataCenter; using Yunda.ISAS.DataMonitoringServer.WebSocket; using Yunda.ISAS.DataMonitoringServer.WebSocket.Model; using YunDa.ISAS.DataTransferObject.DataMonitoring.LinkageConditionDto; -using YunDa.ISAS.DataTransferObject.EquipmentLiveData; using YunDa.ISAS.Entities.MySQL.DataMonitoring; +using YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveData; using Z.Expressions; using ConstantModel = Yunda.ISAS.DataMonitoringServer.DataAnalysis.Model.ConstantModel; diff --git a/src/YunDa.Server/Yunda.ISAS.DataMonitoringServer/DataAnalysis/TeleInfoSave/TelemeteringResultSaveTask.cs b/src/YunDa.Server/Yunda.ISAS.DataMonitoringServer/DataAnalysis/TeleInfoSave/TelemeteringResultSaveTask.cs index 5da7fd3..8a89f76 100644 --- a/src/YunDa.Server/Yunda.ISAS.DataMonitoringServer/DataAnalysis/TeleInfoSave/TelemeteringResultSaveTask.cs +++ b/src/YunDa.Server/Yunda.ISAS.DataMonitoringServer/DataAnalysis/TeleInfoSave/TelemeteringResultSaveTask.cs @@ -10,7 +10,7 @@ using Yunda.ISAS.DataMonitoringServer.DataAnalysis.Model; using Yunda.ISAS.DataMonitoringServer.DataCenter; using Yunda.ISAS.DataMonitoringServer.WPF.ViewModel; using Yunda.ISAS.MongoDB.Entities.DataMonitoring; -using YunDa.ISAS.DataTransferObject.EquipmentLiveData; +using YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveData; using ConstantModel = Yunda.ISAS.DataMonitoringServer.DataAnalysis.Model.ConstantModel; namespace Yunda.ISAS.DataMonitoringServer.DataAnalysis.TeleInfoSave diff --git a/src/YunDa.Server/Yunda.ISAS.DataMonitoringServer/DataAnalysis/WebApiRequest.cs b/src/YunDa.Server/Yunda.ISAS.DataMonitoringServer/DataAnalysis/WebApiRequest.cs index 4bb1868..b440c16 100644 --- a/src/YunDa.Server/Yunda.ISAS.DataMonitoringServer/DataAnalysis/WebApiRequest.cs +++ b/src/YunDa.Server/Yunda.ISAS.DataMonitoringServer/DataAnalysis/WebApiRequest.cs @@ -17,7 +17,6 @@ using YunDa.ISAS.DataTransferObject.DataMonitoring.TelecommandConfigurationDto.S using YunDa.ISAS.DataTransferObject.DataMonitoring.TelecommandPlanDto.TelecommandPlanTimeDto; using YunDa.ISAS.DataTransferObject.DataMonitoring.TelemeteringAlarmStrategyDto; using YunDa.ISAS.DataTransferObject.DataMonitoring.TelemeteringConfigurationDto; -using YunDa.ISAS.DataTransferObject.EquipmentLiveData; using YunDa.ISAS.DataTransferObject.GeneralInformation.EquipmentInfoDto; using YunDa.ISAS.DataTransferObject.GeneralInformation.EquipmentTypeDto; using YunDa.ISAS.DataTransferObject.GeneralInformation.TransformerSubstationDto; @@ -31,6 +30,7 @@ using YunDa.ISAS.Entities.DataMonitoring; using YunDa.ISAS.Entities.GeneralInformation; using YunDa.ISAS.ExternalInteraction.DataTransferObject.InspectionEquipment; using YunDa.ISAS.ExternalInteraction.DataTransferObject.InspectionEquipment.RequestInput; +using YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveData; using YunDa.SOMS.DataTransferObject.GeneralInformation.ProtectionDeviceInfoDto; using YunDa.SOMS.DataTransferObject.GeneralInformation.ProtectionSettingDto; using YunDa.SOMS.DataTransferObject.GeneralInformation.SecondaryCircuitDto; diff --git a/src/YunDa.Server/Yunda.ISAS.DataMonitoringServer/DataCenter/RedisRepository.cs b/src/YunDa.Server/Yunda.ISAS.DataMonitoringServer/DataCenter/RedisRepository.cs index 068f965..ec786e6 100644 --- a/src/YunDa.Server/Yunda.ISAS.DataMonitoringServer/DataCenter/RedisRepository.cs +++ b/src/YunDa.Server/Yunda.ISAS.DataMonitoringServer/DataCenter/RedisRepository.cs @@ -2,13 +2,13 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; -using YunDa.ISAS.DataTransferObject.EquipmentLiveData; using YunDa.ISAS.Redis.Entities.AlarmCategory; using YunDa.ISAS.Redis.Entities.CameraAuthCategory; using YunDa.ISAS.Redis.Entities.DataMonitorCategory; using YunDa.ISAS.Redis.Entities.LinkageCategory; using YunDa.ISAS.Redis.Repositories; using YunDa.SOMS.DataTransferObject.CommonDto; +using YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveData; using YunDa.SOMS.DataTransferObject.GeneralInformation.ProtectionDeviceInfoDto; using YunDa.SOMS.DataTransferObject.MainStationMaintenanceInfo.OperationReport; diff --git a/src/YunDa.Server/Yunda.ISAS.DataMonitoringServer/DataCenter/RunningDataCache.cs b/src/YunDa.Server/Yunda.ISAS.DataMonitoringServer/DataCenter/RunningDataCache.cs index 8e99c56..27027d7 100644 --- a/src/YunDa.Server/Yunda.ISAS.DataMonitoringServer/DataCenter/RunningDataCache.cs +++ b/src/YunDa.Server/Yunda.ISAS.DataMonitoringServer/DataCenter/RunningDataCache.cs @@ -10,15 +10,15 @@ using Yunda.ISAS.DataMonitoringServer.DataAnalysis.Model; using YunDa.ISAS.DataTransferObject.DataMonitoring.DMAlarmCategoryDto; using YunDa.ISAS.DataTransferObject.DataMonitoring.LinkageExecuteActivityDto; using YunDa.ISAS.DataTransferObject.DataMonitoring.TelemeteringAlarmStrategyDto; -using YunDa.ISAS.DataTransferObject.EquipmentLiveData; using YunDa.ISAS.DataTransferObject.GeneralInformation.EquipmentInfoDto; using YunDa.ISAS.DataTransferObject.GeneralInformation.EquipmentTypeDto; using YunDa.ISAS.DataTransferObject.GeneralInformation.TransformerSubstationDto; using YunDa.ISAS.Redis.Repositories; -using ConstantModel = YunDa.ISAS.DataTransferObject.EquipmentLiveData.ConstantModel; +using ConstantModel = YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveData.ConstantModel; using YunDa.SOMS.DataTransferObject.GeneralInformation.SecondaryCircuitDto; using YunDa.ISAS.DataTransferObject.DataMonitoring.TelemeteringConfigurationDto; +using YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveData; namespace Yunda.ISAS.DataMonitoringServer.DataCenter { public class RunningDataCache : ISingletonDependency diff --git a/src/YunDa.Server/Yunda.ISAS.DataMonitoringServer/DataCenter/TelecomDataCenter.cs b/src/YunDa.Server/Yunda.ISAS.DataMonitoringServer/DataCenter/TelecomDataCenter.cs index fbb17fd..86dd297 100644 --- a/src/YunDa.Server/Yunda.ISAS.DataMonitoringServer/DataCenter/TelecomDataCenter.cs +++ b/src/YunDa.Server/Yunda.ISAS.DataMonitoringServer/DataCenter/TelecomDataCenter.cs @@ -11,9 +11,9 @@ using Yunda.ISAS.DataMonitoringServer.DataAnalysis.Helper; using YunDa.ISAS.DataTransferObject.DataMonitoring.TelemeteringConfigurationDto; using YunDa.ISAS.DataTransferObject.DataMonitoring.TelemeteringConfigurationDto.SearchCondition; using YunDa.ISAS.DataTransferObject.DataMonitoring.TelesignalisationConfigurationDto; -using YunDa.ISAS.DataTransferObject.EquipmentLiveData; using YunDa.ISAS.DataTransferObject.Iec104; using YunDa.ISAS.Entities.DataMonitoring; +using YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveData; using ConstantModel = Yunda.ISAS.DataMonitoringServer.DataAnalysis.Model.ConstantModel; namespace Yunda.ISAS.DataMonitoringServer.DataCenter diff --git a/src/YunDa.Server/Yunda.ISAS.DataMonitoringServer/WebSocket/WebSocketServer.cs b/src/YunDa.Server/Yunda.ISAS.DataMonitoringServer/WebSocket/WebSocketServer.cs index 4ffcc87..8df0c76 100644 --- a/src/YunDa.Server/Yunda.ISAS.DataMonitoringServer/WebSocket/WebSocketServer.cs +++ b/src/YunDa.Server/Yunda.ISAS.DataMonitoringServer/WebSocket/WebSocketServer.cs @@ -16,8 +16,8 @@ using Yunda.ISAS.DataMonitoringServer.DataCenter; using Yunda.ISAS.DataMonitoringServer.WebSocket.DotNetty.Server; using Yunda.ISAS.DataMonitoringServer.WebSocket.Model; using YunDa.ISAS.DataTransferObject.CommonDto; -using YunDa.ISAS.DataTransferObject.EquipmentLiveData; using YunDa.ISAS.Redis.Entities.AlarmCategory; +using YunDa.SOMS.DataTransferObject.GeneralInformation.EquipmentLiveData; namespace Yunda.ISAS.DataMonitoringServer.WebSocket { diff --git a/src/YunDa.Web/YunDa.SOMS.Web.MVC/Controllers/GeneralInformationController.cs b/src/YunDa.Web/YunDa.SOMS.Web.MVC/Controllers/GeneralInformationController.cs index e9c94b4..fb74941 100644 --- a/src/YunDa.Web/YunDa.SOMS.Web.MVC/Controllers/GeneralInformationController.cs +++ b/src/YunDa.Web/YunDa.SOMS.Web.MVC/Controllers/GeneralInformationController.cs @@ -66,7 +66,16 @@ namespace YunDa.ISAS.Web.MVC.Controllers ViewData["IsEdit"] = isEdit; return View(); } - + /// + /// 设备指标配置 + /// + /// + /// + public IActionResult EquipmentIndicatorConfig(bool isEdit = false) + { + ViewData["IsEdit"] = isEdit; + return View(); + } } } diff --git a/src/YunDa.Web/YunDa.SOMS.Web.MVC/Views/GeneralInformation/EquipmentIndicatorConfig.cshtml b/src/YunDa.Web/YunDa.SOMS.Web.MVC/Views/GeneralInformation/EquipmentIndicatorConfig.cshtml new file mode 100644 index 0000000..cfe65bd --- /dev/null +++ b/src/YunDa.Web/YunDa.SOMS.Web.MVC/Views/GeneralInformation/EquipmentIndicatorConfig.cshtml @@ -0,0 +1,183 @@ +@{ + ViewData["Title"] = "设备诊断指标"; + Layout = "~/Views/Shared/_Layout.cshtml"; +} +
+
+ @await Html.PartialAsync("~/Views/GeneralInformation/_TranSubstationEquipmentTree.cshtml") +
+
+ + +
+
+ +
+ + + +@section scripts{ + + + + + + + + } +@section styles{ + + + + + } + diff --git a/src/YunDa.Web/YunDa.SOMS.Web.MVC/YunDa.SOMS.Web.MVC.csproj b/src/YunDa.Web/YunDa.SOMS.Web.MVC/YunDa.SOMS.Web.MVC.csproj index 9d1ff97..832f73a 100644 --- a/src/YunDa.Web/YunDa.SOMS.Web.MVC/YunDa.SOMS.Web.MVC.csproj +++ b/src/YunDa.Web/YunDa.SOMS.Web.MVC/YunDa.SOMS.Web.MVC.csproj @@ -250,6 +250,10 @@ Never + + true + PreserveNewest + true PreserveNewest diff --git a/src/YunDa.Web/YunDa.SOMS.Web.MVC/appsettings.json b/src/YunDa.Web/YunDa.SOMS.Web.MVC/appsettings.json index 3bb11ef..5b3ff99 100644 --- a/src/YunDa.Web/YunDa.SOMS.Web.MVC/appsettings.json +++ b/src/YunDa.Web/YunDa.SOMS.Web.MVC/appsettings.json @@ -1,11 +1,22 @@ { + "Abp": { + "WebCommon": { + "WrapResult": false, + "ShowStackTrace": true + } + }, + "AbpExceptionHandling": { + "SendExceptionsDetailsToClients": true, // 显示详细错误 + "SendStackTraceToClients": true // 显示堆栈跟踪 + }, "ConnectionStrings": { - "MysqlSetting": "server=127.0.0.1;port=3306;uid=root;pwd=123456; Database=soms_sys_db;SslMode=none;Max Pool Size=200;Connection Timeout=180;Pooling=True;", + "MysqlSetting": "server=192.168.81.229;port=3306;uid=root;pwd=123456; Database=soms_sys_db;SslMode=none;Max Pool Size=200;Connection Timeout=60;Pooling=True;", + "ISMS_BASE_MysqlSetting": "server=192.168.81.229;port=3306;uid=root;pwd=123456; Database=isms_l_base;SslMode=none;Max Pool Size=200;Connection Timeout=60;Pooling=True;", "ISMS_BASESqlServerSetting": "Server=192.168.65.33;User ID=sa;Password=sa;Database=ISMS_BASE;Trusted_Connection=False;TrustServerCertificate=True;Max Pool Size=200;Connection Timeout=60;", - "ISMS_YcSqlServerSetting": "Server=127.0.0.1;User ID=sa;Password=sa;Database=ISMS_Yc;Trusted_Connection=False;TrustServerCertificate=True", - "ISMS_DataSqlServerSetting": "Server=127.0.0.1;User ID=sa;Password=sa;Database=ISMS_Data;Trusted_Connection=False;TrustServerCertificate=True", - "ISMS_ReportServerSqlServerSetting": "Server=127.0.0.1;User ID=sa;Password=sa;Database=ReportServer;Trusted_Connection=False;TrustServerCertificate=True", - "ISMS_ReportServerTempDBSqlServerSetting": "Server=127.0.0.1;User ID=sa;Password=sa;Database=ReportServerTempDB;Trusted_Connection=False;TrustServerCertificate=True", + "ISMS_YcSqlServerSetting": "Server=192.168.110.161;User ID=sa;Password=sa;Database=ISMS_Yc;Trusted_Connection=False;TrustServerCertificate=True", + "ISMS_DataSqlServerSetting": "Server=192.168.110.161;User ID=sa;Password=sa;Database=ISMS_Data;Trusted_Connection=False;TrustServerCertificate=True", + "ISMS_ReportServerSqlServerSetting": "Server=192.168.110.161;User ID=sa;Password=sa;Database=ReportServer;Trusted_Connection=False;TrustServerCertificate=True", + "ISMS_ReportServerTempDBSqlServerSetting": "Server=192.168.110.161;User ID=sa;Password=sa;Database=ReportServerTempDB;Trusted_Connection=False;TrustServerCertificate=True", "MongoDBSetting": { "Host": "127.0.0.1", "Port": "37017", @@ -50,7 +61,7 @@ "Http": { "Url": "http://0.0.0.0:38090" } - + } }, "App": { diff --git a/src/YunDa.Web/YunDa.SOMS.Web.MVC/wwwroot/view-resources/Views/GeneralInformation/EquipmentIndicatorConfig.js b/src/YunDa.Web/YunDa.SOMS.Web.MVC/wwwroot/view-resources/Views/GeneralInformation/EquipmentIndicatorConfig.js new file mode 100644 index 0000000..76df9d5 --- /dev/null +++ b/src/YunDa.Web/YunDa.SOMS.Web.MVC/wwwroot/view-resources/Views/GeneralInformation/EquipmentIndicatorConfig.js @@ -0,0 +1,351 @@ +$(document).ready(function () { + substationTree.isShowEquipment = false; + substationTree.initTree(subTreeChanged); + // 原有代码保持不变... + equipmentIndicatorConfigList.initListFunc(); + $(".refresh-btn").click(function () { + substationTree.initTree(subTreeChanged); + substationTree.refreshTree(); + }) +}); +var treeNode = { type: null }; +function subTreeChanged(node) { + treeNode = node; + equipmentIndicatorConfigList.refreshTable(); +} + +function showExcelExportImport() { + $("#excelExport").toggle(); +} +var treeNode = null; + +var equipmentIndicatorConfigList = { + mainTableId: "equipmentIndicatorConfigTable", + toolBarId: "equipmentIndicatorConfigToolbar", + toolBarVue: null, + editModalId: "equipmentIndicatorConfigEditModal", + editModalVue: null, + editFormId: "editEquipmentIndicatorConfigForm", + lastExpandRowIndex: -1, + + initListFunc: function () { + equipmentIndicatorConfigList.initToolBarVue(); + equipmentIndicatorConfigList.initEditModalByVue(); + equipmentIndicatorConfigList.initTable(); + equipmentIndicatorConfigList.initEditFormValidate(); + equipmentIndicatorConfigList.refreshTable(); + equipmentIndicatorConfigList.initBaseDataVue(); + }, + + initToolBarVue: function () { + equipmentIndicatorConfigList.toolBarVue = new Vue({ + el: '#' + equipmentIndicatorConfigList.toolBarId, + data: { + name: "", + isShowAddBtn: true + }, + methods: { + search: function () { + equipmentIndicatorConfigList.refreshTable(); + }, + add: function () { + equipmentIndicatorConfigList.initEditModalValues(""); + $(equipmentIndicatorConfigList.editModalVue.$el).modal('show'); + }, + deleteFunc: function () { + let row = equipmentIndicatorConfigList.getSelectItem(); + if (!row || row.length == 0) { + layer.alert("请选择要删除的行!"); + return; + } + let arrIds = new Array(); + row.forEach(r => arrIds.push(r.id)); + isas.ajax({ + url: AppServiceUrl.EquipmentIndicatorConfig_DeleteByIds, + data: JSON.stringify(arrIds), + confirm: true, + success: function (rst) { + if (rst.result?.flag) { + equipmentIndicatorConfigList.refreshTable(); + layer.alert(rst.result.message); + } else if (!rst.success) { + layer.alert(rst.error.message); + } + }, + }); + }, + + addBaseData: function () { + $('#equipmentIndicatorCommentEditModal').modal('show'); + } + } + }) + }, + initBaseDataVue: function () { + equipmentIndicatorConfigList.toolBarVue = new Vue({ + el: '#equipmentIndicatorCommentEditModal', + data: { + id: null, + seqNo: 0, + description: "", + remark: "", + isActive: true, + }, + methods: { + save: function () { + let data = { + id: this.id, + seqNo: this.seqNo, + description: this.description, + remark: this.remark, + isActive: true, + }; + isas.ajax({ + url: AppServiceUrl.EquipmentIndicatorConfig_CreateEquipmentIndicatorComment, + data: JSON.stringify(data), + confirm: true, + success: function (rst) { + if (rst.result?.flag) { + equipmentIndicatorConfigList.editModalVue.loadequipmentIndicatorComment(); + layer.alert(rst.result.message); + } else if (!rst.success) { + layer.alert(rst.error.message); + } + }, + }); + }, + } + }) + }, + + initEditModalByVue: function () { + equipmentIndicatorConfigList.editModalVue = new Vue({ + el: '#' + equipmentIndicatorConfigList.editModalId, + data: { + header: '添加', + id: null, + seqNo: 0, + name: "", + names: [], + calculationFormula: "", + weight: 0, + dataPrecision: 2, + value: 0, + remark: "", + isActive: true, + equipmentTypes: [], + equipmentTypeId: null, + }, + mounted: function () { + this.loadEquipmentTypes(); + this.loadequipmentIndicatorComment(); + }, + methods: { + loadEquipmentTypes: function () { + let bar = this; + isas.ajax({ + url: AppServiceUrl.EquipmentType_FindEquipmentTypeForSelectByLevel + "?equipmentTypeLevel=20", + data: JSON.stringify( + { + searchCondition: { + equipmentTypeLevel: 20 + } + } + ), + type: 'get', + isHideSuccessMsg: true, + success: function (rst) { + if (rst.result) { + if (rst.result.flag) { + bar.equipmentTypes = rst.result.resultData; + } + } + }, + }); + }, + loadequipmentIndicatorComment: function () { + let bar = this; + isas.ajax({ + url: AppServiceUrl.EquipmentIndicatorConfig_FindEquipmentIndicatorCommentForSelect, + + type: 'post', + isHideSuccessMsg: true, + success: function (rst) { + if (rst.result) { + if (rst.result.flag) { + bar.names = rst.result.resultData; + } + } + }, + }); + }, + setEquipmentTypeIdAction: function (para) { + this.equipmentTypeId = para; + + }, + setNameAction: function (para) { + this.name = para; + }, + save: function () { + if (!$("#" + equipmentIndicatorConfigList.editFormId).valid()) return; + + const data = { + id: this.id, + seqNo: this.seqNo, + name: this.name, + calculationFormula: this.calculationFormula, + weight: this.weight, + dataPrecision: this.dataPrecision, + value: this.value, + remark: this.remark, + isActive: this.isActive, + equipmentTypeId: this.equipmentTypeId + }; + + isas.ajax({ + url: AppServiceUrl.EquipmentIndicatorConfig_CreateOrUpdate, + data: JSON.stringify(data), + success: (rst) => { + if (rst.result?.flag) { + equipmentIndicatorConfigList.refreshTable(); + $(this.$el).modal('hide'); + } + } + }); + } + } + }) + }, + + initEditFormValidate: function () { + $("#" + equipmentIndicatorConfigList.editFormId).validate({ + rules: { + name: { required: true, maxlength: 200 }, + equipmentType: { required: true }, + weight: { required: true, number: true }, + dataPrecision: { required: true, number: true } + }, + messages: { + name: { + required: "指标名称不能为空", + maxlength: "名称长度不能超过200个字符" + }, + equipmentType: { required: "请选择设备类型" }, + weight: { + required: "权重不能为空", + number: "请输入有效数字" + }, + dataPrecision: { + required: "数据精度不能为空", + number: "请输入有效数字" + } + } + }); + }, + + initEditModalValues: function (uniqueId) { + const vueInstance = equipmentIndicatorConfigList.editModalVue; + equipmentIndicatorConfigList.resetFormValidate(); + + if (!uniqueId) { + vueInstance.$data = { + header: '添加', + id: null, + seqNo: 0, + name: "", + calculationFormula: "", + weight: 0, + dataPrecision: 2, + value: 0, + remark: "", + isActive: true, + equipmentType: null + }; + return; + } + + const rowData = $('#' + this.mainTableId).bootstrapTable('getRowByUniqueId', uniqueId); + vueInstance.header = '编辑'; + vueInstance.id = rowData.id; + vueInstance.seqNo = rowData.seqNo; + vueInstance.name = rowData.name; + vueInstance.calculationFormula = rowData.calculationFormula; + vueInstance.weight = rowData.weight; + vueInstance.dataPrecision = rowData.dataPrecision; + vueInstance.value = rowData.value; + vueInstance.remark = rowData.remark; + vueInstance.isActive = rowData.isActive; + vueInstance.equipmentType = rowData.equipmentType?.id; + }, + + initTable: function () { + isas.bootstrapTable({ + el: '#' + this.mainTableId, + url: AppServiceUrl.EquipmentIndicatorConfig_FindDatas, + toolBarEl: "#" + equipmentIndicatorConfigList.toolBarVueId, + isInitData: false, + singleSelect: false, + pageList: [12,24,48,96], + pageSize: 12, + showColumns: false, + showToggle: false, + toolbarAlign: 'right', + detailView: false, + columns: [ + { checkbox: true, align: 'center', width: 50 }, + { title: '行号', align: 'center', formatter: (value, row, index) => index + 1 }, + { field: 'seqNo', title: '序号', align: 'center' }, + { field: 'name', title: '指标名称', align: 'center' }, + { + field: 'calculationFormula', + title: '计算方式描述', + formatter: value => value || '-' + }, + { field: 'weight', title: '权重', align: 'center' }, + { field: 'dataPrecision', title: '数据精度', align: 'center' }, + { field: 'value', title: '基准值', align: 'center' }, + { + field: 'equipmentType', + title: '设备类型', + formatter: value => value?.name || '-' + }, + { + field: 'isActive', + title: '状态', + formatter: value => + ` + + ` + }, + { + field: 'operation', + title: "操作", + formatter: (value, row) => + `` + } + ], + queryParams: params => ({ + pageIndex: Math.floor(params.offset / params.limit) + 1, + pageSize: params.limit, + searchCondition: { + name: this.toolBarVue.name, + equipmentTypeId: treeNode?.type === 'equipment' ? treeNode.id : null + } + }) + }); + }, + + refreshTable: function () { + $('#' + this.mainTableId).bootstrapTable('refresh'); + }, + + getSelectItem: () => $('#' + equipmentIndicatorConfigList.mainTableId).bootstrapTable('getSelections'), + resetFormValidate: function () { + $("#" + this.editFormId).validate().resetForm(); + $("#" + this.editFormId).find('.form-group').removeClass('has-success has-error'); + } +}; diff --git a/src/YunDa.Web/YunDa.SOMS.Web.MVC/wwwroot/view-resources/isas_const.js b/src/YunDa.Web/YunDa.SOMS.Web.MVC/wwwroot/view-resources/isas_const.js index 452bdce..f8ac864 100644 --- a/src/YunDa.Web/YunDa.SOMS.Web.MVC/wwwroot/view-resources/isas_const.js +++ b/src/YunDa.Web/YunDa.SOMS.Web.MVC/wwwroot/view-resources/isas_const.js @@ -526,6 +526,12 @@ var AppServiceUrl = { BoardCardInfo_SpwanBoardMancfactoryJDYDList: BaseUrl + "BoardCardInfo/SpwanBoardInfoList", SecondaryElectricalEquipmentInfo_MergerDeviceData: BaseUrl + "SecondaryElectricalEquipmentInfo/MergerDeviceData", + EquipmentIndicatorConfig_DeleteByIds: BaseUrl + "EquipmentIndicatorConfig/DeleteByIds", + EquipmentIndicatorConfig_CreateOrUpdate: BaseUrl + "EquipmentIndicatorConfig/CreateOrUpdate", + EquipmentIndicatorConfig_FindDatas: BaseUrl + "EquipmentIndicatorConfig/FindDatas", + EquipmentIndicatorConfig_FindEquipmentIndicatorCommentForSelect: BaseUrl + "EquipmentIndicatorConfig/FindEquipmentIndicatorCommentForSelect", + EquipmentIndicatorConfig_CreateEquipmentIndicatorComment: BaseUrl + "EquipmentIndicatorConfig/CreateEquipmentIndicatorComment", - + + } \ No newline at end of file