Example #1
0
        //[Route("api/test")]
        public NegotiatedContentResult <GetOrderListResponse> GetConsumerOrderListTest()
        {
            //OrderDao dao = new OrderDao();

            var identity = (ClaimsIdentity)User.Identity;

            var userId = identity.Claims
                         .FirstOrDefault(c => c.Type == "ID").Value;

            var accTocken = identity.Claims
                            .FirstOrDefault(c => c.Type == "AccToken").Value;

            var Roles = identity.Claims
                        .Where(c => c.Type == ClaimTypes.Role)
                        .Select(c => c.Value).ToArray();

            //var custOrderList = dao.GetOrderList(int.Parse(ID), 1);
            //return Request.CreateResponse(HttpStatusCode.OK, custOrderList);

            GetOrderListRequest ordReq = new GetOrderListRequest();

            ordReq.user_id      = int.Parse(userId);
            ordReq.auth_token   = accTocken;
            ordReq.current_list = 1;

            GetOrderListResponse resp = _ordersServices.GetOrderList(ordReq);

            return(Content(HttpStatusCode.OK, resp));
        }
        public void RequestTest()
        {
            GetOrderListRequestModel reqModel = new GetOrderListRequestModel();

            reqModel.Page     = 1;
            reqModel.PageSize = 1000;
            var req = new  GetOrderListRequest("7417441d04ea6267a57cbb6cdced5552", "726fb5fbe5b258d33e32aba78df42e83", reqModel);
            var res = req.Request().Result;

            var sp        = new Moq.Mock <IServiceProvider>();
            var myContext = new Service.Context.XinDBContext(new Microsoft.EntityFrameworkCore.DbContextOptions <Service.Context.XinDBContext>());
            var logger    = new Moq.Mock <ILogger <DataAccess> >();

            sp.Setup((o) => o.GetService(typeof(IEntityContext))).Returns(myContext);

            sp.Setup((o) => o.GetService(typeof(IRepository <OmsOrderList>)))
            .Returns(new GenericEntityRepository <OmsOrderList>(logger.Object));
            var provider = new UowProvider(logger.Object, sp.Object);

            using (var uow = provider.CreateUnitOfWork())
            {
                var repository           = uow.GetRepository <OmsOrderList>();
                List <OmsOrderList> list = new List <OmsOrderList>();
                foreach (var item in res.data)
                {
                    var tt = Mapper <GetOrderListResponseModel, OmsOrderList> .Map(item);

                    list.Add(tt);
                }
                repository.BulkInsert(list, x => x.IncludeGraph = true);
                uow.SaveChanges();
            }
        }
Example #3
0
        public async Task <ActionResult> GetOrderListMessage(GetOrderListRequest MyRequest)
        {
            MyRequest.GetHeaderMessage();
            SetSessionData(MyRequest);
            GetOrderListMessage MyGetOrderListMessage = new GetOrderListMessage(_hostingEnvironment);

            return(View(await MyGetOrderListMessage.GetMessage(MyRequest, _hostingEnvironment)));
        }
Example #4
0
        public async Task <GerOrderListResponse> GetList([FromQuery] GetOrderListRequest request)
        {
            var data = await orderService.GetList(request.PageIndex, request.PageSize);

            var result = orderMapper.Map(data);

            return(result);
        }
Example #5
0
        /// <summary>
        /// 获取医生列表信息
        /// </summary>
        /// <param name="model">model</param>
        /// <returns></returns>
        public List <MemberEntity> GetOrderList(GetOrderListRequest model)
        {
            List <MemberEntity> list = new List <MemberEntity>();

            using (var db = new RepositoryBase().BeginTrans())
            {
                list = db.IQueryable <MemberEntity>(item => item.MemberId == model.MemberId).ToList();
                db.Commit();
            }
            return(list);
        }
