Exemplo n.º 1
0
 protected override void SetBaseInfo(Resolver resolver)
 {
     if (resolver.BarcodeHead == BusinessConstants.BARCODE_HEAD_BIN)
     {
         setBaseMgr.FillResolverByBin(resolver);
     }
     else if (resolver.BarcodeHead == BusinessConstants.BARCODE_HEAD_LOCATION)
     {
         setBaseMgr.FillResolverByLocation(resolver);
     }
     else if (resolver.BarcodeHead == BusinessConstants.BARCODE_HEAD_FLOW)
     {
         setBaseMgr.FillResolverByFlow(resolver);
         if (resolver.OrderType == BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_PROCUREMENT &&
             resolver.ModuleType == BusinessConstants.TRANSFORMER_MODULE_TYPE_SHIPRETURN)
         {
             throw new BusinessErrorException("Flow.ShipReturn.Error.FlowTypeIsProcurement", resolver.OrderType);
         }
         if (resolver.OrderType == BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_DISTRIBUTION &&
             resolver.ModuleType == BusinessConstants.TRANSFORMER_MODULE_TYPE_RECEIVERETURN)
         {
             throw new BusinessErrorException("Flow.ReceiveReturn.Error.FlowTypeIsDistribution", resolver.OrderType);
         }
     }
     else
     {
         throw new BusinessErrorException("Common.Business.Error.BarCodeInvalid");
     }
 }
Exemplo n.º 2
0
        protected override void SetBaseInfo(Resolver resolver)
        {
            if (resolver.BarcodeHead == BusinessConstants.BARCODE_HEAD_BIN)
            {
                setBaseMgr.FillResolverByBin(resolver);
            }
            else if (resolver.CodePrefix == BusinessConstants.CODE_PREFIX_ORDER)
            {
                resolver.Transformers = null;

                OrderHead orderHead = orderHeadMgr.LoadOrderHead(resolver.Input);

                #region 校验

                if (!partyMgr.CheckPartyPermission(resolver.UserCode, orderHead.PartyTo.Code))
                {
                    throw new BusinessErrorException("Common.Error.NoRegionPermission", orderHead.PartyTo.Code);
                }
                if (orderHead.Status != BusinessConstants.CODE_MASTER_STATUS_VALUE_INPROCESS)
                {
                    throw new BusinessErrorException("Order.Error.StatusErrorWhenReceive", orderHead.Status, orderHead.OrderNo);
                }

                if (orderHead.Type == BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_PRODUCTION)
                {
                    throw new BusinessErrorException("Order.Error.OrderShipIsNotProduction", orderHead.OrderNo, orderHead.Type);
                }
                #endregion
                setBaseMgr.FillResolverByOrder(resolver);
            }
            else if (resolver.CodePrefix == BusinessConstants.CODE_PREFIX_ASN)
            {
                resolver.Transformers = null;


                InProcessLocation ip = inProcessLocationMgr.LoadInProcessLocation(resolver.Input);

                #region 校验

                if (!partyMgr.CheckPartyPermission(resolver.UserCode, ip.PartyTo.Code))
                {
                    throw new BusinessErrorException("Common.Error.NoRegionPermission", ip.PartyTo.Code);
                }
                if (ip.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_CLOSE)
                {
                    throw new BusinessErrorException("InProcessLocation.Error.StatusErrorWhenReceive", ip.Status, ip.IpNo);
                }
                #endregion

                setBaseMgr.FillResolverByASN(resolver);
            }
            else
            {
                throw new TechnicalException("Error BarcodeHead:" + resolver.BarcodeHead + " and CodePrefix:" + resolver.CodePrefix);
            }
        }
Exemplo n.º 3
0
 protected override void SetBaseInfo(Resolver resolver)
 {
     if (resolver.BarcodeHead == BusinessConstants.BARCODE_HEAD_BIN)
     {
         setBaseMgr.FillResolverByBin(resolver);
     }
     else
     {
         throw new BusinessErrorException("Common.Business.Error.BarCodeInvalid");
     }
 }
Exemplo n.º 4
0
 protected override void SetBaseInfo(Resolver resolver)
 {
     if (resolver.BarcodeHead == BusinessConstants.BARCODE_HEAD_BIN)
     {
         setBaseMgr.FillResolverByBin(resolver);
     }
     //暂不支持不扫描物流路线移库到库位
     //else if (resolver.BarcodeHead == BusinessConstants.BARCODE_HEAD_LOCATION)
     //{
     //    setBaseMgr.FillResolverByLocation(resolver);
     //}
     else if (resolver.BarcodeHead == BusinessConstants.BARCODE_HEAD_FLOW)
     {
         setBaseMgr.FillResolverByFlow(resolver);
         if (resolver.OrderType != BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_TRANSFER)
         {
             throw new BusinessErrorException("Flow.Error.FlowTypeIsNotTransfer", resolver.OrderType);
         }
     }
     else
     {
         throw new BusinessErrorException("Common.Business.Error.BarCodeInvalid");
     }
 }
