示例#1
0
        public static void Execute(XElement loopTag, Exchange exchange, Route route)
        {
            var expressionTag = loopTag.Elements().FirstOrDefault();

            if (expressionTag == null || (expressionTag.Name != "count"))
            {
                return;
            }

            var xpression = expressionTag.Value;
            var count     = SimpleExpression.ResolveSpecifiedUriPart(xpression, exchange);

            var mCount = Convert.ToInt32(count);

            for (var i = 0; i < mCount; i++)
            {
                var data = loopTag.Elements().Skip(1);
                foreach (var dataItem in data)
                {
                    try
                    {
                        RouteStep.ExecuteRouteStep(dataItem, route, exchange);
                    }
                    catch (Exception exception)
                    {
                    }
                }
            }
        }
示例#2
0
        public async Task <ActionResult> Save(RouteStepViewModel model)
        {
            using (RouteStepServiceClient client = new RouteStepServiceClient())
            {
                RouteStep obj = new RouteStep()
                {
                    Key = new RouteStepKey()
                    {
                        RouteName     = model.RouteName,
                        RouteStepName = model.RouteStepName
                    },
                    DefectReasonCodeCategoryName = model.DefectReasonCodeCategoryName,
                    Duration = model.Duration,
                    ScrapReasonCodeCategoryName = model.ScrapReasonCodeCategoryName,
                    SortSeq            = model.SortSeq,
                    RouteOperationName = model.RouteStepName,
                    Description        = model.Description,
                    Editor             = User.Identity.Name,
                    EditTime           = DateTime.Now,
                    CreateTime         = DateTime.Now,
                    Creator            = User.Identity.Name
                };
                MethodReturnResult rst = await client.AddAsync(obj);

                if (rst.Code == 0)
                {
                    rst.Message = string.Format(FMMResources.StringResource.RouteStep_Save_Success
                                                , obj.Key);
                }
                return(Json(rst));
            }
        }
示例#3
0
        public override Ship Navigate(RouteStep step)
        {
            switch (step)
            {
            case North:
            case South:
            case East:
            case West:
                waypoint.Navigate(step);
                break;

            case Left left:
                logger.LogTrace($"Rotating Left {left.Value}");
                RotateWayPoint(-left.Value);
                break;

            case Right right:
                logger.LogTrace($"Rotating Right {right.Value}");
                RotateWayPoint(right.Value);
                break;

            case Forward forward:
                logger.LogTrace($"Looping forward {forward.Value} times.");
                var(Position, _) = new ToWaypoint(forward.Value).Run(this);
                this.Position    = Position;
                break;

            default:
                throw new NotSupportedException($"{step} is not a supported type.");
            }

            return(this);
        }
        public RouteBuilder From(string uri)
        {
            var node = new XElement("from", new XAttribute("uri", uri));
            var step = new RouteStep(node, route);

            route.RouteProcess = step;
            nextRouteStepProcessorToLink = route.RouteProcess;
            return this;
        }
示例#5
0
        public virtual Ship Navigate(RouteStep step)
        {
            var destination = step.Run(this);

            Position = destination.Position;
            Rotation = (360 + destination.Rotation) % 360;
            logger.LogTrace($"{step}");
            logger.LogTrace($"`-{Position} Rotation: {Rotation}");
            return(this);
        }
        public void should_have_correct_steps()
        {
            var expected = new[]
            {
                new UpRouteStep(),
                new DownRouteStep(),
                RouteStep.MoveOneGridSpace()
            };
            var route = Route.From(expected);

            Assert.That(_route, Is.EqualTo(route));
        }