Example #6
0
        public ActionResult GetOrderListRequest()
        {
            Request MyRequest = new GetOrderListRequest();

            /*   if (HttpContext.Session.GetString(SessionToken) != null)
             * {
             *     MyRequest._Login = HttpContext.Session.GetString(SessionLogin);
             *     MyRequest._Token = HttpContext.Session.GetString(SessionToken);
             *     MyRequest._EnvironmentSelected = (EnvironmentEnum)Enum.Parse(typeof(EnvironmentEnum), HttpContext.Session.GetString(SessionEnvironment));
             * }*/
            return(View(MyRequest));
        }
Example #7
0
        public GetOrderListResponse GetOrderList(GetOrderListRequest request)
        {
            var orders = _repository.GetOrderList()
                         .Select(OrderApiDto.FromDomain)
                         .ToList();

            var response = new GetOrderListResponse()
            {
                OrderList = orders
            };

            return(response);
        }
Example #8
0
 /// <summary>
 /// 获取订单列表
 /// </summary>
 public GetOrderListResponse GetOrderList([FromUri] GetOrderListRequest request)
 {
     try
     {
         var result = Global.Bus.Send <GetOrderListResponse>(Constants.HotelServiceAddress, request);
         if (!result.IsSuccess)
         {
             throw new HttpResponseException(Request.CreateErrorResponse(HttpStatusCode.InternalServerError,
                                                                         "获取订单列表失败。"));
         }
         return(result.Data);
     }
     catch
     {
         throw new HttpResponseException(Request.CreateErrorResponse(HttpStatusCode.InternalServerError,
                                                                     "获取订单列表失败。"));
     }
 }
Example #9
0
        public void GetOrderListWithJsonServClt()
        {
            GetOrderListRequest request = new GetOrderListRequest();

            OrderListResponse response = null;

            using (JsonServiceClient client = new JsonServiceClient(listenOnUrl))
            {
                response = client.Get <OrderListResponse>(request);
            }

            if (response != null)
            {
                response.PrintDump();
            }
            Console.WriteLine("成功获取所有订单。");
            Console.ReadLine();
        }
Example #10
0
        public async Task <IActionResult> GetPaged([FromQuery] GetOrderListRequest request)
        {
            var filter = PredicateBuilder.True <Order>();


            var response = await _entityRepository.GetPagedAsync <GetOrderBase>(

                request.PageNumber,
                request.PageSize,
                request.OrderByPropertyName,
                request.SortingDirection,
                filter,
                x => x.OrderItems
                );

            var result = _mapper.Map <GetOrderListResponse>(response);

            return(Ok(result));
        }
