liuwf 1 year ago
commit 5dcebb9cbb

@ -491,16 +491,6 @@
完成时间
</summary>
</member>
<member name="T:Admin.Core.Model.Model_New.OffLineInfo">
<summary>
条码下线信息记录
</summary>
</member>
<member name="P:Admin.Core.Model.Model_New.OffLineInfo.ObjId">
<summary>
主键标识
</summary>
</member>
<member name="T:Admin.Core.Model.Model_New.OrderBomInfo">
<summary>
SAP BOM 信息
@ -1228,7 +1218,17 @@
</member>
<member name="P:Admin.Core.Model.ExecutePlanInfo.TaskCode">
<summary>
计划任务执行编号
计划任务执行编号——钣金任务
</summary>
</member>
<member name="T:Admin.Core.Model.OffLineInfo">
<summary>
条码下线信息记录
</summary>
</member>
<member name="P:Admin.Core.Model.OffLineInfo.ObjId">
<summary>
主键标识
</summary>
</member>
<member name="T:Admin.Core.Model.Perfusion_Alarm">
@ -1816,6 +1816,41 @@
是否标识
</summary>
</member>
<member name="T:Admin.Core.Model.SMProductionCompletionRecord">
<summary>
钣金每日生产记录表
</summary>
</member>
<member name="P:Admin.Core.Model.SMProductionCompletionRecord.ObjId">
<summary>
主键-guid
</summary>
</member>
<member name="P:Admin.Core.Model.SMProductionCompletionRecord.SmPlanid">
<summary>
计划编码
</summary>
</member>
<member name="P:Admin.Core.Model.SMProductionCompletionRecord.SmProductcode">
<summary>
产品编码
</summary>
</member>
<member name="P:Admin.Core.Model.SMProductionCompletionRecord.SmProductname">
<summary>
产品名称
</summary>
</member>
<member name="P:Admin.Core.Model.SMProductionCompletionRecord.SmProductiontype">
<summary>
生产类型;0--前板1--后板
</summary>
</member>
<member name="P:Admin.Core.Model.SMProductionCompletionRecord.SmProductivetime">
<summary>
生产新时间
</summary>
</member>
<member name="T:Admin.Core.Model.SysUserInfo">
<summary>
用户信息
@ -3371,14 +3406,24 @@
产品编号
</summary>
</member>
<member name="P:Admin.Core.Model.ViewModels.PrintPlanInfoView.PlanAmount">
<summary>
订单数量
</summary>
</member>
<member name="P:Admin.Core.Model.ViewModels.PrintPlanInfoView.ProductName">
<summary>
产品名称
产品型号
</summary>
</member>
<member name="P:Admin.Core.Model.ViewModels.PrintPlanInfoView.PlanAmount">
<member name="P:Admin.Core.Model.ViewModels.PrintPlanInfoView.LinerAmount">
<summary>
订单量
内胆数量
</summary>
</member>
<member name="P:Admin.Core.Model.ViewModels.PrintPlanInfoView.BoxAmount">
<summary>
箱体数量
</summary>
</member>
<member name="P:Admin.Core.Model.ViewModels.PrintPlanInfoView.CompleteAmount">
@ -3406,12 +3451,12 @@
异常量
</summary>
</member>
<member name="P:Admin.Core.Model.ViewModels.PrintPlanInfoView.LinerAmount">
<member name="P:Admin.Core.Model.ViewModels.PrintPlanInfoView.PrintLinerAmount">
<summary>
内胆码已打量
</summary>
</member>
<member name="P:Admin.Core.Model.ViewModels.PrintPlanInfoView.BoxAmount">
<member name="P:Admin.Core.Model.ViewModels.PrintPlanInfoView.PrintBoxAmount">
<summary>
箱壳码已打量
</summary>

@ -383,6 +383,9 @@
},
"D:\\Project\\gitea\\AUCMA\\SCADA\\Aucma.Core.Scanner\\Aucma.Core.Scanner.csproj": {
"projectPath": "D:\\Project\\gitea\\AUCMA\\SCADA\\Aucma.Core.Scanner\\Aucma.Core.Scanner.csproj"
},
"D:\\Project\\gitea\\AUCMA\\SCADA\\Aucma.Core.Tasks\\Aucma.Core.Tasks.csproj": {
"projectPath": "D:\\Project\\gitea\\AUCMA\\SCADA\\Aucma.Core.Tasks\\Aucma.Core.Tasks.csproj"
}
}
}
@ -1140,6 +1143,71 @@
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.402\\RuntimeIdentifierGraph.json"
}
}
},
"D:\\Project\\gitea\\AUCMA\\SCADA\\Aucma.Core.Tasks\\Aucma.Core.Tasks.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "D:\\Project\\gitea\\AUCMA\\SCADA\\Aucma.Core.Tasks\\Aucma.Core.Tasks.csproj",
"projectName": "Aucma.Core.Tasks",
"projectPath": "D:\\Project\\gitea\\AUCMA\\SCADA\\Aucma.Core.Tasks\\Aucma.Core.Tasks.csproj",
"packagesPath": "C:\\Users\\admin\\.nuget\\packages\\",
"outputPath": "D:\\Project\\gitea\\AUCMA\\SCADA\\Aucma.Core.Tasks\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\admin\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net6.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"projectReferences": {
"D:\\Project\\gitea\\AUCMA\\SCADA\\Admin.Core.Common\\Admin.Core.Common.csproj": {
"projectPath": "D:\\Project\\gitea\\AUCMA\\SCADA\\Admin.Core.Common\\Admin.Core.Common.csproj"
},
"D:\\Project\\gitea\\AUCMA\\SCADA\\Admin.Core.IService\\Admin.Core.IService.csproj": {
"projectPath": "D:\\Project\\gitea\\AUCMA\\SCADA\\Admin.Core.IService\\Admin.Core.IService.csproj"
},
"D:\\Project\\gitea\\AUCMA\\SCADA\\Aucma.Core.PLc\\Aucma.Core.PLc.csproj": {
"projectPath": "D:\\Project\\gitea\\AUCMA\\SCADA\\Aucma.Core.PLc\\Aucma.Core.PLc.csproj"
}
}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.402\\RuntimeIdentifierGraph.json"
}
}
}
}
}

@ -4052,6 +4052,7 @@
"Aucma.Core.RunPlc": "1.0.0",
"Aucma.Core.Scanner": "1.0.0",
"Aucma.Core.ScannerGun": "1.0.0",
"Aucma.Core.Tasks": "1.0.0",
"Microsoft.AspNetCore.Authentication.JwtBearer": "5.0.9"
},
"compile": {
@ -4220,6 +4221,21 @@
"runtime": {
"bin/placeholder/Aucma.Core.ScannerGun.dll": {}
}
},
"Aucma.Core.Tasks/1.0.0": {
"type": "project",
"framework": ".NETCoreApp,Version=v6.0",
"dependencies": {
"Admin.Core.Common": "1.0.0",
"Admin.Core.IService": "1.0.0",
"Aucma.Core.PLc": "1.0.0"
},
"compile": {
"bin/placeholder/Aucma.Core.Tasks.dll": {}
},
"runtime": {
"bin/placeholder/Aucma.Core.Tasks.dll": {}
}
}
}
},
@ -11205,6 +11221,11 @@
"type": "project",
"path": "../Aucma.Core.ScannerGun/Aucma.Core.ScannerGun.csproj",
"msbuildProject": "../Aucma.Core.ScannerGun/Aucma.Core.ScannerGun.csproj"
},
"Aucma.Core.Tasks/1.0.0": {
"type": "project",
"path": "../Aucma.Core.Tasks/Aucma.Core.Tasks.csproj",
"msbuildProject": "../Aucma.Core.Tasks/Aucma.Core.Tasks.csproj"
}
},
"projectFileDependencyGroups": {

@ -1,6 +1,6 @@
{
"version": 2,
"dgSpecHash": "F94u7mdFSW4mcmpz6GzwgSU//e1NvwxPV8okl7gDHLi94BeS6qMoDkO+xeh6kEtannd9woqGONXb+is57Ye7ZQ==",
"dgSpecHash": "lpAdUZlNwICgoI0zWeab6lGK6byqEln8T/RCXWsmZhSAVbwyy2BWnrJmPSJkkkJ4x1Ma6659From8jGreg2RJA==",
"success": true,
"projectFilePath": "D:\\Project\\gitea\\AUCMA\\SCADA\\Admin.Core.Api\\Admin.Core.Api.csproj",
"expectedPackageFiles": [

@ -66,5 +66,21 @@ namespace Admin.Core.Common
Configuration.Bind(string.Join(":", sections), list);
return list;
}
/// <summary>
/// 封装要操作的字符
/// </summary>
/// <param name="sections">节点配置</param>
/// <returns></returns>
public static string WriteApp(string sections,string value)
{
try
{
Configuration[sections] = value;
}
catch (Exception) { }
return "";
}
}
}

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
@ -23,6 +23,7 @@
<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" />
</ItemGroup>
</Project>

@ -0,0 +1,34 @@
using Admin.Core.Common;
using Aucma.Core.Tasks;
using log4net;
using Microsoft.AspNetCore.Builder;
using System;
namespace Admin.Core.Extensions
{
/// <summary>
///定时服务
/// </summary>
public static class AucmaTaskMildd
{
private static readonly ILog log = LogManager.GetLogger(typeof(AucmaTaskMildd));
public static async void AucmaTaskMildds(this IApplicationBuilder app, IAucamTaskService aucamTaskService)
{
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;
}
}
}
}

