dev
liulb@mesnac.com 1 year ago
parent 5a0a63646d
commit 10a9b99b28

@ -326,19 +326,84 @@
物料名称
</summary>
</member>
<member name="P:Admin.Core.Model.BaseMaterialInfo.MaterialCategOrIes">
<summary>
物料大类100-冷柜)
</summary>
</member>
<member name="P:Admin.Core.Model.BaseMaterialInfo.MaterialSubclass">
<summary>
物料小类
</summary>
</member>
<member name="P:Admin.Core.Model.BaseMaterialInfo.MaterialType">
<summary>
SAP物料类型
</summary>
</member>
<member name="P:Admin.Core.Model.BaseMaterialInfo.MaterialUnit">
<summary>
SAP物料类型
</summary>
</member>
<member name="P:Admin.Core.Model.BaseMaterialInfo.MaterialMatkl">
<summary>
物料组
</summary>
</member>
<member name="P:Admin.Core.Model.BaseMaterialInfo.MaterialSpecifications">
<summary>
物料型号
</summary>
</member>
<member name="P:Admin.Core.Model.BaseMaterialInfo.PlantCode">
<summary>
所属工厂
</summary>
</member>
<member name="P:Admin.Core.Model.BaseMaterialInfo.ProductLineCode">
<summary>
产线工位
</summary>
</member>
<member name="P:Admin.Core.Model.BaseMaterialInfo.IsFlag">
<summary>
是否标识
</summary>
</member>
<member name="P:Admin.Core.Model.BaseMaterialInfo.CreateBy">
<summary>
是否标识
</summary>
</member>
<member name="P:Admin.Core.Model.BaseMaterialInfo.CreateTime">
<summary>
创建时间
</summary>
</member>
<member name="P:Admin.Core.Model.BaseMaterialInfo.UpdateBy">
<summary>
修改人
</summary>
</member>
<member name="P:Admin.Core.Model.BaseMaterialInfo.UpdateTime">
<summary>
修改时间
</summary>
</member>
<member name="P:Admin.Core.Model.BaseMaterialInfo.IncrementDate">
<summary>
增量日期
</summary>
</member>
<member name="P:Admin.Core.Model.BaseMaterialInfo.InboundDirection">
<summary>
入库方向-A/B
</summary>
</member>
<member name="P:Admin.Core.Model.BaseMaterialInfo.MaterialType">
<member name="P:Admin.Core.Model.BaseMaterialInfo.Dispo">
<summary>
物料sap类型FERT成品
SAP计划员100=成品;200=箱体;300=门体)
</summary>
</member>
<member name="T:Admin.Core.Model.Model_New.BaseOrderInfo">
@ -3223,7 +3288,12 @@
</member>
<member name="P:Admin.Core.Model.SmSyncModel.SmModel">
<summary>
设备设置型号
同步型号
</summary>
</member>
<member name="P:Admin.Core.Model.SmSyncModel.MaterialSpecifications">
<summary>
设置型号
</summary>
</member>
<member name="P:Admin.Core.Model.SmSyncModel.SyncTime">
@ -3231,6 +3301,11 @@
同步时间
</summary>
</member>
<member name="P:Admin.Core.Model.SmSyncModel.Category">
<summary>
类别 1=>前板2=》后板
</summary>
</member>
<member name="P:Admin.Core.Model.SmSyncModel.CreateTime">
<summary>
创建时间

@ -5,20 +5,18 @@
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\Lenovo\.nuget\packages\;D:\开发工具\Visual Studio 2019\Shared\NuGetPackages;C:\Program Files\dotnet\sdk\NuGetFallbackFolder</NuGetPackageFolders>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\admin\.nuget\packages\</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.5.0</NuGetToolVersion>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.7.0</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\Lenovo\.nuget\packages\" />
<SourceRoot Include="D:\开发工具\Visual Studio 2019\Shared\NuGetPackages\" />
<SourceRoot Include="C:\Program Files\dotnet\sdk\NuGetFallbackFolder\" />
<SourceRoot Include="C:\Users\admin\.nuget\packages\" />
</ItemGroup>
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)microsoft.extensions.apidescription.server\3.0.0\build\Microsoft.Extensions.ApiDescription.Server.props" Condition="Exists('$(NuGetPackageRoot)microsoft.extensions.apidescription.server\3.0.0\build\Microsoft.Extensions.ApiDescription.Server.props')" />
<Import Project="$(NuGetPackageRoot)swashbuckle.aspnetcore\5.6.3\build\Swashbuckle.AspNetCore.props" Condition="Exists('$(NuGetPackageRoot)swashbuckle.aspnetcore\5.6.3\build\Swashbuckle.AspNetCore.props')" />
</ImportGroup>
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<PkgMicrosoft_Extensions_ApiDescription_Server Condition=" '$(PkgMicrosoft_Extensions_ApiDescription_Server)' == '' ">C:\Users\Lenovo\.nuget\packages\microsoft.extensions.apidescription.server\3.0.0</PkgMicrosoft_Extensions_ApiDescription_Server>
<PkgMicrosoft_Extensions_ApiDescription_Server Condition=" '$(PkgMicrosoft_Extensions_ApiDescription_Server)' == '' ">C:\Users\admin\.nuget\packages\microsoft.extensions.apidescription.server\3.0.0</PkgMicrosoft_Extensions_ApiDescription_Server>
</PropertyGroup>
</Project>

@ -9,9 +9,9 @@ build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = Admin.Core.Api
build_property.RootNamespace = Admin.Core.Api
build_property.ProjectDir = E:\桌面\AUCMA_SCADA\Admin.Core.Api\
build_property.ProjectDir = D:\Project\gitea\AUCMA\SCADA\Admin.Core.Api\
build_property.RazorLangVersion = 6.0
build_property.SupportLocalizedComponentNames =
build_property.GenerateRazorMetadataSourceChecksumAttributes =
build_property.MSBuildProjectDirectory = E:\桌面\AUCMA_SCADA\Admin.Core.Api
build_property.MSBuildProjectDirectory = D:\Project\gitea\AUCMA\SCADA\Admin.Core.Api
build_property._RazorSourceGeneratorDebug =

@ -7067,11 +7067,12 @@
]
},
"System.Collections.NonGeneric/4.3.0": {
"sha512": "LE/oChpRvkSi3U25u0KnJcI44JeDZ1QJCyN4qFDx2uusEypdqR24w7lKYw21eYe5esuCBuc862wRmpF63Yy1KQ==",
"sha512": "prtjIEMhGUnQq6RnPEYLpFt8AtLbp9yq2zxOSrY7KJJZrw25Fi97IzBqY7iqssbM61Ek5b8f3MG/sG1N2sN5KA==",
"type": "package",
"path": "system.collections.nongeneric/4.3.0",
"files": [
".nupkg.metadata",
".signature.p7s",
"ThirdPartyNotices.txt",
"dotnet_library_license.txt",
"lib/MonoAndroid10/_._",
@ -9804,11 +9805,12 @@
]
},
"System.Runtime.Serialization.Primitives/4.3.0": {
"sha512": "2Z5t70a2SwMsfQDp9KOclaZNyQhfIga2gppq9lIUDM1A4ohTshn4JqT7ir8bvIhXgorWKYDAr6rPzEbi/nTGKg==",
"sha512": "Wz+0KOukJGAlXjtKr+5Xpuxf8+c8739RI1C+A2BoQZT+wMCCoMDDdO8/4IRHfaVINqL78GO8dW8G2lW/e45Mcw==",
"type": "package",
"path": "system.runtime.serialization.primitives/4.3.0",
"files": [
".nupkg.metadata",
".signature.p7s",
"ThirdPartyNotices.txt",
"dotnet_library_license.txt",
"lib/MonoAndroid10/_._",
@ -11275,47 +11277,40 @@
]
},
"packageFolders": {
"C:\\Users\\Lenovo\\.nuget\\packages\\": {},
"D:\\开发工具\\Visual Studio 2019\\Shared\\NuGetPackages": {},
"C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder": {}
"C:\\Users\\admin\\.nuget\\packages\\": {}
},
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "E:\\桌面\\AUCMA_SCADA\\Admin.Core.Api\\Admin.Core.Api.csproj",
"projectUniqueName": "D:\\Project\\gitea\\AUCMA\\SCADA\\Admin.Core.Api\\Admin.Core.Api.csproj",
"projectName": "Admin.Core.Api",
"projectPath": "E:\\桌面\\AUCMA_SCADA\\Admin.Core.Api\\Admin.Core.Api.csproj",
"packagesPath": "C:\\Users\\Lenovo\\.nuget\\packages\\",
"outputPath": "E:\\桌面\\AUCMA_SCADA\\Admin.Core.Api\\obj\\",
"projectPath": "D:\\Project\\gitea\\AUCMA\\SCADA\\Admin.Core.Api\\Admin.Core.Api.csproj",
"packagesPath": "C:\\Users\\admin\\.nuget\\packages\\",
"outputPath": "D:\\Project\\gitea\\AUCMA\\SCADA\\Admin.Core.Api\\obj\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"D:\\开发工具\\Visual Studio 2019\\Shared\\NuGetPackages",
"C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder"
],
"configFilePaths": [
"C:\\Users\\Lenovo\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
"C:\\Users\\admin\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net6.0"
],
"sources": {
"https://api.nuget.org/v3/index.json": {},
"https://nuget.cnblogs.com/v3/index.json": {}
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"projectReferences": {
"E:\\桌面\\AUCMA_SCADA\\Admin.Core.Extensions\\Admin.Core.Extensions.csproj": {
"projectPath": "E:\\桌面\\AUCMA_SCADA\\Admin.Core.Extensions\\Admin.Core.Extensions.csproj"
"D:\\Project\\gitea\\AUCMA\\SCADA\\Admin.Core.Extensions\\Admin.Core.Extensions.csproj": {
"projectPath": "D:\\Project\\gitea\\AUCMA\\SCADA\\Admin.Core.Extensions\\Admin.Core.Extensions.csproj"
},
"E:\\桌面\\AUCMA_SCADA\\Admin.Core.Service\\Admin.Core.Service.csproj": {
"projectPath": "E:\\桌面\\AUCMA_SCADA\\Admin.Core.Service\\Admin.Core.Service.csproj"
"D:\\Project\\gitea\\AUCMA\\SCADA\\Admin.Core.Service\\Admin.Core.Service.csproj": {
"projectPath": "D:\\Project\\gitea\\AUCMA\\SCADA\\Admin.Core.Service\\Admin.Core.Service.csproj"
},
"E:\\桌面\\AUCMA_SCADA\\Admin.Core.Tasks\\Admin.Core.Tasks.csproj": {
"projectPath": "E:\\桌面\\AUCMA_SCADA\\Admin.Core.Tasks\\Admin.Core.Tasks.csproj"
"D:\\Project\\gitea\\AUCMA\\SCADA\\Admin.Core.Tasks\\Admin.Core.Tasks.csproj": {
"projectPath": "D:\\Project\\gitea\\AUCMA\\SCADA\\Admin.Core.Tasks\\Admin.Core.Tasks.csproj"
}
}
}
@ -11358,7 +11353,7 @@
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.202\\RuntimeIdentifierGraph.json"
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.402\\RuntimeIdentifierGraph.json"
}
}
}