示例#7
0
        public IActionResult AddRouteStep(int routeId, int beaconId, int step)
        {
            var routeStep = new RouteStep
            {
                RouteId  = routeId,
                BeaconId = beaconId,
                Step     = step
            };

            context.RouteSteps.Add(routeStep);
            context.SaveChanges();
            return(RedirectToAction("EditRoute", new { id = routeId }));
        }
 public Arena Parse(string[] input)
 {
     Input = input;
     return(Arena.From(GridSize.From(5, 5),
                       new[]
     {
         Robot.From(Position.From(0, 0, CardinalCompassPoint.North()),
                    Route.From(new[]
         {
             RouteStep.RotateRight90Degrees(),
             RouteStep.MoveOneGridSpace(),
             RouteStep.RotateLeft90Degrees()
         }))
     }
                       ));
 }
        /// <summary>
        /// Digest Route Information
        /// </summary>
        private void Exec(XElement routeElement)
        {
            if (routeElement == null)
            {
                return;
            }

            try
            {
                var description = XmlDataUtil.Attribute <string>(routeElement, TagConstant.Description);
                var routeObj    = new Route {
                    Description = description, PackageDescriptor = _packageDescriptor
                };
                RouteStep nextRouteStepProcessorToLink = null;

                //read all steps in route
                foreach (var xmlStep in routeElement.Elements())
                {
                    if (routeObj.CurrentRouteStep == null)
                    {
                        routeObj.CurrentRouteStep    = new RouteStep(xmlStep, routeObj);
                        nextRouteStepProcessorToLink = routeObj.CurrentRouteStep;
                    }
                    else
                    {
                        var nextStep = new RouteStep(xmlStep, routeObj);
                        if (nextRouteStepProcessorToLink == null)
                        {
                            continue;
                        }

                        nextRouteStepProcessorToLink.NextRouteStep = nextStep;
                        nextRouteStepProcessorToLink = nextRouteStepProcessorToLink.NextRouteStep;
                    }
                }

                //add route for execution
                SynapseContext.SetRoute(routeObj);
            }
            catch (Exception exception)
            {
                var msg = exception.Message;
            }
        }