@ -1,16 +1,8 @@
using Admin.Core.Common;
using Admin.Core.IService.ISys;
using Admin.Core.Model.Sys;
using Admin.Core.Tasks;
using Aucma.Core.Scanner;
using log4net;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using StackExchange.Profiling.Internal;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Admin.Core.Extensions
{

@ -0,0 +1,40 @@
using Admin.Core.Common;
using Admin.Core.Tasks;
using Aucma.Core.Scanner;
using Aucma.Core.Tasks;
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 AucmaTaskSetup
{
public static void AddAucmaTaskSetup(this IServiceCollection services)
{
services.AddSingleton<IAucamTaskService, AucamTaskService>();
var baseType = typeof(IAucamTaskService);
var path = AppDomain.CurrentDomain.RelativeSearchPath ?? AppDomain.CurrentDomain.BaseDirectory;
var referencedAssemblies = System.IO.Directory.GetFiles(path, "Aucma.Core.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,11 @@
using Admin.Core.Model;
namespace Admin.Core.IRepository
{
/// <summary>
/// ISMProductionCompletionRecordRepository
/// </summary>
public interface ISMProductionCompletionRecordRepository : IBaseRepository<SMProductionCompletionRecord>
{
}
}

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

@ -112,7 +112,7 @@ namespace Admin.Core.Model
[SugarColumn(ColumnName = "PLAN_TYPE")]
public int PlanType { get; set; }
/// <summary>
/// 计划任务执行编号
/// 计划任务执行编号——钣金任务
/// </summary>
[SugarColumn(ColumnName = "TASK_CODE")]
public string TaskCode { get; set; }

@ -5,7 +5,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Admin.Core.Model.Model_New
namespace Admin.Core.Model
{
/// <summary>
/// 条码下线信息记录

@ -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
{
/// <summary>
/// 钣金每日生产记录表
/// </summary>
[SugarTable("SM_PRODUCTIONCOMPLETIONRECORD", "AUCMA_SCADA")]
public class SMProductionCompletionRecord
{
/// <summary>
/// 主键-guid
/// </summary>
[SugarColumn(ColumnName = "OBJ_ID", IsPrimaryKey = true)]
public string ObjId { get; set; }
/// <summary>
/// 计划编码
/// </summary>
[SugarColumn(ColumnName = "SM_PLANID")]
public string SmPlanid { get; set; }
/// <summary>
/// 产品编码
/// </summary>
[SugarColumn(ColumnName = "SM_PRODUCTCODE")]
public string SmProductcode { get; set; }
/// <summary>
/// 产品名称
/// </summary>
[SugarColumn(ColumnName = "SM_PRODUCTNAME")]
public string SmProductname { get; set; }
/// <summary>
/// 生产类型;0--前板1--后板
/// </summary>
[SugarColumn(ColumnName = "SM_PRODUCTIONTYPE")]
public int SmProductiontype { get; set; }
/// <summary>
/// 生产新时间
/// </summary>
[SugarColumn(ColumnName = "SM_PRODUCTIVETIME")]
public DateTime SmProductivetime { get; set; }
}
}

@ -20,17 +20,25 @@ namespace Admin.Core.Model.ViewModels
/// </summary>
public string ProductCode { get; set; }
/// <summary>
/// 产品名称
/// 订单数量
/// </summary>
public int PlanAmount { get; set; } = 0;
/// <summary>
/// 产品型号
/// </summary>
public string ProductName { get; set; }
/// <summary>
/// 订单量
/// 内胆数量
/// </summary>
public int LinerAmount { get; set; } = 0;
/// <summary>
/// 箱体数量
/// </summary>
public int PlanAmount { get; set; }
public int BoxAmount { get; set; } = 0;
/// <summary>
/// 完成量
/// </summary>
public int CompleteAmount { get; set; }
public int CompleteAmount { get; set; } = 0;
/// <summary>
/// 物料编码
/// </summary>
@ -50,11 +58,11 @@ namespace Admin.Core.Model.ViewModels
/// <summary>
/// 内胆码已打量
/// </summary>
public int LinerAmount { get; set; } = 0;
public int PrintLinerAmount { get; set; } = 0;
/// <summary>
/// 箱壳码已打量
/// </summary>
public int BoxAmount { get; set; } = 0;
public int PrintBoxAmount { get; set; } = 0;
/// <summary>
/// 剩余数量
/// </summary>

@ -35,6 +35,7 @@
<ItemGroup>
<ProjectReference Include="..\Admin.Core.Extensions\Admin.Core.Extensions.csproj" />
<ProjectReference Include="..\Aucma.Core.Tasks\Aucma.Core.Tasks.csproj" />
</ItemGroup>
<ItemGroup>

@ -1,13 +1,6 @@
using Admin.Core.Common;
using Admin.Core.Extensions;
using Admin.Core.IRepository;
using Admin.Core.IService;
using Admin.Core.IService.ISys;
using Admin.Core.Model;
using Admin.Core.Repository;
using Admin.Core.Service;
using Admin.Core.Tasks;
using Aucma.Core.ScannerGun;
using Aucma.Core.Tasks;
using Autofac;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
@ -61,8 +54,8 @@ namespace Admin.Core.RealTimeService
//注册业务服务
AddServices(services);
//任务调度
services.AddJobSetup();
//ÈÎÎñ
services.AddAucmaTaskSetup();
//支持编码大全 例如:支持 System.Text.Encoding.GetEncoding("GB2312") System.Text.Encoding.GetEncoding("GB18030")
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
@ -84,16 +77,12 @@ namespace Admin.Core.RealTimeService
/// </summary>
/// <param name="app"></param>
/// <param name="env"></param>
public void Configure(IApplicationBuilder app, ISysTasksQzService tasksQzService,
ISchedulerCenter schedulerCenter)
public void Configure(IApplicationBuilder app, IAucamTaskService aucamTaskService)
{
// 使用静态文件
app.UseStaticFiles();
// 然后是授权中间件
//app.UseAuthorization();
// 开启QuartzNetJob调度服务
app.UseQuartzJobMildd(tasksQzService, schedulerCenter);
//app.UseScannerGunMildd(scannerGunService);
app.AucmaTaskMildds(aucamTaskService);
}
#region 注册服务

@ -166,6 +166,9 @@
},
"ScannerGun": {
"Enabled": true
},
"AucamTask": {
"Enabled": true
}
},
"IpRateLimiting": {

@ -1,8 +1,7 @@
using Admin.Core.Model;
using Admin.Core.Model.Model_New;
using Admin.Core.Repository;
using Admin.Core.IRepository;
using Admin.Core.Model;
namespace Admin.Core.IRepository
namespace Admin.Core.Repository
{
/// <summary>
/// BaseBomInfoRepository

@ -1,8 +1,7 @@
using Admin.Core.Model;
using Admin.Core.Model.Model_New;
using Admin.Core.Repository;
using Admin.Core.IRepository;
using Admin.Core.Model;
namespace Admin.Core.IRepository
namespace Admin.Core.Repository
{
/// <summary>
/// OrderBomInfoRepository

@ -1,8 +1,8 @@
using Admin.Core.Model;
using Admin.Core.Model.Model_New;
using Admin.Core.Repository;
using Admin.Core.IRepository;
namespace Admin.Core.IRepository
namespace Admin.Core.Repository
{
/// <summary>
/// BaseOrderInfoRepository

@ -1,8 +1,8 @@
using Admin.Core.Model;
using Admin.Core.Model.Model_New;
using Admin.Core.Repository;
using Admin.Core.IRepository;
namespace Admin.Core.IRepository
namespace Admin.Core.Repository
{
/// <summary>
/// OrderBomInfoRepository

@ -1,8 +1,8 @@
using Admin.Core.Model;
using Admin.Core.Model.Model_New;
using Admin.Core.Repository;
using Admin.Core.IRepository;
namespace Admin.Core.IRepository
namespace Admin.Core.Repository
{
/// <summary>
/// BaseSpaceDetailRepository

@ -4,7 +4,7 @@ using Admin.Core.Repository;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Admin.Core.IRepository
namespace Admin.Core.Repository
{
/// <summary>
/// BaseSpaceInfoRepository

@ -1,8 +1,8 @@
using Admin.Core.Model;
using Admin.Core.Model.Model_New;
using Admin.Core.Repository;
using Admin.Core.IRepository;
namespace Admin.Core.IRepository
namespace Admin.Core.Repository
{
/// <summary>
/// BaseStoreInfoRepository

@ -1,6 +1,5 @@
using Admin.Core.IRepository;
using Admin.Core.Model;
using Admin.Core.Model.ViewModels;
using SqlSugar;
using System;
using System.Collections.Generic;
@ -8,7 +7,6 @@ using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static ICSharpCode.SharpZipLib.Zip.ZipEntryFactory;
namespace Admin.Core.Repository
{

@ -1,7 +1,7 @@
using Admin.Core.Model.Model_New;
using Admin.Core.Repository;
using Admin.Core.IRepository;
namespace Admin.Core.IRepository
namespace Admin.Core.Repository
{
/// <summary>
/// MaterialCompletionRepository

@ -1,15 +1,5 @@
using Admin.Core.IRepository;
using Admin.Core.Model;
using Admin.Core.Model.Model_New;
using Admin.Core.Model.ViewModels;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static ICSharpCode.SharpZipLib.Zip.ZipEntryFactory;
namespace Admin.Core.Repository
{

@ -1,7 +1,7 @@
using Admin.Core.Model.Model_New;
using Admin.Core.Repository;
using Admin.Core.IRepository;
namespace Admin.Core.IRepository
namespace Admin.Core.Repository
{
/// <summary>
/// IPrintBarCodeRepository

@ -1,7 +1,7 @@
using Admin.Core.Model.Model_New;
using Admin.Core.Repository;
using Admin.Core.IRepository;
namespace Admin.Core.IRepository
namespace Admin.Core.Repository
{
/// <summary>
/// PrintOrderInfoRepository

@ -1,7 +1,7 @@
using Admin.Core.Model;
using Admin.Core.Repository;
using Admin.Core.IRepository;
namespace Admin.Core.IRepository
namespace Admin.Core.Repository
{
/// <summary>
/// ProductOrderInfoRepository

@ -1,12 +1,12 @@
using Admin.Core.Model;
using Admin.Core.Repository;
using Admin.Core.IRepository;
using Microsoft.IdentityModel.Logging;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Threading.Tasks;
namespace Admin.Core.IRepository
namespace Admin.Core.Repository
{
/// <summary>
/// ProductPlanInfoRepository

@ -1,8 +1,8 @@
using Admin.Core.Model;
using Admin.Core.Repository;
using Admin.Core.IRepository;
using System.Threading.Tasks;
namespace Admin.Core.IRepository
namespace Admin.Core.Repository
{
/// <summary>
/// RealTaskInfoRepository

@ -1,10 +1,10 @@
using Admin.Core.Model;
using Admin.Core.Repository;
using Admin.Core.IRepository;
using log4net;
using System;
using System.Threading.Tasks;
namespace Admin.Core.IRepository
namespace Admin.Core.Repository
{
/// <summary>
/// RecordInstoreRepository

@ -1,10 +1,10 @@
using Admin.Core.Model;
using Admin.Core.Repository;
using Admin.Core.IRepository;
using log4net;
using System;
using System.Threading.Tasks;
namespace Admin.Core.IRepository
namespace Admin.Core.Repository
{
/// <summary>
/// RecordOutStoreRepository

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

@ -1,7 +1,7 @@
using Admin.Core.Model.Model_New;
using Admin.Core.Repository;
using Admin.Core.IRepository;
namespace Admin.Core.IRepository
namespace Admin.Core.Repository
{
/// <summary>
/// SmRecordRepository

@ -1,11 +1,11 @@
using Admin.Core.Model;
using Admin.Core.Model.Model_New;
using Admin.Core.Repository;
using Admin.Core.IRepository;
namespace Admin.Core.IRepository
namespace Admin.Core.Repository
{
/// <summary>
/// ISmTaskExecutionRepository
/// SmTaskExecutionRepository
/// </summary>
public class SmTaskExecutionRepository : BaseRepository<SmTaskExecution>, ISmTaskExecutionRepository
{

@ -50,7 +50,6 @@ namespace Admin.Core.Service
List<PrintPlanInfoView> list = new List<PrintPlanInfoView>();
List<BaseOrderInfo> orderList = await _baseOrderInfoRepository.QueryAsync();
List<OrderBomInfo> orderBomInfoList = await _orderBomInfoRepository.QueryAsync();
//List<BaseBomInfo> bomInfoList = await _baseBomInfoRepository.QueryAsync();
List<PrintOrderInfo> printOrderInfoList = await _printOrderInfoRepository.QueryAsync();
bbinfolist.Clear();
foreach (BaseOrderInfo order in orderList)
@ -58,22 +57,28 @@ namespace Admin.Core.Service
var bomList = await _orderBomInfoRepository.QueryAsync(d => d.ParentId.Equals(order.MaterialCode));
if (bomList != null)
{
bomList.ForEach(b =>
{
List<OrderBomInfo> bbList = RecursionFn(orderBomInfoList, b.MaterialCode);
if (b.ParentId.IsNotEmptyOrNull())
{
PrintPlanInfoView view = new PrintPlanInfoView();
view.OrderCode = order.OrderCode;
view.ProductCode = order.MaterialCode;
view.ProductName = order.MaterialName;
view.PlanAmount = order.OrderAmount;
view.MaterialCode = b.MaterialCode;
view.MaterialName = b.MaterialName;
view.StandardAmount = b.StandardAmount;
view.CreateTime = order.CreatedTime;
list.Add(view);
if (b.ParentId.IsNotEmptyOrNull() && (b.MaterialName.Contains("箱体") || b.MaterialName.Contains("内胆")))
{
bbList.ForEach(bb =>
{
list.Add(new PrintPlanInfoView()
{
OrderCode = order.OrderCode,
ProductCode = order.MaterialCode,
ProductName = order.MaterialName,
PlanAmount = order.OrderAmount,
MaterialCode = bb.MaterialCode,
MaterialName = bb.MaterialName,
LinerAmount = bb.StandardAmount,
BoxAmount = bb.StandardAmount,
StandardAmount = bb.StandardAmount,
CreateTime = order.CreatedTime
});
});
}
});
}

@ -0,0 +1,19 @@
using Admin.Core.IRepository;
using Admin.Core.IService;
using Admin.Core.Model;
using log4net;
namespace Admin.Core.Service
{
public class SMProductionCompletionRecordServices : BaseServices<SMProductionCompletionRecord>, ISMProductionCompletionRecordServices
{
private static readonly log4net.ILog logHelper = LogManager.GetLogger(typeof(BaseBomInfoServices));
private readonly IBaseRepository<SMProductionCompletionRecord> _dal;
public SMProductionCompletionRecordServices(IBaseRepository<SMProductionCompletionRecord> dal)
{
this._dal = dal;
base.BaseDal = dal;
}
}
}

@ -65,8 +65,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aucma.Core.Scanner", "Aucma
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "8.Other", "8.Other", "{F8FB57F6-5465-4E60-B052-D3A63C3C56AE}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aucma.Core.Zebra", "Aucma.Core.Zebra\Aucma.Core.Zebra.csproj", "{C24510B9-90E2-46FA-937B-AB291EAAA7CD}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aucma.Core.PLc", "Aucma.Core.PLc\Aucma.Core.PLc.csproj", "{9EE12F11-F9E4-46DD-935D-F6EDD495A6FC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aucma.Core.RunPlc", "Aucma.Core.RunPlc\Aucma.Core.RunPlc.csproj", "{680718C5-E39C-442F-AC9E-4A56E15AF261}"
@ -81,6 +79,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aucam.Core.PerfusionService
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aucma.Scada.UI", "Aucma.Scada.UI\Aucma.Scada.UI.csproj", "{434F9CE2-2225-4893-9BA2-2681C29E9056}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aucma.Core.Tasks", "Aucma.Core.Tasks\Aucma.Core.Tasks.csproj", "{A7FF5119-A6DE-4947-A1F2-90FE0C628A88}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -167,10 +167,6 @@ Global
{5CF85AD7-DBC9-4466-952B-6742F37E417D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5CF85AD7-DBC9-4466-952B-6742F37E417D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5CF85AD7-DBC9-4466-952B-6742F37E417D}.Release|Any CPU.Build.0 = Release|Any CPU
{C24510B9-90E2-46FA-937B-AB291EAAA7CD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C24510B9-90E2-46FA-937B-AB291EAAA7CD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C24510B9-90E2-46FA-937B-AB291EAAA7CD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C24510B9-90E2-46FA-937B-AB291EAAA7CD}.Release|Any CPU.Build.0 = Release|Any CPU
{9EE12F11-F9E4-46DD-935D-F6EDD495A6FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9EE12F11-F9E4-46DD-935D-F6EDD495A6FC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9EE12F11-F9E4-46DD-935D-F6EDD495A6FC}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -199,6 +195,10 @@ Global
{434F9CE2-2225-4893-9BA2-2681C29E9056}.Debug|Any CPU.Build.0 = Debug|Any CPU
{434F9CE2-2225-4893-9BA2-2681C29E9056}.Release|Any CPU.ActiveCfg = Release|Any CPU
{434F9CE2-2225-4893-9BA2-2681C29E9056}.Release|Any CPU.Build.0 = Release|Any CPU
{A7FF5119-A6DE-4947-A1F2-90FE0C628A88}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A7FF5119-A6DE-4947-A1F2-90FE0C628A88}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A7FF5119-A6DE-4947-A1F2-90FE0C628A88}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A7FF5119-A6DE-4947-A1F2-90FE0C628A88}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -227,14 +227,14 @@ Global
{EC1A6A43-1B6B-42AF-B00E-94DF4DF42111} = {BD987F3A-4E6C-4C47-B28F-1671F875EAE3}
{563882EC-C110-4BCB-B913-3B62124BF680} = {BD987F3A-4E6C-4C47-B28F-1671F875EAE3}
{5CF85AD7-DBC9-4466-952B-6742F37E417D} = {F8FB57F6-5465-4E60-B052-D3A63C3C56AE}
{C24510B9-90E2-46FA-937B-AB291EAAA7CD} = {F8FB57F6-5465-4E60-B052-D3A63C3C56AE}
{9EE12F11-F9E4-46DD-935D-F6EDD495A6FC} = {F8FB57F6-5465-4E60-B052-D3A63C3C56AE}
{680718C5-E39C-442F-AC9E-4A56E15AF261} = {A4C60BC6-0120-48F4-A60D-C73160B122AA}
{680718C5-E39C-442F-AC9E-4A56E15AF261} = {F8FB57F6-5465-4E60-B052-D3A63C3C56AE}
{61EE37C2-A9C2-40DE-A96E-D7E4DEB5FEC3} = {F8FB57F6-5465-4E60-B052-D3A63C3C56AE}
{5515C937-1E2E-4111-8775-EE6898E5933A} = {BD987F3A-4E6C-4C47-B28F-1671F875EAE3}
{C70810CE-041A-4880-99B3-FFCC8B672B42} = {BD987F3A-4E6C-4C47-B28F-1671F875EAE3}
{BFABE9E5-C71D-42FE-94AE-934B9F74B3D0} = {FA2FF2A3-135E-4CA2-9042-76BB71623D5A}
{434F9CE2-2225-4893-9BA2-2681C29E9056} = {BD987F3A-4E6C-4C47-B28F-1671F875EAE3}
{A7FF5119-A6DE-4947-A1F2-90FE0C628A88} = {F8FB57F6-5465-4E60-B052-D3A63C3C56AE}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8047AB56-042B-4AE4-B06A-34137067A86A}

@ -1,11 +1,6 @@
using Admin.Core.Common;
using Admin.Core.Extensions;
using Admin.Core.IRepository;
using Admin.Core.IService;
using Admin.Core.IService.ISys;
using Admin.Core.Model;
using Admin.Core.Repository;
using Admin.Core.Service;
using Admin.Core.Tasks;
using Autofac;
using Microsoft.AspNetCore.Builder;
@ -107,7 +102,6 @@ namespace Aucam.Core.PerfusionService
//services.AddScoped<IBaseRepository<EEquipmentCategory>, BaseRepository<EEquipmentCategory>>();
//services.AddSingleton<IBaseService<EEquipmentCategory>, BaseService<EEquipmentCategory>>();
#endregion
}
#endregion
}

@ -76,6 +76,15 @@
<ProjectReference Include="..\Admin.Core.Extensions\Admin.Core.Extensions.csproj" />
</ItemGroup>
<ItemGroup>
<Reference Include="LiveCharts">
<HintPath>..\dll\LiveCharts.dll</HintPath>
</Reference>
<Reference Include="LiveCharts.Wpf">
<HintPath>..\dll\LiveCharts.Wpf.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Page Update="Assets\Styles\DefaultStyles.xaml">
<SubType>Designer</SubType>

@ -10,6 +10,12 @@
<Compile Update="Views\EnterWarehouseStatisticsPageView.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="Views\FoamMonitorPageView.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="Views\FoamPlanPageView.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="Views\MonitorPageView.xaml.cs">
<SubType>Code</SubType>
</Compile>
@ -30,6 +36,12 @@
<Page Update="Views\EnterWarehouseStatisticsPageView.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="Views\FoamMonitorPageView.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="Views\FoamPlanPageView.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="Views\IndexPageView.xaml">
<SubType>Designer</SubType>
</Page>

@ -0,0 +1,162 @@
using CommunityToolkit.Mvvm.ComponentModel;
using LiveCharts.Defaults;
using LiveCharts.Wpf;
using LiveCharts;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;
namespace Aucma.Core.BoxFoam.ViewModels
{
public partial class FoamMonitorPageViewModel : ObservableObject
{
public FoamMonitorPageViewModel()
{
Task.WaitAll(InitEveryDayMethod());
}
#region 日产量
/// <summary>
/// 每日生产
/// </summary>
/// <returns></returns>
private Task InitEveryDayMethod()
{
#region 按时间统计
ChartValues<ObservablePoint> achievement = new ChartValues<ObservablePoint>
{
new ObservablePoint(0, 12),
new ObservablePoint(1, 14),
new ObservablePoint(2, 28),
new ObservablePoint(3, 62),
new ObservablePoint(4, 29),
new ObservablePoint(5, 29),
new ObservablePoint(6, 7),
new ObservablePoint(7, 31),
new ObservablePoint(8, 13),
new ObservablePoint(9, 11),
new ObservablePoint(10, 8),
new ObservablePoint(11, 5),
new ObservablePoint(12, 3),
new ObservablePoint(13, 11),
new ObservablePoint(14, 15),
new ObservablePoint(15, 6),
new ObservablePoint(16, 11),
new ObservablePoint(17, 9),
new ObservablePoint(18, 11),
new ObservablePoint(19, 1),
new ObservablePoint(20, 10),
new ObservablePoint(21, 22),
new ObservablePoint(22, 16),
new ObservablePoint(23, 12)
};
var column = new ColumnSeries();
column.DataLabels = true;
column.Title = "当日小时产量统计";
column.Values = achievement;
column.Foreground = Brushes.White;
//柱子宽度
//column.Width = 30;
//column.MaxColumnWidth = 30;
//column.LabelsPosition = BarLabelPosition.Perpendicular;
//column.Fill = new SolidColorBrush(Color.FromRgb(34, 139, 34)); //柱状图颜色填充
//column.LabelPoint = p => p.Y.ToString(); //柱状图数据显示位置
ProductionHourList = new List<string>()
{
"1:00", "2:00", "3:00", "4:00", "5:00", "6:00", "7:00", "8:00", "9:00", "10:00", "11:00", "12:00", "13:00", "14:00", "15:00", "16:00", "17:00", "18:00", "19:00", "20:00", "21:00", "22:00", "23:00", "24:00"
};
//Formatter = value => value.ToString("N");
Achievement.Add(column);
#endregion
#region 按类型统计
ChartValues<double> achievement2 = new ChartValues<double>();
Random random2 = new Random();
for (int i = 0; i < 2; i++)
{
achievement2.Add(random2.Next(0, 30));
}
var column2 = new ColumnSeries();
column2.DataLabels = true;
column2.Title = "当日型号产量统计";
column2.Values = achievement2;
column2.Foreground = Brushes.White;
ModelStatistics.Add(column2);
MaterialNameList = new List<string>()
{
"玻璃门,SC-439", "玻璃门,SC-439,AC"
};
#endregion
//await InitExecMethod();
return Task.CompletedTask;
}
#endregion
#region 日产量柱状图X轴日期
/// <summary>
/// 日产量柱状图X轴日期
/// </summary>
private List<string> productionHourList;
public List<string> ProductionHourList
{
get { return productionHourList; }
set { productionHourList = value; }
}
#endregion
#region 型号统计
#region 型号统计柱状图x轴物料类型
/// <summary>
/// 型号统计柱状图x轴物料类型
/// </summary>
private List<string> materialNameList;
public List<string> MaterialNameList
{
get { return materialNameList; }
set { materialNameList = value; }
}
#endregion
#region 型号统计柱状图
/// <summary>
/// 型号统计柱状图
/// </summary>
private SeriesCollection modelStatistics = new SeriesCollection();
public SeriesCollection ModelStatistics
{
get { return modelStatistics; }
set { modelStatistics = value; }
}
#endregion
#endregion
#region 日产量柱状图
/// <summary>
/// 日产量柱状图
/// </summary>
private SeriesCollection achievement = new SeriesCollection();
public SeriesCollection Achievement
{
get { return achievement; }
set { achievement = value; }
}
#endregion
}
}

@ -0,0 +1,21 @@
using CommunityToolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Aucma.Core.BoxFoam.ViewModels
{
/**
*
*
* */
public partial class FoamPlanPageViewModel : ObservableObject
{
public FoamPlanPageViewModel()
{
}
}
}

@ -16,6 +16,8 @@ namespace Aucma.Core.BoxFoam.ViewModels
private EnterWarehouseStatisticsPageView enterWarehouseStatisticsPage = new EnterWarehouseStatisticsPageView();//统计
private MonitorPageView monitorPage= new MonitorPageView();//任务监控
private RealTimeInventoryPageView realTimeInventoryPage = new RealTimeInventoryPageView();
FoamPlanPageView foamPlanPageView = new FoamPlanPageView();
FoamMonitorPageView foamMonitorPageView = new FoamMonitorPageView();
public MainWindowViewModel()
{
UserContent = firstPage;
@ -108,9 +110,8 @@ namespace Aucma.Core.BoxFoam.ViewModels
/// 界面切换
/// </summary>
[RelayCommand]
private void SwitchPages(object obj)
private void SwitchPages(string page)
{
string page = obj as string;
switch (page)
{
case "FirstPage":
@ -125,7 +126,12 @@ namespace Aucma.Core.BoxFoam.ViewModels
case "MonitorPage":
UserContent = monitorPage;
break;
case "FoamPlanPage":
UserContent = foamPlanPageView;
break;
case "FoamMonitorPage":
UserContent = foamMonitorPageView;
break;
default:
break;
}

@ -0,0 +1,330 @@
<UserControl x:Class="Aucma.Core.BoxFoam.Views.FoamMonitorPageView"
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.BoxFoam.Views"
xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf"
mc:Ignorable="d"
d:DesignHeight="1080"
d:DesignWidth="1920">
<Border x:Name="HeightHelperPanel" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="5" Background="Transparent" Margin="5">
<Grid>
<Grid.Resources>
<Style TargetType="TextBlock">
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="FontSize" Value="16"/>
<Setter Property="FontFamily" Value="Microsoft YaHei"/>
</Style>
<Style TargetType="Border">
<Setter Property="BorderBrush" Value="#0288d1"/>
<Setter Property="BorderThickness" Value="1"/>
</Style>
</Grid.Resources>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<UniformGrid Grid.Row="0">
<Grid>
<Grid.Resources>
<Style TargetType="TextBlock">
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="FontSize" Value="16"/>
<Setter Property="FontFamily" Value="Microsoft YaHei"/>
</Style>
<Style TargetType="Border">
<Setter Property="BorderBrush" Value="#0288d1"/>
<Setter Property="BorderThickness" Value="1"/>
</Style>
</Grid.Resources>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Grid.Row="0" Grid.ColumnSpan="4" Background="#1157b9">
<TextBlock Text="发泡线(南)" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="1" Grid.Column="0" Background="#1157b9">
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="2" Grid.Column="0" Background="#1157b9">
<TextBlock Text="1" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="3" Grid.Column="0" Background="#1157b9">
<TextBlock Text="2" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="4" Grid.Column="0" Background="#1157b9">
<TextBlock Text="3" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="5" Grid.Column="0" Background="#1157b9">
<TextBlock Text="4" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="6" Grid.Column="0" Background="#1157b9">
<TextBlock Text="5" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="7" Grid.Column="0" Background="#1157b9">
<TextBlock Text="6" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="1" Grid.Column="1" Background="#1157b9">
<TextBlock Text="状态" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="2" Grid.Column="1" Background="#1157b9">
<Path Data="M 5,5 A 15,15 45 1 1 0,1 Z" Stroke="Green" StrokeThickness="1" Fill="Green" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Row="3" Grid.Column="1" Background="#1157b9">
<Path Data="M 5,5 A 15,15 45 1 1 0,1 Z" Stroke="Green" StrokeThickness="1" Fill="Green" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Row="4" Grid.Column="1" Background="#1157b9">
<Path Data="M 5,5 A 15,15 45 1 1 0,1 Z" Stroke="Green" StrokeThickness="1" Fill="Green" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Row="5" Grid.Column="1" Background="#1157b9">
<Path Data="M 5,5 A 15,15 45 1 1 0,1 Z" Stroke="Green" StrokeThickness="1" Fill="Green" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Row="6" Grid.Column="1" Background="#1157b9">
<Path Data="M 5,5 A 15,15 45 1 1 0,1 Z" Stroke="Green" StrokeThickness="1" Fill="Green" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Row="7" Grid.Column="1" Background="#1157b9">
<Path Data="M 5,5 A 15,15 45 1 1 0,1 Z" Stroke="Green" StrokeThickness="1" Fill="Green" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Row="1" Grid.Column="2" Background="#1157b9">
<TextBlock Text="发泡型号" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="2" Grid.Column="2" >
</Border>
<Border Grid.Row="3" Grid.Column="2">
</Border>
<Border Grid.Row="4" Grid.Column="2">
</Border>
<Border Grid.Row="5" Grid.Column="2">
</Border>
<Border Grid.Row="6" Grid.Column="2">
</Border>
<Border Grid.Row="7" Grid.Column="2">
</Border>
<Border Grid.Row="1" Grid.Column="3" Background="#1157b9">
<TextBlock Text="夹具产量" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="2" Grid.Column="3" >
</Border>
<Border Grid.Row="3" Grid.Column="3">
</Border>
<Border Grid.Row="4" Grid.Column="3">
</Border>
<Border Grid.Row="5" Grid.Column="3">
</Border>
<Border Grid.Row="6" Grid.Column="3">
</Border>
<Border Grid.Row="7" Grid.Column="3">
</Border>
<Border Grid.Row="0" Grid.Column="4" Grid.ColumnSpan="3" >
<TextBlock Text="450" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="1" Grid.Column="4" Background="#1157b9">
<TextBlock Text="发泡量" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="2" Grid.Column="4" >
</Border>
<Border Grid.Row="3" Grid.Column="4">
</Border>
<Border Grid.Row="4" Grid.Column="4">
</Border>
<Border Grid.Row="5" Grid.Column="4">
</Border>
<Border Grid.Row="6" Grid.Column="4">
</Border>
<Border Grid.Row="7" Grid.Column="4">
</Border>
<Border Grid.Row="0" Grid.Column="7" Grid.ColumnSpan="4" Background="#1157b9">
<TextBlock Text="发泡线(北)" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="1" Grid.Column="5" Background="#1157b9">
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="2" Grid.Column="5" Background="#1157b9">
<TextBlock Text="1" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="3" Grid.Column="5" Background="#1157b9">
<TextBlock Text="2" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="4" Grid.Column="5" Background="#1157b9">
<TextBlock Text="3" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="5" Grid.Column="5" Background="#1157b9">
<TextBlock Text="4" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="6" Grid.Column="5" Background="#1157b9">
<TextBlock Text="5" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="7" Grid.Column="5" Background="#1157b9">
<TextBlock Text="6" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="1" Grid.Column="6" Background="#1157b9">
<TextBlock Text="状态" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="2" Grid.Column="6" Background="#1157b9">
<Path Data="M 5,5 A 15,15 45 1 1 0,1 Z" Stroke="Green" StrokeThickness="1" Fill="Green" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Row="3" Grid.Column="6" Background="#1157b9">
<Path Data="M 5,5 A 15,15 45 1 1 0,1 Z" Stroke="Green" StrokeThickness="1" Fill="Green" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Row="4" Grid.Column="6" Background="#1157b9">
<Path Data="M 5,5 A 15,15 45 1 1 0,1 Z" Stroke="Green" StrokeThickness="1" Fill="Green" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Row="5" Grid.Column="6" Background="#1157b9">
<Path Data="M 5,5 A 15,15 45 1 1 0,1 Z" Stroke="Green" StrokeThickness="1" Fill="Green" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Row="6" Grid.Column="6" Background="#1157b9">
<Path Data="M 5,5 A 15,15 45 1 1 0,1 Z" Stroke="Green" StrokeThickness="1" Fill="Green" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Row="7" Grid.Column="6" Background="#1157b9">
<Path Data="M 5,5 A 15,15 45 1 1 0,1 Z" Stroke="Green" StrokeThickness="1" Fill="Green" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Row="1" Grid.Column="7" Background="#1157b9">
<TextBlock Text="发泡型号" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="2" Grid.Column="7" >
</Border>
<Border Grid.Row="3" Grid.Column="7">
</Border>
<Border Grid.Row="4" Grid.Column="7">
</Border>
<Border Grid.Row="5" Grid.Column="7">
</Border>
<Border Grid.Row="6" Grid.Column="7">
</Border>
<Border Grid.Row="7" Grid.Column="7">
</Border>
<Border Grid.Row="1" Grid.Column="8" Background="#1157b9">
<TextBlock Text="夹具产量" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="2" Grid.Column="8" >
</Border>
<Border Grid.Row="3" Grid.Column="8">
</Border>
<Border Grid.Row="4" Grid.Column="8">
</Border>
<Border Grid.Row="5" Grid.Column="8">
</Border>
<Border Grid.Row="6" Grid.Column="8">
</Border>
<Border Grid.Row="7" Grid.Column="8">
</Border>
<Border Grid.Row="1" Grid.Column="9" Background="#1157b9">
<TextBlock Text="发泡量" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="2" Grid.Column="9" >
</Border>
<Border Grid.Row="3" Grid.Column="9">
</Border>
<Border Grid.Row="4" Grid.Column="9">
</Border>
<Border Grid.Row="5" Grid.Column="9">
</Border>
<Border Grid.Row="6" Grid.Column="9">
</Border>
<Border Grid.Row="7" Grid.Column="9">
</Border>
</Grid>
</UniformGrid>
<UniformGrid Grid.Row="1">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<UniformGrid Grid.Column="0">
<Grid Margin="10,10">
<lvc:CartesianChart Series="{Binding Achievement, UpdateSourceTrigger=PropertyChanged}" LegendLocation="Top" Foreground="White">
<lvc:CartesianChart.DataTooltip >
<lvc:DefaultTooltip SelectionMode="OnlySender" BulletSize="10" Foreground="Black"></lvc:DefaultTooltip>
</lvc:CartesianChart.DataTooltip>
<lvc:CartesianChart.AxisX>
<lvc:Axis Labels="{Binding ProductionHourList}" FontSize="12" LabelsRotation="0" DisableAnimations="True" Position="LeftBottom" Foreground="White">
<lvc:Axis.Separator>
<lvc:Separator Visibility="Hidden" Step="1" StrokeThickness="1.5" StrokeDashArray="0" Stroke="#404F56" >
</lvc:Separator>
</lvc:Axis.Separator>
</lvc:Axis>
</lvc:CartesianChart.AxisX>
<lvc:CartesianChart.AxisY>
<lvc:Axis FontSize="18" Foreground="White" >
<lvc:Axis.Separator>
<lvc:Separator Visibility="Hidden" StrokeThickness="1" StrokeDashArray="3" Stroke="#404F56" >
</lvc:Separator>
</lvc:Axis.Separator>
</lvc:Axis>
</lvc:CartesianChart.AxisY>
</lvc:CartesianChart>
</Grid>
</UniformGrid>
<UniformGrid Grid.Column="1">
<Grid Margin="10,10">
<lvc:CartesianChart LegendLocation="Top" Series="{Binding ModelStatistics, UpdateSourceTrigger=PropertyChanged}" Foreground="White">
<lvc:CartesianChart.DataTooltip>
<lvc:DefaultTooltip BulletSize="10" Foreground="Black"></lvc:DefaultTooltip>
</lvc:CartesianChart.DataTooltip>
<lvc:CartesianChart.AxisX>
<lvc:Axis Labels="{Binding MaterialNameList}" FontSize="12" Foreground="White">
<lvc:Axis.Separator>
<lvc:Separator Step="1" Visibility="Hidden" StrokeThickness="1.5" StrokeDashArray="0" Stroke="#404F56" >
</lvc:Separator>
</lvc:Axis.Separator>
</lvc:Axis>
</lvc:CartesianChart.AxisX>
<lvc:CartesianChart.AxisY>
<lvc:Axis FontSize="18" Foreground="White">
<lvc:Axis.Separator>
<lvc:Separator Visibility="Hidden" StrokeThickness="1" StrokeDashArray="3" Stroke="#404F56" >
</lvc:Separator>
</lvc:Axis.Separator>
</lvc:Axis>
</lvc:CartesianChart.AxisY>
</lvc:CartesianChart>
</Grid>
</UniformGrid>
</Grid>
</UniformGrid>
</Grid>
</Border>
</UserControl>

@ -0,0 +1,30 @@
using Aucma.Core.BoxFoam.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;
namespace Aucma.Core.BoxFoam.Views
{
/// <summary>
/// FoamMonitorPageView.xaml 的交互逻辑
/// </summary>
public partial class FoamMonitorPageView : UserControl
{
public FoamMonitorPageView()
{
InitializeComponent();
this.DataContext = new FoamMonitorPageViewModel();
}
}
}

@ -0,0 +1,291 @@
<UserControl x:Class="Aucma.Core.BoxFoam.Views.FoamPlanPageView"
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.BoxFoam.Views"
mc:Ignorable="d" Background="#1152AC"
d:DesignHeight="1080" d:DesignWidth="1920">
<Border x:Name="HeightHelperPanel" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="5" Background="Transparent" Margin="5">
<Grid>
<Grid.Resources>
<Style TargetType="TextBlock">
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="FontSize" Value="16"/>
<Setter Property="FontFamily" Value="Microsoft YaHei"/>
</Style>
<Style TargetType="Border">
<Setter Property="BorderBrush" Value="#0288d1"/>
<Setter Property="BorderThickness" Value="1"/>
</Style>
</Grid.Resources>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.1*"/>
<ColumnDefinition Width="0.3*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="0.3*"/>
<ColumnDefinition Width="0.3*"/>
</Grid.ColumnDefinitions>
<Border Grid.Row="0" Grid.Column="0"></Border>
<Border Grid.Row="1" Grid.Column="0" >
<TextBlock Text="1" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="2" Grid.Column="0">
<TextBlock Text="2" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="3" Grid.Column="0" >
<TextBlock Text="3" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="4" Grid.Column="0" >
<TextBlock Text="4" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="5" Grid.Column="0" >
<TextBlock Text="5" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="6" Grid.Column="0" >
<TextBlock Text="6" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="7" Grid.Column="0" >
<TextBlock Text="7" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="8" Grid.Column="0" >
<TextBlock Text="8" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="9" Grid.Column="0" >
<TextBlock Text="9" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="10" Grid.Column="0" >
<TextBlock Text="10" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="11" Grid.Column="0" >
<TextBlock Text="11" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="12" Grid.Column="0" >
<TextBlock Text="12" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="0" Grid.Column="1" >
<TextBlock Text="物料编号" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="0" Grid.Column="2" >
<TextBlock Text="物料名称" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="0" Grid.Column="3" >
<TextBlock Text="发泡计划量" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="0" Grid.Column="4" >
<TextBlock Text="操作" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="1" Grid.Column="1" >
<TextBlock Text="9002006859" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="1" Grid.Column="2" >
<TextBlock Text="SC-439,YZXGWBC元气森林,C" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="1" Grid.Column="3" >
<TextBlock Text="9999" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="1" Grid.Column="4" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<Button Content="添加" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding AddPlanCommand}" />
<Button Content="清除" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding ClearPlanCommand}"/>
</WrapPanel>
</Border>
<Border Grid.Row="2" Grid.Column="1" >
<TextBlock Text="9002006859" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="2" Grid.Column="2" >
<TextBlock Text="SC-439,YZXGWBC元气森林,C" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="2" Grid.Column="3" >
<TextBlock Text="9999" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="2" Grid.Column="4" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<Button Content="添加" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding AddPlanCommand}" />
<Button Content="清除" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding ClearPlanCommand}"/>
</WrapPanel>
</Border>
<Border Grid.Row="3" Grid.Column="1" >
<TextBlock Text="9002006859" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="3" Grid.Column="2" >
<TextBlock Text="SC-439,YZXGWBC元气森林,C" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="3" Grid.Column="3" >
<TextBlock Text="9999" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="3" Grid.Column="4" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<Button Content="添加" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding AddPlanCommand}" />
<Button Content="清除" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding ClearPlanCommand}"/>
</WrapPanel>
</Border>
<Border Grid.Row="4" Grid.Column="1" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="4" Grid.Column="2" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="4" Grid.Column="3" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="4" Grid.Column="4" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<Button Content="添加" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding AddPlanCommand}" />
<Button Content="清除" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding ClearPlanCommand}"/>
</WrapPanel>
</Border>
<Border Grid.Row="5" Grid.Column="1" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="5" Grid.Column="2" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="5" Grid.Column="3" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="5" Grid.Column="4" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<Button Content="添加" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding AddPlanCommand}" />
<Button Content="清除" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding ClearPlanCommand}"/>
</WrapPanel>
</Border>
<Border Grid.Row="6" Grid.Column="1" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="6" Grid.Column="2" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="6" Grid.Column="3" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="6" Grid.Column="4" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<Button Content="添加" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding AddPlanCommand}" />
<Button Content="清除" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding ClearPlanCommand}"/>
</WrapPanel>
</Border>
<Border Grid.Row="7" Grid.Column="1" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="7" Grid.Column="2" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="7" Grid.Column="3" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="7" Grid.Column="4" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<Button Content="添加" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding AddPlanCommand}" />
<Button Content="清除" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding ClearPlanCommand}"/>
</WrapPanel>
</Border>
<Border Grid.Row="8" Grid.Column="1" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="8" Grid.Column="2" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="8" Grid.Column="3" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="8" Grid.Column="4" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<Button Content="添加" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding AddPlanCommand}" />
<Button Content="清除" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding ClearPlanCommand}"/>
</WrapPanel>
</Border>
<Border Grid.Row="9" Grid.Column="1" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="9" Grid.Column="2" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="9" Grid.Column="3" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="9" Grid.Column="4" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<Button Content="添加" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding AddPlanCommand}" />
<Button Content="清除" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding ClearPlanCommand}"/>
</WrapPanel>
</Border>
<Border Grid.Row="10" Grid.Column="1" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="10" Grid.Column="2" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="10" Grid.Column="3" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="10" Grid.Column="4" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<Button Content="添加" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding AddPlanCommand}" />
<Button Content="清除" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding ClearPlanCommand}"/>
</WrapPanel>
</Border>
<Border Grid.Row="11" Grid.Column="1" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="11" Grid.Column="2" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="11" Grid.Column="3" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="11" Grid.Column="4" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<Button Content="添加" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding AddPlanCommand}" />
<Button Content="清除" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding ClearPlanCommand}"/>
</WrapPanel>
</Border>
<Border Grid.Row="12" Grid.Column="1" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="12" Grid.Column="2" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="12" Grid.Column="3" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="12" Grid.Column="4" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<Button Content="添加" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding AddPlanCommand}" />
<Button Content="清除" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding ClearPlanCommand}"/>
</WrapPanel>
</Border>
</Grid>
</Border>
</UserControl>

