Example #1
0
        public void PickList(Resolver resolver)
        {
            PickList pickList = pickListMgr.CheckAndLoadPickList(resolver.Code);

            pickList.PickListDetails = new List <PickListDetail>();
            if (resolver.Transformers != null)
            {
                foreach (Transformer transformer in resolver.Transformers)
                {
                    PickListDetail pickListDetail = pickListDetailMgr.LoadPickListDetail(transformer.Id, true);
                    if (transformer != null)
                    {
                        foreach (TransformerDetail transformerDetail in transformer.TransformerDetails)
                        {
                            if (transformerDetail != null && transformerDetail.HuId != null && transformerDetail.HuId != string.Empty &&
                                transformerDetail.CurrentQty != 0)
                            {
                                PickListResult pickListResult = new PickListResult();
                                //pickListResult.LocationLotDetail = locationLotDetailMgr.LoadLocationLotDetail(transformerDetail.LocationLotDetId);
                                pickListResult.LocationLotDetail = locationLotDetailMgr.CheckLoadHuLocationLotDetail(transformerDetail.HuId);
                                pickListResult.PickListDetail    = pickListDetail;
                                pickListResult.Qty = transformerDetail.CurrentQty * pickListDetail.OrderLocationTransaction.UnitQty;
                                pickListDetail.AddPickListResult(pickListResult);
                            }
                        }
                    }
                    pickList.AddPickListDetail(pickListDetail);
                }
            }
            pickListMgr.DoPick(pickList, resolver.UserCode);
            resolver.Result       = languageMgr.TranslateMessage("MasterData.PickList.Pick.Successfully", resolver.UserCode, resolver.Code);
            resolver.Transformers = null;
            resolver.Command      = BusinessConstants.CS_BIND_VALUE_TRANSFORMER;
        }
Example #2
0
 protected override void SetDetail(Resolver resolver)
 {
     LocationLotDetail locationLotDetail = locationLotDetailMgr.CheckLoadHuLocationLotDetail(resolver.Input, resolver.UserCode);
     TransformerDetail transformerDetail = TransformerHelper.ConvertLocationLotDetailToTransformerDetail(locationLotDetail, false);
     resolver.AddTransformerDetail(transformerDetail);
     resolver.Command = BusinessConstants.CS_BIND_VALUE_TRANSFORMERDETAIL;
 }
Example #3
0
        protected override void SetDetail(Resolver resolver)
        {
            //setDetailMgr.CheckHuInTransformerDetails(resolver);
            LocationLotDetail locationLotDetail = locationLotDetailMgr.CheckLoadHuLocationLotDetail(resolver.Input, resolver.UserCode);

            //Hu hu = locationLotDetail.Hu;
            //hu.Qty = locationLotDetail.Qty / hu.UnitQty;
            if (this.locationMgr.IsHuOcuppyByPickList(resolver.Input))
            {
                throw new BusinessErrorException("Order.Error.PickUp.HuOcuppied", resolver.Input);
            }

            //已经下架
            if (locationLotDetail.StorageBin == null)
            {
                throw new BusinessErrorException("Warehouse.PickUp.Error.IsAlreadyPickUp", resolver.Input);
            }
            TransformerDetail transformerDetail = TransformerHelper.ConvertLocationLotDetailToTransformerDetail(locationLotDetail, false);

            resolver.AddTransformerDetail(transformerDetail);
            //transformerDetail.CurrentQty = transformerDetail.Qty;
            //int maxSeq = setDetailMgr.FindMaxSeq(resolver.Transformers);
            //transformerDetail.Sequence = maxSeq + 1;
            //resolver.Transformers[0].TransformerDetails.Add(transformerDetail);
            //resolver.Command = BusinessConstants.CS_BIND_VALUE_TRANSFORMERDETAIL;
        }