@ -8,4 +8,4 @@ build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = Admin.Core.Common
build_property.ProjectDir = E:\桌面\AUCMA_SCADA\Admin.Core.Common\
build_property.ProjectDir = D:\Project\gitea\AUCMA\SCADA\Admin.Core.Common\

@ -8,4 +8,4 @@ build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = Admin.Core.EventBus
build_property.ProjectDir = E:\桌面\AUCMA_SCADA\Admin.Core.EventBus\
build_property.ProjectDir = D:\Project\gitea\AUCMA\SCADA\Admin.Core.EventBus\

@ -3,6 +3,7 @@ using Aucma.Core.RunPlc;
using log4net;
using Microsoft.AspNetCore.Builder;
using System;
using System.Threading.Tasks;
namespace Admin.Core.Extensions
{
@ -19,8 +20,12 @@ namespace Admin.Core.Extensions
{
if (Appsettings.app("Middleware", "Plc", "Enabled").ObjToBool())
{
await plc.StartMelsecMcSeverAsync();
await plc.StartSiemensSever();
await plc.StartMelsecPlcAsync();
await plc.StartSiemensPlcAsync();
Console.WriteLine("PLC 任务启动成功");
}
}
catch (Exception e)

@ -8,4 +8,4 @@ build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = Admin.Core.Extensions
build_property.ProjectDir = E:\桌面\AUCMA_SCADA\Admin.Core.Extensions\
build_property.ProjectDir = D:\Project\gitea\AUCMA\SCADA\Admin.Core.Extensions\

@ -1,3 +1,3 @@
is_global = true
build_property.RootNamespace = Admin.Core.FrameWork
build_property.ProjectDir = E:\桌面\AUCMA_SCADA\Admin.Core.FrameWork\
build_property.ProjectDir = D:\Project\gitea\AUCMA\SCADA\Admin.Core.FrameWork\

@ -8,4 +8,4 @@ build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = Admin.Core.IRepository
build_property.ProjectDir = E:\桌面\AUCMA_SCADA\Admin.Core.IRepository\
build_property.ProjectDir = D:\Project\gitea\AUCMA\SCADA\Admin.Core.IRepository\

@ -8,4 +8,4 @@ build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = Admin.Core.IService
build_property.ProjectDir = E:\桌面\AUCMA_SCADA\Admin.Core.IService\
build_property.ProjectDir = D:\Project\gitea\AUCMA\SCADA\Admin.Core.IService\

@ -30,22 +30,85 @@ namespace Admin.Core.Model
/// </summary>
[SugarColumn(ColumnName = "MATERIAL_NAME")]
public string MaterialName { get; set; }
/// <summary>
/// 物料大类100-冷柜)
/// </summary>
[SugarColumn(ColumnName = "MATERIAL_CATEGORIES")]
public string MaterialCategOrIes { get; set; }
/// <summary>
/// 物料小类
/// </summary>
[SugarColumn(ColumnName = "MATERIAL_SUBCLASS")]
public string MaterialSubclass { get; set; }
/// <summary>
/// SAP物料类型
/// </summary>
[SugarColumn(ColumnName = "MATERIAL_TYPE")]
public string MaterialType { get; set; }
/// <summary>
/// SAP物料类型
/// </summary>
[SugarColumn(ColumnName = "MATERIAL_UNIT")]
public string MaterialUnit { get; set; }
/// <summary>
/// 物料组
/// </summary>
[SugarColumn(ColumnName = "MATERIAL_MATKL")]
public string MaterialMatkl { get; set; }
/// <summary>
/// 物料型号
/// </summary>
[SugarColumn(ColumnName = "MATERIAL_SPECIFICATIONS")]
public string MaterialSpecifications { get; set; }
/// <summary>
/// 所属工厂
/// </summary>
[SugarColumn(ColumnName = "PLANT_CODE")]
public string PlantCode { get; set; }
/// <summary>
/// 产线工位
/// </summary>
[SugarColumn(ColumnName = "PRODUCTLINE_CODE")]
public string ProductLineCode { get; set; }
/// <summary>
/// 是否标识
/// </summary>
[SugarColumn(ColumnName = "IS_FLAG")]
public string IsFlag { get; set; }
/// <summary>
/// 是否标识
/// </summary>
[SugarColumn(ColumnName = "CREATED_BY")]
public string CreateBy { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[SugarColumn(ColumnName = "CREATED_TIME")]
public DateTime CreateTime { get; set; }
/// <summary>
/// 修改人
/// </summary>
[SugarColumn(ColumnName = "UPDATED_BY")]
public string UpdateBy { get; set; }
/// <summary>
/// 修改时间
/// </summary>
[SugarColumn(ColumnName = "UPDATED_TIME")]
public DateTime UpdateTime { get; set; }
/// <summary>
/// 增量日期
/// </summary>
[SugarColumn(ColumnName = "INCREMENT_DATE")]
public string IncrementDate { get; set; }
/// <summary>
/// 入库方向-A/B
/// </summary>
[SugarColumn(ColumnName = "INBOUND_DIRECTION")]
public string InboundDirection { get; set; }
/// <summary>
/// 物料sap类型FERT成品
/// SAP计划员100=成品;200=箱体;300=门体)
/// </summary>
[SugarColumn(ColumnName = "MATERIAL_TYPE")]
public string MaterialType { get; set; }
[SugarColumn(ColumnName = "DISPO")]
public string Dispo { get; set; }
}
}

@ -17,7 +17,7 @@ namespace Admin.Core.Model
/// 主键
/// </summary>
[SugarColumn(ColumnName = "OBJ_ID", IsPrimaryKey = true, OracleSequenceName = "SEQ_SMSYNCMODEL")]
public float ObjId { get; set; }
public int ObjId { get; set; }
/// <summary>
/// 产品ID
@ -26,17 +26,25 @@ namespace Admin.Core.Model
public string SmProductId { get; set; }
/// <summary>
/// 设备设置型号
/// 同步型号
/// </summary>
[SugarColumn(ColumnName = "SM_MODEL")]
public string SmModel { get; set; }
/// <summary>
/// 设置型号
/// </summary>
[SugarColumn(ColumnName = "MATERIAL_SPECIFICATIONS")]
public string MaterialSpecifications { get; set; }
/// <summary>
/// 同步时间
/// </summary>
[SugarColumn(ColumnName = "SYNC_TIME")]
public DateTime SyncTime { get; set; }
/// <summary>
/// 类别 1=>前板2=》后板
/// </summary>
[SugarColumn(ColumnName = "CATEGORY")]
public string Category { get; set; }
/// <summary>
/// 创建时间
/// </summary>

@ -8,4 +8,4 @@ build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = Admin.Core.Model
build_property.ProjectDir = E:\桌面\AUCMA_SCADA\Admin.Core.Model\
build_property.ProjectDir = D:\Project\gitea\AUCMA\SCADA\Admin.Core.Model\

@ -8,4 +8,4 @@ build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = Admin.Core.RealTimeService
build_property.ProjectDir = E:\桌面\AUCMA_SCADA\Admin.Core.RealTimeService\
build_property.ProjectDir = D:\Project\gitea\AUCMA\SCADA\Admin.Core.RealTimeService\

@ -8,4 +8,4 @@ build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = Admin.Core.Repository
build_property.ProjectDir = E:\桌面\AUCMA_SCADA\Admin.Core.Repository\
build_property.ProjectDir = D:\Project\gitea\AUCMA\SCADA\Admin.Core.Repository\

@ -8,4 +8,4 @@ build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = Admin.Core.Serilog.Es
build_property.ProjectDir = E:\桌面\AUCMA_SCADA\Admin.Core.Serilog.Es\
build_property.ProjectDir = D:\Project\gitea\AUCMA\SCADA\Admin.Core.Serilog.Es\

@ -8,4 +8,4 @@ build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = Admin.Core.Service
build_property.ProjectDir = E:\桌面\AUCMA_SCADA\Admin.Core.Service\
build_property.ProjectDir = D:\Project\gitea\AUCMA\SCADA\Admin.Core.Service\

@ -8,4 +8,4 @@ build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = Admin.Core.Tasks
build_property.ProjectDir = E:\桌面\AUCMA_SCADA\Admin.Core.Tasks\
build_property.ProjectDir = D:\Project\gitea\AUCMA\SCADA\Admin.Core.Tasks\

@ -85,7 +85,7 @@ namespace Aucma.Core.HwPLc
melsecMcNet.Port = port;
// 如果网络不太理想,配置了两个端口,一个有问题,立即切换另一个的话,可以配置如下的代码
//melsecMcNet.GetPipeSocket().SetMultiPorts(new int[] { 6000, 6001 });
// melsecMcNet.GetPipeSocket().SetMultiPorts(new int[] { 5552, 5553, 5554, 5555});
try
{
// 先关闭再重连,防止多次重连
@ -98,10 +98,9 @@ namespace Aucma.Core.HwPLc
}
else
{
melsecMcNet.ConnectClose();
IsConnected = false;
Console.WriteLine("连接失败!");
Console.WriteLine($"连接失败!【{iP}:{port}】{connect.Message} ");
return false;
}
}
@ -531,7 +530,9 @@ namespace Aucma.Core.HwPLc
}
else
{
//IsConnected = false;
Console.WriteLine($"读取失败信息:{readbyte.Message}");
return null;
}
}

@ -3,6 +3,8 @@ namespace Aucma.Core.RunPlc
{
public interface IRunPlcService
{
Task StartMelsecMcSeverAsync();
Task StartSiemensSever();
Task StartMelsecPlcAsync();
Task StartSiemensPlcAsync();
}

@ -14,32 +14,53 @@ namespace Aucma.Core.RunPlc
#region 构造函数
public RunPlcService()
{
//StartMelsecMcPlcServer();
//StartSiemensPlcServer();
}
#endregion
public async Task StartMelsecMcSeverAsync()
{
await Task.Run(async () =>
{
await StartMelsecMcPlcServer();
});
}
public async Task StartSiemensSever()
{
await Task.Run(async () =>
{
await StartSiemensPlcServer();
});
}
#region 心跳
public async Task StartMelsecPlcAsync()
{
System.Timers.Timer timer = new System.Timers.Timer(3000);
timer.Elapsed += new System.Timers.ElapsedEventHandler(ExecMelsecMcHeartTask); //到达时间的时候执行事件;
timer.AutoReset = true;//设置是执行一次false还是一直执行(true)
timer.Enabled = true;//需要调用 timer.Start()或者timer.Enabled = true来启动它
timer.Start();//timer.Start()的内部原理还是设置timer.Enabled = true;
await Task.Run(async () =>
{
System.Timers.Timer timer = new System.Timers.Timer(3000);
timer.Elapsed += new System.Timers.ElapsedEventHandler(ExecMelsecMcHeartTask); //到达时间的时候执行事件;
timer.AutoReset = true;//设置是执行一次false还是一直执行(true)
timer.Enabled = true;//需要调用 timer.Start()或者timer.Enabled = true来启动它
timer.Start();//timer.Start()的内部原理还是设置timer.Enabled = true;
await Task.CompletedTask;
});
await Task.CompletedTask;
}
public async Task StartSiemensPlcAsync()
{
System.Timers.Timer timer = new System.Timers.Timer(3000);//创建定时器设置间隔时间为1000毫秒
timer.Elapsed += new System.Timers.ElapsedEventHandler(ExecSiemensHeartTask);
timer.AutoReset = true;//设置是执行一次false还是一直执行(true)
timer.Enabled = true;//需要调用 timer.Start()或者timer.Enabled = true来启动它
timer.Start();//timer.Start()的内部原理还是设置timer.Enabled = true;
await Task.CompletedTask;
await Task.Run(async () =>
{
System.Timers.Timer timer = new System.Timers.Timer(3000);//创建定时器设置间隔时间为1000毫秒
timer.Elapsed += new System.Timers.ElapsedEventHandler(ExecSiemensHeartTask);
timer.AutoReset = true;//设置是执行一次false还是一直执行(true)
timer.Enabled = true;//需要调用 timer.Start()或者timer.Enabled = true来启动它
timer.Start();//timer.Start()的内部原理还是设置timer.Enabled = true;
await Task.CompletedTask;
});
}
private static void StartMelsecMcPlcServer()
private static async Task StartMelsecMcPlcServer()
{
var allPlcServices = Appsettings.app<PlcModel>("PLCServer").ToList();
if (allPlcServices == null) return;
@ -56,10 +77,10 @@ namespace Aucma.Core.RunPlc
model.plc = new MelsecPlc(list[i - 1].IP, list[i - 1].Port);
PlcHelper.melsecList.Add(model);
}
// return Task.CompletedTask;
await Task.CompletedTask;
}
private static void StartSiemensPlcServer()
private static async Task StartSiemensPlcServer()
{
List<PlcModel> allPlcServices = Appsettings.app<PlcModel>("PLCServer").ToList();
if (allPlcServices == null) return;
@ -76,7 +97,7 @@ namespace Aucma.Core.RunPlc
model.plc = new SiemensPlc(item.IP, item.Port);
PlcHelper.siemensList.Add(model);
}
await Task.CompletedTask;
}
#endregion

