Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
manager
Project
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
reyun
manager
Commits
9c558399
Commit
9c558399
authored
4 years ago
by
kangxiaoshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整金
parent
85ce37a1
master
…
0727_bugfix
1209_bugfix
1315_bugfix
1439_bugfix
1608_bugfix
1608_from_1619
1619_bugfix
1990_bugfix
2578_bugfix
2580_fix
bigfix_20201028
bugfix_1608_new
bugfix_1760
bugfix_master_1760
change_double
liushaowei
master_mv
mobvista_master
month_flow
No related merge requests found
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
54 deletions
+7
-54
ShareIncomeServiceImpl.java
...main/java/common/service/impl/ShareIncomeServiceImpl.java
+7
-54
No files found.
src/main/java/common/service/impl/ShareIncomeServiceImpl.java
View file @
9c558399
...
...
@@ -83,6 +83,9 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
}
}
//contracts = new ArrayList<>();
//contracts.add(contractRepository.findOne(1361L));
List
<
ContractBody
>
bodies
=
contractBodyRepository
.
findAll
();
Map
<
String
,
String
>
bodiesNameMap
=
bodies
.
stream
().
collect
(
Collectors
.
toMap
(
ContractBody:
:
getCode
,
ContractBody:
:
getName
,
(
v1
,
v2
)
->
v1
));
...
...
@@ -91,7 +94,7 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
DateTime
end
=
new
DateTime
(
endDate
);
for
(
Contract
contract
:
contracts
)
{
this
.
caculateShareIncome
(
contract
,
start
,
end
);
contract
.
setMyBodyName
(
bodiesNameMap
.
get
(
contract
.
getMyBodyCode
()));
}
...
...
@@ -162,7 +165,6 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
adjustmentFund
=
new
BigDecimal
((
Days
.
daysBetween
(
contractStart
,
cancelDate
).
getDays
()
+
1
)
*
excludTax
*
1.0
/
allDay
)
.
setScale
(
0
,
BigDecimal
.
ROUND_HALF_UP
).
longValue
()
*
-
1
;
usedEnd
=
usedEnd
.
compareTo
(
cancelDate
)
<=
0
?
usedEnd
:
cancelDate
;
int
daysIncom
=
Days
.
daysBetween
(
usedStart
,
usedEnd
).
getDays
()
+
1
;
daysIncom
=
daysIncom
<
0
?
0
:
daysIncom
;
...
...
@@ -210,57 +212,6 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
}
// if (cancelDate.isBefore(start) && isCancel) {
// contract.setAdjustmentFund(0L);
// //分摊加入调整金
// contract.setIntervaIncomeShare(0L);
// return;
// }
//
// usedEnd = cancelDate.compareTo(usedEnd) <= 0 ? cancelDate : usedEnd;
//
// int daysIncom = Days.daysBetween(usedStart, usedEnd).getDays() + 1;
// daysIncom = daysIncom < 0 ? 0 : daysIncom;
// //区间分摊总收入
// contract.setIntervaIncomeShare(shareIncomDay * daysIncom);
//
// //调整金
// int daysCancle = 0;
//
// if (isCancel) {
// //合同作废
// daysCancle = Days.daysBetween(contractStart, usedEnd).getDays() + 1;
//
// } else {
// //合同中止
// daysCancle = Days.daysBetween(usedStart, usedEnd).getDays() + 1;
// }
//
// adjustmentFund = new BigDecimal(daysCancle * excludTax * 1.0 / allDay)
// .setScale(0, BigDecimal.ROUND_HALF_UP).longValue() * -1;
//
// DateTime shareEnd = cancelDate.compareTo(contractEnd) <= 0 ? cancelDate : contractEnd;
//
// if (isCancel) {
// if (checkTwoTime(shareEnd, end)) {
// contract.setAdjustmentFund(adjustmentFund);
// } else {
// contract.setAdjustmentFund(0L);
// }
// } else {
//
// if (checkTwoTime(end, usedEnd)) {
// contract.setAdjustmentFund(0L);
// } else {
// contract.setAdjustmentFund(adjustmentFund);
// }
// }
//
// //分摊
// contract.setIntervaIncomeShare(shareIncomDay * daysIncom);
// contract.setIncomeShareAll(contract.getIntervaIncomeShare() + contract.getAdjustmentFund());
//中止 取消 合同逻辑结束
return
;
...
...
@@ -340,7 +291,7 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
dayShareStartDate
=
nextMonth
==
null
?
contractStart
:
nextMonth
;
//最后一日 包含最后一日 时 分摊金处理
//
adjustmentFund = adjustmentFund < 0 ? 0 : adjustmentFund;
//
adjustmentFund = adjustmentFund < 0 ? 0 : adjustmentFund;
Long
lastDay
=
excludTax
-
adjustmentFund
-
shareIncomDay
*
(
Days
.
daysBetween
(
dayShareStartDate
,
contractEnd
).
getDays
());
if
(
start
.
isEqual
(
end
)
&&
start
.
isEqual
(
contractEnd
))
{
...
...
@@ -351,6 +302,8 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
//包含最后一日 时
contract
.
setIntervaIncomeShare
(
contract
.
getIntervaIncomeShare
()
-
shareIncomDay
+
lastDay
);
contract
.
setIncomeShareAll
(
contract
.
getIntervaIncomeShare
());
}
else
{
contract
.
setIncomeShareAll
(
contract
.
getIntervaIncomeShare
());
}
}
...
...
This diff is collapsed.
Click to expand it.
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