예제 #1
0
        public PrintOrderInfo GetPrintShelfMission(Guid Id)
        {
            var data = new PrintOrderInfo();

            data.Title      = "上架单";
            data.SPrintDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm");

            var bll = new ShelfMission();
            var shelfMissionInfo = bll.GetModel(Id);

            data.OrderCode         = shelfMissionInfo.OrderCode;
            data.PurchaseOrderCode = "";
            data.SupplierName      = "";
            data.SPlanArrivalTime  = "";
            data.SPlanArrivalTime  = "";

            var t1 = Task.Factory.StartNew(() =>
            {
                BarcodeHelper bh     = new BarcodeHelper();
                data.BarcodeImageUri = bh.CreateBarcode(data.OrderCode);
            });

            var smpBll   = new ShelfMissionProduct();
            var sqlWhere = "and smp.ShelfMissionId = @ShelfMissionId ";
            var parm     = new SqlParameter("@ShelfMissionId", shelfMissionInfo.Id);
            var pList    = smpBll.GetListByJoin(sqlWhere, parm);

            if (pList != null && pList.Count > 0)
            {
                var cargoList = new List <PrintOrderCargoInfo>();
                foreach (var item in pList)
                {
                    cargoList.Add(new PrintOrderCargoInfo(item.OrderReceiptCode, item.ProductCode, item.ProductName, "", "", "", "", "", item.StayQty, item.Qty, ""));
                }
                data.CargoList = cargoList;
                //data.CargoList = JsonConvert.SerializeObject(cargoList);
            }

            t1.Wait();

            return(data);
        }
예제 #2
0
파일: PdaService.cs 프로젝트: songfang/Wms
        public ResResultModel GetShelfMissionProductList(PdaShelfMissionProductModel model)
        {
            try
            {
                if (model.PageIndex < 1)
                {
                    model.PageIndex = 1;
                }
                if (model.PageSize < 1)
                {
                    model.PageSize = 10;
                }
                int totalRecord = 0;
                var bll         = new ShelfMissionProduct();

                var sqlWhere = "and ShelfMissionId = @ShelfMissionId ";
                var parm     = new SqlParameter("@ShelfMissionId", model.ShelfMissionId);
                var list     = bll.GetListByJoin(model.PageIndex, model.PageSize, out totalRecord, sqlWhere, parm);

                return(ResResult.Response(true, "", JsonConvert.SerializeObject(list)));

                //throw new ArgumentException("该方法未实现");

                //if (model.PageIndex < 1) model.PageIndex = 1;
                //if (model.PageSize < 1) model.PageSize = 10;
                //var shelfMissionId = Guid.Parse(model.ShelfMissionId.ToString());

                //var list = new List<PdaShelfMissionProductInfo>();

                //var spBll = new StockProduct();
                //var slBll = new StockLocation();
                //var bll = new ShelfMissionProduct();

                //var scanningList = spBll.GetProductsByStep(1, 100000, EnumData.EnumStep.收货.ToString());
                //if (scanningList != null && scanningList.Count > 0)
                //{
                //    foreach (var item in scanningList)
                //    {
                //        var stockLocationList = new List<PdaStockLocationProductInfo>();
                //        var bestStockLocation = slBll.GetListByBest(item.ProductId, item.Qty);
                //        if (bestStockLocation != null && bestStockLocation.Count > 0)
                //        {
                //            foreach (var slItem in bestStockLocation)
                //            {
                //                stockLocationList.Add(new PdaStockLocationProductInfo(slItem.Text, 0));
                //            }
                //        }

                //        list.Add(new PdaShelfMissionProductInfo(item.ProductId, item.ProductCode, item.ProductName, item.Qty, (int)EnumData.EnumStep.收货, stockLocationList));
                //    }
                //}

                //var scannedList = bll.GetListByScanned(shelfMissionId);
                //if (scannedList != null && scannedList.Count > 0)
                //{
                //    foreach (var item in scannedList)
                //    {
                //        var stockLocationList = new List<PdaStockLocationProductInfo>();
                //        var bestStockLocation = slBll.GetListByBest(item.ProductId, item.Qty);
                //        if (bestStockLocation != null && bestStockLocation.Count > 0)
                //        {
                //            foreach (var slItem in bestStockLocation)
                //            {
                //                stockLocationList.Add(new PdaStockLocationProductInfo(slItem.Text, 0));
                //            }
                //        }

                //        list.Add(new PdaShelfMissionProductInfo(item.ProductId, item.ProductCode, item.ProductName, item.Qty, (int)EnumData.EnumStep.上架, stockLocationList));
                //    }
                //}

                //var data = list.Skip(((model.PageIndex - 1)*model.PageSize)).Take(model.PageSize);

                //return ResResult.Response(true, "", JsonConvert.SerializeObject(data));
            }
            catch (Exception ex)
            {
                return(ResResult.Response(false, ex.Message, ""));
            }
        }