@ -5,9 +5,11 @@ using Aucma.Core.HwPLc;
using Microsoft.Extensions.DependencyInjection;
using NetTaste;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Aucma.Core.SheetMetal.Business
{
@ -18,44 +20,171 @@ namespace Aucma.Core.SheetMetal.Business
{
protected readonly ISmSyncModelServices? _smSyncModelServices;
public HwPLc.PlcModel melsecPlc = null;
public HwPLc.PlcModel obj_backPanel = null;
public HwPLc.PlcModel obj_sidePanel = null;
public SyncModelHandle() {
_smSyncModelServices = App.ServiceProvider.GetService<ISmSyncModelServices>();
}
public void SyncModelTask()
/// <summary>
/// 获取所有设置的钣金前板型号
/// </summary>
/// <returns></returns>
public async Task QuerySidePanelMode()
{
if (PlcHelper.melsecList!=null)
Thread.Sleep(5000);
obj_sidePanel = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("SidePanelPlc"));
if (obj_sidePanel == null) { return; }
if (obj_sidePanel.plc.IsConnected)
{
do
Console.WriteLine("===============采集前板型号开始===============");
byte[] info = obj_sidePanel.plc.Read("D7000", 3000);
if (info == null)
{
melsecPlc = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("BackPanelPLC"));
if (melsecPlc.plc.IsConnected)
Thread.Sleep(1000);
return;
}
int j = 1;
string mode = string.Empty;
List<SmSyncModel> addList = new List<SmSyncModel>();
List<SmSyncModel> updateList = new List<SmSyncModel>();
var smSyncModelList = _smSyncModelServices.QueryAsync().Result;
for (int i = 1; i <= 600; i++)
{
if (i % 2 == 0)
{
byte[] info = melsecPlc.plc.Read("D6030", 100);
if (info == null)
//设置型号
mode = Encoding.ASCII.GetString(info.Skip(i * 10).Take(10).ToArray()).Replace("\0", "").Trim();
if (string.IsNullOrEmpty(mode)) return;
if (smSyncModelList.Count == 0 || smSyncModelList == null)
{
SmSyncModel sm = new SmSyncModel();
sm.SmProductId = j.ToString();
sm.SmModel = mode;
sm.SyncTime = DateTime.Now;
sm.CreateTime = DateTime.Now;
sm.Category = "0";
addList.Add(sm);
}
else
{
Thread.Sleep(1000);
continue;
var obj = smSyncModelList.First(d => d.SmProductId == j.ToString()&& d.Category=="0" );
if (obj == null)
{
SmSyncModel sm = new SmSyncModel();
sm.SmProductId = j.ToString();
sm.SmModel = mode;
sm.SyncTime = DateTime.Now;
sm.Category = "0";
addList.Add(sm);
}
if (string.IsNullOrEmpty(obj.SmModel) && string.IsNullOrEmpty(mode.Trim())) continue;
if (obj.SmModel.Equals(mode)) continue;
else
{
if (obj.SmModel.Equals(mode))
{
obj.SmProductId = j.ToString();
obj.SmModel = mode;
obj.SyncTime = DateTime.Now;
obj.Category = "0";
updateList.Add(obj);
}
}
}
//读取
//string model = Encoding.ASCII.GetString(info.Skip(0).Take(20).ToArray()).Replace("\0", "").Trim();
//string productId = Encoding.ASCII.GetString(info.Skip(20).Take(20).ToArray()).Replace("\0", "").Trim();
//int complateAmount = short.Parse(bytesToHexStr(info.Skip(40).Take(1).ToArray(), 1), System.Globalization.NumberStyles.HexNumber);
//SmSyncModel syncModel = new SmSyncModel();
//SmSyncModel smSyncModel = _smSyncModelServices.FirstAsync(d => d.SmProductId == productId).Result;
//if (smSyncModel.IsNotEmptyOrNull())
//{
// _smSyncModelServices.AddAsync(model);
//}
//_smSyncModelServices.AddAsync(model);
}
} while (true);
Console.WriteLine($"型号{j}{mode}");
j++;
}
}
if (addList != null || addList.Count > 0) await _smSyncModelServices.AddAsync(addList);
if (updateList != null || updateList.Count > 0) await _smSyncModelServices.UpdateAsync(updateList);
Console.WriteLine("===============采集结束===============");
}
}
/// <summary>
/// 获取所有设置的钣金后板型号
/// </summary>
/// <returns></returns>
public async Task QueryBackPanelMode()
{
Thread.Sleep(5000);
obj_backPanel = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("BackPanelPLC"));
if (obj_backPanel == null) { return; }
if (obj_backPanel.plc.IsConnected)
{
Console.WriteLine("===============采集后板开始===============");
byte[] info = obj_sidePanel.plc.Read("D7000", 3000);
if (info == null)
{
Thread.Sleep(1000);
return;
}
int j = 1;
string mode = string.Empty;
List<SmSyncModel> addList = new List<SmSyncModel>();
List<SmSyncModel> updateList = new List<SmSyncModel>();
var smSyncModelList = _smSyncModelServices.QueryAsync().Result;
for (int i = 1; i <= 600; i++)
{
if (i % 2 == 0)
{
//设置型号
mode = Encoding.ASCII.GetString(info.Skip(i * 10).Take(10).ToArray()).Replace("\0","").Trim();
if (smSyncModelList.Count == 0 || smSyncModelList == null)
{
SmSyncModel sm = new SmSyncModel();
sm.SmProductId = j.ToString();
sm.SmModel = mode.Trim();
sm.SyncTime = DateTime.Now;
sm.CreateTime = DateTime.Now;
sm.Category = "1";
addList.Add(sm);
}
else
{
var obj = smSyncModelList.First(d => d.SmProductId == j.ToString() && d.Category == "1");
if (obj == null)
{
SmSyncModel sm = new SmSyncModel();
sm.SmProductId = j.ToString();
sm.SmModel = mode.Trim();
sm.SyncTime = DateTime.Now;
sm.Category ="1";
addList.Add(sm);
}
else
{
if (string.IsNullOrEmpty(obj.SmModel) && string.IsNullOrEmpty(mode)) continue;
if (obj.SmModel.Equals(mode)) continue;
else
{
obj.SmProductId = j.ToString();
obj.SmModel = mode.Trim();
obj.SyncTime = DateTime.Now;
obj.Category = "1";
updateList.Add(obj);
}
}
}
Console.WriteLine($"型号{j}{mode}");
j++;
}
}
if (addList.Count > 0) await _smSyncModelServices.AddAsync(addList);
if (updateList.Count > 0) await _smSyncModelServices.UpdateAsync(updateList);
Console.WriteLine("===============采集后板结束===============");
}
}
}
}

