Example #1
0
        public void StartPickList(string pickListNo, User user)
        {
            PickList pickList = this.CheckAndLoadPickList(pickListNo);

            PickListHelper.CheckAuthrize(pickList, user);

            if (pickList.Status != BusinessConstants.CODE_MASTER_STATUS_VALUE_SUBMIT)
            {
                throw new BusinessErrorException("Order.Error.PickUp.StatusErrorWhenStart", pickList.Status, pickList.PickListNo);
            }

            #region 检查MaxOnlineQty
            Flow flow = this.flowMgr.LoadFlow(pickList.Flow);
            if (flow != null && flow.MaxOnlineQty > 0 &&
                this.GetInPorcessPickListCount(pickList.Flow, user) >= flow.MaxOnlineQty)
            {
                throw new BusinessErrorException("Order.Error.PickUp.ExcceedMaxOnlineQty");
            }
            #endregion

            DateTime dateTimeNow = DateTime.Now;
            pickList.Status         = BusinessConstants.CODE_MASTER_STATUS_VALUE_INPROCESS;
            pickList.StartDate      = dateTimeNow;
            pickList.StartUser      = user;
            pickList.LastModifyDate = dateTimeNow;
            pickList.LastModifyUser = user;

            this.UpdatePickList(pickList);
        }
Example #2
0
        public void CancelPickList(string pickListNo, User user)
        {
            PickList pickList = this.LoadPickList(pickListNo);

            PickListHelper.CheckAuthrize(pickList, user);

            if (pickList.Status != BusinessConstants.CODE_MASTER_STATUS_VALUE_SUBMIT)
            {
                throw new BusinessErrorException("Order.Error.PickUp.StatusErrorWhenCancel", pickList.Status, pickList.PickListNo);
            }

            pickList.Status         = BusinessConstants.CODE_MASTER_STATUS_VALUE_CANCEL;
            pickList.LastModifyDate = DateTime.Now;
            pickList.LastModifyUser = user;

            this.UpdatePickList(pickList);
        }
Example #3
0
        public void DeletePickList(string pickListNo, User user)
        {
            PickList oldPickList = this.LoadPickList(pickListNo, true);

            PickListHelper.CheckAuthrize(oldPickList, user);

            if (oldPickList.Status != BusinessConstants.CODE_MASTER_STATUS_VALUE_CREATE)
            {
                throw new BusinessErrorException("Order.Error.PickUp.StatusErrorWhenDelete", oldPickList.Status, oldPickList.PickListNo);
            }

            foreach (PickListDetail pickListDetail in oldPickList.PickListDetails)
            {
                pickListDetailMgr.DeletePickListDetail(pickListDetail);
            }

            this.DeletePickList(pickListNo);
        }
Example #4
0
        public void FillResolverByPickList(Resolver resolver)
        {
            PickList pickList = pickListMgr.CheckAndLoadPickList(resolver.Input);
            User     user     = userMgr.CheckAndLoadUser(resolver.UserCode);

            PickListHelper.CheckAuthrize(pickList, user);

            resolver.Code   = pickList.PickListNo;
            resolver.Status = pickList.Status;
            resolver.PickBy = pickList.PickBy;
            if (pickList.PickListDetails != null && pickList.PickListDetails.Count > 0)
            {
                resolver.NeedPrintAsn  = pickList.PickListDetails[0].OrderLocationTransaction.OrderDetail.OrderHead.NeedPrintAsn;
                resolver.IsPickFromBin = pickList.PickListDetails[0].OrderLocationTransaction.OrderDetail.OrderHead.IsPickFromBin;
            }
            //resolver.IsDetailContainHu = true;
            resolver.IsScanHu  = true;//目前只有支持Hu才支持拣货
            resolver.OrderType = pickList.OrderType;
        }
Example #5
0
        public void DoPick(PickList pickList, User user)
        {
            PickList oldPickList = this.LoadPickList(pickList.PickListNo);

            PickListHelper.CheckAuthrize(oldPickList, user);

            if (oldPickList.Status != BusinessConstants.CODE_MASTER_STATUS_VALUE_INPROCESS)
            {
                throw new BusinessErrorException("Order.Error.PickUp.StatusErrorWhenPick", oldPickList.Status, oldPickList.PickListNo);
            }

            //检查是否有pickListResult
            int resultCount = 0;

            foreach (PickListDetail pickListDetail in pickList.PickListDetails)
            {
                foreach (PickListResult pickListResult in pickListDetail.PickListResults)
                {
                    if (pickListResult.Id == 0)
                    {
                        resultCount++;
                        break;
                    }
                }
            }

            if (resultCount == 0)
            {
                throw new BusinessErrorException("MasterData.No.PickListResult");
            }

            foreach (PickListDetail pickListDetail in pickList.PickListDetails)
            {
                foreach (PickListResult pickListResult in pickListDetail.PickListResults)
                {
                    if (pickListResult.Id > 0)
                    {
                        continue;
                    }

                    #region 检查捡货项是否已经被其它捡货单占用
                    if (this.locationMgr.IsHuOcuppyByPickList(pickListResult.LocationLotDetail.Hu.HuId))
                    {
                        throw new BusinessErrorException("Order.Error.PickUp.HuOcuppied", pickListResult.LocationLotDetail.Hu.HuId);
                    }
                    #endregion

                    pickListResultMgr.CreatePickListResult(pickListResult);

                    #region  架
                    if (pickListResult.LocationLotDetail.StorageBin != null)
                    {
                        this.locationMgr.InventoryPick(pickListResult.LocationLotDetail, user);
                    }
                    #endregion
                }
            }

            oldPickList.LastModifyDate = DateTime.Now;
            oldPickList.LastModifyUser = user;

            this.UpdatePickList(oldPickList);
        }