Browse Source

柱状图接口改列表

GOIAggregation
sanji 2 years ago
parent
commit
42a3e35216
  1. 2
      SiNan.API/Controllers/GOIController.cs
  2. 20
      SiNan.Business/GOIBusiness.cs
  3. 1
      SiNan.Business/ProductBusiness.cs
  4. 1
      SiNan.Model/Dto/Response/JDXX/JDXXHistogramResponse.cs

2
SiNan.API/Controllers/GOIController.cs

@ -42,7 +42,7 @@ namespace SiNan.API.Controllers
/// <param name="request"></param>
/// <returns></returns>
[HttpPost]
public JDXXHistogramResponse QueryProduct360HistogramStatistics([FromBody] JDXXHistogramRequest request)
public List<JDXXHistogramResponse> QueryProduct360HistogramStatistics([FromBody] JDXXHistogramRequest request)
{
return goiBusiness.QueryProduct360HistogramStatistics(request);
}

20
SiNan.Business/GOIBusiness.cs

@ -480,7 +480,7 @@ namespace SiNan.Business
};
}
public JDXXHistogramResponse QueryProduct360HistogramStatistics(JDXXHistogramRequest request)
public List<JDXXHistogramResponse> QueryProduct360HistogramStatistics(JDXXHistogramRequest request)
{
List<string> skuIdList = null;
if (!string.IsNullOrEmpty(request.Sku))
@ -495,16 +495,18 @@ namespace SiNan.Business
var startDate = DateTime.Now.Date.AddDays(-14);
var endDate = DateTime.Now.Date.AddSeconds(-1);
var data = fsql.Select<Skus>().Where(s => skuIdList.Contains(s.Sku))
var datas = fsql.Select<Skus>().Where(s => skuIdList.Contains(s.Sku))
.Where(s => s.CreateTime >= startDate && s.CreateTime <= endDate)
.ToAggregate(s => new JDXXHistogramResponse()
.GroupBy(s => s.Sku)
.ToList(g => new JDXXHistogramResponse()
{
UV = s.Sum(s.Key.Uv),
Sales = s.Sum(s.Key.Sales),
Profit = s.Sum(s.Key.Profits),
TotalCost = s.Sum(s.Key.TotalCost)
Sku = g.Key,
UV = g.Sum(g.Value.Uv),
Sales = g.Sum(g.Value.Sales),
Profit = g.Sum(g.Value.Profits),
TotalCost = g.Sum(g.Value.TotalCost)
});
return data;
return datas;
}
public Product360TopStatisticsResponse QueryProduct360TopStatistics(Product360TopStatisticsRequest request)
@ -548,7 +550,7 @@ namespace SiNan.Business
.WhereIf(!string.IsNullOrEmpty(request.Sku), (o, osku) => osku.SkuId == request.Sku)
.Sum((o, osku) => osku.ItemTotal);
var pingjia = fsql.Select<Spuchange>().Where(x => x.SpusId == spu).OrderByDescending(x => x.CreateTime).ToOne(x => x.TotalCount);
var pingjia = freeSqlMultiDBManager.XXfsql.Select<Spuchange>().Where(x => x.SpusId == spu).OrderByDescending(x => x.CreateTime).ToOne(x => x.TotalCount);
var historyPopularizeLevelGOIList = StatisticsPopularizeLevelGOI(skuIdList, null, null);

1
SiNan.Business/ProductBusiness.cs

@ -48,7 +48,6 @@ namespace SiNan.Business
public IList<ProductSkuResponse> GetProductSkuList(SearchProductSkuRequest searchProductSkuRequest)
{
var sendResult = restApiService.SendRequest("http://bbwytest.qiyue666.com", "api/product/GetProductSkuList", searchProductSkuRequest, null, HttpMethod.Post);
if (sendResult.StatusCode != System.Net.HttpStatusCode.OK)
throw new BusinessException(sendResult.Content) { Code = (int)sendResult.StatusCode };

1
SiNan.Model/Dto/Response/JDXX/JDXXHistogramResponse.cs

@ -21,5 +21,6 @@
/// 利润
/// </summary>
public decimal? Profit { get; set; }
public string Sku { get; set; }
}
}

Loading…
Cancel
Save