@ -2,11 +2,13 @@
using Admin.Core.IService;
using Admin.Core.Model;
using Admin.Core.Service;
using Aucma.Core.SheetMetal.Business;
using Aucma.Core.SheetMetal.Models;
using Aucma.Core.SheetMetal.Views;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.ObjectModel;
using System.Linq;
using System.Threading.Tasks;
@ -18,53 +20,47 @@ namespace Aucma.Core.SheetMetal.ViewModels
{
private readonly ISmSyncModelServices _smSyncModelServices;
private readonly ISmSyncModelSubServices _smSyncModelSubServices;
SyncModelHandle handle = new SyncModelHandle();
public BomMaintenancePageViewModel()
{
_smSyncModelServices = App.ServiceProvider.GetService<ISmSyncModelServices>();
_smSyncModelSubServices = App.ServiceProvider.GetService<ISmSyncModelSubServices>();
CorrespondingModelPageViewModel.RefreshSetBomDataGridEvent += RefreshSetBom;
//SmSyncModel model=new SmSyncModel();
//model.ObjId = 1;
//model.SmProductId = "1";
//model.SmModel = "BC/BD-310NF";
//SmSyncModelDataGrid.Add(model);
CorrespondingModelPageViewModel.RefreshSetBomDataGridEvent += Refresh;
OnLoadData();
}
#region 刷新
[RelayCommand]
public void Refresh()
{
OnLoadData();
}
#endregion
#region 初始化加载
public void OnLoadData()
{
var list = _smSyncModelServices.QueryAsync().Result;
SmSyncModelSideDataGrid.Clear();
var list = _smSyncModelServices.QueryAsync().Result;
if (list == null || list.Count() == 0) return;
foreach (var item in list)
{
SmSyncModelDataGrid.Add(item);
}
var obj=list.First();
var smSyncModelSubList = _smSyncModelSubServices.QueryAsync(d=>d.SmProductId== obj.SmProductId).Result;
if (smSyncModelSubList == null || smSyncModelSubList.Count == 0) return;
int i = 1;
foreach (var item in smSyncModelSubList)
var sideList= list.OrderBy(d => d.ObjId);
foreach (var item in sideList.Where(d=>d.Category=="0"))
{
item.ObjId = i;
smSyncModelDateilDataGrid.Add(item);
i++;
SmSyncModelSideDataGrid.Add(item);
}
}
public void RefreshSetBom(string smProductId)
{
var smSyncModelSubList = _smSyncModelSubServices.QueryAsync(d => d.SmProductId == smProductId).Result;
if (smSyncModelSubList == null || smSyncModelSubList.Count == 0) return;
int i = 1;
foreach (var item in smSyncModelSubList)
SmSyncModelBackDataGrid.Clear();
var backList = list.OrderBy(d => d.ObjId);
foreach (var item in backList.Where(d => d.Category == "1"))
{
item.ObjId = i;
smSyncModelDateilDataGrid.Add(item);
i++;
SmSyncModelBackDataGrid.Add(item);
}
}
#endregion
#region 查询按钮
/// <summary>
/// 查询按钮
@ -76,25 +72,27 @@ namespace Aucma.Core.SheetMetal.ViewModels
var list=await _smSyncModelServices.QueryAsync(d=>d.SmModel.Contains(param));
foreach (var item in list)
{
SmSyncModelDataGrid.Add(item);
SmSyncModelSideDataGrid.Add(item);
}
}
#endregion
#region 查询按钮
#region 删除按钮
/// <summary>
/// 查询按钮
/// 删除按钮
/// </summary>
/// <returns></returns>
[RelayCommand]
public async Task DeleteBom(object obj)
{
int id = (int)obj;
var result = await _smSyncModelServices.DeleteByIdAsync(id);
var smSyncModelSub = await _smSyncModelSubServices.FirstAsync(d=>d.ObjId==id);
var result = await _smSyncModelSubServices.DeleteByIdAsync(id);
if (result)
{
MessageBox.Show("删除成功!", "系统提醒", MessageBoxButton.OK);
RefreshSetBom(smSyncModelSub.SmProductId);
}
}
@ -106,13 +104,27 @@ namespace Aucma.Core.SheetMetal.ViewModels
/// </summary>
/// <returns></returns>
[RelayCommand]
public Task SyncModel()
public async Task SyncSideModel()
{
//获取PLC设置好的点位 一共四个上料分垛
return Task.FromResult(0);
Console.WriteLine("手动同步前板型号开始!");
await handle.QuerySidePanelMode();
OnLoadData();
MessageBox.Show("手动同步前板型号结束!");
Console.WriteLine("手动同步前板型号结束!");
}
/// <summary>
/// 同步钣金型号按钮
/// </summary>
/// <returns></returns>
[RelayCommand]
public async Task SyncBackModel()
{
Console.WriteLine("手动同步后板型号开始!");
await handle.QueryBackPanelMode();
OnLoadData();
MessageBox.Show("手动同步后板型号结束!");
Console.WriteLine("手动同步后板型号结束!");
}
#endregion
#region 设置钣金型号对应关系
@ -121,8 +133,9 @@ namespace Aucma.Core.SheetMetal.ViewModels
/// </summary>
/// <returns></returns>
[RelayCommand]
public Task SetProduct(string id)
public Task SetProduct(object obj)
{
string id =Convert.ToInt32(obj).ToString();
//获取PLC设置好的点位 一共四个上料分垛
CorrespondingModelPageView view = new CorrespondingModelPageView(id);
view.ShowDialog();
@ -132,30 +145,41 @@ namespace Aucma.Core.SheetMetal.ViewModels
#endregion
#region 初始化datagrid
private ObservableCollection<SmSyncModel> smSyncModelDataGrid = new ObservableCollection<SmSyncModel>();
public ObservableCollection<SmSyncModel> SmSyncModelDataGrid
private ObservableCollection<SmSyncModel> smSyncModelSideDataGrid = new ObservableCollection<SmSyncModel>();
public ObservableCollection<SmSyncModel> SmSyncModelSideDataGrid
{
get { return smSyncModelDataGrid; }
get { return smSyncModelSideDataGrid; }
set
{
smSyncModelDataGrid = value;
smSyncModelSideDataGrid = value;
OnPropertyChanged();//属性通知
}
}
#endregion
#region 初始化datagrid
private ObservableCollection<SmSyncModelSub> smSyncModelDateilDataGrid = new ObservableCollection<SmSyncModelSub>();
public ObservableCollection<SmSyncModelSub> SmSyncModelDateilDataGrid
private ObservableCollection<SmSyncModel> smSyncModelBackDataGrid = new ObservableCollection<SmSyncModel>();
public ObservableCollection<SmSyncModel> SmSyncModelBackDataGrid
{
get { return smSyncModelDateilDataGrid; }
get { return smSyncModelBackDataGrid; }
set
{
smSyncModelDateilDataGrid = value;
smSyncModelBackDataGrid = value;
OnPropertyChanged();//属性通知
}
}
#endregion
#region 刷新子控件
public void SelectRow(SmSyncModel sub)
{
RefreshSetBom(sub.SmProductId);
}
public void RefreshSetBom(string smProductId)
{
}
#endregion
}
}

