Example #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="houseName">库房名称</param>
        /// <param name="palletPos">配盘工位</param>
        public void QueryPallet(string palletPos, string planCode)
        {
            //this.currHouseName = houseName;
            this.currPalletPos = palletPos;
            this.currPlanCode  = planCode;
            string cellChildID = "";
            //if (houseName == "所有")
            //{

            //    cellChildID = "所有";
            //}
            //else
            //{


            //WH_WareHouseModel house = bllWareHouse.GetModelByName(houseName);
            //if (house == null)
            //{

            //    return;
            //}
            //WH_CellModel station = bllStationLogic.GetModelByHouseIDAndCellName(house.WareHouse_ID, palletPos);
            WH_CellModel station = bllCell.GetStationByName(palletPos);

            if (station == null)
            {
                this.View.ShowMessage("信息提示", "配盘工位获取失败!");
                return;
            }

            cellChildID = station.Cell_ID;



            List <View_StockListModel> stockList = bllViewStockList.GetModelList(cellChildID, planCode);

            //var p1 = stockList.Distinct(sl=>sl.Stpcl);

            ViewDataManager.PALLETMANAGEDATA.PalletList.Clear();
            if (stockList == null)
            {
                return;
            }

            List <View_StockListModel> distinctPallet = new List <View_StockListModel>();//去除重复数据

            foreach (View_StockListModel vsm in stockList)
            {
                var existPallet = distinctPallet.Where(s => s.Stock_Tray_Barcode == vsm.Stock_Tray_Barcode);
                if (existPallet == null || existPallet.Count() == 0)
                {
                    distinctPallet.Add(vsm);
                }
            }


            foreach (View_StockListModel stock in distinctPallet)
            {
                PalletListData pallet = new PalletListData();
                if (planCode != "所有")
                {
                    View_PlanListModel planList = bllViewPlanList.GetModelByPlanListID(stock.Plan_List_ID);
                    if (planList == null)
                    {
                        return;
                    }
                    if (stock.Plan_List_ID == "-1")
                    {
                        pallet.计划配盘 = "否";
                    }
                    else
                    {
                        pallet.计划配盘 = "是";

                        pallet.计划单号 = planList.Plan_Code;
                    }
                }
                else
                {
                    pallet.计划配盘 = "否";
                    pallet.计划单号 = "-1";
                }


                pallet.配盘时间   = stock.Stock_List_Entry_Time.ToString();
                pallet.托盘条码   = stock.Stock_Tray_Barcode;
                pallet.配盘工位名称 = stock.Cell_Name;
                ViewDataManager.PALLETMANAGEDATA.PalletList.Add(pallet);
            }
        }
