Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
T
ts-api-demo
Project
Project
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
wmvm
ts-api-demo
Commits
6dc2bddc
Commit
6dc2bddc
authored
Dec 26, 2024
by
ml
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资产管理后台-自动对账列表修改
parent
83448e01
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
19 deletions
+48
-19
assetCheck.service.ts
src/functional/mvc/service/v2/assetCheck.service.ts
+48
-19
No files found.
src/functional/mvc/service/v2/assetCheck.service.ts
View file @
6dc2bddc
...
...
@@ -237,7 +237,13 @@ export async function fundingTotalRecords() {
//账户
let
accountList
=
await
financeAccountDataUtils
.
getAccountInfoList
();
if
(
!
accountList
.
length
)
{
return
;
return
{
category_count
,
total_init_asset
,
total_balance
,
total_sub_value
,
category_list
};
}
let
dataList
=
await
financeAccountDataUtils
.
getFundingDataByAccounts
(
accountList
);
if
(
dataList
.
length
)
{
...
...
@@ -365,7 +371,13 @@ export async function autoCheckList() {
//账户
let
accountList
=
await
financeAccountDataUtils
.
getAccountInfoList
();
if
(
!
accountList
.
length
)
{
return
;
return
{
account_count
,
total_init_asset
,
total_balance
,
total_change_value
,
account_data_list
};
}
let
dataList
=
await
financeAccountDataUtils
.
getMultiCoinFundingDataByAccounts
(
accountList
);
if
(
dataList
.
length
)
{
...
...
@@ -406,29 +418,46 @@ export async function autoCheckList() {
let
initSymbols
=
_
.
keys
(
initAmountMap
);
let
balanceSymbols
=
_
.
keys
(
multiCoinMap
);
let
symbolsArray
=
_
.
union
(
initSymbols
,
balanceSymbols
);
for
(
let
oneSymbol
of
symbolsArray
)
{
let
symbol_usdt_rate
=
tickerMap
[
oneSymbol
]
?
tickerMap
[
oneSymbol
]
:
await
tickerUtils
.
rateCoin2USDT
(
oneSymbol
);
let
init
=
initAmountMap
[
oneSymbol
]
?
initAmountMap
[
oneSymbol
].
amount
:
0
;
let
init_usdt
=
initAmountMap
[
oneSymbol
]
?
initAmountMap
[
oneSymbol
].
amount_usdt
:
0
;
let
balance
=
multiCoinMap
[
oneSymbol
]
?
multiCoinMap
[
oneSymbol
]
:
0
;
let
balance_usdt
=
new
BigNumber
(
balance
).
mul
(
new
BigNumber
(
symbol_usdt_rate
));
//有账户 没有 初始资金 和 余额的情况
if
(
!
symbolsArray
.
length
)
{
let
listOne
=
{
account_id
:
account_id
,
account_name
:
aMap
[
account_id
]
?
aMap
[
account_id
].
account
:
""
,
remark
:
aMap
[
account_id
]
?
aMap
[
account_id
].
remark
:
""
,
symbol
:
oneSymbol
,
init
:
init
,
init_usdt
:
init_usdt
,
balance
:
balance
,
balance_usdt
:
balance_usdt
,
change
:
new
BigNumber
(
balance
).
sub
(
new
BigNumber
(
init
)
),
change_usdt
:
new
BigNumber
(
balance_usdt
).
sub
(
new
BigNumber
(
init_usdt
)),
symbol
:
"--"
,
init
:
new
BigNumber
(
0
)
,
init_usdt
:
0
,
balance
:
new
BigNumber
(
0
)
,
balance_usdt
:
new
BigNumber
(
0
)
,
change
:
new
BigNumber
(
0
),
change_usdt
:
new
BigNumber
(
0
)
}
account_data_list
.
push
(
listOne
);
total_init_asset
=
total_init_asset
.
add
(
new
BigNumber
(
init_usdt
));
total_balance
=
total_balance
.
add
(
new
BigNumber
(
balance_usdt
));
total_change_value
=
total_change_value
.
add
(
new
BigNumber
(
listOne
.
change_usdt
));
}
else
{
for
(
let
oneSymbol
of
symbolsArray
)
{
let
symbol_usdt_rate
=
tickerMap
[
oneSymbol
]
?
tickerMap
[
oneSymbol
]
:
await
tickerUtils
.
rateCoin2USDT
(
oneSymbol
);
let
init
=
initAmountMap
[
oneSymbol
]
?
initAmountMap
[
oneSymbol
].
amount
:
0
;
let
init_usdt
=
initAmountMap
[
oneSymbol
]
?
initAmountMap
[
oneSymbol
].
amount_usdt
:
0
;
let
balance
=
multiCoinMap
[
oneSymbol
]
?
multiCoinMap
[
oneSymbol
]
:
0
;
let
balance_usdt
=
new
BigNumber
(
balance
).
mul
(
new
BigNumber
(
symbol_usdt_rate
));
let
listOne
=
{
account_id
:
account_id
,
account_name
:
aMap
[
account_id
]
?
aMap
[
account_id
].
account
:
""
,
remark
:
aMap
[
account_id
]
?
aMap
[
account_id
].
remark
:
""
,
symbol
:
oneSymbol
,
init
:
init
,
init_usdt
:
init_usdt
,
balance
:
balance
,
balance_usdt
:
balance_usdt
,
change
:
new
BigNumber
(
balance
).
sub
(
new
BigNumber
(
init
)),
change_usdt
:
new
BigNumber
(
balance_usdt
).
sub
(
new
BigNumber
(
init_usdt
)),
}
account_data_list
.
push
(
listOne
);
total_init_asset
=
total_init_asset
.
add
(
new
BigNumber
(
init_usdt
));
total_balance
=
total_balance
.
add
(
new
BigNumber
(
balance_usdt
));
total_change_value
=
total_change_value
.
add
(
new
BigNumber
(
listOne
.
change_usdt
));
}
}
}
}
...
...
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