@ -18,6 +18,7 @@ using Aucma.Core.SheetMetal.Views;
using Aucma.Core.SheetMetal.Common;
using Admin.Core.Common;
using Admin.Core.Service;
using NPOI.SS.Formula.Functions;
namespace Aucma.Core.SheetMetal.ViewModels
{
@ -27,7 +28,7 @@ namespace Aucma.Core.SheetMetal.ViewModels
/// <summary>
/// 刷新创建计划
/// </summary>
public delegate void RefreshSetBomDataGrid(string smProductId);
public delegate void RefreshSetBomDataGrid();
public static event RefreshSetBomDataGrid RefreshSetBomDataGridEvent;
#endregion
@ -35,16 +36,19 @@ namespace Aucma.Core.SheetMetal.ViewModels
protected readonly IProductPlanInfoServices? _productPlanInfoServices;
protected readonly IExecutePlanInfoServices? _executePlanInfoServices;
private readonly ISmSyncModelSubServices _smSyncModelSubServices;
private readonly IBaseMaterialInfoServices _baseMaterialInfoServices;
private readonly ISmSyncModelServices _smSyncModelServices;
private AppConfigHelper appConfig = new AppConfigHelper();//读取配置文件保存的查询内容
#region 构造函数
public CorrespondingModelPageViewModel() { }
public CorrespondingModelPageViewModel(string productId)
{
_productPlanInfoServices = App.ServiceProvider.GetService<IProductPlanInfoServices>();
_executePlanInfoServices = App.ServiceProvider.GetService<IExecutePlanInfoServices>();
_smSyncModelSubServices = App.ServiceProvider.GetService<ISmSyncModelSubServices>();
_baseMaterialInfoServices = App.ServiceProvider.GetService<IBaseMaterialInfoServices>();
_smSyncModelServices = App.ServiceProvider.GetService<ISmSyncModelServices>();
Task.WaitAll(LoadData());
//加载快捷方式
SaveSearchCriteria();
@ -62,26 +66,24 @@ namespace Aucma.Core.SheetMetal.ViewModels
MaterialDataGrid.Clear();
int i = 1;
string station = Appsettings.app("StationInfo", "StationCode");
var execList = _executePlanInfoServices.QuerySheetMetalPlanData(station);
if (execList == null) return;
foreach (var item in execList)
var materialList = _baseMaterialInfoServices.QueryAsync().Result;
var modelList = from d in materialList
select new
{
d.MaterialCode,
d.MaterialName,
d.MaterialSpecifications
};
if (modelList == null) return;
foreach (var item in modelList)
{
int residue = 0;
if (execList == null) residue = 0;
else residue = (execList.Where(d => d.MaterialCode.Equals(item.MaterialCode))).Sum(d => d.PlanAmount);
MaterialDataGrid.Add(new ProductPlanInfoModel()
MaterialDataGrid.Add(new BaseMaterialInfoModel()
{
No = i,
PlanCode = item.PlanCode,
OrderCode = item.OrderCode,
MaterialCode = item.MaterialCode,
MaterialName = item.MaterialName,
PlanAmount = item.PlanAmount,
ResidueAmount = item.PlanAmount - item.CompleteAmount,
SpliteResidueAmount = item.PlanAmount - residue,
MaterialSpecificatons = item.MaterialSpecificatons,
CompleteAmount = item.CompleteAmount,
StartDate = item.BeginTime
MaterialSpecificatons = item.MaterialSpecifications
});
i++;
}
@ -101,26 +103,24 @@ namespace Aucma.Core.SheetMetal.ViewModels
string station = Appsettings.app("StationInfo", "StationCode");
MaterialDataGrid.Clear();
int i = 1;
var execList = _executePlanInfoServices.QuerySheetMetalPlanData(station);
if (execList == null) return;
execList = execList.Where(d => d.MaterialName.Contains(obj) || d.OrderCode.Contains(obj) || d.PlanCode.Contains(obj)).ToList();
foreach (var item in execList)
var materialList = _baseMaterialInfoServices.QueryAsync(d=>d.MaterialSpecifications.Contains(obj)).Result;
var modelList =( from d in materialList
select new BaseMaterialInfoModel
{
MaterialCode= d.MaterialCode,
MaterialName= d.MaterialName,
MaterialSpecificatons = d.MaterialSpecifications
}).ToList();
if (modelList == null) return;
foreach (var item in modelList)
{
int residue = 0;
if (execList == null) residue = 0;
else residue = (execList.Where(d => d.MaterialCode.Equals(item.MaterialCode))).Sum(d => d.PlanAmount);
MaterialDataGrid.Add(new ProductPlanInfoModel()
MaterialDataGrid.Add(new BaseMaterialInfoModel()
{
No = i,
PlanCode = item.PlanCode,
MaterialCode = item.MaterialCode,
MaterialName = item.MaterialName,
OrderCode = item.OrderCode,
PlanAmount = item.PlanAmount,
ResidueAmount = item.PlanAmount - item.CompleteAmount,
SpliteResidueAmount = item.PlanAmount - residue,
MaterialSpecificatons = item.MaterialSpecificatons,
StartDate = item.BeginTime
MaterialSpecificatons = item.MaterialSpecificatons
});
i++;
}
@ -134,8 +134,8 @@ namespace Aucma.Core.SheetMetal.ViewModels
#endregion
#region 初始化datagrid
private ObservableCollection<ProductPlanInfoModel> materialDataGrid = new ObservableCollection<ProductPlanInfoModel>();
public ObservableCollection<ProductPlanInfoModel> MaterialDataGrid
private ObservableCollection<BaseMaterialInfoModel> materialDataGrid = new ObservableCollection<BaseMaterialInfoModel>();
public ObservableCollection<BaseMaterialInfoModel> MaterialDataGrid
{
get => materialDataGrid;
set => SetProperty(ref materialDataGrid, value);
@ -168,30 +168,19 @@ namespace Aucma.Core.SheetMetal.ViewModels
/// 绑定BOM
/// </summary>
[RelayCommand]
private async void AddBom(string orderCode)
private async void AddBom(string materialSpecificatons)
{
if (!orderCode.IsNullOrEmpty())
if (!materialSpecificatons.IsNullOrEmpty())
{
//添加BOM对应
//MessageBox.Show(ProductId);
//MessageBox.Show(orderCode);
string station = Appsettings.app("StationInfo", "StationCode");
var execList = _executePlanInfoServices.QuerySheetMetalPlanData(station);
var result= execList.First(d=>d.OrderCode.Equals(orderCode));
SmSyncModelSub sub=new SmSyncModelSub();
sub.SmProductId = ProductId;
sub.OrderCode = result.OrderCode;
sub.PlanCode = result.PlanCode;
sub.MaterialCode = result.MaterialCode;
sub.MaterialName = result.MaterialName;
sub.MaterialModel = result.MaterialSpecificatons;
sub.CreateTime = DateTime.Now;
var backResult= await _smSyncModelSubServices.AddAsync(sub);
if (backResult>0)
var smSyncModel=_smSyncModelServices.FirstAsync(d=>d.ObjId==int.Parse(ProductId)).Result;
smSyncModel.MaterialSpecifications = materialSpecificatons;
var result = await _smSyncModelServices.UpdateAsync(smSyncModel);
if (result)
{
MessageBox.Show("设置成功!","系统提醒",MessageBoxButton.OK);
RefreshSetBomDataGridEvent?.Invoke(ProductId);
RefreshSetBomDataGridEvent?.Invoke();
}
return;
}
@ -441,4 +430,11 @@ namespace Aucma.Core.SheetMetal.ViewModels
}
#endregion
}
public class BaseMaterialInfoModel
{
public int No { get; set; }
public string MaterialCode { get; set; }
public string MaterialName { get; set; }
public string MaterialSpecificatons { get; set; }
}
}

@ -135,10 +135,9 @@
<RowDefinition Height="10*"/>
</Grid.RowDefinitions>
<WrapPanel Grid.Row="0" Margin="3" VerticalAlignment="Center">
<Label Content="查询条件" VerticalAlignment="Center" Foreground="White" FontSize="18" />
<TextBox x:Name="queryParam" Text="{Binding Search,Mode=TwoWay}" Style="{x:Null}" Width="300" HorizontalAlignment="Left" VerticalContentAlignment="Center" Margin="10 0 5 0" PreviewMouseDoubleClick="queryParam_PreviewMouseDoubleClick"/>
<Button Content="查 询" Command="{Binding QueryModelCommand}" CommandParameter="{Binding Text, ElementName=queryParam}" Margin="5 0" FontSize="20" Height="40"/>
<Button Content="同步设备型号" Command="{Binding SyncModelCommand}" Margin="5 0" FontSize="20" Background="YellowGreen" Height="40" />
<Button Content="同步前板型号" Command="{Binding SyncSideModelCommand}" Margin="5 0" FontSize="20" Background="YellowGreen" Height="40" />
<Button Content="同步后板型号" Command="{Binding SyncBackModelCommand}" Margin="5 0" FontSize="20" Background="Orange" Height="40" />
<Button Content="刷 新" Command="{Binding RefreshCommand}" CommandParameter="{Binding Text, ElementName=queryParam}" Margin="5 0" FontSize="20" Height="40"/>
</WrapPanel>
<UniformGrid Grid.Row="2" Margin="5" >
<Grid>
@ -147,22 +146,24 @@
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<UniformGrid Grid.Column="0" Margin="3 0">
<DataGrid ItemsSource="{Binding SmSyncModelDataGrid}" Background="Transparent"
ColumnHeaderHeight="35" x:Name="dgvMH" FontSize="20"
<DataGrid ItemsSource="{Binding SmSyncModelSideDataGrid}" Background="Transparent"
ColumnHeaderHeight="35" Name="dgvMH" FontSize="20"
RowHeight="50" AutoGenerateColumns="False" RowHeaderWidth="0"
GridLinesVisibility="None" VerticalAlignment="Stretch"
BorderThickness="0" CanUserAddRows="False" SelectionMode="Single" IsReadOnly="True"
Foreground="White" LoadingRow="dgvMH_LoadingRow" HeadersVisibility ="Column">
Foreground="White" LoadingRow="dgvMH_LoadingRow" HeadersVisibility ="Column" SelectionChanged="dgvMH_SelectionChanged" >
<DataGrid.Columns>
<DataGridTemplateColumn Width="55" Header="序号" >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type DataGridRow}}, Path=Header}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="10,0,0,0"></TextBlock>
<TextBlock Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type DataGridRow}}, Path=Header}" FontSize="18" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="10,0,0,0"></TextBlock>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Binding="{Binding ObjId}" Header="ID" Width="*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" Visibility="Collapsed"/>
<DataGridTextColumn Binding="{Binding SmProductId}" Header="产品编码" Width="1*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding SmModel}" Header="产品型号" Width="2*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding SmModel}" Header="产品型号" Width="*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding MaterialSpecifications}" Header="设定型号" Width="*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding SyncTime,StringFormat=\{0:yyyy-MM-dd HH:mm\}}" Header="同步时间" Width="1*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"
/>
<DataGridTemplateColumn Header="操作" Width="1*" >
@ -170,7 +171,7 @@
<DataTemplate>
<WrapPanel>
<Button Content="添加该型号物料" FontSize="12" CommandParameter="{Binding SmProductId}" Margin="0 2 0 2" Command="{Binding DataContext.SetProductCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid }}" />
<Button Content="设置型号" FontSize="12" CommandParameter="{Binding ObjId}" Margin="0 2 0 2" Command="{Binding DataContext.SetProductCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid }}" />
</WrapPanel>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
@ -179,30 +180,32 @@
</DataGrid>
</UniformGrid>
<UniformGrid Grid.Column="1">
<DataGrid ItemsSource="{Binding SmSyncModelDateilDataGrid}" Background="Transparent"
ColumnHeaderHeight="35" x:Name="dgv1MH" FontSize="20"
RowHeight="50" AutoGenerateColumns="False" RowHeaderWidth="0"
GridLinesVisibility="None" VerticalAlignment="Stretch"
BorderThickness="0" CanUserAddRows="False" SelectionMode="Single" IsReadOnly="True"
Foreground="White">
<DataGrid ItemsSource="{Binding SmSyncModelBackDataGrid}" Background="Transparent"
ColumnHeaderHeight="35" Name="dvg1MH" FontSize="20"
RowHeight="50" AutoGenerateColumns="False" RowHeaderWidth="0"
GridLinesVisibility="None" VerticalAlignment="Stretch"
BorderThickness="0" CanUserAddRows="False" SelectionMode="Single" IsReadOnly="True"
Foreground="White" LoadingRow="dgvMH_LoadingRow" HeadersVisibility ="Column" SelectionChanged="dgvMH_SelectionChanged" >
<DataGrid.Columns>
<DataGridTemplateColumn Width="55" Header="序号" >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type DataGridRow}}, Path=Header}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="10,0,0,0"></TextBlock>
<TextBlock Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type DataGridRow}}, Path=Header}" FontSize="18" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="10,0,0,0"></TextBlock>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Binding="{Binding ObjId}" Header="主键" Width="*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" Visibility="Collapsed"/>
<DataGridTextColumn Binding="{Binding ProductId}" Header="订单编码" Width="1*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding MaterialName}" Header="物料编码" Width="2*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding MaterialName}" Header="物料名称" Width="2*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding MaterialName}" Header="物料型号" Width="2*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTemplateColumn Header="操作" Width="2*" >
<DataGridTextColumn Binding="{Binding ObjId}" Header="ID" Width="*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" Visibility="Collapsed"/>
<DataGridTextColumn Binding="{Binding SmProductId}" Header="产品编码" Width="1*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding SmModel}" Header="产品型号" Width="*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding MaterialSpecifications}" Header="设定型号" Width="*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding SyncTime,StringFormat=\{0:yyyy-MM-dd HH:mm\}}" Header="同步时间" Width="1*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"
/>
<DataGridTemplateColumn Header="操作" Width="1*" >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<WrapPanel>
<Button Content="删除" Background="Red" FontSize="12" CommandParameter="{Binding ObjId}" Margin="0 2 0 2" Command="{Binding DataContext.DeleteBomCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid }}" />
<Button Content="设置型号" FontSize="12" CommandParameter="{Binding ObjId}" Margin="0 2 0 2" Command="{Binding DataContext.SetProductCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid }}" />
</WrapPanel>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>

@ -2,6 +2,8 @@
using System.Windows.Controls;
using System.Windows.Input;
using Aucma.Core.SheetMetal.Common;
using System.Data;
using Admin.Core.Model;
namespace Aucma.Core.SheetMetal.Views
{
@ -10,10 +12,11 @@ namespace Aucma.Core.SheetMetal.Views
/// </summary>
public partial class BomMaintenancePageView : UserControl
{
BomMaintenancePageViewModel model = new BomMaintenancePageViewModel();
public BomMaintenancePageView()
{
InitializeComponent();
this.DataContext = new BomMaintenancePageViewModel();
this.DataContext = model;
}
//在载入行的时候在行表头添加编号
@ -27,5 +30,25 @@ namespace Aucma.Core.SheetMetal.Views
{
CommHelper.OpenOsk();
}
private void dgv1MH_LoadingRow(object sender, DataGridRowEventArgs e)
{
e.Row.Header = (e.Row.GetIndex() + 1).ToString();
}
private void dgvMH_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
var dataGrid = (DataGrid)sender;
if (dataGrid != null && dataGrid.SelectedItem != null)
{
var selectedRows = (SmSyncModel)dataGrid.SelectedItems[0];
if (selectedRows != null)
{
model.SelectRow(selectedRows);
}
}
}
}
}

@ -114,7 +114,6 @@
<Label Content="查询条件" VerticalAlignment="Center" Foreground="White" FontSize="18" />
<TextBox x:Name="queryParam" PreviewMouseDoubleClick="queryParam_PreviewMouseDoubleClick" Text="{Binding Search,Mode=TwoWay}" Style="{x:Null}" Width="300" HorizontalAlignment="Left" VerticalContentAlignment="Center" Margin="10 0 5 0"/>
<Button Content="查 询" Command="{Binding QueryPlanCommand}" CommandParameter="{Binding Text, ElementName=queryParam}" Margin="5 0" Height="40" FontSize="18" />
<Button Content="重 置" Command="{Binding ResetCommand}" Margin="5 0" Height="40" FontSize="18" />
</WrapPanel>
<UniformGrid Grid.Row="1" Margin="3" >
@ -128,18 +127,14 @@
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding No}" Header="序号" Width="0.5*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding PlanCode}" Header="MES工单编号" Width="1.5*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding OrderCode}" Header="SAP计划编号" Width="1.5*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding MaterialName}" Header="产品型号" Width="3*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding MaterialSpecificatons}" Header="配方号" Width="1.5*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" />
<DataGridTextColumn Binding="{Binding PlanAmount}" Header="计划数量" Width="1*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding CompleteAmount}" Header="完成数量" Width="1*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding StartDate,StringFormat=\{0:MM-dd HH:mm\}}" Header="开始时间" Width="1*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTemplateColumn Header="操作" Width="*" >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<Button Content="确定" FontSize="12" CommandParameter="{Binding OrderCode}" Background="Orange" Margin="0 2 0 2" Command="{Binding DataContext.AddBomCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid }}" />
<Button Content="确定" FontSize="12" CommandParameter="{Binding MaterialSpecificatons}" Background="Orange" Margin="0 2 0 2" Command="{Binding DataContext.AddBomCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid }}" />
</WrapPanel>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>

@ -142,7 +142,7 @@
"PlcType": "Melsec",
"Enabled": true,
"IP": "10.10.91.6",
"Port": 5552
"Port": 5553
}
]
}

