Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mall.oytour.com
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄奎
mall.oytour.com
Commits
345ec360
Commit
345ec360
authored
May 09, 2020
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交数据概况
parent
f76c7972
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
978 additions
and
27 deletions
+978
-27
RB_Member_Balance.cs
Mall.Model/Entity/User/RB_Member_Balance.cs
+6
-0
RB_Goods_Order_Extend.cs
Mall.Model/Extend/Product/RB_Goods_Order_Extend.cs
+6
-0
RB_Member_Balance_Extend.cs
Mall.Model/Extend/User/RB_Member_Balance_Extend.cs
+0
-2
DataStatistics_Query.cs
Mall.Model/Query/DataStatistics_Query.cs
+134
-0
CouponModule.cs
Mall.Module.MarketingCenter/CouponModule.cs
+1
-1
StatisticsModule.cs
Mall.Module.MarketingCenter/StatisticsModule.cs
+161
-0
RB_Goods_OrderRepository.cs
Mall.Repository/Product/RB_Goods_OrderRepository.cs
+340
-19
RB_Member_BalanceRepository.cs
Mall.Repository/User/RB_Member_BalanceRepository.cs
+1
-1
CouponController.cs
Mall.WebApi/Controllers/MarketingCenter/CouponController.cs
+4
-4
StatisticsController.cs
...ebApi/Controllers/MarketingCenter/StatisticsController.cs
+325
-0
No files found.
Mall.Model/Entity/User/RB_Member_Balance.cs
View file @
345ec360
...
...
@@ -88,5 +88,11 @@ namespace Mall.Model.Entity.User
/// 备注
/// </summary>
public
string
Remarks
{
get
;
set
;
}
/// <summary>
/// 平台类型
/// </summary>
public
UserSourceEnum
?
PlatformType
{
get
;
set
;
}
}
}
Mall.Model/Extend/Product/RB_Goods_Order_Extend.cs
View file @
345ec360
...
...
@@ -29,6 +29,12 @@ namespace Mall.Model.Extend.Product
/// 商品名称
/// </summary>
public
string
GoodsName
{
get
;
set
;
}
/// <summary>
/// 订单对应的总件数
/// </summary>
public
int
GoodsTotalNum
{
get
;
set
;
}
/// <summary>
/// 货号
/// </summary>
...
...
Mall.Model/Extend/User/RB_Member_Balance_Extend.cs
View file @
345ec360
...
...
@@ -39,7 +39,5 @@ namespace Mall.Model.Extend.User
/// 下载枚举
/// </summary>
public
List
<
int
>
ExcelEnumIds
{
get
;
set
;
}
public
UserSourceEnum
?
PlatformType
{
get
;
set
;
}
}
}
Mall.Model/Query/DataStatistics_Query.cs
0 → 100644
View file @
345ec360
using
Mall.Common.AOP
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Mall.Model.Query
{
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
DataStatistics_Query
{
public
int
TenantId
{
get
;
set
;
}
public
int
MallBaseId
{
get
;
set
;
}
public
int
PlatformType
{
get
;
set
;
}
/// <summary>
/// 开始时间【查询使用】
/// </summary>
public
string
StartDate
{
get
;
set
;
}
/// <summary>
/// 结束时间【查询使用】
/// </summary>
public
string
EndDate
{
get
;
set
;
}
/// <summary>
/// 会员数
/// </summary>
public
int
MemberNum
{
get
;
set
;
}
/// <summary>
/// 商品数
/// </summary>
public
int
GoodsNum
{
get
;
set
;
}
/// <summary>
/// 商品名称
/// </summary>
public
string
Name
{
get
;
set
;
}
/// <summary>
/// 订单数
/// </summary>
public
int
OrderNum
{
get
;
set
;
}
/// <summary>
/// 代发货数
/// </summary>
public
int
NotDeliverNum
{
get
;
set
;
}
/// <summary>
/// 售后数
/// </summary>
public
int
AfterSale
{
get
;
set
;
}
/// <summary>
/// 支付订单数
/// </summary>
public
int
OrderPay
{
get
;
set
;
}
/// <summary>
/// 支付金额
/// </summary>
public
decimal
PayMoney
{
get
;
set
;
}
/// <summary>
/// 支付人数
/// </summary>
public
int
PayMemerNum
{
get
;
set
;
}
/// <summary>
/// 支付件数
/// </summary>
public
int
BuyNum
{
get
;
set
;
}
/// <summary>
/// 折线图统计
/// </summary>
public
List
<
OrderLine
>
OrderLineList
{
get
;
set
;
}
/// <summary>
/// 是否是昨日(主要是销售情况,分昨日和近7天)
/// </summary>
public
int
IsYesterday
{
get
;
set
;
}
public
string
CreateDate
{
get
;
set
;
}
/// <summary>
/// 订单状态0-全部,1-未完成,2-已完成,3-已取消,4-售后中,5-已完成售后
/// </summary>
public
int
OrderStatus
{
get
;
set
;
}
/// <summary>
/// 订单类型
/// </summary>
public
int
OrderType
{
get
;
set
;
}
}
public
class
OrderLine
{
/// <summary>
/// 时间
/// </summary>
public
string
DateStr
{
get
;
set
;
}
/// <summary>
/// 支付订单数
/// </summary>
public
int
OrderPay
{
get
;
set
;
}
/// <summary>
/// 支付金额
/// </summary>
public
decimal
PayMoney
{
get
;
set
;
}
/// <summary>
/// 支付人数
/// </summary>
public
int
PayMemerNum
{
get
;
set
;
}
/// <summary>
/// 支付件数
/// </summary>
public
int
BuyNum
{
get
;
set
;
}
}
}
Mall.Module.MarketingCenter/CouponModule.cs
View file @
345ec360
...
...
@@ -273,7 +273,7 @@ namespace Mall.Module.MarketingCenter
OperatorEnum
=
OperatorEnum
.
Equal
}
};
flag
=
productRepository
.
Update
(
cols
,
wheres
);
productRepository
.
Update
(
cols
,
wheres
);
discountCouponRepository
.
DBSession
.
Commit
();
...
...
Mall.Module.MarketingCenter/StatisticsModule.cs
0 → 100644
View file @
345ec360
using
Mall.Model.Extend.Product
;
using
Mall.Model.Query
;
using
Mall.Repository.Product
;
using
NPOI.SS.Formula.Functions
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
Mall.Module.MarketingCenter
{
public
class
StatisticsModule
{
private
RB_Goods_OrderRepository
orderRepository
=
new
RB_Goods_OrderRepository
();
#
region
数据统计
-
数据概况
/// <summary>
/// 数据概况
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
DataStatistics_Query
>
GetOrdertSatistics
(
DataStatistics_Query
dmodel
)
{
return
orderRepository
.
GetOrdertSatistics
(
dmodel
);
}
/// <summary>
/// 获取近一周的数据
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public
DataStatistics_Query
GetWeeklyOrder
(
DataStatistics_Query
dmodel
)
{
if
(
dmodel
.
IsYesterday
==
1
)
{
dmodel
.
StartDate
=
dmodel
.
EndDate
=
System
.
DateTime
.
Now
.
AddDays
(-
1
).
ToString
(
"yyyy-MM-dd"
);
}
else
{
dmodel
.
StartDate
=
System
.
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd"
);
dmodel
.
EndDate
=
System
.
DateTime
.
Now
.
AddDays
(-
7
).
ToString
(
"yyyy-MM-dd"
);
}
var
List
=
orderRepository
.
GetWeeklyOrder
(
dmodel
);
DataStatistics_Query
model
=
new
DataStatistics_Query
();
if
(
List
!=
null
&&
List
.
Any
())
{
model
.
OrderPay
=
List
.
Count
();
model
.
PayMoney
=
List
.
Sum
(
x
=>
x
.
Income
??
0
);
model
.
PayMemerNum
=
List
.
GroupBy
(
x
=>
x
.
UserId
).
Count
();
model
.
BuyNum
=
List
.
Sum
(
x
=>
x
.
GoodsTotalNum
);
model
.
OrderLineList
=
new
List
<
OrderLine
>();
if
(
dmodel
.
IsYesterday
==
1
)
//同一天
{
for
(
int
i
=
1
;
i
<
24
;
i
++)
{
OrderLine
modelOrderLine
=
new
OrderLine
();
modelOrderLine
.
OrderPay
=
List
.
Where
(
x
=>
x
.
CreateDate
.
Value
.
ToString
(
"dd"
)
==
((
i
>
9
)
?
(
"0"
+
i
)
:
i
.
ToString
())).
Count
();
modelOrderLine
.
PayMoney
=
List
.
Where
(
x
=>
x
.
CreateDate
.
Value
.
ToString
(
"dd"
)
==
((
i
>
9
)
?
(
"0"
+
i
)
:
i
.
ToString
())).
Sum
(
x
=>
x
.
Income
??
0
);
modelOrderLine
.
PayMemerNum
=
List
.
Where
(
x
=>
x
.
CreateDate
.
Value
.
ToString
(
"dd"
)
==
((
i
>
9
)
?
(
"0"
+
i
)
:
i
.
ToString
())).
GroupBy
(
x
=>
x
.
UserId
).
Count
();
modelOrderLine
.
BuyNum
=
List
.
Where
(
x
=>
x
.
CreateDate
.
Value
.
ToString
(
"dd"
)
==
((
i
>
9
)
?
(
"0"
+
i
)
:
i
.
ToString
())).
Sum
(
x
=>
x
.
GoodsTotalNum
);
modelOrderLine
.
DateStr
=
(
i
>
9
)
?
(
"0"
+
i
)
:
i
.
ToString
();
model
.
OrderLineList
.
Add
(
modelOrderLine
);
}
}
else
{
for
(
int
i
=
0
;
i
<
7
;
i
++)
{
OrderLine
modelOrderLine
=
new
OrderLine
();
modelOrderLine
.
OrderPay
=
List
.
Where
(
x
=>
x
.
CreateDate
.
Value
.
ToString
(
"yyyy-MM-dd"
)
==
System
.
DateTime
.
Now
.
AddDays
(
i
).
ToString
(
"yyyy-MM-dd"
)).
Count
();
modelOrderLine
.
PayMoney
=
List
.
Where
(
x
=>
x
.
CreateDate
.
Value
.
ToString
(
"yyyy-MM-dd"
)
==
System
.
DateTime
.
Now
.
AddDays
(
i
).
ToString
(
"yyyy-MM-dd"
)).
Sum
(
x
=>
x
.
Income
??
0
);
modelOrderLine
.
PayMemerNum
=
List
.
Where
(
x
=>
x
.
CreateDate
.
Value
.
ToString
(
"yyyy-MM-dd"
)
==
System
.
DateTime
.
Now
.
AddDays
(
i
).
ToString
(
"yyyy-MM-dd"
)).
GroupBy
(
x
=>
x
.
UserId
).
Count
();
modelOrderLine
.
BuyNum
=
List
.
Where
(
x
=>
x
.
CreateDate
.
Value
.
ToString
(
"yyyy-MM-dd"
)
==
System
.
DateTime
.
Now
.
AddDays
(
i
).
ToString
(
"yyyy-MM-dd"
)).
Sum
(
x
=>
x
.
GoodsTotalNum
);
modelOrderLine
.
DateStr
=
System
.
DateTime
.
Now
.
AddDays
(
i
).
ToString
(
"yyyy-MM-dd"
);
model
.
OrderLineList
.
Add
(
modelOrderLine
);
}
}
}
return
model
;
}
/// <summary>
/// 商品购买力TOP排行
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
DataStatistics_Query
>
GetGoosTop
(
DataStatistics_Query
dmodel
)
{
return
orderRepository
.
GetGoosTop
(
dmodel
);
}
/// <summary>
/// 用户购买力TOP排行
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
DataStatistics_Query
>
GetMemberTop
(
DataStatistics_Query
dmodel
)
{
return
orderRepository
.
GetMemberTop
(
dmodel
);
}
#
endregion
#
region
销售报表
/// <summary>
/// 销售统计
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
DataStatistics_Query
>
GetSellPageList
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
DataStatistics_Query
dmodel
)
{
return
orderRepository
.
GetSellPageList
(
pageIndex
,
pageSize
,
out
count
,
dmodel
);
}
/// <summary>
/// 总成交
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public
DataStatistics_Query
GetSellOrder
(
DataStatistics_Query
dmodel
)
{
var
List
=
orderRepository
.
GetWeeklyOrder
(
dmodel
);
DataStatistics_Query
model
=
new
DataStatistics_Query
();
if
(
List
!=
null
&&
List
.
Any
())
{
model
.
OrderNum
=
List
.
Count
();
model
.
PayMoney
=
List
.
Sum
(
x
=>
x
.
Income
??
0
);
model
.
PayMemerNum
=
List
.
GroupBy
(
x
=>
x
.
UserId
).
Count
();
model
.
GoodsNum
=
List
.
Sum
(
x
=>
x
.
GoodsTotalNum
);
}
return
model
;
}
/// <summary>
/// 销售统计导出
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
DataStatistics_Query
>
GetSellExcel
(
DataStatistics_Query
dmodel
)
{
return
orderRepository
.
GetSellExcel
(
dmodel
);
}
#
endregion
}
}
Mall.Repository/Product/RB_Goods_OrderRepository.cs
View file @
345ec360
This diff is collapsed.
Click to expand it.
Mall.Repository/User/RB_Member_BalanceRepository.cs
View file @
345ec360
...
...
@@ -115,7 +115,7 @@ namespace Mall.Repository.User
}
if
(
query
.
PlatformType
>
0
)
{
builder
.
Append
(
$" AND
b.
{
nameof
(
RB_Member_Balance_Extend
.
PlatformType
)}
=
{
query
.
PlatformType
}
"
);
builder
.
Append
(
$" AND
a.
{
nameof
(
RB_Member_Balance_Extend
.
PlatformType
)}
=
{(
int
)
query
.
PlatformType
}
"
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
MemberName
))
{
...
...
Mall.WebApi/Controllers/MarketingCenter/CouponController.cs
View file @
345ec360
...
...
@@ -196,10 +196,10 @@ namespace Mall.WebApi.Controllers.MarketingCenter
x
.
DiscountsPrice
,
UseTypeStr
=
Mall
.
Common
.
Plugin
.
EnumHelper
.
GetEnumName
(
x
.
UseType
),
x
.
CouponType
,
x
.
StartDate
,
StartDate
=
x
.
StartDate
.
HasValue
?
x
.
StartDate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
,
x
.
IndateType
,
x
.
IndateDay
,
x
.
EndDate
,
EndDate
=
x
.
EndDate
.
HasValue
?
x
.
EndDate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
,
x
.
TotalNum
,
ResidueNum
=
x
.
TotalNum
-
x
.
ReceiveNum
,
x
.
PickupCenter
...
...
@@ -227,7 +227,7 @@ namespace Mall.WebApi.Controllers.MarketingCenter
}
if
(!
string
.
IsNullOrWhiteSpace
(
oldLogisticsModel
.
MemberLevel
))
{
oldLogisticsModel
.
MemberLevelList
=
JsonConvert
.
DeserializeObject
<
List
<
int
>>(
oldLogisticsModel
.
MemberLevel
).
ToArray
();
oldLogisticsModel
.
MemberLevelList
=
JsonConvert
.
DeserializeObject
<
List
<
int
>>(
oldLogisticsModel
.
MemberLevel
).
ToArray
();
}
return
ApiResult
.
Success
(
""
,
oldLogisticsModel
);
}
...
...
@@ -267,7 +267,7 @@ namespace Mall.WebApi.Controllers.MarketingCenter
{
return
ApiResult
.
Failed
(
"开始日期或结束日期必填"
);
}
if
(
query
.
StartDate
<
query
.
EndDate
)
if
(
query
.
StartDate
>
query
.
EndDate
)
{
return
ApiResult
.
Failed
(
"开始日期必须小于结束日期"
);
}
...
...
Mall.WebApi/Controllers/MarketingCenter/StatisticsController.cs
0 → 100644
View file @
345ec360
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment