change - 出入库列表刷新

collectionStore
wenjy 1 year ago
parent f083b5d314
commit 47699ccaaf

Binary file not shown.

@ -77,6 +77,7 @@ namespace Aucma.Scada.Business
/// <param name="message"></param>
public delegate void RefreshLogMessage(string message);
public event RefreshLogMessage RefreshLogMessageEvent;
#endregion
private InStoreBusiness()
@ -89,8 +90,8 @@ namespace Aucma.Scada.Business
grabImage.RefreshLogMessageEvent += PrintLogInfoMessage;
StartPassDown();
InStore(appConfig.shellStoreCode, "B236000007811019001");
InStore(appConfig.linerStoreCode, "L236000007881019001");
//InStore(appConfig.shellStoreCode, "B236000007811019001");
//InStore(appConfig.linerStoreCode, "L236000007881019001");
}
/// <summary>
@ -213,6 +214,8 @@ namespace Aucma.Scada.Business
_taskInfoService.UpdateTaskInfo(taskInfo);
RefreshInStoreTaskEvent?.Invoke(taskInfo);
//if (shellSemaphore.Wait(TimeSpan.FromSeconds(20)))
//{
// // 收到反馈
@ -226,6 +229,8 @@ namespace Aucma.Scada.Business
shellSemaphore.Wait(); //一直堵塞直到信号量释放
PrintLogInfoMessage($"箱壳入库任务:{taskInfo.taskCode};执行完成");
RefreshInStoreTaskEvent?.Invoke(taskInfo);
}
else
{
@ -259,6 +264,8 @@ namespace Aucma.Scada.Business
_taskInfoService.UpdateTaskInfo(taskInfo);
RefreshInStoreTaskEvent?.Invoke(taskInfo);
//if (shellSemaphore.Wait(TimeSpan.FromSeconds(20)))
//{
// // 收到反馈
@ -272,6 +279,8 @@ namespace Aucma.Scada.Business
linerSemaphore.Wait(); //一直堵塞直到信号量释放
PrintLogInfoMessage($"内胆入库任务:{taskInfo.taskCode};执行完成");
RefreshInStoreTaskEvent?.Invoke(taskInfo);
}
else
{

@ -281,6 +281,7 @@ namespace Aucma.Scada.Business
{
while (true)
{
Thread.Sleep(10000);
PassDownTaskInfo();
Thread.Sleep(1000);
}
@ -342,13 +343,13 @@ namespace Aucma.Scada.Business
linerCode = item.materialCode;
}
_taskInfoService.UpdateTaskInfo(item);
RefreshScanMateriaCodeEvent?.Invoke(item.materialCode, item.materialType, item.spaceName, item.storeCode);
}
if (iFlag == taskInfoList.Count)
{
_taskInfoService.UpdateRangeTaskInfo(taskInfoList);
//if (semaphore.Wait(TimeSpan.FromSeconds(20)))
//{
@ -485,9 +486,6 @@ namespace Aucma.Scada.Business
var taskInfo = _taskInfoService.GetTaskInfoByTaskCode(taskCode, storeCode);
if (taskInfo != null)
{
//刷新界面
RefreshScanMateriaCodeEvent?.Invoke(string.Empty, string.Empty, string.Empty, taskInfo.storeCode);
var spaceInfo = _spaceInfoService.GetSpaceInfoBySpaceCode(taskInfo.storeCode, taskInfo.spaceCode);
if (spaceInfo != null)
@ -504,6 +502,9 @@ namespace Aucma.Scada.Business
}
//清除任务信息
_taskInfoService.DeleteTaskInfo(taskCode, storeCode);
//刷新界面
RefreshScanMateriaCodeEvent?.Invoke(string.Empty, string.Empty, string.Empty, taskInfo.storeCode);
}
}

@ -222,11 +222,33 @@ namespace Aucma.Scada.UI.viewModel.InStoreInfo
/// </summary>
public void Query()
{
#region 通过数据库获取数据进行刷新
var info = inStoreBusiness.GetInStoreTask();
if (info != null)
{
info.ForEach(x => RefreshInStoreTask(x));
taskItems = new ObservableCollection<RealTaskInfo>();
//info.ForEach(x => RefreshInStoreTask(x));
try
{
foreach (var item in info)
{
App.Current.Dispatcher.Invoke((Action)(() =>
{
taskItems.Add(item);
InstoreTask = taskItems;
}));
}
}
catch (Exception ex)
{
logHelper.Error("入库任务列表刷新异常", ex);
}
}
#endregion
if (materialTypeCombox == "箱壳")
{
materialTypeCombox = "X-001";
@ -300,18 +322,19 @@ namespace Aucma.Scada.UI.viewModel.InStoreInfo
/// <param name="taskInfo"></param>
private void RefreshInStoreTask(RealTaskInfo taskInfo)
{
try
{
App.Current.Dispatcher.Invoke((Action)(() =>
{
taskItems.Add(taskInfo);
InstoreTask = taskItems;
}));
}
catch (Exception ex)
{
logHelper.Error("入库任务列表刷新异常", ex);
}
//try
//{
// App.Current.Dispatcher.Invoke((Action)(() =>
// {
// taskItems.Add(taskInfo);
// InstoreTask = taskItems;
// }));
//}
//catch (Exception ex)
//{
// logHelper.Error("入库任务列表刷新异常", ex);
//}
Query();
}
/// <summary>

Loading…
Cancel
Save