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
d8b76c16
Commit
d8b76c16
authored
4 years ago
by
kangxiaoshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
作废合同调整金
parent
2a73b1e5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
13 deletions
+8
-13
ShareIncomeServiceImpl.java
...main/java/common/service/impl/ShareIncomeServiceImpl.java
+8
-13
No files found.
src/main/java/common/service/impl/ShareIncomeServiceImpl.java
View file @
d8b76c16
...
...
@@ -100,7 +100,7 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
this
.
shareIncome4Contract
(
contract
,
start
,
end
);
contract
.
setMyBodyName
(
bodiesNameMap
.
get
(
contract
.
getMyBodyCode
()));
}
logger
.
info
(
"计算分摊收入耗时
"
,
(
System
.
currentTimeMillis
()
-
start_
)
/
1000
);
logger
.
info
(
"计算分摊收入耗时
:{}"
,
(
System
.
currentTimeMillis
()
-
start_
)
);
return
contracts
;
}
...
...
@@ -263,10 +263,7 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
if
(
checkTwoTime
(
suspendDate
,
cancelDate
))
{
adjustmentFund
=
0L
;
}
else
{
/* adjustmentFund = new BigDecimal((getDayRange(cancelDate, suspendDate) + 1)
* contract.getIncomeExcludingTax() * 1.0 / contractAllDay)
.setScale(0, BigDecimal.ROUND_HALF_UP).longValue() * -1;*/
/*adjustmentFund = (getDayRange(cancelDate, suspendDate) + 1) * dayShareIncome * (-1);*/
adjustmentFund
=
shareMultiply
(
new
BigDecimal
((
getDayRange
(
cancelDate
,
suspendDate
)
+
1
)
*
-
1
),
dayShareIncome
,
0
);
}
...
...
@@ -275,7 +272,6 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
daysIncom
=
daysIncom
<
0
?
0
:
daysIncom
;
//区间分摊总收入
/*contract.setIntervaIncomeShare(dayShareIncome * daysIncom);*/
contract
.
setIntervaIncomeShare
(
shareMultiply
(
dayShareIncome
,
new
BigDecimal
(
daysIncom
),
0
));
if
(
checkTwoTime
(
selected
[
0
],
cancelDate
)
&&
checkTwoTime
(
cancelDate
,
selected
[
1
]))
{
...
...
@@ -309,22 +305,24 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
DateTime
cancelDate
=
new
DateTime
(
contractChange
.
getDs
());
/*Long adjustmentFund = (getDayRange(contractPart[0], cancelDate) + 1) * dayShareIncome * (-1);*/
Long
adjustmentFund
=
shareMultiply
(
new
BigDecimal
((
getDayRange
(
contractPart
[
0
],
cancelDate
)
+
1
)),
dayShareIncome
,
0
);
Long
adjustmentFund
=
shareMultiply
(
new
BigDecimal
((
getDayRange
(
contractPart
[
0
],
cancelDate
)
+
1
)
*
-
1
),
dayShareIncome
,
0
);
DateTime
usedEnd
=
usePart
[
1
].
compareTo
(
cancelDate
)
<=
0
?
usePart
[
1
]
:
cancelDate
;
int
daysIncom
=
Days
.
daysBetween
(
usePart
[
0
],
usedEnd
).
getDays
()
+
1
;
daysIncom
=
daysIncom
<
0
?
0
:
daysIncom
;
contract
.
setIntervalUseDays
(
getDayRange
(
contractPart
[
0
],
usedEnd
)
+
1
);
//区间分摊总收入
/*contract.setIntervaIncomeShare(dayShareIncome * daysIncom);*/
contract
.
setIntervaIncomeShare
(
shareMultiply
(
dayShareIncome
,
new
BigDecimal
(
daysIncom
),
0
));
boolean
fullRange
=
getDayRange
(
selected
[
0
],
selected
[
1
])
/*
boolean fullRange = getDayRange(selected[0], selected[1])
>= Days.daysBetween(contractPart[0], cancelDate).getDays() ? true : false;
if (fullRange) {
contract.setAdjustmentFund(-1 * contract.getIntervaIncomeShare());
}
else
if
(
checkTwoTime
(
selected
[
0
],
cancelDate
)
&&
checkTwoTime
(
cancelDate
,
selected
[
1
]))
{
} else */
if
(
checkTwoTime
(
selected
[
0
],
cancelDate
)
&&
checkTwoTime
(
cancelDate
,
selected
[
1
]))
{
contract
.
setAdjustmentFund
(
adjustmentFund
);
}
else
{
contract
.
setAdjustmentFund
(
0L
);
...
...
@@ -338,7 +336,6 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
return
one
.
multiply
(
two
).
setScale
(
scale
,
BigDecimal
.
ROUND_HALF_UP
).
longValue
();
}
@Override
public
boolean
checkLateContract
(
DateTime
dateTime
,
DateTime
creatTime
)
{
int
aferDays
=
dateTime
.
monthOfYear
().
get
()
==
12
?
29
:
9
;
...
...
@@ -354,8 +351,6 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
return
dateTime1
.
isBefore
(
dateTime2
)
||
dateTime1
.
isEqual
(
dateTime2
);
}
public
static
void
main
(
String
[]
args
)
{
/* Long aa = new BigDecimal(1000 * 100 / 1.06).setScale(2, BigDecimal.ROUND_HALF_UP).longValue();
...
...
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