Exemplo n.º 1
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);
            }
        }