Пример #1
0
        public static bool UpdateStockCell(string pallet, string cellchlidID, ref string restr)
        {
            StockModel stock = bllStock.GetModelByTrayCode(pallet);

            if (stock == null)
            {
                restr = "库存ID错误!";
                return(false);
            }
            stock.Cell_Child_ID = cellchlidID;
            bllStock.Update(stock);
            return(true);
        }
Пример #2
0
        public void TrayConfirm(string planListID, string recCellName)
        {
            try
            {
                View_PlanListModel planlistView = bllViewPlanList.GetModelByPlanListID(planListID);
                if (planlistView == null)
                {
                    return;
                }
                if (planlistView.Plan_Status == EnumPlanStatus.完成.ToString())
                {
                    this.View.ShowMessage("信息提示", "已完成的计划不允许再进行配盘操作!");
                    return;
                }
                string restr = "";
                if (ViewDataManager.PALLETWITHPLANDATA.TrayGoodsListData.Count == 0)
                {
                    this.View.ShowMessage("信息提示", "请添加配盘物料!");
                    return;
                }
                //if (isFull == true)
                //{
                //    stock.Stock_Full_Flag = "1";
                //}
                //else
                //{
                //    stock.Stock_Full_Flag = "0";
                //}
                //WH_WareHouseModel house = bllWareHouse.GetModelByName(houseName);
                //if (house == null)
                //{
                //    restr = "库房对象为空!";
                //    return ;
                //}
                WH_CellModel cell = bllCell.GetStationByName(recCellName);
                if (cell == null)
                {
                    this.View.ShowMessage("信息提示", "配盘地点错误!");
                    return;
                }
                List <string> distinctTray = new List <string>();
                foreach (TrayGoodsListModel tray in ViewDataManager.PALLETWITHPLANDATA.TrayGoodsListData)
                {
                    if (distinctTray.Contains(tray.托盘条码) == false)
                    {
                        distinctTray.Add(tray.托盘条码);
                    }
                }
                foreach (string tray in distinctTray)
                {
                    StockModel stockModel = bllStock.GetModelByTrayCode(tray);
                    if (stockModel != null)
                    {
                        this.View.ShowMessage("信息提示", "托盘条码" + tray + "已经在库存中,请确认托盘条码!");
                        ViewDataManager.PALLETWITHPLANDATA.TrayGoodsListData.Clear();
                        return;
                    }
                }

                //if (CheckMaterialNum(ref restr) == false)//不做校验了
                //{
                //    this.View.ShowMessage("信息提示", restr);
                //    return;
                //}
                foreach (string tray in distinctTray)
                {
                    StockModel stock = new StockModel();
                    stock.Stock_ID           = Guid.NewGuid().ToString();
                    stock.Cell_Child_ID      = cell.Cell_ID;
                    stock.Stock_Tray_Barcode = tray;
                    bllStock.Add(stock);

                    for (int i = 0; i < ViewDataManager.PALLETWITHPLANDATA.TrayGoodsListData.Count; i++)
                    {
                        TrayGoodsListModel trayGoodsModel = ViewDataManager.PALLETWITHPLANDATA.TrayGoodsListData[i];
                        if (trayGoodsModel.托盘条码 != tray)
                        {
                            continue;
                        }
                        Stock_ListModel stockList = new Stock_ListModel();
                        stockList.Stock_List_ID = Guid.NewGuid().ToString();
                        stockList.Stock_ID      = stock.Stock_ID;

                        GoodsModel goods = bllGoods.GetModelByCode(trayGoodsModel.物料编码);
                        if (goods == null)
                        {
                            continue;
                        }
                        stockList.Goods_ID               = goods.Goods_ID;
                        stockList.Plan_List_ID           = trayGoodsModel.计划列表编号;
                        stockList.Stock_List_Box_Barcode = trayGoodsModel.托盘条码;
                        stockList.Stock_List_Entry_Time  = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                        stockList.Stock_List_Quantity    = trayGoodsModel.数量.ToString();

                        bllStockList.Add(stockList);

                        if (UpdatePlanNum(trayGoodsModel.计划列表编号, goods.Goods_ID, float.Parse(trayGoodsModel.数量), ref restr) == false)
                        {
                            this.WmsFrame.WriteLog("按计划配盘", "", "提示", restr);
                        }
                    }
                }
                ViewDataManager.PALLETWITHPLANDATA.TrayGoodsListData.Clear();//配盘完成后清除数据
                QueryPlan(this.currPlanCode);
                this.View.ShowMessage("信息提示", "配盘成功!");
            }
            catch (Exception ex)
            {
                this.View.ShowMessage("信息提示", "配盘失败!" + ex.Message);
            }
        }
Пример #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);
        }
Пример #4
0
        public void TrayConfirm(bool isFull, string palletCode, string recCellName)
        {
            try
            {
                if (ViewDataManager.PALLETMANAGEDATA.PalletInforData.Count == 0)
                {
                    this.View.ShowMessage("信息提示", "请添加配盘物料!");
                    return;
                }
                //WH_WareHouseModel house = bllWareHouse.GetModelByName(houseName);
                //if (house == null)
                //{

                //    return ;
                //}
                WH_CellModel cell = bllCell.GetStationByName(recCellName);

                //WH_Station_LogicModel cell = bllStationLogic.GetStationByName(house.WareHouse_ID,recCellName);
                if (cell == null)
                {
                    this.View.ShowMessage("信息提示", "配盘地点错误!");
                    return;
                }
                StockModel stockModel = bllStock.GetModelByTrayCode(palletCode);
                if (stockModel == null)
                {
                    this.View.ShowMessage("信息提示", "此托盘条码不在库存中!");
                    return;
                }
                stockModel.Cell_Child_ID      = cell.Cell_ID;
                stockModel.Stock_Tray_Barcode = palletCode;
                if (isFull == true)
                {
                    stockModel.Stock_Full_Flag = "1";
                }
                else
                {
                    stockModel.Stock_Full_Flag = "0";
                }

                bllStock.Update(stockModel);
                Stock_ListModel stockListTemp = bllStockList.GetModelByPalletCode(palletCode);
                if (stockListTemp == null)
                {
                    this.View.ShowMessage("信息提示", "此托盘中没有物料!");
                    return;
                }
                bllStockList.DeleteByStockID(stockModel.Stock_ID);
                for (int i = 0; i < ViewDataManager.PALLETMANAGEDATA.PalletInforData.Count; i++)
                {
                    Stock_ListModel stockList = new Stock_ListModel();
                    stockList.Stock_List_ID = Guid.NewGuid().ToString();
                    stockList.Stock_ID      = stockModel.Stock_ID;
                    PalletGoodsListModel trayGoodsModel = ViewDataManager.PALLETMANAGEDATA.PalletInforData[i];
                    GoodsModel           goods          = bllGoods.GetModelByCode(trayGoodsModel.物料编码);
                    if (goods == null)
                    {
                        continue;
                    }
                    stockList.Goods_ID               = goods.Goods_ID;
                    stockList.Plan_List_ID           = stockListTemp.Plan_List_ID;
                    stockList.Stock_List_Box_Barcode = palletCode;
                    stockList.Stock_List_Entry_Time  = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                    stockList.Stock_List_Quantity    = trayGoodsModel.数量.ToString();
                    bllStockList.Add(stockList);
                }
                this.View.ShowMessage("信息提示", "配盘成功!");
                QueryPallet(currPalletPos, currPlanCode);
            }
            catch (Exception ex)
            {
                this.View.ShowMessage("信息提示", "配盘失败!" + ex.Message);
            }
        }
Пример #5
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);
        }