Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
bailuntec-datacenter
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
huluobin
bailuntec-datacenter
Commits
5b7bd970
Commit
5b7bd970
authored
Jun 08, 2021
by
liyanlin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
726d2afe
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
19 deletions
+18
-19
DcBaseEbayTransactionMapper.xml
...rces/com/bailuntec/mapper/DcBaseEbayTransactionMapper.xml
+2
-1
DcMidTransitMapper.xml
...ain/resources/com/bailuntec/mapper/DcMidTransitMapper.xml
+1
-1
SyncEbayFeeServiceImpl.java
...om/bailuntec/job/service/impl/SyncEbayFeeServiceImpl.java
+13
-15
SyncFeeService.java
...c/main/java/com/bailuntec/job/service/SyncFeeService.java
+2
-2
No files found.
datacenter-domain/src/main/resources/com/bailuntec/mapper/DcBaseEbayTransactionMapper.xml
View file @
5b7bd970
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
#{item.paymentsEntity},#{item.payoutId},#{item.referencesJson},#{item.itemId},#{item.salesRecordReference},
#{item.paymentsEntity},#{item.payoutId},#{item.referencesJson},#{item.itemId},#{item.salesRecordReference},
#{item.transactionDate},#{item.transactionDateShort},#{item.transactionId},#{item.transactionMemo},
#{item.transactionDate},#{item.transactionDateShort},#{item.transactionId},#{item.transactionMemo},
#{item.transactionStatus},#{item.transactionType},#{item.accountId},#{item.transactionDateBj},#{item.exchangeRate},
#{item.transactionStatus},#{item.transactionType},#{item.accountId},#{item.transactionDateBj},#{item.exchangeRate},
,
#{item.exchangeRateUsd})
#{item.exchangeRateUsd})
</foreach>
</foreach>
</insert>
</insert>
</mapper>
</mapper>
\ No newline at end of file
datacenter-domain/src/main/resources/com/bailuntec/mapper/DcMidTransitMapper.xml
View file @
5b7bd970
...
@@ -110,7 +110,7 @@
...
@@ -110,7 +110,7 @@
sum(t2.`count`) purchase_inbound_count
sum(t2.`count`) purchase_inbound_count
from dc_base_purchase t1
from dc_base_purchase t1
left join dc_base_purchase_inbound t2 on t1.bailun_sku = t2.bailun_sku and t1.parent_id = t2.parent_id
left join dc_base_purchase_inbound t2 on t1.bailun_sku = t2.bailun_sku and t1.parent_id = t2.parent_id
where t1.buy_status in (0, 1, 2, 3, 9)
where t1.buy_status in (0, 1, 2, 3,
7,
9)
and t1.has_delete = 0
and t1.has_delete = 0
and t1.`count`
>
0
and t1.`count`
>
0
and (t1.`count`
>
t2.`count` or t2.`count` is null)
and (t1.`count`
>
t2.`count` or t2.`count` is null)
...
...
datacenter-job/datacenter-base/base-sync-ebay-transaction/src/main/java/com/bailuntec/job/service/impl/SyncEbayFeeServiceImpl.java
View file @
5b7bd970
...
@@ -18,7 +18,6 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -18,7 +18,6 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.time.format.DateTimeFormatter
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
...
@@ -42,8 +41,8 @@ public class SyncEbayFeeServiceImpl implements SyncEbayFeeService {
...
@@ -42,8 +41,8 @@ public class SyncEbayFeeServiceImpl implements SyncEbayFeeService {
private
DcBaseEbayTransactionMapper
dcBaseEbayTransactionMapper
;
private
DcBaseEbayTransactionMapper
dcBaseEbayTransactionMapper
;
//当前需要跑的账号
//当前需要跑的账号
private
final
static
String
[]
RUN_ACCOUNT
=
new
String
[]{
"ottlueilwitz3"
,
"jalenhe"
,
"uha4mmada"
,
"rownmelody5"
,
private
final
static
String
[]
RUN_ACCOUNT
=
new
String
[]{
"ottlueilwitz3"
,
"jalenhe"
,
"uha4mmada"
,
"rownmelody5"
,
"nthonyp6ecket"
,
"rayallen9"
,
"barbara_spence95"
,
"nbrysonhall"
,
"credit4free"
,
"barbara_spence95"
};
"nthonyp6ecket"
,
"rayallen9"
,
"barbara_spence95"
,
"nbrysonhall"
,
"credit4free"
,
"barbara_spence95"
};
@Resource
@Resource
private
EbayTransactionApi
ebayTransactionApi
;
private
EbayTransactionApi
ebayTransactionApi
;
...
@@ -54,24 +53,24 @@ public class SyncEbayFeeServiceImpl implements SyncEbayFeeService {
...
@@ -54,24 +53,24 @@ public class SyncEbayFeeServiceImpl implements SyncEbayFeeService {
@Override
@Override
public
void
SyncEbayTransaction
()
{
public
void
SyncEbayTransaction
()
{
//获取未跑或失败的任务
//获取未跑或失败的任务
/*
List<EbayAccountReportTask> ebayAccountReportTaskList = ebayAccountReportTaskService.list(
List
<
EbayAccountReportTask
>
ebayAccountReportTaskList
=
ebayAccountReportTaskService
.
list
(
new
LambdaQueryWrapper
<
EbayAccountReportTask
>()
new
LambdaQueryWrapper
<
EbayAccountReportTask
>()
.ne(EbayAccountReportTask::getStatus, 1)
.
ne
(
EbayAccountReportTask:
:
getStatus
,
1
)
);
*/
);
List
<
EbayAccountReportTask
>
ebayAccountReportTaskList
=
ebayAccountReportTaskService
.
list
(
new
LambdaQueryWrapper
<
EbayAccountReportTask
>()
/*
List<EbayAccountReportTask> ebayAccountReportTaskList = ebayAccountReportTaskService.list(new LambdaQueryWrapper<EbayAccountReportTask>()
.ge(EbayAccountReportTask::getStartTime, LocalDateTime.of(2021, 5, 4, 0, 0, 0))
.ge(EbayAccountReportTask::getStartTime, LocalDateTime.of(2021, 5, 4, 0, 0, 0))
.
lt
(
EbayAccountReportTask:
:
getStartTime
,
LocalDateTime
.
of
(
2021
,
5
,
27
,
0
,
0
,
0
)));
.lt(EbayAccountReportTask::getStartTime, LocalDateTime.of(2021, 5, 27, 0, 0, 0)));
*/
//获取账号信息
//获取账号信息
List
<
Integer
>
accountIdList
=
ebayAccountReportTaskList
.
stream
().
map
(
x
->
x
.
getAccountId
()).
distinct
().
collect
(
Collectors
.
toList
());
List
<
Integer
>
accountIdList
=
ebayAccountReportTaskList
.
stream
().
map
(
x
->
x
.
getAccountId
()).
distinct
().
collect
(
Collectors
.
toList
());
List
<
DcBaseCompanyAccount
>
accountList
=
dcBaseCompanyAccountService
.
list
(
List
<
DcBaseCompanyAccount
>
accountList
=
dcBaseCompanyAccountService
.
list
(
new
LambdaQueryWrapper
<
DcBaseCompanyAccount
>()
new
LambdaQueryWrapper
<
DcBaseCompanyAccount
>()
.
in
(
DcBaseCompanyAccount:
:
getAccountId
,
accountIdList
)
.
in
(
DcBaseCompanyAccount:
:
getAccountId
,
accountIdList
)
.
in
(
DcBaseCompanyAccount:
:
getAccountName
,
RUN_ACCOUNT
)
.
in
(
DcBaseCompanyAccount:
:
getAccountName
,
RUN_ACCOUNT
)
);
);
//循环跑任务
//循环跑任务
List
<
EbayAccountReportTask
>
needUpdateEbayAccountReportTaskList
=
new
ArrayList
<>();
List
<
EbayAccountReportTask
>
needUpdateEbayAccountReportTaskList
=
new
ArrayList
<>();
ebayAccountReportTaskList
.
forEach
(
x
->
{
ebayAccountReportTaskList
.
forEach
(
x
->
{
if
(
accountList
.
stream
().
noneMatch
(
a
->
a
.
getAccountId
().
equals
(
x
.
getAccountId
())))
{
if
(
accountList
.
stream
().
noneMatch
(
a
->
a
.
getAccountId
().
equals
(
x
.
getAccountId
())))
{
return
;
return
;
}
}
//获取token
//获取token
...
@@ -80,7 +79,7 @@ public class SyncEbayFeeServiceImpl implements SyncEbayFeeService {
...
@@ -80,7 +79,7 @@ public class SyncEbayFeeServiceImpl implements SyncEbayFeeService {
DcBaseCompanyAccount
currentAccount
=
accountList
.
stream
().
filter
(
account
->
account
.
getAccountId
().
equals
(
x
.
getAccountId
())).
findFirst
().
get
();
DcBaseCompanyAccount
currentAccount
=
accountList
.
stream
().
filter
(
account
->
account
.
getAccountId
().
equals
(
x
.
getAccountId
())).
findFirst
().
get
();
try
{
try
{
//禁用账号直接跳过
//禁用账号直接跳过
if
(!
currentAccount
.
getStatus
())
{
if
(!
currentAccount
.
getStatus
())
{
x
.
setStatus
(
2
);
x
.
setStatus
(
2
);
x
.
setErrorMsg
(
"当前账号被禁用"
);
x
.
setErrorMsg
(
"当前账号被禁用"
);
needUpdateEbayAccountReportTaskList
.
add
(
x
);
needUpdateEbayAccountReportTaskList
.
add
(
x
);
...
@@ -103,7 +102,7 @@ public class SyncEbayFeeServiceImpl implements SyncEbayFeeService {
...
@@ -103,7 +102,7 @@ public class SyncEbayFeeServiceImpl implements SyncEbayFeeService {
boolean
isSuccess
=
doGet
(
accessToken
.
toString
(),
filter
,
1000
,
pageNum
,
transactions
);
boolean
isSuccess
=
doGet
(
accessToken
.
toString
(),
filter
,
1000
,
pageNum
,
transactions
);
if
(
isSuccess
)
{
if
(
isSuccess
)
{
x
.
setStatus
(
1
);
x
.
setStatus
(
1
);
save
(
transactions
,
currentAccount
.
getAccountId
());
save
(
transactions
,
currentAccount
.
getAccountId
());
}
else
{
}
else
{
String
msg
=
String
.
format
(
"请求ebay广告服务异常,当前账号:%s,当前页码:%s"
,
currentAccount
.
getAccountName
(),
pageNum
);
String
msg
=
String
.
format
(
"请求ebay广告服务异常,当前账号:%s,当前页码:%s"
,
currentAccount
.
getAccountName
(),
pageNum
);
log
.
error
(
msg
);
log
.
error
(
msg
);
...
@@ -135,7 +134,7 @@ public class SyncEbayFeeServiceImpl implements SyncEbayFeeService {
...
@@ -135,7 +134,7 @@ public class SyncEbayFeeServiceImpl implements SyncEbayFeeService {
return
true
;
return
true
;
}
}
private
void
save
(
List
<
Transaction
>
transactions
,
Integer
accountId
)
{
private
void
save
(
List
<
Transaction
>
transactions
,
Integer
accountId
)
{
if
(
transactions
==
null
||
transactions
.
isEmpty
())
{
if
(
transactions
==
null
||
transactions
.
isEmpty
())
{
return
;
return
;
}
}
...
@@ -165,8 +164,7 @@ public class SyncEbayFeeServiceImpl implements SyncEbayFeeService {
...
@@ -165,8 +164,7 @@ public class SyncEbayFeeServiceImpl implements SyncEbayFeeService {
try
{
try
{
x
.
setExchangeRate
(
oaApi
.
getExchangeRateByCurAndDate
(
x
.
getCurrency
(),
"CNY"
,
x
.
getTransactionDateBj
().
toLocalDate
()).
getRate
());
x
.
setExchangeRate
(
oaApi
.
getExchangeRateByCurAndDate
(
x
.
getCurrency
(),
"CNY"
,
x
.
getTransactionDateBj
().
toLocalDate
()).
getRate
());
x
.
setExchangeRateUsd
(
oaApi
.
getExchangeRateByCurAndDate
(
x
.
getCurrency
(),
"USD"
,
x
.
getTransactionDateBj
().
toLocalDate
()).
getRate
());
x
.
setExchangeRateUsd
(
oaApi
.
getExchangeRateByCurAndDate
(
x
.
getCurrency
(),
"USD"
,
x
.
getTransactionDateBj
().
toLocalDate
()).
getRate
());
}
}
catch
(
Exception
ex
)
{
catch
(
Exception
ex
){
log
.
info
(
ex
.
toString
());
log
.
info
(
ex
.
toString
());
}
}
});
});
...
...
datacenter-job/datacenter-base/base-sync-fee/src/main/java/com/bailuntec/job/service/SyncFeeService.java
View file @
5b7bd970
...
@@ -77,8 +77,8 @@ public class SyncFeeService {
...
@@ -77,8 +77,8 @@ public class SyncFeeService {
BeanUtils
.
copyProperties
(
costDto
,
dcBaseFinanceFee
);
BeanUtils
.
copyProperties
(
costDto
,
dcBaseFinanceFee
);
dcBaseFinanceFee
.
setCreateTime
(
LocalDateTime
.
ofInstant
(
costDto
.
getCreateTime
().
toInstant
(),
ZoneId
.
systemDefault
()));
dcBaseFinanceFee
.
setCreateTime
(
LocalDateTime
.
ofInstant
(
costDto
.
getCreateTime
().
toInstant
(),
ZoneId
.
systemDefault
()));
if
(
costDto
.
get
Pay
Time
()
!=
null
)
{
if
(
costDto
.
get
Actual
Time
()
!=
null
)
{
dcBaseFinanceFee
.
setPayTime
(
LocalDateTime
.
ofInstant
(
costDto
.
get
Pay
Time
().
toInstant
(),
ZoneId
.
systemDefault
()));
dcBaseFinanceFee
.
setPayTime
(
LocalDateTime
.
ofInstant
(
costDto
.
get
Actual
Time
().
toInstant
(),
ZoneId
.
systemDefault
()));
}
}
if
(
costDto
.
getAuditTime
()
!=
null
)
{
if
(
costDto
.
getAuditTime
()
!=
null
)
{
dcBaseFinanceFee
.
setAuditTime
(
LocalDateTime
.
ofInstant
(
costDto
.
getAuditTime
().
toInstant
(),
ZoneId
.
systemDefault
()));
dcBaseFinanceFee
.
setAuditTime
(
LocalDateTime
.
ofInstant
(
costDto
.
getAuditTime
().
toInstant
(),
ZoneId
.
systemDefault
()));
...
...
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