From 886c7f746cca7b3fbbb463d86ed5fe0a172c7fbe Mon Sep 17 00:00:00 2001 From: liuwf Date: Sat, 12 Oct 2024 16:52:22 +0800 Subject: [PATCH] =?UTF-8?q?add-=E6=B7=BB=E5=8A=A0=E6=8A=95=E6=96=99?= =?UTF-8?q?=E4=BA=A7=E5=87=BA=E7=BB=9F=E8=AE=A1=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/WmsRawOutstockDetail .cs | 156 ++++++++++++++++++ .../Converter/MultiBindingConverter.cs | 42 +++++ SlnMesnac.WPF/Model/StatisticModel.cs | 20 +++ SlnMesnac.WPF/Page/DevMonitorPage.xaml.cs | 1 - SlnMesnac.WPF/Page/ProdStatisticsPage.xaml | 150 ++++++++++++----- .../ViewModel/ProdStatisticsViewModel.cs | 128 +++++++++++--- 6 files changed, 435 insertions(+), 62 deletions(-) create mode 100644 SlnMesnac.Model/domain/WmsRawOutstockDetail .cs create mode 100644 SlnMesnac.WPF/Converter/MultiBindingConverter.cs create mode 100644 SlnMesnac.WPF/Model/StatisticModel.cs diff --git a/SlnMesnac.Model/domain/WmsRawOutstockDetail .cs b/SlnMesnac.Model/domain/WmsRawOutstockDetail .cs new file mode 100644 index 0000000..b72d696 --- /dev/null +++ b/SlnMesnac.Model/domain/WmsRawOutstockDetail .cs @@ -0,0 +1,156 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Security.Principal; +using System.Text; + +namespace SlnMesnac.Model.domain +{ + [SugarTable("wms_raw_outstock_detail"), TenantAttribute("mes")] + public class WmsRawOutstockDetail + { + /// + /// 原材料出库记录明细ID + /// + [SugarColumn(ColumnName = "raw_outstock_detail_id", IsPrimaryKey = true, IsIdentity = true)] + public long RawOutstockDetailId { get; set; } + + /// + /// 原材料出库ID + /// + [SugarColumn(ColumnName = "raw_outstock_id")] + public long RawOutstockId { get; set; } + + /// + /// 原材料出库任务编号 + /// + [SugarColumn(ColumnName = "task_code")] + public string TaskCode { get; set; } + + /// + /// 仓库ID,关联仓库主键 + /// + [SugarColumn(ColumnName = "warehouse_id")] + public long? WarehouseId { get; set; } + + /// + /// 库位编码 + /// + [SugarColumn(ColumnName = "location_code")] + public string LocationCode { get; set; } + + /// + /// 物料条码;最终出库时保存 + /// + [SugarColumn(ColumnName = "material_barcode")] + public string MaterialBarcode { get; set; } + + /// + /// 物料ID + /// + [SugarColumn(ColumnName = "material_id")] + public long MaterialId { get; set; } + + /// + /// 批次;扫描条码时,从打印条码记录表中获取 + /// + [SugarColumn(ColumnName = "instock_batch")] + public string InstockBatch { get; set; } + + /// + /// 生产日期;扫描条码时,从打印条码记录表中获取 + /// + [SugarColumn(ColumnName = "material_production_date")] + public DateTime? MaterialProductionDate { get; set; } + + /// + /// 计划数量 + /// + [SugarColumn(ColumnName = "plan_amount")] + public decimal PlanAmount { get; set; } + + /// + /// 出库数量 + /// + [SugarColumn(ColumnName = "outstock_amount")] + public decimal? OutstockAmount { get; set; } + + /// + /// 执行状态(0待执行,1执行中,2执行完成) + /// + [SugarColumn(ColumnName = "execute_status")] + public string ExecuteStatus { get; set; } + + /// + /// 同步ERP状态(0:失败,1成功);此字段不用 + /// + [SugarColumn(ColumnName = "erp_status")] + public string ErpStatus { get; set; } + + /// + /// 同步给ERP的数量;此字段不用 + /// + [SugarColumn(ColumnName = "erp_amount")] + public decimal? ErpAmount { get; set; } + + /// + /// 出库人 + /// + [SugarColumn(ColumnName = "outstock_person")] + public string OutstockPerson { get; set; } + + /// + /// 出库时间 + /// + [SugarColumn(ColumnName = "outstock_time")] + public DateTime? OutstockTime { get; set; } + + /// + /// 出库方式(1:人工出库 2:AGV出库 ) + /// + [SugarColumn(ColumnName = "outstock_way")] + public string OutstockWay { get; set; } + + /// + /// 使用机台名称;出库扫描条码时,从打印条码记录表中获取 + /// + [SugarColumn(ColumnName = "machine_name")] + public string MachineName { get; set; } + + /// + /// 质检状态(0:待质检,1:合格,2:NG) + /// + [SugarColumn(ColumnName = "quality_status")] + public string QualityStatus { get; set; } + + /// + /// 创建人 + /// + [SugarColumn(ColumnName = "create_by")] + public string CreateBy { get; set; } + + /// + /// 创建时间 + /// + [SugarColumn(ColumnName = "create_date")] + public DateTime? CreateDate { get; set; } + + /// + /// 最后更新人 + /// + [SugarColumn(ColumnName = "update_by")] + public string UpdateBy { get; set; } + + /// + /// 最后更新时间 + /// + [SugarColumn(ColumnName = "update_date")] + public DateTime? UpdateDate { get; set; } + + /// + /// 每托数量 + /// + [SugarColumn(ColumnName = "stack_amount")] + public decimal? StackAmount { get; set; } + } +} diff --git a/SlnMesnac.WPF/Converter/MultiBindingConverter.cs b/SlnMesnac.WPF/Converter/MultiBindingConverter.cs new file mode 100644 index 0000000..b347877 --- /dev/null +++ b/SlnMesnac.WPF/Converter/MultiBindingConverter.cs @@ -0,0 +1,42 @@ + +using SlnMesnac.WPF.Model; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; + +namespace SlnMesnac.WPF.ConvertTo +{ + public class MultiBindingConverter : IMultiValueConverter + { + /// + /// 对象转换 + /// + /// 所绑定的源的值 + /// 目标的类型 + /// 绑定时所传递的参数 + /// <系统语言等信息 + /// + public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture) + { + if (values != null && values.Count() ==2) + { + StatisticModel bsm = new StatisticModel(); + + bsm.BeginTime = values[0].ToString(); + bsm.EndTime = values[1].ToString(); + + return bsm; + } + return null; + } + + public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture) + { + throw new NotImplementedException(); + } + } + +} diff --git a/SlnMesnac.WPF/Model/StatisticModel.cs b/SlnMesnac.WPF/Model/StatisticModel.cs new file mode 100644 index 0000000..20f11d2 --- /dev/null +++ b/SlnMesnac.WPF/Model/StatisticModel.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SlnMesnac.WPF.Model +{ + public class StatisticModel + { + /// + /// 开始时间 + /// + public string? BeginTime { get; set; } + /// + /// 结束时间 + /// + public string? EndTime { get; set; } + } +} diff --git a/SlnMesnac.WPF/Page/DevMonitorPage.xaml.cs b/SlnMesnac.WPF/Page/DevMonitorPage.xaml.cs index c3dca42..187e2bc 100644 --- a/SlnMesnac.WPF/Page/DevMonitorPage.xaml.cs +++ b/SlnMesnac.WPF/Page/DevMonitorPage.xaml.cs @@ -2010,7 +2010,6 @@ namespace SlnMesnac.WPF.Page MagNetStatus3.Fill = MagNet_MesUse_Flag ? Brushes.Green : Brushes.Red; MagNetStatus4.Fill = signal3 ? Brushes.Red : Brushes.Green; })); - MachineStatusDto machineStatusDto = new MachineStatusDto(); machineStatusDto.deviceId = 1017; machineStatusDto.status = MagNet_Shake_Status && MagNet_Status; diff --git a/SlnMesnac.WPF/Page/ProdStatisticsPage.xaml b/SlnMesnac.WPF/Page/ProdStatisticsPage.xaml index f0ec50b..5493fd7 100644 --- a/SlnMesnac.WPF/Page/ProdStatisticsPage.xaml +++ b/SlnMesnac.WPF/Page/ProdStatisticsPage.xaml @@ -2,22 +2,109 @@ 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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:SlnMesnac.WPF.Page" + xmlns:cvt="clr-namespace:SlnMesnac.WPF.ConvertTo" mc:Ignorable="d" d:DesignHeight="750" d:DesignWidth="1920" Background="Transparent"> + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -30,35 +117,25 @@ - + ScrollViewer.VerticalScrollBarVisibility="Visible" BorderThickness="0" CanUserAddRows="False" HorizontalAlignment="Center" + Foreground="White" > - - - - - - - - -