升级到.net 8

This commit is contained in:
green1193pr7sdfr 2025-09-11 15:12:10 +08:00
parent 6f3406cf21
commit 972ab6b645
74 changed files with 357 additions and 415 deletions

View File

@ -54,8 +54,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "YunDa.SOMS.ExternalInteract
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yunda.ToolLibrary", "src\YunDa.Util\ToolLibrary\Yunda.ToolLibrary.csproj", "{D4151068-F1A4-4A8F-94E1-C1C05D986C71}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yunda.VideoSurveillanceAdapter", "src\YunDa.Util\VideoSurveillanceAdapter\Yunda.VideoSurveillanceAdapter.csproj", "{31DECE15-9A02-4E47-912B-FC08D3B24E1B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "YunDa.SOMS.ExternalInteraction.DataTransferObject", "src\YunDa.Application\YunDa.SOMS.ExternalInteraction.DataTransferObject\YunDa.SOMS.ExternalInteraction.DataTransferObject.csproj", "{13D6143E-C01D-4E1B-A769-032F669CF725}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "YunDa.Quick", "YunDa.Quick", "{7E07DDCE-003F-4C6E-98D5-74A71E8C1770}"
@ -381,24 +379,6 @@ Global
{D4151068-F1A4-4A8F-94E1-C1C05D986C71}.Template|x64.Build.0 = Release|x64
{D4151068-F1A4-4A8F-94E1-C1C05D986C71}.Template|x86.ActiveCfg = Release|Any CPU
{D4151068-F1A4-4A8F-94E1-C1C05D986C71}.Template|x86.Build.0 = Release|Any CPU
{31DECE15-9A02-4E47-912B-FC08D3B24E1B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{31DECE15-9A02-4E47-912B-FC08D3B24E1B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{31DECE15-9A02-4E47-912B-FC08D3B24E1B}.Debug|x64.ActiveCfg = Debug|x64
{31DECE15-9A02-4E47-912B-FC08D3B24E1B}.Debug|x64.Build.0 = Debug|x64
{31DECE15-9A02-4E47-912B-FC08D3B24E1B}.Debug|x86.ActiveCfg = Debug|Any CPU
{31DECE15-9A02-4E47-912B-FC08D3B24E1B}.Debug|x86.Build.0 = Debug|Any CPU
{31DECE15-9A02-4E47-912B-FC08D3B24E1B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{31DECE15-9A02-4E47-912B-FC08D3B24E1B}.Release|Any CPU.Build.0 = Release|Any CPU
{31DECE15-9A02-4E47-912B-FC08D3B24E1B}.Release|x64.ActiveCfg = Release|x64
{31DECE15-9A02-4E47-912B-FC08D3B24E1B}.Release|x64.Build.0 = Release|x64
{31DECE15-9A02-4E47-912B-FC08D3B24E1B}.Release|x86.ActiveCfg = Release|Any CPU
{31DECE15-9A02-4E47-912B-FC08D3B24E1B}.Release|x86.Build.0 = Release|Any CPU
{31DECE15-9A02-4E47-912B-FC08D3B24E1B}.Template|Any CPU.ActiveCfg = Release|Any CPU
{31DECE15-9A02-4E47-912B-FC08D3B24E1B}.Template|Any CPU.Build.0 = Release|Any CPU
{31DECE15-9A02-4E47-912B-FC08D3B24E1B}.Template|x64.ActiveCfg = Release|x64
{31DECE15-9A02-4E47-912B-FC08D3B24E1B}.Template|x64.Build.0 = Release|x64
{31DECE15-9A02-4E47-912B-FC08D3B24E1B}.Template|x86.ActiveCfg = Debug|x86
{31DECE15-9A02-4E47-912B-FC08D3B24E1B}.Template|x86.Build.0 = Debug|x86
{13D6143E-C01D-4E1B-A769-032F669CF725}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{13D6143E-C01D-4E1B-A769-032F669CF725}.Debug|Any CPU.Build.0 = Debug|Any CPU
{13D6143E-C01D-4E1B-A769-032F669CF725}.Debug|x64.ActiveCfg = Debug|Any CPU
@ -1017,7 +997,6 @@ Global
{4CBFA9EA-B504-4893-AE68-B931C8EFF249} = {93CB9A86-F838-4498-B5EB-AB0A5EE42106}
{7FF25D59-5262-40A2-8A9D-CC8B7450F3B4} = {EE6B9914-CE4E-467D-9DAF-A343701EF4A0}
{D4151068-F1A4-4A8F-94E1-C1C05D986C71} = {A86F8C9A-DC31-4BDB-ADAD-41F08A3F9E43}
{31DECE15-9A02-4E47-912B-FC08D3B24E1B} = {A86F8C9A-DC31-4BDB-ADAD-41F08A3F9E43}
{13D6143E-C01D-4E1B-A769-032F669CF725} = {EE6B9914-CE4E-467D-9DAF-A343701EF4A0}
{7E07DDCE-003F-4C6E-98D5-74A71E8C1770} = {AFAA0841-BD93-466F-B8F4-FB4EEC86F1FC}
{840AC814-E360-40DF-BA25-0ABD7D9E2898} = {7E07DDCE-003F-4C6E-98D5-74A71E8C1770}
@ -1055,7 +1034,7 @@ Global
{43E4AAB5-FE6F-FF22-8A2C-98632C151F3C} = {A49CD7CD-52BA-48F3-83D5-D6CA072F8849}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B516B1E8-1CEC-4BCC-BA92-93CB32845E37}
VisualSVNWorkingCopyRoot = .
SolutionGuid = {B516B1E8-1CEC-4BCC-BA92-93CB32845E37}
EndGlobalSection
EndGlobal

View File

@ -2,7 +2,6 @@
using Abp.Extensions;
using Abp.Runtime.Validation;
using Abp.UI;
using iTextSharp.text;
using MongoDB.Bson;
using System;
using System.Collections.Generic;

View File

@ -85,7 +85,7 @@ namespace YunDa.SOMS.Application.Core.Configuration
/// 是否在上传主站时压缩图片
/// </summary>
public bool IsCpmpressImageForMasterStation { get; set; }
public IConfiguration AppConfiguration { get => throw new System.NotImplementedException(); set => throw new System.NotImplementedException(); }
public IConfiguration AppConfiguration { get; set ; }
/// <summary>
/// 获取url组合

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Platforms>AnyCPU;x64;x86</Platforms>
</PropertyGroup>
@ -14,13 +14,13 @@
<ItemGroup>
<PackageReference Include="Abp.AspNetCore" Version="7.4.0" />
<PackageReference Include="Abp.AspNetCore.SignalR" Version="7.4.0" />
<PackageReference Include="iTextSharp" Version="5.5.13.3" />
<PackageReference Include="NPOI" Version="2.5.6" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.2.3" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" />
<PackageReference Include="iText7" Version="8.0.5" />
<PackageReference Include="NPOI" Version="2.7.2" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="7.2.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="7.2.0" />
<PackageReference Include="Net.Codecrete.QrCodeGenerator" Version="2.0.4" />
<PackageReference Include="NetMQ" Version="4.0.1.6" />
<PackageReference Include="SkiaSharp" Version="2.88.6" />
<PackageReference Include="NetMQ" Version="4.0.1.13" />
<PackageReference Include="SkiaSharp" Version="2.88.9" />
</ItemGroup>
<ItemGroup>

View File

@ -3,7 +3,6 @@ using Abp.Domain.Repositories;
using Abp.Domain.Uow;
using Abp.Web.Mvc.Alerts;
using Google.Protobuf.WellKnownTypes;
using iTextSharp.text.pdf.parser;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using MongoDB.Bson;
@ -520,12 +519,25 @@ namespace YunDa.SOMS.Application.GeneralInformation.SettingAndFaultRpt
var lastData = mongoToData.LastOrDefault();
strtime = (lastData.DateTime + TimeSpan.FromMinutes(5)).ToString("HH:mm");
}
List<AlertData> dzList = default;
try
{
var str = HttpHelper.HttpGetRequest<object>(url + $"?faultRpt=GetFaultRptByTime|{date} {strtime}|{date} 23:59");
JObject wrappedObject = JObject.Parse(str.ToString());
var contentString = wrappedObject["content"].ToString();
var dzList = JsonConvert.DeserializeObject<List<AlertData>>(contentString);
dzList = JsonConvert.DeserializeObject<List<AlertData>>(contentString);
}
catch (Exception ex)
{
Log4Helper.Error(this.GetType(), "获取故障报告聚合报告超时", ex);
}
List<FaultReport> faultReports = new List<FaultReport>();
// 从Content中提取故障序号并赋值给SeqNo
if (dzList!=null)
{
foreach (var alert in dzList)
{
FaultReport faultReport = new FaultReport
@ -544,6 +556,8 @@ namespace YunDa.SOMS.Application.GeneralInformation.SettingAndFaultRpt
faultReport.SeqNo = ExtractFaultSequenceNumber(alert.Content);
faultReports.Add(faultReport);
}
}
var resData = GroupFaultReports(faultReports);
foreach (var group in resData)
@ -578,7 +592,6 @@ namespace YunDa.SOMS.Application.GeneralInformation.SettingAndFaultRpt
}
}
InsertGroups(resData, targetDate);
mongoToData.AddRange(resData);
var tempData = mongoToData.Where(t => t.AlertType == alertType);

