Browse Source

产品360分析-星象柱状图统计接口

GOIAggregation
shanji 2 years ago
parent
commit
e796f8facc
  1. 11
      SiNan.API/Controllers/GOIController.cs
  2. 20
      SiNan.Business/GOIBusiness.cs
  3. 7
      SiNan.Model/Dto/Request/JDXX/JDXXHistogramRequest.cs
  4. 25
      SiNan.Model/Dto/Response/JDXX/JDXXHistogramResponse.cs
  5. 1
      SiNan.Model/SiNan.Model.csproj

11
SiNan.API/Controllers/GOIController.cs

@ -34,5 +34,16 @@ namespace SiNan.API.Controllers
{
return goiBusiness.QueryProduct360PopularizeGOI(request);
}
/// <summary>
/// 产品360分析-星象柱状图统计接口
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost]
public ListResponse<JDXXHistogramResponse> QueryProduct360HistogramStatistics([FromBody]JDXXHistogramRequest request)
{
return goiBusiness.QueryProduct360HistogramStatistics(request);
}
}
}

20
SiNan.Business/GOIBusiness.cs

@ -418,5 +418,25 @@ namespace SiNan.Business
Count = list.Count
};
}
public ListResponse<JDXXHistogramResponse> QueryProduct360HistogramStatistics(JDXXHistogramRequest request)
{
var startDate = DateTime.Now.Date.AddDays(-14);
var endDate = DateTime.Now.Date.AddSeconds(-1);
var list = fsql.Select<Server.Model.Db.Skus>().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<JDXXHistogramResponse>()
{
Count = list.Count,
ItemList = list
};
}
}
}

7
SiNan.Model/Dto/Request/JDXX/JDXXHistogramRequest.cs

@ -0,0 +1,7 @@
namespace SiNan.Model.Dto
{
public class JDXXHistogramRequest
{
public IList<string> SkuList { get; set; }
}
}

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

@ -0,0 +1,25 @@
namespace SiNan.Model.Dto
{
public class JDXXHistogramResponse
{
/// <summary>
/// 访客
/// </summary>
public long? UV { get; set; }
/// <summary>
/// 销量
/// </summary>
public long? Sales { get; set; }
/// <summary>
/// 花费
/// </summary>
public decimal? TotalCost { get; set; }
/// <summary>
/// 利润
/// </summary>
public decimal? Profit { get; set; }
}
}

1
SiNan.Model/SiNan.Model.csproj

@ -18,7 +18,6 @@
<ItemGroup>
<Folder Include="Db\JDXX\" />
<Folder Include="Dto\Response\JDXX\" />
</ItemGroup>
</Project>

Loading…
Cancel
Save