cahnge - 出库逻辑

foamRearStore
wenjy 11 months ago
parent 7be28d901c
commit 110cdfb7a2

Binary file not shown.

@ -85,11 +85,6 @@ namespace Aucma.Scada.Business
StartPassDown();
}
private void HandleTimer()
{
InStore("SC232");
}
/// <summary>
/// 入库
/// </summary>
@ -99,7 +94,7 @@ namespace Aucma.Scada.Business
try
{
PrintLogInfoMessage($"扫码成功,物料码:{materialCode}");
string materialType = SubStringMaterialCode(materialCode);
string materialType = materialCode;
var spaceInfo = _spaceInfoService.InStoreGetSpaceInfoByMaterialType(appConfig.foamStoreCode, materialType);
if (spaceInfo != null)
{

@ -99,7 +99,7 @@ namespace Aucma.Scada.Business
}
/// <summary>
/// 接收下达的组装计划根据BOM获取需要出库的箱壳、内胆物料信息
/// 接收下达的组装计划根据BOM获取需要出库的泡后、内胆物料信息
/// </summary>
/// <param name="planInfo"></param>
private void PlanHandle(ExecutePlanInfo planInfo)
@ -111,15 +111,11 @@ namespace Aucma.Scada.Business
if (planInfo != null)
{
string taskCode = DateTime.Now.ToString("HH:mm:ss");
var shellBomInfo = _bomInfoService.GetChildenBomInfoByMaterialCode(planInfo.materialCode, appConfig.shellMaterialType);
var linerBomInfo = _bomInfoService.GetChildenBomInfoByMaterialCode(planInfo.materialCode, appConfig.linerMaterialType);
var bomInfo = _bomInfoService.GetChildenBomInfoByMaterialCode(planInfo.materialCode, appConfig.shellMaterialType);
for (int i = 0; i < planInfo.planAmount - planInfo.completeAmount; i++)
{
OutStore(appConfig.shellStoreCode, shellBomInfo, planInfo.executePlanCode, taskCode);
OutStore(appConfig.foamStoreCode, bomInfo, planInfo.executePlanCode, taskCode);
Thread.Sleep(500);
OutStore(appConfig.linerStoreCode, linerBomInfo, planInfo.executePlanCode, taskCode);
Thread.Sleep(500);
}
}
});
@ -296,41 +292,23 @@ namespace Aucma.Scada.Business
if (taskInfoList.Count > 0)
{
taskAmount = taskInfoList.Count; //下发的任务数量默认2箱壳、内胆),箱壳、内胆均执行完成后才会释放信号量
taskAmount = taskInfoList.Count; //下发的任务数量默认2泡后、内胆),泡后、内胆均执行完成后才会释放信号量
foreach (var item in taskInfoList)
{
taskCode = item.taskCode;
if (item.storeCode == appConfig.shellStoreCode)
if (taskHandleBusiness.SendShellTask_OutStore(item))
{
if (taskHandleBusiness.SendShellTask_OutStore(item))
{
PrintLogInfoMessage($"下发箱壳出库任务:{item.taskCode};仓库{item.storeCode};货道:{item.spaceCode}等待PLC执行反馈");
item.taskStatus = 2;
iFlag++;
}
else
{
PrintLogInfoMessage($"箱壳出库任务:{item.taskCode}下发失败请排除PLC连接");
continue;
}
shellCode = item.materialCode;
PrintLogInfoMessage($"下发泡后出库任务:{item.taskCode};仓库{item.storeCode};货道:{item.spaceCode}等待PLC执行反馈");
item.taskStatus = 2;
iFlag++;
}
else if (item.storeCode == appConfig.linerStoreCode)
else
{
if (taskHandleBusiness.SendLinerTask_OutStore(item))
{
PrintLogInfoMessage($"下发内胆出库任务:{item.taskCode};仓库{item.storeCode};货道:{item.spaceCode}等待PLC执行反馈");
item.taskStatus = 2;
iFlag++;
}
else
{
PrintLogInfoMessage($"内胆出库任务:{item.taskCode}下发失败请排除PLC连接");
continue;
}
linerCode = item.materialCode;
PrintLogInfoMessage($"泡后出库任务:{item.taskCode}下发失败请排除PLC连接");
continue;
}
shellCode = item.materialCode;
RefreshScanMateriaCodeEvent?.Invoke(item.materialCode, item.materialType, item.spaceName, item.storeCode);
}
@ -352,7 +330,7 @@ namespace Aucma.Scada.Business
semaphore.Wait(); //一直堵塞直到信号量释放
PrintLogInfoMessage($"出库任务:{taskCode};执行完成,绑定箱壳条码:{shellCode};内胆条码:{linerCode}");
PrintLogInfoMessage($"出库任务:{taskCode};执行完成,绑定泡后条码:{shellCode};内胆条码:{linerCode}");
}
}
@ -374,13 +352,13 @@ namespace Aucma.Scada.Business
List<RealTaskInfo> taskInfos = new List<RealTaskInfo>();
try
{
RealTaskInfo shellTaskInfo = _taskInfoService.GetTaskInfoByStoreCode(appConfig.shellStoreCode, 2);
RealTaskInfo foamTaskInfo = _taskInfoService.GetTaskInfoByStoreCode(appConfig.foamStoreCode, 2);
if (shellTaskInfo != null)
if (foamTaskInfo != null)
{
taskInfos.Add(shellTaskInfo);
//获取与箱壳任务匹配的内胆任务
RealTaskInfo linerTaskInfo = _taskInfoService.GetTaskInfoByTaskCode(shellTaskInfo.taskCode, appConfig.linerStoreCode);
taskInfos.Add(foamTaskInfo);
//获取与泡后任务匹配的内胆任务
RealTaskInfo linerTaskInfo = _taskInfoService.GetTaskInfoByTaskCode(foamTaskInfo.taskCode, appConfig.linerStoreCode);
if (linerTaskInfo != null) taskInfos.Add(linerTaskInfo);
}
else
@ -409,42 +387,21 @@ namespace Aucma.Scada.Business
/// <param name="taskCode"></param>
private void TaskFeedback(string storeCode, string taskCode)
{
if (storeCode == appConfig.shellStoreCode)
{
ShellTaskFeedback(taskCode);
}
else
{
LinerTaskFeedback(taskCode);
}
}
/// <summary>
/// 箱壳执行反馈
/// </summary>
private void ShellTaskFeedback(string taskCode)
{
Interlocked.Increment(ref completedTasks);
CheckCompletedTasks();
PrintLogInfoMessage("箱壳执行完成,自动释放信号量");
OutStoreFinish(taskCode, appConfig.shellStoreCode);
FoamTaskFeedback(taskCode);
}
/// <summary>
/// 内胆执行反馈
/// 泡后执行反馈
/// </summary>
private void LinerTaskFeedback(string taskCode)
private void FoamTaskFeedback(string taskCode)
{
Interlocked.Increment(ref completedTasks);
CheckCompletedTasks();
PrintLogInfoMessage("内胆执行完成,自动释放信号量");
PrintLogInfoMessage("泡后执行完成,自动释放信号量");
OutStoreFinish(taskCode, appConfig.linerStoreCode);
OutStoreFinish(taskCode, appConfig.foamStoreCode);
}
/// <summary>
@ -505,7 +462,7 @@ namespace Aucma.Scada.Business
/// <returns></returns>
public List<RealTaskInfo> GetOutStoreTask()
{
var taskInfos = _taskInfoService.GetTaskInfosByStoreCode(new string[] { appConfig.shellStoreCode, appConfig.linerStoreCode }, appConfig.outstoreTaskType);
var taskInfos = _taskInfoService.GetTaskInfosByStoreCode(new string[] { appConfig.foamStoreCode, appConfig.linerStoreCode }, appConfig.outstoreTaskType);
return taskInfos;
}

@ -8,6 +8,8 @@ shellStoreCode=XKJCK-001
linerStoreCode=NDJCK-001
foamStoreCode=FPJCK-001
shellMaterialType=3
linerMaterialType=4

@ -298,6 +298,7 @@ namespace Aucma.Scada.UI.viewModel.InStoreInfo
MaterialCode = materialCode;
MaterialName = materialName;
SpaceName = spaceName;
ScanTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
}
}
}

Loading…
Cancel
Save