View File

@ -1,5 +1,4 @@
using Abp.Domain.Repositories;
using iTextSharp.text;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System;

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>8.0</LangVersion>
<AssemblyName>YunDa.SOMS.Application</AssemblyName>
<PackageId>YunDa.SOMS.Application</PackageId>

View File

@ -0,0 +1,58 @@
using AutoMapper;
using System;
using System.Linq;
namespace YunDa.SOMS.DataTransferObject
{
/// <summary>
/// Custom AutoMapper profile to handle Guid mapping issues and prevent MaxInteger constraint violations
/// </summary>
public class SOMSAutoMapperProfile : Profile
{
public SOMSAutoMapperProfile()
{
// Configure custom mappings to prevent extension method discovery issues
// Explicitly handle Guid conversions to prevent MaxInteger constraint violations
CreateMap<Guid, string>().ConvertUsing(guid => guid.ToString());
CreateMap<string, Guid>().ConvertUsing(str => ConvertStringToGuid(str));
CreateMap<Guid?, string>().ConvertUsing(guid => ConvertNullableGuidToString(guid));
CreateMap<string, Guid?>().ConvertUsing(str => ConvertStringToNullableGuid(str));
// Prevent issues with nullable Guid collections
CreateMap<Guid[], string[]>().ConvertUsing(guids => ConvertGuidArrayToStringArray(guids));
CreateMap<string[], Guid[]>().ConvertUsing(strings => ConvertStringArrayToGuidArray(strings));
}
private static Guid ConvertStringToGuid(string str)
{
if (Guid.TryParse(str, out var guid))
return guid;
return Guid.Empty;
}
private static string ConvertNullableGuidToString(Guid? guid)
{
return guid?.ToString();
}
private static Guid? ConvertStringToNullableGuid(string str)
{
if (string.IsNullOrEmpty(str))
return null;
if (Guid.TryParse(str, out var guid))
return guid;
return null;
}
private static string[] ConvertGuidArrayToStringArray(Guid[] guids)
{
return guids?.Select(g => g.ToString()).ToArray();
}
private static Guid[] ConvertStringArrayToGuidArray(string[] strings)
{
return strings?.Select(s => ConvertStringToGuid(s)).ToArray();
}
}
}

