add
zongzhibin
2024-11-24 272ea6040258a7adfc807123036378915860fb90
CC/iWareCC_ASRS/WmsTask/EmptySalverTransferTask.cs
@@ -29,11 +29,11 @@
            while (true)
            {
                Thread.Sleep(2000);//休眠2秒,将休眠写到前面,是为了下面的continue方法执行后不显示错误信息的提示!!!【EditBy shaocx,2022-05-24】
                SystemWarningMsg._lbl_Alert_EmptySalverTransfer = string.Empty;
                SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_AutoQiTaoOutbound = string.Empty;
                bool isHasFinishedCurrentHanlder = false;//是否已经处理完了空托盘转运任务
                try
                {
                    if (SystemValue.isAllowRuning_EmptySalverTransfer && SystemValue.isStartedModel)
                    if (SystemValue.isAllowRuning_DataProcess_RobotBuffer_IssueOutboundTask && SystemValue.isStartedModel)
                    {
                        //此处判断 1009 1010 1011的状态
                        bool isEmptyPlace_1011 = false, isEmptyPlace_1010 = false, isEmptyPlace_1009 = false;
@@ -77,7 +77,7 @@
                                    {
                                        if (FormCC.RGV_1011_HasCategory_COUNT < SysGloble.MAX_RGV_1011_HasCategory_COUNT)
                                        {
                                            SystemWarningMsg._lbl_Alert_EmptySalverTransfer += "错误:1011处不允许创建任务,1011有货时间:" + FormCC.RGV_1011_HasCategory_COUNT
                                            SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_AutoQiTaoOutbound += "错误:1011处不允许创建任务,1011有货时间:" + FormCC.RGV_1011_HasCategory_COUNT
                                                + ",还未大于设定的最大超时时间:" + SysGloble.MAX_RGV_1011_HasCategory_COUNT + SysGloble.SPLIT_STR;
                                        }
                                        else
@@ -93,11 +93,11 @@
                                    var fr = MyExtendHelper.DoHandler(context, store, rgvLocation);
                                    if (fr.result == false)
                                    {
                                        SystemWarningMsg._lbl_Alert_EmptySalverTransfer += "错误:1011处新建任务失败:" + fr.resMsg + SysGloble.SPLIT_STR;
                                        SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_AutoQiTaoOutbound += "错误:1011处新建任务失败:" + fr.resMsg + SysGloble.SPLIT_STR;
                                    }
                                    else
                                    {
                                        SystemWarningMsg._lbl_Alert_EmptySalverTransfer += "成功创建1011任务" + SysGloble.SPLIT_STR;
                                        SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_AutoQiTaoOutbound += "成功创建1011任务" + SysGloble.SPLIT_STR;
                                        continue;
                                    }
                                    isHasFinishedCurrentHanlder = true;
@@ -165,7 +165,7 @@
                                if (salverStackCount == 0)
                                {
                                    //报错
                                    SystemWarningMsg._lbl_Alert_EmptySalverTransfer += ("[检测]根据1009站点的光电获取返回立体库的托盘数为0") + SysGloble.SPLIT_STR;
                                    SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_AutoQiTaoOutbound += ("[检测]根据1009站点的光电获取返回立体库的托盘数为0") + SysGloble.SPLIT_STR;
                                    continue;
                                }
                                //休眠5秒
@@ -174,13 +174,13 @@
                                if (salverStackCount2 == 0)
                                {
                                    //报错
                                    SystemWarningMsg._lbl_Alert_EmptySalverTransfer += ("[检测]根据1009站点的光电获取返回立体库的托盘数为0") + SysGloble.SPLIT_STR;
                                    SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_AutoQiTaoOutbound += ("[检测]根据1009站点的光电获取返回立体库的托盘数为0") + SysGloble.SPLIT_STR;
                                    continue;
                                }
                                if (salverStackCount != salverStackCount2)
                                {
                                    //报错
                                    SystemWarningMsg._lbl_Alert_EmptySalverTransfer += ("根据1009站点的光电,相差5秒获取返回立体库的托盘数不一致,第一次是" + salverStackCount + ",第二次是" + salverStackCount2) + SysGloble.SPLIT_STR;
                                    SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_AutoQiTaoOutbound += ("根据1009站点的光电,相差5秒获取返回立体库的托盘数不一致,第一次是" + salverStackCount + ",第二次是" + salverStackCount2) + SysGloble.SPLIT_STR;
                                    continue;
                                }
@@ -190,11 +190,11 @@
                                var fr = MyExtendHelper.DoHandler(context, null, rgvLocation);
                                if (fr.result == false)
                                {
                                    SystemWarningMsg._lbl_Alert_EmptySalverTransfer += "错误:1009处新建任务失败:" + fr.resMsg + SysGloble.SPLIT_STR;
                                    SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_AutoQiTaoOutbound += "错误:1009处新建任务失败:" + fr.resMsg + SysGloble.SPLIT_STR;
                                }
                                else
                                {
                                    SystemWarningMsg._lbl_Alert_EmptySalverTransfer += "成功创建1009任务" + SysGloble.SPLIT_STR;
                                    SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_AutoQiTaoOutbound += "成功创建1009任务" + SysGloble.SPLIT_STR;
                                    continue;
                                }
                                isHasFinishedCurrentHanlder = true;
@@ -209,7 +209,7 @@
                            var errMsg = "";
                            if (!MyExtendHelper.IsAllowSendTaskTo1014ByTPHS(ref errMsg))
                            {
                                SystemWarningMsg._lbl_Alert_EmptySalverTransfer += errMsg + SysGloble.SPLIT_STR;
                                SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_AutoQiTaoOutbound += errMsg + SysGloble.SPLIT_STR;
                                continue;
                            }
@@ -223,7 +223,7 @@
                                {
                                    if (!MyExtendHelper.IsAllowSendTaskTo1014ByTPHS(ref errMsg))
                                    {//再次校验 【EditBy shaocx,2022-05-18】
                                        SystemWarningMsg._lbl_Alert_EmptySalverTransfer += errMsg + SysGloble.SPLIT_STR;
                                        SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_AutoQiTaoOutbound += errMsg + SysGloble.SPLIT_STR;
                                        continue;
                                    }
                                    //判断1011位置是否有库存,并且是未锁定状态,如果是,就不要创建从立体库到1014的任务了【EditBy shaocx,2022-05-18】
@@ -232,18 +232,18 @@
                                    if (store1011 != null && store1011.StationId > 0)
                                    //if (store1011 != null && store1011.StationIsLock == false && store1011.StationIsHasTaskDoing == false)
                                    {
                                        SystemWarningMsg._lbl_Alert_EmptySalverTransfer += "1011位置有系统库存存在,因此不需要创建从立体库到1014的任务。。" + SysGloble.SPLIT_STR;
                                        SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_AutoQiTaoOutbound += "1011位置有系统库存存在,因此不需要创建从立体库到1014的任务。。" + SysGloble.SPLIT_STR;
                                        continue;
                                    }
                                    var fr = MyExtendHelper.DoHandler(context, null, rgvLocation);
                                    if (fr.result == false)
                                    {
                                        SystemWarningMsg._lbl_Alert_EmptySalverTransfer += "错误:拆盘机入口1014处新建从立体库叫托盘任务失败:" + fr.resMsg + SysGloble.SPLIT_STR;
                                        SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_AutoQiTaoOutbound += "错误:拆盘机入口1014处新建从立体库叫托盘任务失败:" + fr.resMsg + SysGloble.SPLIT_STR;
                                    }
                                    else
                                    {
                                        SystemWarningMsg._lbl_Alert_EmptySalverTransfer += "成功创建拆盘机入口1014处新建从立体库叫托盘任务" + SysGloble.SPLIT_STR;
                                        SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_AutoQiTaoOutbound += "成功创建拆盘机入口1014处新建从立体库叫托盘任务" + SysGloble.SPLIT_STR;
                                        continue;
                                    }
                                }
@@ -254,8 +254,8 @@
                }
                catch (Exception ex)
                {
                    SystemWarningMsg._lbl_Alert_EmptySalverTransfer += "分解线程出现异常:" + ex.Message + SysGloble.SPLIT_STR;
                    Log4NetHelper.WriteErrorLog(LogType.EmptySalverTransferTask, "HandlerIssuingTask出现异常:" + ex.Message, ex);
                    SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_AutoQiTaoOutbound += "分解线程出现异常:" + ex.Message + SysGloble.SPLIT_STR;
                    Log4NetHelper.WriteErrorLog(LogType.DataProcess_RobotBuffer_IssueOutboundTask, "HandlerIssuingTask出现异常:" + ex.Message, ex);
                }
            }