diff --git a/AUCMA.STORE.Analysis/TaskHandleBusiness.cs b/AUCMA.STORE.Analysis/TaskHandleBusiness.cs index 94100cb..2d42585 100644 --- a/AUCMA.STORE.Analysis/TaskHandleBusiness.cs +++ b/AUCMA.STORE.Analysis/TaskHandleBusiness.cs @@ -561,11 +561,11 @@ namespace AUCMA.STORE.Business { LogHelper.Pilerlog($"入库任务:{baseTaskQueue.pilerTaskCode};内容:{JsonChange.ModeToJson(baseTaskQueue)}"); - _ = baseTaskQueueBusiness.DeleteTaskQueue(baseTaskQueue); - Mapper.Initialize(cret => cret.CreateMap()); PlcDirectiveDTO taskDTO = Mapper.Map(baseTaskQueue); - + + LogHelper.Pilerlog($"入库任务:{baseTaskQueue.pilerTaskCode};映射为PlcDirectiveDTO"); + #region 将入库任务转换成字节发送 byte[] buffer = new byte[42]; taskDTO.inStorePlatformCode = 0; @@ -621,6 +621,11 @@ namespace AUCMA.STORE.Business taskCode = taskDTO.pilerTaskCode.ToString(); taskQueue = baseTaskQueue; 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); return buffer; } @@ -633,6 +638,7 @@ namespace AUCMA.STORE.Business catch (Exception ex) { LogHelper.Pilerlog($"获取入库任务逻辑处理异常:{ex.Message}"); + LogHelper.Error($"获取入库任务逻辑处理异常:{ex.Message}",ex); return null; } } diff --git a/AUCMA.STORE/InStoreForm.cs b/AUCMA.STORE/InStoreForm.cs index ff23700..db1cb4e 100644 --- a/AUCMA.STORE/InStoreForm.cs +++ b/AUCMA.STORE/InStoreForm.cs @@ -1132,29 +1132,45 @@ namespace AUCMA.STORE } 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) { - - if(inStoreTask.locationArea == LocationArea.Location_Left) + for (int i = 0; i < dataGridView1.Rows.Count; i++) { - dataGridView1.Rows[i].Cells[3].Value = "1#库"; - } - else - { - dataGridView1.Rows[i].Cells[3].Value = "2#库"; - } + if (dataGridView1.Rows[i].Cells[0].FormattedValue.ToString() == inStoreTask.taskCode) + { + + if (inStoreTask.locationArea == LocationArea.Location_Left) + { + 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); } }