View File

@ -1,6 +1,9 @@
using Abp.AutoMapper;
using Abp.Modules;
using Abp.Reflection.Extensions;
using AutoMapper;
using System;
using System.Diagnostics;
namespace YunDa.SOMS.DataTransferObject
{
@ -16,7 +19,28 @@ namespace YunDa.SOMS.DataTransferObject
Configuration.Modules.AbpAutoMapper().Configurators.Add(
// Scan the assembly for classes which inherit from AutoMapper.Profile
cfg => cfg.AddMaps(thSOMSsembly)
cfg =>
{
try
{
// Add our custom profile first to handle Guid mappings
cfg.AddProfile<SOMSAutoMapperProfile>();
// Try to add maps from assembly with error handling
cfg.AddMaps(thSOMSsembly);
}
catch (ArgumentException ex) when (ex.Message.Contains("MaxInteger") || ex.Message.Contains("violates the constraint"))
{
// Handle MaxInteger constraint violation gracefully
Debug.WriteLine($"AutoMapper MaxInteger constraint issue: {ex.Message}");
// Only use our custom profile if assembly scanning fails
}
catch (Exception ex)
{
Debug.WriteLine($"AutoMapper configuration error: {ex.Message}");
// Continue with just the custom profile
}
}
);
}
}

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
@ -40,7 +40,7 @@
</ItemGroup>
<ItemGroup>
<!-- MessagePack for .NET 6.0 -->
<PackageReference Include="MessagePack" Version="2.5.140" />
<PackageReference Include="MessagePack" Version="2.5.187" />
<PackageReference Include="Microsoft.AspNetCore.Http.Features" Version="5.0.17" />
</ItemGroup>
</Project>

View File

@ -84,6 +84,11 @@
完整统计信息
</summary>
</member>
<member name="T:YunDa.SOMS.DataTransferObject.SOMSAutoMapperProfile">
<summary>
Custom AutoMapper profile to handle Guid mapping issues and prevent MaxInteger constraint violations
</summary>
</member>
<member name="P:YunDa.SOMS.DataTransferObject.ClientConfigruation.ThreeDimension.EditHomePageSettingInput.Content">
<summary>
内容

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Platforms>AnyCPU;x64;x86</Platforms>
<NoWarn>1701;1702;1591;0414</NoWarn>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Platforms>AnyCPU;x64;x86</Platforms>
<NoWarn>1701;1702;1591</NoWarn>

View File

@ -1,6 +1,5 @@
using Abp.Web.Mvc.Alerts;
using Google.Protobuf.WellKnownTypes;
using iTextSharp.text.pdf.parser;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>YunDa.SOMS.MongoDB.Application</AssemblyName>
<PackageId>YunDa.SOMS.MongoDB.Application</PackageId>
<RootNamespace>YunDa.SOMS.MongoDB.Application</RootNamespace>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>YunDa.SOMS.Core</AssemblyName>
<PackageId>YunDa.SOMS.Core</PackageId>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
@ -14,19 +14,19 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Abp" Version="7.4.0" />
<PackageReference Include="Abp.AutoMapper" Version="7.4.0" />
<PackageReference Include="Castle.Core" Version="4.4.1" />
<PackageReference Include="Abp" Version="9.4.2" />
<PackageReference Include="Abp.AutoMapper" Version="9.4.2" />
<PackageReference Include="Castle.Core" Version="5.1.1" />
<PackageReference Include="log4net" Version="3.0.3" />
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0" />
</ItemGroup>
</Project>

View File

@ -2,19 +2,25 @@
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>8.0</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<!-- EF Core SQLite 提供程序 -->
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.25" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.15" />
<!-- EF Core 设计时工具包 -->
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.25" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.15">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<!-- 可选EF Core 工具包 -->
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.25" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.15">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
</Project>

View File

@ -2,18 +2,24 @@
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<!-- EF Core SQLite 提供程序 -->
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.25" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.15" />
<!-- EF Core 设计时工具包 -->
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.25" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.15">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<!-- 可选EF Core 工具包 -->
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.25" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.15">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
</Project>

View File

@ -2,19 +2,25 @@
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>8.0</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<!-- EF Core SQLite 提供程序 -->
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.25" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.15" />
<!-- EF Core 设计时工具包 -->
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.25" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.15">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<!-- 可选EF Core 工具包 -->
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.25" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.15">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
</Project>

View File

@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<NuGetAudit>False</NuGetAudit>
</PropertyGroup>
@ -11,16 +11,16 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'" />
<ItemGroup>
<PackageReference Include="Abp" Version="7.4.0" />
<PackageReference Include="Abp.EntityFrameworkCore" Version="7.4.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.25" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.25" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.25">
<PackageReference Include="Abp" Version="9.4.2" />
<PackageReference Include="Abp.EntityFrameworkCore" Version="9.4.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.15" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.15" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.15">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="6.0.0" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="6.0.2" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="8.0.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\YunDa.Core\YunDa.SOMS.Core\YunDa.SOMS.Core.csproj" />

