/// <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);
        }
Beispiel #2
0
        /// <summary>
        /// 只有发货扫描条码才支持不扫物流路线,扫描库格移库
        /// </summary>
        /// <param name="resolver"></param>
        protected override void SetDetail(Resolver resolver)
        {
            List <string> flowTypes = new List <string>();

            flowTypes.Add(BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_TRANSFER);
            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 (hu.Location != null && hu.Location.Contains("MLAT") && hu.IsInspect == false)
            {
                throw new BusinessErrorException("Hu.Error.HuIdNotInspect", resolver.Input);
            }


            if (resolver.CodePrefix != null && resolver.CodePrefix.Trim() != string.Empty)
            {
                flowView = flowMgr.CheckAndLoadFlowView(resolver.Code, null, null, null, hu, flowTypes);
            }
            else
            {
                if (resolver.BinCode == null || resolver.BinCode == string.Empty)
                {
                    throw new BusinessErrorException("Common.Business.Error.ScanFlowOrStorageBinFirst");
                }
                else
                {
                    flowView = flowMgr.CheckAndLoadFlowView(null, resolver.UserCode, hu.Location, resolver.LocationToCode, hu, flowTypes);
                    setBaseMgr.FillResolverByFlow(resolver, flowView.Flow);
                }
            }

            #region 先进先出校验
            if (flowView.Flow.IsGoodsReceiveFIFO)
            {
                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 minLot = setDetailMgr.CheckFIFO(hu, huIdList);
                if (minLot != string.Empty && minLot != null)
                {
                    throw new BusinessErrorException("FIFO.ERROR", hu.HuId, minLot);
                }
            }
            #endregion

            setDetailMgr.MatchHuByFlowView(resolver, flowView, hu);
        }