change - 入库刷新优化

collectionStore
wenjy 11 months ago
parent 6444579446
commit 64e2d2dfb2

Binary file not shown.

@ -98,8 +98,8 @@ namespace Aucma.Scada.Business
// Thread.Sleep(6000); // Thread.Sleep(6000);
// for (int i = 1; i < 7; i++) // for (int i = 1; i < 7; i++)
// { // {
// //InStore(appConfig.shellStoreCode, "B23600000781101902" + i); // //InStore(appConfig.shellStoreCode, "B23600000781102300" + i);
// InStore(appConfig.linerStoreCode, "L23600000788101902" + i); // InStore(appConfig.linerStoreCode, "L23600000788102300" + i);
// } // }
//}); //});
@ -350,6 +350,7 @@ namespace Aucma.Scada.Business
InStoreFinish(taskCode, appConfig.shellStoreCode); InStoreFinish(taskCode, appConfig.shellStoreCode);
shellSemaphore.Release(); shellSemaphore.Release();
} }
/// <summary> /// <summary>
@ -358,8 +359,11 @@ namespace Aucma.Scada.Business
private void LinerTaskFeedback(string taskCode) private void LinerTaskFeedback(string taskCode)
{ {
PrintLogInfoMessage("内胆执行完成,自动释放信号量"); PrintLogInfoMessage("内胆执行完成,自动释放信号量");
InStoreFinish(taskCode, appConfig.linerStoreCode); InStoreFinish(taskCode, appConfig.linerStoreCode);
linerSemaphore.Release(); linerSemaphore.Release();
} }
#endregion #endregion
@ -380,9 +384,11 @@ namespace Aucma.Scada.Business
if (spaceInfo != null) if (spaceInfo != null)
{ {
//读取PLC获取货道信息存放数量、在途数量 //读取PLC获取货道信息存放数量、在途数量,
//实际应用改为读取PLC库存信息
spaceInfo.materialType = taskInfo.materialType; spaceInfo.materialType = taskInfo.materialType;
spaceInfo.spaceStock = spaceInfo.spaceStock + 1; spaceInfo.spaceStock = spaceInfo.spaceStock + 1;
spaceInfo.onRouteAmount -= 1;
_spaceInfoService.UpdateSpaceInfo(spaceInfo); _spaceInfoService.UpdateSpaceInfo(spaceInfo);
#region 添加货道明细 #region 添加货道明细

@ -283,11 +283,11 @@ namespace Aucma.Scada.UI.viewModel.AssemblyPlan
/// </summary> /// </summary>
public void Init() public void Init()
{ {
App.Current.Dispatcher.Invoke((Action)(() => var planInfos = assemblyPlanBusiness.GetEexecutePlanInfosByProductLineCode();
{ RefreshDataGrid(planInfos);
var planInfos = assemblyPlanBusiness.GetEexecutePlanInfosByProductLineCode();
RefreshDataGrid(planInfos);
if (planInfos != null)
{
//加载正在执行的计划 //加载正在执行的计划
planInfos = planInfos.Where(x => x.executeStatus == 2).ToList(); planInfos = planInfos.Where(x => x.executeStatus == 2).ToList();
if (planInfos.Count > 0) if (planInfos.Count > 0)
@ -295,7 +295,10 @@ namespace Aucma.Scada.UI.viewModel.AssemblyPlan
ExecutePlanInfo planInfo = planInfos.OrderBy(x => x.executeOrder).First(); ExecutePlanInfo planInfo = planInfos.OrderBy(x => x.executeOrder).First();
RefreshPlanExecute(planInfo); RefreshPlanExecute(planInfo);
} }
}
App.Current.Dispatcher.Invoke((Action)(() =>
{
MaterialNameList = new List<string>() MaterialNameList = new List<string>()
{ {
"SC232", "SC232",

@ -235,16 +235,16 @@ namespace Aucma.Scada.UI.viewModel.InStoreInfo
//info.ForEach(x => RefreshInStoreTask(x)); //info.ForEach(x => RefreshInStoreTask(x));
try try
{ {
foreach (var item in info)
App.Current.Dispatcher.BeginInvoke((Action)(() =>
{ {
foreach (var item in info)
App.Current.Dispatcher.Invoke((Action)(() =>
{ {
item.materialType = inStoreBusiness.GetMaterialName(item.materialType); item.materialType = inStoreBusiness.GetMaterialName(item.materialType);
taskItems.Add(item); taskItems.Add(item);
InstoreTask = taskItems; InstoreTask = taskItems;
})); }
} }));
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -288,9 +288,8 @@ namespace Aucma.Scada.UI.viewModel.InStoreInfo
{ {
ChartValues<double> achievement = new ChartValues<double>(); ChartValues<double> achievement = new ChartValues<double>();
ChartValues<double> achievement2 = new ChartValues<double>(); ChartValues<double> achievement2 = new ChartValues<double>();
App.Current.Dispatcher.Invoke((Action)(() => App.Current.Dispatcher.BeginInvoke((Action)(() =>
{ {
Query();
Achievement.Clear(); Achievement.Clear();
MaterialNameList = new List<string>() MaterialNameList = new List<string>()
{ {
@ -334,20 +333,10 @@ namespace Aucma.Scada.UI.viewModel.InStoreInfo
/// <param name="taskInfo"></param> /// <param name="taskInfo"></param>
private void RefreshInStoreTask(RealTaskInfo taskInfo, bool isFinsih = false) private void RefreshInStoreTask(RealTaskInfo taskInfo, bool isFinsih = false)
{ {
//try
//{
// App.Current.Dispatcher.Invoke((Action)(() =>
// {
// taskItems.Add(taskInfo);
// InstoreTask = taskItems;
// }));
//}
//catch (Exception ex)
//{
// logHelper.Error("入库任务列表刷新异常", ex);
//}
if (isFinsih) if (isFinsih)
{ {
Query();
Init(); Init();
} }
else else

@ -94,7 +94,7 @@ namespace Aucma.Scada.UI.viewModel.InventoryInfo
private void Query() private void Query()
{ {
App.Current.Dispatcher.Invoke((Action)(() => App.Current.Dispatcher.BeginInvoke((Action)(() =>
{ {
var info = inventoryInfoBusiness.GetSpaceInfos(appConfig.linerStoreCode); var info = inventoryInfoBusiness.GetSpaceInfos(appConfig.linerStoreCode);
if (info != null) if (info != null)

Loading…
Cancel
Save