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
aa9de9a8
Commit
aa9de9a8
authored
Aug 24, 2020
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
0328682d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
119 additions
and
2 deletions
+119
-2
LiveHouseController.cs
Mall.WebApi/Controllers/AppletWeChat/LiveHouseController.cs
+119
-2
No files found.
Mall.WebApi/Controllers/AppletWeChat/LiveHouseController.cs
View file @
aa9de9a8
...
...
@@ -153,7 +153,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
item
.
NoPaid
=
item
.
ALLCommission
;
item
.
RemitFXCommission
=
item
.
RemitFXCommission
+
(!
string
.
IsNullOrWhiteSpace
(
item
.
LiveFinanceIds
)
?
item
.
LiveCommission
:
0
);
item
.
Paid
=
item
.
PaidCostMoney
+
item
.
RemitFXCommission
;
item
.
Paid
=
item
.
PaidCostMoney
+
item
.
RemitFXCommission
;
item
.
GrossProfit
=
(
item
.
AllPrice
+
item
.
RealMoney
)
-
item
.
CouponMoney
-
item
.
RefundActual
-
item
.
ALLCommission
-
item
.
PayMoney
;
item
.
GrossProfitRate
=
(
item
.
AllPrice
+
item
.
RealMoney
-
item
.
RefundActual
)
==
0
?
0
:
Math
.
Round
((
item
.
GrossProfit
/
((
item
.
AllPrice
+
item
.
RealMoney
-
item
.
RefundActual
)
==
0
?
1
:
(
item
.
AllPrice
+
item
.
RealMoney
-
item
.
RefundActual
))),
2
,
MidpointRounding
.
AwayFromZero
);
// item.GrossProfitRate = (item.AllPrice + item.RealMoney - item.RefundActual) == 0 ? 0 : Math.Round((item.GrossProfit / (item.AllPrice + item.RealMoney - item.RefundActual)), 2, MidpointRounding.AwayFromZero);
...
...
@@ -433,6 +433,49 @@ namespace Mall.WebApi.Controllers.AppletWeChat
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
item
.
GrossProfitRate
.
ToString
(
"#0.00"
))
{
});
slist
.
Add
(
datarow
);
}
if
(
list
!=
null
&&
list
.
Any
())
{
ExcelDataSource
datarow
=
new
ExcelDataSource
()
{
ExcelRows
=
new
List
<
ExcelColumn
>(
30
)
{
new
ExcelColumn
(
value
:
""
){
},
}
};
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
""
)
{
});
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
""
)
{
});
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
list
.
Sum
(
x
=>
x
.
Unit_Price
).
ToString
(
"#0.00"
))
{
});
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
list
.
Sum
(
x
=>
x
.
Number
).
ToString
())
{
});
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
""
)
{
});
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
list
.
Sum
(
x
=>
x
.
Final_Price
).
ToString
(
"#0.00"
))
{
});
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
(
list
.
Sum
(
x
=>
!
string
.
IsNullOrWhiteSpace
(
x
.
FreightMoney
)
?
Convert
.
ToDecimal
(
x
.
FreightMoney
)
:
0
)).
ToString
(
"#0.00"
))
{
});
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
list
.
Sum
(
x
=>
x
.
AllPrice
).
ToString
(
"#0.00"
))
{
});
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
"0"
)
{
});
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
list
.
Sum
(
x
=>
x
.
AllPrice
).
ToString
(
"#0.00"
))
{
});
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
list
.
Sum
(
x
=>
x
.
CostMoney
).
ToString
(
"#0.00"
))
{
});
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
list
.
Sum
(
x
=>
x
.
PackingMoney
).
ToString
(
"#0.00"
))
{
});
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
list
.
Sum
(
x
=>
x
.
GoodsFreight
).
ToString
(
"#0.00"
))
{
});
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
list
.
Sum
(
x
=>
x
.
PaidCostMoney
).
ToString
(
"#0.00"
))
{
});
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
list
.
Sum
(
x
=>
x
.
CostFreight
).
ToString
(
"#0.00"
))
{
});
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
list
.
Sum
(
x
=>
x
.
FXCommission
).
ToString
(
"#0.00"
))
{
});
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
list
.
Sum
(
x
=>
x
.
RemitFXCommission
).
ToString
(
"#0.00"
))
{
});
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
""
)
{
});
//返佣信息
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
list
.
Sum
(
x
=>
x
.
OtherPrice
).
ToString
(
"#0.00"
))
{
});
// datarow.ExcelRows.Add(new ExcelColumn(value: item.ALLCommission.ToString("#0.00")) { });
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
list
.
Sum
(
x
=>
x
.
Paid
).
ToString
(
"#0.00"
))
{
});
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
list
.
Sum
(
x
=>
x
.
NoPaid
).
ToString
(
"#0.00"
))
{
});
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
list
.
Sum
(
x
=>
x
.
CouponMoney
).
ToString
(
"#0.00"
))
{
});
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
list
.
Sum
(
x
=>
x
.
RefundActual
).
ToString
(
"#0.00"
))
{
});
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
list
.
Sum
(
x
=>
x
.
YSMoney
).
ToString
(
"#0.00"
))
{
});
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
list
.
Sum
(
x
=>
x
.
RealMoney
).
ToString
(
"#0.00"
))
{
});
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
list
.
Sum
(
x
=>
x
.
YFMoney
).
ToString
(
"#0.00"
))
{
});
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
list
.
Sum
(
x
=>
x
.
PayMoney
).
ToString
(
"#0.00"
))
{
});
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
list
.
Sum
(
x
=>
x
.
GrossProfit
).
ToString
(
"#0.00"
))
{
});
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
""
)
{
});
//datarow.ExcelRows.Add(new ExcelColumn(value: Math.Round((item.GrossProfit * (item.CompanyProfitRate / 100)), 2, MidpointRounding.AwayFromZero).ToString("#0.00")) { });
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
(
Math
.
Round
(
list
.
Sum
(
x
=>
x
.
GrossProfitRate
)
/
(
list
.
Count
()
==
0
?
1
:
list
.
Count
()),
2
,
MidpointRounding
.
AwayFromZero
)).
ToString
(
"#0.00"
))
{
});
slist
.
Add
(
datarow
);
}
#
endregion
var
byteData
=
ExcelTempLateHelper
.
ToExcelExtend
(
slist
);
...
...
@@ -485,6 +528,80 @@ namespace Mall.WebApi.Controllers.AppletWeChat
}
/// <summary>
/// 获取分销商
/// </summary>
/// <param name="requestMsg"></param>
/// <returns></returns>
[
HttpPost
]
[
AllowAnonymous
]
public
ApiResult
GetTotalOrderProfitLoss_V2
(
object
requestMsg
)
{
var
requestParm
=
JsonConvert
.
DeserializeObject
<
RequestParm
>(
requestMsg
.
ToString
());
OrderStatistics_Query
demodel
=
JsonConvert
.
DeserializeObject
<
OrderStatistics_Query
>(
requestParm
.
msg
.
ToString
());
demodel
.
TenantId
=
requestParm
.
TenantId
;
demodel
.
MallBaseId
=
requestParm
.
MallBaseId
;
List
<
OrderStatistics_Query
>
list
=
new
List
<
OrderStatistics_Query
>();
if
(
demodel
.
IsFxCommission
==
1
)
{
list
=
statisticsModule
.
GetFXAllOrderProfitLossList
(
demodel
);
}
else
if
(
demodel
.
IsFxCommission
==
0
)
{
demodel
.
IsSelectOrderCommission
=
1
;
list
=
statisticsModule
.
GetAllOrderProfitLossList
(
demodel
);
}
foreach
(
var
item
in
list
)
{
item
.
ALLCommission
=
item
.
CostFreight
+
item
.
CostMoney
+
item
.
PackingMoney
+
item
.
GoodsFreight
+
item
.
FXCommission
+
item
.
LiveCommission
+
item
.
OtherPrice
;
item
.
NoPaid
=
item
.
ALLCommission
;
item
.
RemitFXCommission
=
item
.
RemitFXCommission
+
(!
string
.
IsNullOrWhiteSpace
(
item
.
LiveFinanceIds
)
?
item
.
LiveCommission
:
0
);
item
.
Paid
=
item
.
PaidCostMoney
+
item
.
RemitFXCommission
;
item
.
GrossProfit
=
(
item
.
AllPrice
+
item
.
RealMoney
)
-
item
.
CouponMoney
-
item
.
RefundActual
-
item
.
ALLCommission
-
item
.
PayMoney
;
item
.
GrossProfitRate
=
(
item
.
AllPrice
+
item
.
RealMoney
)
==
0
?
0
:
Math
.
Round
((
item
.
GrossProfit
/
((
item
.
AllPrice
+
item
.
RealMoney
-
item
.
RefundActual
)
==
0
?
1
:
(
item
.
AllPrice
+
item
.
RealMoney
-
item
.
RefundActual
))),
2
,
MidpointRounding
.
AwayFromZero
);
}
var
retult
=
new
{
OrderNo
=
""
,
GoodsName
=
""
,
Unit_Price
=
list
.
Sum
(
x
=>
x
.
Unit_Price
),
//单价
Number
=
list
.
Sum
(
x
=>
x
.
Number
),
//数量
SupplierName
=
""
,
Final_Price
=
list
.
Sum
(
x
=>
x
.
Final_Price
),
//数量
FreightMoney
=
list
.
Sum
(
x
=>
!
string
.
IsNullOrWhiteSpace
(
x
.
FreightMoney
)
?
Convert
.
ToDecimal
(
x
.
FreightMoney
)
:
0
),
AllPrice
=
list
.
Sum
(
x
=>
x
.
AllPrice
),
CostMoney
=
list
.
Sum
(
x
=>
x
.
CostMoney
),
PackingMoney
=
list
.
Sum
(
x
=>
x
.
PackingMoney
),
GoodsFreight
=
list
.
Sum
(
x
=>
x
.
GoodsFreight
),
PaidCostMoney
=
list
.
Sum
(
x
=>
x
.
PaidCostMoney
),
CostFreight
=
list
.
Sum
(
x
=>
x
.
CostFreight
),
FXCommission
=
list
.
Sum
(
x
=>
x
.
FXCommission
),
RemitFXCommission
=
list
.
Sum
(
x
=>
x
.
RemitFXCommission
),
ALLCommission
=
list
.
Sum
(
x
=>
x
.
ALLCommission
),
OtherPrice
=
list
.
Sum
(
x
=>
x
.
OtherPrice
),
Paid
=
list
.
Sum
(
x
=>
x
.
Paid
),
NoPaid
=
list
.
Sum
(
x
=>
x
.
NoPaid
),
CouponMoney
=
list
.
Sum
(
x
=>
x
.
CouponMoney
),
RefundActual
=
list
.
Sum
(
x
=>
x
.
RefundActual
),
YSMoney
=
list
.
Sum
(
x
=>
x
.
YSMoney
),
RealMoney
=
list
.
Sum
(
x
=>
x
.
RealMoney
),
YFMoney
=
list
.
Sum
(
x
=>
x
.
YFMoney
),
PayMoney
=
list
.
Sum
(
x
=>
x
.
PayMoney
),
GrossProfit
=
list
.
Sum
(
x
=>
x
.
GrossProfit
),
CompanyName
=
""
,
GrossProfitRate
=
Math
.
Round
(
list
.
Sum
(
x
=>
x
.
GrossProfitRate
)
/
(
list
.
Count
()
==
0
?
1
:
list
.
Count
()),
2
,
MidpointRounding
.
AwayFromZero
),
//毛利率的平均值
};
return
ApiResult
.
Success
(
""
,
retult
);
}
/// <summary>
/// 获取分销商
/// </summary>
...
...
@@ -515,7 +632,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
item
.
RemitFXCommission
=
item
.
RemitFXCommission
+
(!
string
.
IsNullOrWhiteSpace
(
item
.
LiveFinanceIds
)
?
item
.
LiveCommission
:
0
);
item
.
Paid
=
item
.
PaidCostMoney
+
item
.
RemitFXCommission
;
item
.
GrossProfit
=
(
item
.
AllPrice
+
item
.
RealMoney
)
-
item
.
CouponMoney
-
item
.
RefundActual
-
item
.
ALLCommission
-
item
.
PayMoney
;
item
.
GrossProfitRate
=
(
item
.
AllPrice
+
item
.
RealMoney
)
==
0
?
0
:
Math
.
Round
((
item
.
GrossProfit
/
((
item
.
AllPrice
+
item
.
RealMoney
-
item
.
RefundActual
)
==
0
?
1
:
(
item
.
AllPrice
+
item
.
RealMoney
-
item
.
RefundActual
))),
2
,
MidpointRounding
.
AwayFromZero
);
item
.
GrossProfitRate
=
(
item
.
AllPrice
+
item
.
RealMoney
)
==
0
?
0
:
Math
.
Round
((
item
.
GrossProfit
/
((
item
.
AllPrice
+
item
.
RealMoney
-
item
.
RefundActual
)
==
0
?
1
:
(
item
.
AllPrice
+
item
.
RealMoney
-
item
.
RefundActual
))),
2
,
MidpointRounding
.
AwayFromZero
);
//item.GrossProfit = item.AllPrice - item.ALLCommission;
//item.GrossProfitRate = item.AllPrice == 0 ? 0 : Math.Round((item.GrossProfit / item.AllPrice), 2, MidpointRounding.AwayFromZero);
}
...
...
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