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
726d2afe
Commit
726d2afe
authored
May 27, 2021
by
liyanlin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
d92866f9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
15 deletions
+44
-15
DcBaseEbayTransaction.java
...main/java/com/bailuntec/domain/DcBaseEbayTransaction.java
+9
-0
DcBaseEbayTransactionMapper.xml
...rces/com/bailuntec/mapper/DcBaseEbayTransactionMapper.xml
+4
-2
SyncEbayFeeServiceImpl.java
...om/bailuntec/job/service/impl/SyncEbayFeeServiceImpl.java
+20
-6
BalanceSheetService.java
...n/java/com/bailuntec/job/service/BalanceSheetService.java
+11
-7
No files found.
datacenter-domain/src/main/java/com/bailuntec/domain/DcBaseEbayTransaction.java
View file @
726d2afe
...
...
@@ -11,6 +11,7 @@ import lombok.EqualsAndHashCode;
import
lombok.experimental.Accessors
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.util.List
;
...
...
@@ -71,6 +72,14 @@ public class DcBaseEbayTransaction implements Serializable {
private
Integer
accountId
;
private
LocalDateTime
transactionDateBj
;
@ApiModelProperty
(
value
=
"转人民币汇率,根据transactionDateBj取值"
)
private
BigDecimal
exchangeRate
;
@ApiModelProperty
(
value
=
"转美元汇率"
)
private
BigDecimal
exchangeRateUsd
;
@TableField
(
exist
=
false
)
private
List
<
Reference
>
references
;
...
...
datacenter-domain/src/main/resources/com/bailuntec/mapper/DcBaseEbayTransactionMapper.xml
View file @
726d2afe
...
...
@@ -4,12 +4,13 @@
<insert
id=
"insertIgnoreExist"
parameterType=
"arraylist"
>
insert ignore into dc_base_ebay_transaction (value,currency,booking_entry,username,fee_type,order_id,payments_entity,
payout_id,references_json,item_id,sales_record_reference,transaction_date,transaction_date_short,transaction_id,
transaction_memo,transaction_status,transaction_type,account_id) values
transaction_memo,transaction_status,transaction_type,account_id
,transaction_date_bj ,exchange_rate,exchange_rate_usd
) values
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
(#{item.value},#{item.currency},#{item.bookingEntry},#{item.username},#{item.feeType},#{item.orderId},
#{item.paymentsEntity},#{item.payoutId},#{item.referencesJson},#{item.itemId},#{item.salesRecordReference},
#{item.transactionDate},#{item.transactionDateShort},#{item.transactionId},#{item.transactionMemo},
#{item.transactionStatus},#{item.transactionType},#{item.accountId})
#{item.transactionStatus},#{item.transactionType},#{item.accountId},#{item.transactionDateBj},#{item.exchangeRate},
,#{item.exchangeRateUsd})
</foreach>
</insert>
</mapper>
\ No newline at end of file
datacenter-job/datacenter-base/base-sync-ebay-transaction/src/main/java/com/bailuntec/job/service/impl/SyncEbayFeeServiceImpl.java
View file @
726d2afe
package
com
.
bailuntec
.
job
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.bailuntec.api.bailuntec.oa.OaApi
;
import
com.bailuntec.api.ebay.seller.EbayTransactionApi
;
import
com.bailuntec.api.ebay.seller.response.transaction.EbayTransactionRes
;
import
com.bailuntec.api.ebay.seller.response.transaction.Reference
;
...
...
@@ -17,6 +18,7 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -40,21 +42,25 @@ public class SyncEbayFeeServiceImpl implements SyncEbayFeeService {
private
DcBaseEbayTransactionMapper
dcBaseEbayTransactionMapper
;
//当前需要跑的账号
private
final
static
String
[]
RUN_ACCOUNT
=
new
String
[]{
"ottlueilwitz3"
,
"jalenhe"
,
"uha4mmada"
,
"rownmelody5"
,
"nthonyp6ecket"
,
"rayallen9"
,
"barbara_spence95"
,
"nbrysonhall"
,
"credit4free"
};
private
final
static
String
[]
RUN_ACCOUNT
=
new
String
[]{
"ottlueilwitz3"
,
"jalenhe"
,
"uha4mmada"
,
"rownmelody5"
,
"nthonyp6ecket"
,
"rayallen9"
,
"barbara_spence95"
,
"nbrysonhall"
,
"credit4free"
,
"barbara_spence95"
};
@Resource
private
EbayTransactionApi
ebayTransactionApi
;
@Resource
private
OaApi
oaApi
;
@Override
public
void
SyncEbayTransaction
()
{
//获取未跑或失败的任务
List
<
EbayAccountReportTask
>
ebayAccountReportTaskList
=
ebayAccountReportTaskService
.
list
(
/*
List<EbayAccountReportTask> ebayAccountReportTaskList = ebayAccountReportTaskService.list(
new LambdaQueryWrapper<EbayAccountReportTask>()
.ne(EbayAccountReportTask::getStatus, 1)
);
/*
List<EbayAccountReportTask> ebayAccountReportTaskList = ebayAccountReportTaskService.list(new LambdaQueryWrapper<EbayAccountReportTask>()
.ge(EbayAccountReportTask::getStartTime, LocalDateTime.of(2021, 5,
1
, 0, 0, 0))
.lt(EbayAccountReportTask::getStartTime, LocalDateTime.of(2021, 5, 2
6, 0, 0, 0)));*/
);
*/
List
<
EbayAccountReportTask
>
ebayAccountReportTaskList
=
ebayAccountReportTaskService
.
list
(
new
LambdaQueryWrapper
<
EbayAccountReportTask
>()
.
ge
(
EbayAccountReportTask:
:
getStartTime
,
LocalDateTime
.
of
(
2021
,
5
,
4
,
0
,
0
,
0
))
.
lt
(
EbayAccountReportTask:
:
getStartTime
,
LocalDateTime
.
of
(
2021
,
5
,
2
7
,
0
,
0
,
0
)));
//获取账号信息
List
<
Integer
>
accountIdList
=
ebayAccountReportTaskList
.
stream
().
map
(
x
->
x
.
getAccountId
()).
distinct
().
collect
(
Collectors
.
toList
());
List
<
DcBaseCompanyAccount
>
accountList
=
dcBaseCompanyAccountService
.
list
(
...
...
@@ -148,6 +154,7 @@ public class SyncEbayFeeServiceImpl implements SyncEbayFeeService {
x
.
setReferencesJson
(
JSON
.
toJSONString
(
transaction
.
getReferences
()));
}
if
(
x
.
getTransactionDate
()
!=
null
)
{
x
.
setTransactionDateBj
(
x
.
getTransactionDate
().
minusHours
(
15L
));
x
.
setTransactionDateShort
(
x
.
getTransactionDate
().
toLocalDate
());
}
...
...
@@ -155,6 +162,13 @@ public class SyncEbayFeeServiceImpl implements SyncEbayFeeService {
x
.
setCurrency
(
transaction
.
getAmount
().
getCurrency
());
x
.
setUsername
(
transaction
.
getBuyer
()
==
null
?
""
:
transaction
.
getBuyer
().
getUsername
());
x
.
setAccountId
(
accountId
);
try
{
x
.
setExchangeRate
(
oaApi
.
getExchangeRateByCurAndDate
(
x
.
getCurrency
(),
"CNY"
,
x
.
getTransactionDateBj
().
toLocalDate
()).
getRate
());
x
.
setExchangeRateUsd
(
oaApi
.
getExchangeRateByCurAndDate
(
x
.
getCurrency
(),
"USD"
,
x
.
getTransactionDateBj
().
toLocalDate
()).
getRate
());
}
catch
(
Exception
ex
){
log
.
info
(
ex
.
toString
());
}
});
dcBaseEbayTransactionMapper
.
insertIgnoreExist
(
dcBaseEbayTransactionList
);
...
...
datacenter-job/datacenter-finance/finance-balance-sheet/src/main/java/com/bailuntec/job/service/BalanceSheetService.java
View file @
726d2afe
package
com
.
bailuntec
.
job
.
service
;
import
com.alibaba.fastjson.JSON
;
import
com.bailuntec.api.bailuntec.cw.CwApi
;
import
com.bailuntec.api.bailuntec.cw.response.BankAccountBalanceDTO
;
import
com.bailuntec.api.bailuntec.cw.response.BorrowBalanceDTO
;
...
...
@@ -487,7 +488,7 @@ public class BalanceSheetService {
LocalDate
date
=
dcJobConfig
.
getStartTime
().
toLocalDate
();
DcBalanceSheet
dcBalanceSheet
=
dcBalanceSheetMapper
.
selectOne
(
new
LambdaQueryWrapper
<
DcBalanceSheet
>()
.
eq
(
DcBalanceSheet:
:
getCompanyValue
,
companyValue
)
.
eq
(
DcBalanceSheet:
:
getCompanyName
,
companyName
)
...
...
@@ -665,29 +666,32 @@ public class BalanceSheetService {
/**
* <p>
*
获取半成品存货
* 获取半成品存货
* </p>
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
syncSemiInventoryBalance
(){
public
void
syncSemiInventoryBalance
()
{
DcJobConfig
dcJobConfig
=
dcJobConfigMapper
.
selectByName
(
baseSyncSemiStock
);
boolean
isOk
=
true
;
DateTimeFormatter
dtf
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
);
String
startDate
=
dcJobConfig
.
getStartTime
().
toLocalDate
().
format
(
dtf
);
String
endDate
=
dcJobConfig
.
getEndTime
().
toLocalDate
().
format
(
dtf
);
try
{
MjgysResult
<
List
<
SupofferLogResp
>>
supofferLogs
=
mjgysApi
.
supofferLog
(
startDate
,
endDate
);
MjgysResult
<
List
<
SupofferLogResp
>>
supofferLogs
=
mjgysApi
.
supofferLog
(
startDate
,
endDate
);
log
.
info
(
"获取半成品存货mjgysApi:"
+
JSON
.
toJSONString
(
supofferLogs
));
if
(
supofferLogs
.
isSuccess
()
&&
supofferLogs
.
getData
().
size
()
>
0
)
{
dcSemiSupplierOfferLogMapper
.
insertOrUpdateSemiSupplierOfferLog
(
supofferLogs
.
getData
());
}
}
catch
(
Exception
e
)
{
log
.
info
(
e
.
toString
());
e
.
printStackTrace
();
isOk
=
false
;
}
int
rows
=
5000
;
int
page
=
1
;
try
{
MjzzResult
<
MjzzPage
<
StockLogResp
>>
stockLogResult
=
mjzzApi
.
stockLog
(
page
,
rows
,
startDate
,
endDate
);
MjzzResult
<
MjzzPage
<
StockLogResp
>>
stockLogResult
=
mjzzApi
.
stockLog
(
page
,
rows
,
startDate
,
endDate
);
log
.
info
(
"获取半成品存货mjzzApi:"
+
JSON
.
toJSONString
(
stockLogResult
));
if
(
stockLogResult
.
getSuccess
()
&&
stockLogResult
.
getData
().
getTotalItems
()
>
0
)
{
dcSemiStockLogMapper
.
insertOrUpdateSemiStockLog
(
stockLogResult
.
getData
().
getItems
());
int
totalPages
=
stockLogResult
.
getData
().
getTotalPages
();
...
...
@@ -695,7 +699,7 @@ public class BalanceSheetService {
while
(
page
<
totalPages
)
{
page
+=
1
;
try
{
stockLogResult
=
mjzzApi
.
stockLog
(
page
,
rows
,
startDate
,
endDate
);
stockLogResult
=
mjzzApi
.
stockLog
(
page
,
rows
,
startDate
,
endDate
);
if
(
stockLogResult
.
getData
()
!=
null
&&
stockLogResult
.
getData
().
getItems
()
!=
null
)
{
dcSemiStockLogMapper
.
insertOrUpdateSemiStockLog
(
stockLogResult
.
getData
().
getItems
());
}
...
...
@@ -708,7 +712,7 @@ public class BalanceSheetService {
}
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
(
);
log
.
info
(
e
.
toString
()
);
isOk
=
false
;
}
// 生成半成品每日存货
...
...
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