Exemplo n.º 1
0
        public void FillResolverByOrder(Resolver resolver)
        {
            User      user      = userMgr.CheckAndLoadUser(resolver.UserCode);
            OrderHead orderHead = orderHeadMgr.CheckAndLoadOrderHead(resolver.Input);
            Flow      flow      = this.flowMgr.LoadFlow(orderHead.Flow);

            //if (!user.HasPermission(orderHead.PartyFrom.Code) ||
            //    !user.HasPermission(orderHead.PartyTo.Code))
            //{
            //    throw new BusinessErrorException("Common.Business.Error.NoPermission");
            //}
            #region CopyProperty from OrderHead
            resolver.Code             = orderHead.OrderNo;
            resolver.Description      = flow.Description;
            resolver.Status           = orderHead.Status;
            resolver.OrderType        = orderHead.Type;
            resolver.NeedPrintAsn     = orderHead.NeedPrintAsn;
            resolver.NeedPrintReceipt = orderHead.NeedPrintReceipt;
            resolver.AutoPrintHu      = orderHead.AutoPrintHu && (orderHead.CreateHuOption != BusinessConstants.CODE_MASTER_CREATE_HU_OPTION_VALUE_NONE);
            resolver.AllowExceed      = orderHead.AllowExceed;
            resolver.OrderType        = orderHead.Type;
            resolver.AntiResolveHu    = orderHead.AntiResolveHu;
            resolver.IsOddCreateHu    = orderHead.IsOddCreateHu;
            resolver.IsPickFromBin    = orderHead.IsPickFromBin;
            resolver.FulfillUnitCount = orderHead.FulfillUnitCount;
            resolver.IsShipByOrder    = orderHead.IsShipByOrder;
            if (resolver.ModuleType == BusinessConstants.TRANSFORMER_MODULE_TYPE_RECEIVE)
            {
                resolver.IsScanHu = orderHead.IsReceiptScanHu;
            }
            else if (resolver.ModuleType == BusinessConstants.TRANSFORMER_MODULE_TYPE_SHIP ||
                     resolver.ModuleType == BusinessConstants.TRANSFORMER_MODULE_TYPE_SHIPORDER)
            {
                resolver.IsScanHu = orderHead.IsShipScanHu;
            }
            #endregion
        }
Exemplo n.º 2
0
        /// <summary>
        /// 校验订单配置选项,是否允许同时发货
        /// </summary>
        /// <param name="orderNo"></param>
        /// <param name="originalOrderNo"></param>
        private void CheckOrderConfigValid(string orderNo, string originalOrderNo)
        {
            OrderHead originalOrderHead = orderHeadMgr.CheckAndLoadOrderHead(originalOrderNo);
            OrderHead orderHead         = orderHeadMgr.CheckAndLoadOrderHead(orderNo);
            Flow      flow         = this.flowMgr.LoadFlow(orderHead.Flow);
            Flow      originalFlow = this.flowMgr.LoadFlow(originalOrderHead.Flow);

            #region 合并发货校验
            if (flow.Code != originalFlow.Code || flow.Type != originalFlow.Type)
            {
                throw new BusinessErrorException("Order.Error.ShipOrder.OrderTypeNotEqual");
            }

            if (orderHead.PartyFrom.Code != originalOrderHead.PartyFrom.Code)
            {
                throw new BusinessErrorException("Order.Error.ShipOrder.PartyFromNotEqual");
            }

            if (orderHead.PartyTo.Code != originalOrderHead.PartyTo.Code)
            {
                throw new BusinessErrorException("Order.Error.ShipOrder.PartyToNotEqual");
            }

            string shipFromCode         = orderHead.ShipFrom != null ? orderHead.ShipFrom.Code : string.Empty;
            string originalShipFromCode = originalOrderHead.ShipFrom != null ? originalOrderHead.ShipFrom.Code : string.Empty;
            if (shipFromCode != originalShipFromCode)
            {
                throw new BusinessErrorException("Order.Error.ShipOrder.ShipFromNotEqual");
            }

            string shipToCode         = orderHead.ShipTo != null ? orderHead.ShipTo.Code : string.Empty;
            string originalShipToCode = originalOrderHead.ShipTo != null ? originalOrderHead.ShipTo.Code : string.Empty;
            if (shipToCode != originalShipToCode)
            {
                throw new BusinessErrorException("Order.Error.ShipOrder.ShipToNotEqual");
            }

            string routingCode         = orderHead.Routing != null ? orderHead.Routing.Code : string.Empty;
            string originalRoutingCode = originalOrderHead.Routing != null ? originalOrderHead.Routing.Code : string.Empty;
            if (routingCode != originalRoutingCode)
            {
                throw new BusinessErrorException("Order.Error.ShipOrder.RoutingNotEqual");
            }

            if (orderHead.IsShipScanHu != originalOrderHead.IsShipScanHu)
            {
                throw new BusinessErrorException("Order.Error.ShipOrder.IsShipScanHuNotEqual");
            }

            if (orderHead.IsReceiptScanHu != originalOrderHead.IsReceiptScanHu)
            {
                throw new BusinessErrorException("Order.Error.ShipOrder.IsReceiptScanHuNotEqual");
            }

            if (orderHead.IsAutoReceive != originalOrderHead.IsAutoReceive)
            {
                throw new BusinessErrorException("Order.Error.ShipOrder.IsAutoReceiveNotEqual");
            }

            if (orderHead.GoodsReceiptGapTo != originalOrderHead.GoodsReceiptGapTo)
            {
                throw new BusinessErrorException("Order.Error.ShipOrder.GoodsReceiptGapToNotEqual");
            }
            if (orderHead.AntiResolveHu != originalOrderHead.AntiResolveHu)
            {
                throw new BusinessErrorException("Order.Error.ShipOrder.AntiResolveHuNotEqual");
            }
            #endregion
        }