View File

@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Platforms>AnyCPU;x64;x86</Platforms>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Abp" Version="7.4.0" />
<PackageReference Include="MongoDB.Bson" Version="2.13.1" />
<PackageReference Include="Abp" Version="9.4.2" />
<PackageReference Include="MongoDB.Bson" Version="2.30.0" />
<PackageReference Include="MySql.Data.EntityFrameworkCore" Version="8.0.22" />
</ItemGroup>
<ItemGroup>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>YunDa.SOMS</RootNamespace>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
@ -26,21 +26,21 @@
</ItemGroup>
<ItemGroup>
<!-- ABP EntityFrameworkCore -->
<PackageReference Include="Abp.EntityFrameworkCore" Version="7.4.0" />
<PackageReference Include="Abp.EntityFrameworkCore" Version="9.4.2" />
<!-- EF Core 6.0的工具包 -->
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.25">
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.15">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.25">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.15">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<!-- Pomelo MySQL 与 EF Core 6.0兼容的版本 -->
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="6.0.2" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="8.0.2" />
</ItemGroup>
</Project>

View File

@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Platforms>AnyCPU;x64;x86</Platforms>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MongoDB.Driver" Version="2.24.0" />
<PackageReference Include="MongoDB.Driver" Version="2.30.0" />
</ItemGroup>
<ItemGroup>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<ItemGroup>

View File

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\YunDa.Core\YunDa.SOMS.Core\YunDa.SOMS.Core.csproj" />
@ -8,6 +8,6 @@
<ProjectReference Include="..\YunDa.SOMS.Redis.Entities\YunDa.SOMS.Redis.Entities.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="StackExchange.Redis" Version="2.2.50" />
<PackageReference Include="StackExchange.Redis" Version="2.8.16" />
</ItemGroup>
</Project>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Platforms>AnyCPU;x64;x86</Platforms>
<PlatformTarget>AnyCPU</PlatformTarget>
@ -11,6 +11,6 @@
<ProjectReference Include="..\..\YunDa.Core\YunDa.SOMS.Core\YunDa.SOMS.Core.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="MongoDB.Bson" Version="2.13.1" />
<PackageReference Include="MongoDB.Bson" Version="2.30.0" />
</ItemGroup>
</Project>

View File

