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
fe1d4c77
Commit
fe1d4c77
authored
Mar 10, 2026
by
jianan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
出账检核-设置出账金额问题2
parent
d721e2d9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
23 deletions
+32
-23
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/FortuneServiceImpl.java
+32
-23
No files found.
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/FortuneServiceImpl.java
View file @
fe1d4c77
...
...
@@ -208,22 +208,36 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
if
(
currentPaymentHkdAmount
!=
null
&&
currentPaymentHkdAmount
.
compareTo
(
BigDecimal
.
ZERO
)
!=
0
)
{
splitFortune
(
fortune
,
currentPaymentHkdAmount
,
expectedFortune
,
loginUserId
,
fortuneUpdateRequest
);
}
else
{
// 如果未传入金额,
仅更新预计
出账状态为已出帐
expectedFortuneService
.
lambdaUpdate
()
.
set
(
ExpectedFortune:
:
getStatus
,
fortuneUpdateRequest
.
getStatus
())
.
eq
(
ExpectedFortune:
:
getId
,
expectedFortune
.
getId
())
.
update
();
// 如果未传入金额,
全额发放,
出账状态为已出帐
totalFortune
(
fortune
,
expectedFortune
,
loginUserId
,
fortuneUpdateRequest
);
}
return
true
;
}
// 统一更新实际出账数据
BeanUtils
.
copyProperties
(
fortuneUpdateRequest
,
fortune
,
"id"
,
"fortuneBizId"
,
"expectedFortuneBizId"
,
"commissionBizId"
);
private
void
totalFortune
(
Fortune
fortune
,
ExpectedFortune
expectedFortune
,
String
loginUserId
,
FortuneUpdateRequest
fortuneUpdateRequest
)
{
// 1. 更新fortune记录为全额发放状态
fortune
.
setCurrentPaymentHkdAmount
(
fortune
.
getHkdAmount
());
fortune
.
setCurrentPaymentRatio
(
BigDecimal
.
valueOf
(
100
));
fortune
.
setStatus
(
FortuneStatusEnum
.
CHECKED
.
getItemValue
());
fortune
.
setUpdaterId
(
loginUserId
);
fortune
.
setUpdateTime
(
new
Date
());
// 更新实际出账数据
fortune
.
setUpdaterId
(
loginUserId
);
fortune
.
setUpdateTime
(
new
Date
()
);
// 更新实际出账日期
Date
actualPayoutDate
=
new
Date
(
);
fortune
.
setActualPayoutDate
(
actualPayoutDate
);
this
.
updateById
(
fortune
);
}
return
true
;
this
.
updateById
(
fortune
);
// 2. 更新expected_fortune记录为已全额发放状态
// 统一使用港币金额
expectedFortune
.
setPaidAmount
(
expectedFortune
.
getHkdAmount
());
expectedFortune
.
setUnpaidAmount
(
BigDecimal
.
ZERO
);
expectedFortune
.
setPaidRatio
(
BigDecimal
.
valueOf
(
100
));
expectedFortune
.
setUnpaidRatio
(
BigDecimal
.
ZERO
);
expectedFortune
.
setStatus
(
"6"
);
// 全额发放完成状态
expectedFortune
.
setActualPayoutDate
(
LocalDate
.
now
());
expectedFortuneService
.
updateById
(
expectedFortune
);
}
private
BigDecimal
queryDefaultExchangeRate
(
String
currency
)
{
...
...
@@ -290,25 +304,20 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
}
// 3. 同步 expected_fortune
ExpectedFortune
ef
=
expectedFortuneService
.
lambdaQuery
()
.
eq
(
ExpectedFortune:
:
getExpectedFortuneBizId
,
main
.
getExpectedFortuneBizId
())
.
one
();
if
(
ef
==
null
)
return
;
// 统一使用港币金额
BigDecimal
newPaid
=
e
f
.
getPaidAmount
()
==
null
?
BigDecimal
.
ZERO
:
ef
.
getPaidAmount
().
add
(
currentPaymentHkdAmount
);
BigDecimal
newUnpaid
=
e
f
.
getHkdAmount
().
subtract
(
newPaid
);
BigDecimal
newPaid
=
e
xpectedFortune
.
getPaidAmount
()
==
null
?
BigDecimal
.
ZERO
:
expectedFortune
.
getPaidAmount
().
add
(
currentPaymentHkdAmount
);
BigDecimal
newUnpaid
=
e
xpectedFortune
.
getHkdAmount
().
subtract
(
newPaid
);
String
newStatus
=
newUnpaid
.
compareTo
(
BigDecimal
.
ZERO
)
==
0
?
"6"
:
"3"
;
expectedFortuneService
.
lambdaUpdate
()
.
set
(
ExpectedFortune:
:
getPaidAmount
,
newPaid
)
.
set
(
ExpectedFortune:
:
getUnpaidAmount
,
newUnpaid
)
.
set
(
ExpectedFortune:
:
getPaidRatio
,
newPaid
.
divide
(
e
f
.
getHkdAmount
(),
4
,
RoundingMode
.
HALF_UP
).
multiply
(
BigDecimal
.
valueOf
(
100
)))
newPaid
.
divide
(
e
xpectedFortune
.
getHkdAmount
(),
4
,
RoundingMode
.
HALF_UP
).
multiply
(
BigDecimal
.
valueOf
(
100
)))
.
set
(
ExpectedFortune:
:
getUnpaidRatio
,
newUnpaid
.
divide
(
e
f
.
getHkdAmount
(),
4
,
RoundingMode
.
HALF_UP
).
multiply
(
BigDecimal
.
valueOf
(
100
)))
newUnpaid
.
divide
(
e
xpectedFortune
.
getHkdAmount
(),
4
,
RoundingMode
.
HALF_UP
).
multiply
(
BigDecimal
.
valueOf
(
100
)))
.
set
(
ExpectedFortune:
:
getStatus
,
newStatus
)
.
eq
(
ExpectedFortune:
:
getId
,
e
f
.
getId
())
.
eq
(
ExpectedFortune:
:
getId
,
e
xpectedFortune
.
getId
())
.
update
();
}
...
...
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