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
ab3e1539
Commit
ab3e1539
authored
Jun 03, 2020
by
kangxiaoshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
dded1b8a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
ContractServiceImpl.java
src/main/java/common/service/impl/ContractServiceImpl.java
+12
-8
No files found.
src/main/java/common/service/impl/ContractServiceImpl.java
View file @
ab3e1539
...
...
@@ -542,7 +542,10 @@ public class ContractServiceImpl implements ContractService {
//分摊收入调整金 = 合同金额 * 6% / 合同总天数 *[录入日期前一月最后一日(含) - 合同开始日期]
int
day1
=
Days
.
daysBetween
(
contractStart
,
contractEnd
).
getDays
();
int
day2
=
Days
.
daysBetween
(
contractStart
,
new
DateTime
().
plusMonths
(-
1
).
dayOfMonth
().
withMaximumValue
()).
getDays
();
resource
.
setAdjustmentFund
(
resource
.
getMoney
()
*
6
/
day1
*
day2
);
// 此处为 *100的结果
long
resultValue
=
new
BigDecimal
(
resource
.
getMoney
()
*
0.06
/
day1
*
day2
)
.
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
)
.
multiply
(
new
BigDecimal
(
100
)).
longValue
();
resource
.
setAdjustmentFund
(
resultValue
);
// 此处为 *100的结果
}
else
{
resource
.
setAdjustmentFund
(
0L
);
}
...
...
@@ -2449,17 +2452,18 @@ public class ContractServiceImpl implements ContractService {
if
(
containEnd
)
{
//时间范围合同结束时间时 分两部分计算
//第一部分
intervalIncome
=
v
.
getIncomeExcludingTax
()
/
contracAllDays
*
(
contractFormRange
-
1
);
double
valuePart1
=
v
.
getIncomeExcludingTax
()
*
1.0
/
100
/
contracAllDays
*
(
contractFormRange
-
1
);
//此处 除100 计算完成再扩大100倍
Long
intervalIncomePart2
=
(
long
)
(
v
.
getIncomeExcludingTax
()
*
1.0
/
100
-
((
v
.
getIncomeExcludingTax
()
*
1.0
/
100
/
contracAllDays
*
(
contracAllDays
-
1
)))
)
*
100
;
intervalIncome
+=
intervalIncomePart2
;
double
valuePart2
=
v
.
getIncomeExcludingTax
()
*
1.0
/
100
-
((
v
.
getIncomeExcludingTax
()
*
1.0
/
100
/
contracAllDays
*
(
contracAllDays
-
1
)));
intervalIncome
=
new
BigDecimal
(
valuePart1
+
valuePart2
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
)
.
multiply
(
new
BigDecimal
(
100L
)).
longValue
()
;
v
.
setIntervaIncomeShare
(
intervalIncome
);
}
else
{
intervalIncome
=
v
.
getIncomeExcludingTax
()
/
contracAllDays
*
contractFormRange
;
intervalIncome
=
(
new
BigDecimal
(
v
.
getIncomeExcludingTax
()
*
1.0
/
100
/
contracAllDays
*
contractFormRange
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
)
.
multiply
(
new
BigDecimal
(
100L
))).
longValue
();
v
.
setIntervaIncomeShare
(
intervalIncome
);
}
...
...
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