@ -1,7 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>`n <LangVersion>8.0</LangVersion>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>8.0</LangVersion>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<ApplicationIcon />
<OutputType>Exe</OutputType>
@ -51,7 +52,7 @@
<!-- Microsoft.Extensions.Logging for .NET Core 3.1 -->
<PackageReference Include="Castle.Windsor.MsDependencyInjection" Version="3.4.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.16" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
</ItemGroup>
<ProjectExtensions>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Worker">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<UserSecretsId>dotnet-RunMongoDB-F084529C-6E8B-44A8-BE09-0A65470BDFBE</UserSecretsId>
<ApplicationIcon />
<OutputType>Exe</OutputType>

View File

@ -8,7 +8,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Platform>Any CPU</Platform>
<PublishDir>D:\SOMS\内存数据库</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>true</SelfContained>
<PublishSingleFile>true</PublishSingleFile>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>8.0</LangVersion>
<UserSecretsId>dotnet-RunRedis-A18FAF4A-2F80-402E-8246-728465033F11</UserSecretsId>
<ApplicationIcon />

View File

@ -404,9 +404,12 @@ namespace RunRedis.Services
UseShellExecute = false,
RedirectStandardOutput = true,
RedirectStandardError = true,
RedirectStandardInput = true
RedirectStandardInput = true,
WorkingDirectory ="./"
};
#if DEBUG
processStartInfo.WorkingDirectory = System.AppDomain.CurrentDomain.BaseDirectory;
#endif
process = Process.Start(processStartInfo);
var outputBuilder = new StringBuilder();
var errorBuilder = new StringBuilder();

View File

@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows7.0</TargetFramework>
<TargetFramework>net8.0-windows7.0</TargetFramework>
<LangVersion>8.0</LangVersion>
<UseWPF>true</UseWPF>
<UseWindowsForms>true</UseWindowsForms>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>8.0</LangVersion>
<RootNamespace>JDYD.IEC104</RootNamespace>
<AssemblyName>JDYD.IEC104</AssemblyName>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>8.0</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>
@ -11,12 +11,12 @@
<PackageReference Include="DotNetty.Codecs" Version="0.7.5" />
<PackageReference Include="DotNetty.Codecs.Http" Version="0.7.5" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.2" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="StackExchange.Redis" Version="2.6.122" />
<PackageReference Include="MessagePack" Version="2.5.140" />
<PackageReference Include="StackExchange.Redis" Version="2.8.16" />
<PackageReference Include="MessagePack" Version="2.5.187" />
</ItemGroup>
<ItemGroup>

View File

@ -85,7 +85,7 @@ public class WebApiConfiguration
/// <summary>
/// Web API端口
/// </summary>
public int Port { get; set; } = 56670;
public int Port { get; set; } = 38094;
/// <summary>
/// 查询超时时间(秒)

View File

@ -51,7 +51,7 @@ namespace YunDa.Server.ISMSTcp.Controllers
{
try
{
_logger.LogInformation("收到查询请求 - dz:{Dz}, faultRpt:{FaultRpt}, waveCfg:{WaveCfg}, waveDat:{WaveDat}, version:{Version}",
_logger.LogError("收到查询请求 - dz:{Dz}, faultRpt:{FaultRpt}, waveCfg:{WaveCfg}, waveDat:{WaveDat}, version:{Version}",
dz, faultRpt, waveCfg, waveDat, version);
WebResult<object> result;

View File

@ -113,6 +113,7 @@ namespace YunDa.Server.ISMSTcp.Services
{
try
{
return true;
var commState = await GetDeviceCommunicationStateAsync(deviceId, cancellationToken);
// 如果未找到状态信息,默认认为通信异常

View File

@ -211,7 +211,7 @@ namespace YunDa.Server.ISMSTcp.Services
// 使用映射字典查找对应的haskey列表
if (!_ycIdToHashKeysMapping.TryGetValue(ycDataModel.YC_ID, out List<string> haskeys))
{
_logger.LogWarning("未找到YC_ID {YcId} 对应的映射", ycDataModel.YC_ID);
//_logger.LogWarning("未找到YC_ID {YcId} 对应的映射", ycDataModel.YC_ID);
return;
}

View File

@ -32,7 +32,7 @@ namespace YunDa.Server.ISMSTcp.Services
_tcpClient = tcpClient;
_logger = logger;
}
int _yxCount = 0;
/// <summary>
/// 执行定时任务
/// </summary>
@ -100,6 +100,8 @@ namespace YunDa.Server.ISMSTcp.Services
// 构造召唤命令CallYCByDevice|{装置ID}
string command = $"CallYCByDevice|{device.Id}";
// 发送命令到TCP客户端
bool tcpResult = await _tcpClient.SendMessageAsync(command);
if (tcpResult)
@ -113,6 +115,17 @@ namespace YunDa.Server.ISMSTcp.Services
failedDevices.Add($"{device.Id}({device.DeviceName})");
_logger.LogWarning("通过TCP客户端发送命令失败装置: {DeviceId} ({DeviceName})", device.Id, device.DeviceName);
}
await Task.Delay(100);
if (_yxCount == 0)
{
string command1 = $"CallYXByDevice|{device.Id}";
tcpResult = await _tcpClient.SendMessageAsync(command);
}
_yxCount++;
if (_yxCount>10)
{
_yxCount = 0;
}
// 每个命令之间间隔100毫秒
await Task.Delay(100);

View File

@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>8.0</LangVersion>
<Nullable>enable</Nullable>
<AssemblyName>ISMS通信网关</AssemblyName>
@ -17,8 +17,8 @@
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Hosting" Version="2.2.7" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />

View File

@ -47,7 +47,7 @@
"DefaultDatabaseIndex": 0
},
"WebApi": {
"Port": 56670,
"Port": 38094,
"QueryTimeoutSeconds": 180,
"EnableCors": true,
"AllowedOrigins": [ "*" ]

View File

@ -31,7 +31,7 @@
},
"ScheduledTelemetry": {
"Enabled": true,
"IntervalMinutes": 5,
"IntervalMinutes": 60,
"MaxRetries": 10,
"RetryDelayMs": 2000,
"CommandDelayMs": 100

View File

@ -139,7 +139,22 @@ namespace Yunda.SOMS.DataMonitoringServer
{
Configuration.Modules.AbpAutoMapper().Configurators.Add(cfg =>
{
try
{
// Disable extension method discovery to prevent MaxInteger constraint violation
cfg.Advanced.AllowAdditiveTypeMapCreation = false;
cfg.AddMaps(typeof(SOMSDataMonitoringServerModule).GetAssembly());
}
catch (System.ArgumentException ex) when (ex.Message.Contains("MaxInteger") || ex.Message.Contains("violates the constraint"))
{
// Handle MaxInteger constraint violation gracefully
System.Diagnostics.Debug.WriteLine($"AutoMapper MaxInteger constraint issue in DataMonitoringServer: {ex.Message}");
// Continue without the problematic mappings
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"AutoMapper configuration error in DataMonitoringServer: {ex.Message}");
}
});
}

View File

@ -4,7 +4,7 @@
</PropertyGroup>
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows7.0</TargetFramework>
<TargetFramework>net8.0-windows7.0</TargetFramework>
<UseWPF>true</UseWPF>
<Platforms>AnyCPU;x64;x86</Platforms>
<ApplicationIcon>serviceIcon.ico</ApplicationIcon>
@ -143,11 +143,9 @@
<PackageReference Include="Castle.Windsor.MsDependencyInjection" Version="3.4.0" />
<!-- Microsoft.Extensions.Caching.Memory: 内存缓存支持,与 .NET 6.0 兼容,使用安全版本 -->
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="6.0.33" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="8.0.1" />
<!-- ABP 核心包,确保依赖注入正常工作 -->
<PackageReference Include="Abp" Version="7.4.0" />
<PackageReference Include="Abp.AutoMapper" Version="7.4.0" />
</ItemGroup>

View File

@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AssemblyName>Yunda.SOMS.IEC104.ConsoleApp</AssemblyName>
@ -39,10 +39,7 @@
<!-- 构建后任务:确保配置文件正确复制 -->
<Target Name="PostBuildCopyConfig" AfterTargets="PostBuildEvent">
<Message Text="正在复制IEC104控制台配置文件..." Importance="high" />
<Copy SourceFiles="$(ProjectDir)appsettings.json"
DestinationFiles="$(OutputPath)appsettings.iec104console.json"
OverwriteReadOnlyFiles="true"
SkipUnchangedFiles="false" />
<Copy SourceFiles="$(ProjectDir)appsettings.json" DestinationFiles="$(OutputPath)appsettings.iec104console.json" OverwriteReadOnlyFiles="true" SkipUnchangedFiles="false" />
</Target>
</Project>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>8.0</LangVersion>
<Platforms>AnyCPU;x64</Platforms>
<PlatformTarget>AnyCPU</PlatformTarget>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
</Project>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Platforms>AnyCPU;x64</Platforms>
<PlatformTarget>AnyCPU</PlatformTarget>
<NuGetAudit>True</NuGetAudit>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Platforms>AnyCPU;x64;x86</Platforms>
<DefineConstants Condition="'$(Platform)'=='x86'">TRACE;Is32Bit</DefineConstants>
<DefineConstants Condition="'$(PlatformTarget)'=='x86'">TRACE;Is32Bit</DefineConstants>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>8.0</LangVersion>
<Platforms>AnyCPU;x64</Platforms>
</PropertyGroup>
@ -24,10 +24,10 @@
<PackageReference Include="DotNetty.Handlers" Version="0.6.0" />
<PackageReference Include="DotNetty.Transport" Version="0.6.0" />
<PackageReference Include="DotNetty.Transport.Libuv" Version="0.6.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
</Project>

View File

@ -1,11 +1,11 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
COPY ["src/YunDa.Web/YunDa.ISAS.ExternalInteraction.WebApi/YunDa.ISAS.ExternalInteraction.WebApi.csproj", "src/YunDa.Web/YunDa.ISAS.ExternalInteraction.WebApi/"]
RUN dotnet restore "src/YunDa.Web/YunDa.ISAS.ExternalInteraction.WebApi/YunDa.ISAS.ExternalInteraction.WebApi.csproj"

View File

@ -95,7 +95,7 @@
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="8.0.5" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.15" />
</ItemGroup>
</Project>

View File

@ -3,7 +3,7 @@
<PropertyGroup>
<LangVersion>10.0</LangVersion>
<GenerateGlobalUsings>false</GenerateGlobalUsings>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>disable</ImplicitUsings>
<OutputType>WinExe</OutputType>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>YunDa.SOMS.Web.Core</AssemblyName>
<PackageId>YunDa.SOMS.Web.Core</PackageId>
<UserSecretsId>YunDa-SOMS-5F9F2126-6913-40F7-BB3E-166FB37D0539</UserSecretsId>
@ -13,7 +13,7 @@
<!-- 使用与 .NET 6.0 兼容的 ABP 版本 -->
<!-- 使用 .NET 6.0 支持的 ASP.NET Core 包版本 -->
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.15" />
<!-- SignalR 支持 - 使用 .NET 6.0 内置版本 -->
<!-- SignalR 已包含在 ASP.NET Core 6.0 框架中,无需额外引用 -->

View File

@ -1,20 +0,0 @@
FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-buster-slim AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build
WORKDIR /src
COPY ["src/YunDa.Web/YunDa.SOMS.Web.Host/YunDa.SOMS.Web.Host.csproj", "src/YunDa.Web/YunDa.SOMS.Web.Host/"]
RUN dotnet restore "src/YunDa.Web/YunDa.SOMS.Web.Host/YunDa.SOMS.Web.Host.csproj"
COPY . .
WORKDIR "/src/src/YunDa.Web/YunDa.SOMS.Web.Host"
RUN dotnet build "YunDa.SOMS.Web.Host.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "YunDa.SOMS.Web.Host.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "YunDa.SOMS.Web.Host.dll"]

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<DockerfileContext>..\..\..</DockerfileContext>
@ -23,9 +23,6 @@
<ItemGroup>
<None Include="app.config" />
<None Update="Dockerfile">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="log4net.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>

View File

@ -1,8 +1,8 @@
FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-buster-slim AS base
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
WORKDIR /app
EXPOSE 80
FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
COPY ["src/YunDa.Web/YunDa.SOMS.Web.MVC/YunDa.SOMS.Web.MVC.csproj", "src/YunDa.Web/YunDa.SOMS.Web.MVC/"]
RUN dotnet restore "src/YunDa.Web/YunDa.SOMS.Web.MVC/YunDa.SOMS.Web.MVC.csproj"

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<AssemblyName>SOMS后台服务</AssemblyName>
<OutputType>WinExe</OutputType>
@ -229,9 +229,6 @@
<None Include="wwwroot\js\plugins\webuploader\webuploader.nolog.min.js" />
<None Include="wwwroot\js\plugins\webuploader\webuploader.withoutimage.js" />
<None Include="wwwroot\js\plugins\webuploader\webuploader.withoutimage.min.js" />
<None Update="Dockerfile">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="log4net.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>

View File

@ -13,7 +13,7 @@
"IsmsBaseDatabaseType": "MySQL"
},
"ConnectionStrings": {
"MysqlSetting": "server=192.168.81.22;port=3306;uid=root;pwd=123456; Database=soms_sys_db;SslMode=none;Max Pool Size=200;Connection Timeout=60;Pooling=True; ",
"MysqlSetting": "server=127.0.0.1;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.65.33;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.110.161;User ID=sa;Password=sa;Database=ISMS_BASE;Trusted_Connection=False;TrustServerCertificate=True;Max Pool Size=200;Connection Timeout=60;",
@ -23,7 +23,7 @@
"ISMS_ReportServerTempDBSqlServerSetting": "Server=192.168.110.161;User ID=sa;Password=sa;Database=ReportServerTempDB;Trusted_Connection=False;TrustServerCertificate=True",
"MongoDBSetting": {
"Host": "192.168.81.22",
"Host": "127.0.0.1",
"Port": "37017",
"DatabaseName": "soms_mongodb",
"IsAuth": "false",
@ -31,7 +31,7 @@
"PassWord": "123456"
},
"RedisSetting": {
"Host": "192.168.81.22",
"Host": "127.0.0.1",
"Port": "36379",
"Auth": "yunda123",
"Name": "",

View File

@ -15,14 +15,14 @@
"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=60;Pooling=True; ",
"ISMS_BASE_MysqlSetting": "server=192.168.65.33;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=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",
"Host": "192.168.81.22",
"Port": "37017",
"DatabaseName": "soms_mongodb",
"IsAuth": "false",
@ -30,7 +30,7 @@
"PassWord": "123456"
},
"RedisSetting": {
"Host": "127.0.0.1",
"Host": "192.168.81.22",
"Port": "36379",
"Auth": "yunda123",
"Name": "",
@ -47,7 +47,7 @@
"DataMonitoringServiceBaseUrl": "http://127.0.0.1:8093/SOMS/api/dataMonitoringService/",
"MaxDataCount": 80000,
"Swagger": true,
"IsmsGateWayIp": "http://127.0.0.1:38094",
"IsmsGateWayIp": "http://192.168.81.22:56670",
"IsmsftpIp": "192.168.65.33:48021",
"IsmsftpUserName": "admin",
"IsmsftpPassword": "yunda123",
@ -66,11 +66,11 @@
},
"Kestrel": {
"System.GC.Server": false,
"EndPoints": {
"Http": {
"Url": "http://0.0.0.0:38090"
}
}
},
"App": {

View File

@ -1,33 +0,0 @@
using Microsoft.AspNetCore.Mvc;
namespace YundDa.SOMS.Iec104Client.Controllers
{
[ApiController]
[Route("[controller]")]
public class WeatherForecastController : ControllerBase
{
private static readonly string[] Summaries = new[]
{
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
};
private readonly ILogger<WeatherForecastController> _logger;
public WeatherForecastController(ILogger<WeatherForecastController> logger)
{
_logger = logger;
}
[HttpGet(Name = "GetWeatherForecast")]
public IEnumerable<WeatherForecast> Get()
{
return Enumerable.Range(1, 5).Select(index => new WeatherForecast
{
Date = DateTime.Now.AddDays(index),
TemperatureC = Random.Shared.Next(-20, 55),
Summary = Summaries[Random.Shared.Next(Summaries.Length)]
})
.ToArray();
}
}
}

View File

@ -1,35 +0,0 @@
namespace YundDa.SOMS.Iec104Client
{
public class Program
{
public static void Main(string[] args)
{
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
app.UseHttpsRedirection();
app.UseAuthorization();
app.MapControllers();
app.Run();
}
}
}

View File

@ -1,31 +0,0 @@
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:62546",
"sslPort": 44394
}
},
"profiles": {
"YundDa.SOMS.Iec104Client": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "https://localhost:7286;http://localhost:5286",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

View File

@ -1,13 +0,0 @@
namespace YundDa.SOMS.Iec104Client
{
public class WeatherForecast
{
public DateTime Date { get; set; }
public int TemperatureC { get; set; }
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
public string? Summary { get; set; }
}
}

View File

@ -1,13 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Swashbuckle.AspNetCore" Version="7.0.0" />
</ItemGroup>
</Project>

View File

@ -1,8 +0,0 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}

View File

@ -1,9 +0,0 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}

View File

@ -1,4 +1,4 @@
# .NET 6.0 开发规范 (基于ASP.NET Boilerplate)
# .NET 8.0 开发规范 (基于ASP.NET Boilerplate)
## 📁 项目结构
@ -392,5 +392,64 @@ public class UserAppService : SOMSAppServiceBase
## 📚 参考文档
- [ASP.NET Boilerplate官方文档](https://aspnetboilerplate.com/Pages/Documents)
- .NET 6.0 官方文档
- .NET 8.0 官方文档
- C# 编程指南
# Project Structure & Architecture
- YunDa.SOMS follows a layered architecture with Application, Domain, Infrastructure, and Web.MVC layers
- Application layer handles DTO conversion, business coordination, and API interfaces
- Domain layer contains pure business logic, entity definitions, and domain services
- Infrastructure layer manages data access and external service calls
- Web.MVC layer handles frontend pages, controllers, and views
# Technology Stack
- .NET 8.0 with ASP.NET Boilerplate framework
- MySQL for configuration data storage
- MongoDB for record data storage
- Redis for data sharing and caching
# Coding Standards
- Classes use PascalCase (UserManagementAppService)
- Interfaces use I + PascalCase (IUserManagementAppService)
- Async methods end with Async suffix
- Variables use camelCase, private fields have underscore prefix (_userRepository)
- Constants use UPPER_SNAKE_CASE (DEFAULT_USER_ROLE)
- Backend uses PascalCase for properties, frontend uses camelCase
# Best Practices
- All AppServices should inherit from SOMSAppServiceBase
- Use dependency injection via constructor
- Implement proper exception handling with BusinessException, ValidationException
- Use Log4Helper for logging with appropriate levels (Info, Warning, Error)
- Leverage C# 8.0+ features like nullable reference types, switch expressions
- User prefers processing raw JSON strings directly for camelCase conversion rather than converting to objects first, as it's more efficient
# Async Programming
- Always use async/await for asynchronous operations
- Include CancellationToken parameter with default value
- Use ConfigureAwait(false) for better performance
- Return Task<RequestResult<T>> for async methods
# AppService Patterns
- Implement standard try/catch blocks in AppService methods
- Follow CRUD template for standard operations
- Validate inputs before processing
- Use ObjectMapper for entity-to-DTO conversion
- Return RequestResult<T> with appropriate Flag and Message
- Implements data synchronization using batch creation functionality in AppServices for efficient data insertion from external REST APIs.
# Development Constraints
- No test projects needed
- No Summary.md file required
- Avoid referencing infrastructure in Domain layer
- Don't directly operate database connections in AppService
- Avoid hardcoded strings in business logic
# Redis Integration
- Alarm messages use AlarmMessage class from YunDa.SOMS.Redis.Entities
- Alarm messages require equipment-based filtering where EquipmentInfoId field determines if messages are filtered to specific equipment or sent to all clients.
# External API Integration
- YunDa.SOMS uses external API integrations with base URL configurations in Web.MVC project.
`

