From 993b409e7dbafd13f5c6fe416c4cfcd6e6a297f5 Mon Sep 17 00:00:00 2001 From: wenjy Date: Tue, 9 Jan 2024 10:11:28 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E6=96=B0=E5=8F=91=E6=B3=A1?= =?UTF-8?q?=E7=BA=BF=E8=AE=A1=E5=88=92=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewModels/FoamPlanPageViewModel.cs | 2 +- .../ViewModels/QuantityIssuedViewModel.cs | 50 +++++++++++++------ .../ViewModels/SplitPlanViewModel.cs | 4 +- .../Views/QuantityIssuedView.xaml | 2 +- Aucma.Core.BoxFoam/Views/SplitPlanView.xaml | 2 +- Aucma.Core.BoxFoam/appsettings.json | 2 +- 6 files changed, 40 insertions(+), 22 deletions(-) diff --git a/Aucma.Core.BoxFoam/ViewModels/FoamPlanPageViewModel.cs b/Aucma.Core.BoxFoam/ViewModels/FoamPlanPageViewModel.cs index 773aba1a..1918fb09 100644 --- a/Aucma.Core.BoxFoam/ViewModels/FoamPlanPageViewModel.cs +++ b/Aucma.Core.BoxFoam/ViewModels/FoamPlanPageViewModel.cs @@ -31,7 +31,7 @@ namespace Aucma.Core.BoxFoam.ViewModels public async void InitData() { - var task =await _boxFoamPlanServices.QueryAsync(x=>x.ProductLineCode == "XC_002" && x.StationCode == "1005" && x.ShiftType == 1); + var task =await _boxFoamPlanServices.QueryAsync(x=>x.ProductLineCode == "CX_02" && x.StationCode == "1005" && x.ShiftType == 1); if (task == null) return; task.OrderBy(d=>d.ObjId); foreach (var item in task) diff --git a/Aucma.Core.BoxFoam/ViewModels/QuantityIssuedViewModel.cs b/Aucma.Core.BoxFoam/ViewModels/QuantityIssuedViewModel.cs index 9e020eb9..c45a57c1 100644 --- a/Aucma.Core.BoxFoam/ViewModels/QuantityIssuedViewModel.cs +++ b/Aucma.Core.BoxFoam/ViewModels/QuantityIssuedViewModel.cs @@ -7,6 +7,7 @@ using CommunityToolkit.Mvvm.Messaging; using log4net; using Microsoft.Extensions.DependencyInjection; using System; +using System.Numerics; using System.Threading.Tasks; using System.Windows; @@ -96,7 +97,7 @@ namespace Aucma.Core.BoxFoam.ViewModels /// 保存数据 /// [RelayCommand] - private void AddPlanInfo() + private async void AddPlanInfo() { var productPlanInfo = _planInfo; if (_planInfo != null) @@ -106,33 +107,44 @@ namespace Aucma.Core.BoxFoam.ViewModels { task.MaterialCode = _planInfo.MaterialCode; task.MaterialName = _planInfo.MaterialName; + task.OrderCode = _planInfo.OrderCode; task.PlanAmount = Convert.ToInt32(TransmitAmount); + task.ProductLineCode = "CX_02"; + task.StationCode = "1005"; + task.UpdateTime = DateTime.Now; + task.ShiftType = 1; var result = _boxFoamPlanServices.UpdateAsync(task).Result; if (result) { - MessageBox.Show("任务添加成功!", "系统提醒"); + MessageBox.Show("任务修改成功!", "系统提醒"); WeakReferenceMessenger.Default.Send("RefreshTask");//刷新任务界面 } else { - MessageBox.Show("任务添加失败!", "系统提醒"); + MessageBox.Show("任务修改失败!", "系统提醒"); } } else { - //task.MaterialCode = _planInfo.MaterialCode; - //task.MaterialName = _planInfo.MaterialName; - //task.PlanAmount = Convert.ToInt32(TransmitAmount); - //var plan = _boxFoamPlanServices.AddAsync(task).Result; - //if (plan) - //{ - // MessageBox.Show("任务添加成功!", "系统提醒"); - // WeakReferenceMessenger.Default.Send("RefreshTask");//刷新任务界面 - //} - //else - //{ - // MessageBox.Show("任务添加失败!", "系统提醒"); - //} + task = new BoxFoamPlan(); + task.MaterialCode = _planInfo.MaterialCode; + task.MaterialName = _planInfo.MaterialName; + task.OrderCode = _planInfo.OrderCode; + task.PlanAmount = Convert.ToInt32(TransmitAmount); + task.ProductLineCode = "CX_02"; + task.StationCode = "1005"; + task.CreateTime = DateTime.Now; + task.ShiftType = 1; + int plan = await _boxFoamPlanServices.AddAsync(task); + if (plan > 0 ) + { + MessageBox.Show("任务添加成功!", "系统提醒"); + WeakReferenceMessenger.Default.Send("RefreshTask");//刷新任务界面 + } + else + { + MessageBox.Show("任务添加失败!", "系统提醒"); + } } } else @@ -140,7 +152,13 @@ namespace Aucma.Core.BoxFoam.ViewModels BoxFoamPlan plan = new BoxFoamPlan(); plan.MaterialCode = _planInfo.MaterialCode; plan.MaterialName = _planInfo.MaterialName; + plan.OrderCode = _planInfo.OrderCode; plan.PlanAmount = Convert.ToInt32(TransmitAmount); + + plan.ProductLineCode = "CX_02"; + plan.StationCode = "1005"; + plan.CreateTime = DateTime.Now; + plan.ShiftType = 1; var result = _boxFoamPlanServices.AddAsync(plan).Result; if (result > 0) { diff --git a/Aucma.Core.BoxFoam/ViewModels/SplitPlanViewModel.cs b/Aucma.Core.BoxFoam/ViewModels/SplitPlanViewModel.cs index 6be3e6da..4d309957 100644 --- a/Aucma.Core.BoxFoam/ViewModels/SplitPlanViewModel.cs +++ b/Aucma.Core.BoxFoam/ViewModels/SplitPlanViewModel.cs @@ -45,8 +45,8 @@ namespace Aucma.Core.BoxFoam.ViewModels MaterialDataGrid.Clear(); int i = 1; string station = Appsettings.app("StoreInfo", "BeforeStoreCode"); - var planlist = await _productPlanInfoServices.QueryAsync(d => d.ProductLineCode.Equals(station)); - var execList = await _executePlanInfoServices.QueryAsync(d => d.ProductLineCode.Equals(station)); + var planlist = await _productPlanInfoServices.QueryAsync(d => d.ProductLineCode == "1005"); + var execList = await _executePlanInfoServices.QueryAsync(d => d.ProductLineCode == "1005"); foreach (var item in planlist) { int residue = 0; diff --git a/Aucma.Core.BoxFoam/Views/QuantityIssuedView.xaml b/Aucma.Core.BoxFoam/Views/QuantityIssuedView.xaml index 5a6ecd52..98ea16d1 100644 --- a/Aucma.Core.BoxFoam/Views/QuantityIssuedView.xaml +++ b/Aucma.Core.BoxFoam/Views/QuantityIssuedView.xaml @@ -6,7 +6,7 @@ xmlns:local="clr-namespace:Aucma.Core.BoxFoam.Views" mc:Ignorable="d" Background="#1152AC" FontFamily="Microsoft YaHei" Title="下达数量" Height="500" Width="700" Name="window" - ResizeMode="NoResize" Topmost="True"> + ResizeMode="NoResize" Topmost="False"> diff --git a/Aucma.Core.BoxFoam/Views/SplitPlanView.xaml b/Aucma.Core.BoxFoam/Views/SplitPlanView.xaml index b31dcfad..8a8b4ab8 100644 --- a/Aucma.Core.BoxFoam/Views/SplitPlanView.xaml +++ b/Aucma.Core.BoxFoam/Views/SplitPlanView.xaml @@ -8,7 +8,7 @@ Background="#1152AC" Title="计划维护" FontFamily="Microsoft YaHei" Height="700" Width="900" d:DesignHeight="800" WindowStartupLocation="CenterScreen" - d:DesignWidth="1500" ResizeMode="NoResize" Topmost="True" > + d:DesignWidth="1500" ResizeMode="NoResize" Topmost="False" >