Exemplo n.º 1
0
        protected override void SetBaseInfo(Resolver resolver)
        {
            if (resolver.CodePrefix == BusinessConstants.CODE_PREFIX_PICKLIST)
            {
                setBaseMgr.FillResolverByPickList(resolver);

                if (resolver.Status != BusinessConstants.CODE_MASTER_STATUS_VALUE_INPROCESS)
                {
                    throw new BusinessErrorException("Common.Business.Error.StatusError", resolver.Code, resolver.Status);
                }
            }
            else
            {
                throw new BusinessErrorException("Common.Business.Error.BarCodeInvalid");
            }
        }
Exemplo n.º 2
0
        protected override void SetBaseInfo(Resolver resolver)
        {
            if (resolver.CodePrefix == BusinessConstants.CODE_PREFIX_ORDER)
            {
                bool isHasOrderNo = false;
                if (resolver.Transformers != null)
                {
                    foreach (Transformer transformer in resolver.Transformers)
                    {
                        if (transformer.OrderNo == resolver.Code)
                        {
                            isHasOrderNo = true;
                            break;
                        }
                    }
                }
                if (!isHasOrderNo)
                {
                    #region 校验
                    OrderHead orderHead = orderHeadMgr.LoadOrderHead(resolver.Input);
                    if (!partyMgr.CheckPartyPermission(resolver.UserCode, orderHead.PartyFrom.Code))
                    {
                        throw new BusinessErrorException("Common.Error.NoRegionPermission", orderHead.PartyFrom.Code);
                    }

                    if (!orderHead.IsShipByOrder && resolver.ModuleType == BusinessConstants.TRANSFORMER_MODULE_TYPE_SHIPORDER)
                    {
                        throw new BusinessErrorException("Order.Error.NotShipByOrder", orderHead.OrderNo);
                    }

                    if (orderHead.Status != BusinessConstants.CODE_MASTER_STATUS_VALUE_INPROCESS)
                    {
                        throw new BusinessErrorException("Common.Business.Error.StatusError", orderHead.OrderNo, orderHead.Status);
                    }

                    if (orderHead.Type != BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_PROCUREMENT &&
                        orderHead.Type != BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_DISTRIBUTION &&
                        orderHead.Type != BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_TRANSFER)
                    {
                        throw new BusinessErrorException("Order.Error.OrderShipIsNotProduction", orderHead.OrderNo, orderHead.Type);
                    }
                    #endregion

                    setBaseMgr.FillResolverByOrder(resolver);
                }
            }
            else if (resolver.CodePrefix == BusinessConstants.CODE_PREFIX_PICKLIST)
            {
                resolver.Transformers = null;

                PickList pickList = pickListMgr.LoadPickList(resolver.Input);
                if (!partyMgr.CheckPartyPermission(resolver.UserCode, pickList.PartyFrom.Code))
                {
                    throw new BusinessErrorException("Common.Error.NoRegionPermission", pickList.PartyFrom.Code);
                }

                if (pickList.Status != BusinessConstants.CODE_MASTER_STATUS_VALUE_INPROCESS)
                {
                    throw new BusinessErrorException("Common.Business.Error.StatusError", pickList.PickListNo, pickList.Status);
                }

                setBaseMgr.FillResolverByPickList(resolver);
            }
            else
            {
                throw new BusinessErrorException("Common.Business.Error.BarCodeInvalid");
            }
        }