View File

@ -1,29 +0,0 @@
@echo off
echo ========================================
echo IEC104 Console App 独立调试测试
echo ========================================
echo.
echo 正在启动IEC104控制台应用程序调试模式...
echo 默认配置: 192.168.65.101:2410, RTU地址=1
echo.
cd YunDa.Server\Yunda.SOMS.DataMonitoringServer\bin\Debug\net6.0-windows7.0\IEC104Console\net6.0
echo 当前目录: %CD%
echo.
if exist "Yunda.SOMS.IEC104.ConsoleApp.exe" (
echo 找到可执行文件,正在启动...
echo.
Yunda.SOMS.IEC104.ConsoleApp.exe
) else (
echo 错误: 找不到 Yunda.SOMS.IEC104.ConsoleApp.exe
echo 请先编译项目: dotnet build
echo.
pause
)
echo.
echo 程序已退出
pause

View File

@ -1,42 +0,0 @@
#!/usr/bin/env pwsh
Write-Host "========================================" -ForegroundColor Green
Write-Host "IEC104 Console App 独立调试测试" -ForegroundColor Green
Write-Host "========================================" -ForegroundColor Green
Write-Host ""
Write-Host "正在启动IEC104控制台应用程序调试模式..." -ForegroundColor Yellow
Write-Host "默认配置: 192.168.65.101:2410, RTU地址=1" -ForegroundColor Yellow
Write-Host ""
# 切换到输出目录
$outputPath = "YunDa.Server\Yunda.SOMS.DataMonitoringServer\bin\Debug\net6.0-windows7.0\IEC104Console\net6.0"
Set-Location $outputPath
Write-Host "当前目录: $(Get-Location)" -ForegroundColor Cyan
Write-Host ""
$exePath = "Yunda.SOMS.IEC104.ConsoleApp.exe"
if (Test-Path $exePath) {
Write-Host "找到可执行文件,正在启动..." -ForegroundColor Green
Write-Host ""
Write-Host "提示: 在调试模式下,您可以使用以下命令:" -ForegroundColor Magenta
Write-Host " status - 显示连接状态" -ForegroundColor Magenta
Write-Host " info - 显示连接信息" -ForegroundColor Magenta
Write-Host " help - 显示帮助信息" -ForegroundColor Magenta
Write-Host " quit - 退出程序" -ForegroundColor Magenta
Write-Host ""
# 启动程序
& ".\$exePath"
} else {
Write-Host "错误: 找不到 $exePath" -ForegroundColor Red
Write-Host "请先编译项目: dotnet build" -ForegroundColor Red
Write-Host ""
Read-Host "Press any key to continue"
}
Write-Host ""
Write-Host "程序已退出" -ForegroundColor Yellow
Read-Host "Press any key to continue"

