Beispiel #1
0
        public void AddTrayGoods(string trayCode, string goodsNum, string goodsCode, string planCode)
        {
            if (trayCode.Trim() == "")
            {
                this.View.ShowMessage("信息提示", "请输入托盘条码!");
                return;
            }
            if (goodsNum == "")
            {
                this.View.ShowMessage("信息提示", "请输入物料配盘数量!");
                return;
            }
            if (IsExistPalletGoods(trayCode, goodsCode) == true)
            {
                this.View.ShowMessage("信息提示", "此物料已经在配盘中!");
                return;
            }
            View_GoodsModel goodsModel = bllViewGoods.GetModelByGoodsCode(goodsCode);

            if (goodsModel == null)
            {
                return;
            }
            PalletGoodsList tglm = new PalletGoodsList();

            tglm.托盘条码 = trayCode;
            tglm.单位   = goodsModel.Goods_Unit;
            tglm.规格型号 = goodsModel.Goods_Model;
            //tglm.生产日期 = createDatetime;
            tglm.数量   = goodsNum;
            tglm.物料编码 = goodsCode;

            ViewDataManager.PALLETWITHOUTPLANDATA.PalletInforData.Add(tglm);
        }
Beispiel #2
0
 public void DeleteTrayGoods(string pallet, string goodsCode)
 {
     for (int i = 0; i < ViewDataManager.PALLETWITHOUTPLANDATA.PalletInforData.Count; i++)
     {
         PalletGoodsList tglm = ViewDataManager.PALLETWITHOUTPLANDATA.PalletInforData[i];
         if (tglm.物料编码 == goodsCode && pallet == tglm.托盘条码)
         {
             ViewDataManager.PALLETWITHOUTPLANDATA.PalletInforData.Remove(tglm);
             break;
         }
     }
 }
Beispiel #3
0
        public void LoadStock(string cellID)
        {
            ViewDataManager.STOCKADJUSTVIEWDATA.PalletInforData.Clear();
            List <View_StockListModel> stockList = bllViewStockList.GetModelListByCellID(cellID);

            if (stockList != null && stockList.Count > 0)
            {
                foreach (View_StockListModel stock in stockList)
                {
                    PalletGoodsList pgl = new PalletGoodsList();
                    pgl.单位   = stock.Goods_Unit;
                    pgl.规格型号 = stock.Goods_Model;
                    pgl.数量   = stock.Stock_List_Quantity;
                    pgl.托盘条码 = stock.Stock_Tray_Barcode;
                    pgl.物料编码 = stock.Goods_Code;

                    ViewDataManager.STOCKADJUSTVIEWDATA.PalletInforData.Add(pgl);
                }
            }
        }
Beispiel #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);
            }
        }