@ -1,4 +1,5 @@
using System;
using Aucma.Core.BoxFoam.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -10,18 +11,20 @@ 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;
namespace Aucma.Core.PrintTo.Views
namespace Aucma.Core.BoxFoam.Views
{
/// <summary>
/// HomeWindowView.xaml 的交互逻辑
/// FoamPlanPageView.xaml 的交互逻辑
/// </summary>
public partial class HomeWindowView : Window
public partial class FoamPlanPageView : UserControl
{
public HomeWindowView()
public FoamPlanPageView()
{
InitializeComponent();
this.DataContext = new FoamPlanPageViewModel();
}
}
}

@ -8,7 +8,7 @@
Title="澳柯玛箱体发泡控制系统"
d:DesignHeight="800"
d:DesignWidth="1000" FontFamily="Microsoft YaHei"
MinHeight="1080" MinWidth="1920" WindowState="Normal"
WindowStyle="ToolWindow" WindowState="Maximized"
WindowStartupLocation="CenterScreen"
>
<Window.Background>
@ -44,8 +44,8 @@
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="白班" FontSize="25" Foreground="White" FontWeight="Bold" Margin="0,0,30,0"/>
<TextBlock Grid.Column="1" Text="|" FontSize="25" Foreground="White" FontWeight="Bold" Margin="0,0,30,0"/>
<TextBlock Grid.Column="2" Text="SCADA" FontSize="25" Foreground="White" FontWeight="Bold" Margin="0,0,10,0"/>
<!--<TextBlock Grid.Column="1" Text="|" FontSize="25" Foreground="White" FontWeight="Bold" Margin="0,0,30,0"/>
<TextBlock Grid.Column="2" Text="SCADA" FontSize="25" Foreground="White" FontWeight="Bold" Margin="0,0,10,0"/>-->
</Grid>
</StackPanel>
</Grid>
@ -68,6 +68,9 @@
<Button Content="实时库存" x:Name="RealTimeInventoryPage" Margin="5 0" Command="{Binding SwitchPagesCommand}" CommandParameter="{Binding Name,ElementName=RealTimeInventoryPage}" />
<Button Content="任务监控" x:Name="MonitorPage" Margin="5 0" Command="{Binding SwitchPagesCommand}" CommandParameter="{Binding Name,ElementName=MonitorPage}" />
<Button Content="入库统计" x:Name="StatisticsPage" Margin="5 0" Command="{Binding SwitchPagesCommand}" CommandParameter="{Binding Name,ElementName=StatisticsPage}" />
<Button Content="发泡计划" x:Name="FoamPlanPage" Margin="5 0" Command="{Binding SwitchPagesCommand}" CommandParameter="{Binding Name,ElementName=FoamPlanPage}" />
<Button Content="发泡监控" x:Name="FoamMonitorPage" Margin="5 0" Command="{Binding SwitchPagesCommand}" CommandParameter="{Binding Name,ElementName=FoamMonitorPage}" />
<Button Content="库存设置" x:Name="SetLibPage" Margin="5 0" Command="{Binding SwitchPagesCommand}" CommandParameter="{Binding Name,ElementName=StatisticsPage}" />
<Button Content="键 盘" x:Name="TabTip" Margin="5 0" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=TabTip}" />
<Button Content="最小化" x:Name="Minimized" Margin="5 0" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=Minimized}" Background="#FF9900" BorderBrush="#FF9900" />
<Button Content="退 出" x:Name="Exit" Margin="5 0" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=Exit}" Background="#FF0033" BorderBrush="#FF0033"/>

@ -109,7 +109,7 @@
"TriggerType": 1,
"IntervalSecond": 1,
"CycleRunTimes": 1,
"IsStart": true,
"IsStart": false,
"JobParams": null,
"DelFlag": false,
"CreateBy": "admin",
@ -131,7 +131,7 @@
"TriggerType": 1,
"IntervalSecond": 1,
"CycleRunTimes": 1,
"IsStart": true,
"IsStart": false,
"JobParams": null,
"DelFlag": false,
"CreateBy": "admin",

@ -78,6 +78,9 @@
</ItemGroup>
<ItemGroup>
<Compile Update="Views\PalletizPageView.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="Views\StatisticsPageView.xaml.cs">
<SubType>Code</SubType>
</Compile>

@ -7,6 +7,9 @@
</ApplicationDefinition>
</ItemGroup>
<ItemGroup>
<Page Update="Views\PalletizPageView.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="Views\IndexPageView.xaml">
<SubType>Designer</SubType>
</Page>

@ -15,7 +15,7 @@ namespace Aucma.Core.Palletiz.ViewModels
private static readonly log4net.ILog log = LogManager.GetLogger(typeof(MainWindowViewModel));
private IndexPageView firstPage = new IndexPageView();//首页
private StatisticsPageView recordPage = new StatisticsPageView();
private PalletizPageView palletizPage = new PalletizPageView();
public MainWindowViewModel()
{
UserContent = firstPage;
@ -118,6 +118,9 @@ namespace Aucma.Core.Palletiz.ViewModels
case "RecordPage":
UserContent = recordPage;
break;
case "PalletizPage":
UserContent = palletizPage;
break;
default:
break;
}

@ -0,0 +1,15 @@
using CommunityToolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Aucma.Core.Palletiz.ViewModels
{
public partial class PalletizPageViewModel : ObservableObject
{
public PalletizPageViewModel() { }
}
}

