Exemple #1
0
        private void StartOrder(Resolver resolver)
        {
            if (resolver.CodePrefix == BusinessConstants.CODE_PREFIX_ORDER)
            {
                setBaseMgr.FillResolverByOrder(resolver);

                #region 校验
                if (resolver.Status != BusinessConstants.CODE_MASTER_STATUS_VALUE_SUBMIT)
                {
                    throw new BusinessErrorException("Common.Business.Error.StatusError", resolver.Code, resolver.Status);
                }

                if (resolver.OrderType != BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_PRODUCTION)
                {
                    throw new BusinessErrorException("Order.Error.OrderOfflineIsNotProduction", resolver.Code, resolver.OrderType);
                }
                #endregion

                orderMgr.StartOrder(resolver.Input, resolver.UserCode);
                resolver.Result = DateTime.Now.ToString("HH:mm:ss");
                resolver.Code   = resolver.Input;
            }
            else
            {
                throw new BusinessErrorException("Common.Business.Error.BarCodeInvalid");
            }
        }
Exemple #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);
            }
        }
Exemple #3
0
        protected override void SetBaseInfo(Resolver resolver)
        {
            if (resolver.CodePrefix == BusinessConstants.CODE_PREFIX_ORDER)
            {
                setBaseMgr.FillResolverByOrder(resolver);

                #region 校验
                if (resolver.Status != BusinessConstants.CODE_MASTER_STATUS_VALUE_INPROCESS)
                {
                    throw new BusinessErrorException("Common.Business.Error.StatusError", resolver.Code, resolver.Status);
                }

                if (resolver.OrderType != BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_PRODUCTION)
                {
                    throw new BusinessErrorException("Order.Error.OrderOfflineIsNotProduction", resolver.Code, resolver.OrderType);
                }
                #endregion
            }
            else
            {
                throw new BusinessErrorException("Common.Business.Error.BarCodeInvalid");
            }
        }
Exemple #4
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");
            }
        }