Exemplo n.º 5
0
        protected override void SetBaseInfo(Resolver resolver)
        {
            if (resolver.ModuleType == BusinessConstants.TRANSFORMER_MODULE_TYPE_HUSTATUS)
            {
                return;
            }
            if (resolver.BarcodeHead == BusinessConstants.CODE_PREFIX_CYCCNT)
            {
                CycleCount cycleCount = cycleCountMgr.CheckAndLoadCycleCount(resolver.Input);

                resolver.Code          = cycleCount.Code;
                resolver.Description   = StringHelper.GetCodeDescriptionString(cycleCount.Location.Code, cycleCount.Location.Name);
                resolver.Status        = cycleCount.Status;
                resolver.OrderType     = cycleCount.Type;
                resolver.IsScanHu      = cycleCount.IsScanHu;
                resolver.LocationCode  = cycleCount.Location.Code;
                resolver.Result        = resolver.Description;
                resolver.IsPickFromBin = cycleCount.Location.EnableAdvWM;
                if (!resolver.IsScanHu)
                {
                    throw new BusinessErrorException("CycCnt.Error.IsNotScanHu");
                }

                resolver.WorkingHours = new List <string[]>();
                if (cycleCount.Items != null && cycleCount.Items != string.Empty)
                {
                    resolver.WorkingHours.Add(cycleCount.Items.Split('|'));
                }
                else
                {
                    resolver.WorkingHours.Add(new string[] { });
                }
                if (cycleCount.Bins != null && cycleCount.Bins != string.Empty)
                {
                    resolver.WorkingHours.Add(cycleCount.Bins.Split('|'));
                }
                else
                {
                    resolver.WorkingHours.Add(new string[] { });
                }

                resolver.Command = BusinessConstants.CS_BIND_VALUE_TRANSFORMER;

                if (resolver.Status != BusinessConstants.CODE_MASTER_STATUS_VALUE_INPROCESS)
                {
                    throw new BusinessErrorException("Common.Business.Error.StatusError", resolver.Code, resolver.Status);
                }
            }
            else if (resolver.BarcodeHead == BusinessConstants.BARCODE_HEAD_BIN)
            {
                if (resolver.Code == null || resolver.Code == string.Empty)
                {
                    throw new BusinessErrorException("CycCnt.Error.ScanCycCountFirst");
                }
                //if (!resolver.IsPickFromBin)
                //{
                //    //没有启用高位货架,不用扫描库格
                //    throw new BusinessErrorException("CycCnt.Error.NotEnableAdvWM");
                //}
                IList <StorageBin> storageBinList = storageBinMgr.GetStorageBinByLocation(resolver.LocationCode);
                setBaseMgr.FillResolverByBin(resolver);

                //CycleCount cycleCount = cycleCountMgr.CheckAndLoadCycleCount(resolver.Code);
                var bins = storageBinList.Select(s => s.Code);
                if (!bins.Contains(resolver.BinCode))
                {
                    //库格没有在盘点库位上面
                    throw new BusinessErrorException("CycCnt.Error.BinNotInLocation");
                }
                if (resolver.WorkingHours != null && resolver.WorkingHours.Count == 2)
                {
                    if (resolver.WorkingHours[1] != null && resolver.WorkingHours[1].Length > 0 &&
                        !resolver.WorkingHours[1].Contains(resolver.BinCode))
                    {
                        if (resolver.WorkingHours[1].Length > 0)
                        {
                            throw new BusinessErrorException("CycCnt.Error.NotContainTheBin");
                        }
                    }
                }
                else
                {
                    throw new BusinessErrorException("CycCnt.Error");
                }
            }

            //else if (resolver.BarcodeHead == BusinessConstants.BARCODE_HEAD_LOCATION)
            //{
            //    if (resolver.LocationCode != null && resolver.LocationCode.Trim() != string.Empty)
            //    {
            //        throw new BusinessErrorException("CycCnt.Please.ScanHu");
            //    }
            //    setBaseMgr.FillResolverByLocation(resolver);
            //    resolver.IsScanHu = true;
            //    resolver.BinCode = null;
            //}
            else
            {
                throw new BusinessErrorException("Common.Business.Error.BarCodeInvalid");
            }
        }