wenjy 1 year ago
commit 82f6d76ce7

@ -3206,6 +3206,71 @@
生产新时间
</summary>
</member>
<member name="T:Admin.Core.Model.SmSyncModel">
<summary>
上位机同步钣金设备设置的物料型号
</summary>
</member>
<member name="P:Admin.Core.Model.SmSyncModel.ObjId">
<summary>
主键
</summary>
</member>
<member name="P:Admin.Core.Model.SmSyncModel.SmProductId">
<summary>
产品ID
</summary>
</member>
<member name="P:Admin.Core.Model.SmSyncModel.SmModel">
<summary>
设备设置型号
</summary>
</member>
<member name="P:Admin.Core.Model.SmSyncModel.SyncTime">
<summary>
同步时间
</summary>
</member>
<member name="P:Admin.Core.Model.SmSyncModel.CreateTime">
<summary>
创建时间
</summary>
</member>
<member name="P:Admin.Core.Model.SmSyncModelSub.SmProductId">
<summary>
产品型号编码——主键产品型号
</summary>
</member>
<member name="P:Admin.Core.Model.SmSyncModelSub.OrderCode">
<summary>
产品型号编码——主键产品型号
</summary>
</member>
<member name="P:Admin.Core.Model.SmSyncModelSub.PlanCode">
<summary>
产品型号编码——主键产品型号
</summary>
</member>
<member name="P:Admin.Core.Model.SmSyncModelSub.MaterialCode">
<summary>
物料编码
</summary>
</member>
<member name="P:Admin.Core.Model.SmSyncModelSub.MaterialName">
<summary>
物料名称
</summary>
</member>
<member name="P:Admin.Core.Model.SmSyncModelSub.MaterialModel">
<summary>
对应型号
</summary>
</member>
<member name="P:Admin.Core.Model.SmSyncModelSub.CreateTime">
<summary>
创建时间
</summary>
</member>
<member name="T:Admin.Core.Model.SysUserInfo">
<summary>
用户信息