@ -8,6 +8,9 @@ using System.Text;
using System.Timers;
using Aucma.Core.HwPLc;
using log4net;
using NetTaste;
using NPOI.SS.Formula.Functions;
using System.Collections.Generic;
namespace Aucma.Core.SheetMetalTasks
{
@ -63,10 +66,12 @@ namespace Aucma.Core.SheetMetalTasks
protected readonly IExecutePlanInfoServices? _executePlanInfoServices;
protected readonly IRecordSidePanelComplateServices _sidePanelComplateServices;
protected readonly IRecordBackPanelComplateServices _backPanelComplateServices;
protected readonly IProductPlanInfoServices? _productPlanInfoServices;
protected readonly IProductPlanInfoServices _productPlanInfoServices;
protected readonly ISysUserInfoServices? _sysUserInfoServices;
protected readonly IMaterialCompletionServices? _materialCompletionServices;
public HwPLc.PlcModel plc1 = null;
protected readonly ISmSyncModelServices? _smSyncModelServices;
public HwPLc.PlcModel obj_backPanel = null;
public HwPLc.PlcModel obj_sidePanel = null;
bool flay = true;//方法完成标识
#region 构造函数
@ -81,7 +86,7 @@ namespace Aucma.Core.SheetMetalTasks
/// <param name="materialCompletionServices"></param>
public AucamSheetMetalTaskService(IExecutePlanInfoServices executePlanInfoServices, IRecordSidePanelComplateServices recordSidePanelComplateServices,
IRecordBackPanelComplateServices recordBackPanelComplateServices, IProductPlanInfoServices productPlanInfoServices,
ISysUserInfoServices sysUserInfoServices, IMaterialCompletionServices materialCompletionServices)
ISysUserInfoServices sysUserInfoServices, IMaterialCompletionServices materialCompletionServices, ISmSyncModelServices smSyncModelServices)
{
_executePlanInfoServices = executePlanInfoServices;
_sidePanelComplateServices = recordSidePanelComplateServices;
@ -89,54 +94,113 @@ namespace Aucma.Core.SheetMetalTasks
_productPlanInfoServices = productPlanInfoServices;
_sysUserInfoServices = sysUserInfoServices;
_materialCompletionServices = materialCompletionServices;
}
_smSyncModelServices = smSyncModelServices;
}
#endregion
#region 更新钣金工位计划数
#region 启动任务下发
public Task SheetMetalTasks()
{
//System.Timers.Timer timer = new System.Timers.Timer(5000);
//timer.Elapsed += new System.Timers.ElapsedEventHandler(Run1); //到达时间的时候执行事件;
//timer.AutoReset = true;//设置是执行一次false还是一直执行(true)
//timer.Enabled = true;//需要调用 timer.Start()或者timer.Enabled = true来启动它
//timer.Start();//timer.Start()的内部原理还是设置timer.Enabled = true;
Task.Run(() =>
//Thread.Sleep(5000);
//while (true)
//{
// var obj_backPanel = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("BackPanelPLC"));
// if (obj_backPanel.plc.IsConnected)
// {
// bool result = obj_backPanel.plc.ReadBool("M61");
// Console.WriteLine(result);
// Thread.Sleep(5000);
// }
//}
Task.Run(async () =>
{
InitSendBackPanelPlan();
await InitSendBackPanelPlan();
});
Task.Run(() =>
//Task.Run(async () =>
//{
// await InitSendSidePanelPlan();
//});
//Task.Run(() =>
//{
// UpdateComplatePlan();//更新计划数
//});
//Task.Run(async () =>
//{
// await ReadSideBlanking();//获取前板下料
//});
Task.Run(async () =>
{
InitSendSidePanelPlan();
await QuerySidePanelMode();//获取型号
});
Task.Run(() =>
Task.Run(async () =>
{
UpdateComplatePlan();//更新计划数
await QueryBackPanelMode();
});
return Task.CompletedTask;
}
private void Run1(object? sender, ElapsedEventArgs e)
#endregion
#region 之前代码
#region 下发多个计划同步执行
/// <summary>
/// 初始化下发生产计划,获取已拆分的计划进行下发——前板任务
/// </summary>
public async Task InitSendSidePanelPlan()
{
if (flay)
Thread.Sleep(5000);
var obj_sidePanel = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("SidePanelPlc"));
while (true)
{
flay = false;
lock (string.Empty)
List<SheetMetaSendPlanInfoView> planInfoList = await _executePlanInfoServices.QuerySheetMetalSendPlanData("1001");
if (planInfoList == null || planInfoList.Count == 0) continue;
planInfoList = planInfoList.Where(d => d.PlanAmount > d.SidePanelAmount&&(d.ExecuteStatus == 1 || d.ExecuteStatus == 2)).ToList();
if (planInfoList == null || planInfoList.Count == 0) continue;
planInfoList = planInfoList.Where(d => d.ExecuteStatus == 1 || d.ExecuteStatus == 2).ToList();
if (planInfoList == null || planInfoList.Count == 0) continue;
var planInfos = planInfoList.Where(d => d.PlanType == 2).ToList();
if (planInfos != null)
{
if (planInfos.Count > 0)
{
SheetMetaSendPlanInfoView planInfo = planInfos.FirstOrDefault(d => d.SidePanelAmount != d.PlanAmount);
if (planInfo == null) continue;
if (planInfo.PlanType == 2)//如果为2或者为1 前板板计划单独下发 以前板完成为主
{
List<Bin> binList=GetSideBinStatus(obj_sidePanel);
SmSyncModel smSyncModel =_smSyncModelServices.FirstAsync(d => d.MaterialSpecifications.Equals(planInfo.MaterialSpecificatons)&&d.Category=="0").Result;
if (smSyncModel == null) continue;
Bin bin = binList.First(d => d.ProductId.Equals(smSyncModel.SmProductId));
if (bin==null) continue;
SendPlanTaskToSidPanel(planInfo, obj_sidePanel,smSyncModel.SmProductId.ObjToInt());
UpdateSidPanelPlanTaskByComplate(planInfo);
}
}
else
{
Console.WriteLine("未获取到需要下发的任务");
}
}
Thread.Sleep(5000);
}
}
#endregion
#region 下发多个计划同步执行
/// <summary>
/// 初始化下发生产计划,获取已拆分的计划进行下发——后板任务
/// </summary>
public async void InitSendBackPanelPlan()
public async Task InitSendBackPanelPlan()
{
Thread.Sleep(5000);
var obj_backPanel = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("BackPanelPLC"));
@ -158,11 +222,16 @@ namespace Aucma.Core.SheetMetalTasks
{
SheetMetaSendPlanInfoView planInfo = planInfos.FirstOrDefault(d => d.BackPanelAmount != d.PlanAmount);
if (planInfo == null) continue;
if (planInfo.PlanType == 3 || planInfo.PlanType == 1)//如果为3或者为1 后板计划单独下发 以前板完成为主
if (planInfo.PlanType == 3 )//如果为3或者为1 后板计划单独下发 以前板完成为主
{
//获取设置的型号查询对应的型号,下发计划
List<Bin> binList = GetBackBinStatus(obj_backPanel);
SmSyncModel smSyncModel = _smSyncModelServices.FirstAsync(d => d.MaterialSpecifications.Equals(planInfo.MaterialSpecificatons) && d.Category == "1").Result;
if (smSyncModel == null) continue;
Bin bin = binList.FirstOrDefault(d => d.ProductId.Equals(smSyncModel.SmProductId));
if (bin == null) continue;
SendPlanTaskToBackPanel(planInfo, obj_backPanel);
SendPlanTaskToBackPanel(planInfo, obj_backPanel, smSyncModel.SmProductId.ObjToInt());
UpdateBackPanelPlanTaskByComplate(planInfo);
}
@ -181,51 +250,14 @@ namespace Aucma.Core.SheetMetalTasks
}
}
/// <summary>
/// 初始化下发生产计划,获取已拆分的计划进行下发——前板任务
/// </summary>
public async void InitSendSidePanelPlan()
{
Thread.Sleep(5000);
var obj_sidePanel = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("SidePanelPlc"));
while (true)
{
List<SheetMetaSendPlanInfoView> planInfoList = await _executePlanInfoServices.QuerySheetMetalSendPlanData("1001");
if (planInfoList == null || planInfoList.Count == 0) continue;
planInfoList = planInfoList.Where(d => d.PlanAmount > d.SidePanelAmount).ToList();
if (planInfoList == null || planInfoList.Count == 0) continue;
planInfoList = planInfoList.Where(d => d.ExecuteStatus == 1 || d.ExecuteStatus == 2).ToList();
if (planInfoList == null || planInfoList.Count == 0) continue;
var planInfos = planInfoList.Where(d => d.PlanType == 2 || d.PlanType == 1).ToList();
if (planInfos != null)
{
if (planInfos.Count > 0)
{
SheetMetaSendPlanInfoView planInfo = planInfos.FirstOrDefault(d => d.SidePanelAmount != d.PlanAmount);
if (planInfo == null) continue;
if (planInfo.PlanType == 2 || planInfo.PlanType == 1)//如果为2或者为1 前板板计划单独下发 以前板完成为主
{
SendPlanTaskToSidPanel(planInfo, obj_sidePanel);
UpdateSidPanelPlanTaskByComplate(planInfo);
}
}
else
{
Console.WriteLine("未获取到需要下发的任务");
}
}
Thread.Sleep(5000);
}
}
/// <summary>
/// 下发前板生产计划
/// </summary>
/// <param name="planInfo"></param>
/// <param name="obj"></param>
public void SendPlanTaskToSidPanel(SheetMetaSendPlanInfoView planInfo, PlcModel obj_sidePanel)
public void SendPlanTaskToSidPanel(SheetMetaSendPlanInfoView planInfo, PlcModel obj_sidePanel,int SmProductId)
{
try
{
@ -239,6 +271,7 @@ namespace Aucma.Core.SheetMetalTasks
obj_sidePanel.plc.WriteString("D6010", planInfo.MaterialSpecificatons);
obj_sidePanel.plc.WriteInt32("D6020", planInfo.PlanAmount);
obj_sidePanel.plc.WriteInt32("D6021", 1);
obj_sidePanel.plc.WriteInt32("D6022", SmProductId);//产品号
Console.WriteLine($"{DateTime.Now.ToString("HH:m:s")}===>计划【{planInfo.TaskCode}】已下发,等待前板设备应答。。。。。。");
RefreshExecInfoEvent?.Invoke($"计划【{planInfo.TaskCode}】已下发,等待前板设备应答。。。。。。", "White");
@ -248,8 +281,7 @@ namespace Aucma.Core.SheetMetalTasks
DateTime startTime = DateTime.Now;
do
{
if (obj_sidePanel.plc.ReadInt32("D6021") == 2)
if (obj_sidePanel.plc.ReadInt16("D6021") == 2)
{
obj_sidePanel.plc.WriteInt32("D6021", 0);
Console.WriteLine($"{DateTime.Now.ToString("HH:m:s")}===>计划【{planInfo.TaskCode}】,收到前板设备应答信号,复位应答地址");
@ -296,7 +328,7 @@ namespace Aucma.Core.SheetMetalTasks
/// </summary>
/// <param name="planInfo"></param>
/// <param name="obj"></param>
public void SendPlanTaskToBackPanel(SheetMetaSendPlanInfoView planInfo, PlcModel obj_backPanel)
public void SendPlanTaskToBackPanel(SheetMetaSendPlanInfoView planInfo, PlcModel obj_backPanel,int productId)
{
try
{
@ -308,8 +340,9 @@ namespace Aucma.Core.SheetMetalTasks
obj_backPanel.plc.WriteString("D4000", planInfo.TaskCode);
string processNumber = GetProcessNumberBy(planInfo.MaterialCode);
obj_backPanel.plc.WriteString("D4010", planInfo.MaterialSpecificatons);
obj_backPanel.plc.WriteInt32("D4020", planInfo.PlanAmount);
obj_backPanel.plc.WriteInt32("D4021", 1);
obj_backPanel.plc.WriteInt16("D4020", planInfo.PlanAmount.ToString());
obj_backPanel.plc.WriteInt16("D4021", 1.ToString());
obj_backPanel.plc.WriteInt16("D4022", productId.ToString());
Console.WriteLine($"{DateTime.Now.ToString("HH:m:s")}===>计划【{planInfo.TaskCode}】已下发,等待背板设备应答。。。。。。");
RefreshExecInfoEvent?.Invoke($"计划【{planInfo.TaskCode}】已下发,等待背板设备应答。。。。。。", "White");
@ -319,10 +352,10 @@ namespace Aucma.Core.SheetMetalTasks
DateTime startTime = DateTime.Now;
do
{
if (obj_backPanel.plc.ReadInt32("D4021") == 2)
Console.WriteLine(obj_backPanel.plc.ReadInt16("D4021"));
if (obj_backPanel.plc.ReadInt16("D4021") == 2)
{
obj_backPanel.plc.WriteInt32("D4021", 0);
obj_backPanel.plc.WriteInt16("D4021", "0");
Console.WriteLine($"{DateTime.Now.ToString("HH:m:s")}===>收到背板板设备应答信号,复位应答地址");
RefreshExecInfoEvent?.Invoke($"收到背板板设备应答信号,复位应答地址", "White");
startTime = DateTime.Now;
@ -365,7 +398,6 @@ namespace Aucma.Core.SheetMetalTasks
/// <summary>
/// 根据后板完成记录更新生产计划
/// </summary>
/// <param name="planInfo"></param>
private void UpdateBackPanelPlanTaskByComplate(SheetMetaSendPlanInfoView planInfo)
{
try
@ -543,7 +575,7 @@ namespace Aucma.Core.SheetMetalTasks
if (planInfo.PlanType == 2)
{
sumAmount = sumBackPanelAmount;
sumAmount = sumSidePanelAmount;
if (planInfo.PlanAmount - sumAmount == 0)
{
planInfo.ExecuteStatus = 3;
@ -913,7 +945,6 @@ namespace Aucma.Core.SheetMetalTasks
{
bool isFlag = true;
do
{
try
@ -1042,8 +1073,6 @@ namespace Aucma.Core.SheetMetalTasks
}
/// <summary>
/// 下发背板生产计划
/// </summary>
@ -1235,8 +1264,6 @@ namespace Aucma.Core.SheetMetalTasks
}
}
/// <summary>
/// 通过物料编号获取工艺编号
/// </summary>
@ -1345,5 +1372,384 @@ namespace Aucma.Core.SheetMetalTasks
#endregion
#endregion
#region 同步钣金设置型号
/// <summary>
/// 获取所有设置的钣金前板型号
/// </summary>
/// <returns></returns>
public async Task QuerySidePanelMode()
{
while (true)
{
Thread.Sleep(50000);
obj_sidePanel = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("SidePanelPlc"));
if (obj_sidePanel == null) { continue; }
if (obj_sidePanel.plc.IsConnected)
{
Console.WriteLine("===============采集前板开始===============");
byte[] info = obj_sidePanel.plc.Read("D7000", 3000);
if (info == null)
{
Thread.Sleep(1000);
continue;
}
int j = 1;
string mode = string.Empty;
List<SmSyncModel> addList = new List<SmSyncModel>();
List<SmSyncModel> updateList = new List<SmSyncModel>();
var smSyncModelList = _smSyncModelServices.QueryAsync(d=>d.Category=="0").Result;
for (int i = 1; i <= 600; i++)
{
if (i % 2 == 0)
{
//设置型号
mode = Encoding.ASCII.GetString(info.Skip(i * 10).Take(10).ToArray()).Replace("\0", "").Trim();
if (smSyncModelList.Count == 0 || smSyncModelList == null)
{
SmSyncModel sm = new SmSyncModel();
sm.SmProductId = j.ToString();
sm.SmModel = mode.Trim();
sm.SyncTime = DateTime.Now;
sm.CreateTime = DateTime.Now;
sm.Category = "0";
addList.Add(sm);
}
else
{
var obj = smSyncModelList.First(d => d.SmProductId == j.ToString());
if (obj == null)
{
SmSyncModel sm = new SmSyncModel();
sm.SmProductId = j.ToString();
sm.SmModel = mode.Trim();
sm.SyncTime = DateTime.Now;
sm.Category = "0";
addList.Add(sm);
}
else
{
if (string.IsNullOrEmpty(obj.SmModel) && string.IsNullOrEmpty(mode)) continue;
if (string.IsNullOrEmpty(obj.SmModel) && !string.IsNullOrEmpty(mode))
{
obj.SmProductId = j.ToString();
obj.SmModel = mode.Trim();
obj.SyncTime = DateTime.Now;
obj.Category = "0";
updateList.Add(obj);
}
if (!string.IsNullOrEmpty(obj.SmModel) && !string.IsNullOrEmpty(mode) && obj.SmModel!= mode)
{
obj.SmProductId = j.ToString();
obj.SmModel = mode.Trim();
obj.SyncTime = DateTime.Now;
obj.Category = "0";
updateList.Add(obj);
}
}
}
j++;
}
}
if (addList != null && addList.Count > 0) await _smSyncModelServices.AddAsync(addList);
if (updateList != null&&updateList.Count > 0) await _smSyncModelServices.UpdateAsync(updateList);
Console.WriteLine("===============采集结束===============");
}
}
}
/// <summary>
/// 获取所有设置的钣金前板型号
/// </summary>
/// <returns></returns>
public async Task QueryBackPanelMode()
{
while (true)
{
Thread.Sleep(5000);
obj_backPanel = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("BackPanelPLC"));
if (obj_backPanel == null) { continue; }
if (obj_backPanel.plc.IsConnected)
{
Console.WriteLine("===============采集后板开始===============");
byte[] info = obj_backPanel.plc.Read("D7000", 3000);
if (info == null)
{
Thread.Sleep(1000);
continue;
}
int j = 1;
string mode = string.Empty;
List<SmSyncModel> addList = new List<SmSyncModel>();
List<SmSyncModel> updateList = new List<SmSyncModel>();
var smSyncModelList = _smSyncModelServices.QueryAsync(d=>d.Category=="1").Result;
for (int i = 1; i <= 600; i++)
{
if (i % 2 == 0)
{
//设置型号
mode = Encoding.ASCII.GetString(info.Skip(i * 10).Take(10).ToArray()).Replace("\0", "").Trim();
if (smSyncModelList.Count == 0 || smSyncModelList == null)
{
SmSyncModel sm = new SmSyncModel();
sm.SmProductId = j.ToString();
sm.SmModel = mode.Trim();
sm.SyncTime = DateTime.Now;
sm.CreateTime = DateTime.Now;
sm.Category = "1";
addList.Add(sm);
}
else
{
var obj = smSyncModelList.First(d => d.SmProductId == j.ToString());
if (obj == null)
{
SmSyncModel sm = new SmSyncModel();
sm.SmProductId = j.ToString();
sm.SmModel = mode.Trim();
sm.SyncTime = DateTime.Now;
sm.Category = "1";
addList.Add(sm);
}
else
{
if (string.IsNullOrEmpty(obj.SmModel) && string.IsNullOrEmpty(mode)) continue;
if (string.IsNullOrEmpty(obj.SmModel) && !string.IsNullOrEmpty(mode))
{
obj.SmProductId = j.ToString();
obj.SmModel = mode.Trim();
obj.SyncTime = DateTime.Now;
obj.Category = "1";
updateList.Add(obj);
}
if (!string.IsNullOrEmpty(obj.SmModel) && !string.IsNullOrEmpty(mode) && obj.SmModel != mode)
{
obj.SmProductId = j.ToString();
obj.SmModel = mode.Trim();
obj.SyncTime = DateTime.Now;
obj.Category = "1";
updateList.Add(obj);
}
}
}
j++;
}
}
if (addList != null && addList.Count > 0) await _smSyncModelServices.AddAsync(addList);
if (updateList != null && updateList.Count > 0) await _smSyncModelServices.UpdateAsync(updateList);
Console.WriteLine("===============采集结束===============");
}
}
}
#endregion
public List<Bin> GetBackBinStatus(PlcModel obj_SidePanel)
{
List<Bin> list = new List<Bin>();
if (!obj_SidePanel.plc.IsConnected)
{
Console.WriteLine("plc为 false");
return null;
}
var startb0=obj_SidePanel.plc.ReadBool("M60");
if (startb0)
{
string productId = obj_SidePanel.plc.ReadInt16("D2002").ToString();//读取产品编码
Bin bin = new Bin();
bin.ProductId = productId;
bin.Status = startb0;
list.Add(bin);
}
var startb2 = obj_SidePanel.plc.ReadBool("M61");
if (startb2)
{
string productId = obj_SidePanel.plc.ReadInt16("D2026").ToString();
Bin bin = new Bin();
bin.ProductId = productId;
bin.Status = startb2;
list.Add(bin);
}
var startb4 = obj_SidePanel.plc.ReadBool("M62");
if (startb4)
{
string productId = obj_SidePanel.plc.ReadInt16("D2050").ToString();
Bin bin = new Bin();
bin.ProductId = productId;
bin.Status = startb4;
list.Add(bin);
}
var startb6 = obj_SidePanel.plc.ReadBool("M63");
if (startb6)
{
string productId = obj_SidePanel.plc.ReadInt16("D2075").ToString();
Bin bin = new Bin();
bin.ProductId = productId;
bin.Status = startb6;
list.Add(bin);
}
var startb7 = obj_SidePanel.plc.ReadBool("M64");
if (startb7)
{
string productId = obj_SidePanel.plc.ReadInt16("D2098").ToString();
Bin bin = new Bin();
bin.ProductId = productId;
bin.Status = startb7;
list.Add(bin);
}
var startb8 = obj_SidePanel.plc.ReadBool("M65");
if (startb8)
{
string productId = obj_SidePanel.plc.ReadInt16("D2122").ToString();
Bin bin = new Bin();
bin.ProductId = productId;
bin.Status = startb8;
list.Add(bin);
}
return list;
}
public List<Bin> GetSideBinStatus(PlcModel obj_SidePanel)
{
List<Bin> list = new List<Bin>();
var startb0 = obj_SidePanel.plc.ReadBool("M140");
if (startb0)
{
string productId = obj_SidePanel.plc.ReadInt16("D1402").ToString();
Bin bin = new Bin();
bin.ProductId = productId;
bin.Status = startb0;
list.Add(bin);
}
var startb2 = obj_SidePanel.plc.ReadBool("M141");
if (startb0)
{
string productId = obj_SidePanel.plc.ReadInt16("D1426").ToString();
Bin bin = new Bin();
bin.ProductId = productId;
bin.Status = startb0;
list.Add(bin);
}
var startb4 = obj_SidePanel.plc.ReadBool("M142");
if (startb4)
{
string productId = obj_SidePanel.plc.ReadInt16("D1450").ToString();
Bin bin = new Bin();
bin.ProductId = productId;
bin.Status = startb4;
list.Add(bin);
}
var startb6 = obj_SidePanel.plc.ReadBool("M143");
if (startb6)
{
string productId = obj_SidePanel.plc.ReadInt16("D1474").ToString();
Bin bin = new Bin();
bin.ProductId = productId;
bin.Status = startb6;
list.Add(bin);
}
return list;
}
/// <summary>
/// 前板下线数量
/// </summary>
public async Task ReadSideBlanking()
{
while (true)
{
string stationCode = Appsettings.app("StationInfo", "StationCode");
string productLineCode = Appsettings.app("StationInfo", "ProductLineCode");
Thread.Sleep(5000);
obj_sidePanel = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("SidePanelPlc"));
if (obj_sidePanel.plc.IsConnected)
{
byte[] info = obj_sidePanel.plc.Read("D2100", 20);
if (info == null)
{
Thread.Sleep(1000);
continue;
}
//计划编号
string planCode = Encoding.ASCII.GetString(info.Skip(0).Take(20).ToArray()).Replace("\n","").Trim();
var offLineAmount = obj_sidePanel.plc.ReadInt16("D6051");
RefreshExecInfoEvent?.Invoke($"下线计划号:{planCode}》》》》下线数量:{offLineAmount}", "White");
Console.WriteLine($"计划号:{planCode}》》》》下线数量:{offLineAmount}");
List<RecordSidePanelComplate> sidePanelComplates = _sidePanelComplateServices.Query(x => x.ProductlineCode == stationCode && x.PlanCode == planCode);
sidePanelComplates = sidePanelComplates.OrderByDescending(d=>d.RecordTime).ToList();
RecordSidePanelComplate recordSidePanelComplate = sidePanelComplates.First();
int sumSidePanelAmount = recordSidePanelComplate.OffLineAmount;
if (recordSidePanelComplate.OffLineAmount < offLineAmount)
{
//更新计划数量
ExecutePlanInfo executePlanInfo = _executePlanInfoServices.FirstAsync(x => x.TaskCode == planCode).Result;
var productPlanInfoList = _productPlanInfoServices.FirstAsync(d => d.ProductLineCode.Contains(stationCode) && d.PlanCode.Contains(executePlanInfo.ProductPlanCode)).Result;
productPlanInfoList.CompleteAmount = productPlanInfoList.CompleteAmount + (offLineAmount - recordSidePanelComplate.OffLineAmount);
await _productPlanInfoServices.UpdateAsync(productPlanInfoList);//更新计划
}
}
}
}
/// <summary>
/// 后板下线数量
/// </summary>
public void ReadBackBlanking()
{
while (true)
{
string stationCode = Appsettings.app("StationInfo", "StationCode");
string productLineCode = Appsettings.app("StationInfo", "ProductLineCode");
Thread.Sleep(5000);
obj_sidePanel = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("SidePanelPlc"));
if (obj_sidePanel.plc.IsConnected)
{
byte[] info = obj_sidePanel.plc.Read("D2100", 20);
if (info == null)
{
Thread.Sleep(1000);
continue;
}
//计划编号
string planCode = Encoding.ASCII.GetString(info.Skip(0).Take(20).ToArray()).Replace("\n", "").Trim();
var offLineAmount = obj_sidePanel.plc.ReadInt16("D6051");
RefreshExecInfoEvent?.Invoke($"下线计划号:{planCode}》》》》下线数量:{offLineAmount}", "White");
Console.WriteLine($"计划号:{planCode}》》》》下线数量:{offLineAmount}");
List<RecordSidePanelComplate> sidePanelComplates = _sidePanelComplateServices.Query(x => x.ProductlineCode == stationCode && x.PlanCode == planCode);
sidePanelComplates = sidePanelComplates.OrderByDescending(d => d.RecordTime).ToList();
RecordSidePanelComplate recordSidePanelComplate = sidePanelComplates.First();
int sumSidePanelAmount = recordSidePanelComplate.OffLineAmount;
if (recordSidePanelComplate.OffLineAmount < offLineAmount)
{
//更新计划数量
ExecutePlanInfo executePlanInfo = _executePlanInfoServices.FirstAsync(x => x.TaskCode == planCode).Result;
var productPlanInfoList = _productPlanInfoServices.FirstAsync(d => d.ProductLineCode.Contains(stationCode) && d.PlanCode.Contains(executePlanInfo.ProductPlanCode)).Result;
productPlanInfoList.CompleteAmount = productPlanInfoList.CompleteAmount + (offLineAmount - recordSidePanelComplate.OffLineAmount);
_= _productPlanInfoServices.UpdateAsync(productPlanInfoList).Result;//更新计划
}
}
}
}
}
public class Bin
{
/// <summary>
/// 料仓Id
/// </summary>
public string ProductId { get; set; }
/// <summary>
/// 是否启用
/// </summary>
public bool Status { get; set; }
}
}

@ -1,23 +0,0 @@
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v6.0",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v6.0": {
"HwControlLib/1.0.0": {
"runtime": {
"HwControlLib.dll": {}
}
}
}
},
"libraries": {
"HwControlLib/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
}
}
}

@ -15,7 +15,7 @@ namespace XamlGeneratedNamespace {
/// GeneratedInternalTypeHelper
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "7.0.4.0")]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "7.0.12.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public sealed class GeneratedInternalTypeHelper : System.Windows.Markup.InternalTypeHelper {