@ -8,7 +8,7 @@
d:DesignHeight="800"
d:DesignWidth="1000" FontFamily="Microsoft YaHei"
MinHeight="1080" MinWidth="1920" WindowState="Maximized"
WindowStartupLocation="CenterScreen" WindowStyle="None"
WindowStartupLocation="CenterScreen" WindowStyle="ToolWindow"
>
<Window.Background>
<ImageBrush ImageSource="/Assets/images/background.jpg" />
@ -65,6 +65,7 @@
<StackPanel Grid.Row="1" Height="50" Orientation="Horizontal" Margin="5 0" HorizontalAlignment="Left">
<Button Content="实时监控" x:Name="FirstPage" Command="{Binding SwitchPagesCommand}" CommandParameter="{Binding Name,ElementName=FirstPage}" Margin="5 0" />
<Button Content="扫描记录" x:Name="RecordPage" Margin="5 0" Command="{Binding SwitchPagesCommand}" CommandParameter="{Binding Name,ElementName=RecordPage}" />
<Button Content="分垛库设置" x:Name="PalletizPage" Margin="5 0" Command="{Binding SwitchPagesCommand}" CommandParameter="{Binding Name,ElementName=PalletizPage}" />
<Button Content="键 盘" x:Name="TabTip" Margin="5 0" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=TabTip}" />
<Button Content="最小化" x:Name="Minimized" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=Minimized}" Width="100" Background="#FF9900" BorderBrush="#FF9900" Margin="0,0,10,0"/>
<Button Content="退 出" x:Name="Exit" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=Exit}" Width="100" Background="#FF0033" BorderBrush="#FF0033" Margin="0,0,10,0"/>

@ -0,0 +1,371 @@
<UserControl x:Class="Aucma.Core.Palletiz.Views.PalletizPageView"
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.Palletiz.Views"
mc:Ignorable="d" Background="#1152AC"
d:DesignHeight="1080" d:DesignWidth="1920">
<Border x:Name="HeightHelperPanel" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="5" Background="Transparent" Margin="5">
<Grid>
<Grid.Resources>
<Style TargetType="TextBlock">
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="FontSize" Value="16"/>
<Setter Property="FontFamily" Value="Microsoft YaHei"/>
</Style>
<Style TargetType="Border">
<Setter Property="BorderBrush" Value="#0288d1"/>
<Setter Property="BorderThickness" Value="1"/>
</Style>
</Grid.Resources>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.1*"/>
<ColumnDefinition Width="0.3*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="0.3*"/>
<ColumnDefinition Width="0.3*"/>
<ColumnDefinition Width="0.3*"/>
</Grid.ColumnDefinitions>
<Border Grid.Row="0" Grid.Column="0"></Border>
<Border Grid.Row="1" Grid.Column="0" >
<TextBlock Text="1" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="2" Grid.Column="0">
<TextBlock Text="2" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="3" Grid.Column="0" >
<TextBlock Text="3" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="4" Grid.Column="0" >
<TextBlock Text="4" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="5" Grid.Column="0" >
<TextBlock Text="5" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="6" Grid.Column="0" >
<TextBlock Text="6" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="7" Grid.Column="0" >
<TextBlock Text="7" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="8" Grid.Column="0" >
<TextBlock Text="8" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="9" Grid.Column="0" >
<TextBlock Text="9" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="10" Grid.Column="0" >
<TextBlock Text="10" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="11" Grid.Column="0" >
<TextBlock Text="11" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="12" Grid.Column="0" >
<TextBlock Text="12" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="0" Grid.Column="1" >
<TextBlock Text="物料编号" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="0" Grid.Column="2" >
<TextBlock Text="物料名称" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="0" Grid.Column="3" >
<TextBlock Text="转向角度" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="0" Grid.Column="4" >
<TextBlock Text="是否占用多货道" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="0" Grid.Column="5" >
<TextBlock Text="操作" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="1" Grid.Column="1" >
<TextBlock Text="9002006859" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="1" Grid.Column="2" >
<TextBlock Text="SC-439,YZXGWBC元气森林,C" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="1" Grid.Column="3" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<TextBlock Text="180" Foreground="White" FontSize="20"/>
<TextBlock Text="°" Foreground="White" FontSize="20"/>
</WrapPanel>
</Border>
<Border Grid.Row="1" Grid.Column="4" >
<TextBlock Text="是" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="1" Grid.Column="5" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<Button Content="添加" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding AddPlanCommand}" />
<Button Content="清除" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding ClearPlanCommand}"/>
</WrapPanel>
</Border>
<Border Grid.Row="2" Grid.Column="1" >
<TextBlock Text="9002006890" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="2" Grid.Column="2" >
<TextBlock Text="SC-439,YZXGWBC元气森林" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="2" Grid.Column="3" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<TextBlock Text="90" Foreground="White" FontSize="20"/>
<TextBlock Text="°" Foreground="White" FontSize="20"/>
</WrapPanel>
</Border>
<Border Grid.Row="2" Grid.Column="4" >
<TextBlock Text="是" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="2" Grid.Column="5" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<Button Content="添加" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding AddPlanCommand}" />
<Button Content="清除" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding ClearPlanCommand}"/>
</WrapPanel>
</Border>
<Border Grid.Row="3" Grid.Column="1" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="3" Grid.Column="2" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="3" Grid.Column="3" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<TextBlock Text="0" Foreground="White" FontSize="20"/>
<TextBlock Text="°" Foreground="White" FontSize="20"/>
</WrapPanel>
</Border>
<Border Grid.Row="3" Grid.Column="4" >
<TextBlock Text="否" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="3" Grid.Column="5" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<Button Content="添加" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding AddPlanCommand}" />
<Button Content="清除" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding ClearPlanCommand}"/>
</WrapPanel>
</Border>
<Border Grid.Row="4" Grid.Column="1" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="4" Grid.Column="2" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="4" Grid.Column="3" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<TextBlock Text="0" Foreground="White" FontSize="20"/>
<TextBlock Text="°" Foreground="White" FontSize="20"/>
</WrapPanel>
</Border>
<Border Grid.Row="4" Grid.Column="4" >
<TextBlock Text="否" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="4" Grid.Column="5" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<Button Content="添加" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding AddPlanCommand}" />
<Button Content="清除" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding ClearPlanCommand}"/>
</WrapPanel>
</Border>
<Border Grid.Row="5" Grid.Column="1" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="5" Grid.Column="2" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="5" Grid.Column="3" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="5" Grid.Column="3" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<TextBlock Text="0" Foreground="White" FontSize="20"/>
<TextBlock Text="°" Foreground="White" FontSize="20"/>
</WrapPanel>
</Border>
<Border Grid.Row="5" Grid.Column="4" >
<TextBlock Text="否" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="5" Grid.Column="5" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<Button Content="添加" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding AddPlanCommand}" />
<Button Content="清除" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding ClearPlanCommand}"/>
</WrapPanel>
</Border>
<Border Grid.Row="6" Grid.Column="1" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="6" Grid.Column="2" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="6" Grid.Column="3" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<TextBlock Text="0" Foreground="White" FontSize="20"/>
<TextBlock Text="°" Foreground="White" FontSize="20"/>
</WrapPanel>
</Border>
<Border Grid.Row="6" Grid.Column="4" >
<TextBlock Text="否" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="6" Grid.Column="5" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<Button Content="添加" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding AddPlanCommand}" />
<Button Content="清除" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding ClearPlanCommand}"/>
</WrapPanel>
</Border>
<Border Grid.Row="7" Grid.Column="1" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="7" Grid.Column="2" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="7" Grid.Column="3" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<TextBlock Text="0" Foreground="White" FontSize="20"/>
<TextBlock Text="°" Foreground="White" FontSize="20"/>
</WrapPanel>
</Border>
<Border Grid.Row="7" Grid.Column="4" >
<TextBlock Text="否" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="7" Grid.Column="5" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<Button Content="添加" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding AddPlanCommand}" />
<Button Content="清除" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding ClearPlanCommand}"/>
</WrapPanel>
</Border>
<Border Grid.Row="8" Grid.Column="1" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="8" Grid.Column="2" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="8" Grid.Column="3" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<TextBlock Text="0" Foreground="White" FontSize="20"/>
<TextBlock Text="°" Foreground="White" FontSize="20"/>
</WrapPanel>
</Border>
<Border Grid.Row="8" Grid.Column="4" >
<TextBlock Text="否" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="8" Grid.Column="5" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<Button Content="添加" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding AddPlanCommand}" />
<Button Content="清除" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding ClearPlanCommand}"/>
</WrapPanel>
</Border>
<Border Grid.Row="9" Grid.Column="1" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="9" Grid.Column="2" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="9" Grid.Column="3" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<TextBlock Text="0" Foreground="White" FontSize="20"/>
<TextBlock Text="°" Foreground="White" FontSize="20"/>
</WrapPanel>
</Border>
<Border Grid.Row="9" Grid.Column="4" >
<TextBlock Text="否" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="9" Grid.Column="5" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<Button Content="添加" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding AddPlanCommand}" />
<Button Content="清除" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding ClearPlanCommand}"/>
</WrapPanel>
</Border>
<Border Grid.Row="10" Grid.Column="1" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="10" Grid.Column="2" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="10" Grid.Column="3" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<TextBlock Text="0" Foreground="White" FontSize="20"/>
<TextBlock Text="°" Foreground="White" FontSize="20"/>
</WrapPanel>
</Border>
<Border Grid.Row="10" Grid.Column="4" >
<TextBlock Text="否" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="10" Grid.Column="5" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<Button Content="添加" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding AddPlanCommand}" />
<Button Content="清除" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding ClearPlanCommand}"/>
</WrapPanel>
</Border>
<Border Grid.Row="11" Grid.Column="1" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="11" Grid.Column="2" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="11" Grid.Column="3" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<TextBlock Text="0" Foreground="White" FontSize="20"/>
<TextBlock Text="°" Foreground="White" FontSize="20"/>
</WrapPanel>
</Border>
<Border Grid.Row="11" Grid.Column="4" >
<TextBlock Text="否" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="11" Grid.Column="5" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<Button Content="添加" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding AddPlanCommand}" />
<Button Content="清除" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding ClearPlanCommand}"/>
</WrapPanel>
</Border>
<Border Grid.Row="12" Grid.Column="1" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="12" Grid.Column="2" >
<TextBlock Text="" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="12" Grid.Column="3" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<TextBlock Text="0" Foreground="White" FontSize="20"/>
<TextBlock Text="°" Foreground="White" FontSize="20"/>
</WrapPanel>
</Border>
<Border Grid.Row="12" Grid.Column="4" >
<TextBlock Text="否" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="12" Grid.Column="5" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<Button Content="添加" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding AddPlanCommand}" />
<Button Content="清除" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding ClearPlanCommand}"/>
</WrapPanel>
</Border>
</Grid>
</Border>
</UserControl>

@ -0,0 +1,17 @@
using Aucma.Core.Palletiz.ViewModels;
using System.Windows.Controls;
namespace Aucma.Core.Palletiz.Views
{
/// <summary>
/// FoamPlanPageView.xaml 的交互逻辑
/// </summary>
public partial class PalletizPageView : UserControl
{
public PalletizPageView()
{
InitializeComponent();
this.DataContext = new PalletizPageViewModel();
}
}
}

@ -50,6 +50,14 @@ namespace Aucma.Core.PrintTo.Models
/// </summary>
public int StandardAmount { get; set; } = 0;
/// <summary>
/// 内胆数量
/// </summary>
public int LinerAmount { get; set; } = 0;
/// <summary>
/// 箱体数量
/// </summary>
public int BoxAmount { get; set; } = 0;
/// <summary>
/// 异常量
/// </summary>
public int ErrorNum { get; set; } = 0;

@ -1,167 +0,0 @@
using Aucma.Core.PrintTo.Models;
using Aucma.Core.PrintTo.Views;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using MaterialDesignThemes.Wpf;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics.Metrics;
using System.Drawing.Imaging;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
/*
*
*
*/
namespace Aucma.Core.PrintTo.ViewModels
{
public partial class HomeWindowViewModel : ObservableObject
{
public HomeWindowViewModel()
{
LoadData();
}
#region 加载DataGrid数据
private void LoadData()
{
//Datalist.Add(new OrderInfo() { OrderTime = "2023-10-07", material_code = "2135556", material_name = "内胆" });
//Datalist.Add(new OrderInfo() { OrderTime = "2023-10-07", material_code = "2135556", material_name = "内胆" });
//Datalist.Add(new OrderInfo() { OrderTime = "2023-10-07", material_code = "2135556", material_name = "内胆" });
//Datalist.Add(new OrderInfo() { OrderTime = "2023-10-07", material_code = "2135556", material_name = "内胆" });
//Datalist.Add(new OrderInfo() { OrderTime = "2023-10-07", material_code = "2135556", material_name = "内胆" });
//Datalist.Add(new OrderInfo() { OrderTime = "2023-10-07", material_code = "2135556", material_name = "内胆" });
//Datalist.Add(new OrderInfo() { OrderTime = "2023-10-07", material_code = "2135556", material_name = "内胆" });
//Datalist.Add(new OrderInfo() { OrderTime = "2023-10-07", material_code = "2135556", material_name = "内胆" });
//Datalist.Add(new OrderInfo() { OrderTime = "2023-10-07", material_code = "2135556", material_name = "内胆" });
//Datalist.Add(new OrderInfo() { OrderTime = "2023-10-07", material_code = "2135556", material_name = "内胆" });
//Datalist.Add(new OrderInfo() { OrderTime = "2023-10-07", material_code = "2135556", material_name = "内胆" });
//Datalist.Add(new OrderInfo() { OrderTime = "2023-10-07", material_code = "2135556", material_name = "内胆" });
//Datalist.Add(new OrderInfo() { OrderTime = "2023-10-07", material_code = "2135556", material_name = "内胆" });
//Datalist.Add(new OrderInfo() { OrderTime = "2023-10-07", material_code = "2135556", material_name = "内胆" });
//Datalist.Add(new OrderInfo() { OrderTime = "2023-10-07", material_code = "2135556", material_name = "内胆" });
//Datalist.Add(new OrderInfo() { OrderTime = "2023-10-07", material_code = "2135556", material_name = "内胆" });
//Datalist.Add(new OrderInfo() { OrderTime = "2023-10-07", material_code = "2135556", material_name = "内胆" });
//Datalist.Add(new OrderInfo() { OrderTime = "2023-10-07", material_code = "2135556", material_name = "内胆" });
//Datalist.Add(new OrderInfo() { OrderTime = "2023-10-07", material_code = "2135556", material_name = "内胆" });
//Datalist.Add(new OrderInfo() { OrderTime = "2023-10-07", material_code = "2135556", material_name = "内胆" });
//Datalist.Add(new OrderInfo() { OrderTime = "2023-10-07", material_code = "2135556", material_name = "内胆" });
//Datalist.Add(new OrderInfo() { OrderTime = "2023-10-07", material_code = "2135556", material_name = "内胆" });
//Datalist.Add(new OrderInfo() { OrderTime = "2023-10-07", material_code = "2135556", material_name = "内胆" });
//Datalist.Add(new OrderInfo() { OrderTime = "2023-10-07", material_code = "2135556", material_name = "内胆" });
}
#endregion
#region 查询按钮
/// <summary>
/// 查询
/// </summary>
[RelayCommand]
private void QueryString(string queryStr)
{
System.Windows.Application.Current.Dispatcher.Invoke((Action)(() =>
{
if (!string.IsNullOrEmpty(queryStr))
{
Datalist.Clear();
//Datalist.Add(new OrderInfo() { OrderTime = "2023-10-06", material_code = "123456", material_name = "箱体", PrintName = queryStr });
}
else
{
Datalist.Clear();
LoadData();
}
//Datalist.Insert(0, Datalist[Datalist.Count - 1]);
//Datalist.RemoveAt(Datalist.Count - 1);
}));
}
#endregion
#region 打印
/// <summary>
/// 打印
/// </summary>
[RelayCommand]
private void Print()
{
MessageBox.Show("打印");
PrintToDevView window=new PrintToDevView();
window.ShowDialog();
}
#endregion
#region 重打
/// <summary>
///重打
/// </summary>
[RelayCommand]
private void Reprint()
{
MessageBox.Show("重打");
// OrderInfo info = new OrderInfo();
}
#endregion
#region 补打
/// <summary>
///补打
/// </summary>
[RelayCommand]
private void SupplementaryPrint()
{
MessageBox.Show("补打");
// OrderInfo info = new OrderInfo();
}
#endregion
#region 续打
/// <summary>
///续打
/// </summary>
[RelayCommand]
private void ContinuedPrint()
{
MessageBox.Show("续打");
// OrderInfo info = new OrderInfo();
}
#endregion
#region 初始化datagrid
private ObservableCollection<OrderInfo> datalist = new ObservableCollection<OrderInfo>();
public ObservableCollection<OrderInfo> Datalist
{
get { return datalist; }
set
{
datalist = value;
OnPropertyChanged();//属性通知
}
}
#endregion
#region 获取当前行数据 赋值到textbox
private OrderInfo selectedCells;
public OrderInfo SelectedCells
{
get { return selectedCells; }
set
{
selectedCells = value;
SetProperty(ref selectedCells, value);
}
}
#endregion
}
}