示例#10
0
        private static RouteInfoStep AddInfoStepFromStep(RouteStep step)
        {
            RouteInfoStep infoStep = new RouteInfoStep
            {
                Intersections = new List <RouteInfoIntersection>(),
                Distance      = step.Distance,
                Duration      = step.Duration,
                Mode          = step.Mode,
                Name          = step.Name,
                Geometry      = ConvertLocationsToGeocoordinates(step.Geometry.ToList()),
                Maneuver      = ConvertRouteInfoManeuverFromManeuver(step.Maneuver)
            };

            foreach (StepIntersection stepIntersection in step.Intersections)
            {
                infoStep.Intersections.Add(AddInfoIntersectionFromIntersection(stepIntersection));
            }
            return(infoStep);
        }
        public static void Process(XElement multicastElement, Exchange exchange)
        {
            try
            {
                var toElements = multicastElement.Elements("to");
                var xElements  = toElements as XElement[] ?? toElements.ToArray();
                if (!xElements.Any())
                {
                    return;
                }

                foreach (var toTag in xElements)
                {
                    RouteStep.ExecuteRouteStep(toTag, exchange.Route, exchange);
                }
            }
            catch (Exception exception)
            {
            }
        }
        public void should_have_correct_steps()
        {
            var expected = new[]
            {
                RouteStep.RotateLeft90Degrees(),
                RouteStep.RotateRight90Degrees(),
                RouteStep.MoveOneGridSpace(),
                RouteStep.RotateRight90Degrees(),
                RouteStep.RotateLeft90Degrees(),
                RouteStep.MoveOneGridSpace(),
                RouteStep.MoveOneGridSpace(),
                RouteStep.RotateRight90Degrees(),
                RouteStep.MoveOneGridSpace(),
                RouteStep.RotateLeft90Degrees(),
                RouteStep.MoveOneGridSpace()
            };
            var route = Route.From(expected);

            Assert.That(_route, Is.EqualTo(route));
        }
        public RouteBuilder To(string uri)
        {
            var node = new XElement("to", new XAttribute("uri", uri));

            if (route.RouteProcess == null)
            {
                route.RouteProcess = new RouteStep(node, route);
                nextRouteStepProcessorToLink = route.RouteProcess;
            }
            else
            {
                var nextStep = new RouteStep(node, route);
                if (nextRouteStepProcessorToLink == null)
                    return this;

                nextRouteStepProcessorToLink.NextTag = nextStep;
                nextRouteStepProcessorToLink = nextRouteStepProcessorToLink.NextTag;
            }

            return this;
        }
        public static void DoWhen(XElement choicElement, Exchange exchange)
        {
            var whenElements = choicElement.Elements("when");
            var passed       = false;

            foreach (var whenElement in whenElements)
            {
                passed = CheckRequiremnt(whenElement, exchange);
                if (!passed)
                {
                    continue;
                }

                var functions = whenElement.Elements().Skip(1);
                foreach (var xmlStep in functions)
                {
                    RouteStep.ExecuteRouteStep(xmlStep, exchange.Route, exchange);
                }
                break;
            }

            if (!passed)
            {
                //handle otherwise
                var otherwiseXml = choicElement.Element("otherwise");
                if (otherwiseXml == null)
                {
                    return;
                }

                var otherwiseFunctions = otherwiseXml.Elements();

                foreach (var xmlStep in otherwiseFunctions)
                {
                    RouteStep.ExecuteRouteStep(xmlStep, exchange.Route, exchange);
                }
            }
        }
        public void should_have_correct_gridsize_and_robots()
        {
            var expected = Arena.From
                               (GridSize.From(5, 6),
                               new[]
            {
                Robot.From
                    (Position.From(0, 1, CardinalCompassPoint.North()),
                    Route.From(new[]
                {
                    RouteStep.RotateRight90Degrees(),
                    RouteStep.MoveOneGridSpace(),
                    RouteStep.RotateLeft90Degrees(),
                    RouteStep.MoveOneGridSpace(),
                    RouteStep.RotateRight90Degrees(),
                    RouteStep.MoveOneGridSpace(),
                    RouteStep.RotateLeft90Degrees(),
                    RouteStep.MoveOneGridSpace()
                }))
            });

            Assert.That(_arena, Is.EqualTo(expected));
        }
        private async Task <PositionDto> GetNextPositionAsync(PositionDto currentPosition, RouteStep routeStep)
        {
            PositionDto nextPosition = null;

            switch (routeStep)
            {
            case RouteStep.F:
            {
                nextPosition = await MoveForwardAsync(currentPosition);

                break;
            }

            case RouteStep.B:
            {
                nextPosition = await MoveBackwardAsync(currentPosition);

                break;
            }

            case RouteStep.L:
            {
                nextPosition = await TurnLeftAsync(currentPosition);

                break;
            }

            case RouteStep.R:
            {
                nextPosition = await TurnRightAsync(currentPosition);

                break;
            }
            }

            return(nextPosition);
        }
 public RouteStep Resolve(char input)
 {
     return(input == 'M' ? RouteStep.MoveOneGridSpace() : null);
 }
 public RouteStep Resolve(char input)
 {
     return(input == 'L' ? RouteStep.RotateLeft90Degrees() : null);
 }
示例#19
0
 /// <summary>
 /// Method that will Update the RouteStep passed in the parameters to the database
 /// </summary>
 /// <param name="routeStep">Object RouteStep to Update</param>
 public void Update(RouteStep routeStep)
 {
     _context.Routesteps.Update(routeStep);
     _context.SaveChanges();
 }
示例#20
0
 /// <summary>
 /// Method to Add the RouteStep passed in the parameters to the database
 /// </summary>
 /// <param name="routeStep">Object RouteStep to Add</param>
 public void Add(RouteStep routeStep)
 {
     _context.Routesteps.Add(routeStep);
     _context.SaveChanges();
 }