@ -4052,6 +4052,7 @@
"Aucma.Core.RunPlc": "1.0.0",
"Aucma.Core.Scanner": "1.0.0",
"Aucma.Core.ScannerGun": "1.0.0",
"Aucma.Core.SheetMetalTasks": "1.0.0",
"Aucma.Core.Tasks": "1.0.0",
"Microsoft.AspNetCore.Authentication.JwtBearer": "5.0.9"
},
@ -4236,6 +4237,20 @@
"bin/placeholder/Aucma.Core.ScannerGun.dll": {}
}
},
"Aucma.Core.SheetMetalTasks/1.0.0": {
"type": "project",
"framework": ".NETCoreApp,Version=v6.0",
"dependencies": {
"Admin.Core.IService": "1.0.0",
"Aucma.Core.HwPLc": "1.0.0"
},
"compile": {
"bin/placeholder/Aucma.Core.SheetMetalTasks.dll": {}
},
"runtime": {
"bin/placeholder/Aucma.Core.SheetMetalTasks.dll": {}
}
},
"Aucma.Core.Tasks/1.0.0": {
"type": "project",
"framework": ".NETCoreApp,Version=v6.0",
@ -11239,6 +11254,11 @@
"path": "../Aucma.Core.ScannerGun/Aucma.Core.ScannerGun.csproj",
"msbuildProject": "../Aucma.Core.ScannerGun/Aucma.Core.ScannerGun.csproj"
},
"Aucma.Core.SheetMetalTasks/1.0.0": {
"type": "project",
"path": "../Aucma.Core.SheetMetalTasks/Aucma.Core.SheetMetalTasks.csproj",
"msbuildProject": "../Aucma.Core.SheetMetalTasks/Aucma.Core.SheetMetalTasks.csproj"
},
"Aucma.Core.Tasks/1.0.0": {
"type": "project",
"path": "../Aucma.Core.Tasks/Aucma.Core.Tasks.csproj",

@ -23,7 +23,8 @@
<ProjectReference Include="..\Aucma.Core.RunPlc\Aucma.Core.RunPlc.csproj" />
<ProjectReference Include="..\Aucma.Core.ScannerGun\Aucma.Core.ScannerGun.csproj" />
<ProjectReference Include="..\Aucma.Core.Scanner\Aucma.Core.Scanner.csproj" />
<ProjectReference Include="..\Aucma.Core.Tasks\Aucma.Core.Tasks.csproj" />
<ProjectReference Include="..\Aucma.Core.SheetMetalTasks\Aucma.Core.SheetMetalTasks.csproj" />
<ProjectReference Include="..\Aucma.Core.Tasks\Aucma.Core.Tasks.csproj" />
</ItemGroup>
</Project>

@ -1,34 +1,31 @@
using Admin.Core.Common;
using Aucma.Core.SheetMetalTasks;
using log4net;
using Microsoft.AspNetCore.Builder;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Admin.Core.Extensions.Middlewares
{
public static class AucamSheetMetalTaskMildd
{
private static readonly ILog log = LogManager.GetLogger(typeof(AucamSheetMetalTaskMildd));
//public static async void UseAucamSheetMetalTaskMildds(this IApplicationBuilder app, IAucamSheetMetalTaskService aucamTaskService)
//{
// if (app == null) throw new ArgumentNullException(nameof(app));
public static async void UseAucamSheetMetalTaskMildds(this IApplicationBuilder app, IAucamSheetMetalTaskService aucamSheetMetalTaskService)
{
if (app == null) throw new ArgumentNullException(nameof(app));
// try
// {
// if (Appsettings.app("Middleware", "AucamTask", "Enabled").ObjToBool())
// {
// await aucamTaskService.AucamTaskAsync();
// Console.WriteLine("澳柯玛钣金定时服务已开启");
// }
// }
// catch (Exception e)
// {
// log.Error($"An error was reported when starting the job service.\n{e.Message}");
// throw;
// }
//}
try
{
if (Appsettings.app("Middleware", "AucamTask", "Enabled").ObjToBool())
{
await aucamSheetMetalTaskService.SheetMetalTasks();
Console.WriteLine("钣金服务已开启");
}
}
catch (Exception e)
{
log.Error($"An error was reported when starting the job service.\n{e.Message}");
throw;
}
}
}
}

@ -1,40 +1,32 @@
using Admin.Core.Common;
using Admin.Core.Tasks;
using Aucma.Core.Scanner;
using Aucma.Core.Tasks;
using Aucma.Core.SheetMetalTasks;
using Microsoft.Extensions.DependencyInjection;
using Quartz;
using Quartz.Spi;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
namespace Admin.Core.Extensions
{
/// <summary>
/// 启动服务
/// 启动钣金服务
/// </summary>
public static class AucamSheetMetalTaskSetup
{
public static void AddAucmaSheetMetalTaskSetup(this IServiceCollection services)
{
//services.AddSingleton<IAucamSheetMetalTaskService, AucamSheetMetalTaskService>();
services.AddSingleton<IAucamSheetMetalTaskService, AucamSheetMetalTaskService>();
//var baseType = typeof(IAucamSheetMetalTaskService);
//var path = AppDomain.CurrentDomain.RelativeSearchPath ?? AppDomain.CurrentDomain.BaseDirectory;
//var referencedAssemblies = System.IO.Directory.GetFiles(path, "Aucma.SheetMetalCore.Tasks.dll").Select(Assembly.LoadFrom).ToArray();
//var types = referencedAssemblies
// .SelectMany(a => a.DefinedTypes)
// .Select(type => type.AsType())
// .Where(x => x != baseType && baseType.IsAssignableFrom(x)).ToArray();
//var implementTypes = types.Where(x => x.IsClass).ToArray();
//foreach (var implementType in implementTypes)
//{
// services.AddTransient(implementType);
//}
var baseType = typeof(IAucamSheetMetalTaskService);
var path = AppDomain.CurrentDomain.RelativeSearchPath ?? AppDomain.CurrentDomain.BaseDirectory;
var referencedAssemblies = System.IO.Directory.GetFiles(path, "Aucma.SheetMetalCore.Tasks.dll").Select(Assembly.LoadFrom).ToArray();
var types = referencedAssemblies
.SelectMany(a => a.DefinedTypes)
.Select(type => type.AsType())
.Where(x => x != baseType && baseType.IsAssignableFrom(x)).ToArray();
var implementTypes = types.Where(x => x.IsClass).ToArray();
foreach (var implementType in implementTypes)
{
services.AddTransient(implementType);
}
}
}
}

@ -0,0 +1,15 @@
using Admin.Core.Model;
using Admin.Core.Model.Model_New;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Admin.Core.IRepository
{
/// <summary>
/// ISmSyncModelRepository
/// </summary>
public interface ISmSyncModelRepository : IBaseRepository<SmSyncModel>
{
}
}

@ -0,0 +1,11 @@
using Admin.Core.Model;
namespace Admin.Core.IRepository
{
/// <summary>
/// ISmSyncModelSubRepository
/// </summary>
public interface ISmSyncModelSubRepository : IBaseRepository<SmSyncModelSub>
{
}
}

@ -0,0 +1,12 @@
using Admin.Core.Model;
namespace Admin.Core.IService
{
/// <summary>
/// ISmSyncModelServices
/// </summary>
public interface ISmSyncModelServices : IBaseServices<SmSyncModel>
{
}
}

@ -0,0 +1,16 @@
using Admin.Core.IService;
using Admin.Core.Model;
using Admin.Core.Model.ViewModels;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Admin.Core.IService
{
/// <summary>
/// ISmSyncModelSubServices
/// </summary>
public interface ISmSyncModelSubServices : IBaseServices<SmSyncModelSub>
{
}
}

@ -0,0 +1,46 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Admin.Core.Model
{
/// <summary>
/// 上位机同步钣金设备设置的物料型号
/// </summary>
[SugarTable("SM_SYNCMODEL", "AUCMA_SCADA")]
public class SmSyncModel
{
/// <summary>
/// 主键
/// </summary>
[SugarColumn(ColumnName = "OBJ_ID", IsPrimaryKey = true, OracleSequenceName = "SEQ_SMSYNCMODEL")]
public float ObjId { get; set; }
/// <summary>
/// 产品ID
/// </summary>
[SugarColumn(ColumnName = "SM_PRODUCTID")]
public string SmProductId { get; set; }
/// <summary>
/// 设备设置型号
/// </summary>
[SugarColumn(ColumnName = "SM_MODEL")]
public string SmModel { get; set; }
/// <summary>
/// 同步时间
/// </summary>
[SugarColumn(ColumnName = "SYNC_TIME")]
public DateTime SyncTime { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[SugarColumn(ColumnName = "CREATE_TIME")]
public DateTime CreateTime { get; set; }
}
}

@ -0,0 +1,52 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Admin.Core.Model
{
[SugarTable("SM_SYNCMODELSUB", "AUCMA_SCADA")]
public class SmSyncModelSub
{
[SugarColumn(ColumnName = "OBJ_ID", IsPrimaryKey = true, OracleSequenceName = "SEQ_SYNCMODELSUB")]
public int ObjId { get; set; }
/// <summary>
/// 产品型号编码——主键产品型号
/// </summary>
[SugarColumn(ColumnName = "SM_PRODUCTID")]
public string SmProductId { get; set; }
/// <summary>
/// 产品型号编码——主键产品型号
/// </summary>
[SugarColumn(ColumnName = "ORDER_CODE")]
public string OrderCode { get; set; }
/// <summary>
/// 产品型号编码——主键产品型号
/// </summary>
[SugarColumn(ColumnName = "PLAN_CODE")]
public string PlanCode { get; set; }
/// <summary>
/// 物料编码
/// </summary>
[SugarColumn(ColumnName = "MATERIAL_CODE")]
public string MaterialCode { get; set; }
/// <summary>
/// 物料名称
/// </summary>
[SugarColumn(ColumnName = "MATERIAL_NAME")]
public string MaterialName { get; set; }
/// <summary>
/// 对应型号
/// </summary>
[SugarColumn(ColumnName = "MATERIAL_MODEL")]
public string MaterialModel { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[SugarColumn(ColumnName = "CREATE_TIME")]
public DateTime CreateTime { get; set; }
}
}

@ -55,12 +55,12 @@ namespace Admin.Core.RealTimeService
//AutoMapper
services.AddAutoMapperSetup();
//PLC
services.AddPlcSetup();
//services.AddPlcSetup();
//任务调度
services.AddJobSetup();
//services.AddJobSetup();
//任务
// services.AddAucmaTaskSetup();
//services.AddScannerGunSetup();
services.AddScannerGunSetup();
//支持编码大全 例如:支持 System.Text.Encoding.GetEncoding("GB2312") System.Text.Encoding.GetEncoding("GB18030")
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
}
@ -81,15 +81,15 @@ namespace Admin.Core.RealTimeService
/// </summary>
/// <param name="app"></param>
/// <param name="env"></param>
public void Configure(IApplicationBuilder app, IRunPlcService plc, ISysTasksQzService tasksQzService, ISchedulerCenter schedulerCenter)
public void Configure(IApplicationBuilder app, IScannerGunService scannerGun)//, IRunPlcService plc, ISysTasksQzService tasksQzService, ISchedulerCenter schedulerCenter
{
// 使用静态文件
app.UseStaticFiles();
//app.AucmaTaskMildds(aucamTaskService);
app.UsePlcMildd(plc);
//app.UsePlcMildd(plc);
// 开启QuartzNetJob调度服务
app.UseQuartzJobMildd(tasksQzService, schedulerCenter);
//app.UseScannerGunMildd(scannerGun);
//app.UseQuartzJobMildd(tasksQzService, schedulerCenter);
app.UseScannerGunMildd(scannerGun);
}

@ -162,10 +162,10 @@
},
"Middleware": {
"QuartzNetJob": {
"Enabled": true
"Enabled": false
},
"ScannerGun": {
"Enabled": false
"Enabled": true
},
"AucamTask": {
"Enabled": false

@ -0,0 +1,15 @@
using Admin.Core.IRepository;
using Admin.Core.Model;
namespace Admin.Core.Repository
{
/// <summary>
/// ISmSyncModelRepository
/// </summary>
public class SmSyncModelRepository : BaseRepository<SmSyncModel>, ISmSyncModelRepository
{
public SmSyncModelRepository(IUnitOfWork unitOfWork) : base(unitOfWork)
{
}
}
}

@ -0,0 +1,18 @@
using Admin.Core.IRepository;
using Admin.Core.Model;
using Admin.Core.Model.Model_New;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Admin.Core.Repository
{
/// <summary>
/// SmSyncModelSubRepository
/// </summary>
public class SmSyncModelSubRepository : BaseRepository<SmSyncModelSub>, ISmSyncModelSubRepository
{
public SmSyncModelSubRepository(IUnitOfWork unitOfWork) : base(unitOfWork)
{
}
}
}

@ -0,0 +1,25 @@
using Admin.Core.IRepository;
using Admin.Core.IService;
using Admin.Core.Model;
using Admin.Core.Model.ViewModels;
using log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Admin.Core.Service
{
public class SmSyncModelServices : BaseServices<SmSyncModel>, ISmSyncModelServices
{
private static readonly log4net.ILog logHelper = LogManager.GetLogger(typeof(SmSyncModelServices));
private readonly IBaseRepository<SmSyncModel> _dal;
public SmSyncModelServices(IBaseRepository<SmSyncModel> dal)
{
this._dal = dal;
base.BaseDal = dal;
}
}
}

@ -0,0 +1,29 @@
using Admin.Core.IRepository;
using Admin.Core.IService;
using Admin.Core.Model;
using Admin.Core.Model.Model_New;
using Admin.Core.Model.ViewModels;
using log4net;
using Microsoft.AspNetCore.Razor.TagHelpers;
using Microsoft.IdentityModel.Logging;
using NPOI.XSSF.UserModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Admin.Core.Service
{
public class SmSyncModelSubServices : BaseServices<SmSyncModelSub>, ISmSyncModelSubServices
{
private static readonly log4net.ILog logHelper = LogManager.GetLogger(typeof(BaseBomInfoServices));
private readonly IBaseRepository<SmSyncModelSub> _dal;
public SmSyncModelSubServices(IBaseRepository<SmSyncModelSub> dal)
{
this._dal = dal;
base.BaseDal = dal;
}
}
}

@ -87,6 +87,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aucam.Core.TemperatureServi
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aucma.Core.PrintTo", "Aucma.Core.PrintTo\Aucma.Core.PrintTo.csproj", "{AC2B98A8-09CF-42A5-93B5-DF74185B8D3A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aucma.Core.SheetMetalTasks", "Aucma.Core.SheetMetalTasks\Aucma.Core.SheetMetalTasks.csproj", "{F78F41F3-8B38-4CA1-A254-C18CCDCA8291}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -217,6 +219,10 @@ Global
{AC2B98A8-09CF-42A5-93B5-DF74185B8D3A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AC2B98A8-09CF-42A5-93B5-DF74185B8D3A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AC2B98A8-09CF-42A5-93B5-DF74185B8D3A}.Release|Any CPU.Build.0 = Release|Any CPU
{F78F41F3-8B38-4CA1-A254-C18CCDCA8291}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F78F41F3-8B38-4CA1-A254-C18CCDCA8291}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F78F41F3-8B38-4CA1-A254-C18CCDCA8291}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F78F41F3-8B38-4CA1-A254-C18CCDCA8291}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -256,6 +262,7 @@ Global
{A1473270-1D54-40D5-9E68-5C917347CFE8} = {F8FB57F6-5465-4E60-B052-D3A63C3C56AE}
{87B08C88-4258-4D57-B9E5-EC6C7F3899BC} = {FA2FF2A3-135E-4CA2-9042-76BB71623D5A}
{AC2B98A8-09CF-42A5-93B5-DF74185B8D3A} = {BD987F3A-4E6C-4C47-B28F-1671F875EAE3}
{F78F41F3-8B38-4CA1-A254-C18CCDCA8291} = {F8FB57F6-5465-4E60-B052-D3A63C3C56AE}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8047AB56-042B-4AE4-B06A-34137067A86A}

