Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
DataCenter_Core2.1_20190520
Overview
Overview
Details
Activity
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
bltdc
DataCenter_Core2.1_20190520
Commits
c4c37a35
Commit
c4c37a35
authored
Oct 19, 2021
by
DESKTOP-732ATD8\BLT
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加功能:Shopify 广告费
parent
cc7d3996
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
1 deletion
+45
-1
OrdersServices.cs
Bailun.DC.Services/OrdersServices.cs
+32
-0
OrdersController.cs
Bailun.DC.Web/Areas/Reports/Controllers/OrdersController.cs
+12
-0
BaseController.cs
Bailun.DC.Web/Base/BaseController.cs
+1
-1
No files found.
Bailun.DC.Services/OrdersServices.cs
View file @
c4c37a35
...
@@ -6597,6 +6597,38 @@ namespace Bailun.DC.Services
...
@@ -6597,6 +6597,38 @@ namespace Bailun.DC.Services
}
}
#
endregion
#
region
Shopify
public
decimal
ShopifyAD
(
DateTime
?
start
,
DateTime
?
end
,
bool
isUSD
)
{
var
sqlparam
=
new
DynamicParameters
();
var
sql
=
$" select round(sum(fee *
{(
isUSD
?
"1"
:
"cny_exchange_rate"
)}
),2) as fee from dc_base_finance_shopify_fee where status = 0"
;
if
(
start
.
HasValue
)
{
sql
+=
" and bdate >= @bdate"
;
sqlparam
.
Add
(
"bdate"
,
start
.
Value
.
Date
);
}
if
(
end
.
HasValue
)
{
sql
+=
" and edate < @edate"
;
sqlparam
.
Add
(
"edate"
,
end
.
Value
.
Date
.
AddDays
(
1
));
}
using
(
var
cn
=
new
MySqlConnection
(
Common
.
GlobalConfig
.
ConnectionString_read
))
{
if
(
cn
.
State
==
System
.
Data
.
ConnectionState
.
Closed
)
{
cn
.
Open
();
}
var
obj
=
cn
.
QueryFirstOrDefault
<
decimal
?>(
sql
,
sqlparam
,
null
,
2
*
60
)
??
0
;
return
obj
;
}
}
#
endregion
#
endregion
...
...
Bailun.DC.Web/Areas/Reports/Controllers/OrdersController.cs
View file @
c4c37a35
...
@@ -1645,6 +1645,9 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
...
@@ -1645,6 +1645,9 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
//Add by Allan at 20210608 for Ebay 新接口
//Add by Allan at 20210608 for Ebay 新接口
var
ebayADFeeNew
=
new
dc_base_ebay_transaction
();
//Ebay 新广告费
var
ebayADFeeNew
=
new
dc_base_ebay_transaction
();
//Ebay 新广告费
var
ebayPutAwayNew
=
new
dc_base_ebay_transaction
();
//Ebay 上架费
var
ebayPutAwayNew
=
new
dc_base_ebay_transaction
();
//Ebay 上架费
decimal
shopifyFee
=
0
;
//Shopify 广告费
var
ADfeeTypeNew
=
new
string
[]
{
var
ADfeeTypeNew
=
new
string
[]
{
"AD_FEE"
"AD_FEE"
};
};
...
@@ -1832,6 +1835,8 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
...
@@ -1832,6 +1835,8 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
ebayADFeeNew
=
_service
.
EbayADFeeNew
(
companyid
,
dtstart
,
dtend
,
ADfeeTypeNew
,
null
,
""
,
""
,
currency
.
ToUpper
()
==
"USD"
,
""
,
producttype
,
skusource
,
shippingstrategy
,
platform
,
website
);
ebayADFeeNew
=
_service
.
EbayADFeeNew
(
companyid
,
dtstart
,
dtend
,
ADfeeTypeNew
,
null
,
""
,
""
,
currency
.
ToUpper
()
==
"USD"
,
""
,
producttype
,
skusource
,
shippingstrategy
,
platform
,
website
);
ebayPutAwayNew
=
_service
.
EbayADFeeNew
(
companyid
,
dtstart
,
dtend
,
PutAwayFeeTypeNew
,
null
,
""
,
""
,
currency
.
ToUpper
()
==
"USD"
,
""
,
producttype
,
skusource
,
shippingstrategy
,
platform
,
website
);
ebayPutAwayNew
=
_service
.
EbayADFeeNew
(
companyid
,
dtstart
,
dtend
,
PutAwayFeeTypeNew
,
null
,
""
,
""
,
currency
.
ToUpper
()
==
"USD"
,
""
,
producttype
,
skusource
,
shippingstrategy
,
platform
,
website
);
//End Add
//End Add
shopifyFee
=
_service
.
ShopifyAD
(
dtstart
,
dtend
,
currency
.
ToUpper
()
==
"USD"
);
}
}
else
else
{
{
...
@@ -1881,6 +1886,8 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
...
@@ -1881,6 +1886,8 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
ebayADFeeNew
=
_service
.
EbayADFeeNew
(
companyid
,
dtstart
,
dtend
,
ADfeeTypeNew
,
null
,
""
,
""
,
currency
.
ToUpper
()
==
"USD"
,
""
,
producttype
,
skusource
,
shippingstrategy
,
platform
,
website
);
ebayADFeeNew
=
_service
.
EbayADFeeNew
(
companyid
,
dtstart
,
dtend
,
ADfeeTypeNew
,
null
,
""
,
""
,
currency
.
ToUpper
()
==
"USD"
,
""
,
producttype
,
skusource
,
shippingstrategy
,
platform
,
website
);
ebayPutAwayNew
=
_service
.
EbayADFeeNew
(
companyid
,
dtstart
,
dtend
,
PutAwayFeeTypeNew
,
null
,
""
,
""
,
currency
.
ToUpper
()
==
"USD"
,
""
,
producttype
,
skusource
,
shippingstrategy
,
platform
,
website
);
ebayPutAwayNew
=
_service
.
EbayADFeeNew
(
companyid
,
dtstart
,
dtend
,
PutAwayFeeTypeNew
,
null
,
""
,
""
,
currency
.
ToUpper
()
==
"USD"
,
""
,
producttype
,
skusource
,
shippingstrategy
,
platform
,
website
);
//End Add
//End Add
shopifyFee
=
_service
.
ShopifyAD
(
dtstart
,
dtend
,
currency
.
ToUpper
()
==
"USD"
);
}
}
else
else
{
{
...
@@ -2051,6 +2058,11 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
...
@@ -2051,6 +2058,11 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
item
.
profit_total
=
(
item
.
profit_total
-
item
.
adfee
??
0
);
item
.
profit_total
=
(
item
.
profit_total
-
item
.
adfee
??
0
);
item
.
profit_rate
=
(
item
.
amount_sales
-
item
.
amount_prepaid
)
!=
0
?
Math
.
Round
((
item
.
profit_total
/
(
item
.
amount_sales
-
item
.
amount_prepaid
)),
2
)
:
0
;
item
.
profit_rate
=
(
item
.
amount_sales
-
item
.
amount_prepaid
)
!=
0
?
Math
.
Round
((
item
.
profit_total
/
(
item
.
amount_sales
-
item
.
amount_prepaid
)),
2
)
:
0
;
}
}
else
if
(
item
.
platform_type
.
ToLower
()
==
"shopify"
)
//Shopify广告费
{
item
.
adfee
=
shopifyFee
;
}
}
}
else
if
(
statistictype
==
1
)
else
if
(
statistictype
==
1
)
{
{
...
...
Bailun.DC.Web/Base/BaseController.cs
View file @
c4c37a35
...
@@ -262,7 +262,7 @@ namespace Bailun.DC.Web.Base
...
@@ -262,7 +262,7 @@ namespace Bailun.DC.Web.Base
paramdata
=
""
,
paramdata
=
""
,
hashcode
=
""
,
hashcode
=
""
,
filekey
=
""
,
filekey
=
""
,
createtime
=
DateTime
.
Now
,
datatype
=
datatype
//1=销售平台
datatype
=
datatype
//1=销售平台
};
};
...
...
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