|
|
|
@ -496,7 +496,7 @@ namespace Aucma.Core.OldBoxFoam.ViewModels
|
|
|
|
|
{
|
|
|
|
|
if (string.IsNullOrEmpty(spaceCodes))
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show("请至少选择一个型号!");
|
|
|
|
|
MessageBox.Show("未关联到货道信息不进行型号设置!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// 查询货道信息
|
|
|
|
@ -517,46 +517,52 @@ namespace Aucma.Core.OldBoxFoam.ViewModels
|
|
|
|
|
[RelayCommand]
|
|
|
|
|
private async void AddPlanInfo()
|
|
|
|
|
{
|
|
|
|
|
if (string.IsNullOrEmpty(TransmitAmount))
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show("请输入下达的计划数量,不允许为空!!!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var productPlanInfo = _planInfo;
|
|
|
|
|
if (_planInfo != null)
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
BoxFoamPlan plan = new BoxFoamPlan();
|
|
|
|
|
plan.MaterialCode = _planInfo.MaterialCode;
|
|
|
|
|
plan.MaterialName = _planInfo.MaterialName;
|
|
|
|
|
plan.PlanAmount = Convert.ToInt32(TransmitAmount);
|
|
|
|
|
plan.ProductLineCode = "CX_01";
|
|
|
|
|
plan.StationCode = "1105";
|
|
|
|
|
plan.UpdateTime = DateTime.Now;
|
|
|
|
|
plan.CreateTime = DateTime.Now;
|
|
|
|
|
plan.OrderCode = _planInfo.OrderCode;
|
|
|
|
|
plan.PlanCode = _planInfo.PlanCode;
|
|
|
|
|
plan.ShiftType = 1;
|
|
|
|
|
var result = _boxFoamPlanServices.AddAsync(plan).Result;
|
|
|
|
|
if (result >= 0)
|
|
|
|
|
if (string.IsNullOrEmpty(TransmitAmount))
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show("计划添加成功!", "系统提醒");
|
|
|
|
|
WeakReferenceMessenger.Default.Send<string>("RefreshTask");//刷新任务界面
|
|
|
|
|
if (!string.IsNullOrEmpty(spaceCodes))
|
|
|
|
|
{
|
|
|
|
|
// 查询货道信息
|
|
|
|
|
List<OldBoxFoamType> spaceList = await _oldBoxFoamTypeServices.QueryAsync();
|
|
|
|
|
OldBoxFoamType space = spaceList.Where(x => x.ObjId == int.Parse(spaceCodes)).FirstOrDefault();
|
|
|
|
|
space.MaterialCode = PlanInfo.MaterialCode;
|
|
|
|
|
space.MaterialName = PlanInfo.MaterialName;
|
|
|
|
|
await _oldBoxFoamTypeServices.UpdateAsync(space);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MessageBox.Show("请输入下达的计划数量,不允许为空!!!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
var productPlanInfo = _planInfo;
|
|
|
|
|
if (_planInfo != null)
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show("任务添加失败!", "系统提醒");
|
|
|
|
|
}
|
|
|
|
|
BoxFoamPlan plan = new BoxFoamPlan();
|
|
|
|
|
plan.MaterialCode = _planInfo.MaterialCode;
|
|
|
|
|
plan.MaterialName = _planInfo.MaterialName;
|
|
|
|
|
plan.PlanAmount = Convert.ToInt32(TransmitAmount);
|
|
|
|
|
plan.ProductLineCode = "CX_01";
|
|
|
|
|
plan.StationCode = "1105";
|
|
|
|
|
plan.UpdateTime = DateTime.Now;
|
|
|
|
|
plan.CreateTime = DateTime.Now;
|
|
|
|
|
plan.OrderCode = _planInfo.OrderCode;
|
|
|
|
|
plan.PlanCode = _planInfo.PlanCode;
|
|
|
|
|
plan.ShiftType = 1;
|
|
|
|
|
var result = _boxFoamPlanServices.AddAsync(plan).Result;
|
|
|
|
|
if (result >= 0)
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show("计划添加成功!", "系统提醒");
|
|
|
|
|
WeakReferenceMessenger.Default.Send<string>("RefreshTask");//刷新任务界面
|
|
|
|
|
if (!string.IsNullOrEmpty(spaceCodes))
|
|
|
|
|
{
|
|
|
|
|
// 查询货道信息
|
|
|
|
|
List<OldBoxFoamType> spaceList = await _oldBoxFoamTypeServices.QueryAsync();
|
|
|
|
|
OldBoxFoamType space = spaceList.Where(x => x.ObjId == int.Parse(spaceCodes)).FirstOrDefault();
|
|
|
|
|
space.MaterialCode = PlanInfo.MaterialCode;
|
|
|
|
|
space.MaterialName = PlanInfo.MaterialName;
|
|
|
|
|
await _oldBoxFoamTypeServices.UpdateAsync(space);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show("任务添加失败!", "系统提醒");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}catch(Exception ex)
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show($"生产计划创建异常:{ex.Message}", "系统异常");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|