@ -9,6 +9,7 @@ using Admin.Core.Service;
using Admin.Core.Tasks;
using Aucma.Core.RunPlc;
using Aucma.Core.Scanner;
using Aucma.Core.ScannerGun;
using Autofac;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
@ -64,6 +65,8 @@ namespace Aucma.Core.CodeBinding
//扫码器
services.AddScannerSetup();
// ɨÂëǹ
services.AddScannerGunSetup();
//任务调度
services.AddJobSetup();
@ -89,7 +92,7 @@ namespace Aucma.Core.CodeBinding
/// </summary>
/// <param name="app"></param>
/// <param name="env"></param>
public void Configure(IApplicationBuilder app, IScannerService scannerService, IRunPlcService runPlcService, ISysTasksQzService tasksQzService, ISchedulerCenter schedulerCenter) // ISysTasksQzService tasksQzService, ISchedulerCenter schedulerCenter
public void Configure(IApplicationBuilder app, IScannerService scannerService, IScannerGunService scannerGunService, IRunPlcService runPlcService, ISysTasksQzService tasksQzService, ISchedulerCenter schedulerCenter) // ISysTasksQzService tasksQzService, ISchedulerCenter schedulerCenter
{
// 使用静态文件
app.UseStaticFiles();
@ -97,6 +100,9 @@ namespace Aucma.Core.CodeBinding
//app.UseAuthorization();
//开启扫码服务
app.UseScannerMildd(scannerService);
//¿ªÆôɨÂëǹ·þÎñ
app.UseScannerGunMildd(scannerGunService);
// 开启QuartzNetJob调度服务
app.UseQuartzJobMildd(tasksQzService, schedulerCenter);
//PLC

@ -201,7 +201,7 @@
"Name": "扫码器2"
},
"ScannerGun": { //
"Enabled": false
"Enabled": true
}
},
"PLCServer": [

@ -23,10 +23,11 @@ namespace Aucma.Core.ScannerGun
public static void InstanceSerialPort3(string portName)
{
string port = System.IO.Ports.SerialPort.GetPortNames().FirstOrDefault();
//实例化串行端口
SerialPort serialPort = new SerialPort();
//端口名 注:因为使用的是USB转RS232 所以去设备管理器中查看一下虚拟com口的名字
serialPort.PortName = portName;
serialPort.PortName = port;// portName;
//波特率
serialPort.BaudRate = 9600;
//奇偶校验
@ -77,7 +78,7 @@ namespace Aucma.Core.ScannerGun
return;
}
//业务处理
Console.WriteLine(code.Trim());
Console.WriteLine("获取数据:"+code.Trim());
}
catch (Exception ex)
{

@ -7,6 +7,12 @@
</ApplicationDefinition>
</ItemGroup>
<ItemGroup>
<Compile Update="Views\BomMaintenancePageView.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="Views\CorrespondingModelPageView.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="Views\LogPageView.xaml.cs">
<SubType>Code</SubType>
</Compile>
@ -30,6 +36,12 @@
<Page Update="Assets\Styles\DefaultStyles.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="Views\BomMaintenancePageView.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="Views\CorrespondingModelPageView.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="Views\IndexPageView.xaml">
<SubType>Designer</SubType>
</Page>

@ -1,5 +1,6 @@
using Admin.Core.Common;
using Admin.Core.Extensions;
using Admin.Core.Extensions.Middlewares;
using Admin.Core.IRepository;
using Admin.Core.IService;
using Admin.Core.IService.ISys;
@ -8,6 +9,7 @@ using Admin.Core.Repository;
using Admin.Core.Service;
using Admin.Core.Tasks;
using Aucma.Core.RunPlc;
using Aucma.Core.SheetMetalTasks;
using Autofac;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
@ -64,7 +66,7 @@ namespace Aucma.Core.SheetMetal
//services.AddJobSetup();
//PLC
services.AddPlcSetup();
// services.AddAucmaTaskSetup();
services.AddAucmaSheetMetalTaskSetup();
//支持编码大全 例如:支持 System.Text.Encoding.GetEncoding("GB2312") System.Text.Encoding.GetEncoding("GB18030")
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
}
@ -85,7 +87,7 @@ namespace Aucma.Core.SheetMetal
/// </summary>
/// <param name="app"></param>
/// <param name="env"></param>
public void Configure(IApplicationBuilder app, IRunPlcService runPlcService)
public void Configure(IApplicationBuilder app, IRunPlcService runPlcService, IAucamSheetMetalTaskService aucamSheetMetalTaskService )
{
// 使用静态文件
app.UseStaticFiles();
@ -93,6 +95,8 @@ namespace Aucma.Core.SheetMetal
//app.UseQuartzJobMildd(tasksQzService, schedulerCenter);
//PLC
app.UsePlcMildd(runPlcService);
//澳柯玛任务处理中间件
app.UseAucamSheetMetalTaskMildds(aucamSheetMetalTaskService);
}
#region 注册服务

