Esempio n. 1
0
        public void CompleteTaskManual(string palletCode)
        {
            ManageModel task = bllManage.GetModelByPalletCode(palletCode);

            if (task == null)
            {
                this.View.ShowMessage("信息提示", "不存在任务!");
                return;
            }
            task.Mange_Status = EnumManageTaskStatus.已完成.ToString();
            bllManage.Update(task);
            QueryTask(this.currtaskType, this.currtaskStatus);
        }
Esempio n. 2
0
        /// <summary>
        /// wcs向wms请求任务
        /// </summary>
        /// <param name="applyTask"></param>
        /// <returns></returns>
        public ResposeData RequireTask(RequireTaskModel requireTask)
        {
            ResposeData response = new ResposeData();

            if (requireTask == null)
            {
                response.Status   = false;
                response.Describe = "请求任务对象为空!";
                return(response);
            }


            try
            {
                ManageModel existMana = bllManage.GetModelByPalletCode(requireTask.PalletCode);
                if (existMana != null)
                {
                    response.Status   = false;
                    response.Describe = "此托盘任务已经生成!";
                    return(response);
                }
                ManageModel manage = new ManageModel();
                manage.Mange_ID = Guid.NewGuid().ToString();
                WH_Station_LogicModel stationLogic = bllStationLogic.GetModelByCellID(requireTask.RequireDevice.DeviceCode);
                if (stationLogic == null)
                {
                    response.Status   = false;
                    response.Describe = "请求设备编号错误!";
                    return(response);
                }

                if (requireTask.RequireType == EnumRequireTaskType.空筐入库.ToString())//入库请求设备对应指定库房编码,库房编码和堆垛机编码一致
                {
                    //通过stationLogic得知申请的是哪个库房的入库
                    View_CellModel targetModel = bllViewCell.ApplyCell(stationLogic.WareHouse_ID);
                    if (targetModel == null)
                    {
                        response.Status   = false;
                        response.Describe = "已经没有货位可以申请了!";
                        return(response);
                    }

                    manage.Mange_Stock_Barcode     = requireTask.PalletCode;
                    manage.Manage_BreakDown_Status = "FALSE";
                    manage.Mange_End_Cell_ID       = targetModel.Cell_Chlid_ID;
                    manage.Mange_Full_Flag         = "0";
                    manage.Mange_Start_Cell_ID     = requireTask.RequireDevice.DeviceCode;
                    manage.Mange_Status            = EnumManageTaskStatus.待执行.ToString();
                    manage.Mange_Type_ID           = "7";//空托盘上架
                }
                else if (requireTask.RequireType == EnumRequireTaskType.空筐出库.ToString())
                {
                    View_CellModel emptyPalletCell = bllViewCell.GetEmptyPalletCell();
                    if (emptyPalletCell == null)
                    {
                        response.Status   = false;
                        response.Describe = "已经没有空托盘可以申请了!";
                        return(response);
                    }

                    manage.Manage_BreakDown_Status = "FALSE";
                    manage.Mange_End_Cell_ID       = requireTask.RequireDevice.DeviceCode;
                    manage.Mange_Full_Flag         = "0";

                    manage.Mange_Start_Cell_ID = emptyPalletCell.Cell_Chlid_ID;
                    manage.Mange_Status        = EnumManageTaskStatus.待执行.ToString();
                    manage.Mange_Stock_Barcode = requireTask.PalletCode;
                    manage.Mange_Type_ID       = "9";//空托盘下架
                }
                else
                {
                    response.Status   = false;
                    response.Describe = "请求任务类型错误!";
                    return(response);
                }
                bllManage.Add(manage);

                response.Status   = true;
                response.Describe = "任务请求成功!";
                return(response);
            }
            catch (Exception ex)
            {
                response.Status   = false;
                response.Describe = "任务请求失败!" + ex.Message;
                return(response);
            }
        }
