diff --git a/SiNan.API/Controllers/GOIController.cs b/SiNan.API/Controllers/GOIController.cs index 84ef0c8..d95f9fa 100644 --- a/SiNan.API/Controllers/GOIController.cs +++ b/SiNan.API/Controllers/GOIController.cs @@ -34,5 +34,16 @@ namespace SiNan.API.Controllers { return goiBusiness.QueryProduct360PopularizeGOI(request); } + + /// + /// 产品360分析-星象柱状图统计接口 + /// + /// + /// + [HttpPost] + public ListResponse QueryProduct360HistogramStatistics([FromBody]JDXXHistogramRequest request) + { + return goiBusiness.QueryProduct360HistogramStatistics(request); + } } } diff --git a/SiNan.Business/GOIBusiness.cs b/SiNan.Business/GOIBusiness.cs index 4b3e816..5d36446 100644 --- a/SiNan.Business/GOIBusiness.cs +++ b/SiNan.Business/GOIBusiness.cs @@ -418,5 +418,25 @@ namespace SiNan.Business Count = list.Count }; } + + public ListResponse QueryProduct360HistogramStatistics(JDXXHistogramRequest request) + { + var startDate = DateTime.Now.Date.AddDays(-14); + var endDate = DateTime.Now.Date.AddSeconds(-1); + var list = fsql.Select().Where(s => request.SkuList.Contains(s.Sku)) + .Where(s => s.CreateTime >= startDate && s.CreateTime <= endDate) + .ToList(s => new JDXXHistogramResponse() + { + UV = s.Uv, + Sales = s.Sales, + Profit = s.Profits, + TotalCost = s.TotalCost + }); + return new ListResponse() + { + Count = list.Count, + ItemList = list + }; + } } } diff --git a/SiNan.Model/Dto/Request/JDXX/JDXXHistogramRequest.cs b/SiNan.Model/Dto/Request/JDXX/JDXXHistogramRequest.cs new file mode 100644 index 0000000..32cdc79 --- /dev/null +++ b/SiNan.Model/Dto/Request/JDXX/JDXXHistogramRequest.cs @@ -0,0 +1,7 @@ +namespace SiNan.Model.Dto +{ + public class JDXXHistogramRequest + { + public IList SkuList { get; set; } + } +} diff --git a/SiNan.Model/Dto/Response/JDXX/JDXXHistogramResponse.cs b/SiNan.Model/Dto/Response/JDXX/JDXXHistogramResponse.cs new file mode 100644 index 0000000..33a2c36 --- /dev/null +++ b/SiNan.Model/Dto/Response/JDXX/JDXXHistogramResponse.cs @@ -0,0 +1,25 @@ +namespace SiNan.Model.Dto +{ + public class JDXXHistogramResponse + { + /// + /// 访客 + /// + public long? UV { get; set; } + + /// + /// 销量 + /// + public long? Sales { get; set; } + + /// + /// 花费 + /// + public decimal? TotalCost { get; set; } + + /// + /// 利润 + /// + public decimal? Profit { get; set; } + } +} diff --git a/SiNan.Model/SiNan.Model.csproj b/SiNan.Model/SiNan.Model.csproj index 7620268..3608941 100644 --- a/SiNan.Model/SiNan.Model.csproj +++ b/SiNan.Model/SiNan.Model.csproj @@ -18,7 +18,6 @@ -