Example #4
0
        protected override void SetDetail(Resolver resolver)
        {
            Hu hu = huMgr.CheckAndLoadHu(resolver.Input);

            if (this.locationMgr.IsHuOcuppyByPickList(resolver.Input))
            {
                throw new BusinessErrorException("Order.Error.PickUp.HuOcuppied", resolver.Input);
            }
            if (resolver.BinCode == string.Empty || resolver.BinCode == null)
            {
                throw new BusinessErrorException("Warehouse.PutAway.PlzScanBin");
            }
            if (hu.StorageBin != null && hu.StorageBin.Trim() != string.Empty && hu.StorageBin == resolver.BinCode)
            {
                throw new BusinessErrorException("Warehouse.PutAway.AlreadyInThisBin");
            }
            //校验Bin
            StorageBin        bin = storageBinMgr.CheckAndLoadStorageBin(resolver.BinCode);
            LocationLotDetail locationLotDetail = locationLotDetailMgr.CheckLoadHuLocationLotDetail(resolver.Input, string.Empty, bin.Area.Location.Code);

            locationLotDetail.NewStorageBin = bin;
            TransformerDetail transformerDetail = TransformerHelper.ConvertLocationLotDetailToTransformerDetail(locationLotDetail, true);

            resolver.AddTransformerDetail(transformerDetail);
        }
Example #5
0
        /// <summary>
        /// 仅校验投料的物料号,库位是否一致,不校验单位单包装等信息
        /// todo:不允许投入的又有数量又有Hu //可以前台控制
        /// </summary>
        /// <param name="resolver"></param>
        protected override void SetDetail(Resolver resolver)
        {
            if (resolver.CodePrefix == string.Empty)
            {
                throw new BusinessErrorException("Common.Business.Error.ScanProductLineFirst");
            }
            LocationLotDetail locationLotDetail = locationLotDetailMgr.CheckLoadHuLocationLotDetail(resolver.Input, resolver.UserCode);
            TransformerDetail transformerDetail = TransformerHelper.ConvertLocationLotDetailToTransformerDetail(locationLotDetail, false);
            var query = resolver.Transformers.Where
                            (t => (t.ItemCode == transformerDetail.ItemCode && t.LocationCode == transformerDetail.LocationCode));

            if (query.Count() < 1)
            {
                throw new BusinessErrorException("Warehouse.HuMatch.NotMatch", transformerDetail.HuId);
            }

            #region 先进先出校验
            Flow flow = flowMgr.CheckAndLoadFlow(resolver.Code);
            if (flow.IsGoodsReceiveFIFO)
            {
                Hu             hu       = huMgr.CheckAndLoadHu(resolver.Input);
                IList <string> huIdList = new List <string>();
                if (resolver.Transformers != null && resolver.Transformers.Count > 0)
                {
                    foreach (Transformer transformer in resolver.Transformers)
                    {
                        if (transformer.TransformerDetails != null && transformer.TransformerDetails.Count > 0)
                        {
                            foreach (TransformerDetail det in transformer.TransformerDetails)
                            {
                                if (det.CurrentQty != decimal.Zero)
                                {
                                    huIdList.Add(det.HuId);
                                }
                            }
                        }
                    }
                }
                string maxLot = setDetailMgr.CheckFIFO(hu, huIdList);
                if (maxLot != string.Empty && maxLot != null)
                {
                    throw new BusinessErrorException("FIFO.ERROR", hu.HuId, maxLot);
                }
            }
            #endregion

            resolver.AddTransformerDetail(transformerDetail);
        }
        private void CreateRepack(Resolver resolver)
        {
            string[]           huIdArr      = resolver.Input.Split(',');
            List <ReceiptNote> receiptNotes = new List <ReceiptNote>();

            foreach (string huId in huIdArr)
            {
                try
                {
                    IList <RepackDetail> repackDetailList  = new List <RepackDetail>();
                    LocationLotDetail    locationLotDetail = locationLotDetailMgr.CheckLoadHuLocationLotDetail(huId);
                    RepackDetail         inRepackDetail    = new RepackDetail();
                    inRepackDetail.LocationLotDetail = locationLotDetail;
                    inRepackDetail.Hu     = locationLotDetail.Hu;
                    inRepackDetail.IOType = BusinessConstants.IO_TYPE_IN;
                    inRepackDetail.Qty    = inRepackDetail.Hu.Qty * inRepackDetail.Hu.UnitQty;
                    repackDetailList.Add(inRepackDetail);

                    RepackDetail outRepackDetail = new RepackDetail();
                    outRepackDetail.itemCode = inRepackDetail.Hu.Item.Code;
                    outRepackDetail.IOType   = BusinessConstants.IO_TYPE_OUT;
                    outRepackDetail.Qty      = inRepackDetail.Qty;
                    repackDetailList.Add(outRepackDetail);

                    Repack repack = repackMgr.CreateDevanning(repackDetailList, userMgr.CheckAndLoadUser(resolver.UserCode));

                    ReceiptNote receiptNote = Repack2ReceiptNote(repack);
                    receiptNotes.Add(receiptNote);
                }

                catch (Exception ex)
                {
                    continue;
                }
            }
            if (resolver.ReceiptNotes == null)
            {
                resolver.ReceiptNotes = receiptNotes;
            }
            else
            {
                IListHelper.AddRange <ReceiptNote>(resolver.ReceiptNotes, receiptNotes);
            }
        }
