From e796f8facc5da9d70069cb22ac25b42e509091d5 Mon Sep 17 00:00:00 2001
From: shanj <18996038927@163.com>
Date: Thu, 2 Nov 2023 22:26:42 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BA=A7=E5=93=81360=E5=88=86=E6=9E=90-?=
=?UTF-8?q?=E6=98=9F=E8=B1=A1=E6=9F=B1=E7=8A=B6=E5=9B=BE=E7=BB=9F=E8=AE=A1?=
=?UTF-8?q?=E6=8E=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
SiNan.API/Controllers/GOIController.cs | 11 ++++++++
SiNan.Business/GOIBusiness.cs | 20 +++++++++++++++
.../Dto/Request/JDXX/JDXXHistogramRequest.cs | 7 ++++++
.../Response/JDXX/JDXXHistogramResponse.cs | 25 +++++++++++++++++++
SiNan.Model/SiNan.Model.csproj | 1 -
5 files changed, 63 insertions(+), 1 deletion(-)
create mode 100644 SiNan.Model/Dto/Request/JDXX/JDXXHistogramRequest.cs
create mode 100644 SiNan.Model/Dto/Response/JDXX/JDXXHistogramResponse.cs
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 @@
-