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
2456efc9
Commit
2456efc9
authored
Sep 23, 2020
by
guanzhenshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
亚马逊广告列表增加广告类型字段,导出增加广告类型字段
parent
60f94bd5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
13 deletions
+54
-13
dc_base_finance_amazon_ad_product.cs
Bailun.DC.Models/dc_base_finance_amazon_ad_product.cs
+13
-0
OrdersServices.cs
Bailun.DC.Services/OrdersServices.cs
+19
-4
OrdersController.cs
Bailun.DC.Web/Areas/Reports/Controllers/OrdersController.cs
+11
-9
AmazonAD.cshtml
Bailun.DC.Web/Areas/Reports/Views/Orders/AmazonAD.cshtml
+11
-0
No files found.
Bailun.DC.Models/dc_base_finance_amazon_ad_product.cs
View file @
2456efc9
...
...
@@ -232,5 +232,18 @@ namespace Bailun.DC.Models
public
string
site_en
{
get
;
set
;
}
public
string
platform
{
get
;
set
;
}
/// <summary>
/// 广告类型 1-广告推广 2-品牌推广 3-品牌推广(视频) 4品牌展示
/// </summary>
public
int
type
{
get
;
set
;
}
}
public
enum
enum_AmazonAdType
{
广告推广
=
1
,
品牌推广
=
2
,
品牌推广
_
视频
=
3
,
品牌展示
=
4
}
}
Bailun.DC.Services/OrdersServices.cs
View file @
2456efc9
...
...
@@ -5735,10 +5735,10 @@ namespace Bailun.DC.Services
/// <param name="companyid"></param>
/// <param name="total"></param>
/// <returns></returns>
public
List
<
dc_base_finance_amazon_ad_product
>
ListAmazonADSku
(
BtTableParameter
parameter
,
string
account
,
DateTime
?
start
,
DateTime
?
end
,
int
?
companyid
,
ref
int
total
)
public
List
<
dc_base_finance_amazon_ad_product
>
ListAmazonADSku
(
BtTableParameter
parameter
,
string
account
,
DateTime
?
start
,
DateTime
?
end
,
int
?
companyid
,
int
?
type
,
ref
int
total
)
{
var
sqlparam
=
new
DynamicParameters
();
var
sql
=
"select t2.account_name,t1.sku,t1.currency,cost,(cost*exchange_rate) cost_rmb,report_date from dc_base_finance_amazon_ad_product t1 join dc_base_company_account t2 on t1.account_id=t2.account_id "
;
var
sql
=
"select t2.account_name,t1.sku,t1.currency,cost,(cost*exchange_rate) cost_rmb,report_date
,type
from dc_base_finance_amazon_ad_product t1 join dc_base_company_account t2 on t1.account_id=t2.account_id "
;
if
(!
string
.
IsNullOrEmpty
(
account
))
{
...
...
@@ -5766,6 +5766,11 @@ namespace Bailun.DC.Services
sqlparam
.
Add
(
"end"
,
end
.
Value
.
AddDays
(
1
));
}
if
(
type
.
HasValue
)
{
sql
+=
" and t1.type="
+
type
.
Value
;
}
if
(!
string
.
IsNullOrEmpty
(
parameter
.
sort
))
{
sql
+=
" order by t1."
+
parameter
.
sort
+
" "
+
parameter
.
order
;
...
...
@@ -5794,7 +5799,7 @@ namespace Bailun.DC.Services
/// <param name="companyid"></param>
/// <param name="total"></param>
/// <returns></returns>
public
List
<
dc_base_finance_amazon_ad_product
>
ListAmazonADSku
(
string
account
,
DateTime
?
start
,
DateTime
?
end
,
int
?
companyid
)
public
List
<
dc_base_finance_amazon_ad_product
>
ListAmazonADSku
(
string
account
,
DateTime
?
start
,
DateTime
?
end
,
int
?
companyid
,
int
?
type
)
{
var
sqlparam
=
new
DynamicParameters
();
var
sql
=
"select t2.account_name,t1.sku,t1.currency,cost,(cost*exchange_rate) cost_rmb,report_date,asin,t2.site_en from dc_base_finance_amazon_ad_product t1 join dc_base_company_account t2 on t1.account_id=t2.account_id "
;
...
...
@@ -5825,6 +5830,11 @@ namespace Bailun.DC.Services
sqlparam
.
Add
(
"end"
,
end
.
Value
.
AddDays
(
1
));
}
if
(
type
.
HasValue
)
{
sql
+=
" and t1.type="
+
type
.
Value
;
}
using
(
var
cn
=
new
MySqlConnection
(
Common
.
GlobalConfig
.
ConnectionString
))
{
...
...
@@ -5847,7 +5857,7 @@ namespace Bailun.DC.Services
/// <param name="end"></param>
/// <param name="companyid"></param>
/// <returns></returns>
public
dc_base_finance_amazon_ad_product
ListAmazonADSkuCount
(
string
account
,
DateTime
?
start
,
DateTime
?
end
,
int
?
companyid
,
bool
isUSD
,
int
[]
producttype
,
int
?
skusource
,
int
?
shippingstrategy
,
string
platform
,
string
website
)
public
dc_base_finance_amazon_ad_product
ListAmazonADSkuCount
(
string
account
,
DateTime
?
start
,
DateTime
?
end
,
int
?
companyid
,
bool
isUSD
,
int
[]
producttype
,
int
?
skusource
,
int
?
shippingstrategy
,
string
platform
,
string
website
,
int
?
type
)
{
if
(
platform
!=
null
&&
platform
.
ToLower
()
!=
"fba"
)
{
...
...
@@ -5920,6 +5930,11 @@ namespace Bailun.DC.Services
sqlparam
.
Add
(
"end"
,
end
.
Value
.
AddDays
(
1
));
}
if
(
type
.
HasValue
)
{
sql
+=
" and t1.type="
+
type
.
Value
;
}
using
(
var
cn
=
new
MySqlConnection
(
Common
.
GlobalConfig
.
ConnectionString
))
{
if
(
cn
.
State
==
System
.
Data
.
ConnectionState
.
Closed
)
...
...
Bailun.DC.Web/Areas/Reports/Controllers/OrdersController.cs
View file @
2456efc9
...
...
@@ -1787,7 +1787,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
ebayADFee
=
_service
.
EbayFeeCount
(
companyid
,
dtstart
,
dtend
,
ADfeeType
,
""
,
""
,
currency
.
ToUpper
()
==
"USD"
,
""
,
producttype
,
skusource
,
shippingstrategy
,
platform
,
website
);
ebayPutAway
=
_service
.
EbayFeeCount
(
companyid
,
dtstart
,
dtend
,
PutAwayFeeType
,
""
,
""
,
currency
.
ToUpper
()
==
"USD"
,
""
,
producttype
,
skusource
,
shippingstrategy
,
platform
,
website
);
amazonAD
=
_service
.
ListAmazonADSkuCount
(
""
,
dtstart
,
dtend
,
companyid
,
currency
.
ToUpper
()
==
"USD"
,
producttype
,
skusource
,
shippingstrategy
,
platform
,
website
);
amazonAD
=
_service
.
ListAmazonADSkuCount
(
""
,
dtstart
,
dtend
,
companyid
,
currency
.
ToUpper
()
==
"USD"
,
producttype
,
skusource
,
shippingstrategy
,
platform
,
website
,
null
);
aliexpressAD
=
_service
.
ListAliexpressADCount
(
companyid
,
""
,
dtstart
,
dtend
,
currency
.
ToUpper
()
==
"USD"
);
wishAD
=
_service
.
ListWishADCount
(
companyid
,
null
,
dtstart
,
dtend
,
currency
.
ToUpper
()
==
"USD"
);
...
...
@@ -1832,7 +1832,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
ebayADFee
=
_service
.
EbayFeeCount
(
companyid
,
dtstart
,
dtend
,
ADfeeType
,
""
,
""
,
currency
.
ToUpper
()
==
"USD"
,
""
,
null
,
null
,
null
,
platform
,
website
);
ebayPutAway
=
_service
.
EbayFeeCount
(
companyid
,
dtstart
,
dtend
,
PutAwayFeeType
,
""
,
""
,
currency
.
ToUpper
()
==
"USD"
,
""
,
null
,
null
,
null
,
platform
,
website
);
amazonAD
=
_service
.
ListAmazonADSkuCount
(
""
,
dtstart
,
dtend
,
companyid
,
currency
.
ToUpper
()
==
"USD"
,
null
,
null
,
null
,
platform
,
website
);
amazonAD
=
_service
.
ListAmazonADSkuCount
(
""
,
dtstart
,
dtend
,
companyid
,
currency
.
ToUpper
()
==
"USD"
,
null
,
null
,
null
,
platform
,
website
,
null
);
wishAD
=
_service
.
ListWishADCount
(
companyid
,
null
,
dtstart
,
dtend
,
currency
.
ToUpper
()
==
"USD"
);
aliexpressAD
=
_service
.
ListAliexpressADCount
(
companyid
,
""
,
dtstart
,
dtend
,
currency
.
ToUpper
()
==
"USD"
);
}
...
...
@@ -2845,14 +2845,14 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
/// <returns></returns>
[
BailunAuthentication
(
LoginMode
.
Enforce
)]
[
BrowseLog
(
"Bailun_data"
,
"访问【百伦数据中心】->【分平台利润统计】->【亚马逊】->【亚马逊广告费】->【查询】页面"
,
0
)]
public
string
AmazonADJson
(
BtTableParameter
parameter
,
DateTime
?
start
,
DateTime
?
end
,
string
account
)
public
string
AmazonADJson
(
BtTableParameter
parameter
,
DateTime
?
start
,
DateTime
?
end
,
string
account
,
int
?
t
)
{
var
_service
=
new
Services
.
OrdersServices
();
var
companyid
=
HttpContextHelper
.
Current
?.
User
?.
GetCompanyId
().
ToInt32
();
var
total
=
0
;
var
obj
=
_service
.
ListAmazonADSku
(
parameter
,
account
,
start
,
end
,
companyid
,
ref
total
);
var
countObj
=
_service
.
ListAmazonADSkuCount
(
account
,
start
,
end
,
companyid
,
false
,
null
,
null
,
null
,
""
,
""
);
var
obj
=
_service
.
ListAmazonADSku
(
parameter
,
account
,
start
,
end
,
companyid
,
t
,
ref
total
);
var
countObj
=
_service
.
ListAmazonADSkuCount
(
account
,
start
,
end
,
companyid
,
false
,
null
,
null
,
null
,
null
,
""
,
t
);
var
list
=
obj
.
Select
(
a
=>
new
{
a
.
account_name
,
...
...
@@ -2861,6 +2861,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
a
.
currency
,
cost_rmb
=
a
.
cost_rmb
.
ToString
(
"N2"
),
report_date
=
a
.
report_date
.
ToString
(
"yyyy-MM-dd"
),
type
=
Enum
.
GetName
(
typeof
(
enum_AmazonAdType
),
a
.
type
)
});
return
JsonConvert
.
SerializeObject
(
new
...
...
@@ -2885,10 +2886,10 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
/// <param name="end"></param>
/// <param name="account"></param>
/// <returns></returns>
public
ActionResult
ExportAmazonAD
(
DateTime
?
start
,
DateTime
?
end
,
string
account
,
int
companyid
)
public
ActionResult
ExportAmazonAD
(
DateTime
?
start
,
DateTime
?
end
,
string
account
,
int
companyid
,
int
?
t
)
{
var
_service
=
new
Services
.
OrdersServices
();
var
obj
=
_service
.
ListAmazonADSku
(
account
,
start
,
end
,
companyid
);
var
obj
=
_service
.
ListAmazonADSku
(
account
,
start
,
end
,
companyid
,
t
);
var
list
=
obj
.
Select
(
a
=>
new
{
a
.
asin
,
...
...
@@ -2899,10 +2900,11 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
cost_rmb
=
a
.
cost_rmb
.
ToString
(
"N2"
),
report_date
=
a
.
report_date
.
ToString
(
"yyyy-MM-dd"
),
a
.
site_en
,
a
.
type
});
var
colNames
=
new
List
<
string
>
{
"帐号"
,
"SKU"
,
"费用"
,
"币种"
,
"费用RMB"
,
"ASIN"
,
"站点"
,
"报告日期"
"ASIN"
,
"站点"
,
"报告日期"
,
"广告类型"
};
var
listVal
=
new
List
<
string
>();
...
...
@@ -2910,7 +2912,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
{
listVal
.
Add
(
item
.
account_name
+
"|"
+
item
.
sku
+
"|"
+
item
.
cost
+
"|"
+
item
.
currency
+
"|"
+
item
.
cost_rmb
+
"|"
+
item
.
asin
+
"|"
+
item
.
site_en
+
"|"
+
item
.
report_date
item
.
asin
+
"|"
+
item
.
site_en
+
"|"
+
item
.
report_date
+
"|"
+(
Enum
.
GetName
(
typeof
(
enum_AmazonAdType
),
item
.
type
))
);
}
...
...
Bailun.DC.Web/Areas/Reports/Views/Orders/AmazonAD.cshtml
View file @
2456efc9
...
...
@@ -17,6 +17,16 @@
</select>
</div>
<div class="form-group">
<label> </label>
<select id="t" name="t" class="form-control">
<option value="">广告类型</option>
<option value="1">广告推广</option>
<option value="2">品牌推广</option>
<option value="3">品牌推广_视频</option>
<option value="4">品牌展示</option>
</select>
</div>
<div class="form-group">
<label>费用时间</label>
<input id="start" name="start" type="text" class="form-control" style="width:130px;" value="@(DateTime.Now.AddDays(-7).ToString("yyyy-MM-dd"))" />
<span>至</span>
...
...
@@ -77,6 +87,7 @@
},
{ field: 'sku', title: 'SKU', width: '120', sortable: true },
{ field: 'cost', title: '费用', width: '120', sortable: true, iscount: true },
{ field: 'type', title: '广告类型', width: '150' },
{ field: 'currency', title: '币种', width: '130' },
{ field: 'cost_rmb', title: '费用RMB', width: '100', iscount: true},
{ field: 'report_date', title: '报告日期', width: '100' }
...
...
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