@ -32,10 +32,7 @@ namespace Aucma.Core.PrintTo.ViewModels
PrintIsEnabled = "True";
WeakReferenceMessenger.Default.Register<string>(this, Recive);
Task.Run(async ()=>
{
await LoadData();
});
Task.WaitAll(LoadData());
}
#region 加载DataGrid数据
@ -45,20 +42,23 @@ namespace Aucma.Core.PrintTo.ViewModels
var list = await _baseOrderInfoServices.QueryPrintInfo();
foreach (var item in list)
{
OrderInfo info = new OrderInfo();
info.CreatedTime = item.CreateTime;
info.OrderCode = item.OrderCode;
info.ProductCode = item.ProductCode;
info.ProductName = item.ProductName;
info.PlanAmount = item.PlanAmount;
info.CompleteAmount = item.CompleteAmount;
info.MaterialCode = item.MaterialCode;
info.MaterialName = item.MaterialName;
info.StandardAmount = item.StandardAmount;
info.ErrorNum = item.ErrorAmount;
info.LinerCodeNum = item.LinerAmount;
info.BoxCodeNum = item.BoxAmount;
Datalist.Add(info);
Datalist.Add(new OrderInfo()
{
CreatedTime = item.CreateTime,
OrderCode = item.OrderCode,
ProductCode = item.ProductCode,
ProductName = item.ProductName,
PlanAmount = item.PlanAmount,
CompleteAmount = item.CompleteAmount,
MaterialCode = item.MaterialCode,
MaterialName = item.MaterialName,
StandardAmount = item.StandardAmount,
LinerAmount = item.LinerAmount,
BoxAmount = item.StandardAmount,
ErrorNum = item.ErrorAmount,
LinerCodeNum = item.LinerAmount,
BoxCodeNum = item.BoxAmount
});
}
}
#endregion
@ -181,10 +181,6 @@ namespace Aucma.Core.PrintTo.ViewModels
MessageBox.Show("请选中需要打印的产品!","系统提醒");
return;
}
//if (!CheckPrintPassword())
//{
// return;
//}
try
{
string order_code = SelectedCells.OrderCode;

@ -11,6 +11,8 @@ using FastReport;
using FastReport.DevComponents.DotNetBar;
using log4net;
using Microsoft.Extensions.DependencyInjection;
using NPOI.SS.Formula.Functions;
using StackExchange.Profiling.Internal;
using System;
using System.Collections.Generic;
using System.Diagnostics;
@ -26,33 +28,44 @@ namespace Aucma.Core.PrintTo.ViewModels
private static readonly log4net.ILog log = LogManager.GetLogger(typeof(PrintToDevViewModel));
protected readonly IOrderBomInfoServices _orderBomInfoServices;
protected readonly IPrintBarCodeServices _printBarCodeServices;
private List<OrderBomInfo> items { get; }
private Queue<OrderBomInfo> BarcodesUnprinted { get; } = new Queue<OrderBomInfo>();
private Queue<OrderBomInfo> BarcodesPrinted { get; } = new Queue<OrderBomInfo>();
private PrintState printState { get; set; } = PrintState.Idle;//打印状态
protected bool isPrint { get; set; } = true;//打印打印标志
public PrintToDevViewModel() { }
protected bool isPrint { get; set; } = true;//打印标志
public PrintToDevViewModel(string productCode, string materialCode, string materialName, int printAmount, string? barCode = null)
#region 构造函数
/// <summary>
/// 构造函数
/// </summary>
/// <param name="productCode">产品编码</param>
/// <param name="materialCode">物料编码</param>
/// <param name="materialName">型号简码</param>
/// <param name="printAmount">打印数量</param>
public PrintToDevViewModel(string productCode, string materialCode, string materialName, int printAmount)
{
_orderBomInfoServices = App.ServiceProvider.GetService<IOrderBomInfoServices>();
_printBarCodeServices = App.ServiceProvider.GetService<IPrintBarCodeServices>();
ProductCode = productCode;
MaterialName = materialName;
MaterialCode= materialCode;
PrintAmount = printAmount;
Progress = 0;
MaxProgress = printAmount;//最大数
State = "Green";
ErrorNum = 0;
ErrorNum = 0;//异常
printState = PrintState.Printing;
isPrint=true;
SuspendEnabled = "False";
OperateEnabled = "True";
SuspendEnabled = "False";//暂停打印
OperateEnabled = "True";//打印
// 非阻塞打印
Task.Run(async () =>
{
await ExecPrintAsync(productCode, materialCode, materialName, 0);
await ExecPrintAsync(productCode, materialCode, printAmount);
});
}
#endregion
#region 选中订单参数
@ -74,16 +87,16 @@ namespace Aucma.Core.PrintTo.ViewModels
public string ProductCode { get => _productCode; set => SetProperty(ref _productCode, value); }
#endregion
#region 物料型号
#region 型号简码
private string _materialName;
public string MaterialName { get => _materialName; set => SetProperty(ref _materialName, value); }
#endregion
#region 打印条
private string _barCode;
#region 物料编
private string _materialCode;
public string BarCode { get => _barCode; set => SetProperty(ref _barCode, value); }
public string MaterialCode { get => _materialCode; set => SetProperty(ref _materialCode, value); }
#endregion
#region 打印数量
@ -214,47 +227,36 @@ namespace Aucma.Core.PrintTo.ViewModels
#endregion
#region 执行打印
#region 将打印数据添加到队列中
/// <summary>
/// 执行打印
/// 将打印数据添加到队列中
/// </summary>
/// <param name="planCode"></param>
/// <param name="orderNo"></param>
/// <param name="materialName"></param>
/// <param name="planAmount"></param>
public async Task ExecPrintAsync(string orderNo, string materialCode, string materialName, int planAmount)
/// <param name="orderNo">订单号</param>
/// <param name="materialCode">物料码</param>
/// <param name="planAmount">打印数量</param>
public async Task ExecPrintAsync(string orderNo, string materialCode, int planAmount)
{
string printer = Appsettings.app("Printer", "PrinterName");
var boxList = await _orderBomInfoServices.QueryAsync(d => d.ParentId == orderNo&&d.MaterialName.Contains("箱体"));
if (boxList.Count == 0)
{
MaxProgress = boxList.Count;
MessageBox.Show("无法查询打印条码数据", "系统提醒");
return;
}
var list = await _orderBomInfoServices.QueryAsync(d => d.ParentId == orderNo && d.MaterialName.Contains("内胆"));
if (list.Count == 0)
var obj = await _orderBomInfoServices.FirstAsync(d => d.MaterialCode == materialCode);
if (obj == null)
{
MaxProgress = list.Count;
MessageBox.Show("无法查询打印条码数据", "系统提醒");
return;
}
list.ForEach(d => BarcodesUnprinted.Enqueue(d));
for (int i = 0; i < planAmount; i++) { BarcodesUnprinted.Enqueue(obj); }
}
#endregion
#region 打印
public Task Print()
public async Task<bool> Print()
{
try
{
string printer = Appsettings.app("Printer", "PrinterName");
int printNum = BarcodesUnprinted.Count;//打印数
int i = 0;
MaxProgress = printNum;
ErrorNum = 0;
int i = 1;
while (BarcodesUnprinted.Count > 0)
{
if (printState == PrintState.Paused)
@ -264,62 +266,89 @@ namespace Aucma.Core.PrintTo.ViewModels
continue;
}
if (printState == PrintState.Completetd) break;
PrintBarCode printBarCode = new PrintBarCode();
try
{
var item = BarcodesUnprinted.Peek();
string barCode = string.Empty;
if (item.MaterialName.Contains("U壳"))
{
string rowNum = await GetMaxNumAsync(item.MaterialCode,"B");//最大值+1
barCode = $"B{DateTime.Now.ToString("yyMMdd")}{item.MaterialCode}{rowNum}";
PrintProgress = $"[{PrintAmount}/{i}] {barCode}";
printBarCode.MaterialBarcode = barCode;
printBarCode.PrintBarType = 1;
Console.WriteLine($"B{DateTime.Now.ToString("yyMMdd")}{item.MaterialCode}{rowNum}");
}
if (item.MaterialName.Contains("内胆"))
{
string rowNum = await GetMaxNumAsync(item.MaterialCode, "L");//最大值+1
barCode = $"L{DateTime.Now.ToString("yyMMdd")}{item.MaterialCode}{rowNum}";
PrintProgress = $"[{PrintAmount}/{i}] {barCode}";
printBarCode.MaterialBarcode = barCode;
printBarCode.PrintBarType = 2;//内胆码
Console.WriteLine($"L{DateTime.Now.ToString("yyMMdd")}{item.MaterialCode}{rowNum}");
}
#region 打印
//对接打印机
Report barReport = new Report();
barReport.Load(System.Environment.CurrentDirectory + @"\Report\MaterialBar.frx");//打印报表位置
////对接打印机
//Report barReport = new Report();
//barReport.Load(System.Environment.CurrentDirectory + @"\Report\MaterialBar.frx");//打印报表位置
// 设置打印机和打印选项
barReport.PrintSettings.ShowDialog = false; // 是否打开打印机选择框
barReport.PrintSettings.Printer = printer; // 设置打印机名称
barReport.PrintSettings.Copies = 1; // 设置打印份数
//barReport.PrintSettings.PageRange = "1-3"; // 设置打印页范围
//// 设置打印机和打印选项
//barReport.PrintSettings.ShowDialog = false; // 是否打开打印机选择框
//barReport.PrintSettings.Printer = printer; // 设置打印机名称
//barReport.PrintSettings.Copies = 1; // 设置打印份数
// //barReport.PrintSettings.PageRange = "1-3"; // 设置打印页范围
//barReport.SetParameterValue("BoxBarData.Id", item.barCode);
//barReport.SetParameterValue("BoxBarData.Order_No", orderNo);//订单码
//barReport.SetParameterValue("BoxBarData.Order_Material_Name", materialName);//物料名称
//barReport.SetParameterValue("BoxBarData.Bar_Code", barCode);//二维码
barReport.SetParameterValue("BoxBarData.Id", barCode);
barReport.SetParameterValue("BoxBarData.Order_No", ProductCode);//订单号
barReport.SetParameterValue("BoxBarData.Order_Material_Name", item.MaterialName);//物料简码
barReport.SetParameterValue("BoxBarData.Bar_Code", barCode);//二维码
////barReport.Prepare();
////string BarPath = System.Environment.CurrentDirectory + @"\pdf\" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".pdf";
////barReport.Export(new PDFExport(), BarPath);
//barReport.Prepare();
//string BarPath = System.Environment.CurrentDirectory + @"\pdf\" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".pdf";
//barReport.Export(new PDFExport(), BarPath);
//barReport.Print();
barReport.Print();
if (item.MaterialName.Contains("箱体"))
#endregion
printBarCode.ProductCode = ProductCode;
printBarCode.MaterialCode = item.MaterialCode;
printBarCode.MaterialName = item.MaterialName;
printBarCode.PrintTime = DateTime.Now;
printBarCode.SupplementMaterial =0;
if (string.IsNullOrEmpty(printBarCode.MaterialBarcode))
{
Console.WriteLine(item.MaterialName);
PrintProgress = $"[{printNum}/{i}] B{DateTime.Now.ToString("yyMMdd")}item.MaterialCode{i + 1}";
Console.WriteLine($"B{DateTime.Now.ToString("yyMMdd")}{item.MaterialCode}{i + 1}");
throw new Exception("条码生成异常");//抛出异常,回滚事务,事务退出
}
if (item.MaterialName.Contains("内胆"))
var num= await _printBarCodeServices.AddAsync(printBarCode);
if (num<=0)
{
Console.WriteLine(item.MaterialName);
PrintProgress = $"[{printNum}/{i}] L{DateTime.Now.ToString("yyMMdd")}{item.MaterialCode}0000{i + 1}";
Console.WriteLine($"L{DateTime.Now.ToString("yyMMdd")}{item.MaterialCode}0000{i + 1}");
ErrorNum++;
log.Error($"打印保存出错:{printBarCode.ToJson()}");
}
BarcodesPrinted.Enqueue(BarcodesUnprinted.Dequeue());
i++;
Progress = i;
Thread.Sleep(1000);
}
catch (Exception ex)
{
log.Error($"打印出错:{ex.Message}");
log.Error($"打印出错:{ex.Message}\n{printBarCode.ToJson()}");
ErrorNum++;
}
Progress = i;
i++;
}
//打印完成
SetCompletetd();
return Task.FromResult(true);
return await Task.FromResult(true);
}
catch (Exception ex)
{
log.Error($"打印出错:{ex.Message}");
return Task.FromResult(false);
return await Task.FromResult(false);
}
finally
{
@ -327,6 +356,38 @@ namespace Aucma.Core.PrintTo.ViewModels
}
}
#region 获取最大值
/// <summary>
/// 获取最大值
/// </summary>
/// <param name="MaterialCode"></param>
/// <returns></returns>
public async Task<string> GetMaxNumAsync(string MaterialCode,string falg)
{
try
{
List<int> tempList = new List<int>();
var list = await _printBarCodeServices.QueryAsync(d => d.MaterialBarcode.Contains(MaterialCode) && d.MaterialBarcode.Substring(0, 1).Equals(falg));
if (list.Count() == 0)
{
return "0001";
}
list.ForEach(item =>
{
int num = Convert.ToInt32(item.MaterialBarcode.Substring(item.MaterialBarcode.Length - 1, 4));
tempList.Add(num);
});
string maxStr = (tempList.Max() + 1).ToString();
string rowNum = maxStr.PadLeft(4, '0');
return rowNum;
}
catch
{
return "0001";
}
}
#endregion
#endregion
#region 暂停

@ -107,7 +107,6 @@ namespace Aucma.Core.PrintTo.ViewModels
#region 打印机
//对接打印机
Report barReport = new Report();
//barReport.Load(System.Environment.CurrentDirectory + @"\Report\MaterialBar.frx");//打印报表位置
barReport.Load(System.Environment.CurrentDirectory + @"\Report\MaterialBar.frx");
// 设置打印机和打印选项
@ -120,11 +119,6 @@ namespace Aucma.Core.PrintTo.ViewModels
barReport.SetParameterValue("BoxBarData.Order_Material_Name", item);//物料名称
barReport.SetParameterValue("BoxBarData.Bar_Code", item);//二维码
//barReport.SetParameterValue("BoxBarData.Id", item);
//barReport.SetParameterValue("BoxBarData.DeviceCode", item);
//barReport.SetParameterValue("BoxBarData.DeviceName", item);
//barReport.SetParameterValue("BoxBarData.CostCenter", item);
//barReport.Prepare();
//string BarPath = System.Environment.CurrentDirectory + @"\pdf\" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".pdf";
//barReport.Export(new PDFExport(), BarPath);
@ -132,7 +126,6 @@ namespace Aucma.Core.PrintTo.ViewModels
barReport.Print();
#endregion
PrintProgress = $"[{printNum}/{i}] {item}";
BarcodesPrinted.Enqueue(BarcodesUnprinted.Dequeue());
Thread.Sleep(1000);

@ -35,7 +35,7 @@ namespace Aucma.Core.PrintTo.ViewModels
_barCodeServices = App.ServiceProvider.GetService<IPrintBarCodeServices>();
_baseOrderInfoServices = App.ServiceProvider.GetService<IBaseOrderInfoServices>();
LoadData(productCode, material_code);
Task.WaitAll(LoadData(productCode, material_code));
}
#region 选中订单参数
@ -83,7 +83,7 @@ namespace Aucma.Core.PrintTo.ViewModels
var materialName = SelectedCells.MaterialName;
var barCode = SelectedCells.BarCode;
PrintToDevView printToDev = new PrintToDevView(productCode, materialCode, materialName, 1, barCode);
PrintToDevView printToDev = new PrintToDevView(productCode, materialCode, materialName, 1);
printToDev.ShowDialog();
}
#endregion

@ -1,112 +0,0 @@
<Window x:Class="Aucma.Core.PrintTo.Views.HomeWindowView"
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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:local="clr-namespace:Aucma.Core.PrintTo.Views"
mc:Ignorable="d"
Background="#F4F4F4"
d:DesignHeight="1200"
d:DesignWidth="800">
<Window.Resources>
<!--列头标题栏样式-->
<!--<Style TargetType="DataGridColumnHeader">
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="Background" Value="#dddddd"/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="BorderThickness" Value="1" />
<Setter Property="BorderBrush" Value="Gray" />
<Setter Property="Height" Value="50"/>
<Setter Property="FontSize" Value="14"/>
</Style>-->
<Style TargetType="DataGridColumnHeader">
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="Height" Value="30"/>
</Style>
<!--单元格样式-->
<Style TargetType="DataGridCell">
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="BorderBrush" Value="Gray" />
<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>
<!--<Style TargetType="TextBlock" x:Key="centerAlignmentStyle">
<Setter Property="Foreground" Value="Gray"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="TextWrapping" Value="Wrap"/>
</Style>-->
<!--背景色改变必须先设置cellStyle 因为cellStyle会覆盖rowStyle样式换行换色-->
<Style TargetType="DataGridRow">
<Setter Property="Height" Value="30"/>
<Style.Triggers>
<Trigger Property="AlternationIndex" Value="0">
<Setter Property="Background" Value="#e7e7e7" />
<!--ffe14d-->
</Trigger>
<Trigger Property="AlternationIndex" Value="1">
<Setter Property="Background" Value="#f2f2f2" />
<!--f1ef9f-->
</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>
<!--但由于DataGridTextColumn不能从FrameworkElement或FrameworkContentElement继承而无法使用-->
<!--<Style TargetType="DataGridTextColumn">
<Setter Property="ElementStyle">
<Setter.Value>
<Style TargetType="TextBlock">
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
</Setter.Value>
</Setter>
</Style>-->
<!--网格线颜色-->
<Style TargetType="DataGrid">
<!--该属性指示是否允许用户调整列宽度-->
<Setter Property="CanUserResizeColumns" Value="false" />
<Setter Property="Background" Value="#F4F4F4" />
<Setter Property="BorderBrush" Value="Gray" />
<Setter Property="SelectionUnit" Value="FullRow" />
<Setter Property="VerticalScrollBarVisibility" Value="Auto" />
<Setter Property="HorizontalScrollBarVisibility" Value="Auto" />
<Setter Property="RowHeaderWidth" Value="0" />
<Setter Property="HorizontalGridLinesBrush">
<Setter.Value>
<SolidColorBrush Color="#d6c79b" />
</Setter.Value>
</Setter>
<Setter Property="VerticalGridLinesBrush">
<Setter.Value>
<SolidColorBrush Color="#d6c79b" />
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<Grid >
</Grid>
</Window>

@ -176,16 +176,17 @@
ItemsSource="{Binding Datalist}" ColumnWidth="*" AutoGenerateColumns="False" IsReadOnly="True" CanUserAddRows="False" SelectionMode="Single"
SelectedItem="{Binding SelectedCells, Mode=OneWayToSource}">
<DataGrid.Columns>
<DataGridTextColumn Width="0.8*" Binding="{Binding CreatedTime, StringFormat=\{0:yyy-MM-dd\}}" Header="订单日期" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="0.8*" Binding="{Binding CreatedTime, StringFormat=\{0:yyy/MM/dd\}}" Header="订单日期" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="1*" Binding="{Binding OrderCode}" Header="订单编号" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="1*" Binding="{Binding ProductCode}" Header="产品编码" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="2*" Binding="{Binding ProductName}" Header="产品型号" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="*" Binding="{Binding CompleteAmount}" Header="内胆码" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="*" Binding="{Binding CompleteAmount}" Header="箱体码" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="2*" Binding="{Binding MaterialName}" Header="产品型号" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="*" Binding="{Binding LinerAmount}" Header="内胆码" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="*" Binding="{Binding BoxAmount}" Header="箱体码" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="*" Binding="{Binding PlanAmount}" Header="订单数量" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="50" Binding="{Binding ErrorNum}" Header="异常量" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn MinWidth="50" Binding="{Binding LinerCodeNum}" Header="内胆码&#x0a;已打数量" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn MinWidth="50" Binding="{Binding BoxCodeNum}" Header="U壳码&#x0a;已打数量" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn MinWidth="50" Binding="{Binding PrintLinerAmount}" Header="内胆码&#x0a;已打数量" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn MinWidth="50" Binding="{Binding PrintBoxAmount}" Header="U壳码&#x0a;已打数量" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="*" Binding="{Binding CompleteAmount}" Header="剩余" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
</DataGrid.Columns>
</DataGrid>
</UniformGrid>

@ -16,18 +16,9 @@ namespace Aucma.Core.PrintTo.Views
this.DataContext = new IndexPageViewModel();
}
/// <summary>
/// 点击按钮带出键盘
/// </summary>
/// <returns></returns>
private void ClickQuery()
{
CommHelper.OpenOsk();
}
private void queryParam_PreviewMouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
ClickQuery();
CommHelper.OpenOsk();
}
}
}

@ -32,19 +32,19 @@
</Grid.RowDefinitions>
<WrapPanel Grid.Row="0" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="产品编号" FontSize="15" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBox FontSize="15" Text="{Binding ProductCode}" Width="300" Foreground="White" BorderBrush="White" Margin="15 0 0 0" VerticalAlignment="Center" IsReadOnly="True"/>
<TextBlock Text="产品编号" FontSize="18" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBox FontSize="18" Text="{Binding ProductCode}" Width="300" Foreground="White" BorderBrush="White" Margin="15 0 0 0" VerticalAlignment="Center" IsReadOnly="True"/>
</WrapPanel>
<WrapPanel Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="产品型号" FontSize="15" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBox Text="{Binding MaterialName}" FontSize="15" Width="300" Foreground="White" BorderBrush="White"
<TextBlock Text="产品型号" FontSize="18" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBox Text="{Binding MaterialName}" FontSize="18" Width="300" Foreground="White" BorderBrush="White"
Margin="15 0 0 0"
HorizontalAlignment="Center" VerticalAlignment="Center" IsReadOnly="True"/>
</WrapPanel>
<WrapPanel Grid.Row="2" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="打印名称" FontSize="15" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBox Text="{Binding PrintName}" FontSize="15" Width="300" Foreground="White" BorderBrush="White" Margin="15 0 0 0"
HorizontalAlignment="Center" VerticalAlignment="Center" IsReadOnly="True"/>
<TextBlock Text="打印名称" FontSize="18" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBox Text="{Binding PrintName}" FontSize="18" Width="300" Foreground="White" BorderBrush="White" Margin="15 0 0 0"
HorizontalAlignment="Center" VerticalAlignment="Center" />
</WrapPanel>
</Grid>
</GroupBox>

