Beispiel #1
0
        protected override void SetDetail(Resolver resolver)
        {
            List <string> flowTypes = new List <string>();

            flowTypes.Add(BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_PRODUCTION);
            bool isHaslocationLotDetail = locationLotDetailMgr.CheckHuLocationExist(resolver.Input);

            if (!isHaslocationLotDetail)
            {
                throw new BusinessErrorException("Hu.Error.NoInventory", resolver.Input);
            }
            Hu       hu       = huMgr.CheckAndLoadHu(resolver.Input);
            FlowView flowView = null;

            //如果是扫描Bin,根据Hu和Bin匹配出flow
            if (resolver.CodePrefix == null || resolver.CodePrefix.Trim() == string.Empty)
            {
                //确定flow和flowView
                flowView = flowMgr.CheckAndLoadFlowView(null, resolver.UserCode, string.Empty, null, hu, flowTypes);
                setBaseMgr.FillResolverByFlow(resolver, flowView.Flow);
            }
            //如果已经确定了Flow
            else
            {
                //根据Flow和Hu匹配出flowView
                flowView = flowMgr.CheckAndLoadFlowView(resolver.Code, null, null, null, hu, flowTypes);
            }
            setDetailMgr.MatchHuByFlowView(resolver, flowView, hu);
        }
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);
        }
Beispiel #3
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);
        }