Beispiel #5
0
        public void TrayConfirm(string cellID)
        {
            try
            {
                string restr = "";
                //if (ViewDataManager.STOCKADJUSTVIEWDATA.PalletGoodsData.Count == 0)
                //{
                //    this.View.ShowMessage("信息提示", "请添加配盘物料!");
                //    return;
                //}

                List <View_Plan_StockListModel> oldStockList = bllViewPlanStockList.GetModelListByCellID(cellID);

                View_CellModel cell = bllViewCell.GetModelByChildCellID(cellID);
                if (cell == null)
                {
                    this.View.ShowMessage("信息提示", "库存货位错误!");
                    return;
                }
                if (cell.Cell_Child_Flag != "1")
                {
                    this.View.ShowMessage("信息提示", "被禁用的货位不允许调整库存!");
                    // this.WmsFrame.WriteLog("库存调整", "", "提示", "被禁用的货位不允许调整库存!");
                    return;
                }
                if (cell.Cell_Child_Status == EnumGSTaskStatus.锁定.ToString())
                {
                    this.View.ShowMessage("信息提示", "被锁定的货位不允许调整库存!请等待任务执行完成再调整!");
                    return;
                }
                if (ViewDataManager.STOCKADJUSTVIEWDATA.PalletInforData.Count == 0)//清空库存
                {
                    if (this.View.AskMessage("信息提示", "您确定要清空此货位库存么?") != 0)
                    {
                        return;
                    }
                    string operteDetail = cell.WareHouse_Name + ":[" + cell.Cell_Name + "]库存手动清空!";
                    TaskHandleMethod.AddCellOperRecord(cellID, EnumGSOperateType.手动修改状态, operteDetail, ref restr);
                    TaskHandleMethod.DeleteStockByCellChildID(cellID);
                    if (AddRecord(cellID, EnumCellStatus.空闲, EnumGSTaskStatus.完成, ref restr) == false)
                    {
                        this.View.ShowMessage("信息提示", "库存状态、操作记录更新失败!");
                        return;
                    }
                    return;
                }
                List <string> distinctTray = new List <string>();
                foreach (PalletGoodsList tray in ViewDataManager.STOCKADJUSTVIEWDATA.PalletInforData)
                {
                    if (distinctTray.Contains(tray.托盘条码) == false)
                    {
                        distinctTray.Add(tray.托盘条码);
                    }
                }
                if (distinctTray.Count > 1)
                {
                    this.View.ShowMessage("信息提示", "一个货位只允许有一个托盘!");
                    return;
                }
                foreach (string tray in distinctTray)
                {
                    List <StockModel> stockListModel = bllStock.GetModelListByTrayCode(tray);
                    foreach (StockModel stockModel in stockListModel)
                    {
                        if (stockModel != null && stockModel.Cell_Child_ID != cellID)
                        {
                            this.View.ShowMessage("信息提示", "托盘条码" + tray + "已经在库存中,请确认托盘条码!");
                            ViewDataManager.STOCKADJUSTVIEWDATA.PalletInforData.Clear();
                            return;
                        }
                    }
                }
                TaskHandleMethod.DeleteStockByCellChildID(cellID);//先清空库存在往里添加
                foreach (string tray in distinctTray)
                {
                    StockModel stock = new StockModel();
                    stock.Stock_ID           = Guid.NewGuid().ToString();
                    stock.Cell_Child_ID      = cell.Cell_Chlid_ID;
                    stock.Stock_Tray_Barcode = tray;
                    bllStock.Add(stock);

                    for (int i = 0; i < ViewDataManager.STOCKADJUSTVIEWDATA.PalletInforData.Count; i++)
                    {
                        PalletGoodsList trayGoodsModel = ViewDataManager.STOCKADJUSTVIEWDATA.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;
                        if (oldStockList != null && oldStockList.Count > 0)//计划编号从原来库存里获取
                        {
                            stockList.Plan_List_ID = oldStockList[0].Plan_List_ID;
                            if (oldStockList[0].Plan_List_ID != "-1")
                            {
                                if (UpdatePlanNum(oldStockList[0].Plan_List_ID, goods.Goods_ID, trayGoodsModel.数量.ToString(), ref restr) == false)
                                {
                                    this.WmsFrame.WriteLog("按计划配盘", "", "提示", restr);
                                }
                            }
                        }
                        else//如果没有库存默认为无计划
                        {
                            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 (AddRecord(cellID, EnumCellStatus.满位, EnumGSTaskStatus.完成, ref restr) == false)
                {
                    this.View.ShowMessage("信息提示", "库存状态、操作记录更新失败!");
                    return;
                }
                string operteStockDetail = cell.WareHouse_Name + ":[" + cell.Cell_Name + "]库存手动调整成功!!";

                TaskHandleMethod.AddCellOperRecord(cellID, EnumGSOperateType.手动修改状态, operteStockDetail, ref restr);

                ViewDataManager.STOCKADJUSTVIEWDATA.PalletInforData.Clear();//配盘完成后清除数据
                this.View.ShowMessage("信息提示", "库存调整成功!");
            }
            catch (Exception ex)
            {
                this.View.ShowMessage("信息提示", "库存调整失败!" + ex.Message);
            }
        }