Example #11
0
        public override async Task <GetOrderListResponse> GetOrderList(GetOrderListRequest request, ServerCallContext context)
        {
            var status = request.Status.ToArray();

            if (status.Length == 0)
            {
                status = System.Enum.GetValues(typeof(GrpcContract.Common.OrderStatus)).Cast <GrpcContract.Common.OrderStatus>().ToArray();
            }

            var type = request.Type.ToArray();

            if (type.Length == 0)
            {
                type = System.Enum.GetValues(typeof(GrpcContract.Orders.OrderType)).Cast <GrpcContract.Orders.OrderType>().ToArray();
            }

            var mappedType = type.Select(x => x switch
            {
                GrpcContract.Orders.OrderType.UnknownType => Antares.Service.History.Core.Domain.Enums.OrderType.Unknown,
                GrpcContract.Orders.OrderType.Market => Antares.Service.History.Core.Domain.Enums.OrderType.Market,
                GrpcContract.Orders.OrderType.Limit => Antares.Service.History.Core.Domain.Enums.OrderType.Limit,
                GrpcContract.Orders.OrderType.StopLimit => Antares.Service.History.Core.Domain.Enums.OrderType.StopLimit,
                _ => throw new ArgumentOutOfRangeException(nameof(x), x, null)
            }).ToArray();
Example #12
0
 /// <summary>
 /// 获取预约列表信息
 /// </summary>
 /// <param name="model">参数</param>
 public List <OrderEntity> GetOrderList(GetOrderListRequest model)
 {
     return(service.IQueryable(item => item.MemberId == model.MemberId).ToList());
 }
Example #13
0
        public NegotiatedContentResult <GetOrderListResponse> GetConsumerOrderList(GetOrderListRequest request)
        {
            GetOrderListResponse resp = _ordersServices.GetOrderList(request);

            return(Content(HttpStatusCode.OK, resp));
        }
Example #14
0
        //获取订单列表:
        public OrderListResponse Get(GetOrderListRequest request)
        {
            OrderListResponse result = OrderLogic.Instance.GetOrderList();

            return(result);
        }
Example #15
0
        public ActionResult GetOrderList(GetOrderListRequest request)
        {
            ResponseBase <List <GetOrderListResponse> > response = new ResponseBase <List <GetOrderListResponse> >();

            response.IsSuccess = false;
            response.Reason    = "系统出错,请联系管理员";
            List <GetOrderListResponse> list = new List <GetOrderListResponse>();

            response.Result = list;
            #region 验证
            if (request == null)
            {
                response.IsSuccess = false;
                response.Reason    = "参数不能为空";
                return(Content(response.ToJson()));
            }

            //全名
            if (string.IsNullOrWhiteSpace(request.FullName))
            {
                response.IsSuccess = false;
                response.Reason    = "全名不正确";
                return(Content(response.ToJson()));
            }

            //护照
            if (string.IsNullOrWhiteSpace(request.FullName))
            {
                response.IsSuccess = false;
                response.Reason    = "护照不正确";
                return(Content(response.ToJson()));
            }

            #endregion

            try
            {
                // orderApp.AddOrder(orderViewModel);

                //获取用户信息
                var member = memberApp.GetList(item => item.FullName == request.FullName && item.CredentialType == (int)CredentialTypeEnum.Passport && item.CredentialInformation == request.PassportNo).FirstOrDefault();
                if (member != null)
                {
                    request.MemberId = member.MemberId;
                    var orderList = orderApp.GetOrderList(request);

                    //预约信息
                    if (orderList != null && orderList.Any())
                    {
                        foreach (var order in orderList)
                        {
                            GetOrderListResponse getOrderListResponse = new GetOrderListResponse();
                            getOrderListResponse.FullName             = member.FullName.ToString();
                            getOrderListResponse.Gender               = (GenderEnum)member.Gender;
                            getOrderListResponse.DateOfBirth          = member.DateOfBirth;
                            getOrderListResponse.IdentificationNumber = member.CredentialInformation;
                            getOrderListResponse.CellPhone            = member.ContactNumber;

                            getOrderListResponse.Description = order.SymptomDescription;
                            getOrderListResponse.Appointment = order.OrderDate.ToString();
                            getOrderListResponse.Operating   = order.AddDate;

                            list.Add(getOrderListResponse);
                        }
                    }
                    response.IsSuccess = true;
                    response.Result    = list;
                }
                else
                {
                    //没有找到信息
                    response.IsSuccess = true;
                }
            }
            catch (Exception ex)
            {
            }
            return(Content(response.ToJson()));
        }
Example #16
0
        public NegotiatedContentResult <GetOrderListResponse> PostGetCurrentOrderList([FromBody] GetOrderListRequest request)
        {
            GetOrderListResponse resp = _ordersServices.GetOrderList(request);

            return(Content(HttpStatusCode.OK, resp));
        }
Example #17
0
 public ActionResult ManageParcelMessage(GetOrderListRequest MyRequest)
 {
     MyRequest.GetHeaderMessage();
     SetSessionData(MyRequest);
     return(View(new GetOrderListMessage(_hostingEnvironment)));
 }
Example #18
0
 public ActionResult GetOrderListMessage(GetOrderListRequest MyRequest)
 {
     MyRequest.GetHeaderMessage();
     SetSessionData(MyRequest);
     return(View(new GetOrderListMessage(MyRequest)));
 }
Example #19
0
 public GetOrderListResponse GetOrderList(GetOrderListRequest request)
 {
     return(_apiService.GetOrderList(request));
 }