@ -8,16 +8,21 @@ namespace Aucma.Core.PrintTo.Views
/// </summary>
public partial class PrintToDevView : Window
{
public PrintToDevView()
{
InitializeComponent();
this.DataContext = new PrintToDevViewModel();
}
public PrintToDevView(string productCode,string materialCode, string materialName, int printAmount, string? barCode=null)
#region 构造函数
/// <summary>
/// 构造函数
/// </summary>
/// <param name="productCode">产品编码</param>
/// <param name="materialCode">物料编码</param>
/// <param name="materialName">产品名称</param>
/// <param name="printAmount">打印数量</param>
/// <param name="barCode"></param>
public PrintToDevView(string productCode, string materialCode, string materialName, int printAmount)
{
InitializeComponent();
this.DataContext = new PrintToDevViewModel(productCode, materialCode, materialName, printAmount,barCode);
this.DataContext = new PrintToDevViewModel(productCode, materialCode, materialName, printAmount);
}
#endregion
}
}

@ -98,12 +98,13 @@
ItemsSource="{Binding Datalist}" ColumnWidth="*" AutoGenerateColumns="False" IsReadOnly="True" CanUserAddRows="False" SelectionMode="Single"
SelectedItem="{Binding SelectedCells, Mode=OneWayToSource}">
<DataGrid.Columns>
<DataGridTextColumn MinWidth="100" Binding="{Binding ProductCode}" Header="产品编号" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" />
<DataGridTextColumn MinWidth="100" Binding="{Binding MaterialCode}" Header="物料编号" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn MinWidth="200" Binding="{Binding MaterialName}" Header="物料名称" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn MinWidth="300" Binding="{Binding BarCode}" Header="物料条码" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn MinWidth="100" Binding="{Binding SuppleMetNum}" Header="补打个数" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn MinWidth="200" Binding="{Binding PrintTime ,StringFormat=\{0:yyyy-MM-dd HH:mm\}}" Header="打印时间" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="*" Binding="{Binding No}" Header="编号" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" />
<DataGridTextColumn Width="*" Binding="{Binding ProductCode}" Header="产品编号" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" />
<DataGridTextColumn Width="*" Binding="{Binding BarCode}" Header="物料条码" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="2*" Binding="{Binding MaterialCode}" Header="物料编码" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="2*" Binding="{Binding MaterialName}" Header="物料名称" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="100" Binding="{Binding SuppleMetNum}" Header="补打个数" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="200" Binding="{Binding PrintTime ,StringFormat=\{0:yyyy-MM-dd HH:mm\}}" Header="打印时间" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
</DataGrid.Columns>
</DataGrid>
</UniformGrid>

@ -5,7 +5,7 @@ using System.Timers;
namespace Aucma.Core.RunPlc
{
/// <summary>
/// 扫码器初始化
/// PLC任务
/// </summary>
public class RunPlcService : IRunPlcService
{

@ -33,7 +33,7 @@
<Page Update="Assets\Styles\DefaultStyles.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="Views\IndexPage.xaml">
<Page Update="Views\IndexPageView.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="Views\InventoryStatisticsPageView.xaml">

@ -30,5 +30,10 @@ namespace Aucma.Core.SheetMetal.Common
get { return iniHelper.IniReadValue("system", "searchItems"); }
set { iniHelper.IniWriteValue("system", "searchItems", value); }
}
public string queryExec
{
get { return iniHelper.IniReadValue("system", "ExecState"); }
set { iniHelper.IniWriteValue("system", "ExecState", value); }
}
}
}

@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Aucma.Core.SheetMetal.Common
{
public class CommHelper
{
#region 打开软盘
/// <summary>
/// 打开软盘
/// </summary>
public static void OpenOsk()
{
try
{
Process proc = new Process();
proc.StartInfo.FileName = @"C:\Windows\System32\osk.exe";
proc.StartInfo.UseShellExecute = true;
proc.StartInfo.Verb = "runas";
proc.Start();
}
catch
{
}
}
#endregion
}
}

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Aucma.Core.SheetMetal.Models
{
public class SelectModel
{
public int ID { get; set; }
/// <summary>
/// 类型
/// </summary>
public string TypeName { get; set; }
}
}

@ -57,5 +57,9 @@ namespace Aucma.Core.SheetMetal.Models
/// 计划任务执行编号
/// </summary>
public string TaskCode { get; set; }
/// <summary>
/// 执行状态1-待执行2-执行中3-完成
/// </summary>
public int ExecuteStatus { get; set; }
}
}

