cahnge - 出库逻辑

foamRearStore
wenjy 1 year ago
parent 7be28d901c
commit 110cdfb7a2

Binary file not shown.

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

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

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

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

Loading…
Cancel
Save