@ -0,0 +1,160 @@
using Admin.Core.Common;
using Admin.Core.IService;
using Admin.Core.Model;
using Admin.Core.Service;
using Aucma.Core.SheetMetal.Models;
using Aucma.Core.SheetMetal.Views;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using Microsoft.Extensions.DependencyInjection;
using System.Collections.ObjectModel;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
namespace Aucma.Core.SheetMetal.ViewModels
{
public partial class BomMaintenancePageViewModel : ObservableObject
{
private readonly ISmSyncModelServices _smSyncModelServices;
private readonly ISmSyncModelSubServices _smSyncModelSubServices;
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);
OnLoadData();
}
public void OnLoadData()
{
var list = _smSyncModelServices.QueryAsync().Result;
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)
{
item.ObjId = i;
smSyncModelDateilDataGrid.Add(item);
i++;
}
}
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)
{
item.ObjId = i;
smSyncModelDateilDataGrid.Add(item);
i++;
}
}
#region 查询按钮
/// <summary>
/// 查询按钮
/// </summary>
/// <returns></returns>
[RelayCommand]
public async Task QueryModel(string param)
{
var list=await _smSyncModelServices.QueryAsync(d=>d.SmModel.Contains(param));
foreach (var item in list)
{
SmSyncModelDataGrid.Add(item);
}
}
#endregion
#region 查询按钮
/// <summary>
/// 查询按钮
/// </summary>
/// <returns></returns>
[RelayCommand]
public async Task DeleteBom(object obj)
{
int id = (int)obj;
var result = await _smSyncModelServices.DeleteByIdAsync(id);
if (result)
{
MessageBox.Show("删除成功!", "系统提醒", MessageBoxButton.OK);
}
}
#endregion
#region 同步钣金型号按钮
/// <summary>
/// 同步钣金型号按钮
/// </summary>
/// <returns></returns>
[RelayCommand]
public Task SyncModel()
{
//获取PLC设置好的点位 一共四个上料分垛
return Task.FromResult(0);
}
#endregion
#region 设置钣金型号对应关系
/// <summary>
/// 设置钣金型号对应关系
/// </summary>
/// <returns></returns>
[RelayCommand]
public Task SetProduct(string id)
{
//获取PLC设置好的点位 一共四个上料分垛
CorrespondingModelPageView view = new CorrespondingModelPageView(id);
view.ShowDialog();
return Task.FromResult(0);
}
#endregion
#region 初始化datagrid
private ObservableCollection<SmSyncModel> smSyncModelDataGrid = new ObservableCollection<SmSyncModel>();
public ObservableCollection<SmSyncModel> SmSyncModelDataGrid
{
get { return smSyncModelDataGrid; }
set
{
smSyncModelDataGrid = value;
OnPropertyChanged();//属性通知
}
}
#endregion
#region 初始化datagrid
private ObservableCollection<SmSyncModelSub> smSyncModelDateilDataGrid = new ObservableCollection<SmSyncModelSub>();
public ObservableCollection<SmSyncModelSub> SmSyncModelDateilDataGrid
{
get { return smSyncModelDateilDataGrid; }
set
{
smSyncModelDateilDataGrid = value;
OnPropertyChanged();//属性通知
}
}
#endregion
}
}

