Esempio n. 1
0
        /// <summary>
        ///DCR出库和产品出库
        /// </summary>
        /// <param name="xweModel"></param>
        /// <param name="testType"></param>
        /// <returns></returns>
        private bool AutoOutHouseGsTask(XWEDBAccess.Model.GoodsSiteModel xweModel, SysCfg.EnumTestType testType)
        {
            string[] rcl = xweModel.GoodsSiteName.Split('-');

            CellCoordModel cell  = new CellCoordModel(int.Parse(rcl[0]), int.Parse(rcl[1]), int.Parse(rcl[2]));
            CellCoordModel cell2 = null;

            // 上传MES Start
            Report2Mes(xweModel);
            // 上传MES END

            if (testType == SysCfg.EnumTestType.充放电测试)
            {
                if (this.AsrsModel.HouseName == EnumStoreHouse.A1库房.ToString())
                {
                    cell2 = AHouseDCRStation;//特殊固定的位置
                }
                else//b1库房
                {
                    cell2 = BHouseDCRStation; //特殊固定的位置
                }


                if (this.AsrsModel.GenerateOutputTask(cell, cell2, SysCfg.EnumAsrsTaskType.DCR测试, true) == false)
                {
                    this.AsrsModel.LogRecorder.AddDebugLog("库存控制模块", "生成DCR测试任务失败!");
                    return(false);
                }
                if (xweGsBll.UpdateGs(this.AsrsModel.HouseName, xweModel.GoodsSiteName, EnumOperateStatus.锁定.ToString()) == false)//将出库的货位锁定,根据锁定状态循环生成任务
                {
                    this.AsrsModel.LogRecorder.AddDebugLog("库存控制模块", "更新新威尔中间库的锁定状态失败!");
                    return(false);
                }

                // 将测试结果保存到数据库中 START
                AddXWEHistroy(xweModel);
                // 将测试结果保存到数据库中 END

                return(true);
            }
            else if (testType == SysCfg.EnumTestType.DCR测试)//正常出库
            {
                if (this.AsrsModel.GenerateOutputTask(cell, null, SysCfg.EnumAsrsTaskType.DCR出库, true) == false)
                {
                    this.AsrsModel.LogRecorder.AddDebugLog("库存控制模块", "生成DCR测试任务失败!");
                    return(false);
                }
                if (xweGsBll.UpdateGs(this.AsrsModel.HouseName, xweModel.GoodsSiteName, EnumOperateStatus.锁定.ToString()) == false)//将出库的货位锁定,根据锁定状态循环生成任务
                {
                    this.AsrsModel.LogRecorder.AddDebugLog("库存控制模块", "更新新威尔中间库的锁定状态失败!");
                    return(false);
                }
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 2
0
        /// <summary>
        ///DCR出库和产品出库
        /// </summary>
        /// <param name="xweModel"></param>
        /// <param name="testType"></param>
        /// <returns></returns>
        private bool AutoOutHouseGsTask(XWEDBAccess.Model.GoodsSiteModel xweModel, SysCfg.EnumTestType testType)
        {
            string[] rcl = xweModel.GoodsSiteName.Split('-');

            CellCoordModel cell  = new CellCoordModel(int.Parse(rcl[0]), int.Parse(rcl[1]), int.Parse(rcl[2]));
            CellCoordModel cell2 = null;

            // 上传MES Start
            Report2Mes(xweModel);
            // 上传MES END

            if (testType == SysCfg.EnumTestType.充放电测试)
            {
                ControlTaskModel dcrWaitOrRunningTask = null;
                if (this.AsrsModel.HouseName == EnumStoreHouse.A1库房.ToString())
                {
                    dcrWaitOrRunningTask = bllControlTask.GetProcessWaitOrRunningTask(EnumStoreHouse.A1库房.ToString(), 4, "1001");
                    cell2 = AHouseDCRStation;//特殊固定的位置
                }
                else//b1库房
                {
                    dcrWaitOrRunningTask = bllControlTask.GetProcessWaitOrRunningTask(EnumStoreHouse.B1库房.ToString(), 4, "1002");
                    cell2 = BHouseDCRStation;     //特殊固定的位置
                }
                if (dcrWaitOrRunningTask != null) //如果已经有dcr执行中或者待执行的任务就不在生成了,同一个工位的锁定
                {
                    return(false);
                }
                //在生成dcr测试的时候要判断下DCR测试工位是否有料,在新威尔交互的数据表中记录dcr工位的测试类型为无的时候证明已经测试完并出库完成
                if (IsDCRStationValid(this.AsrsModel.HouseName) == false)
                {
                    return(false);
                }

                if (this.AsrsModel.GenerateOutputTask(cell, cell2, SysCfg.EnumAsrsTaskType.DCR测试, true) == false)
                {
                    this.AsrsModel.LogRecorder.AddDebugLog("库存控制模块", "生成DCR测试任务失败!");
                    return(false);
                }
                if (xweGsBll.UpdateGs(this.AsrsModel.HouseName, xweModel.GoodsSiteName, EnumOperateStatus.锁定.ToString()) == false)//将出库的货位锁定,根据锁定状态循环生成任务
                {
                    this.AsrsModel.LogRecorder.AddDebugLog("库存控制模块", "更新新威尔中间库的锁定状态失败!");
                    return(false);
                }

                // 将测试结果保存到数据库中 START
                AddXWEHistroy(xweModel);
                // 将测试结果保存到数据库中 END

                return(true);
            }
            else if (testType == SysCfg.EnumTestType.DCR测试)//正常出库
            {
                ControlTaskModel dcrOutWaitOrRunningTask = null;
                if (this.AsrsModel.HouseName == EnumStoreHouse.A1库房.ToString())
                {
                    dcrOutWaitOrRunningTask = bllControlTask.GetProcessWaitOrRunningTask(EnumStoreHouse.A1库房.ToString(), 3, "1001");
                }
                else//b1库房
                {
                    dcrOutWaitOrRunningTask = bllControlTask.GetProcessWaitOrRunningTask(EnumStoreHouse.B1库房.ToString(), 3, "1002");
                }
                if (dcrOutWaitOrRunningTask != null)//如果已经有dcr执行中或者待执行的任务就不在生成了,同一个工位的锁定
                {
                    return(false);
                }

                if (this.AsrsModel.GenerateOutputTask(cell, null, SysCfg.EnumAsrsTaskType.DCR出库, true) == false)
                {
                    this.AsrsModel.LogRecorder.AddDebugLog("库存控制模块", "生成DCR测试任务失败!");
                    return(false);
                }
                if (xweGsBll.UpdateGs(this.AsrsModel.HouseName, xweModel.GoodsSiteName, EnumOperateStatus.锁定.ToString()) == false)//将出库的货位锁定,根据锁定状态循环生成任务
                {
                    this.AsrsModel.LogRecorder.AddDebugLog("库存控制模块", "更新新威尔中间库的锁定状态失败!");
                    return(false);
                }
                return(true);
            }
            else
            {
                return(false);
            }
        }