Example #7
0
 protected override void SetDetail(Resolver resolver)
 {
     if (resolver.CodePrefix == string.Empty)
     {
         throw new BusinessErrorException("Common.Business.Error.ScanFlowFirst");
     }
     if (resolver.ModuleType == BusinessConstants.TRANSFORMER_MODULE_TYPE_PRODUCTIONRECEIVE)
     {
         LocationLotDetail locationLotDetail    = locationLotDetailMgr.CheckLoadHuLocationLotDetail(resolver.Input, resolver.UserCode);
         TransformerDetail newTransformerDetail = TransformerHelper.ConvertLocationLotDetailToTransformerDetail(locationLotDetail, false);
         resolver.AddTransformerDetail(newTransformerDetail);
     }
     else
     {
         setDetailMgr.MatchReceive(resolver);
         if (resolver.BinCode != null && resolver.BinCode != string.Empty)
         {
             resolver.Result = languageMgr.TranslateMessage("Warehouse.CurrentBinCode", resolver.UserCode, resolver.BinCode);
         }
     }
 }
Example #8
0
        protected override void SetDetail(Resolver resolver)
        {
            List <string> flowTypes = new List <string>();

            flowTypes.Add(BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_TRANSFER);
            flowTypes.Add(BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_PROCUREMENT);
            flowTypes.Add(BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_DISTRIBUTION);
            flowTypes.Add(BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_CUSTOMERGOODS);
            Hu hu = huMgr.CheckAndLoadHu(resolver.Input);

            if (this.locationMgr.IsHuOcuppyByPickList(resolver.Input))
            {
                throw new BusinessErrorException("Order.Error.PickUp.HuOcuppied", resolver.Input);
            }

            FlowView flowView = null;

            //移库路线类型退货(退库)可以跟据库格和库位找出相对应的移库路线
            if (resolver.CodePrefix == null || resolver.CodePrefix.Trim() == string.Empty)
            {
                if (resolver.BinCode == null || resolver.BinCode.Trim() == string.Empty)
                {
                    throw new BusinessErrorException("Common.Business.Error.ScanFlowOrStorageBinFirst");
                }
                if (resolver.LocationFormCode == null || resolver.LocationFormCode.Trim() == string.Empty)
                {
                    throw new BusinessErrorException("Common.Business.Error.ScanFlowOrLocationFirst");
                }
                if (hu.Location != null)
                {
                    if (hu.Location != resolver.LocationFormCode)
                    {
                        throw new BusinessErrorException("Common.Business.Error.HuNoInventory", resolver.LocationFormCode, hu.HuId);
                    }
                }
                //确定flow和flowView
                List <string> transferType = new List <string>();
                transferType.Add(BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_TRANSFER);
                flowView = flowMgr.CheckAndLoadFlowView(null, resolver.UserCode, resolver.LocationToCode, resolver.LocationFormCode, hu, transferType);
                setBaseMgr.FillResolverByFlow(resolver, flowView.Flow);
                resolver.Result = resolver.LocationFormCode + " => " + resolver.LocationToCode;
            }

            //已经确定了Flow,匹配新的Hu
            if (resolver.CodePrefix != null && resolver.CodePrefix.Trim() != string.Empty)
            {
                flowView = flowMgr.CheckAndLoadFlowView(resolver.Code, null, null, null, hu, null);
                //退库检查库存
                if ((resolver.OrderType == BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_TRANSFER ||
                     resolver.OrderType == BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_PROCUREMENT ||
                     resolver.OrderType == BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_CUSTOMERGOODS) &&
                    flowView.Flow.IsReceiptScanHu
                    )
                {
                    LocationLotDetail locationLotDetail = locationLotDetailMgr.CheckLoadHuLocationLotDetail(hu.HuId);
                    hu.Qty = locationLotDetail.Qty / hu.UnitQty;
                }
            }
            else
            {
                throw new BusinessErrorException("Common.Business.Error.ScanFlowFirst");
            }
            setDetailMgr.MatchHuByFlowView(resolver, flowView, hu);
        }