Beispiel #1
0
        public async Task <GetItemsOutput> GetItemsAsync(GetItemsInput input)
        {
            var jobInfo = CreateStartJobInfo(GetProcessKey(nameof(GetItemsAsync)), input);
            var job     = await _orchestratorClient.ExecuteJobAsync(jobInfo);

            var itemsOutputInternal = JsonConvert.DeserializeObject <GetItemsOutputInternal>(job.OutputArguments);

            return(GetItemsOutputFromInternalResult(itemsOutputInternal));
        }
Beispiel #2
0
        /// <summary>
        /// 下载Excel
        /// </summary>
        /// <returns></returns>
        public async Task <FileResult> DownExcel(GetItemsInput input)
        {
            MemoryStream msData = new MemoryStream(10);

            var result = await _cartAppService.GetCartByIds(input);

            //创建一个临时文件
            string filePath = $"{_env.WebRootPath }\\TempFile\\";
            Stream stream   = new ExcelTool <CartItemDto>().GetExcelByList(filePath, result.Items);

            return(ToExcel(stream));
        }
 public async Task<GetItemsOutput> GetItemsAsync(GetItemsInput input)
 {
     if (input.CustomerId.OrdinalEquals("123456"))
     {
         return new GetItemsOutput()
         {
             Items = new Item[]
             {
                 new Item()
                 {
                     DeliveryDate = DateTime.Today.AddDays(2),
                     ItemId = "35678",
                     OrderId = "45436",
                     ItemName = "wireless speaker",
                     Quantity = "1",
                     DeliveryStatus = "out of stock",
                 },
                 new Item()
                 {
                     DeliveryDate = DateTime.Today.AddDays(10),
                     ItemId = "35678",
                     OrderId = "45436",
                     ItemName = "TV",
                     Quantity = "1",
                     DeliveryStatus = "out of stock",
                 },
                 new Item()
                 {
                     DeliveryDate = DateTime.Today.AddDays(-1),
                     ItemId = "123",
                     OrderId = "5645",
                     ItemName = "monitor",
                     Quantity = "1",
                     DeliveryStatus = "delivered",
                 },
                 new Item()
                 {
                     DeliveryDate = DateTime.Today.AddDays(-5),
                     ItemId = "123",
                     OrderId = "5645",
                     ItemName = "headphone",
                     Quantity = "1",
                     DeliveryStatus = "delivered",
                 },
             },
         };
     }
     else
     {
         return new GetItemsOutput();
     }
 }