@ -0,0 +1,444 @@
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using Aucma.Core.SheetMetal.Models;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using Admin.Core.IService;
using log4net;
using Microsoft.Extensions.DependencyInjection;
using Admin.Core.Model;
using Castle.Core.Internal;
using CommunityToolkit.Mvvm.Messaging;
using Aucma.Core.SheetMetal.Views;
using Aucma.Core.SheetMetal.Common;
using Admin.Core.Common;
using Admin.Core.Service;
namespace Aucma.Core.SheetMetal.ViewModels
{
public partial class CorrespondingModelPageViewModel : ObservableObject
{
#region 刷新创建计划
/// <summary>
/// 刷新创建计划
/// </summary>
public delegate void RefreshSetBomDataGrid(string smProductId);
public static event RefreshSetBomDataGrid RefreshSetBomDataGridEvent;
#endregion
private static readonly log4net.ILog log = LogManager.GetLogger(typeof(SplitPlanViewModel));
protected readonly IProductPlanInfoServices? _productPlanInfoServices;
protected readonly IExecutePlanInfoServices? _executePlanInfoServices;
private readonly ISmSyncModelSubServices _smSyncModelSubServices;
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>();
Task.WaitAll(LoadData());
//加载快捷方式
SaveSearchCriteria();
//WeakReferenceMessenger.Default.Register<string>(this, SaveSearchCriteria);
_radioButtonStatus = 1;
ProductId = productId;
}
#endregion
#region 加载DataGrid数据
private async Task LoadData()
{
try
{
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)
{
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()
{
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
});
i++;
}
}
catch (Exception ex)
{
log.Error($"初始化查询:{ex.Message}");
}
await Task.CompletedTask;
}
private async Task LoadData(string obj)
{
try
{
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)
{
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()
{
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
});
i++;
}
}
catch (Exception ex)
{
log.Error($"根据搜索条件查询:{ex.Message}");
}
await Task.CompletedTask;
}
#endregion
#region 初始化datagrid
private ObservableCollection<ProductPlanInfoModel> materialDataGrid = new ObservableCollection<ProductPlanInfoModel>();
public ObservableCollection<ProductPlanInfoModel> MaterialDataGrid
{
get => materialDataGrid;
set => SetProperty(ref materialDataGrid, value);
}
#endregion
#region 查询
/// <summary>
/// 查询
/// </summary>
[RelayCommand]
private async Task QueryPlan(string obj)
{
if (obj.IsNullOrEmpty())
{
System.Windows.Application.Current.Dispatcher.Invoke((Action)(async () =>
{
MaterialDataGrid.Clear();
await LoadData();
}));
return;
}
MaterialDataGrid.Clear();
await LoadData(obj);
}
#endregion
#region 绑定BOM
/// <summary>
/// 绑定BOM
/// </summary>
[RelayCommand]
private async void AddBom(string orderCode)
{
if (!orderCode.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)
{
MessageBox.Show("设置成功!","系统提醒",MessageBoxButton.OK);
RefreshSetBomDataGridEvent?.Invoke(ProductId);
}
return;
}
}
#endregion
#region 获取当前行数据 赋值到textbox
private ProductPlanInfoModel selectedCells;
public ProductPlanInfoModel SelectedCells
{
get { return selectedCells; }
set
{
selectedCells = value;
SetProperty(ref selectedCells, value);
}
}
#endregion
#region 关闭当前窗口
/// <summary>
/// 关闭当前窗口
/// </summary>
public void CloseWindow()
{
WeakReferenceMessenger.Default.Send<object>("close");
}
#endregion
#region 参数定义
private string _productId = string.Empty;
public string ProductId
{
get => _productId;
set => SetProperty(ref _productId, value);
}
private string _search = string.Empty;
public string Search
{
get => _search;
set => SetProperty(ref _search, value);
}
/// <summary>
/// 下拉框
/// </summary>
public string _materialTypeCombox;
public string MaterialTypeCombox
{
get => _materialTypeCombox;
set => SetProperty(ref _materialTypeCombox, value);
}
#region 多选按钮
/// <summary>
/// 多选按钮
/// </summary>
public int _radioButtonStatus;
public int RadioButtonStatus
{
get => _radioButtonStatus;
set => SetProperty(ref _radioButtonStatus, value);
}
#endregion
private ObservableCollection<string> _configurations = new ObservableCollection<string>();
public ObservableCollection<string> Configurations
{
get => _configurations;
set => SetProperty(ref _configurations, value);
}
private ProductPlanInfoModel selectedDataItem;
public ProductPlanInfoModel SelectedDataItem
{
get => selectedDataItem;
set => SetProperty(ref selectedDataItem, value);
}
#endregion
#region 重置
/// <summary>
/// 重置
/// </summary>
[RelayCommand]
public async Task Reset()
{
Search = string.Empty;
MaterialTypeCombox = string.Empty;
await this.LoadData();
}
#endregion
#region 搜索条件设置
/// <summary>
/// 搜索条件设置
/// </summary>
[RelayCommand]
public async Task SearchCriteriaSet()
{
SearchCriteriaView searchCriteriaWindow = new SearchCriteriaView();
bool? dialogResult = searchCriteriaWindow.ShowDialog();
if (dialogResult == false) // 用户点击了“取消”按钮或关闭窗口
{
await LoadData();
}
}
#endregion
#region 查询快捷查询方式
private void SaveSearchCriteria(object recipient, string message)
{
if (message == "RefreshSearchItems")
{
Configurations = new ObservableCollection<string>();
var searchItems = appConfig.searchItems;
var split = searchItems.Split('%');
foreach (var item in split)
{
if (!string.IsNullOrEmpty(item))
{
Configurations.Add(item);
}
}
}
}
private void SaveSearchCriteria()
{
Configurations = new ObservableCollection<string>();
var searchItems = appConfig.searchItems;
var split = searchItems.Split('%');
foreach (var item in split)
{
if (!string.IsNullOrEmpty(item))
{
Configurations.Add(item);
}
}
}
#endregion
#region 双击事件
public void MouseClick(object obj)
{
var info = SelectedDataItem as ProductPlanInfoModel;
if (info != null)
{
info.PlanType = _radioButtonStatus;
QuantityIssuedView quantityIssuedWindow = new QuantityIssuedView(info);
quantityIssuedWindow.ShowDialog();
}
}
/// <summary>
/// 鼠标双击事件
/// </summary>
[RelayCommand]
public void DoubleMouseClick()
{
MessageBox.Show("双击事件");
}
#endregion
#region 快捷查询
/// <summary>
/// 快捷查询
/// </summary>
/// <param name="selectedOption"></param>
/// <returns></returns>
[RelayCommand]
public async Task RadioButton(string selectedOption)
{
string productLineCode = Appsettings.app("StationInfo", "StationCode");
MaterialDataGrid.Clear();
if (!string.IsNullOrEmpty(selectedOption))
{
await LoadData(selectedOption);
}
else
{
await LoadData();
}
}
#endregion
#region 按钮
/// <summary>
/// 按钮
/// </summary>
/// <returns></returns>
[RelayCommand]
public void UpdateRadioButtonStatus(string status)
{
if (status == "status1")
{
_radioButtonStatus = 1;
}
if (status == "status2")
{
_radioButtonStatus = 2;
}
if (status == "status3")
{
_radioButtonStatus = 3;
}
}
#endregion
#region 获取最大值
/// <summary>
/// 获取最大值
/// </summary>
/// <param name="taskCode">MES编码</param>
/// <returns></returns>
public string GetMaxNum(string mesId)
{
try
{
List<int> tempList = new List<int>();
var list = _executePlanInfoServices.QueryAsync(d => d.TaskCode.Contains(mesId)).Result;
if (list.Count() == 0)
{
return mesId + "0001";
}
foreach (var item in list)
{
string code = item.TaskCode.Substring(item.TaskCode.Length - 4);
int num = Convert.ToInt32(code);
tempList.Add(num);
}
string maxStr = (tempList.Max() + 1).ToString();
string taskCode = maxStr.PadLeft(4, '0');
return taskCode;
}
catch
{
return mesId + "0001";
}
}
#endregion
}
}

@ -24,6 +24,7 @@ using Aucma.Core.HwPLc;
using System.Text;
using System.Threading;
using Admin.Core.Model.Model_New;
using Aucma.Core.SheetMetalTasks;
/*
*
*/
@ -76,20 +77,20 @@ namespace Aucma.Core.SheetMetal.ViewModels
_baseBomInfoServices = App.ServiceProvider.GetService<IBaseBomInfoServices>();
_sysUserInfoServices = App.ServiceProvider.GetService<ISysUserInfoServices>();
_recordInstoreServices = App.ServiceProvider.GetService<IRecordInStoreServices>();
//Task.WaitAll(LoadData());
Task.WaitAll(LoadData());
AddSelectData();//添加下拉菜单
//RefreshHourAmount();//小时产量
//RefreshMaterialStats();//型号产量
RefreshHourAmount();//小时产量
RefreshMaterialStats();//型号产量
//——测试——
InitEveryDayMethod();//小时产量
InitExecMethod();//执行列表
LoadDataTest();
//InitEveryDayMethod();//小时产量
//InitExecMethod();//执行列表
//LoadDataTest();
//——测试 end——
//SheetMetalPlanTaskHandle.RefreshCurrentPlanInfoEvent += RefreshCurrentPlanInfo;
//QuantityIssuedViewModel.RefreshCretaePlanInfoEvent += LoadData;
//SheetMetalPlanTaskHandle.RefreshCreatePlanInfoEvent += LoadData;
//SheetMetalPlanTaskHandle.RefreshChatEvent += RefreshChat;
//SheetMetalPlanTaskHandle.RefreshPlanInfoEvent += RefreshPlanShow;
AucamSheetMetalTaskService.RefreshCurrentPlanInfoEvent += RefreshCurrentPlanInfo;
QuantityIssuedViewModel.RefreshCretaePlanInfoEvent += LoadData;
AucamSheetMetalTaskService.RefreshCreatePlanInfoEvent += LoadData;
AucamSheetMetalTaskService.RefreshChatEvent += RefreshChat;
AucamSheetMetalTaskService.RefreshPlanInfoEvent += RefreshPlanShow;
}
#endregion