Example #2
0
        private bool CreateCell(string houseDeviceID, string areaID, int rowth, int colth, int layerth, string shelfType)
        {
            WH_CellModel cell = new WH_CellModel();

            cell.Area_ID     = areaID;
            cell.Cell_Code   = rowth.ToString() + "-" + colth.ToString() + "-" + layerth.ToString();
            cell.Cell_Column = colth;
            cell.Cell_ID     = Guid.NewGuid().ToString();
            cell.Cell_InOut  = "出入";
            cell.Cell_Layer  = layerth;
            cell.Cell_Name   = rowth.ToString() + "排" + colth.ToString() + "列" + layerth.ToString() + "层";

            cell.Cell_Row    = rowth;
            cell.Cell_Type   = "货位";
            cell.Device_Code = houseDeviceID;
            cell.Shelf_Type  = shelfType;
            bllCell.Add(cell);

            if (shelfType == EnumShelfType.双深.ToString())
            {
                for (int i = 0; i < 2; i++)
                {
                    WH_Cell_ChildrenModel cellChild = new WH_Cell_ChildrenModel();
                    cellChild.Cell_Child_Flag  = "1";
                    cellChild.Cell_Child_InOut = "出入";
                    cellChild.Cell_Child_Model = "大";

                    cellChild.Cell_Child_Run_Status = EnumGSTaskStatus.完成.ToString();
                    cellChild.Cell_Child_Status     = EnumCellStatus.空闲.ToString();
                    cellChild.Cell_Chlid_ID         = Guid.NewGuid().ToString();

                    if (i == 0)
                    {
                        cellChild.Cell_Child_Order    = 1;
                        cellChild.Cell_Chlid_Position = EnumCellPos.前.ToString();
                    }
                    else
                    {
                        cellChild.Cell_Child_Order    = 2;
                        cellChild.Cell_Chlid_Position = EnumCellPos.后.ToString();
                    }
                    cellChild.Cell_ID = cell.Cell_ID;
                    bllCellChild.Add(cellChild);
                }
            }
            else
            {
                WH_Cell_ChildrenModel cellChild = new WH_Cell_ChildrenModel();
                cellChild.Cell_Child_Flag  = "1";
                cellChild.Cell_Child_InOut = "出入";
                cellChild.Cell_Child_Model = "大";

                cellChild.Cell_Child_Run_Status = EnumGSTaskStatus.完成.ToString();
                cellChild.Cell_Child_Status     = EnumCellStatus.空闲.ToString();
                cellChild.Cell_Chlid_ID         = Guid.NewGuid().ToString();
                cellChild.Cell_Child_Order      = 1;
                cellChild.Cell_Chlid_Position   = EnumCellPos.前.ToString();
                cellChild.Cell_ID = cell.Cell_ID;
                bllCellChild.Add(cellChild);
            }

            return(true);
        }
Example #3
0
        private bool CreateNewGS(string houseName, int rowth, int colth, int layerth, ref WH_CellModel gsModel)
        {
            //GoodsSiteModel gsm = new GoodsSiteModel();
            //gsm.GoodsSiteColumn = colth;
            //gsm.GoodsSiteOperate = EnumGSOperate.入库.ToString();
            //gsm.GoodsSiteLayer = layerth;
            //gsm.GoodsSiteName = rowth.ToString() + "排" + colth.ToString() + "列" + layerth.ToString() + "层";
            //gsm.GoodsSitePos = rowth.ToString() + "-" + colth.ToString() + "-" + layerth.ToString();
            //gsm.GoodsSiteRow = rowth;
            //gsm.GoodsSiteStatus = EnumCellStatus.空闲.ToString();
            //gsm.GsEnabled = true;
            //StoreHouseModel houseModel = bllStoreHouse.GetModelByName(houseName);//默认简历库区1
            //if (houseModel == null)
            //{
            //    return false;
            //}
            //gsm.StoreHouseID = houseModel.StoreHouseID;
            //gsm.GoodsSiteTaskStatus = EnumGSTaskStatus.完成.ToString();

            //gsModel = gsm;
            return(true);
        }
Example #4
0
        public void TrayConfirm(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.PALLETWITHOUTPLANDATA.PalletGoodsData.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 (PalletGoodsList tray in ViewDataManager.PALLETWITHOUTPLANDATA.PalletInforData)
                {
                    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.PALLETWITHOUTPLANDATA.PalletInforData.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.PALLETWITHOUTPLANDATA.PalletInforData.Count; i++)
                    {
                        PalletGoodsList trayGoodsModel = ViewDataManager.PALLETWITHOUTPLANDATA.PalletInforData[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           = "-1";
                        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, trayGoodsModel.数量, ref restr) == false)
                        //{
                        //    this.WmsFrame.WriteLog("按计划配盘", "", "提示", restr);
                        //}
                    }
                }
                ViewDataManager.PALLETWITHOUTPLANDATA.PalletInforData.Clear();//配盘完成后清除数据
                this.View.ShowMessage("信息提示", "配盘成功!");
            }
            catch (Exception ex)
            {
                this.View.ShowMessage("信息提示", "配盘失败!" + ex.Message);
            }
        }
Example #5
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);
            }
        }