Esempio n. 3
0
        public void PutawayTask(string palletCode, string houseName, string putawayStationName,
                                bool isAssign, string rowth, string colth, string layerth, string pos)
        {
            string restr = "";

            if (palletCode == "")
            {
                this.View.ShowMessage("信息提示", "请选择托盘条码!");
                return;
            }
            //if(isEmptyPallet == false)//不是空托盘,没有库存判断
            //{
            StockModel stock = bllStock.GetModelByTrayCode(palletCode);

            if (stock == null)
            {
                this.View.ShowMessage("信息提示", "请配盘入库!");
                return;
            }
            //}

            ManageModel manageTemp = bllManage.GetModelByPalletCode(palletCode);

            if (manageTemp != null)
            {
                this.View.ShowMessage("信息提示", "当前托盘已经生成上架任务!");
                return;
            }
            string             manageID   = "";
            EnumManageTaskType manaTask   = EnumManageTaskType.架;
            string             targetCell = rowth + "排" + colth + "列" + layerth + "层-" + pos;
            //if (isEmptyPallet == true)
            //{
            //    manaTask = EnumManageTaskType.空托盘上架;
            //}
            //else
            ////{
            //manaTask = EnumManageTaskType.上架;
            //}
            ReturnObject allowCreateTask = new ReturnObject();

            allowCreateTask.Status = true;

            if (this.AllowPutaway != null)
            {
                WH_WareHouseModel house = bllWareHouse.GetModelByName(houseName);
                if (house == null)
                {
                    this.View.ShowMessage("信息提示", "库房获取失败!");
                    return;
                }
                PutawayParams putwayParams = new PutawayParams();
                putwayParams.WareHouseName = houseName;
                putwayParams.WareHouseCode = house.WareHouse_Code;
                putwayParams.PalletCode    = palletCode;
                allowCreateTask            = this.AllowPutaway(putwayParams);
            }
            if (allowCreateTask.Status == false)
            {
                this.View.ShowMessage("信息提示", allowCreateTask.Describe);
                return;
            }
            if (TaskHandleMethod.CreatePutawayManageTask(palletCode, houseName, putawayStationName, isAssign, targetCell, manaTask, ref manageID, ref restr) == false)
            {
                this.WmsFrame.WriteLog("上架逻辑", "", "提示", "创建管理任务失败:" + restr);
                return;
            }
            //if (TaskHandleMethod.CreatePutawayManageListTask(manageID, palletCode, ref restr) == false)
            //{
            //    this.WmsFrame.WriteLog("上架逻辑", "", "提示", "创建管理任务列表失败:" + restr);
            //    return;
            //}
            this.WmsFrame.WriteLog("上架逻辑", "", "提示", "上架任务下达成功!" + restr);
        }
Esempio n. 4
0
        public void PutawayTask(string palletCode, string houseName, string putawayStationName,
                                bool isAssign, string rowth, string colth, string layerth, string pos)
        {
            string restr = "";

            if (palletCode == "")
            {
                this.View.ShowMessage("信息提示", "请选择托盘条码!");
                return;
            }
            //if(isEmptyPallet == false)//不是空托盘,没有库存判断
            //{
            StockModel stock = bllStock.GetModelByTrayCode(palletCode);

            if (stock == null)
            {
                this.View.ShowMessage("信息提示", "请配盘入库!");
                return;
            }
            //}

            ManageModel manageTemp = bllManage.GetModelByPalletCode(palletCode);

            if (manageTemp != null)
            {
                this.View.ShowMessage("信息提示", "当前托盘已经生成上架任务!");
                return;
            }
            string             manageID   = "";
            EnumManageTaskType manaTask   = EnumManageTaskType.架;
            string             targetCell = rowth + "排" + colth + "列" + layerth + "层-" + pos;
            //if (isEmptyPallet == true)
            //{
            //    manaTask = EnumManageTaskType.空托盘上架;
            //}
            //else
            ////{
            //manaTask = EnumManageTaskType.上架;
            //}
            bool allowCreateTask = true;

            if (this.AllowPutaway != null)
            {
                allowCreateTask = this.AllowPutaway();
            }
            if (allowCreateTask == false)
            {
                this.View.ShowMessage("信息提示", "当前系统不允许下达上架任务!只允许执行一个任务");
                return;
            }
            if (TaskHandleMethod.CreatePutawayManageTask(palletCode, houseName, putawayStationName, isAssign, targetCell, manaTask, ref manageID, ref restr) == false)
            {
                this.WmsFrame.WriteLog("上架逻辑", "", "提示", "创建管理任务失败:" + restr);
                return;
            }
            //if (TaskHandleMethod.CreatePutawayManageListTask(manageID, palletCode, ref restr) == false)
            //{
            //    this.WmsFrame.WriteLog("上架逻辑", "", "提示", "创建管理任务列表失败:" + restr);
            //    return;
            //}
            this.WmsFrame.WriteLog("上架逻辑", "", "提示", "上架任务下达成功!" + restr);
        }