@ -13,6 +13,7 @@ using System.Windows.Documents;
using Admin.Core.Tasks;
using Aucma.Core.SheetMetal.Business;
using Aucma.Core.SheetMetal.Models;
using Aucma.Core.SheetMetalTasks;
namespace Aucma.Core.SheetMetal.ViewModels
{
@ -22,7 +23,7 @@ namespace Aucma.Core.SheetMetal.ViewModels
private ObservableCollection<ListBoxDataView> listItems = new ObservableCollection<ListBoxDataView>();
public LogPageViewModel()
{
SheetMetalPlanTaskHandle.RefreshExecInfoEvent += PrintMessageToListBox;
AucamSheetMetalTaskService.RefreshExecInfoEvent += PrintMessageToListBox;
}
/// <summary>

@ -26,39 +26,47 @@ namespace Aucma.Core.SheetMetal.ViewModels
public partial class MainWindowViewModel : ObservableObject
{
private static readonly log4net.ILog log = LogManager.GetLogger(typeof(MainWindowViewModel));
private ISysUserInfoServices _sysUserInfoServices;
private IndexPageView firstPage = new IndexPageView();//首页
private LogPageView logPage = new LogPageView();//日志
private BomMaintenancePageView bomMaintenancePageView = new BomMaintenancePageView();//钣金设备BOM维护
private StatisticsPageView statisticsPage = new StatisticsPageView();//统计
private SheetMetalPlanTaskHandle _taskHandle = new SheetMetalPlanTaskHandle();
ISysUserInfoServices _sysUserInfoServices;
#region 构造函数
public MainWindowViewModel()
{
_sysUserInfoServices = App.ServiceProvider.GetService<ISysUserInfoServices>();
UserContent = firstPage;
init();
Task.Run(() =>
{
//_taskHandle.InitSendPlan();
_taskHandle.InitSendBackPanelPlan();
});
Task.Run(() =>
{
_taskHandle.InitSendSidePanelPlan();
});
Task.Run(async () =>
{
await RefreshTeamTime();//班组时间
});
Task.Run( () =>
{
_taskHandle.UpdateComplatePlan();//更新计划数
await RefreshTeamTime();//班组时间
});
//Task.Run(() =>
//{
// //_taskHandle.InitSendPlan();
// _taskHandle.InitSendBackPanelPlan();
//});
//Task.Run(() =>
//{
// _taskHandle.InitSendSidePanelPlan();
//});
//Task.Run( () =>
//{
// _taskHandle.UpdateComplatePlan();//更新计划数
//});
DispatcherTimer timer = new DispatcherTimer();
timer.Interval = new TimeSpan(0, 0, 1); //间隔1秒
timer.Tick += new EventHandler(timer_Tick);
timer.Start();
}
#endregion
#region 初始化班组刷新定时任务
public void init()
{
// 设备状态刷新定时器
@ -67,24 +75,26 @@ namespace Aucma.Core.SheetMetal.ViewModels
timer.AutoReset = true;
timer.Enabled = true;
timer.Start();
}
}
#endregion
#region 刷新上班时间
public async Task RefreshTeamTime()
{
while (true)
{
var list= await _sysUserInfoServices.GetTeamData();
if (list!=null&& list.Count>0)
var list = await _sysUserInfoServices.GetTeamData();
if (list != null && list.Count > 0)
{
var sysUserInfo=list.First();
TeamName = $"{sysUserInfo.TeamName}({list.Min(d=>d.StartTime).ToString("HH:mm")}~{list.Max(d => d.EndTime).ToString("HH:mm")})";
var sysUserInfo = list.First();
TeamName = $"{sysUserInfo.TeamName}({list.Min(d => d.StartTime).ToString("HH:mm")}~{list.Max(d => d.EndTime).ToString("HH:mm")})";
//TeamName = $"{sysUserInfo.TeamName}";
}
Thread.Sleep(5000);
}
}
#endregion
#region 设备状态刷新
/// <summary>
@ -253,10 +263,13 @@ namespace Aucma.Core.SheetMetal.ViewModels
break;
case "LogPage":
UserContent = logPage;
break;
break;
case "StatisticsPage":
UserContent = statisticsPage;
break;
case "BomPage":
UserContent = bomMaintenancePageView;
break;
default:
break;
}
@ -422,7 +435,6 @@ namespace Aucma.Core.SheetMetal.ViewModels
}
#endregion
#region 刷新时间
public string _currentDateTime;
@ -445,15 +457,15 @@ namespace Aucma.Core.SheetMetal.ViewModels
}
#endregion
#region 时间显示
void timer_Tick(object sender, EventArgs e)
{
System.Windows.Application.Current.Dispatcher.Invoke((Action)(() =>
{
CurrentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
}));
}
}
#endregion
}
}