示例#21
0
        /// <summary>
        /// ProcessChannel
        /// </summary>
        /// <param name="splitElement"></param>
        /// <param name="exchange"></param>
        public static void Execute(XElement splitElement, Exchange exchange)
        {
            try
            {
                if (splitElement == null)
                {
                    return;
                }

                var spliterXml = splitElement.Elements().FirstOrDefault();
                if (spliterXml == null)
                {
                    return;
                }

                ISplitterStrategy strategy = null;
                var strategyAttr           = splitElement.Attribute("strategy");

                if (strategyAttr != null)
                {
                    strategy = SynapseContext.LoadBean(strategyAttr.Value.ToString(CultureInfo.InvariantCulture)) as ISplitterStrategy;
                }

                var result = new List <String>();
                if (strategy != null)
                {
                    result = strategy.Split(exchange);
                }
                else
                {
                    var splitterName = spliterXml.Name.ToString();
                    switch (splitterName)
                    {
                    case "xpath":
                        result = SplitByXPath(spliterXml.Value, exchange);
                        break;

                    case "simple":
                        result = SplitSimple(spliterXml.Value, exchange);
                        break;
                    }
                }

                if (result == null)
                {
                    return;
                }

                var nextSteps = strategy == null?splitElement.Elements().Skip(1) : splitElement.Elements();

                //process each
                foreach (var nextStep in nextSteps)
                {
                    try
                    {
                        //hold original message
                        var originalMessage = exchange.InMessage.Body;
                        foreach (var item in result)
                        {
                            var exchangeMsg = item;

                            var splitterExchange = exchange.CloneExchange(new Message
                            {
                                Body             = exchangeMsg,
                                HeaderCollection = exchange.InMessage.HeaderCollection
                            },
                                                                          new Message(),
                                                                          exchange.Route);

                            RouteStep.ExecuteRouteStep(nextStep, exchange.Route, splitterExchange);
                        }
                        //restore original message
                        exchange.InMessage.Body = originalMessage;
                    }
                    catch (Exception exception)
                    {
                    }
                }
            }
            catch (Exception exception)
            {
            }
        }
示例#22
0
        public async Task GenerateCastlesAsync(string id, GenerateCastleData castles)
        {
            var game = await Build(new Guid(id), string.Empty, -1);

            foreach (CastleModel t in castles.Castles)
            {
                AddCastleEvent addCastleEvent = new AddCastleEvent(t.OwnerUserId);
                t.Id = addCastleEvent.Id.ToString();
                InitCastleEvent init = Mapper.Map <InitCastleEvent>(t);
                init.Id        = addCastleEvent.Id;
                init.CreatedBy = init.OwnerUserId;
                var gameId = new Guid(id);

                _domain.AddEvent(gameId, addCastleEvent, init);
            }
            //var reveuneEv = _gameDomainService.RevenueCoinEvent(game.Speed);
            //reveuneEv.RunningAt = reveuneEv.ExecuteAt = DateTime.UtcNow;
            //_domain.AddEvent(game.Id, reveuneEv, _gameDomainService.UpkeepCoinEvent(game.Speed));
            var gameEntity = await _gameRepository.GetByIdAsync(id);

            gameEntity.Castles = castles.Castles.Select(e => e.Id).ToList();
            gameEntity.Routes  = new List <CastleRoute>();
            foreach (var route in castles.Routes)
            {
                var formattedRoute = new CastleRoute()
                {
                    FromCastle = route.FromCastle.Id,
                    ToCastle   = route.ToCastle.Id,
                    Route      = new Route()
                    {
                        Distance = route.Route.Distance,
                        Duration = route.Route.Duration,
                        Steps    = new List <RouteStep>()
                    }
                };
                var positions = new List <Position>();
                positions.Add(new Position()
                {
                    Lat = route.FromCastle.Position.Lat,
                    Lng = route.FromCastle.Position.Lng
                });
                foreach (var step in route.Route.Steps)
                {
                    var startPos = new Position()
                    {
                        Lat = step.StartLocation.Lat,
                        Lng = step.StartLocation.Lng
                    };
                    var endPos = new Position()
                    {
                        Lat = step.EndLocation.Lat,
                        Lng = step.EndLocation.Lng
                    };
                    if (!positions.Any(e => e.Lat == startPos.Lat && e.Lng == startPos.Lng))
                    {
                        positions.Add(startPos);
                    }
                    if (!positions.Any(e => e.Lat == endPos.Lat && e.Lng == endPos.Lng))
                    {
                        positions.Add(endPos);
                    }
                    var formattedStep = new RouteStep()
                    {
                        StartLocation = startPos,
                        EndLocation   = endPos,
                        Distance      = step.Distance,
                        Duration      = step.Duration
                    };
                    formattedRoute.Route.Steps.Add(formattedStep);
                }
                if (!positions.Any(e => e.Lat == route.ToCastle.Position.Lat && e.Lng == route.ToCastle.Position.Lng))
                {
                    positions.Add(new Position()
                    {
                        Lat = route.ToCastle.Position.Lat,
                        Lng = route.ToCastle.Position.Lng
                    });
                }
                formattedRoute.FormattedRoute = positions;
                gameEntity.Routes.Add(formattedRoute);
            }
            await _gameRepository.UpdateAsync(gameEntity);
        }
