|
|
|
|
@ -2689,6 +2689,9 @@ namespace Khd.Core.Wpf.Form
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
private void CallTrayBtn_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
using var scope = _host.Services.CreateScope();
|
|
|
|
|
using var dbContext = scope.ServiceProvider.GetRequiredService<DefaultDbContext>();
|
|
|
|
|
using var transaction = dbContext.Database.BeginTransaction();
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
BaseEquip ctuEquip = SystemData.BaseEquip.First(t => t.objid == 11);
|
|
|
|
|
@ -2698,9 +2701,6 @@ namespace Khd.Core.Wpf.Form
|
|
|
|
|
HandyControl.Controls.MessageBox.Show("请选择料箱!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
using var scope = _host.Services.CreateScope();
|
|
|
|
|
using var dbContext = scope.ServiceProvider.GetRequiredService<DefaultDbContext>();
|
|
|
|
|
//int taskCount = dbContext.WcsTask.Where(t => t.nextPointId == 11).Count();
|
|
|
|
|
//if (taskCount + ids.Count > 6)
|
|
|
|
|
//{
|
|
|
|
|
@ -2777,8 +2777,6 @@ namespace Khd.Core.Wpf.Form
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in emptyLocations)
|
|
|
|
|
{
|
|
|
|
|
item.locationStatus = "6";
|
|
|
|
|
item.ContainerStatus = "2";
|
|
|
|
|
addList.Add(new WcsTaskManual()
|
|
|
|
|
{
|
|
|
|
|
objid = Global.SnowId.NextId(),
|
|
|
|
|
@ -2800,7 +2798,8 @@ namespace Khd.Core.Wpf.Form
|
|
|
|
|
fromFloorNo = 5,
|
|
|
|
|
useFlag = 1
|
|
|
|
|
});
|
|
|
|
|
dbContext.Update(item);
|
|
|
|
|
dbContext.WmsBaseLocation.Where(t => t.locationId == item.locationId)
|
|
|
|
|
.Update(t => new WmsBaseLocation { locationStatus = "6", ContainerStatus = "2" });
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -2808,8 +2807,6 @@ namespace Khd.Core.Wpf.Form
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < EmptyCountForm.EmptyTaskCount; i++)
|
|
|
|
|
{
|
|
|
|
|
emptyLocations[i].locationStatus = "6";
|
|
|
|
|
emptyLocations[i].ContainerStatus = "2";
|
|
|
|
|
addList.Add(new WcsTaskManual()
|
|
|
|
|
{
|
|
|
|
|
objid = Global.SnowId.NextId(),
|
|
|
|
|
@ -2831,7 +2828,8 @@ namespace Khd.Core.Wpf.Form
|
|
|
|
|
fromFloorNo = 5,
|
|
|
|
|
useFlag = 1
|
|
|
|
|
});
|
|
|
|
|
dbContext.Update(emptyLocations[i]);
|
|
|
|
|
dbContext.WmsBaseLocation.Where(t => t.locationId == emptyLocations[i].locationId)
|
|
|
|
|
.Update(t => new WmsBaseLocation { locationStatus = "6", ContainerStatus = "2" });
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -2839,6 +2837,7 @@ namespace Khd.Core.Wpf.Form
|
|
|
|
|
}
|
|
|
|
|
dbContext.AddRange(addList);
|
|
|
|
|
dbContext.SaveChanges();
|
|
|
|
|
transaction.Commit();
|
|
|
|
|
HandyControl.Controls.MessageBox.Show("创建出库任务成功!");
|
|
|
|
|
itemsControlItems.Clear();
|
|
|
|
|
CallSelectedItem.Clear();
|
|
|
|
|
@ -2847,7 +2846,14 @@ namespace Khd.Core.Wpf.Form
|
|
|
|
|
}
|
|
|
|
|
catch
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
transaction.Rollback();
|
|
|
|
|
}
|
|
|
|
|
catch
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|