View File

@ -2,20 +2,20 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>8.0</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.25">
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.25">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="6.0.2" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="8.0.0" />
</ItemGroup>
</Project>

View File

@ -142,7 +142,7 @@ namespace ConsoleISMSMysql.Data
if (!optionsBuilder.IsConfigured)
{
#warning To protect potentially sensitive information in your connection string, you should move it out of source code. See http://go.microsoft.com/fwlink/?LinkId=723263 for guidance on storing connection strings.
optionsBuilder.UseMySql("server=192.168.81.229;port=3306;uid=root;pwd=123456;database=isms_l_base;sslmode=none", x => x.ServerVersion("8.0.15-mysql"));
optionsBuilder.UseMySql("server=192.168.81.229;port=3306;uid=root;pwd=123456;database=isms_l_base;sslmode=none", ServerVersion.Parse("8.0.15-mysql"));
}
}

View File

@ -141,7 +141,7 @@ namespace ConsoleISMSMysql.Models
if (!optionsBuilder.IsConfigured)
{
#warning To protect potentially sensitive information in your connection string, you should move it out of source code. See http://go.microsoft.com/fwlink/?LinkId=723263 for guidance on storing connection strings.
optionsBuilder.UseMySql("server=192.168.81.229;port=3306;uid=root;pwd=123456;database=isms_l_base;sslmode=none;maxpoolsize=200;connectiontimeout=60;pooling=true", x => x.ServerVersion("8.0.15-mysql"));
optionsBuilder.UseMySql("server=192.168.81.229;port=3306;uid=root;pwd=123456;database=isms_l_base;sslmode=none;maxpoolsize=200;connectiontimeout=60;pooling=true", ServerVersion.Parse("8.0.15-mysql"));
}
}

View File

@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>8.0</LangVersion>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>