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
01f68897
Commit
01f68897
authored
3 years ago
by
lzxry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix
parent
f5c94987
master
…
mobvista_master
No related merge requests found
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
25 deletions
+20
-25
ShareIncomeServiceImpl.java
...main/java/common/service/impl/ShareIncomeServiceImpl.java
+19
-24
TrackingFlowTask.java
src/main/java/track/task/TrackingFlowTask.java
+1
-1
No files found.
src/main/java/common/service/impl/ShareIncomeServiceImpl.java
View file @
01f68897
...
@@ -250,6 +250,13 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
...
@@ -250,6 +250,13 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
contract
.
setOneTimeRecognizedRevenue
(
oneTimeRecognizedRevenue
.
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
());
contract
.
setOneTimeRecognizedRevenue
(
oneTimeRecognizedRevenue
.
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
());
int
contractAllDay
=
getDayRange
(
contractValidPart
[
0
],
contractValidPart
[
1
])
+
1
;
//合同总天数
int
contractAllDay
=
getDayRange
(
contractValidPart
[
0
],
contractValidPart
[
1
])
+
1
;
//合同总天数
//晚录合同处理
DateTime
create
=
new
DateTime
(
new
DateTime
(
contract
.
getCreateTime
()).
toString
(
"yyyy-MM-dd"
));
//录入时间点
DateTime
[]
creatPoints
=
new
DateTime
[]{
create
,
//录入日
create
.
dayOfMonth
().
withMinimumValue
()
//录入月1日
};
//处理精度
//处理精度
BigDecimal
dayShareIncome
=
dailyRevenueRecognition
.
divide
(
new
BigDecimal
(
String
.
valueOf
(
contractAllDay
)),
8
,
BigDecimal
.
ROUND_HALF_UP
);
BigDecimal
dayShareIncome
=
dailyRevenueRecognition
.
divide
(
new
BigDecimal
(
String
.
valueOf
(
contractAllDay
)),
8
,
BigDecimal
.
ROUND_HALF_UP
);
...
@@ -266,18 +273,12 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
...
@@ -266,18 +273,12 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
}
}
//晚录合同处理
DateTime
create
=
new
DateTime
(
new
DateTime
(
contract
.
getCreateTime
()).
toString
(
"yyyy-MM-dd"
));
//录入时间点
DateTime
[]
creatPoints
=
new
DateTime
[]{
create
,
//录入日
create
.
dayOfMonth
().
withMinimumValue
()
//录入月1日
};
this
.
afterContractCAS
(
contract
,
oneTimeRecognizedRevenue
,
contractAllDay
,
dayShareIncome
,
contractPart
,
usePart
,
selected
,
creatPoints
,
contractValidPart
);
this
.
afterContractCAS
(
contract
,
oneTimeRecognizedRevenue
,
contractAllDay
,
dayShareIncome
,
contractPart
,
usePart
,
selected
,
creatPoints
,
contractValidPart
);
}
}
private
void
afterContractCAS
(
Contract
contract
,
BigDecimal
oneTimeRecognizedRevenue
,
int
contractAllDay
,
BigDecimal
dayShareIncome
,
DateTime
[]
contractPart
,
DateTime
[]
usePart
,
DateTime
[]
selected
,
DateTime
[]
creatPoints
,
DateTime
[]
contractValidPart
)
{
private
void
afterContractCAS
(
Contract
contract
,
BigDecimal
oneTimeRecognizedRevenue
,
int
contractAllDay
,
BigDecimal
dayShareIncome
,
DateTime
[]
contractPart
,
DateTime
[]
usePart
,
DateTime
[]
selected
,
DateTime
[]
creatPoints
,
DateTime
[]
contractValidPart
)
{
int
betweenMonth
=
Months
.
monthsBetween
(
contractPart
[
0
],
creatPoints
[
0
]).
getMonths
();
//时间范围内用于计算分摊金额的天数
//时间范围内用于计算分摊金额的天数
int
daysIncom
=
getDayRange
(
usePart
[
0
],
usePart
[
1
])
+
1
;
int
daysIncom
=
getDayRange
(
usePart
[
0
],
usePart
[
1
])
+
1
;
//区间分摊总收入
//区间分摊总收入
...
@@ -305,12 +306,10 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
...
@@ -305,12 +306,10 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
contract
.
setStatus
(
ContractStatusEnum
.
LATE
.
getKey
());
contract
.
setStatus
(
ContractStatusEnum
.
LATE
.
getKey
());
}
}
boolean
isLater
=
true
;
if
(!
isLateContract
)
{
if
(!
isLateContract
||
betweenMonth
<
1
)
{
//非合同晚录
//非合同晚录
contract
.
setAdjustmentFund
(
0L
);
contract
.
setAdjustmentFund
(
0L
);
contract
.
setIncomeShareAll
(
contract
.
getIntervaIncomeShare
());
contract
.
setIncomeShareAll
(
contract
.
getIntervaIncomeShare
());
isLater
=
false
;
}
else
if
(
selected
[
1
].
isBefore
(
creatPoints
[
1
]))
{
}
else
if
(
selected
[
1
].
isBefore
(
creatPoints
[
1
]))
{
...
@@ -334,10 +333,12 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
...
@@ -334,10 +333,12 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
adjustmentFund
=
shareMultiply
(
dayShareIncome
,
new
BigDecimal
(
getDayRange
(
contractValidPart
[
0
],
creatPoints
[
1
].
plusDays
(-
1
))
+
1
),
0
);
adjustmentFund
=
shareMultiply
(
dayShareIncome
,
new
BigDecimal
(
getDayRange
(
contractValidPart
[
0
],
creatPoints
[
1
].
plusDays
(-
1
))
+
1
),
0
);
adjustmentFund
+=
oneTimeRecognizedRevenue
.
multiply
(
new
BigDecimal
(
"100"
)).
setScale
(
0
,
BigDecimal
.
ROUND_HALF_UP
).
longValue
();
//
adjustmentFund += oneTimeRecognizedRevenue.multiply(new BigDecimal("100")).setScale(0, BigDecimal.ROUND_HALF_UP).longValue();
if
(
checkTwoTime
(
selected
[
0
],
creatPoints
[
1
])
&&
checkTwoTime
(
creatPoints
[
1
],
selected
[
1
]))
{
if
(
checkTwoTime
(
selected
[
0
],
creatPoints
[
1
])
&&
checkTwoTime
(
creatPoints
[
1
],
selected
[
1
]))
{
//所选时间范围包含 录入月 1 号 显示统计的调整金
//所选时间范围包含 录入月 1 号 显示统计的调整金
contract
.
setAdjustmentFund
(
adjustmentFund
);
contract
.
setAdjustmentFund
(
adjustmentFund
);
//逻辑变动,所选时间返回包含录入月1号就开始显示一次性确认收入
contract
.
setOneTimeRecognizedRevenue
(
oneTimeRecognizedRevenue
.
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
());
}
else
{
}
else
{
contract
.
setAdjustmentFund
(
0L
);
contract
.
setAdjustmentFund
(
0L
);
}
}
...
@@ -355,24 +356,16 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
...
@@ -355,24 +356,16 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
if
(
checkTwoTime
(
contractValidPart
[
1
],
selected
[
1
]))
{
if
(
checkTwoTime
(
contractValidPart
[
1
],
selected
[
1
]))
{
//最后一日分摊金计算处理
//最后一日分摊金计算处理
Long
lastDay
;
//CAS的合同都有“一次性确认收入”,单价是减去一次性确认收入后的,所以计算最后一天的分摊金需要再减去一次性确认收入的金额
if
(
isLater
)
{
Long
lastDay
=
contract
.
getIncomeExcludingTax
()
-
adjustmentFund
-
(
oneTimeRecognizedRevenue
.
longValue
()
*
100
)
lastDay
=
contract
.
getIncomeExcludingTax
()
-
adjustmentFund
-
shareMultiply
(
dayShareIncome
,
new
BigDecimal
(
getDayRange
(
creatPoints
[
1
],
contractValidPart
[
1
])),
0
);
}
else
{
//CAS的合同都有“一次性确认收入”,单价是减去一次性确认收入后的,所以计算最后一天的分摊金需要再减去一次性确认收入的金额
lastDay
=
contract
.
getIncomeExcludingTax
()
-
adjustmentFund
-
(
contract
.
getOneTimeRecognizedRevenue
().
longValue
()
*
100
)
-
shareMultiply
(
dayShareIncome
,
new
BigDecimal
(
getDayRange
(
contractValidPart
[
0
],
contractValidPart
[
1
])),
0
);
-
shareMultiply
(
dayShareIncome
,
new
BigDecimal
(
getDayRange
(
contractValidPart
[
0
],
contractValidPart
[
1
])),
0
);
}
//最后一日 或 包含最后一日 时
//最后一日 或 包含最后一日 时
contract
.
setIntervaIncomeShare
(
contract
.
getIntervaIncomeShare
()
-
contract
.
setIntervaIncomeShare
(
contract
.
getIntervaIncomeShare
()
-
dayShareIncome
.
setScale
(
0
,
BigDecimal
.
ROUND_HALF_UP
).
longValue
()
+
lastDay
);
dayShareIncome
.
setScale
(
0
,
BigDecimal
.
ROUND_HALF_UP
).
longValue
()
+
lastDay
);
}
}
Double
v
=
contract
.
getOneTimeRecognizedRevenue
()
*
100L
;
Double
v
=
contract
.
getOneTimeRecognizedRevenue
()
*
100L
;
//contract.setIncomeShareAll(contract.getIntervaIncomeShare() + contract.getAdjustmentFund());
contract
.
setIncomeShareAll
(
contract
.
getIntervaIncomeShare
()
+
contract
.
getAdjustmentFund
()
+
v
.
longValue
());
contract
.
setIncomeShareAll
(
contract
.
getIntervaIncomeShare
()
+
contract
.
getAdjustmentFund
()
+
v
.
longValue
());
}
}
...
@@ -459,8 +452,10 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
...
@@ -459,8 +452,10 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
DateTime
cancelDate
=
new
DateTime
(
contractChange
.
getDs
());
DateTime
cancelDate
=
new
DateTime
(
contractChange
.
getDs
());
Long
adjustmentFund
=
shareMultiply
(
new
BigDecimal
((
getDayRange
(
contractValidPart
[
0
],
cancelDate
)
+
1
)
*
-
1
),
dayShareIncome
,
0
);
Long
adjustmentFund
=
shareMultiply
(
new
BigDecimal
((
getDayRange
(
contractValidPart
[
0
],
cancelDate
)
+
1
)
*
-
1
),
dayShareIncome
,
0
);
adjustmentFund
-=
oneTimeRecognizedRevenue
.
multiply
(
new
BigDecimal
(
"100"
)).
setScale
(
0
,
BigDecimal
.
ROUND_HALF_UP
).
longValue
();
//adjustmentFund -= oneTimeRecognizedRevenue.multiply(new BigDecimal("100")).setScale(0, BigDecimal.ROUND_HALF_UP).longValue();
if
(
checkTwoTime
(
contractValidPart
[
0
],
selected
[
1
])
&&
checkTwoTime
(
selected
[
0
],
contractValidPart
[
0
]))
{
if
(
checkTwoTime
(
cancelDate
,
selected
[
1
])
&&
checkTwoTime
(
selected
[
0
],
cancelDate
))
{
contract
.
setOneTimeRecognizedRevenue
(
oneTimeRecognizedRevenue
.
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
()*-
1
);
}
else
if
(
checkTwoTime
(
contractValidPart
[
0
],
selected
[
1
])
&&
checkTwoTime
(
selected
[
0
],
contractValidPart
[
0
]))
{
//如果是晚录合同,把一次性确认收入放在录入月1号
}
else
{
}
else
{
contract
.
setOneTimeRecognizedRevenue
(
0.0
);
contract
.
setOneTimeRecognizedRevenue
(
0.0
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/main/java/track/task/TrackingFlowTask.java
View file @
01f68897
...
@@ -448,7 +448,7 @@ public class TrackingFlowTask {
...
@@ -448,7 +448,7 @@ public class TrackingFlowTask {
StopWatch
stopWatch
=
new
StopWatch
();
StopWatch
stopWatch
=
new
StopWatch
();
stopWatch
.
start
();
stopWatch
.
start
();
String
status
=
restTaskInfoRepository
.
findStatus
(
info
.
getId
());
String
status
=
restTaskInfoRepository
.
findStatus
(
info
.
getId
());
if
(!
status
.
equals
(
"
init
"
))
{
if
(!
status
.
equals
(
"
tasking
"
))
{
logger
.
info
(
"暂停重置流量 ......"
);
logger
.
info
(
"暂停重置流量 ......"
);
break
;
break
;
}
}
...
...
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