@ -21,15 +21,15 @@ namespace Aucma.Core.SheetMetal.ViewModels
{
public partial class MaterialStatisticsViewModel : ObservableObject
{
private readonly IBaseSpaceInfoServices _baseSpaceInfoServices;
private readonly ISysUserInfoServices _sysUserInfoServices;
private readonly IBaseSpaceInfoServices? _baseSpaceInfoServices;
private readonly ISysUserInfoServices? _sysUserInfoServices;
public MaterialStatisticsViewModel()
{
_baseSpaceInfoServices = App.ServiceProvider.GetService<IBaseSpaceInfoServices>();
_sysUserInfoServices = App.ServiceProvider.GetService<ISysUserInfoServices>();
//Refresh();
RefreshTest();
//RefreshTest();
}
[RelayCommand]
public void RefreshTest()
@ -42,10 +42,10 @@ namespace Aucma.Core.SheetMetal.ViewModels
ShellMaterialStockDataGrid.Add(new BaseSpaceInfo() { MaterialType = "BC/BD-310NF", SpaceStock = 10});
//内胆
LinerMaterialStockDataGrid.Clear();
LinerMaterialStockDataGrid.Add(new BaseSpaceInfo() { MaterialType = "BCD-162CST", SpaceStock = 6 });
LinerMaterialStockDataGrid.Add(new BaseSpaceInfo() { MaterialType = "BCD-212CHG", SpaceStock = 5 });
LinerMaterialStockDataGrid.Add(new BaseSpaceInfo() { MaterialType = "BCD-211CGN", SpaceStock = 4 });
LinerMaterialStockDataGrid.Add(new BaseSpaceInfo() { MaterialType = "BC/BD-310NF", SpaceStock = 11 });
LinerMaterialStockDataGrid.Add(new BaseSpaceInfo() { MaterialType = "BCD-162CST", SpaceStock = 6 });
LinerMaterialStockDataGrid.Add(new BaseSpaceInfo() { MaterialType = "BCD-212CHG", SpaceStock = 5 });
LinerMaterialStockDataGrid.Add(new BaseSpaceInfo() { MaterialType = "BCD-211CGN", SpaceStock = 4 });
LinerMaterialStockDataGrid.Add(new BaseSpaceInfo() { MaterialType = "BC/BD-310NF", SpaceStock = 11 });
//泡前库
FoamBeforeMaterialStockDataGrid.Clear();

@ -0,0 +1,220 @@
<UserControl x:Class="Aucma.Core.SheetMetal.Views.BomMaintenancePageView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Aucma.Core.SheetMetal.Views"
mc:Ignorable="d" Background="#1152AC"
d:DesignHeight="800" FontFamily="Microsoft YaHei"
d:DesignWidth="1000" >
<UserControl.Resources>
<Style x:Key="DataGridTextColumnCenterSytle" TargetType="{x:Type TextBlock}">
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="FontSize" Value="20"/>
</Style>
<Style TargetType="DataGrid">
<!--网格线颜色-->
<Setter Property="CanUserResizeColumns" Value="false"/>
<Setter Property="Background" Value="#1152AC" />
<Setter Property="BorderBrush" Value="#4285DE" />
<Setter Property="Foreground" Value="White"/>
<Setter Property="HorizontalGridLinesBrush">
<Setter.Value>
<SolidColorBrush Color="#4285DE"/>
</Setter.Value>
</Setter>
<Setter Property="VerticalGridLinesBrush">
<Setter.Value>
<SolidColorBrush Color="#1152AC"/>
</Setter.Value>
</Setter>
</Style>
<!--列头标题栏样式-->
<Style TargetType="DataGridColumnHeader">
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="BorderBrush" Value="#dddddd" />
<Setter Property="Height" Value="40"/>
<Setter Property="FontSize" Value="18"/>
<Setter Property="Background" Value="#4285DE"/>
<Setter Property="Foreground" Value="White"/>
</Style>
<!--单元格样式-->
<Style TargetType="DataGridCell">
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="BorderBrush" Value="White" />
<Setter Property="Height" Value="40"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridCell}">
<Grid Background="{TemplateBinding Background}" >
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#4285DE"/>
<Setter Property="Foreground" Value="#dddddd"/>
</Trigger>
</Style.Triggers>
</Style>
<Style TargetType="{x:Type Slider}">
<Style.Resources>
<!-- 重写重复触发按钮的样式 -->
<Style x:Key="RepeatButtonStyle" TargetType="{x:Type RepeatButton}">
<Setter Property="Focusable" Value="false" />
<Setter Property="IsTabStop" Value="false" />
<Setter Property="Padding" Value="0" />
<Setter Property="Width" Value="30" />
</Style>
</Style.Resources>
<Setter Property="Stylus.IsPressAndHoldEnabled" Value="false" />
<Setter Property="SmallChange" Value="1" />
<!-- 重写Slider的模板 -->
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Slider}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBox Grid.RowSpan="2" Height="Auto" Margin="0" Padding="0" VerticalAlignment="Stretch"
VerticalContentAlignment="Center" Text="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=Value}">
<!-- 给TextBox绑定上下命令 -->
<TextBox.InputBindings>
<KeyBinding Gesture="Up" Command="{x:Static Slider.IncreaseSmall}" />
<KeyBinding Gesture="Down" Command="{x:Static Slider.DecreaseSmall}" />
<KeyBinding Gesture="PageUp" Command="{x:Static Slider.IncreaseLarge}" />
<KeyBinding Gesture="PageDown" Command="{x:Static Slider.DecreaseLarge}" />
</TextBox.InputBindings>
</TextBox>
<RepeatButton Grid.Row="0" Grid.Column="1" Command="{x:Static Slider.IncreaseSmall}"
Style="{StaticResource RepeatButtonStyle}">
<Path Data="M4,0 L0,4 8,4 Z" Fill="Black" />
</RepeatButton>
<RepeatButton Grid.Row="1" Grid.Column="1" Command="{x:Static Slider.DecreaseSmall}"
Style="{StaticResource RepeatButtonStyle}">
<Path Data="M0,0 L4,4 8,0 Z" Fill="Black" />
</RepeatButton>
<!-- 由于Slider的内部实现要求存在这些必要组件,所以必须保留,但是设置为隐藏即可 -->
<Border x:Name="TrackBackground" Visibility="Collapsed">
<Rectangle x:Name="PART_SelectionRange" Visibility="Collapsed" />
</Border>
<Thumb x:Name="Thumb" Visibility="Collapsed" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</UserControl.Resources>
<Border Grid.Row="1" Grid.Column="1" BorderBrush="#0288d1" BorderThickness="1" CornerRadius="5" Margin="5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="0.6*"/>
<RowDefinition Height="9*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="#0288d1" BorderThickness="0,0,0,1" CornerRadius="0" Margin="1,1,5,5" >
<TextBlock Text="钣金设置" FontSize="25" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Row="1" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="5" Margin="1,0,5,5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="0.6*"/>
<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" />
</WrapPanel>
<UniformGrid Grid.Row="2" Margin="5" >
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<UniformGrid Grid.Column="0" Margin="3 0">
<DataGrid ItemsSource="{Binding SmSyncModelDataGrid}" Background="Transparent"
ColumnHeaderHeight="35" x: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">
<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>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<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 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="添加该型号物料" FontSize="12" CommandParameter="{Binding SmProductId}" Margin="0 2 0 2" Command="{Binding DataContext.SetProductCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid }}" />
</WrapPanel>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</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.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>
</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*" >
<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 }}" />
</WrapPanel>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</UniformGrid>
</Grid>
</UniformGrid>
</Grid>
</Border>
</Grid>
</Border>
</UserControl>

@ -0,0 +1,31 @@
using Aucma.Core.SheetMetal.ViewModels;
using System.Windows.Controls;
using System.Windows.Input;
using Aucma.Core.SheetMetal.Common;
namespace Aucma.Core.SheetMetal.Views
{
/// <summary>
/// BomMaintenancePageView.xaml 的交互逻辑
/// </summary>
public partial class BomMaintenancePageView : UserControl
{
public BomMaintenancePageView()
{
InitializeComponent();
this.DataContext = new BomMaintenancePageViewModel();
}
//在载入行的时候在行表头添加编号
private void dgvMH_LoadingRow(object sender, DataGridRowEventArgs e)
{
e.Row.Header = (e.Row.GetIndex() + 1).ToString();
}
private void queryParam_PreviewMouseDoubleClick(object sender, MouseButtonEventArgs e)
{
CommHelper.OpenOsk();
}
}
}

