|
|
|
@ -118,9 +118,7 @@ namespace Aucma.Core.BoxFoam.Business
|
|
|
|
|
{
|
|
|
|
|
Thread.Sleep(5000);
|
|
|
|
|
|
|
|
|
|
test();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// test();
|
|
|
|
|
// 获取任务下发plc
|
|
|
|
|
StartPassDown();
|
|
|
|
|
// InStore("B23600083025024860011");
|
|
|
|
@ -130,7 +128,7 @@ namespace Aucma.Core.BoxFoam.Business
|
|
|
|
|
|
|
|
|
|
public async void test()
|
|
|
|
|
{
|
|
|
|
|
InStoreFinish("PB01_001");
|
|
|
|
|
// InStoreFinish("PB01_001");
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 入库出库完成信号定时器
|
|
|
|
@ -194,11 +192,12 @@ namespace Aucma.Core.BoxFoam.Business
|
|
|
|
|
|
|
|
|
|
if (taskInfo != null)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
logHelper.Info($"下发泡后入库任务:{taskInfo.TaskCode};仓库{taskInfo.StoreCode};货道:{taskInfo.SpaceCode}");
|
|
|
|
|
|
|
|
|
|
logHelper.Info($"下发泡前入库任务:{taskInfo.TaskCode};仓库{taskInfo.StoreCode};货道:{taskInfo.SpaceCode}");
|
|
|
|
|
LogDelegateEvent?.Invoke($"下发泡前入库任务:{taskInfo.TaskCode};仓库{taskInfo.StoreCode};货道:{taskInfo.SpaceCode}");
|
|
|
|
|
if (SendFoamTask_InStore(taskInfo))
|
|
|
|
|
{
|
|
|
|
|
logHelper.Info($"泡后入库任务:{taskInfo.TaskCode};下发成功,等待PLC执行反馈");
|
|
|
|
|
logHelper.Info($"泡前入库任务:{taskInfo.TaskCode};下发成功,等待PLC执行反馈");
|
|
|
|
|
semaphore.Wait(); //一直堵塞直到信号量释放
|
|
|
|
|
logHelper.Info($"箱壳入库任务:{taskInfo.TaskCode};开始执行");
|
|
|
|
|
taskInfo.TaskStatus = 2;
|
|
|
|
@ -231,8 +230,6 @@ namespace Aucma.Core.BoxFoam.Business
|
|
|
|
|
logHelper.Info("下发任务异常");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取待执行的入库任务
|
|
|
|
@ -266,6 +263,7 @@ namespace Aucma.Core.BoxFoam.Business
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
logHelper.Info($"扫码成功,物料条码:{materialBarCode}");
|
|
|
|
|
LogDelegateEvent?.Invoke($"扫码成功,物料条码:{materialBarCode}");
|
|
|
|
|
var taskList = await _realTaskInfoService.QueryAsync(d => d.MaterialCode.Equals(materialBarCode) && d.StoreCode == storeCode);
|
|
|
|
|
if (taskList.Count() > 0)
|
|
|
|
|
{
|
|
|
|
@ -278,6 +276,7 @@ namespace Aucma.Core.BoxFoam.Business
|
|
|
|
|
if (spaceInfo != null)
|
|
|
|
|
{
|
|
|
|
|
logHelper.Info($"匹配货道:{spaceInfo.ToJson()}");
|
|
|
|
|
LogDelegateEvent?.Invoke($"匹配货道:{spaceInfo.ToJson()}");
|
|
|
|
|
|
|
|
|
|
string message = $"箱体码[{materialBarCode}], 入{spaceInfo.SpaceName},入库中....";
|
|
|
|
|
PrintBarCode print = await _printBarCodeServices.FirstAsync(x => x.MaterialBarcode == materialBarCode);
|
|
|
|
@ -336,12 +335,14 @@ namespace Aucma.Core.BoxFoam.Business
|
|
|
|
|
if (flag > 0)
|
|
|
|
|
{
|
|
|
|
|
logHelper.Info("入库任务创建成功");
|
|
|
|
|
LogDelegateEvent?.Invoke($"[{materialCode}]入库任务创建成功");
|
|
|
|
|
RefreshInStoreTaskEvent?.Invoke(realTaskInfo);//刷新datagrid 列表
|
|
|
|
|
result = true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
logHelper.Info("入库任务创建失败");
|
|
|
|
|
LogDelegateEvent?.Invoke($"[{materialCode}]入库任务创建失败");
|
|
|
|
|
result = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -617,6 +618,7 @@ namespace Aucma.Core.BoxFoam.Business
|
|
|
|
|
/// </summary>
|
|
|
|
|
private void InStoreAnswer(string taskCode)
|
|
|
|
|
{
|
|
|
|
|
LogDelegateEvent?.Invoke($"泡前库应答成功,自动释放信号量,进行下发新任务");
|
|
|
|
|
logHelper.Info("泡前库应答成功,自动释放信号量,进行下发新任务");
|
|
|
|
|
// InStoreFinish(taskCode);
|
|
|
|
|
semaphore.Release();
|
|
|
|
@ -676,10 +678,13 @@ namespace Aucma.Core.BoxFoam.Business
|
|
|
|
|
recordInstore.InStoreAmount = 1;
|
|
|
|
|
recordInstore.InStoreTime = DateTime.Now;
|
|
|
|
|
recordInstore.BarCodeCode = taskInfo.MaterialCode;
|
|
|
|
|
|
|
|
|
|
bool result = await _recordInstoreServices.SaveRecordToDb(recordInstore, taskInfo, spaceInfo, spaceDetail);
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
bool result = await _recordInstoreServices.SaveRecordToDb(recordInstore, taskInfo, spaceInfo, spaceDetail);
|
|
|
|
|
if (result)
|
|
|
|
|
{
|
|
|
|
|
LogDelegateEvent?.Invoke($"入库完成,更新数据库成功");
|
|
|
|
|
}
|
|
|
|
|
LogDelegateEvent?.Invoke($"更新数据库异常");
|
|
|
|
|
}
|
|
|
|
|
////清除任务信息
|
|
|
|
|
//await _realTaskInfoService.DeleteTaskInfo(taskCode, storeCode);
|
|
|
|
|