@ -11,7 +11,6 @@ using System.Threading.Tasks;
using Admin.Core.IService;
using Microsoft.Extensions.DependencyInjection;
using Aucma.Core.SheetMetal.Common;
using Admin.Core.Model.Model_New;
using Admin.Core.Tasks;
using CommunityToolkit.Mvvm.Messaging;
using LiveCharts;
@ -20,8 +19,7 @@ using Admin.Core.Model;
using System.Windows.Media;
using log4net;
using Admin.Core.Common;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
using System.Drawing.Drawing2D;
using LiveCharts.Defaults;
/*
*
*
@ -31,25 +29,38 @@ namespace Aucma.Core.SheetMetal.ViewModels
public partial class IndexPageViewModel : ObservableObject
{
protected readonly IExecutePlanInfoServices? _taskExecutionPlanInfoServices;
private AppConfigHelper appConfig = new AppConfigHelper();
List<SelectModel> list = new List<SelectModel>() { new SelectModel()
{
ID=1,
TypeName="手动"
},
new SelectModel()
{
ID=2,
TypeName="自动"
}};
public Func<double, string> Formatter { get; set; }
int k = 100;
#region 构造函数
public IndexPageViewModel()
{
_taskExecutionPlanInfoServices = App.ServiceProvider.GetService<IExecutePlanInfoServices>();
StationName = Appsettings.app("StoreInfo", "StationName");
Job_SheetMetalTask_Quartz.SmEverDayDelegateEvent += InitEveryDayMethod;
Job_SheetMetalTask_Quartz.SmShowDelegateEvent += UpdatePlanSHow;//计划内容展示
//Job_SheetMetalTask_Quartz.SmEverDayDelegateEvent += InitEveryDayMethod;
//Job_SheetMetalTask_Quartz.SmShowDelegateEvent += UpdatePlanSHow;//计划内容展示
WeakReferenceMessenger.Default.Register<string>(this, Recive);
Task.Run(async () =>
{
await LoadData();
await InitExecMethod();
});
Task.WaitAll(LoadData(), InitExecMethod());
InitEveryDayMethod();
foreach (var item in list)
{
LocationSource.Add(item);
}
SelectLocation = ReadFile();
}
#endregion
#region 订单统计
@ -68,51 +79,98 @@ namespace Aucma.Core.SheetMetal.ViewModels
#endregion
#region
#region 日产
/// <summary>
/// 每日生产
/// </summary>
/// <returns></returns>
private Task InitEveryDayMethod()
{
ChartValues<double> achievement = new ChartValues<double>();
Random random = new Random();
for (int i = 0; i < 5; i++)
{
achievement.Add(random.Next(60, 100));
}
#region 按时间统计
ChartValues<ObservablePoint> achievement = new ChartValues<ObservablePoint>
{
new ObservablePoint(0, 12),
new ObservablePoint(1, 14),
new ObservablePoint(2, 28),
new ObservablePoint(3, 62),
new ObservablePoint(4, 29),
new ObservablePoint(5, 29),
new ObservablePoint(6, 7),
new ObservablePoint(7, 31),
new ObservablePoint(8, 13),
new ObservablePoint(9, 11),
new ObservablePoint(10, 8),
new ObservablePoint(11, 5),
new ObservablePoint(12, 3),
new ObservablePoint(13, 11),
new ObservablePoint(14, 15),
new ObservablePoint(15, 6),
new ObservablePoint(16, 11),
new ObservablePoint(17, 9),
new ObservablePoint(18, 11),
new ObservablePoint(19, 1),
new ObservablePoint(20, 10),
new ObservablePoint(21, 22),
new ObservablePoint(22, 16),
new ObservablePoint(23, 12)
};
var column = new ColumnSeries();
column.DataLabels = true;
column.Title = "型号";
column.Title = "前板";
column.Values = achievement;
column.Foreground = Brushes.White;
ModelStatistics.Add(column);
//柱子宽度
//column.Width = 30;
//column.MaxColumnWidth = 30;
//column.LabelsPosition = BarLabelPosition.Perpendicular;
//column.Fill = new SolidColorBrush(Color.FromRgb(34, 139, 34)); //柱状图颜色填充
//column.LabelPoint = p => p.Y.ToString(); //柱状图数据显示位置
ProductionHourList = new List<string>()
{
"12",
"13",
"14",
"15",
"16",
"1:30", "2:30", "3:00", "4:00", "5:00", "6:00", "7:00", "8:00", "9:00", "10:00", "11:00", "12:00", "13:00", "14:00", "15:00", "16:00", "17:00", "18:00", "19:00", "20:00", "21:00", "22:00", "23:00", "24:00"
};
//Formatter = value => value.ToString("N");
Achievement.Add(column);
Achievement.Add(new ColumnSeries
{
DataLabels = true,
Title = "后板",
Values = achievement,
Foreground = Brushes.White
});
#endregion
#region 按类型统计
ChartValues<double> achievement2 = new ChartValues<double>();
Random random2 = new Random();
for (int i = 0; i < 5; i++)
for (int i = 0; i < 2; i++)
{
achievement2.Add(random2.Next(60, 100));
}
var column2 = new ColumnSeries();
column2.DataLabels = true;
column2.Title = "产量";
column2.Title = "前板";
column2.Values = achievement2;
column2.Foreground = Brushes.White;
ModelStatistics.Add(column2);
Achievement.Add(column2);
ModelStatistics.Add(new ColumnSeries()
{
DataLabels = true,
Title = "后板",
Values = achievement2,
Foreground = Brushes.White,
});
MaterialNameList = new List<string>()
{
"玻璃门,SC-439", "玻璃门,SC-439,AC"
};
#endregion
//await InitExecMethod();
return Task.CompletedTask;
}
@ -125,7 +183,8 @@ namespace Aucma.Core.SheetMetal.ViewModels
#region 加载DataGrid数据
private async Task LoadData()
{
var list= await _taskExecutionPlanInfoServices.QueryAsync(d=>d.ProductLineCode.Contains("1001"));
string productLineCode = Appsettings.app("StoreInfo", "ProductLineCode");
var list = await _taskExecutionPlanInfoServices.QueryAsync(d => d.ProductLineCode.Contains(productLineCode));
var execList = list.OrderBy(d => d.ExecuteOrder);
int i = 1;
string planType = string.Empty;
@ -140,7 +199,7 @@ namespace Aucma.Core.SheetMetal.ViewModels
task.TaskAmount = item.PlanAmount;
task.CompleteAmount = item.CompleteAmount;
task.BeginTime = item.BeginTime;
task.IsExec = item.ExecuteStatus;
task.IsExec = item.ExecuteStatus;//执行状态
if (item.PlanType == 1)
{
planType = "前后板联动";
@ -155,6 +214,7 @@ namespace Aucma.Core.SheetMetal.ViewModels
}
task.PlanType = planType;
task.TaskCode = item.TaskCode;
task.ExecuteStatus= item.ExecuteStatus;//执行状态
PlanInfoDataGrid.Add(task);
i++;
@ -444,17 +504,77 @@ namespace Aucma.Core.SheetMetal.ViewModels
#endregion
#endregion
#region 下拉框 选择执行状态
/// <summary>
/// 下拉框 选择执行状态
/// </summary>
private string materialTypeCombox;
public string MaterialTypeCombox
{
get { return materialTypeCombox; }
set
{
materialTypeCombox = value;
SetProperty(ref materialTypeCombox, value);
}
}
/// <summary>
/// 当ComboBox选中项更改时发生
/// </summary>
private SelectModel _selectLocation;
public SelectModel SelectLocation
{
get
{
return this._selectLocation;
}
set
{
this._selectLocation = value;
//这里操作更改变化的值
//MessageBox.Show(_selectLocation.ID);
if (_selectLocation != null)
{
WriteFile(_selectLocation.ID);
}
SetProperty(ref _selectLocation, value);
}
}
private ObservableCollection<SelectModel> _locationRoad = new ObservableCollection<SelectModel>();
/// <summary>
/// 集合数据
/// </summary>
public ObservableCollection<SelectModel> LocationSource
{
get
{
return this._locationRoad;
}
set
{
SetProperty(ref _locationRoad, value);
}
}
#endregion
#region 刷新列表-其他界面刷新该方法
/// <summary>
/// 刷新列表
/// </summary>
/// <param name="recipient"></param>
/// <param name="message"></param>
private async void Recive(object recipient, object message)
private async void Recive(object recipient, string message)
{
if (message== "Refresh")
{
PlanInfoDataGrid.Clear();
await LoadData();
}
}
#endregion
#region 刷新界面显示数据
@ -474,10 +594,24 @@ namespace Aucma.Core.SheetMetal.ViewModels
MesMOrderCode = info.ProductPlanCode;
ProductModel = info.MaterialName;
BeginTime = info.BeginTime.ToString();
}));
return Task.CompletedTask;
}
#endregion
#region 读写文件
public void WriteFile(int obj)
{
//写入到配置文件中
appConfig.queryExec = obj.ToString();
}
public SelectModel ReadFile()
{
//读取入到配置文件中
var queryExec = appConfig.queryExec;
var model = list.FirstOrDefault(d => d.ID == int.Parse(queryExec));
return model;
}
#endregion
}
}

@ -8,13 +8,14 @@ using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Windows.Interop;
using System.Collections.ObjectModel;
using Admin.Core.Common;
namespace Aucma.Core.SheetMetal.ViewModels
{
public partial class MainWindowViewModel : ObservableObject
{
private static readonly log4net.ILog log = LogManager.GetLogger(typeof(MainWindowViewModel));
private IndexPage firstPage = new IndexPage();//首页
private IndexPageView firstPage = new IndexPageView();//首页
private LogPageView logPage = new LogPageView();//日志
private StatisticsPageView statisticsPage = new StatisticsPageView();//统计

@ -1,6 +1,7 @@
using Aucma.Core.SheetMetal.Common;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using CommunityToolkit.Mvvm.Messaging;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
@ -16,7 +17,7 @@ namespace Aucma.Core.SheetMetal.ViewModels
private AppConfigHelper appConfig =new AppConfigHelper();
public SearchCriteriaViewModel()
{
Init();
}
#region 关闭当前页
@ -72,6 +73,7 @@ namespace Aucma.Core.SheetMetal.ViewModels
{
Configurations.Add(item);
}
WeakReferenceMessenger.Default.Send<string>("RefreshSearchItems");//刷新窗口
}
#endregion
}

@ -17,6 +17,7 @@ using CommunityToolkit.Mvvm.Messaging;
using Aucma.Core.SheetMetal.Views;
using Aucma.Core.SheetMetal.Common;
using System.Windows.Input;
using Admin.Core.Common;
namespace Aucma.Core.SheetMetal.ViewModels
{
@ -32,12 +33,10 @@ namespace Aucma.Core.SheetMetal.ViewModels
{
_productPlanInfoServices = App.ServiceProvider.GetService<IProductPlanInfoServices>();
_executePlanInfoServices = App.ServiceProvider.GetService<IExecutePlanInfoServices>();
Task.Run(async () =>{
await LoadData();
});
Task.WaitAll(LoadData());
//加载快捷方式
SaveSearchCriteria();
//WeakReferenceMessenger.Default.Register<string>;
WeakReferenceMessenger.Default.Register<string>(this, SaveSearchCriteria);
}
#region 加载DataGrid数据
@ -267,7 +266,9 @@ namespace Aucma.Core.SheetMetal.ViewModels
#region 查询快捷查询方式
private void SaveSearchCriteria()
private void SaveSearchCriteria(object recipient, string message)
{
if (message== "RefreshSearchItems")
{
Configurations = new ObservableCollection<string>();
var searchItems = appConfig.searchItems;
@ -282,6 +283,21 @@ namespace Aucma.Core.SheetMetal.ViewModels
}
}
}
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 双击事件
@ -315,7 +331,8 @@ namespace Aucma.Core.SheetMetal.ViewModels
[RelayCommand]
public async Task RadioButton(string selectedOption)
{
List<ProductPlanInfo> planInfos = await _productPlanInfoServices.QueryAsync(d => d.ProductLineCode.Equals(_search));
string productLineCode = Appsettings.app("StoreInfo", "ProductLineCode");
List<ProductPlanInfo> planInfos = await _productPlanInfoServices.QueryAsync(d => d.ProductLineCode.Equals(productLineCode) && d.MaterialName.Contains(selectedOption));
if (planInfos != null)
{
if (planInfos.Count > 0)
@ -323,7 +340,7 @@ namespace Aucma.Core.SheetMetal.ViewModels
MaterialDataGrid.Clear();
int i = 1;
var execList = await _executePlanInfoServices.QueryAsync(d => d.ProductLineCode.Equals(_search));
var execList = await _executePlanInfoServices.QueryAsync(d => d.ProductLineCode.Equals(productLineCode));
foreach (var item in planInfos)
{
int residue = 0;

@ -1,4 +1,4 @@
<UserControl x:Class="Aucma.Core.SheetMetal.Views.IndexPage"
<UserControl x:Class="Aucma.Core.SheetMetal.Views.IndexPageView"
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"
@ -19,7 +19,6 @@
<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"/>
@ -65,10 +64,12 @@
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#4285DE"/>
<!--<Setter Property="Foreground" Value="#dddddd"/>-->
<Setter Property="Foreground" Value="White"/>
</Trigger>
<DataTrigger Binding="{Binding ExecuteStatus}" Value="2">
<Setter Property="Background" Value="Green" />
</DataTrigger>
</Style.Triggers>
</Style>
</UserControl.Resources>
@ -167,7 +168,7 @@
<RowDefinition Height="7*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="0" Background="Transparent" Margin="1,1,0,0" >
<TextBlock Text="订单数量" FontSize="15" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="订单数量" FontSize="18" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Row="1" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="0" Background="Transparent" Margin="1,1,0,0" >
<lvc:Gauge Margin="5" Uses360Mode="True" From="0" To="{Binding PlanMaxNum,Mode=TwoWay}"
@ -184,7 +185,7 @@
<RowDefinition Height="7*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="0" Background="Transparent" Margin="1,1,0,0" >
<TextBlock Text="生产数量" FontSize="15" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="生产数量" FontSize="18" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Row="1" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="0" Background="Transparent" Margin="1,1,0,0" >
<lvc:Gauge GaugeBackground="Green" Margin="5" Uses360Mode="True" From="0" To="{Binding PlanMaxNum,Mode=TwoWay}"
@ -201,7 +202,7 @@
<RowDefinition Height="7*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderThickness="0" CornerRadius="0" Background="Transparent" Margin="1,1,0,0" >
<TextBlock Text="差异数量" FontSize="15" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="差异数量" FontSize="18" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Row="1" BorderThickness="0" CornerRadius="0" Background="Transparent" Margin="1,1,0,0" >
<lvc:Gauge GaugeBackground="Red" Margin="5" Uses360Mode="True" From="0" To="{Binding PlanMaxNum,Mode=TwoWay}"
@ -218,7 +219,7 @@
<RowDefinition Height="7*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderThickness="0" CornerRadius="0" Background="Transparent" Margin="1,1,0,0" >
<TextBlock Text="订单完成率" FontSize="15" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="订单完成率" FontSize="18" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Row="1" BorderThickness="0" CornerRadius="0" Background="Transparent" Margin="1,1,0,0" >
<lvc:Gauge GaugeBackground="Orange" Margin="5" Uses360Mode="True" From="0" To="100"
@ -250,17 +251,20 @@
<Border Grid.Row="1" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="5" Background="Transparent" Margin="1,1,5,5">
<Border Grid.Row="1" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="5" Background="Transparent" Margin="1,1,5,5">
<Grid Margin="10,10">
<lvc:CartesianChart Series="{Binding Achievement, UpdateSourceTrigger=PropertyChanged}" Foreground="Red" >
<lvc:CartesianChart Series="{Binding Achievement, UpdateSourceTrigger=PropertyChanged}" LegendLocation="Top" Foreground="White">
<lvc:CartesianChart.DataTooltip >
<lvc:DefaultTooltip SelectionMode="OnlySender" BulletSize="10" Foreground="Black"></lvc:DefaultTooltip>
</lvc:CartesianChart.DataTooltip>
<lvc:CartesianChart.AxisX>
<lvc:Axis Labels="{Binding ProductionHourList}" FontSize="15">
<lvc:Axis Labels="{Binding ProductionHourList}" FontSize="12" LabelsRotation="0" DisableAnimations="True" Position="LeftBottom" Foreground="White">
<lvc:Axis.Separator>
<lvc:Separator Visibility="Hidden" StrokeThickness="1.5" StrokeDashArray="0" Stroke="#404F56" >
<lvc:Separator Visibility="Hidden" Step="1" StrokeThickness="1.5" StrokeDashArray="0" Stroke="#404F56" >
</lvc:Separator>
</lvc:Axis.Separator>
</lvc:Axis>
</lvc:CartesianChart.AxisX>
<lvc:CartesianChart.AxisY>
<lvc:Axis FontSize="15">
<lvc:Axis FontSize="18" Foreground="White" >
<lvc:Axis.Separator>
<lvc:Separator Visibility="Hidden" StrokeThickness="1" StrokeDashArray="3" Stroke="#404F56" >
</lvc:Separator>
@ -284,7 +288,6 @@
<Border Grid.Row="0" BorderBrush="#0288d1" BorderThickness="0,0,0,1" CornerRadius="0" Background="#1157b9" Margin="1,1,5,5" >
<TextBlock Text="计划列表" FontSize="20" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<!--计划列表-->
<Border Grid.Row="1" Grid.Column="0" Background="Transparent" Margin="1,1,5,5">
<Grid>
@ -292,24 +295,21 @@
<RowDefinition Height="6*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<DataGrid Grid.Row="0" ItemsSource="{Binding PlanInfoDataGrid}" Background="#00000000"
ColumnHeaderHeight="35"
RowHeight="50" AutoGenerateColumns="False" RowHeaderWidth="0"
GridLinesVisibility="None" ScrollViewer.HorizontalScrollBarVisibility="Hidden"
ScrollViewer.VerticalScrollBarVisibility="Hidden" BorderThickness="0" CanUserAddRows="False"
SelectionMode="Single" IsReadOnly="True"
Foreground="White">
<DataGrid x:Name="dgvMH" ItemsSource="{Binding PlanInfoDataGrid}"
HorizontalAlignment="Center" VerticalAlignment="Top" AlternationCount="2" RowHeaderWidth="0"
ColumnWidth="*" AutoGenerateColumns="False" IsReadOnly="True"
CanUserAddRows="False" SelectionMode="Single" Foreground="White"
SelectedItem="{Binding SelectedCells, Mode=OneWayToSource}" FontSize="18">
<DataGrid.Columns >
<DataGridTextColumn Binding="{Binding ID}" Header="主键" Width="auto" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" Visibility="Hidden" />
<DataGridTextColumn Binding="{Binding No}" x:Name="No" Header="编号" Width="0.5*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" />
<DataGridTextColumn Binding="{Binding TaskCode}" Header="计划编号" Width="1.5*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" />
<DataGridTextColumn Binding="{Binding TaskCode}" Header="计划编号" Width="1.3*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" />
<DataGridTextColumn Binding="{Binding MaterialName}" Header="物料型号" Width="3*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" />
<DataGridTextColumn Binding="{Binding TaskAmount}" Header="计划" Width="0.6*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding CompleteAmount}" Header="完成" Width="0.6*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding PlanType}" Header="计划类型" Width="1*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding BeginTime ,StringFormat=\{0:MM-dd HH:mm\}}" Header="开始时间" Width="1.7*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding BeginTime ,StringFormat=\{0:MM-dd HH:mm\}}" Header="开始时间" Width="1.2*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding ExecuteStatus}" Header="执行状态" Visibility="Collapsed"/>
<DataGridTemplateColumn Header="操作" Width="3.5*" >
<DataGridTemplateColumn.CellTemplate>
@ -331,9 +331,15 @@
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,20,0">
<TextBlock Text="执行方式" VerticalAlignment="Center" Foreground="White" FontSize="18" Margin="20,0,0,0"/>
<ComboBox Text="{Binding MaterialTypeCombox}" Width="200" Height="30" Margin="10 0 0 0" Style="{x:Null}" Background="#1152AC" VerticalAlignment="Center" FontSize="15" BorderBrush="#1152AC">
<ComboBoxItem Content="手动" IsSelected="True"/>
<ComboBoxItem Content="自动" />
<ComboBox Width="200" Height="30" Margin="10 0 0 0"
ItemsSource="{Binding LocationSource,Mode=OneWay}"
Style="{x:Null}" Background="#1152AC" VerticalAlignment="Center" FontSize="15"
SelectedItem="{Binding SelectLocation,Mode=TwoWay}"
SelectedValuePath="SelectedModel"
DisplayMemberPath="TypeName"
SelectedValue="{Binding SelectLocation,Mode=TwoWay}">
<!--<ComboBoxItem Content="手动" IsSelected="True"/>
<ComboBoxItem Content="自动" />-->
</ComboBox>
<Button Content="计划维护" Command="{Binding SplitPlanCommand}" Margin="20,0,0,0" BorderThickness="1" />
<Button Content="物料库存" Command="{Binding InventoryStatisticsCommand}" Margin="20,0,0,0" BorderThickness="1" />
@ -358,23 +364,28 @@
<!--型号统计-->
<Border Grid.Row="1" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="5" Background="Transparent" Margin="1,1,5,5">
<Grid Margin="10,10">
<lvc:CartesianChart Series="{Binding ModelStatistics, UpdateSourceTrigger=PropertyChanged}">
<lvc:CartesianChart LegendLocation="Top" Series="{Binding ModelStatistics, UpdateSourceTrigger=PropertyChanged}" Foreground="White">
<lvc:CartesianChart.DataTooltip>
<lvc:DefaultTooltip BulletSize="10" Foreground="Black"></lvc:DefaultTooltip>
</lvc:CartesianChart.DataTooltip>
<lvc:CartesianChart.AxisX>
<lvc:Axis Labels="{Binding MaterialNameList}" FontSize="15">
<lvc:Axis Labels="{Binding MaterialNameList}" FontSize="12" Foreground="White">
<lvc:Axis.Separator>
<lvc:Separator Visibility="Hidden" StrokeThickness="1.5" StrokeDashArray="0" Stroke="#404F56" >
<lvc:Separator Step="1" Visibility="Hidden" StrokeThickness="1.5" StrokeDashArray="0" Stroke="#404F56" >
</lvc:Separator>
</lvc:Axis.Separator>
</lvc:Axis>
</lvc:CartesianChart.AxisX>
<lvc:CartesianChart.AxisY>
<lvc:Axis FontSize="15">
<lvc:Axis FontSize="18" Foreground="White">
<lvc:Axis.Separator>
<lvc:Separator Visibility="Hidden" StrokeThickness="1" StrokeDashArray="3" Stroke="#404F56" >
</lvc:Separator>
</lvc:Axis.Separator>
</lvc:Axis>
</lvc:CartesianChart.AxisY>
</lvc:CartesianChart>
</Grid>
</Border>

@ -18,11 +18,11 @@ using System.Windows.Shapes;
namespace Aucma.Core.SheetMetal.Views
{
/// <summary>
/// IndexPage.xaml 的交互逻辑
/// IndexPageView.xaml 的交互逻辑
/// </summary>
public partial class IndexPage : UserControl
public partial class IndexPageView : UserControl
{
public IndexPage()
public IndexPageView()
{
InitializeComponent();
this.DataContext = new IndexPageViewModel();

@ -8,7 +8,7 @@
Title="澳柯玛生产控制系统" Icon="/Assets/images/Icon.png"
d:DesignHeight="1080"
d:DesignWidth="1920" FontFamily="Microsoft YaHei"
MinHeight="1080" MinWidth="1800" WindowStyle="ToolWindow" WindowState="Maximized"
MinHeight="1080" MinWidth="1920" WindowStyle="ToolWindow" WindowState="Maximized"
WindowStartupLocation="CenterScreen" >
<Window.Background>
<ImageBrush ImageSource="/Assets/images/background.jpg" />

@ -62,7 +62,7 @@
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="下达数量" FontSize="18" Foreground="#FFFFFF" Margin="10,0,0,0" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBox x:Name="TransmitAmount" FontSize="18" Text="{Binding TransmitAmount}" Foreground="#FFFFFF" BorderBrush="White" Width="150" Height="40" IsReadOnly="True" Margin="5,0,10,0"/>
<TextBox x:Name="TransmitAmount" VerticalContentAlignment="Center" FontSize="18" Text="{Binding TransmitAmount}" Foreground="#FFFFFF" BorderBrush="White" Width="150" Height="40" IsReadOnly="True" Margin="5,0,10,0"/>
</StackPanel>
<Border Grid.Row="1" BorderBrush="Black" BorderThickness="0" Margin="10">

@ -152,7 +152,7 @@
<Border Grid.Row="1" Grid.Column="1" BorderBrush="#0288d1" BorderThickness="1" CornerRadius="5" Margin="5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="0.8*"/>
<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" >
@ -167,7 +167,7 @@
</Grid.RowDefinitions>
<WrapPanel Grid.Row="0" Margin="5" 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"/>
<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" />
<Button Content="重 置" Command="{Binding ResetCommand}" Margin="5 0" />
<Button Content="配 置" Command="{Binding SearchCriteriaSetCommand}" Margin="5 0" />
@ -176,12 +176,19 @@
<Border Grid.Row="1" BorderBrush="#0288d1" BorderThickness="1">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="0.25*"/>
<RowDefinition Height="0.25*"/>
<RowDefinition Height="0.8*"/>
<RowDefinition Height="0.4*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="#0288d1" BorderThickness="0 0 0 1">
<WrapPanel VerticalAlignment="Center" Margin="10 0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.15*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0" VerticalAlignment="Center" Margin="10 0 0 0">
<TextBlock Text="快捷查询" VerticalAlignment="Center" Foreground="#FFFFFF" FontSize="18" />
</StackPanel>
<WrapPanel Grid.Column="1" VerticalAlignment="Center" Margin="0 5">
<ItemsControl ItemsSource="{Binding Configurations}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
@ -195,11 +202,13 @@
Command="{Binding DataContext.RadioButtonCommand, RelativeSource={RelativeSource AncestorType=ItemsControl}}"
CommandParameter="{Binding}"
GroupName="MaterialTypeRadioButton"
Margin="20,10" FontSize="15" Foreground="#FFFFFF"/>
Margin="25,0" FontSize="12" Foreground="#FFFFFF"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</WrapPanel>
</Grid>
</Border>
<Border Grid.Row="1" BorderBrush="#0288d1" BorderThickness="0">
<WrapPanel Grid.Row="1" VerticalAlignment="Center" Margin="10 0">

@ -1,4 +1,5 @@
using Aucma.Core.SheetMetal.ViewModels;
using Aucma.Core.SheetMetal.Common;
using Aucma.Core.SheetMetal.ViewModels;
using CommunityToolkit.Mvvm.Messaging;
using System.Windows;
using System.Windows.Input;
@ -28,5 +29,10 @@ namespace Aucma.Core.SheetMetal.Views
{
planInfoEditViewModel.MouseClick(sender);
}
private void queryParam_PreviewMouseDoubleClick(object sender, MouseButtonEventArgs e)
{
CommHelper.OpenOsk();
}
}
}

@ -138,16 +138,7 @@
GridLinesVisibility="None" ScrollViewer.HorizontalScrollBarVisibility="Hidden"
ScrollViewer.VerticalScrollBarVisibility="Hidden" BorderThickness="0" CanUserAddRows="False" SelectionMode="Single" IsReadOnly="True"
Foreground="White" >
<!--根据设定值变色-->
<DataGrid.CellStyle>
<Style TargetType="DataGridCell">
<Style.Triggers>
<DataTrigger Binding="{Binding No}" Value="1">
<Setter Property="Background" Value="#4285DE" />
</DataTrigger>
</Style.Triggers>
</Style>
</DataGrid.CellStyle>
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding No}" Header="序号" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding ProductPlanCode}" Header="计划编号" Width="1*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>

@ -73,7 +73,7 @@
"TriggerType": 1,
"IntervalSecond": 1,
"CycleRunTimes": 1,
"IsStart": true,
"IsStart": false,
"JobParams": null,
"DelFlag": false,
"CreateBy": "admin",
@ -115,9 +115,10 @@
},
"StoreInfo": {
"StationName": "箱壳前后板生产",
"shellStoreCode": "1001",
"linerStoreCode": "1001",
"foamBeforeStoreCode": "1001"
"ShellStoreCode": "1001",
"LinerStoreCode": "1001",
"FoamBeforeStoreCode": "1001",
"ProductLineCode": "1001"
},
"PLCServer": [
{

@ -0,0 +1,66 @@
using Admin.Core.Common;
using Aucma.Core.PLc;
using log4net;
using System.Timers;
namespace Aucma.Core.Tasks
{
/// <summary>
/// 实时任务列表
/// </summary>
public class AucamTaskService : IAucamTaskService
{
//private static readonly log4net.ILog log = LogManager.GetLogger(typeof(AucamTaskService));
System.Timers.Timer timer1 = new System.Timers.Timer(1000);
System.Timers.Timer timer2 = new System.Timers.Timer(1000);
System.Timers.Timer timer3 = new System.Timers.Timer(1000);
public Task AucamTaskAsync()
{
timer1.Elapsed += new System.Timers.ElapsedEventHandler(Run1); //到达时间的时候执行事件;
timer1.AutoReset = true;//设置是执行一次false还是一直执行(true)
timer1.Enabled = true;//需要调用 timer.Start()或者timer.Enabled = true来启动它
timer1.Start();//timer.Start()的内部原理还是设置timer.Enabled = true;
timer2.Elapsed += new System.Timers.ElapsedEventHandler(Run2); //到达时间的时候执行事件;
timer2.AutoReset = true;//设置是执行一次false还是一直执行(true)
timer2.Enabled = true;//需要调用 timer.Start()或者timer.Enabled = true来启动它
timer2.Start();//timer.Start()的内部原理还是设置timer.Enabled = true;
timer3.Elapsed += new System.Timers.ElapsedEventHandler(Run3); //到达时间的时候执行事件;
timer3.AutoReset = true;//设置是执行一次false还是一直执行(true)
timer3.Enabled = true;//需要调用 timer.Start()或者timer.Enabled = true来启动它
timer3.Start();//timer.Start()的内部原理还是设置timer.Enabled = true;
return Task.CompletedTask;
}
/// <summary>
/// 钣金——前板
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Run1(object? sender, ElapsedEventArgs e)
{
Console.WriteLine("前板");
}
/// <summary>
/// 钣金——后板
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Run2(object? sender, ElapsedEventArgs e)
{
Console.WriteLine("后板");
}
/// <summary>
/// 钣金——实时任务列表
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Run3(object? sender, ElapsedEventArgs e)
{
Console.WriteLine("实时任务列表");
}
}
}

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

@ -0,0 +1,290 @@
using System;
using System.Linq;
using log4net;
using Admin.Core.IService;
using Admin.Core.Model;
using Admin.Core.Common;
/// <summary>
/// 泡前库入库任务逻辑处理
/// </summary>
namespace Aucma.Core.Tasks
{
public class Job_BoxFoamInStoreTaskTask
{
#region 事件
/// <summary>
/// 扫码信息刷新
/// </summary>
/// <param name="materialBarCode">条码</param>
/// <param name="materialCode">编码</param>
/// <param name="materialName">名称</param>
/// <param name="spaceName">货到名称</param>
public delegate Task RefreshDataGridDelegate();
public static event RefreshDataGridDelegate RefreshDataGridDelegateEvent;
/// <summary>
/// 扫码信息刷新
/// </summary>
/// <param name="materialBarCode">条码</param>
/// <param name="materialCode">编码</param>
/// <param name="materialName">名称</param>
/// <param name="spaceName">货到名称</param>
public delegate void RefreshScanMateriaCode(string materialBarCode, string materialCode, string materialName, string spaceName,string msg);
public static event RefreshScanMateriaCode RefreshScanMateriaCodeEvent;
/// <summary>
/// 初始化入库任务
/// </summary>
/// <param name="message"></param>
public delegate void RefreshInStoreTask(RealTaskInfo taskInfos);
public static event RefreshInStoreTask RefreshInStoreTaskEvent;
/// <summary>
/// 日志信息刷新
/// </summary>
/// <param name="message"></param>
public delegate void RefreshLogMessage(string message);
public static event RefreshLogMessage RefreshLogMessageEvent;
/// <summary>
/// 入库日志事件
/// </summary>
/// <param name="msg"></param>
public delegate void LogDelegate(string msg);
public static event LogDelegate LogDelegateEvent;
#endregion
private static readonly log4net.ILog logHelper = LogManager.GetLogger(typeof(Job_BoxFoamInStoreTaskTask));
private readonly IBaseSpaceInfoServices _baseSpaceInfoServices;
private readonly IRealTaskInfoServices _realTaskInfoService;
private readonly IProductPlanInfoServices _productPlanInfoServices;
private readonly IRecordInStoreServices _recordInstoreServices;
private readonly IBaseStoreInfoServices _baseStoreInfoServices;
private readonly IBaseSpaceDetailServices _baseSpaceDetailServices;
public Job_BoxFoamInStoreTaskTask(IBaseSpaceInfoServices baseSpaceInfoServices, IRealTaskInfoServices realTaskInfoService,
IProductPlanInfoServices productPlanInfoServices, IRecordInStoreServices recordInstoreServices,
IBaseStoreInfoServices baseStoreInfoServices, IBaseSpaceDetailServices IBaseSpaceDetailServices)
{
_realTaskInfoService=realTaskInfoService;
_baseSpaceInfoServices = baseSpaceInfoServices;
_productPlanInfoServices = productPlanInfoServices;
_recordInstoreServices = recordInstoreServices;
_baseStoreInfoServices = baseStoreInfoServices;
_baseSpaceDetailServices = IBaseSpaceDetailServices;
}
public async Task InStoreRun()
{
string storeCode = Appsettings.app("StoreInfo", "BeforeStoreCode");//泡前库code
await InStore(storeCode, "B20231082080029650001");
}
public async Task OuteRun()
{
string storeCode = Appsettings.app("StoreInfo", "BeforeStoreCode");//泡前库code
await MaterialEnterStore(storeCode);
}
#region 入库
/// <summary>
/// 入库
/// </summary>
/// <param name="storeCode">仓库编号</param>
/// <param name="materialCode">物料条码</param>
private async Task InStore(string storeCode, string materialBarCode)
{
try
{
if (string.IsNullOrEmpty(storeCode)) return;
if (string.IsNullOrEmpty(materialBarCode)) return;
logHelper.Info($"扫码成功,物料条码:{materialBarCode}");
var taskList = await _realTaskInfoService.QueryAsync(d => d.MaterialCode.Equals(materialBarCode) && d.StoreCode == storeCode);
if (taskList.Count() >0)
{
LogDelegateEvent?.Invoke($"物料条码[{materialBarCode}],任务创建失败,该物料入库任务已存在!");
return;
}
string materialType = SubString(materialBarCode);//截取中间物料条码
var spaceInfo =await _baseSpaceInfoServices.InStoreGetSpaceInfoByMaterialType(storeCode, materialType);
if (spaceInfo != null)
{
//logHelper.Info($"匹配货道:{spaceInfo.ToJson()}");
var list= await _productPlanInfoServices.QueryAsync(d => d.MaterialCode == materialType);
if (list.Count()==0) return;
var obj = list.FirstOrDefault();
var repeatList = await _recordInstoreServices.QueryAsync(d => d.BarCodeCode.Equals(materialBarCode));
if (repeatList.Count() > 0)
{
//logHelper.Error($"任务创建记录条码重复异常:{obj.ToJson()}");
LogDelegateEvent?.Invoke($"物料条码[{materialBarCode}],任务创建失败,该条码任务记录中已存在,请检查!");
return;
}
string message = $"物料[{obj.MaterialName}], 入{spaceInfo.SpaceName},入库中....";
RefreshScanMateriaCodeEvent?.Invoke(materialBarCode, obj.MaterialCode, obj.MaterialName, spaceInfo.SpaceName, message); //刷新界面扫码信息
CreateInStoreTask(spaceInfo, materialBarCode); //创建入库任务
}
else
{
//报警停线
}
}
catch (Exception ex)
{
logHelper.Error($"入库业务异常:{ex}");
}
}
#endregion
#region 创建入库任务
/// <summary>
/// 创建入库任务
/// </summary>
/// <param name="spaceInfo"></param>
private async void CreateInStoreTask(BaseSpaceInfo spaceInfo, string materialCode)
{
try
{
string storeCode = Appsettings.app("StoreInfo", "StoreCode");//泡前库code
//生成入库任务依次下发至PLC
RealTaskInfo realTaskInfo = new RealTaskInfo();
realTaskInfo.TaskType = 1;
realTaskInfo.TaskCode = System.Guid.NewGuid().ToString("N").Substring(0, 6);
realTaskInfo.SpaceName = spaceInfo.SpaceName;
realTaskInfo.StoreCode = spaceInfo.StoreCode;
realTaskInfo.SpaceCode = spaceInfo.SpaceCode;
realTaskInfo.MaterialType = spaceInfo.MaterialType;
realTaskInfo.MaterialCode = materialCode;
realTaskInfo.PlanAmount = 1;
realTaskInfo.TaskStatus = 1; //任务状态1 - 待执行2 - 执行中3 - 完成
realTaskInfo.CreateTime = DateTime.Now;
var taskList = await _realTaskInfoService.QueryAsync(d => d.MaterialCode.Equals(materialCode) && d.StoreCode == storeCode);
if (taskList.Count() > 0) return;
int result = await _realTaskInfoService.AddAsync(realTaskInfo);
if (result > 0)
{
logHelper.Info("入库任务创建成功");
RefreshInStoreTaskEvent?.Invoke(realTaskInfo);//刷新datagrid 列表
}
else
{
logHelper.Info("入库任务创建失败");
}
}
catch (Exception ex)
{
logHelper.Info($"入库任务创建异常:{ex.Message}");
}
}
#endregion
#region 截取物料编码
public string SubString(string barCode)
{
try
{
string materialCode = barCode.Substring(7, 10);
return materialCode;
}
catch (Exception ex)
{
logHelper.Info($"截取物料条码失败:{ex.Message}");
return string.Empty;
}
}
#endregion
#region PLC 任务处理表
/// <summary>
/// PLC 任务处理表
/// </summary>
/// <param name="storeCode">仓库编码</param>
/// <param name="materialBarCode">物料编码</param>
/// <returns></returns>
public async Task MaterialEnterStore(string storeCode, string materialBarCode = "B20231082080029650001")
{
//扫描入库信号,入库完成
try
{
var taskList = await _realTaskInfoService.QueryAsync(d => d.MaterialType.Equals(materialBarCode) && d.StoreCode == storeCode);
if (taskList.Count() == 0) return;
var obj = taskList.FirstOrDefault();
var mCode= materialBarCode.Substring(7, 10);//物料条码
//删除任务表、更新货道、添加入库明细、添加入库记录
var planInfoList = await _productPlanInfoServices.QueryAsync(d => d.MaterialCode.Equals(mCode));//计划
if (planInfoList.Count() == 0)
{
logHelper.Error($"物料计划信息为空!");
return;
}
var baseStoreInfolist = await _baseStoreInfoServices.QueryAsync(d => d.StoreCode.Equals(obj.StoreCode));//仓库
if (baseStoreInfolist.Count() == 0)
{
logHelper.Error($"仓库信息为空!");
return;
}
var baseSpacelist = await _baseSpaceInfoServices.QueryAsync(d => d.SpaceCode.Equals(obj.SpaceCode));
if (taskList.Count() == 0)
{
LogDelegateEvent?.Invoke($"物料[{materialBarCode}],入库记录条码重复异常!");
logHelper.Error($"货道信息为空!");
return;
}
var baseSpaceDetailList = await _baseSpaceDetailServices.QueryAsync(d => d.MaterialCode.Equals(obj.MaterialCode));//货到详情
if (baseSpaceDetailList.Count() != 0)
{
logHelper.Error($"货到信息存在重复物料!");
return;
}
var baseSpace = baseSpacelist.FirstOrDefault();
var planInfo = planInfoList.FirstOrDefault();
var baseStoreInfo = baseStoreInfolist.FirstOrDefault();
baseSpace.SpaceStock = baseSpace.SpaceStock + 1;
baseSpace.OnRouteAmount = 0;
//入库记录表
RecordInStore recordInstore = new RecordInStore();
recordInstore.StoreCode = storeCode;
recordInstore.StoreArea = baseStoreInfo.StoreArea;
recordInstore.SpaceCode = baseSpace.SpaceCode;
recordInstore.MaterialType = baseSpace.MaterialType;
recordInstore.MaterialCode = mCode;
recordInstore.InStoreTime = DateTime.Now;
recordInstore.BarCodeCode = materialBarCode;
recordInstore.MaterialName = planInfo.MaterialName;
recordInstore.EntryPattern = 0;
recordInstore.IsFlag = 0;
recordInstore.CreatedTime = DateTime.Now;
//入库详情表
BaseSpaceDetail baseDetail = new BaseSpaceDetail();
baseDetail.StoreCode= storeCode;
baseDetail.SpaceCode= baseSpace.SpaceCode;
baseDetail.MaterialCode = materialBarCode;
baseDetail.MaterialName = planInfo.MaterialName;
baseDetail.MaterialAmount = 1;
baseDetail.CreatedTime= DateTime.Now;
bool result = await _recordInstoreServices.SaveRecordToDb(recordInstore, obj, baseSpace, baseDetail);
if (result)
{
string message = $"物料[{planInfo.MaterialName}], 入{baseSpace.SpaceName},入库成功!";
RefreshScanMateriaCodeEvent?.Invoke(obj.MaterialCode, materialBarCode, planInfo.MaterialName, baseSpace.SpaceName, message); //刷新界面扫码信息
LogDelegateEvent?.Invoke($"物料[{planInfo.MaterialName}], 入库[{baseSpace.SpaceName}]成功!");
RefreshDataGridDelegateEvent?.Invoke();
}
else
{
LogDelegateEvent?.Invoke($"物料[{planInfo.MaterialName}], 入库[{baseSpace.SpaceName}]失败,任务回滚!");
logHelper.Error($"物料[{planInfo.MaterialName}], 入库[{baseSpace.SpaceName}]失败,任务回滚!");
}
}
catch (Exception ex)
{
logHelper.Error($"入库数据处理异常:{ex.Message}");
}
}
#endregion
}
}

@ -0,0 +1,128 @@
using Admin.Core.Common;
using Admin.Core.IService;
using Admin.Core.Model;
using Aucma.Core.PLc;
using log4net;
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
/// <summary>
/// 箱体出库任务
/// </summary>
namespace Aucma.Core.Tasks
{
public class Job_BoxFoamOutStoreTask
{
#region 初始化出库任务
/// <summary>
/// 初始化出库任务
/// </summary>
/// <param name="message"></param>
public delegate void RefreshOutStoreTask(RealTaskInfo taskInfos);
public event RefreshOutStoreTask RefreshOutStoreTaskEvent;
#endregion
private static readonly log4net.ILog log = LogManager.GetLogger(typeof(Job_BoxFoamOutStoreTask));
protected readonly IBaseOrderInfoServices _baseOrderInfoServices;
protected readonly IBaseSpaceInfoServices _baseSpaceInfoServices;
protected readonly IBaseBomInfoServices _baseBomInfoServices;
protected readonly IRealTaskInfoServices _realTaskInfoServices;
protected readonly IExecutePlanInfoServices _executePlanInfoServices;
public Job_BoxFoamOutStoreTask(IBaseOrderInfoServices baseOrderInfoServices, IBaseSpaceInfoServices baseSpaceInfoServices,
IRealTaskInfoServices realTaskInfoServices,IBaseBomInfoServices baseBomInfoServices, IExecutePlanInfoServices executePlanInfoServices)
{
_baseOrderInfoServices = baseOrderInfoServices;
_baseSpaceInfoServices = baseSpaceInfoServices;
_baseBomInfoServices = baseBomInfoServices;
_realTaskInfoServices = realTaskInfoServices;
_executePlanInfoServices = executePlanInfoServices;
}
public async Task Run()
{
var obj = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("泡前库Plc"));
if (obj.IsConnect)
{
var val = obj.plc.ReadBool("M100");//出发出库点位
if (val)
{
//获取发泡夹类型=》箱体类型
var planInfo = await _executePlanInfoServices.FirstAsync();
await PlanHandle(planInfo);
}
}
}
private async Task PlanHandle(ExecutePlanInfo planInfo)
{
string storeCode = Appsettings.app("StoreInfo", "BeforeStoreCode");//读取泡前库标识
if (planInfo != null)
{
var boxBomInfo = await _baseBomInfoServices.GetChildenBomInfoByMaterialCode(planInfo.MaterialCode, storeCode);
OutStore(storeCode, boxBomInfo, planInfo.ExecutePlanCode);
}
}
private async void OutStore(string storeCode, BaseBomInfo bomInfo, string planCode)
{
try
{
log.Info($"收到出库计划,物料码:{bomInfo.MaterialCode}");
//BaseSpaceInfo spaceInfo = await _baseSpaceInfoServices.OutStoreGetSpaceInfoByMaterialCode(storeCode, bomInfo.MaterialCode);
//if (spaceInfo != null)
//{
// log.Info($"匹配货道:{spaceInfo.SpaceName}");
// //RefreshScanMateriaCodeEvent?.Invoke(materiaclCode, materialType, spaceInfo.spaceName, storeCode); //刷新界面扫码信息
// CreateOutStoreTask(spaceInfo, bomInfo, planCode); //创建出库任务
//}
//else
//{
// //报警停线
//}
}
catch (Exception ex)
{
log.Info($"出库业务异常:{ex.Message}");
}
}
#region 创建出库任务
/// <summary>
/// 创建出库任务
/// </summary>
/// <param name="spaceInfo"></param>
private async void CreateOutStoreTask(BaseSpaceInfo spaceInfo, BaseBomInfo bomInfo, string planCode)
{
//生成出库任务依次下发至PLC
RealTaskInfo realTaskInfo = new RealTaskInfo();
realTaskInfo.PlanCode = planCode;
realTaskInfo.TaskType = 2;
realTaskInfo.TaskCode = System.Guid.NewGuid().ToString("N").Substring(0, 6);
realTaskInfo.StoreCode = spaceInfo.StoreCode;
realTaskInfo.SpaceCode = spaceInfo.SpaceCode;
realTaskInfo.SpaceName = spaceInfo.SpaceName;
realTaskInfo.MaterialType = bomInfo.MaterialName;
realTaskInfo.MaterialCode = bomInfo.MaterialCode;
realTaskInfo.PlanAmount = 1;
realTaskInfo.TaskStatus = 1;
realTaskInfo.CreateTime = DateTime.Now;
int result = await _realTaskInfoServices.AddAsync(realTaskInfo);
if (result > 0)
{
log.Info("出库任务创建成功");
RefreshOutStoreTaskEvent?.Invoke(realTaskInfo);
}
else
{
log.Error("出库任务创建失败");
}
}
#endregion
}
}

@ -0,0 +1,38 @@
using Admin.Core.IService;
using Aucma.Core.PLc;
using log4net;
/// <summary>
///门体发泡数据采集
/// </summary>
namespace Aucma.Core.Tasks
{
public class Job_DoorFoamTask
{
protected readonly IBaseOrderInfoServices _baseOrderInfoServices;
private static readonly log4net.ILog log = LogManager.GetLogger(typeof(Job_DoorFoamTask));
public Job_DoorFoamTask()
{
}
public async Task Execute()
{
await Run();
}
#region 门体发泡数据采集
public Task Run()
{
var obj = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("DoorPlc"));
if (obj.plc.IsConnected)
{
var endSignal = obj.plc.ReadInt16("DB4.DBW0");
}
return Task.FromResult(0);
}
#endregion
}
}

@ -0,0 +1,174 @@
using Admin.Core.IService;
using Admin.Core.Model;
using Aucma.Core.PLc;
using log4net;
/// <summary>
/// 灌注数据采集
/// </summary>
namespace Aucma.Core.Tasks
{
public class Job_PerfusionTask
{
private static readonly log4net.ILog log = LogManager.GetLogger(typeof(Job_PerfusionTask));
protected readonly IBaseOrderInfoServices _baseOrderInfoServices;
protected readonly IPerfusionDeviceStatusServices _perfusionDeviceStatusServices;
protected readonly IPerfusionAlarmServices _perfusionAlarmServices;
protected readonly IPerfusionRecordServices _perfusionRecordServices;
public Job_PerfusionTask(IPerfusionDeviceStatusServices perfusionDeviceStatusServices, IPerfusionAlarmServices perfusionAlarmServices,
IPerfusionRecordServices perfusionRecordServices)
{
_perfusionDeviceStatusServices = perfusionDeviceStatusServices;
_perfusionAlarmServices = perfusionAlarmServices;
_perfusionRecordServices = perfusionRecordServices;
}
public async Task Execute()
{
await SaveDbRun();
await DeviceStatusRun();
}
#region 检测设备状态
private async Task DeviceStatusRun()
{
var obj = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("PerfusionPlc"));
if (obj.plc.IsConnected)
{
var status = obj.plc.ReadInt32("DB55.46.0");//设备状态;1运行、2停机、3故障
//更新灌注设备状态
var deviceStatus = await _perfusionDeviceStatusServices.FirstAsync();
deviceStatus.PerfusionStatus = status;
await _perfusionDeviceStatusServices.UpdateAsync(deviceStatus);
}
else
{
log.Error("灌注PLC连接异常");
}
}
#endregion
#region 保存灌注数据
public async Task SaveDbRun()
{
string alarmName = string.Empty;
var obj = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("PerfusionPlc"));
if (obj.plc.IsConnected)
{
var endSignal = obj.plc.ReadInt16("DB55.44.0");//任务结束信号存盘
/*
* 8
* 4
* */
if (endSignal == 8)
{
try
{
var barCode = obj.plc.ReadString("DB55.20.0");//箱体条码
var perfusionRecord = await _perfusionRecordServices.FirstAsync(d=>d.PerfusionBoxCode.Equals(barCode));
if (perfusionRecord == null) return;
var refrigerantTypeLeft = obj.plc.ReadString("DB55.58.0");//冷媒类型——左侧冷媒型号
var refrigerantTypeRight = obj.plc.ReadString("DB55.68.0");//冷媒类型——右侧冷媒型号
var setVolume = obj.plc.ReadDouble("DB55.78.0");//设定灌注量
var actualVolume = obj.plc.ReadDouble("DB55.0.0");//实际灌注量
var pressureR = obj.plc.ReadDouble("DB55.8.0");//灌注压力——灌注压力_R
var pressureL = obj.plc.ReadDouble("DB55.50.0");//灌注压力——灌注压力_L
var duration = obj.plc.ReadInt16("DB55.12.0");//灌注时长
var system = obj.plc.ReadInt32("DB55.82.0");//0,右系统 1左系统
Perfusion_Record record = new Perfusion_Record();
record.PerfusionBoxCode = barCode;
record.PerfusionRefrigerantTypeLeft = refrigerantTypeLeft;
record.PerfusionRefrigerantTypeRight = refrigerantTypeRight;
record.PerfusionSetVolume = setVolume.ToString();
record.PerfusionActualVolume = actualVolume.ToString();
record.PerfusionR = pressureR.ToString();
record.PerfusionL = pressureL.ToString();
record.PerfusionDuration = duration.ToString();
record.PerfusionSystem = system.ToString();
var r = await _perfusionRecordServices.AddAsync(record);
if (r > 0)
{
//数据采集完成设为2
obj.plc.WriteInt32("DB55.44.0", 2);//应答字:1数据采集2存盘成功
}
else
{
log.Error($"存盘数据失败,箱体码[{barCode}]");
}
}
catch (Exception ex)
{
log.Error(ex.Message);
}
}
/*
*2:
*4
*8
*16
*32
*64
*128
*256
* */
if (endSignal == 4)
{
try
{
var barCode = obj.plc.ReadString("DB55.20.0");//箱体条码
var perfusionAlarm = await _perfusionAlarmServices.FirstAsync(d => d.PerfusionBoxcode.Equals(barCode));
if (perfusionAlarm != null) return;
var alarm = obj.plc.ReadInt32("DB55.48.0");
//保存到异常任务表中,通知返修检测
switch (alarm)
{
case 0:
alarmName = "充注枪真空不合格";
break;
case 4:
alarmName = "充注故障";
break;
case 8:
alarmName = "充注时真空度超限定";
break;
case 16:
alarmName = "回升检测不合格";
break;
case 32:
alarmName = "工件真空不合格";
break;
case 64:
alarmName = "平衡缸接近开关异常";
break;
case 128:
alarmName = "增压超时";
break;
case 256:
alarmName = "风压不足";
break;
default:
break;
}
Perfusion_Alarm alarm1 = new Perfusion_Alarm();
alarm1.PerfusionBoxcode = barCode;
alarm1.PerfusionStatus = alarm;
alarm1.PerfusionAlarm = alarmName;
alarm1.PerfusionCompleted = "1";//异常取消
await _perfusionAlarmServices.AddAsync(alarm1);
}
catch (Exception ex)
{
log.Error(ex.Message);
}
}
}
}
#endregion
}
}

