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
d93a1435
Commit
d93a1435
authored
Mar 25, 2020
by
guanzhenshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加指定sku利润特殊处理
parent
b3f7294d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
130 additions
and
26 deletions
+130
-26
Program.cs
Bailun.DC.DailyPurchaseSellStock/Program.cs
+19
-20
OrdersServices.cs
Bailun.DC.Services/OrdersServices.cs
+0
-0
OrdersController.cs
Bailun.DC.Web/Areas/Reports/Controllers/OrdersController.cs
+109
-4
Index.cshtml
Bailun.DC.Web/Pages/Index.cshtml
+2
-2
No files found.
Bailun.DC.DailyPurchaseSellStock/Program.cs
View file @
d93a1435
...
...
@@ -7,30 +7,29 @@ namespace Bailun.DC.DailyPurchaseSellStock
{
class
Program
{
static
async
Task
Main
(
string
[]
args
)
{
Console
.
WriteLine
(
"启动服务 "
+
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
));
var
builder
=
new
HostBuilder
().
ConfigureServices
((
hostContext
,
services
)
=>
{
services
.
AddHostedService
<
Services
>();
});
await
builder
.
RunConsoleAsync
();
}
//static void Main(string[] args)
//static async Task Main(string[] args)
//{
// var _services = new Services();
// var start = DateTime.Parse("2020-01-01");
// while (start.AddDays(1) < DateTime.Now)
// Console.WriteLine("启动服务 " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
// var builder = new HostBuilder().ConfigureServices((hostContext, services) =>
// {
// Console.WriteLine(start);
// _services.Init(start);
// }
// services.AddHostedService<Services>();
// });
// await builder.RunConsoleAsync();
//}
static
void
Main
(
string
[]
args
)
{
var
_services
=
new
Services
();
var
start
=
DateTime
.
Parse
(
"2020-03-23"
);
while
(
start
.
AddDays
(
1
)
<
DateTime
.
Now
)
{
Console
.
WriteLine
(
start
);
_services
.
Init
(
start
);
start
=
start
.
AddDays
(
1
);
}
}
}
}
Bailun.DC.Services/OrdersServices.cs
View file @
d93a1435
This diff is collapsed.
Click to expand it.
Bailun.DC.Web/Areas/Reports/Controllers/OrdersController.cs
View file @
d93a1435
...
...
@@ -1624,24 +1624,129 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
//Add by Allan at 20200320,for 增加sku级别的利润统计
if
(
producttype
.
Length
>
0
||
skusource
.
HasValue
||
shippingstrategy
.
HasValue
)
{
if
(
shipstart
.
HasValue
||
shipend
.
HasValue
)
{
result
=
_service
.
ListPlatformProfitByShipTime
(
platform
,
website
,
start
,
end
,
shipstart
,
shipend
,
currency
.
ToUpper
()
==
"USD"
,
companyid
,
skucategoryids
,
producttype
,
skusource
,
shippingstrategy
);
var
fbaResult
=
_service
.
ListPlatformProfit
(
string
.
IsNullOrEmpty
(
platform
)
?
"FBA"
:
""
,
website
,
null
,
null
,
null
,
null
,
currency
.
ToUpper
()
==
"USD"
,
companyid
,
skucategoryids
,
producttype
,
skusource
,
shippingstrategy
,
shipstart
,
shipend
);
result
.
AddRange
(
fbaResult
);
dtstart
=
shipstart
;
dtend
=
shipend
;
listRefund
=
_service
.
ListPlatformRefund
(
dtstart
,
dtend
,
companyid
,
platform
,
website
,
currency
.
ToUpper
()
==
"USD"
,
false
,
producttype
,
skusource
,
shippingstrategy
);
//不包含未发货的退款金额
//针对SKU FJH-L-2 做特殊处理
if
(
producttype
.
Length
>
0
)
{
var
result_FJH
=
_service
.
ListSkuProfit_FJH_L_2_ByShipTime
(
platform
,
website
,
start
,
end
,
shipstart
,
shipend
,
currency
.
ToUpper
()
==
"USD"
,
companyid
,
skucategoryids
,
producttype
,
skusource
,
shippingstrategy
);
var
fbaresult_FJH
=
_service
.
ListSkuProfit_FJH_L_2
(
string
.
IsNullOrEmpty
(
platform
)
?
"FBA"
:
""
,
website
,
null
,
null
,
null
,
null
,
currency
.
ToUpper
()
==
"USD"
,
companyid
,
skucategoryids
,
producttype
,
skusource
,
shippingstrategy
,
shipstart
,
shipend
);
foreach
(
var
item
in
result
)
{
var
objFJH
=
result_FJH
.
Where
(
a
=>
a
.
platform_type
==
item
.
platform_type
).
FirstOrDefault
();
if
(
objFJH
!=
null
)
{
item
.
cost_platform_fee
+=
objFJH
.
cost_platform_fee
;
item
.
profit_total
+=
objFJH
.
profit_total
;
item
.
amount_refund
+=
objFJH
.
amount_refund
;
item
.
amount_sales
+=
objFJH
.
amount_sales
;
item
.
cost_first
+=
objFJH
.
cost_first
;
item
.
cost_handle_bailun
+=
objFJH
.
cost_handle_bailun
;
item
.
cost_handle_platform
+=
objFJH
.
cost_handle_platform
;
item
.
cost_tail
+=
objFJH
.
cost_tail
;
item
.
amount_prepaid
+=
objFJH
.
amount_prepaid
;
item
.
cost_product
+=
objFJH
.
cost_product
;
item
.
cost_fba_fee
+=
objFJH
.
cost_fba_fee
;
item
.
cost_paypal_fee
+=
objFJH
.
cost_paypal_fee
;
}
}
foreach
(
var
item
in
fbaResult
)
{
var
objFJH
=
fbaresult_FJH
.
Where
(
a
=>
a
.
platform_type
==
item
.
platform_type
).
FirstOrDefault
();
if
(
objFJH
!=
null
)
{
item
.
cost_platform_fee
+=
objFJH
.
cost_platform_fee
;
item
.
profit_total
+=
objFJH
.
profit_total
;
item
.
amount_refund
+=
objFJH
.
amount_refund
;
item
.
amount_sales
+=
objFJH
.
amount_sales
;
item
.
cost_first
+=
objFJH
.
cost_first
;
item
.
cost_handle_bailun
+=
objFJH
.
cost_handle_bailun
;
item
.
cost_handle_platform
+=
objFJH
.
cost_handle_platform
;
item
.
cost_tail
+=
objFJH
.
cost_tail
;
item
.
amount_prepaid
+=
objFJH
.
amount_prepaid
;
item
.
cost_product
+=
objFJH
.
cost_product
;
item
.
cost_fba_fee
+=
objFJH
.
cost_fba_fee
;
item
.
cost_paypal_fee
+=
objFJH
.
cost_paypal_fee
;
}
}
//退款
var
listRefund_FJH
=
_service
.
ListSku_FJH_L_2_Refund
(
dtstart
,
dtend
,
companyid
,
platform
,
website
,
currency
.
ToUpper
()
==
"USD"
,
false
,
producttype
,
skusource
,
shippingstrategy
);
//不包含未发货的退款金额
foreach
(
var
item
in
listRefund
)
{
var
objRefundFJH
=
listRefund_FJH
.
Where
(
a
=>
a
.
platform_type
==
item
.
platform_type
).
FirstOrDefault
();
if
(
objRefundFJH
!=
null
)
{
item
.
amount_refund
+=
objRefundFJH
.
amount_refund
;
}
}
}
result
.
AddRange
(
fbaResult
);
}
else
{
result
=
_service
.
ListPlatformProfit
(
platform
,
website
,
start
,
end
,
shipstart
,
shipend
,
currency
.
ToUpper
()
==
"USD"
,
companyid
,
skucategoryids
,
producttype
,
skusource
,
shippingstrategy
);
listRefund
=
_service
.
ListPlatformRefund
(
dtstart
,
dtend
,
companyid
,
platform
,
website
,
currency
.
ToUpper
()
==
"USD"
,
true
,
producttype
,
skusource
,
shippingstrategy
);
//包含未发货的退款金额
//针对SKU FJH-L-2 做特殊处理
if
(
producttype
.
Length
>
0
)
{
var
result_FJH
=
_service
.
ListSkuProfit_FJH_L_2
(
platform
,
website
,
start
,
end
,
shipstart
,
shipend
,
currency
.
ToUpper
()
==
"USD"
,
companyid
,
skucategoryids
,
producttype
,
skusource
,
shippingstrategy
);
foreach
(
var
item
in
result
)
{
var
objFJH
=
result_FJH
.
Where
(
a
=>
a
.
platform_type
==
item
.
platform_type
).
FirstOrDefault
();
if
(
objFJH
!=
null
)
{
item
.
cost_platform_fee
+=
objFJH
.
cost_platform_fee
;
item
.
profit_total
+=
objFJH
.
profit_total
;
item
.
amount_refund
+=
objFJH
.
amount_refund
;
item
.
amount_sales
+=
objFJH
.
amount_sales
;
item
.
cost_first
+=
objFJH
.
cost_first
;
item
.
cost_handle_bailun
+=
objFJH
.
cost_handle_bailun
;
item
.
cost_handle_platform
+=
objFJH
.
cost_handle_platform
;
item
.
cost_tail
+=
objFJH
.
cost_tail
;
item
.
amount_prepaid
+=
objFJH
.
amount_prepaid
;
item
.
cost_product
+=
objFJH
.
cost_product
;
item
.
cost_fba_fee
+=
objFJH
.
cost_fba_fee
;
item
.
cost_paypal_fee
+=
objFJH
.
cost_paypal_fee
;
}
}
//退款
var
listRefund_FJH
=
_service
.
ListSku_FJH_L_2_Refund
(
dtstart
,
dtend
,
companyid
,
platform
,
website
,
currency
.
ToUpper
()
==
"USD"
,
false
,
producttype
,
skusource
,
shippingstrategy
);
//不包含未发货的退款金额
foreach
(
var
item
in
listRefund
)
{
var
objRefundFJH
=
listRefund_FJH
.
Where
(
a
=>
a
.
platform_type
==
item
.
platform_type
).
FirstOrDefault
();
if
(
objRefundFJH
!=
null
)
{
item
.
amount_refund
+=
objRefundFJH
.
amount_refund
;
}
}
}
}
ebayADFee
=
_service
.
EbayFeeCount
(
companyid
,
dtstart
,
dtend
,
ADfeeType
,
""
,
""
,
currency
.
ToUpper
()
==
"USD"
,
""
,
producttype
,
skusource
,
shippingstrategy
);
ebayPutAway
=
_service
.
EbayFeeCount
(
companyid
,
dtstart
,
dtend
,
PutAwayFeeType
,
""
,
""
,
currency
.
ToUpper
()
==
"USD"
,
""
,
producttype
,
skusource
,
shippingstrategy
);
...
...
@@ -1651,6 +1756,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
aliexpressAD
=
_service
.
ListAliexpressADCount
(
companyid
,
""
,
dtstart
,
dtend
,
currency
.
ToUpper
()
==
"USD"
);
wishAD
=
_service
.
ListWishADCount
(
companyid
,
null
,
dtstart
,
dtend
,
currency
.
ToUpper
()
==
"USD"
);
//aliexpressAD = _service.ListAliexpressADCount(companyid, "", dtstart, dtend, currency.ToUpper() == "USD");
}
else
{
...
...
@@ -1679,7 +1785,6 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
wishAD
=
_service
.
ListWishADCount
(
companyid
,
null
,
dtstart
,
dtend
,
currency
.
ToUpper
()
==
"USD"
);
aliexpressAD
=
_service
.
ListAliexpressADCount
(
companyid
,
""
,
dtstart
,
dtend
,
currency
.
ToUpper
()
==
"USD"
);
}
foreach
(
var
item
in
result
)
...
...
Bailun.DC.Web/Pages/Index.cshtml
View file @
d93a1435
...
...
@@ -29,8 +29,8 @@
<body
class=
"fixed-sidebar full-height-layout gray-bg"
style=
"overflow:hidden"
>
<script
type=
"text/javascript"
>
//
login_localhost();
login
();
login_localhost
();
//
login();
window
.
location
=
"@Url.Content("
~
/Home/
Main
")"
;
</script>
</body>
...
...
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