change - 新发泡线计划添加

dev
wenjy 1 year ago
parent f8f71c0bfe
commit 993b409e7d

@ -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)

@ -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
/// 保存数据
/// </summary>
[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<string>("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<string>("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<string>("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)
{

@ -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;

@ -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">
<Border Margin="5" BorderBrush="#0288d1" CornerRadius="10">
<Border.Effect>

@ -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" >
<Window.Resources>
<Style x:Key="DataGridTextColumnCenterSytle" TargetType="{x:Type TextBlock}">

@ -228,7 +228,7 @@
"Enabled": true,
//"IP": "10.10.93.180",
"IP": "127.0.0.1",
"Port": 102
"Port": 105
}
],
"StoreInfo": {

Loading…
Cancel
Save