@ -8,4 +8,4 @@ build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = HwControlLib
build_property.ProjectDir = E:\桌面\AUCMA_SCADA\HwControlLib\
build_property.ProjectDir = D:\Project\gitea\AUCMA\SCADA\HwControlLib\

@ -4,7 +4,7 @@
library
C#
.cs
E:\桌面\AUCMA_SCADA\HwControlLib\obj\Debug\net6.0-windows\
D:\Project\gitea\AUCMA\SCADA\HwControlLib\obj\Debug\net6.0-windows\
HwControlLib
none
false
@ -13,7 +13,7 @@ TRACE;DEBUG;NET;NET6_0;NETCOREAPP
1204305769
71208292394
194-1617825143
194-2067936865
Themes\Generic.xaml;
False

@ -1,33 +1,28 @@
{
"format": 1,
"restore": {
"E:\\桌面\\AUCMA_SCADA\\HwControlLib\\HwControlLib.csproj": {}
"D:\\Project\\gitea\\AUCMA\\SCADA\\HwControlLib\\HwControlLib.csproj": {}
},
"projects": {
"E:\\桌面\\AUCMA_SCADA\\HwControlLib\\HwControlLib.csproj": {
"D:\\Project\\gitea\\AUCMA\\SCADA\\HwControlLib\\HwControlLib.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "E:\\桌面\\AUCMA_SCADA\\HwControlLib\\HwControlLib.csproj",
"projectUniqueName": "D:\\Project\\gitea\\AUCMA\\SCADA\\HwControlLib\\HwControlLib.csproj",
"projectName": "HwControlLib",
"projectPath": "E:\\桌面\\AUCMA_SCADA\\HwControlLib\\HwControlLib.csproj",
"packagesPath": "C:\\Users\\Lenovo\\.nuget\\packages\\",
"outputPath": "E:\\桌面\\AUCMA_SCADA\\HwControlLib\\obj\\",
"projectPath": "D:\\Project\\gitea\\AUCMA\\SCADA\\HwControlLib\\HwControlLib.csproj",
"packagesPath": "C:\\Users\\admin\\.nuget\\packages\\",
"outputPath": "D:\\Project\\gitea\\AUCMA\\SCADA\\HwControlLib\\obj\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"D:\\开发工具\\Visual Studio 2019\\Shared\\NuGetPackages",
"C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder"
],
"configFilePaths": [
"C:\\Users\\Lenovo\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
"C:\\Users\\admin\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net6.0-windows"
],
"sources": {
"https://api.nuget.org/v3/index.json": {},
"https://nuget.cnblogs.com/v3/index.json": {}
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net6.0-windows7.0": {
@ -63,7 +58,7 @@
"privateAssets": "none"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.202\\RuntimeIdentifierGraph.json"
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.402\\RuntimeIdentifierGraph.json"
}
}
}