@ -0,0 +1,81 @@
using Admin.Core.IService.ISys;
using Admin.Core.IService;
using System;
using System.Threading.Tasks;
using Admin.Core.IRepository;
using Admin.Core.Model.Model_New;
using System.Collections.Generic;
using Aucma.Core.PLc;
using System.Linq;
using Admin.Core.Model;
/// <summary>
/// 钣金计划
/// </summary>
namespace Aucma.Core.Tasks
{
public class Job_SheetMetalTask
{
#region 钣金任务
/// <summary>
/// 实时任务信息-每日产量
/// </summary>
public delegate Task SmEverDayDelegate();
public static event SmEverDayDelegate SmEverDayDelegateEvent;
/// <summary>
/// 实时任务信息-展示
/// </summary>
public delegate Task SmShowDelegate(ExecutePlanInfo info);
public static event SmShowDelegate SmShowDelegateEvent;
#endregion
private readonly ISmTaskExecutionServices _smTaskExecutionServices;
private readonly IExecutePlanInfoServices _taskExecutionServices;
public Job_SheetMetalTask(ISmTaskExecutionServices smTaskExecutionServices, IExecutePlanInfoServices taskExecutionServices)
{
_smTaskExecutionServices = smTaskExecutionServices;
_taskExecutionServices = taskExecutionServices;
}
public async Task Execute()
{
await ShowRun();
await CompleteRun();
}
#region 实施当日产量和型号统计
public Task Run()
{
SmEverDayDelegateEvent?.Invoke();
return Task.CompletedTask;
}
#endregion
#region 实时计划显示
public async Task ShowRun()
{
var model = await _taskExecutionServices.FirstAsync(d => d.ExecuteStatus == 2);
SmShowDelegateEvent?.Invoke(model);
}
#endregion
#region 任务完成
public Task CompleteRun()
{
var obj = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("后板Plc"));
var val = obj.plc.ReadInt32("M100");//任务结束信号存盘
if (val == 1)
{
//1、存储当日完成记录表、计算节拍信息
//2、更新界面计划执行、当日产量、型号统计、计划列表
//3、更新日志记录
//4、更新数据统计列表
}
return Task.CompletedTask;
}
#endregion
}
}

@ -0,0 +1,8 @@

namespace Aucma.Core.Tasks
{
public interface IAucamTaskService
{
Task AucamTaskAsync();
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save