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 6fc6bc5..3adb498 100644 --- a/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/EquipmentInfo/EquipmentInfoExAppService.cs +++ b/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/EquipmentInfo/EquipmentInfoExAppService.cs @@ -500,7 +500,6 @@ namespace YunDa.ISAS.Application.GeneralInformation .Where(t => t.DataSourceCategory == dataSourceCategory) .Where(t => t.IsActive) .ToList(); - var duplicateIds = telemeterings .GroupBy(t => $"{t.DeviceAddress}_{t.CPUSector}_{t.DispatcherAddress}_{(int)t.DataSourceCategory}") .Where(g => g.Count() > 1) // 找出重复的标识符 diff --git a/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/SecondaryCircuitInfo/SecondaryCircuitLogicExpressionAppService.cs b/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/SecondaryCircuitInfo/SecondaryCircuitLogicExpressionAppService.cs index 3ad9fe3..18014de 100644 --- a/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/SecondaryCircuitInfo/SecondaryCircuitLogicExpressionAppService.cs +++ b/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/SecondaryCircuitInfo/SecondaryCircuitLogicExpressionAppService.cs @@ -85,7 +85,11 @@ namespace YunDa.ISAS.Application.GeneralInformation.SecondaryCircuitInfo .Where(t => t.SecondaryCircuitId == input.SecondaryCircuitId).FirstOrDefault(); if (secondaryCircuitProtectionDevice != null) { - var dispatchaddr = _telemeteringConfigurationRepository.GetAll().Where(t => t.DataSourceCategory == DataSourceCategoryEnum.None).Select(t => t.DispatcherAddress).Max() + 1; + int dispatchaddr = 1; + if (_telemeteringConfigurationRepository.GetAll().Where(t => t.DataSourceCategory == DataSourceCategoryEnum.None).Count()>0) + { + dispatchaddr =(int) _telemeteringConfigurationRepository.GetAll().Where(t => t.DataSourceCategory == DataSourceCategoryEnum.None)?.Select(t => t.DispatcherAddress)?.Max() + 1; + } var telemetering = InsertTelemetering(secondaryCircuitProtectionDevice, entity.Name, dispatchaddr); var telemeteringId = await _telemeteringConfigurationRepository.InsertAndGetIdAsync(telemetering); if (telemeteringId!=default) @@ -168,6 +172,7 @@ namespace YunDa.ISAS.Application.GeneralInformation.SecondaryCircuitInfo YesContent = "故障", NoContent = "消失", UnsurenessContent = "不定", + DataSourceCategory = DataSourceCategoryEnum.None, IsCommStatus = false, TransformerSubstationId = secondaryCircuitProtectionDevice.ProtectionDevice.TransformerSubstationId, }; diff --git a/src/YunDa.Application/YunDa.ISAS.DataTransferObject/YunDa.SOMS.DataTransferObject.csproj b/src/YunDa.Application/YunDa.ISAS.DataTransferObject/YunDa.SOMS.DataTransferObject.csproj index 5872830..b5c4e54 100644 --- a/src/YunDa.Application/YunDa.ISAS.DataTransferObject/YunDa.SOMS.DataTransferObject.csproj +++ b/src/YunDa.Application/YunDa.ISAS.DataTransferObject/YunDa.SOMS.DataTransferObject.csproj @@ -24,7 +24,6 @@ - diff --git a/src/YunDa.Web/YunDa.SOMS.Web.MVC/appsettings.development.json b/src/YunDa.Web/YunDa.SOMS.Web.MVC/appsettings.development.json index e84721d..f4c3c9c 100644 --- a/src/YunDa.Web/YunDa.SOMS.Web.MVC/appsettings.development.json +++ b/src/YunDa.Web/YunDa.SOMS.Web.MVC/appsettings.development.json @@ -1,6 +1,6 @@ { "ConnectionStrings": { - "MysqlSetting": "server=127.0.0.1;port=3306;uid=root;pwd=123456; Database=soms_sys_db;SslMode=none;Pooling=False;", + "MysqlSetting": "server=192.168.110.229;port=3306;uid=root;pwd=123456; Database=soms_sys_db;SslMode=none;Pooling=False;", "ISMS_BASESqlServerSetting": "Server=192.168.110.161;User ID=sa;Password=sa;Database=ISMS_BASE;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", @@ -8,7 +8,7 @@ "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", + "Host": "192.168.110.229", "Port": "37017", "DatabaseName": "isas_mongodb", "IsAuth": "false", @@ -16,7 +16,7 @@ "PassWord": "123456" }, "RedisSetting": { - "Host": "127.0.0.1", + "Host": "192.168.110.229", "Port": "36379", "Auth": "yunda123", "Name": "",