@ -5,13 +5,11 @@
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\Lenovo\.nuget\packages\;D:\开发工具\Visual Studio 2019\Shared\NuGetPackages;C:\Program Files\dotnet\sdk\NuGetFallbackFolder</NuGetPackageFolders>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\admin\.nuget\packages\</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.5.0</NuGetToolVersion>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.7.0</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\Lenovo\.nuget\packages\" />
<SourceRoot Include="D:\开发工具\Visual Studio 2019\Shared\NuGetPackages\" />
<SourceRoot Include="C:\Program Files\dotnet\sdk\NuGetFallbackFolder\" />
<SourceRoot Include="C:\Users\admin\.nuget\packages\" />
</ItemGroup>
</Project>

@ -8,34 +8,27 @@
"net6.0-windows7.0": []
},
"packageFolders": {
"C:\\Users\\Lenovo\\.nuget\\packages\\": {},
"D:\\开发工具\\Visual Studio 2019\\Shared\\NuGetPackages": {},
"C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder": {}
"C:\\Users\\admin\\.nuget\\packages\\": {}
},
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "E:\\桌面\\AUCMA_SCADA\\HwControlLib\\HwControlLib.csproj",
"projectUniqueName": "D:\\Project\\gitea\\AUCMA\\SCADA\\HwControlLib\\HwControlLib.csproj",
"projectName": "HwControlLib",
"projectPath": "E:\\桌面\\AUCMA_SCADA\\HwControlLib\\HwControlLib.csproj",
"packagesPath": "C:\\Users\\Lenovo\\.nuget\\packages\\",
"outputPath": "E:\\桌面\\AUCMA_SCADA\\HwControlLib\\obj\\",
"projectPath": "D:\\Project\\gitea\\AUCMA\\SCADA\\HwControlLib\\HwControlLib.csproj",
"packagesPath": "C:\\Users\\admin\\.nuget\\packages\\",
"outputPath": "D:\\Project\\gitea\\AUCMA\\SCADA\\HwControlLib\\obj\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"D:\\开发工具\\Visual Studio 2019\\Shared\\NuGetPackages",
"C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder"
],
"configFilePaths": [
"C:\\Users\\Lenovo\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
"C:\\Users\\admin\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net6.0-windows"
],
"sources": {
"https://api.nuget.org/v3/index.json": {},
"https://nuget.cnblogs.com/v3/index.json": {}
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net6.0-windows7.0": {
@ -71,7 +64,7 @@
"privateAssets": "none"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.202\\RuntimeIdentifierGraph.json"
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.402\\RuntimeIdentifierGraph.json"
}
}
}

@ -1,8 +1,8 @@
{
"version": 2,
"dgSpecHash": "ybnvfUshvvKIc46usGVB7kox/SCKkseLBijIGbMXdvJYCOdNE/0WN/DZO6u3XNrg5fccw9Qd0IkJ00WdmrPlEg==",
"dgSpecHash": "vdyWe2SVons+Y6get5R5Z1bsudk/C2JG+/yY8r3PrvTCQlFwmP/yYc/iedeQUqhixJt2UKO0GhNSvd1iLTRIlw==",
"success": true,
"projectFilePath": "E:\\桌面\\AUCMA_SCADA\\HwControlLib\\HwControlLib.csproj",
"projectFilePath": "D:\\Project\\gitea\\AUCMA\\SCADA\\HwControlLib\\HwControlLib.csproj",
"expectedPackageFiles": [],
"logs": []
}
Loading…
Cancel
Save