change - 入库任务执行异常

master
wenjy 3 weeks ago
parent 953396af5b
commit 44fa4d57cb

@ -561,11 +561,11 @@ namespace AUCMA.STORE.Business
{ {
LogHelper.Pilerlog($"入库任务:{baseTaskQueue.pilerTaskCode};内容:{JsonChange.ModeToJson(baseTaskQueue)}"); LogHelper.Pilerlog($"入库任务:{baseTaskQueue.pilerTaskCode};内容:{JsonChange.ModeToJson(baseTaskQueue)}");
_ = baseTaskQueueBusiness.DeleteTaskQueue(baseTaskQueue);
Mapper.Initialize(cret => cret.CreateMap<BaseTaskQueue, PlcDirectiveDTO>()); Mapper.Initialize(cret => cret.CreateMap<BaseTaskQueue, PlcDirectiveDTO>());
PlcDirectiveDTO taskDTO = Mapper.Map<PlcDirectiveDTO>(baseTaskQueue); PlcDirectiveDTO taskDTO = Mapper.Map<PlcDirectiveDTO>(baseTaskQueue);
LogHelper.Pilerlog($"入库任务:{baseTaskQueue.pilerTaskCode};映射为PlcDirectiveDTO");
#region 将入库任务转换成字节发送 #region 将入库任务转换成字节发送
byte[] buffer = new byte[42]; byte[] buffer = new byte[42];
taskDTO.inStorePlatformCode = 0; taskDTO.inStorePlatformCode = 0;
@ -621,6 +621,11 @@ namespace AUCMA.STORE.Business
taskCode = taskDTO.pilerTaskCode.ToString(); taskCode = taskDTO.pilerTaskCode.ToString();
taskQueue = baseTaskQueue; taskQueue = baseTaskQueue;
TaskInfoRefreshEvent?.Invoke(Convert.ToInt32(baseTaskQueue.pilerTaskCode), TaskType.InStore, locationArea, $"{taskQueue.pilerUnloadRows} - {taskQueue.pilerUnloadLine} - {taskQueue.pilerUnloadTier}"); TaskInfoRefreshEvent?.Invoke(Convert.ToInt32(baseTaskQueue.pilerTaskCode), TaskType.InStore, locationArea, $"{taskQueue.pilerUnloadRows} - {taskQueue.pilerUnloadLine} - {taskQueue.pilerUnloadTier}");
bool res = baseTaskQueueBusiness.DeleteTaskQueue(baseTaskQueue).Result;
LogHelper.Pilerlog($"入库任务:{baseTaskQueue.pilerTaskCode};移除");
UpdateLocationStatus("A", locationArea, $"{taskQueue.pilerUnloadRows}-{taskQueue.pilerUnloadLine}-{taskQueue.pilerUnloadTier}", LocationStatus.Occupy); UpdateLocationStatus("A", locationArea, $"{taskQueue.pilerUnloadRows}-{taskQueue.pilerUnloadLine}-{taskQueue.pilerUnloadTier}", LocationStatus.Occupy);
return buffer; return buffer;
} }
@ -633,6 +638,7 @@ namespace AUCMA.STORE.Business
catch (Exception ex) catch (Exception ex)
{ {
LogHelper.Pilerlog($"获取入库任务逻辑处理异常:{ex.Message}"); LogHelper.Pilerlog($"获取入库任务逻辑处理异常:{ex.Message}");
LogHelper.Error($"获取入库任务逻辑处理异常:{ex.Message}",ex);
return null; return null;
} }
} }

@ -1132,29 +1132,45 @@ namespace AUCMA.STORE
} }
public virtual void ReFresh_TaskInfo_dgv(TaskDTO inStoreTask,int state) public virtual void ReFresh_TaskInfo_dgv(TaskDTO inStoreTask,int state)
{ {
if (dataGridView1.Rows.Count > 0) try
{ {
for (int i = 0; i < dataGridView1.Rows.Count; i++) LogHelper.Pilerlog($"任务:{inStoreTask.taskCode};修改界面展示");
if(dataGridView1 != null)
{ {
if (dataGridView1.Rows[i].Cells[0].FormattedValue.ToString() == inStoreTask.taskCode) if (dataGridView1.Rows.Count > 0)
{ {
for (int i = 0; i < dataGridView1.Rows.Count; i++)
if(inStoreTask.locationArea == LocationArea.Location_Left)
{ {
dataGridView1.Rows[i].Cells[3].Value = "1#库"; if (dataGridView1.Rows[i].Cells[0].FormattedValue.ToString() == inStoreTask.taskCode)
} {
else
{ if (inStoreTask.locationArea == LocationArea.Location_Left)
dataGridView1.Rows[i].Cells[3].Value = "2#库"; {
} dataGridView1.Rows[i].Cells[3].Value = "1#库";
}
else
{
dataGridView1.Rows[i].Cells[3].Value = "2#库";
}
dataGridView1.Rows[i].Cells[4].Value = inStoreTask.locationCode; dataGridView1.Rows[i].Cells[4].Value = inStoreTask.locationCode;
dataGridView1.Rows[i].Cells[5].Value = "执行中"; dataGridView1.Rows[i].Cells[5].Value = "执行中";
dataGridView1.Rows[i].Cells[6].Value = inStoreTask.recordTime.ToString("HH:mm:ss"); dataGridView1.Rows[i].Cells[6].Value = inStoreTask.recordTime.ToString("HH:mm:ss");
}
}
} }
} }
else
{
LogHelper.Pilerlog($"任务:{inStoreTask.taskCode};修改界面展示失败任务列表为null");
}
}catch(Exception ex)
{
LogHelper.Error($"ReFresh_TaskInfo_dgv异常:{ex.Message}", ex);
} }
} }

Loading…
Cancel
Save