Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yd-csf
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xingmin
yd-csf
Commits
d789c3c2
Commit
d789c3c2
authored
Apr 08, 2026
by
jianan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增出账更新到应付
parent
887e3f9c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
1 deletions
+30
-1
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/FortuneServiceImpl.java
+30
-1
No files found.
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/FortuneServiceImpl.java
View file @
d789c3c2
...
...
@@ -708,6 +708,7 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
List
<
Fortune
>
fortuneList
=
new
ArrayList
<>();
List
<
ExpectedFortune
>
expectedFortuneUpdateList
=
new
ArrayList
<>();
for
(
FortuneAddRequest
fortuneAddRequest
:
fortuneAddRequestList
)
{
// 校验参数
valiAddFortune
(
fortuneAddRequest
);
...
...
@@ -739,6 +740,8 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
fortune
.
setStatus
(
FortuneStatusEnum
.
MATCH_FAIL
.
getItemValue
());
fortune
.
setRemark
(
"未找到当前预计发佣对应的来佣"
);
}
// 更新预计出账的数据
processExpectedFortune
(
expectedFortune
,
fortune
,
expectedFortuneUpdateList
);
}
// 生成发佣业务ID
...
...
@@ -749,7 +752,33 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
fortune
.
setIsPart
(
0
);
fortuneList
.
add
(
fortune
);
}
return
this
.
saveBatch
(
fortuneList
);
this
.
saveBatch
(
fortuneList
);
if
(
CollectionUtils
.
isNotEmpty
(
expectedFortuneUpdateList
))
{
expectedFortuneService
.
updateBatchById
(
expectedFortuneUpdateList
);
}
return
true
;
}
private
void
processExpectedFortune
(
ExpectedFortune
expectedFortune
,
Fortune
fortune
,
List
<
ExpectedFortune
>
expectedFortuneUpdateList
)
{
// 出账币种
String
currency
=
fortune
.
getCurrency
();
// 港币出账金额
BigDecimal
hkdAmount
=
fortune
.
getHkdAmount
();
ExpectedFortune
updateObj
=
new
ExpectedFortune
();
updateObj
.
setId
(
expectedFortune
.
getId
());
updateObj
.
setHkdAmount
(
expectedFortune
.
getHkdAmount
().
add
(
hkdAmount
));
// 根据预计出账币种计算 expectedFortune.getAmount() 字段
BigDecimal
originalAmount
=
fortune
.
getAmount
();
// 原始币种金额
BigDecimal
exchangeRate
=
queryExchangeRateByFeign
(
currency
,
expectedFortune
.
getCurrency
());
BigDecimal
amount
=
originalAmount
.
multiply
(
exchangeRate
);
// 本次新增出账金额
updateObj
.
setAmount
(
amount
.
add
(
expectedFortune
.
getAmount
()));
expectedFortuneUpdateList
.
add
(
updateObj
);
}
}
...
...
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