Ejemplo n.º 1
0
        public ResResultModel GetShelfMissionList(PdaShelfMissionModel model)
        {
            try
            {
                var           bll      = new ShelfMission();
                StringBuilder sqlWhere = null;
                ParamsHelper  parms    = null;

                if (!string.IsNullOrWhiteSpace(model.OrderCode))
                {
                    sqlWhere = new StringBuilder(300);
                    sqlWhere.AppendFormat("and OrderNum like @OrderNum ");
                    var parm = new SqlParameter("@OrderNum", SqlDbType.VarChar, 20);
                    parm.Value = "%" + model.OrderCode + "%";
                    parms      = new ParamsHelper();
                    parms.Add(parm);
                }

                var list = bll.GetList(model.PageIndex, model.PageSize, sqlWhere == null ? "" : sqlWhere.ToString(), parms == null ? null : parms.ToArray());

                return(ResResult.Response(true, "", JsonConvert.SerializeObject(list)));
            }
            catch (Exception ex)
            {
                return(ResResult.Response(false, ex.Message, ""));
            }
        }
Ejemplo n.º 2
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);
        }