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
d721e2d9
Commit
d721e2d9
authored
Mar 10, 2026
by
jianan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
出账检核-设置出账金额问题
parent
d3b3d2b9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
16 deletions
+12
-16
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/FortuneServiceImpl.java
+12
-16
No files found.
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/FortuneServiceImpl.java
View file @
d721e2d9
...
...
@@ -248,24 +248,20 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
* 拆分发放(按本次发放金额拆)
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
splitFortune
(
Fortune
main
,
BigDecimal
currentPaymentAmount
,
ExpectedFortune
expectedFortune
,
String
loginUserId
,
FortuneUpdateRequest
fortuneUpdateRequest
)
{
if
(
currentPaymentAmount
==
null
||
currentPaymentAmount
.
compareTo
(
BigDecimal
.
ZERO
)
<=
0
)
throw
new
BusinessException
(
"本次发放金额必须大于0"
);
public
void
splitFortune
(
Fortune
main
,
BigDecimal
currentPaymentHkdAmount
,
ExpectedFortune
expectedFortune
,
String
loginUserId
,
FortuneUpdateRequest
fortuneUpdateRequest
)
{
if
(!
main
.
getStatus
().
equals
(
FortuneStatusEnum
.
CAN_SEND
.
getItemValue
()))
throw
new
BusinessException
(
"只有可出账记录才能修改金额"
);
BigDecimal
fullAmount
=
main
.
getAmount
();
if
(
currentPayment
Amount
.
compareTo
(
main
.
getCurrentPayment
Amount
())
>
0
)
BigDecimal
fullAmount
=
main
.
get
Hkd
Amount
();
if
(
currentPayment
HkdAmount
.
compareTo
(
main
.
getCurrentPaymentHkd
Amount
())
>
0
)
throw
new
BusinessException
(
"本次发放金额不能大于可出账金额"
);
// 本次发放港币金额
BigDecimal
currentHkdAmount
=
currentPaymentAmount
.
multiply
(
main
.
getExchangeRate
());
// 1. 更新主行 = 本次发放金额
main
.
setCurrentPaymentAmount
(
currentPaymentAmount
);
main
.
setCurrentPaymentHkdAmount
(
currentHkdAmount
);
main
.
setCurrentPaymentRatio
(
currentPaymentAmount
.
divide
(
expectedFortune
.
getAmount
(),
4
,
RoundingMode
.
HALF_UP
).
multiply
(
BigDecimal
.
valueOf
(
100
)));
main
.
setCurrentPaymentAmount
(
null
);
main
.
setCurrentPaymentHkdAmount
(
current
Payment
HkdAmount
);
main
.
setCurrentPaymentRatio
(
currentPayment
Hkd
Amount
.
divide
(
expectedFortune
.
get
Hkd
Amount
(),
4
,
RoundingMode
.
HALF_UP
).
multiply
(
BigDecimal
.
valueOf
(
100
)));
main
.
setStatus
(
FortuneStatusEnum
.
CHECKED
.
getItemValue
());
main
.
setUpdaterId
(
loginUserId
);
main
.
setUpdateTime
(
new
Date
());
...
...
@@ -276,15 +272,15 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
this
.
updateById
(
main
);
// 2. 剩余金额生成新行
BigDecimal
leftAmount
=
fullAmount
.
subtract
(
currentPaymentAmount
);
BigDecimal
leftAmount
=
fullAmount
.
subtract
(
currentPayment
Hkd
Amount
);
if
(
leftAmount
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
Fortune
part
=
new
Fortune
();
BeanUtils
.
copyProperties
(
main
,
part
,
"id"
,
"fortuneBizId"
,
"currentPaymentAmount"
,
"status"
,
"isPart"
,
"payoutDate"
);
part
.
setFortuneBizId
(
RandomStringGenerator
.
generateBizId16
(
CommonEnum
.
UID_TYPE_FORTUNE
.
getCode
()));
part
.
setCurrentPaymentAmount
(
leftAmount
);
part
.
setCurrentPaymentHkdAmount
(
leftAmount
.
multiply
(
main
.
getExchangeRate
())
);
part
.
setCurrentPaymentAmount
(
null
);
part
.
setCurrentPaymentHkdAmount
(
leftAmount
);
part
.
setCurrentPaymentRatio
(
leftAmount
.
divide
(
expectedFortune
.
getAmount
(),
4
,
RoundingMode
.
HALF_UP
).
multiply
(
BigDecimal
.
valueOf
(
100
)));
.
divide
(
expectedFortune
.
get
Hkd
Amount
(),
4
,
RoundingMode
.
HALF_UP
).
multiply
(
BigDecimal
.
valueOf
(
100
)));
part
.
setStatus
(
FortuneStatusEnum
.
WAIT
.
getItemValue
());
part
.
setIsPart
(
1
);
part
.
setPayoutDate
(
LocalDate
.
now
().
plusMonths
(
1
));
// 次月
...
...
@@ -300,7 +296,7 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
if
(
ef
==
null
)
return
;
// 统一使用港币金额
BigDecimal
newPaid
=
ef
.
getPaidAmount
()
==
null
?
BigDecimal
.
ZERO
:
ef
.
getPaidAmount
().
add
(
currentHkdAmount
);
BigDecimal
newPaid
=
ef
.
getPaidAmount
()
==
null
?
BigDecimal
.
ZERO
:
ef
.
getPaidAmount
().
add
(
current
Payment
HkdAmount
);
BigDecimal
newUnpaid
=
ef
.
getHkdAmount
().
subtract
(
newPaid
);
String
newStatus
=
newUnpaid
.
compareTo
(
BigDecimal
.
ZERO
)
==
0
?
"6"
:
"3"
;
...
...
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