change - 出入库逻辑处理

collectionStore
wenjy 1 year ago
parent 0e38cfed10
commit b6062dc600

Binary file not shown.

@ -60,7 +60,7 @@ namespace Aucma.Scada.Business
/// 初始化入库任务
/// </summary>
/// <param name="message"></param>
public delegate void RefreshInStoreTask(RealTaskInfo taskInfos);
public delegate void RefreshInStoreTask(RealTaskInfo taskInfos, bool isFinsih = false);
public event RefreshInStoreTask RefreshInStoreTaskEvent;
/// <summary>
@ -93,15 +93,15 @@ namespace Aucma.Scada.Business
grabImage.RefreshLogMessageEvent += PrintLogInfoMessage;
StartPassDown();
//Task.Run(() =>
//{
// Thread.Sleep(6000);
// for (int i = 11; i < 12; i++)
// {
// InStore(appConfig.shellStoreCode, "B23600000781101900" + i);
// InStore(appConfig.linerStoreCode, "L23600000788101900" + i);
// }
//});
Task.Run(() =>
{
Thread.Sleep(6000);
for (int i = 1; i < 7; i++)
{
//InStore(appConfig.shellStoreCode, "B23600000781101902" + i);
InStore(appConfig.linerStoreCode, "L23600000788101902" + i);
}
});
}
@ -124,6 +124,7 @@ namespace Aucma.Scada.Business
var result = CreateInStoreTask(spaceInfo, materialCode); //创建入库任务
if (result)
{
spaceInfo.onRouteAmount += 1;
_spaceInfoService.UpdateSpaceInfo(spaceInfo);
}
}
@ -241,7 +242,7 @@ namespace Aucma.Scada.Business
PrintLogInfoMessage($"箱壳入库任务:{taskInfo.taskCode};执行完成");
RefreshInStoreTaskEvent?.Invoke(taskInfo);
RefreshInStoreTaskEvent?.Invoke(taskInfo,true);
}
else
{
@ -252,10 +253,8 @@ namespace Aucma.Scada.Business
else
{
PrintLogInfoMessage("未获取到需要下发的箱壳入库任务");
Thread.Sleep(5000);
}
Thread.Sleep(3000);
}
/// <summary>
@ -291,7 +290,7 @@ namespace Aucma.Scada.Business
PrintLogInfoMessage($"内胆入库任务:{taskInfo.taskCode};执行完成");
RefreshInStoreTaskEvent?.Invoke(taskInfo);
RefreshInStoreTaskEvent?.Invoke(taskInfo,true);
}
else
{
@ -302,8 +301,8 @@ namespace Aucma.Scada.Business
{
PrintLogInfoMessage("未获取到需要下发的内胆入库任务");
Thread.Sleep(5000);
}
Thread.Sleep(3000);
}
/// <summary>

@ -139,7 +139,7 @@ namespace Aucma.Scada.Business
ReadShellFinish_InStore(taskCode);
}
Thread.Sleep(5000);
Thread.Sleep(1000);
} while (isFlag);
}
else
@ -192,7 +192,7 @@ namespace Aucma.Scada.Business
isFlag = false;
}
Thread.Sleep(5000);
Thread.Sleep(1000);
} while (isFlag);
}
else
@ -294,7 +294,7 @@ namespace Aucma.Scada.Business
ReadLinerFinish_InStore(taskCode);
}
Thread.Sleep(5000);
Thread.Sleep(1000);
} while (isFlag);
}
else
@ -347,7 +347,7 @@ namespace Aucma.Scada.Business
}
Thread.Sleep(5000);
Thread.Sleep(1000);
} while (isFlag);
}
else

