コード例 #1
0
        public ActionResult MoveBillDetailEdit(MoveBillDetail moveBillDetail)
        {
            string strResult = string.Empty;
            bool   bResult   = MoveBillDetailService.Save(moveBillDetail, out strResult);
            string msg       = bResult ? "修改成功" : "修改失败";

            return(Json(JsonMessageHelper.getJsonMessage(bResult, msg, strResult), "text", JsonRequestBehavior.AllowGet));
        }
コード例 #2
0
        public bool GeneratePalletTag(string billNo, ref string strResult)
        {
            bool result = false;
            var  mbms   = MoveBillMasterRepository.GetQueryable().Where(p => billNo.Contains(p.BillNo));
            IEnumerable <MoveBillDetail> tempDetails = new MoveBillDetail[] { };

            foreach (var mbm in mbms)
            {
                tempDetails = tempDetails.Concat(mbm.MoveBillDetails);
            }

            decimal i = 0;
            int     j = 1;

            var details = tempDetails.Where(d => (d.Product.AbcTypeCode == "2" || d.Product.AbcTypeCode == "3") &&
                                            d.RealQuantity != (d.InCell.MaxQuantity * d.Unit.Count) &&
                                            d.InCell.Area.AreaType != "3")
                          .OrderBy(d => d.OutCellCode)
                          .ToArray();

            foreach (var detail in details)
            {
                if (detail.PalletTag == null)
                {
                    if (detail.RealQuantity + i < 300000)
                    {
                        detail.PalletTag = j;
                        i += detail.RealQuantity;
                    }
                    else
                    {
                        detail.PalletTag = ++j;
                        i = detail.RealQuantity;
                    }
                }
                else
                {
                    strResult = "当前订单已组盘!";
                    return(true);
                }
            }

            MoveBillMasterRepository.SaveChanges();
            result = true;
            return(result);
        }
コード例 #3
0
ファイル: MoveBillCreater.cs プロジェクト: windygu/wms_rfid
 public void AddToMoveBillDetail(MoveBillMaster moveBillMaster, Storage sourceStorage, Storage targetStorage, decimal moveQuantity)
 {
     if (moveQuantity > 0)
     {
         Locker.LockKey = moveBillMaster.BillNo;
         MoveBillDetail detail = new MoveBillDetail();
         detail.BillNo         = moveBillMaster.BillNo;
         detail.ProductCode    = sourceStorage.ProductCode;
         detail.OutCellCode    = sourceStorage.CellCode;
         detail.OutStorageCode = sourceStorage.StorageCode;
         detail.InCellCode     = targetStorage.CellCode;
         detail.InStorageCode  = targetStorage.StorageCode;
         detail.UnitCode       = sourceStorage.Product.UnitCode;
         detail.RealQuantity   = moveQuantity;
         detail.Status         = "0";
         moveBillMaster.MoveBillDetails.Add(detail);
         sourceStorage.OutFrozenQuantity += moveQuantity;
         targetStorage.ProductCode        = sourceStorage.ProductCode;
         targetStorage.InFrozenQuantity  += moveQuantity;
     }
 }