示例#23
0
        public async Task <ActionResult> SaveCopy(RouteViewModel model)
        {
            Route obj = new Route()
            {
                Key         = model.Name,
                RouteType   = model.RouteType,
                Status      = model.Status,
                Description = model.Description,
                Creator     = User.Identity.Name,
                CreateTime  = DateTime.Now,
                Editor      = User.Identity.Name,
                EditTime    = DateTime.Now
            };
            MethodReturnResult result = new MethodReturnResult();

            using (RouteServiceClient client = new RouteServiceClient())
            {
                result = await client.AddAsync(obj);

                if (result.Code == 0)
                {
                    result.Message      = "复制工艺流程主体成功";
                    StringBuilder where = new StringBuilder();

                    using (RouteStepServiceClient routeStepServiceClient = new RouteStepServiceClient())
                    {
                        where.AppendFormat(" Key.RouteName ='{0}'",
                                           model.ParentName);


                        PagingConfig cfg = new PagingConfig()
                        {
                            IsPaging = false,
                            OrderBy  = "SortSeq",
                            Where    = where.ToString()
                        };
                        MethodReturnResult <IList <RouteStep> > routeStep = routeStepServiceClient.Get(ref cfg);
                        if (routeStep.Code == 0)
                        {
                            List <RouteStep> listOfRouteStep = routeStep.Data.ToList <RouteStep>();
                            foreach (RouteStep itemOfRouteStep in listOfRouteStep)
                            {
                                #region  制工步信息
                                RouteStep objRouteStep = new RouteStep()
                                {
                                    Key = new RouteStepKey()
                                    {
                                        RouteName     = model.Name,
                                        RouteStepName = itemOfRouteStep.Key.RouteStepName
                                    },
                                    DefectReasonCodeCategoryName = itemOfRouteStep.DefectReasonCodeCategoryName,
                                    Duration = itemOfRouteStep.Duration,
                                    ScrapReasonCodeCategoryName = itemOfRouteStep.ScrapReasonCodeCategoryName,
                                    SortSeq            = itemOfRouteStep.SortSeq,
                                    RouteOperationName = itemOfRouteStep.RouteOperationName,
                                    Description        = itemOfRouteStep.Description,
                                    Editor             = User.Identity.Name,
                                    EditTime           = DateTime.Now,
                                    CreateTime         = DateTime.Now,
                                    Creator            = User.Identity.Name
                                };
                                MethodReturnResult rstOfRouteStep = await routeStepServiceClient.AddAsync(objRouteStep);

                                if (rstOfRouteStep.Code != 0)
                                {
                                    result.Code    = 1001;
                                    result.Message = "复制工步信息失败" + rstOfRouteStep.Message;
                                    return(Json(result));
                                }
                                #endregion

                                #region  制工步参数
                                using (RouteStepParameterServiceClient routeStepParameterServiceClient = new RouteStepParameterServiceClient())
                                {
                                    #region  除新增工艺流程工步带过来的工步参数
                                    cfg = new PagingConfig()
                                    {
                                        Where = string.Format(" Key.RouteName='{0}' AND Key.RouteStepName = '{1}'"
                                                              , model.Name
                                                              , itemOfRouteStep.Key.RouteStepName),
                                        OrderBy = "ParamIndex"
                                    };
                                    MethodReturnResult <IList <RouteStepParameter> > routeStepParameterNewAdd = routeStepParameterServiceClient.Get(ref cfg);
                                    if (routeStepParameterNewAdd.Code == 0)
                                    {
                                        List <RouteStepParameter> listOfRouteStepParameterNewAdd = routeStepParameterNewAdd.Data.ToList <RouteStepParameter>();
                                        foreach (RouteStepParameter itemOfRouteStepParameterNewAdd in listOfRouteStepParameterNewAdd)
                                        {
                                            MethodReturnResult rstOfRouteStepParameterNewAdd = routeStepParameterServiceClient.Delete(itemOfRouteStepParameterNewAdd.Key);
                                            if (rstOfRouteStepParameterNewAdd.Code != 0)
                                            {
                                                result.Code    = 1001;
                                                result.Message = "删除初始工步参数信息失败" + rstOfRouteStepParameterNewAdd.Message;
                                                return(Json(result));
                                            }
                                        }
                                    }
                                    #endregion

                                    #region  制工步参数
                                    cfg = new PagingConfig()
                                    {
                                        Where = string.Format(" Key.RouteName='{0}' AND Key.RouteStepName = '{1}'"
                                                              , model.ParentName
                                                              , itemOfRouteStep.Key.RouteStepName),
                                        OrderBy = "ParamIndex"
                                    };
                                    MethodReturnResult <IList <RouteStepParameter> > routeStepParameter = routeStepParameterServiceClient.Get(ref cfg);
                                    if (routeStepParameter.Code == 0)
                                    {
                                        List <RouteStepParameter> listOfRouteStepParameter = routeStepParameter.Data.ToList <RouteStepParameter>();
                                        foreach (RouteStepParameter itemOfRouteStepParameter in listOfRouteStepParameter)
                                        {
                                            RouteStepParameter objRouteStepParameter = new RouteStepParameter()
                                            {
                                                Key = new RouteStepParameterKey()
                                                {
                                                    RouteName     = model.Name,
                                                    RouteStepName = itemOfRouteStepParameter.Key.RouteStepName,
                                                    ParameterName = itemOfRouteStepParameter.Key.ParameterName
                                                },
                                                MaterialType          = itemOfRouteStepParameter.MaterialType,
                                                DataFrom              = itemOfRouteStepParameter.DataFrom,
                                                DataType              = itemOfRouteStepParameter.DataType,
                                                DCType                = itemOfRouteStepParameter.DCType,
                                                IsDeleted             = itemOfRouteStepParameter.IsDeleted,
                                                IsMustInput           = itemOfRouteStepParameter.IsMustInput,
                                                IsReadOnly            = itemOfRouteStepParameter.IsReadOnly,
                                                IsUsePreValue         = itemOfRouteStepParameter.IsUsePreValue,
                                                ParamIndex            = itemOfRouteStepParameter.ParamIndex,
                                                ValidateFailedMessage = itemOfRouteStepParameter.ValidateFailedMessage,
                                                ValidateFailedRule    = itemOfRouteStepParameter.ValidateFailedRule,
                                                ValidateRule          = itemOfRouteStepParameter.ValidateRule,
                                                Editor                = User.Identity.Name,
                                                EditTime              = DateTime.Now,
                                            };
                                            MethodReturnResult rstOfRouteStepParameter = await routeStepParameterServiceClient.AddAsync(objRouteStepParameter);

                                            if (rstOfRouteStepParameter.Code != 0)
                                            {
                                                result.Code    = 1001;
                                                result.Message = "复制工步参数信息失败" + rstOfRouteStepParameter.Message;
                                                return(Json(result));
                                            }
                                        }
                                    }
                                    #endregion
                                }
                                #endregion

                                #region  制工步属性
                                using (RouteStepAttributeServiceClient routeStepAttributeServiceClient = new RouteStepAttributeServiceClient())
                                {
                                    #region  除新增工艺流程工步带过来的工步属性
                                    cfg = new PagingConfig()
                                    {
                                        Where = string.Format(" Key.RouteName='{0}' AND Key.RouteStepName = '{1}'"
                                                              , model.Name
                                                              , itemOfRouteStep.Key.RouteStepName),
                                        OrderBy = "Key.AttributeName"
                                    };
                                    MethodReturnResult <IList <RouteStepAttribute> > routeStepAttributeNewAdd = routeStepAttributeServiceClient.Get(ref cfg);
                                    if (routeStepAttributeNewAdd.Code == 0)
                                    {
                                        List <RouteStepAttribute> listOfRouteStepAttributeNewAdd = routeStepAttributeNewAdd.Data.ToList <RouteStepAttribute>();
                                        foreach (RouteStepAttribute itemOfRouteStepAttributeNewAdd in listOfRouteStepAttributeNewAdd)
                                        {
                                            MethodReturnResult rstOfRouteStepAttributeNewAdd = routeStepAttributeServiceClient.Delete(itemOfRouteStepAttributeNewAdd.Key);
                                            if (rstOfRouteStepAttributeNewAdd.Code != 0)
                                            {
                                                result.Code    = 1001;
                                                result.Message = "删除初始工步属性信息失败" + rstOfRouteStepAttributeNewAdd.Message;
                                                return(Json(result));
                                            }
                                        }
                                    }
                                    #endregion

                                    #region  制工步属性
                                    cfg = new PagingConfig()
                                    {
                                        Where = string.Format(" Key.RouteName='{0}' AND Key.RouteStepName = '{1}'"
                                                              , model.ParentName
                                                              , itemOfRouteStep.Key.RouteStepName),
                                        OrderBy = "Key.AttributeName"
                                    };
                                    MethodReturnResult <IList <RouteStepAttribute> > routeStepAttribute = routeStepAttributeServiceClient.Get(ref cfg);
                                    if (routeStepAttribute.Code == 0)
                                    {
                                        List <RouteStepAttribute> listOfRouteStepAttribute = routeStepAttribute.Data.ToList <RouteStepAttribute>();
                                        foreach (RouteStepAttribute itemOfRouteStepAttribute in listOfRouteStepAttribute)
                                        {
                                            RouteStepAttribute objRouteStepAttribute = new RouteStepAttribute()
                                            {
                                                Key = new RouteStepAttributeKey()
                                                {
                                                    RouteName     = model.Name,
                                                    RouteStepName = itemOfRouteStepAttribute.Key.RouteStepName,
                                                    AttributeName = itemOfRouteStepAttribute.Key.AttributeName
                                                },
                                                Value    = itemOfRouteStepAttribute.Value,
                                                Editor   = User.Identity.Name,
                                                EditTime = DateTime.Now,
                                            };
                                            MethodReturnResult rstOfRouteStepAttribute = await routeStepAttributeServiceClient.AddAsync(objRouteStepAttribute);

                                            if (rstOfRouteStepAttribute.Code != 0)
                                            {
                                                result.Code    = 1001;
                                                result.Message = "复制工步属性信息失败" + rstOfRouteStepAttribute.Message;
                                                return(Json(result));
                                            }
                                        }
                                    }
                                    #endregion
                                }
                                #endregion
                            }
                            result.Message += " \r\n 复制工艺流程工步参数及工步属性成功";
                        }
                    }
                }
            }
            return(Json(result));
        }