@ -91,6 +91,9 @@ namespace Aucma.Scada.Business
public delegate void RefreshAssemblyPlanInit();
public event RefreshAssemblyPlanInit RefreshAssemblyPlanInitEvent;
public delegate void RefreshStoreStock();
public event RefreshStoreStock RefreshStoreStockEvent;
#endregion
private OutStoreBusiness()
@ -289,7 +292,6 @@ namespace Aucma.Scada.Business
{
while (true)
{
Thread.Sleep(10000);
PassDownTaskInfo();
Thread.Sleep(1000);
}
@ -378,14 +380,17 @@ namespace Aucma.Scada.Business
UpdatePlanInfo(executePlanCode);
RefreshStoreStockEvent?.Invoke();
}
}
else
{
PrintLogInfoMessage("未获取到需要下发的出库任务");
Thread.Sleep(5000);
}
Thread.Sleep(3000);
}

@ -152,7 +152,7 @@ namespace Aucma.Scada.Business
ReadShellFinish_OutStore(taskCode);
}
Thread.Sleep(5000);
Thread.Sleep(1000);
} while (isFlag);
}
else
@ -205,7 +205,7 @@ namespace Aucma.Scada.Business
isFlag = false;
}
Thread.Sleep(5000);
Thread.Sleep(1000);
} while (isFlag);
}
else
@ -311,7 +311,7 @@ namespace Aucma.Scada.Business
ReadLinerFinish_OutStore(taskCode);
}
Thread.Sleep(5000);
Thread.Sleep(1000);
} while (isFlag);
}
else
@ -364,7 +364,7 @@ namespace Aucma.Scada.Business
}
Thread.Sleep(5000);
Thread.Sleep(1000);
} while (isFlag);
}
else

@ -284,46 +284,52 @@ namespace Aucma.Scada.UI.viewModel.InStoreInfo
/// </summary>
public void Init()
{
Query();
MaterialNameList = new List<string>()
{
"SC232",
"SA124",
"SC387",
"SC211",
"DQ196",
};
ChartValues<double> achievement = new ChartValues<double>();
Random random = new Random();
for (int i = 0; i < 5; i++)
{
achievement.Add(random.Next(60, 100));
}
var column = new ColumnSeries();
column.DataLabels = true;
column.Title = "箱壳";
column.Values = achievement;
ChartValues<double> achievement2 = new ChartValues<double>();
Random random2 = new Random();
for (int i = 0; i < 5; i++)
App.Current.Dispatcher.Invoke((Action)(() =>
{
achievement2.Add(random2.Next(60, 100));
}
Query();
MaterialNameList = new List<string>()
{
"SC232",
"SA124",
"SC387",
"SC211",
"DQ196",
};
Random random = new Random();
for (int i = 0; i < 5; i++)
{
achievement.Add(random.Next(60, 100));
}
var column = new ColumnSeries();
column.DataLabels = true;
column.Title = "箱壳";
column.Values = achievement;
Random random2 = new Random();
for (int i = 0; i < 5; i++)
{
achievement2.Add(random2.Next(60, 100));
}
var column2 = new ColumnSeries();
column2.DataLabels = true;
column2.Title = "内胆";
column2.Values = achievement2;
Achievement.Add(column);
Achievement.Add(column2);
var column2 = new ColumnSeries();
column2.DataLabels = true;
column2.Title = "内胆";
column2.Values = achievement2;
Achievement.Add(column);
Achievement.Add(column2);
}));
}
/// <summary>
/// 刷新入库任务列表
/// </summary>
/// <param name="taskInfo"></param>
private void RefreshInStoreTask(RealTaskInfo taskInfo)
private void RefreshInStoreTask(RealTaskInfo taskInfo, bool isFinsih = false)
{
//try
//{
@ -337,7 +343,14 @@ namespace Aucma.Scada.UI.viewModel.InStoreInfo
//{
// logHelper.Error("入库任务列表刷新异常", ex);
//}
Query();
if (isFinsih)
{
Init();
}
else
{
Query();
}
}
/// <summary>