@ -0,0 +1,154 @@
<Window x:Class="Aucma.Core.SheetMetal.Views.CorrespondingModelPageView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Aucma.Core.SheetMetal.Views"
mc:Ignorable="d"
Background="#1152AC"
Title="钣金生产型号维护" FontFamily="Microsoft YaHei" Height="800" Width="1300"
d:DesignHeight="800" WindowStartupLocation="CenterScreen"
d:DesignWidth="1500" ResizeMode="NoResize" Topmost="False">
<Window.Resources>
<Style x:Key="DataGridTextColumnCenterSytle" TargetType="{x:Type TextBlock}">
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="FontSize" Value="18"/>
</Style>
<Style TargetType="DataGrid">
<!--网格线颜色-->
<Setter Property="CanUserResizeColumns" Value="false"/>
<Setter Property="Background" Value="#1152AC" />
<Setter Property="BorderBrush" Value="#4285DE" />
<Setter Property="Foreground" Value="White"/>
<Setter Property="HorizontalGridLinesBrush">
<Setter.Value>
<SolidColorBrush Color="#4285DE"/>
</Setter.Value>
</Setter>
<Setter Property="VerticalGridLinesBrush">
<Setter.Value>
<SolidColorBrush Color="#1152AC"/>
</Setter.Value>
</Setter>
</Style>
<!--列头标题栏样式-->
<Style TargetType="DataGridColumnHeader">
<!--<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>-->
<!--<Setter Property="Background" Value="#dddddd"/>
<Setter Property="Foreground" Value="Black"/>-->
<!--<Setter Property="BorderThickness" Value="1" />-->
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="BorderBrush" Value="#dddddd" />
<Setter Property="Height" Value="40"/>
<Setter Property="FontSize" Value="18"/>
<Setter Property="Background" Value="#4285DE"/>
<Setter Property="Foreground" Value="White"/>
</Style>
<!--单元格样式-->
<Style TargetType="DataGridCell">
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="BorderBrush" Value="White" />
<Setter Property="Height" Value="40"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridCell}">
<Grid Background="{TemplateBinding Background}" >
<ContentPresenter HorizontalAlignment="Left" VerticalAlignment="Center" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#4285DE"/>
<Setter Property="Foreground" Value="#dddddd"/>
</Trigger>
</Style.Triggers>
</Style>
<!--背景色改变必须先设置cellStyle 因为cellStyle会覆盖rowStyle样式换行换色-->
<!--<Style TargetType="DataGridRow">
<Setter Property="Height" Value="30"/>
<Style.Triggers>
<Trigger Property="AlternationIndex" Value="0">
<Setter Property="Background" Value="#e7e7e7"/>
</Trigger>
<Trigger Property="AlternationIndex" Value="1">
<Setter Property="Background" Value="#f2f2f2" />
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#f1ef9f" />
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#05c4ff"/>
</Trigger>
<Trigger Property="IsFocused" Value="True">
<Setter Property="Background" Value="#05c4ff"/>
</Trigger>
</Style.Triggers>
</Style>-->
</Window.Resources>
<Border Grid.Row="1" Grid.Column="1" BorderBrush="#0288d1" BorderThickness="1" CornerRadius="5" Margin="5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="0.6*"/>
<RowDefinition Height="9*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="#0288d1" BorderThickness="0,0,0,1" CornerRadius="0" Margin="1,1,5,5" >
<TextBlock Text="钣金生产型号维护" FontSize="25" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Row="1" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="5" Margin="1,0,5,5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="0.1*"/>
<RowDefinition/>
</Grid.RowDefinitions>
<WrapPanel Grid.Row="0" Margin="3" VerticalAlignment="Center">
<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" >
<DataGrid ItemsSource="{Binding MaterialDataGrid}" Background="Transparent"
ColumnHeaderHeight="40" x:Name="dgvMH" FontSize="18"
RowHeight="50" AutoGenerateColumns="False" RowHeaderWidth="0"
GridLinesVisibility="None" VerticalAlignment="Stretch"
ScrollViewer.VerticalScrollBarVisibility="Visible" ScrollViewer.HorizontalScrollBarVisibility="Visible"
BorderThickness="0" CanUserAddRows="False" SelectionMode="Single" IsReadOnly="True"
Foreground="White" SelectedItem="{Binding SelectedDataItem}">
<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 }}" />
</WrapPanel>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</UniformGrid>
</Grid>
</Border>
</Grid>
</Border>
</Window>

@ -0,0 +1,30 @@
using Aucma.Core.SheetMetal.Common;
using Aucma.Core.SheetMetal.ViewModels;
using System.Windows;
using System.Windows.Input;
namespace Aucma.Core.SheetMetal.Views
{
/// <summary>
/// CorrespondingModelPageView.xaml 的交互逻辑
/// </summary>
public partial class CorrespondingModelPageView : Window
{
public CorrespondingModelPageView()
{
InitializeComponent();
this.DataContext = new CorrespondingModelPageViewModel();
}
public CorrespondingModelPageView(string productId)
{
InitializeComponent();
this.DataContext = new CorrespondingModelPageViewModel(productId);
}
private void queryParam_PreviewMouseDoubleClick(object sender, MouseButtonEventArgs e)
{
CommHelper.OpenOsk();
}
}
}

@ -65,6 +65,7 @@
<Button Content="生产计划" x:Name="FirstPage" FontSize="20" Height="40" Margin="5 0" Command="{Binding SwitchPagesCommand}" CommandParameter="{Binding Name,ElementName=FirstPage}" />
<Button Content="设备监控" x:Name="LogPage" FontSize="20" Height="40" Margin="5 0" Command="{Binding SwitchPagesCommand}" CommandParameter="{Binding Name,ElementName=LogPage}" />
<Button Content="统 计" x:Name="StatisticsPage" FontSize="20" Height="40" Margin="5 0" Command="{Binding SwitchPagesCommand}" CommandParameter="{Binding Name,ElementName=StatisticsPage}" />
<Button Content="BOM设置" x:Name="BomPage" FontSize="20" Height="40" Margin="5 0" Command="{Binding SwitchPagesCommand}" CommandParameter="{Binding Name,ElementName=BomPage}" />
<Button Content="键 盘" x:Name="TabTip" FontSize="20" Height="40" Margin="5 0" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=TabTip}" />
<Button Content="最小化" x:Name="Minimized" FontSize="20" Height="40" Margin="5 0" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=Minimized}" Background="#FF9900" BorderBrush="#FF9900" />
<Button Content="退 出" x:Name="Exit" FontSize="20" Height="40" Margin="5 0" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=Exit}" Background="#df4642" BorderBrush="#df4642" />

@ -96,12 +96,14 @@
<RowDefinition Height="8*"/>
</Grid.RowDefinitions>
<WrapPanel Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Center">
<TextBlock Text="搜索条件" Margin="10 0" Foreground="White" FontSize="18" VerticalAlignment="Center"/>
<!--<TextBlock Text="搜索条件" Margin="10 0" Foreground="White" FontSize="18" VerticalAlignment="Center"/>
<TextBox VerticalContentAlignment="Center"
x:Name="queryParam" FontSize="16" Style="{x:Null}" Background="#1152AC"
x:Name="queryParam" FontSize="16" Style="{x:Null}"
Width="200" Margin="10 0" BorderBrush="White" Foreground="White">
</TextBox>-->
<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"/>
</TextBox>
<Button Margin="10 0"
Content="查询" Command="{Binding ExecQueryCommand}" FontSize="18"
Style="{StaticResource MaterialDesignRaisedSecondaryDarkButton}" CommandParameter="{Binding Text, ElementName=queryParam}" />

@ -1,18 +1,7 @@
using Aucma.Core.SheetMetal.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Aucma.Core.SheetMetal.Common;
namespace Aucma.Core.SheetMetal.Views
{
@ -26,5 +15,10 @@ namespace Aucma.Core.SheetMetal.Views
InitializeComponent();
this.DataContext = new StatisticsPageViewModel();
}
private void queryParam_PreviewMouseDoubleClick(object sender, MouseButtonEventArgs e)
{
CommHelper.OpenOsk();
}
}
}

@ -111,6 +111,9 @@
},
"Plc": {
"Enabled": true
},
"AucamTask": {
"Enabled": true
}
},
"StationInfo": {

File diff suppressed because it is too large Load Diff

@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Admin.Core.IService\Admin.Core.IService.csproj" />
<ProjectReference Include="..\Aucma.Core.HwPLc\Aucma.Core.HwPLc.csproj" />
</ItemGroup>
</Project>

@ -0,0 +1,11 @@

namespace Aucma.Core.SheetMetalTasks
{
public interface IAucamSheetMetalTaskService
{
/// <summary>
/// 钣金计划任务
/// </summary>
Task SheetMetalTasks();
}
}
Loading…
Cancel
Save