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
6c5bd868
Commit
6c5bd868
authored
Jun 11, 2021
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
ff7b1964
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
90 additions
and
81 deletions
+90
-81
StatisticsModule.cs
Mall.Module.MarketingCenter/StatisticsModule.cs
+80
-80
TimersHelper.cs
Mall.WindowsService/Helper/TimersHelper.cs
+9
-0
UserStatisticsModule.cs
Mall.WindowsService/Module/UserStatisticsModule.cs
+1
-1
No files found.
Mall.Module.MarketingCenter/StatisticsModule.cs
View file @
6c5bd868
...
...
@@ -1960,16 +1960,16 @@ namespace Mall.Module.MarketingCenter
mmodel
.
BuyNum
=
mlist
.
Sum
(
x
=>
x
.
BuyNum
);
mmodel
.
TotalPayPeople
=
mlist
.
Any
()
?
mlist
.
Max
(
x
=>
x
.
PaymentNum
)
:
0
;
mmodel
.
Profit
=
mlist
.
Sum
(
x
=>
x
.
Profit
);
//抓取累计数据
int
TotalPXNum
=
mlist
.
Any
()
?
mlist
.
Max
(
x
=>
x
.
PXLJNum
)
:
0
;
int
TotalVIPNum
=
mlist
.
Any
()
?
mlist
.
Max
(
x
=>
x
.
VipLJNum
)
:
0
;
int
TotalYXNum
=
mlist
.
Any
()
?
mlist
.
Max
(
x
=>
x
.
YXLJNum
)
:
0
;
int
TotalJXNum
=
mlist
.
Any
()
?
mlist
.
Max
(
x
=>
x
.
JXLJNum
)
:
0
;
mmodel
.
PXNum
=
TotalPXNum
;
mmodel
.
VipNum
=
TotalVIPNum
;
mmodel
.
YXNum
=
TotalYXNum
;
mmodel
.
JXNum
=
TotalJXNum
;
mmodel
.
TotalMNum
=
TotalPXNum
+
TotalVIPNum
+
TotalYXNum
+
Total
JXNum
;
//抓取累计数据
不使用累计
//
int TotalPXNum = mlist.Any() ? mlist.Max(x => x.PXLJNum) : 0;
//
int TotalVIPNum = mlist.Any() ? mlist.Max(x => x.VipLJNum) : 0;
//
int TotalYXNum = mlist.Any() ? mlist.Max(x => x.YXLJNum) : 0;
//
int TotalJXNum = mlist.Any() ? mlist.Max(x => x.JXLJNum) : 0;
mmodel
.
PXNum
=
mlist
.
Sum
(
x
=>
x
.
PXNum
);
mmodel
.
VipNum
=
mlist
.
Sum
(
x
=>
x
.
VipNum
);
mmodel
.
YXNum
=
mlist
.
Sum
(
x
=>
x
.
YXNum
);
mmodel
.
JXNum
=
mlist
.
Sum
(
x
=>
x
.
JXNum
);
mmodel
.
TotalMNum
=
mmodel
.
PXNum
+
mmodel
.
VipNum
+
mmodel
.
YXNum
+
mmodel
.
JXNum
;
#
region
求月平均
#
region
月平均参数
...
...
@@ -2192,11 +2192,11 @@ namespace Mall.Module.MarketingCenter
BuyNum
=
MonthSList2
.
Sum
(
x
=>
x
.
BuyNum
),
Profit
=
MonthSList2
.
Sum
(
x
=>
x
.
Profit
),
TotalPayPeople
=
MonthSList2
.
Any
()?
MonthSList2
.
Max
(
x
=>
x
.
TotalPayPeople
)
:
0
,
PXNum
=
MonthSList2
.
Any
()?
MonthSList2
.
Max
(
x
=>
x
.
PXNum
)
:
0
,
VipNum
=
MonthSList2
.
Any
()
?
MonthSList2
.
Max
(
x
=>
x
.
VipNum
)
:
0
,
YXNum
=
MonthSList2
.
Any
()
?
MonthSList2
.
Max
(
x
=>
x
.
YXNum
)
:
0
,
JXNum
=
MonthSList2
.
Any
()
?
MonthSList2
.
Max
(
x
=>
x
.
JXNum
)
:
0
,
TotalMNum
=
MonthSList2
.
Any
()
?
MonthSList2
.
Max
(
x
=>
x
.
TotalMNum
)
:
0
,
PXNum
=
MonthSList2
.
Sum
(
x
=>
x
.
PXNum
)
,
VipNum
=
MonthSList2
.
Sum
(
x
=>
x
.
VipNum
)
,
YXNum
=
MonthSList2
.
Sum
(
x
=>
x
.
YXNum
)
,
JXNum
=
MonthSList2
.
Sum
(
x
=>
x
.
JXNum
)
,
TotalMNum
=
MonthSList2
.
Sum
(
x
=>
x
.
TotalMNum
)
,
MAvgPeopleNum
=
Math
.
Round
(
MonthSList2
.
Sum
(
x
=>
x
.
MAvgPeopleNum
)
/
TotalMonthNum
,
2
,
MidpointRounding
.
AwayFromZero
),
MAvgOrderNum
=
Math
.
Round
(
MonthSList2
.
Sum
(
x
=>
x
.
MAvgOrderNum
)
/
TotalMonthNum
,
2
,
MidpointRounding
.
AwayFromZero
),
...
...
@@ -2329,16 +2329,16 @@ namespace Mall.Module.MarketingCenter
mmodel
.
BuyNum
=
mlist
.
Sum
(
x
=>
x
.
BuyNum
);
mmodel
.
TotalPayPeople
=
mlist
.
Any
()
?
mlist
.
Max
(
x
=>
x
.
PaymentNum
)
:
0
;
mmodel
.
Profit
=
mlist
.
Sum
(
x
=>
x
.
Profit
);
//抓取累计数据
int
TotalPXNum
=
mlist
.
Any
()
?
mlist
.
Max
(
x
=>
x
.
PXLJNum
)
:
0
;
int
TotalVIPNum
=
mlist
.
Any
()
?
mlist
.
Max
(
x
=>
x
.
VipLJNum
)
:
0
;
int
TotalYXNum
=
mlist
.
Any
()
?
mlist
.
Max
(
x
=>
x
.
YXLJNum
)
:
0
;
int
TotalJXNum
=
mlist
.
Any
()
?
mlist
.
Max
(
x
=>
x
.
JXLJNum
)
:
0
;
mmodel
.
PXNum
=
TotalPXNum
;
mmodel
.
VipNum
=
TotalVIPNum
;
mmodel
.
YXNum
=
TotalYXNum
;
mmodel
.
JXNum
=
TotalJXNum
;
mmodel
.
TotalMNum
=
TotalPXNum
+
TotalVIPNum
+
TotalYXNum
+
Total
JXNum
;
//抓取累计数据
暂不使用
//
int TotalPXNum = mlist.Any() ? mlist.Max(x => x.PXLJNum) : 0;
//
int TotalVIPNum = mlist.Any() ? mlist.Max(x => x.VipLJNum) : 0;
//
int TotalYXNum = mlist.Any() ? mlist.Max(x => x.YXLJNum) : 0;
//
int TotalJXNum = mlist.Any() ? mlist.Max(x => x.JXLJNum) : 0;
mmodel
.
PXNum
=
mlist
.
Sum
(
x
=>
x
.
PXNum
)
;
mmodel
.
VipNum
=
mlist
.
Sum
(
x
=>
x
.
VipNum
)
;
mmodel
.
YXNum
=
mlist
.
Sum
(
x
=>
x
.
YXNum
)
;
mmodel
.
JXNum
=
mlist
.
Sum
(
x
=>
x
.
JXNum
)
;
mmodel
.
TotalMNum
=
mmodel
.
PXNum
+
mmodel
.
VipNum
+
mmodel
.
YXNum
+
mmodel
.
JXNum
;
#
region
求月平均
#
region
月平均参数
...
...
@@ -2562,11 +2562,11 @@ namespace Mall.Module.MarketingCenter
BuyNum
=
MonthSList2
.
Sum
(
x
=>
x
.
BuyNum
),
Profit
=
MonthSList2
.
Sum
(
x
=>
x
.
Profit
),
TotalPayPeople
=
MonthSList2
.
Any
()
?
MonthSList2
.
Max
(
x
=>
x
.
TotalPayPeople
)
:
0
,
PXNum
=
MonthSList2
.
Any
()
?
MonthSList2
.
Max
(
x
=>
x
.
PXNum
)
:
0
,
VipNum
=
MonthSList2
.
Any
()
?
MonthSList2
.
Max
(
x
=>
x
.
VipNum
)
:
0
,
YXNum
=
MonthSList2
.
Any
()
?
MonthSList2
.
Max
(
x
=>
x
.
YXNum
)
:
0
,
JXNum
=
MonthSList2
.
Any
()
?
MonthSList2
.
Max
(
x
=>
x
.
JXNum
)
:
0
,
TotalMNum
=
MonthSList2
.
Any
()
?
MonthSList2
.
Max
(
x
=>
x
.
TotalMNum
)
:
0
,
PXNum
=
MonthSList2
.
Sum
(
x
=>
x
.
PXNum
)
,
VipNum
=
MonthSList2
.
Sum
(
x
=>
x
.
VipNum
)
,
YXNum
=
MonthSList2
.
Sum
(
x
=>
x
.
YXNum
)
,
JXNum
=
MonthSList2
.
Sum
(
x
=>
x
.
JXNum
)
,
TotalMNum
=
MonthSList2
.
Sum
(
x
=>
x
.
TotalMNum
)
,
MAvgPeopleNum
=
Math
.
Round
(
MonthSList2
.
Sum
(
x
=>
x
.
MAvgPeopleNum
)
/
TotalMonthNum
,
2
,
MidpointRounding
.
AwayFromZero
),
MAvgOrderNum
=
Math
.
Round
(
MonthSList2
.
Sum
(
x
=>
x
.
MAvgOrderNum
)
/
TotalMonthNum
,
2
,
MidpointRounding
.
AwayFromZero
),
...
...
@@ -2837,15 +2837,15 @@ namespace Mall.Module.MarketingCenter
mmodel
.
BuyNum
=
mlist
.
Sum
(
x
=>
x
.
BuyNum
);
mmodel
.
TotalPayPeople
=
mlist
.
Any
()
?
mlist
.
Max
(
x
=>
x
.
PaymentNum
)
:
0
;
mmodel
.
Profit
=
mlist
.
Sum
(
x
=>
x
.
Profit
);
int
TotalPXNum
=
mlist
.
Any
()
?
mlist
.
Max
(
x
=>
x
.
PXLJNum
)
:
0
;
int
TotalVIPNum
=
mlist
.
Any
()
?
mlist
.
Max
(
x
=>
x
.
VipLJNum
)
:
0
;
int
TotalYXNum
=
mlist
.
Any
()
?
mlist
.
Max
(
x
=>
x
.
YXLJNum
)
:
0
;
int
TotalJXNum
=
mlist
.
Any
()
?
mlist
.
Max
(
x
=>
x
.
JXLJNum
)
:
0
;
mmodel
.
PXNum
=
TotalPXNum
;
mmodel
.
VipNum
=
TotalVIPNum
;
mmodel
.
YXNum
=
TotalYXNum
;
mmodel
.
JXNum
=
TotalJXNum
;
mmodel
.
TotalMNum
=
TotalPXNum
+
TotalVIPNum
+
TotalYXNum
+
Total
JXNum
;
//
int TotalPXNum = mlist.Any() ? mlist.Max(x => x.PXLJNum) : 0;
//
int TotalVIPNum = mlist.Any() ? mlist.Max(x => x.VipLJNum) : 0;
//
int TotalYXNum = mlist.Any() ? mlist.Max(x => x.YXLJNum) : 0;
//
int TotalJXNum = mlist.Any() ? mlist.Max(x => x.JXLJNum) : 0;
mmodel
.
PXNum
=
mlist
.
Sum
(
x
=>
x
.
PXNum
)
;
mmodel
.
VipNum
=
mlist
.
Sum
(
x
=>
x
.
VipNum
)
;
mmodel
.
YXNum
=
mlist
.
Sum
(
x
=>
x
.
YXNum
)
;
mmodel
.
JXNum
=
mlist
.
Sum
(
x
=>
x
.
JXNum
)
;
mmodel
.
TotalMNum
=
mmodel
.
PXNum
+
mmodel
.
VipNum
+
mmodel
.
YXNum
+
mmodel
.
JXNum
;
#
region
求月平均
#
region
月平均参数
...
...
@@ -3088,22 +3088,22 @@ namespace Mall.Module.MarketingCenter
var
PreMmodel
=
MonthSList
.
Where
(
x
=>
x
.
Date
==
Convert
.
ToDateTime
(
SRateMonth
+
"-01"
).
AddMonths
(-
1
).
ToString
(
"yyyy-MM"
)).
FirstOrDefault
();
User_Statistics_Rate_Query
smodel
=
new
User_Statistics_Rate_Query
()
{
Date
=
SRateMonth
};
smodel
.
MAvgPeopleNum
=
Math
.
Round
(
PreMmodel
.
MAvgPeopleNum
>
0
?
(
NowMmodel
.
MAvgPeopleNum
-
PreMmodel
.
MAvgPeopleNum
)
/
PreMmodel
.
MAvgPeopleNum
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
MAvgOrderNum
=
Math
.
Round
(
PreMmodel
.
MAvgOrderNum
>
0
?
(
NowMmodel
.
MAvgOrderNum
-
PreMmodel
.
MAvgOrderNum
)
/
PreMmodel
.
MAvgOrderNum
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
MAvgPayMoney
=
Math
.
Round
(
PreMmodel
.
MAvgPayMoney
>
0
?
(
NowMmodel
.
MAvgPayMoney
-
PreMmodel
.
MAvgPayMoney
)
/
PreMmodel
.
MAvgPayMoney
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
MAvgBuyNum
=
Math
.
Round
(
PreMmodel
.
MAvgBuyNum
>
0
?
(
NowMmodel
.
MAvgBuyNum
-
PreMmodel
.
MAvgBuyNum
)
/
PreMmodel
.
MAvgBuyNum
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgOrderNum
=
Math
.
Round
(
PreMmodel
.
PAvgOrderNum
>
0
?
(
NowMmodel
.
PAvgOrderNum
-
PreMmodel
.
PAvgOrderNum
)
/
PreMmodel
.
PAvgOrderNum
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgBuyNum
=
Math
.
Round
(
PreMmodel
.
PAvgBuyNum
>
0
?
(
NowMmodel
.
PAvgBuyNum
-
PreMmodel
.
PAvgBuyNum
)
/
PreMmodel
.
PAvgBuyNum
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgUnitPrice
=
Math
.
Round
(
PreMmodel
.
PAvgUnitPrice
>
0
?
(
NowMmodel
.
PAvgUnitPrice
-
PreMmodel
.
PAvgUnitPrice
)
/
PreMmodel
.
PAvgUnitPrice
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgBuyPrice
=
Math
.
Round
(
PreMmodel
.
PAvgBuyPrice
>
0
?
(
NowMmodel
.
PAvgBuyPrice
-
PreMmodel
.
PAvgBuyPrice
)
/
PreMmodel
.
PAvgBuyPrice
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgMOrderRate
=
Math
.
Round
(
PreMmodel
.
PAvgMOrderRate
>
0
?
(
NowMmodel
.
PAvgMOrderRate
-
PreMmodel
.
PAvgMOrderRate
)
/
PreMmodel
.
PAvgMOrderRate
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgProfitRate
=
Math
.
Round
(
PreMmodel
.
PAvgProfitRate
>
0
?
(
NowMmodel
.
PAvgProfitRate
-
PreMmodel
.
PAvgProfitRate
)
/
PreMmodel
.
PAvgProfitRate
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgProfit
=
Math
.
Round
(
PreMmodel
.
Profit
>
0
?
(
NowMmodel
.
Profit
-
PreMmodel
.
Profit
)
/
PreMmodel
.
Profit
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgPXNum
=
Math
.
Round
(
PreMmodel
.
PXNum
>
0
?
Convert
.
ToDecimal
(
NowMmodel
.
PXNum
-
PreMmodel
.
PXNum
)
/
PreMmodel
.
PXNum
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgVipNum
=
Math
.
Round
(
PreMmodel
.
VipNum
>
0
?
Convert
.
ToDecimal
(
NowMmodel
.
VipNum
-
PreMmodel
.
VipNum
)
/
PreMmodel
.
VipNum
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgYXNum
=
Math
.
Round
(
PreMmodel
.
YXNum
>
0
?
Convert
.
ToDecimal
(
NowMmodel
.
YXNum
-
PreMmodel
.
YXNum
)
/
PreMmodel
.
YXNum
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgJXNum
=
Math
.
Round
(
PreMmodel
.
JXNum
>
0
?
Convert
.
ToDecimal
(
NowMmodel
.
JXNum
-
PreMmodel
.
JXNum
)
/
PreMmodel
.
JXNum
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgTotalMNum
=
Math
.
Round
(
PreMmodel
.
TotalMNum
>
0
?
Convert
.
ToDecimal
(
NowMmodel
.
TotalMNum
-
PreMmodel
.
TotalMNum
)
/
PreMmodel
.
TotalMNum
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
MAvgPeopleNum
=
NowMmodel
.
MAvgPeopleNum
<=
0
?
0
:
Math
.
Round
(
PreMmodel
.
MAvgPeopleNum
>
0
?
(
NowMmodel
.
MAvgPeopleNum
-
PreMmodel
.
MAvgPeopleNum
)
/
PreMmodel
.
MAvgPeopleNum
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
MAvgOrderNum
=
NowMmodel
.
MAvgOrderNum
<=
0
?
0
:
Math
.
Round
(
PreMmodel
.
MAvgOrderNum
>
0
?
(
NowMmodel
.
MAvgOrderNum
-
PreMmodel
.
MAvgOrderNum
)
/
PreMmodel
.
MAvgOrderNum
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
MAvgPayMoney
=
NowMmodel
.
MAvgPayMoney
<=
0
?
0
:
Math
.
Round
(
PreMmodel
.
MAvgPayMoney
>
0
?
(
NowMmodel
.
MAvgPayMoney
-
PreMmodel
.
MAvgPayMoney
)
/
PreMmodel
.
MAvgPayMoney
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
MAvgBuyNum
=
NowMmodel
.
MAvgBuyNum
<=
0
?
0
:
Math
.
Round
(
PreMmodel
.
MAvgBuyNum
>
0
?
(
NowMmodel
.
MAvgBuyNum
-
PreMmodel
.
MAvgBuyNum
)
/
PreMmodel
.
MAvgBuyNum
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgOrderNum
=
NowMmodel
.
PAvgOrderNum
<=
0
?
0
:
Math
.
Round
(
PreMmodel
.
PAvgOrderNum
>
0
?
(
NowMmodel
.
PAvgOrderNum
-
PreMmodel
.
PAvgOrderNum
)
/
PreMmodel
.
PAvgOrderNum
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgBuyNum
=
NowMmodel
.
PAvgBuyNum
<=
0
?
0
:
Math
.
Round
(
PreMmodel
.
PAvgBuyNum
>
0
?
(
NowMmodel
.
PAvgBuyNum
-
PreMmodel
.
PAvgBuyNum
)
/
PreMmodel
.
PAvgBuyNum
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgUnitPrice
=
NowMmodel
.
PAvgUnitPrice
<=
0
?
0
:
Math
.
Round
(
PreMmodel
.
PAvgUnitPrice
>
0
?
(
NowMmodel
.
PAvgUnitPrice
-
PreMmodel
.
PAvgUnitPrice
)
/
PreMmodel
.
PAvgUnitPrice
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgBuyPrice
=
NowMmodel
.
PAvgBuyPrice
<=
0
?
0
:
Math
.
Round
(
PreMmodel
.
PAvgBuyPrice
>
0
?
(
NowMmodel
.
PAvgBuyPrice
-
PreMmodel
.
PAvgBuyPrice
)
/
PreMmodel
.
PAvgBuyPrice
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgMOrderRate
=
NowMmodel
.
PAvgMOrderRate
<=
0
?
0
:
Math
.
Round
(
PreMmodel
.
PAvgMOrderRate
>
0
?
(
NowMmodel
.
PAvgMOrderRate
-
PreMmodel
.
PAvgMOrderRate
)
/
PreMmodel
.
PAvgMOrderRate
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgProfitRate
=
NowMmodel
.
PAvgProfitRate
<=
0
?
0
:
Math
.
Round
(
PreMmodel
.
PAvgProfitRate
>
0
?
(
NowMmodel
.
PAvgProfitRate
-
PreMmodel
.
PAvgProfitRate
)
/
PreMmodel
.
PAvgProfitRate
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgProfit
=
NowMmodel
.
Profit
<=
0
?
0
:
Math
.
Round
(
PreMmodel
.
Profit
>
0
?
(
NowMmodel
.
Profit
-
PreMmodel
.
Profit
)
/
PreMmodel
.
Profit
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgPXNum
=
NowMmodel
.
PXNum
<=
0
?
0
:
Math
.
Round
(
PreMmodel
.
PXNum
>
0
?
Convert
.
ToDecimal
(
NowMmodel
.
PXNum
-
PreMmodel
.
PXNum
)
/
PreMmodel
.
PXNum
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgVipNum
=
NowMmodel
.
VipNum
<=
0
?
0
:
Math
.
Round
(
PreMmodel
.
VipNum
>
0
?
Convert
.
ToDecimal
(
NowMmodel
.
VipNum
-
PreMmodel
.
VipNum
)
/
PreMmodel
.
VipNum
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgYXNum
=
NowMmodel
.
YXNum
<=
0
?
0
:
Math
.
Round
(
PreMmodel
.
YXNum
>
0
?
Convert
.
ToDecimal
(
NowMmodel
.
YXNum
-
PreMmodel
.
YXNum
)
/
PreMmodel
.
YXNum
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgJXNum
=
NowMmodel
.
JXNum
<=
0
?
0
:
Math
.
Round
(
PreMmodel
.
JXNum
>
0
?
Convert
.
ToDecimal
(
NowMmodel
.
JXNum
-
PreMmodel
.
JXNum
)
/
PreMmodel
.
JXNum
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgTotalMNum
=
NowMmodel
.
TotalMNum
<=
0
?
0
:
Math
.
Round
(
PreMmodel
.
TotalMNum
>
0
?
Convert
.
ToDecimal
(
NowMmodel
.
TotalMNum
-
PreMmodel
.
TotalMNum
)
/
PreMmodel
.
TotalMNum
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
ReRateList
.
Add
(
smodel
);
if
(
SRateMonth
==
endTime
)
...
...
@@ -3339,15 +3339,15 @@ namespace Mall.Module.MarketingCenter
mmodel
.
BuyNum
=
mlist
.
Sum
(
x
=>
x
.
BuyNum
);
mmodel
.
TotalPayPeople
=
mlist
.
Any
()
?
mlist
.
Max
(
x
=>
x
.
PaymentNum
)
:
0
;
mmodel
.
Profit
=
mlist
.
Sum
(
x
=>
x
.
Profit
);
int
TotalPXNum
=
mlist
.
Any
()
?
mlist
.
Max
(
x
=>
x
.
PXLJNum
)
:
0
;
int
TotalVIPNum
=
mlist
.
Any
()
?
mlist
.
Max
(
x
=>
x
.
VipLJNum
)
:
0
;
int
TotalYXNum
=
mlist
.
Any
()
?
mlist
.
Max
(
x
=>
x
.
YXLJNum
)
:
0
;
int
TotalJXNum
=
mlist
.
Any
()
?
mlist
.
Max
(
x
=>
x
.
JXLJNum
)
:
0
;
mmodel
.
PXNum
=
TotalPXNum
;
mmodel
.
VipNum
=
TotalVIPNum
;
mmodel
.
YXNum
=
TotalYXNum
;
mmodel
.
JXNum
=
TotalJXNum
;
mmodel
.
TotalMNum
=
TotalPXNum
+
TotalVIPNum
+
TotalYXNum
+
Total
JXNum
;
//
int TotalPXNum = mlist.Any() ? mlist.Max(x => x.PXLJNum) : 0;
//
int TotalVIPNum = mlist.Any() ? mlist.Max(x => x.VipLJNum) : 0;
//
int TotalYXNum = mlist.Any() ? mlist.Max(x => x.YXLJNum) : 0;
//
int TotalJXNum = mlist.Any() ? mlist.Max(x => x.JXLJNum) : 0;
mmodel
.
PXNum
=
mlist
.
Sum
(
x
=>
x
.
PXNum
)
;
mmodel
.
VipNum
=
mlist
.
Sum
(
x
=>
x
.
VipNum
)
;
mmodel
.
YXNum
=
mlist
.
Sum
(
x
=>
x
.
YXNum
)
;
mmodel
.
JXNum
=
mlist
.
Sum
(
x
=>
x
.
JXNum
)
;
mmodel
.
TotalMNum
=
mmodel
.
PXNum
+
mmodel
.
VipNum
+
mmodel
.
YXNum
+
mmodel
.
JXNum
;
#
region
求月平均
#
region
月平均参数
...
...
@@ -3590,22 +3590,22 @@ namespace Mall.Module.MarketingCenter
var
PreMmodel
=
MonthSList
.
Where
(
x
=>
x
.
Date
==
Convert
.
ToDateTime
(
SRateMonth
+
"-01"
).
AddMonths
(-
1
).
ToString
(
"yyyy-MM"
)).
FirstOrDefault
();
User_Statistics_Rate_Query
smodel
=
new
User_Statistics_Rate_Query
()
{
Date
=
SRateMonth
};
smodel
.
MAvgPeopleNum
=
Math
.
Round
(
PreMmodel
.
MAvgPeopleNum
>
0
?
(
NowMmodel
.
MAvgPeopleNum
-
PreMmodel
.
MAvgPeopleNum
)
/
PreMmodel
.
MAvgPeopleNum
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
MAvgOrderNum
=
Math
.
Round
(
PreMmodel
.
MAvgOrderNum
>
0
?
(
NowMmodel
.
MAvgOrderNum
-
PreMmodel
.
MAvgOrderNum
)
/
PreMmodel
.
MAvgOrderNum
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
MAvgPayMoney
=
Math
.
Round
(
PreMmodel
.
MAvgPayMoney
>
0
?
(
NowMmodel
.
MAvgPayMoney
-
PreMmodel
.
MAvgPayMoney
)
/
PreMmodel
.
MAvgPayMoney
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
MAvgBuyNum
=
Math
.
Round
(
PreMmodel
.
MAvgBuyNum
>
0
?
(
NowMmodel
.
MAvgBuyNum
-
PreMmodel
.
MAvgBuyNum
)
/
PreMmodel
.
MAvgBuyNum
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgOrderNum
=
Math
.
Round
(
PreMmodel
.
PAvgOrderNum
>
0
?
(
NowMmodel
.
PAvgOrderNum
-
PreMmodel
.
PAvgOrderNum
)
/
PreMmodel
.
PAvgOrderNum
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgBuyNum
=
Math
.
Round
(
PreMmodel
.
PAvgBuyNum
>
0
?
(
NowMmodel
.
PAvgBuyNum
-
PreMmodel
.
PAvgBuyNum
)
/
PreMmodel
.
PAvgBuyNum
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgUnitPrice
=
Math
.
Round
(
PreMmodel
.
PAvgUnitPrice
>
0
?
(
NowMmodel
.
PAvgUnitPrice
-
PreMmodel
.
PAvgUnitPrice
)
/
PreMmodel
.
PAvgUnitPrice
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgBuyPrice
=
Math
.
Round
(
PreMmodel
.
PAvgBuyPrice
>
0
?
(
NowMmodel
.
PAvgBuyPrice
-
PreMmodel
.
PAvgBuyPrice
)
/
PreMmodel
.
PAvgBuyPrice
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgMOrderRate
=
Math
.
Round
(
PreMmodel
.
PAvgMOrderRate
>
0
?
(
NowMmodel
.
PAvgMOrderRate
-
PreMmodel
.
PAvgMOrderRate
)
/
PreMmodel
.
PAvgMOrderRate
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgProfitRate
=
Math
.
Round
(
PreMmodel
.
PAvgProfitRate
>
0
?
(
NowMmodel
.
PAvgProfitRate
-
PreMmodel
.
PAvgProfitRate
)
/
PreMmodel
.
PAvgProfitRate
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgProfit
=
Math
.
Round
(
PreMmodel
.
Profit
>
0
?
(
NowMmodel
.
Profit
-
PreMmodel
.
Profit
)
/
PreMmodel
.
Profit
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgPXNum
=
Math
.
Round
(
PreMmodel
.
PXNum
>
0
?
Convert
.
ToDecimal
(
NowMmodel
.
PXNum
-
PreMmodel
.
PXNum
)
/
PreMmodel
.
PXNum
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgVipNum
=
Math
.
Round
(
PreMmodel
.
VipNum
>
0
?
Convert
.
ToDecimal
(
NowMmodel
.
VipNum
-
PreMmodel
.
VipNum
)
/
PreMmodel
.
VipNum
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgYXNum
=
Math
.
Round
(
PreMmodel
.
YXNum
>
0
?
Convert
.
ToDecimal
(
NowMmodel
.
YXNum
-
PreMmodel
.
YXNum
)
/
PreMmodel
.
YXNum
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgJXNum
=
Math
.
Round
(
PreMmodel
.
JXNum
>
0
?
Convert
.
ToDecimal
(
NowMmodel
.
JXNum
-
PreMmodel
.
JXNum
)
/
PreMmodel
.
JXNum
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgTotalMNum
=
Math
.
Round
(
PreMmodel
.
TotalMNum
>
0
?
Convert
.
ToDecimal
(
NowMmodel
.
TotalMNum
-
PreMmodel
.
TotalMNum
)
/
PreMmodel
.
TotalMNum
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
MAvgPeopleNum
=
NowMmodel
.
MAvgPeopleNum
<=
0
?
0
:
Math
.
Round
(
PreMmodel
.
MAvgPeopleNum
>
0
?
(
NowMmodel
.
MAvgPeopleNum
-
PreMmodel
.
MAvgPeopleNum
)
/
PreMmodel
.
MAvgPeopleNum
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
MAvgOrderNum
=
NowMmodel
.
MAvgOrderNum
<=
0
?
0
:
Math
.
Round
(
PreMmodel
.
MAvgOrderNum
>
0
?
(
NowMmodel
.
MAvgOrderNum
-
PreMmodel
.
MAvgOrderNum
)
/
PreMmodel
.
MAvgOrderNum
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
MAvgPayMoney
=
NowMmodel
.
MAvgPayMoney
<=
0
?
0
:
Math
.
Round
(
PreMmodel
.
MAvgPayMoney
>
0
?
(
NowMmodel
.
MAvgPayMoney
-
PreMmodel
.
MAvgPayMoney
)
/
PreMmodel
.
MAvgPayMoney
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
MAvgBuyNum
=
NowMmodel
.
MAvgBuyNum
<=
0
?
0
:
Math
.
Round
(
PreMmodel
.
MAvgBuyNum
>
0
?
(
NowMmodel
.
MAvgBuyNum
-
PreMmodel
.
MAvgBuyNum
)
/
PreMmodel
.
MAvgBuyNum
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgOrderNum
=
NowMmodel
.
PAvgOrderNum
<=
0
?
0
:
Math
.
Round
(
PreMmodel
.
PAvgOrderNum
>
0
?
(
NowMmodel
.
PAvgOrderNum
-
PreMmodel
.
PAvgOrderNum
)
/
PreMmodel
.
PAvgOrderNum
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgBuyNum
=
NowMmodel
.
PAvgBuyNum
<=
0
?
0
:
Math
.
Round
(
PreMmodel
.
PAvgBuyNum
>
0
?
(
NowMmodel
.
PAvgBuyNum
-
PreMmodel
.
PAvgBuyNum
)
/
PreMmodel
.
PAvgBuyNum
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgUnitPrice
=
NowMmodel
.
PAvgUnitPrice
<=
0
?
0
:
Math
.
Round
(
PreMmodel
.
PAvgUnitPrice
>
0
?
(
NowMmodel
.
PAvgUnitPrice
-
PreMmodel
.
PAvgUnitPrice
)
/
PreMmodel
.
PAvgUnitPrice
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgBuyPrice
=
NowMmodel
.
PAvgBuyPrice
<=
0
?
0
:
Math
.
Round
(
PreMmodel
.
PAvgBuyPrice
>
0
?
(
NowMmodel
.
PAvgBuyPrice
-
PreMmodel
.
PAvgBuyPrice
)
/
PreMmodel
.
PAvgBuyPrice
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgMOrderRate
=
NowMmodel
.
PAvgMOrderRate
<=
0
?
0
:
Math
.
Round
(
PreMmodel
.
PAvgMOrderRate
>
0
?
(
NowMmodel
.
PAvgMOrderRate
-
PreMmodel
.
PAvgMOrderRate
)
/
PreMmodel
.
PAvgMOrderRate
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgProfitRate
=
NowMmodel
.
PAvgProfitRate
<=
0
?
0
:
Math
.
Round
(
PreMmodel
.
PAvgProfitRate
>
0
?
(
NowMmodel
.
PAvgProfitRate
-
PreMmodel
.
PAvgProfitRate
)
/
PreMmodel
.
PAvgProfitRate
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgProfit
=
NowMmodel
.
Profit
<=
0
?
0
:
Math
.
Round
(
PreMmodel
.
Profit
>
0
?
(
NowMmodel
.
Profit
-
PreMmodel
.
Profit
)
/
PreMmodel
.
Profit
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgPXNum
=
NowMmodel
.
PXNum
<=
0
?
0
:
Math
.
Round
(
PreMmodel
.
PXNum
>
0
?
Convert
.
ToDecimal
(
NowMmodel
.
PXNum
-
PreMmodel
.
PXNum
)
/
PreMmodel
.
PXNum
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgVipNum
=
NowMmodel
.
VipNum
<=
0
?
0
:
Math
.
Round
(
PreMmodel
.
VipNum
>
0
?
Convert
.
ToDecimal
(
NowMmodel
.
VipNum
-
PreMmodel
.
VipNum
)
/
PreMmodel
.
VipNum
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgYXNum
=
NowMmodel
.
YXNum
<=
0
?
0
:
Math
.
Round
(
PreMmodel
.
YXNum
>
0
?
Convert
.
ToDecimal
(
NowMmodel
.
YXNum
-
PreMmodel
.
YXNum
)
/
PreMmodel
.
YXNum
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgJXNum
=
NowMmodel
.
JXNum
<=
0
?
0
:
Math
.
Round
(
PreMmodel
.
JXNum
>
0
?
Convert
.
ToDecimal
(
NowMmodel
.
JXNum
-
PreMmodel
.
JXNum
)
/
PreMmodel
.
JXNum
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
smodel
.
PAvgTotalMNum
=
NowMmodel
.
TotalMNum
<=
0
?
0
:
Math
.
Round
(
PreMmodel
.
TotalMNum
>
0
?
Convert
.
ToDecimal
(
NowMmodel
.
TotalMNum
-
PreMmodel
.
TotalMNum
)
/
PreMmodel
.
TotalMNum
:
1
,
4
,
MidpointRounding
.
AwayFromZero
)
*
100
;
ReRateList
.
Add
(
smodel
);
if
(
SRateMonth
==
endTime
)
...
...
Mall.WindowsService/Helper/TimersHelper.cs
View file @
6c5bd868
...
...
@@ -46,6 +46,15 @@ namespace Mall.WindowsService.Helper
LogHelper
.
Write
(
"DistributorVipModule=====End"
);
#
endregion
#
region
电商统计
if
(
DateTime
.
Now
.
Hour
==
1
)
{
LogHelper
.
Write
(
"UpdateToDayUserStatistics=====Start"
);
new
Module
.
UserStatisticsModule
().
UpdateToDayUserStatistics
(
""
,
""
);
LogHelper
.
Write
(
"UpdateToDayUserStatistics=====End"
);
}
#
endregion
Interlocked
.
Exchange
(
ref
inTimer
,
0
);
}
...
...
Mall.WindowsService/Module/UserStatisticsModule.cs
View file @
6c5bd868
...
...
@@ -44,7 +44,7 @@ namespace Mall.WindowsService.Module
{
if
(
string
.
IsNullOrEmpty
(
StartTime
))
{
StartTime
=
DateTime
.
Now
.
AddMonths
(-
1
).
ToString
(
"yyyy-MM"
)
+
"-01"
;
StartTime
=
DateTime
.
Now
.
AddMonths
(-
6
).
ToString
(
"yyyy-MM"
)
+
"-01"
;
}
if
(
string
.
IsNullOrEmpty
(
EndTime
))
{
...
...
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