@ -22,6 +22,8 @@ namespace Aucma.Scada.UI.viewModel.InventoryInfo
private OutStoreBusiness outStoreBusiness = OutStoreBusiness.Instance;
private InStoreBusiness inStoreBusiness = InStoreBusiness.Instance;
private AppConfig appConfig = AppConfig.Instance;
public LinerInventoryViewModel()
@ -40,6 +42,9 @@ namespace Aucma.Scada.UI.viewModel.InventoryInfo
OutOnlyOneCommand = new RelayCommand<object>(obj => OutOnlyOne(obj));
#endregion
outStoreBusiness.RefreshStoreStockEvent += Query;
inStoreBusiness.RefreshInStoreTaskEvent += RefreshSpaceInfo;
Query();
@ -89,20 +94,28 @@ namespace Aucma.Scada.UI.viewModel.InventoryInfo
private void Query()
{
var info = inventoryInfoBusiness.GetSpaceInfos(appConfig.linerStoreCode);
if (info != null)
App.Current.Dispatcher.Invoke((Action)(() =>
{
if (spaceItems.Count > 0)
var info = inventoryInfoBusiness.GetSpaceInfos(appConfig.linerStoreCode);
if (info != null)
{
spaceItems.Clear();
if (spaceItems.Count > 0)
{
spaceItems.Clear();
}
foreach (var item in info)
{
spaceItems.Add(item);
}
Shapes = spaceItems;
}
}));
}
foreach (var item in info)
{
spaceItems.Add(item);
}
Shapes = spaceItems;
}
private void RefreshSpaceInfo(object obj = null, bool isFinish = true)
{
Query();
}
/// <summary>

@ -22,6 +22,8 @@ namespace Aucma.Scada.UI.viewModel.InventoryInfo
private OutStoreBusiness outStoreBusiness = OutStoreBusiness.Instance;
private InStoreBusiness inStoreBusiness = InStoreBusiness.Instance;
private AppConfig appConfig = AppConfig.Instance;
public ShellInventoryViewModel()
@ -40,6 +42,11 @@ namespace Aucma.Scada.UI.viewModel.InventoryInfo
OutOnlyOneCommand = new RelayCommand<object>(obj => OutOnlyOne(obj));
#endregion
outStoreBusiness.RefreshStoreStockEvent += Query;
inStoreBusiness.RefreshInStoreTaskEvent += RefreshSpaceInfo;
Query();
}
@ -89,20 +96,29 @@ namespace Aucma.Scada.UI.viewModel.InventoryInfo
private void Query()
{
var info = inventoryInfoBusiness.GetSpaceInfos(appConfig.shellStoreCode);
if (info != null)
App.Current.Dispatcher.Invoke((Action)(() =>
{
if (spaceItems.Count > 0)
var info = inventoryInfoBusiness.GetSpaceInfos(appConfig.shellStoreCode);
if (info != null)
{
spaceItems.Clear();
if (spaceItems.Count > 0)
{
spaceItems.Clear();
}
foreach (var item in info)
{
spaceItems.Add(item);
}
Shapes = spaceItems;
}
}));
}
foreach (var item in info)
{
spaceItems.Add(item);
}
Shapes = spaceItems;
}
private void RefreshSpaceInfo(object obj = null, bool isFinish = true)
{
Query();
}
/// <summary>

@ -29,7 +29,7 @@ namespace HighWayIot.Repository.service.Impl
try
{
Expression<Func<BaseSpaceInfo, bool>> exp = s1 => true;
exp = exp.And(x => x.storeCode == store && x.materialType == materialType && x.spaceStatus == 1 && x.spaceCapacity != (x.spaceStock + x.onRouteAmount)); //相同型号、启用状态、库存未满的货道信息
exp = exp.And(x => x.storeCode == store && x.materialType == materialType && x.spaceStatus == 1 && x.spaceCapacity > (x.spaceStock + x.onRouteAmount)); //相同型号、启用状态、库存未满的货道信息
spaceInfos = _mesRepository.GetList(exp);

Loading…
Cancel
Save