|
|
|
|
@ -54,6 +54,12 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
string startCode = StartComboBox.SelectedItem?.ToString();
|
|
|
|
|
string endCode = EndComboBox.SelectedItem?.ToString();
|
|
|
|
|
|
|
|
|
|
if(SqlSugarClient == null)
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show("SqlSugarClient为空!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(startCode) || string.IsNullOrEmpty(endCode))
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show("请选择起点和终点!");
|
|
|
|
|
@ -74,41 +80,45 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
endCode = "3066";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
WmsBaseLocation? startLocation = SqlSugarClient.Queryable<WmsBaseLocation>().Where(it => it.LocationCode == startCode).First();
|
|
|
|
|
WmsBaseLocation? endLocation = SqlSugarClient.Queryable<WmsBaseLocation>().Where(it => it.LocationCode == endCode).First();
|
|
|
|
|
WmsBaseLocation? startLocation = SqlSugarClient.Queryable<WmsBaseLocation>().Where(it => it.AgvPositionCode == startCode).First();
|
|
|
|
|
WmsBaseLocation? endLocation = SqlSugarClient.Queryable<WmsBaseLocation>().Where(it => it.AgvPositionCode == endCode).First();
|
|
|
|
|
|
|
|
|
|
if (startLocation.LocationStatus != 0)
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show("起点库位不可用,状态被锁定!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (endLocation.LocationStatus != 0)
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show("终点库位不可用,状态被锁定!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(startLocation.ContainerCode))
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show("起点库位无托盘,请检查库存!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(endLocation.ContainerCode))
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show($"终点库位已有托盘:{endLocation.ContainerCode},禁止移库,请检查库存!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
WcsTask task = new WcsTask();
|
|
|
|
|
task.TaskType = StaticTaskType.MoveLocationTask;
|
|
|
|
|
task.CurrPointNo = startLocation.AgvPositionCode;
|
|
|
|
|
task.EndPointNo = endLocation.AgvPositionCode;
|
|
|
|
|
task.TaskStatus = 0;
|
|
|
|
|
task.CreatedTime = DateTime.Now;
|
|
|
|
|
task.CreatedBy = "wcs";
|
|
|
|
|
task.TaskName = "1-12机台移库任务";
|
|
|
|
|
task.PalletInfoCode = startLocation.ContainerCode;
|
|
|
|
|
SqlSugarClient.AsTenant().BeginTran();
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
WcsTask task = new WcsTask();
|
|
|
|
|
task.TaskType = StaticTaskType.MoveLocationTask;
|
|
|
|
|
task.CurrPointNo = startLocation.AgvPositionCode;
|
|
|
|
|
task.EndPointNo = endLocation.AgvPositionCode;
|
|
|
|
|
task.TaskStatus = 0;
|
|
|
|
|
task.CreatedTime = DateTime.Now;
|
|
|
|
|
task.CreatedBy = "wcs";
|
|
|
|
|
task.TaskName = "1-12机台移库任务";
|
|
|
|
|
task.PalletInfoCode = startLocation.ContainerCode;
|
|
|
|
|
SqlSugarClient.AsTenant().BeginTran();
|
|
|
|
|
int id = SqlSugarClient.Insertable(task).ExecuteReturnIdentity();
|
|
|
|
|
WcsTaskLog wcsTaskLog = CoreMapper.Map<WcsTaskLog>(task);
|
|
|
|
|
wcsTaskLog.Id = id;
|
|
|
|
|
|