/// <summary> /// 产品查询接口 /// </summary> /// <param name="requestData"></param> /// <returns></returns> public string GetProductInfo(RequestData requestData) { var productQuery = _tongChengGateway.CheckProduct(requestData.RequestBody); var productRequest = productQuery.Data; var response = _ticketGateway.GetProduct(new ProductQueryRequest { Body = new Product { Type = string.IsNullOrEmpty(productRequest.ProductNo) ? 1 : 2, ProductId = string.IsNullOrEmpty(productRequest.ProductNo) ? 0 : Convert.ToInt32(productRequest.ProductNo), CurrentPage = productRequest.PageIndex, PageSize = productRequest.PageSize } }); if (response.Head.Code == "000000") { var productResponse = new ProductResponse { totalCount = response.Body.Count, productList = new List <ProductItemResponse>() }; foreach (var row in response.Body.ProductList) { productResponse.productList.Add(new ProductItemResponse { productNo = row.ProductId.ToString(), productName = row.ProductName, retailPrice = Convert.ToInt64(row.PriceInfo.MarketPrice * 100), webPrice = Convert.ToInt64(row.PriceInfo.SellPrice * 100), contractPrice = Convert.ToInt64(row.PriceInfo.SellPrice * 100), payType = 2, beginSaleDate = row.BeginValidDate, endSaleDate = row.EndValidDate, beginValidDate = row.BeginValidDate, endValidDate = row.EndValidDate, checkWay = 2, isCanRefund = row.CancelConfig.CanCancel, isCanOverdueRefund = 0, isStock = row.PriceInfo.SellStock == -1 ? 0 : 1 }); } return(_tongChengGateway.GetProductInfo(productResponse)); } return(_tongChengGateway.ErrorResult(ResultCode.Error, "系统出错")); }
private static void sysTimer_Elapsed(object sender, ElapsedEventArgs e) { var response = _ticketGateway.GetProduct(new ProductQueryRequest { Body = new Product { Type = 1, ProductId = 0, CurrentPage = 1, PageSize = 1 } }); if (response.Head.Code == "000000") { } _logger.Info(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + " : " + response.Head.Code); }