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
aa76909a
Commit
aa76909a
authored
Oct 09, 2022
by
jianshuqin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加ShopifyGoogle平台广告费
parent
7ac88b23
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
17 deletions
+18
-17
response_shopify_fee.cs
Bailun.DC.SyncShopifyFee/Models/response_shopify_fee.cs
+2
-0
Services.cs
Bailun.DC.SyncShopifyFee/Services.cs
+16
-17
No files found.
Bailun.DC.SyncShopifyFee/Models/response_shopify_fee.cs
View file @
aa76909a
...
...
@@ -21,5 +21,7 @@ namespace Bailun.DC.SyncShopifyFee.Models
public
string
account_currency
{
get
;
set
;
}
public
decimal
?
cny_exchange_rate
{
get
;
set
;
}
public
string
platform
{
get
;
set
;
}
}
}
Bailun.DC.SyncShopifyFee/Services.cs
View file @
aa76909a
...
...
@@ -14,19 +14,19 @@ namespace Bailun.DC.SyncShopifyFee
public
class
Services
:
BackgroundService
{
IDictionary
<
string
,
string
>
dicWebsitePlatform
=
new
Dictionary
<
string
,
string
>
{
{
"scrm
_Facebook
"
,
"http://scrm.bailuntec.com/ScrmApi/api/ApiGetAdFeeLog"
},
//?btime=2021-10-01&etime=2021-10-03&page=1&rows=100
{
"scrm"
,
"http://scrm.bailuntec.com/ScrmApi/api/ApiGetAdFeeLog"
},
//?btime=2021-10-01&etime=2021-10-03&page=1&rows=100
{
"scrm_Google"
,
"http://scrm.bailuntec.com/ScrmApi/api/ApiGetAdFeeLogFull"
},
//?btime=2021-10-01&etime=2021-10-03&page=1&rows=100
{
"au
_Facebook
"
,
"http://au.btm.bailuntec.com/ScrmApi/api/ApiGetAdFeeLog"
},
//?btime=2021-10-01&etime=2021-10-03&page=1&rows=100
{
"au2
_Facebook
"
,
"http://au2.btm.bailuntec.com/ScrmApi/api/ApiGetAdFeeLog"
},
//?btime=2021-10-01&etime=2021-10-03&page=1&rows=100
{
"de
_Facebook
"
,
"http://de.btm.bailuntec.com/ScrmApi/api/ApiGetAdFeeLog"
},
//?btime=2021-10-01&etime=2021-10-03&page=1&rows=100
{
"fr
_Facebook
"
,
"http://fr.btm.bailuntec.com/ScrmApi/api/ApiGetAdFeeLog"
},
//?btime=2021-10-01&etime=2021-10-03&page=1&rows=100
{
"my
_Facebook
"
,
"http://my.btm.bailuntec.com/ScrmApi/api/ApiGetAdFeeLog"
},
//?btime=2021-10-01&etime=2021-10-03&page=1&rows=100
{
"td
_Facebook
"
,
"http://td.btm.bailuntec.com/ScrmApi/api/ApiGetAdFeeLog"
},
//?btime=2021-10-01&etime=2021-10-03&page=1&rows=100
{
"uk
_Facebook
"
,
"http://uk.btm.bailuntec.com/ScrmApi/api/ApiGetAdFeeLog"
},
//?btime=2021-10-01&etime=2021-10-03&page=1&rows=100
{
"us
_Facebook
"
,
"http://us.btm.bailuntec.com/ScrmApi/api/ApiGetAdFeeLog"
},
//?btime=2021-10-01&etime=2021-10-03&page=1&rows=100
{
"us2
_Facebook
"
,
"http://us2.btm.bailuntec.com/ScrmApi/api/ApiGetAdFeeLog"
},
//?btime=2021-10-01&etime=2021-10-03&page=1&rows=100
{
"us3
_Facebook
"
,
"http://us3.btm.bailuntec.com/ScrmApi/api/ApiGetAdFeeLog"
},
//?btime=2021-10-01&etime=2021-10-03&page=1&rows=100
{
"us4
_Facebook
"
,
"http://us4.btm.bailuntec.com/ScrmApi/api/ApiGetAdFeeLog"
},
//?btime=2021-10-01&etime=2021-10-03&page=1&rows=100
{
"au"
,
"http://au.btm.bailuntec.com/ScrmApi/api/ApiGetAdFeeLog"
},
//?btime=2021-10-01&etime=2021-10-03&page=1&rows=100
{
"au2"
,
"http://au2.btm.bailuntec.com/ScrmApi/api/ApiGetAdFeeLog"
},
//?btime=2021-10-01&etime=2021-10-03&page=1&rows=100
{
"de"
,
"http://de.btm.bailuntec.com/ScrmApi/api/ApiGetAdFeeLog"
},
//?btime=2021-10-01&etime=2021-10-03&page=1&rows=100
{
"fr"
,
"http://fr.btm.bailuntec.com/ScrmApi/api/ApiGetAdFeeLog"
},
//?btime=2021-10-01&etime=2021-10-03&page=1&rows=100
{
"my"
,
"http://my.btm.bailuntec.com/ScrmApi/api/ApiGetAdFeeLog"
},
//?btime=2021-10-01&etime=2021-10-03&page=1&rows=100
{
"td"
,
"http://td.btm.bailuntec.com/ScrmApi/api/ApiGetAdFeeLog"
},
//?btime=2021-10-01&etime=2021-10-03&page=1&rows=100
{
"uk"
,
"http://uk.btm.bailuntec.com/ScrmApi/api/ApiGetAdFeeLog"
},
//?btime=2021-10-01&etime=2021-10-03&page=1&rows=100
{
"us"
,
"http://us.btm.bailuntec.com/ScrmApi/api/ApiGetAdFeeLog"
},
//?btime=2021-10-01&etime=2021-10-03&page=1&rows=100
{
"us2"
,
"http://us2.btm.bailuntec.com/ScrmApi/api/ApiGetAdFeeLog"
},
//?btime=2021-10-01&etime=2021-10-03&page=1&rows=100
{
"us3"
,
"http://us3.btm.bailuntec.com/ScrmApi/api/ApiGetAdFeeLog"
},
//?btime=2021-10-01&etime=2021-10-03&page=1&rows=100
{
"us4"
,
"http://us4.btm.bailuntec.com/ScrmApi/api/ApiGetAdFeeLog"
},
//?btime=2021-10-01&etime=2021-10-03&page=1&rows=100
};
private
Timer
_timer
;
...
...
@@ -66,7 +66,7 @@ namespace Bailun.DC.SyncShopifyFee
//站点
string
website
=
websitePlatform
[
0
];
//平台
string
platform
=
websitePlatform
[
1
]
;
string
platform
=
websitePlatform
.
Length
>
1
?
websitePlatform
[
1
]
:
default
(
string
)
;
var
page
=
1
;
var
pagesize
=
1000
;
var
count
=
0
;
...
...
@@ -83,7 +83,7 @@ namespace Bailun.DC.SyncShopifyFee
{
try
{
var
result
=
Common
.
HttpHelper
.
NetHelper
.
Request
(
$"
{
website_platform
.
Value
}
?btime=
{
btime
.
Value
.
ToString
(
"yyyy-MM-dd HH:00:00"
)}
&etime=
{
etime
.
Value
.
ToString
(
"yyyy-MM-dd"
)}
&page=
{
page
}
&rows=
{
pagesize
}
"
);
var
result
=
Common
.
HttpHelper
.
NetHelper
.
Request
(
$"
{
website_platform
.
Value
}
?btime=
{
btime
.
Value
.
ToString
(
"yyyy-MM-dd HH:00:00"
)}
&etime=
{
etime
.
Value
.
ToString
(
"yyyy-MM-dd"
)}
&page=
{
page
}
&rows=
{
pagesize
}
{(!
string
.
IsNullOrWhiteSpace
(
platform
)
?
$"&platform=
{
platform
}
"
:
string
.
Empty
)}
"
);
if
(!
string
.
IsNullOrEmpty
(
result
))
{
var
json
=
JsonConvert
.
DeserializeObject
<
response_result
>(
result
);
...
...
@@ -120,8 +120,7 @@ namespace Bailun.DC.SyncShopifyFee
var
m
=
JsonConvert
.
DeserializeObject
<
dc_base_finance_shopify_fee
>(
JsonConvert
.
SerializeObject
(
item
));
m
.
gmt_modified
=
DateTime
.
Now
;
m
.
website
=
website
;
m
.
platform
=
platform
;
int
count
=
db
.
Execute
(
"update dc_base_finance_shopify_fee set ts = @ts, bdate = @bdate, edate = @edate, fee = @fee, account_currency = @account_currency, cny_exchange_rate = @cny_exchange_rate,gmt_modified = @gmt_modified where data_id=@data_id and website=@website and platform=@platform"
,
m
);
int
count
=
db
.
Execute
(
$"update dc_base_finance_shopify_fee set ts = @ts, bdate = @bdate, edate = @edate, fee = @fee, account_currency = @account_currency, cny_exchange_rate = @cny_exchange_rate,gmt_modified = @gmt_modified where data_id=@data_id and website=@website and platform = @platform"
,
m
);
if
(
count
==
0
)
{
m
.
gmt_create
=
DateTime
.
Now
;
...
...
@@ -146,7 +145,7 @@ namespace Bailun.DC.SyncShopifyFee
{
db
.
Open
();
}
string
sql
=
"select DATE_FORMAT(max(ts),'%Y-%m-%d %H:00:00') from dc_base_finance_shopify_fee where website = @website and platform = @platform
"
;
string
sql
=
$"select DATE_FORMAT(max(ts),'%Y-%m-%d %H:00:00') from dc_base_finance_shopify_fee where website = @website
{(!
string
.
IsNullOrWhiteSpace
(
platform
)
?
"and platform = @platform"
:
string
.
Empty
)}
"
;
btime
=
db
.
QueryFirstOrDefault
<
DateTime
?>(
sql
,
new
{
website
=
website
,
platform
=
platform
})
??
DateTime
.
Now
.
AddHours
(-
2
);
Console
.
WriteLine
(
$"同步
{
website
}
的shopify广告费开始时间为
{
btime
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
}
...
...
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