|
|
|
@ -67,6 +67,8 @@ namespace Aucma.Scada.Business
|
|
|
|
|
private IRecordOutStoreService _recordOutStoreService;
|
|
|
|
|
|
|
|
|
|
private IRecordProductfinishService _recordProductfinishService;
|
|
|
|
|
|
|
|
|
|
private ICodeBindingRecordServices _codeBindingRecordServices;
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 委托事件
|
|
|
|
@ -111,7 +113,7 @@ namespace Aucma.Scada.Business
|
|
|
|
|
_productPlanInfoService = registerServices.GetService<IProductPlanInfoService>();
|
|
|
|
|
_recordOutStoreService = registerServices.GetService<IRecordOutStoreService>();
|
|
|
|
|
_recordProductfinishService = registerServices.GetService<IRecordProductfinishService>();
|
|
|
|
|
|
|
|
|
|
_codeBindingRecordServices = registerServices.GetService<ICodeBindingRecordServices>();
|
|
|
|
|
assemblyPlanBusiness.NextPassExecutePlanInfoEvent += PlanHandle;
|
|
|
|
|
taskHandleBusiness.OutStoreAnswerEvent += OutStoreAnswer;
|
|
|
|
|
taskHandleBusiness.OutStoreFinsihEvent += OutStoreFinish;
|
|
|
|
@ -138,9 +140,14 @@ namespace Aucma.Scada.Business
|
|
|
|
|
for (int i = 0; i < planInfo.planAmount - planInfo.completeAmount; i++)
|
|
|
|
|
{
|
|
|
|
|
string taskCode = System.Guid.NewGuid().ToString("N").Substring(0,10);
|
|
|
|
|
OutStore(appConfig.shellStoreCode, shellBomInfo, planInfo.executePlanCode, taskCode);
|
|
|
|
|
RealTaskInfo shellTask = OutStore(appConfig.shellStoreCode, shellBomInfo, planInfo.executePlanCode, taskCode);
|
|
|
|
|
Thread.Sleep(500);
|
|
|
|
|
OutStore(appConfig.linerStoreCode, linerBomInfo, planInfo.executePlanCode, taskCode);
|
|
|
|
|
RealTaskInfo linerTask = OutStore(appConfig.linerStoreCode, linerBomInfo, planInfo.executePlanCode, taskCode);
|
|
|
|
|
// 条码绑定表,绑定箱壳和内胆码 shellTask.materialCode,linerTask.materialCode
|
|
|
|
|
if (shellTask != null && linerTask != null)
|
|
|
|
|
{
|
|
|
|
|
_codeBindingRecordServices.BindingCode(shellTask.materialCode, linerTask.materialCode);
|
|
|
|
|
}
|
|
|
|
|
Thread.Sleep(500);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -162,7 +169,7 @@ namespace Aucma.Scada.Business
|
|
|
|
|
/// <param name="storeCode"></param>
|
|
|
|
|
/// <param name="bomInfo"></param>
|
|
|
|
|
/// <param name="planCode"></param>
|
|
|
|
|
private void OutStore(string storeCode, BaseBomInfo bomInfo, string planCode, string taskCode)
|
|
|
|
|
private RealTaskInfo OutStore(string storeCode, BaseBomInfo bomInfo, string planCode, string taskCode)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
@ -175,18 +182,21 @@ namespace Aucma.Scada.Business
|
|
|
|
|
{
|
|
|
|
|
PrintLogInfoMessage($"匹配货道:{spaceInfo.spaceName}");
|
|
|
|
|
// RefreshScanMateriaCodeEvent?.Invoke(materiaclCode, materialType, spaceInfo.spaceName, storeCode); //刷新界面扫码信息
|
|
|
|
|
bool result = CreateOutStoreTask(spaceInfo, planCode, taskCode); //创建出库任务
|
|
|
|
|
if (result)
|
|
|
|
|
RealTaskInfo task = CreateOutStoreTask(spaceInfo, planCode, taskCode); //创建出库任务
|
|
|
|
|
if (task!=null)
|
|
|
|
|
{
|
|
|
|
|
PrintLogInfoMessage("出库任务创建成功");
|
|
|
|
|
return task;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
PrintLogInfoMessage("出库任务创建失败");
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return null;
|
|
|
|
|
//报警停线
|
|
|
|
|
PrintLogInfoMessage($"{storeCode};仓库内未获取到{bomInfo.materialCode}相匹配的物料及货道");
|
|
|
|
|
}
|
|
|
|
@ -194,6 +204,7 @@ namespace Aucma.Scada.Business
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
PrintLogErrorMessage("出库业务异常", ex);
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -201,7 +212,7 @@ namespace Aucma.Scada.Business
|
|
|
|
|
/// 创建出库任务
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="spaceInfo"></param>
|
|
|
|
|
private bool CreateOutStoreTask(BaseSpaceInfo spaceInfo, string planCode, string taksCode, int taskModel = 0)
|
|
|
|
|
private RealTaskInfo CreateOutStoreTask(BaseSpaceInfo spaceInfo, string planCode, string taksCode, int taskModel = 0)
|
|
|
|
|
{
|
|
|
|
|
bool result = false;
|
|
|
|
|
try
|
|
|
|
@ -210,7 +221,6 @@ namespace Aucma.Scada.Business
|
|
|
|
|
BaseSpaceDetail spaceDetail = GetSpaceDetailFirstOrderByCreatTime(spaceInfo);
|
|
|
|
|
if (spaceDetail != null)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
#region 出库任务赋值
|
|
|
|
|
RealTaskInfo realTaskInfo = new RealTaskInfo();
|
|
|
|
|
realTaskInfo.planCode = planCode;
|
|
|
|
@ -235,6 +245,7 @@ namespace Aucma.Scada.Business
|
|
|
|
|
RefreshOutStoreTaskEvent?.Invoke(realTaskInfo);
|
|
|
|
|
|
|
|
|
|
UpdateSpaceAndDetial(spaceInfo, spaceDetail);
|
|
|
|
|
return realTaskInfo;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
@ -246,7 +257,7 @@ namespace Aucma.Scada.Business
|
|
|
|
|
{
|
|
|
|
|
PrintLogErrorMessage("出库任务创建异常", ex);
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -788,7 +799,9 @@ namespace Aucma.Scada.Business
|
|
|
|
|
BaseSpaceInfo spaceInfo = _spaceInfoService.GetSpaceInfoBySpaceCode(storeCode, spaceCode);
|
|
|
|
|
if (spaceInfo.spaceStock > 0)
|
|
|
|
|
{
|
|
|
|
|
result = this.CreateOutStoreTask(spaceInfo, System.Guid.NewGuid().ToString("N"), DateTime.Now.ToString("HH:mm:ss"), 1);
|
|
|
|
|
RealTaskInfo task = this.CreateOutStoreTask(spaceInfo, System.Guid.NewGuid().ToString("N"), DateTime.Now.ToString("HH:mm:ss"), 1);
|
|
|
|
|
if (task != null)
|
|
|
|
|
result = true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|