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
f5cf2cbd
Commit
f5cf2cbd
authored
Nov 30, 2020
by
lzxry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
无限流量计算区间流量
parent
2d0a5e89
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
ShareIncomeServiceImpl.java
...main/java/common/service/impl/ShareIncomeServiceImpl.java
+14
-5
No files found.
src/main/java/common/service/impl/ShareIncomeServiceImpl.java
View file @
f5cf2cbd
...
@@ -315,7 +315,7 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
...
@@ -315,7 +315,7 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
BigDecimal
flow
=
tkioFlowRepository
.
sumFlowByDsAndContractCodes
(
startDate
,
endDate
,
codes
);
BigDecimal
flow
=
tkioFlowRepository
.
sumFlowByDsAndContractCodes
(
startDate
,
endDate
,
codes
);
double
i1
=
flow
==
null
?
0
:
flow
.
divide
(
new
BigDecimal
(
10000.0
)).
setScale
(
4
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
();
double
i1
=
flow
==
null
?
0
:
flow
.
divide
(
new
BigDecimal
(
10000.0
)).
setScale
(
4
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
();
if
(
j
>
0
){
//上一份合同超出的流量
if
(
j
>
0
){
//上一份合同超出的流量
算在当前合同上(肯定在签订日之前)合同的开始日(补充协议的开始日就是原合同的开始日,结束日为上一个合同的下一个签订日)
BigDecimal
bigDecimal
=
tkioFlowRepository
.
sumFlowByContractCodeAndDs
(
contractsArray
[
j
].
getContractCode
(),
contractsArray
[
j
].
getStartDate
(),
contractsArray
[
j
-
1
].
getNextSignedDate
());
BigDecimal
bigDecimal
=
tkioFlowRepository
.
sumFlowByContractCodeAndDs
(
contractsArray
[
j
].
getContractCode
(),
contractsArray
[
j
].
getStartDate
(),
contractsArray
[
j
-
1
].
getNextSignedDate
());
double
i
=
bigDecimal
==
null
?
0
:
bigDecimal
.
divide
(
new
BigDecimal
(
10000.0
)).
setScale
(
4
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
();
double
i
=
bigDecimal
==
null
?
0
:
bigDecimal
.
divide
(
new
BigDecimal
(
10000.0
)).
setScale
(
4
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
();
i1
+=
i
;
i1
+=
i
;
...
@@ -568,6 +568,19 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
...
@@ -568,6 +568,19 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
//区间分摊总收入
//区间分摊总收入
contract
.
setIntervaIncomeShare
(
shareMultiply
(
dayShareIncome
.
multiply
(
new
BigDecimal
(
100L
)),
new
BigDecimal
(
daysIncom
),
0
));
contract
.
setIntervaIncomeShare
(
shareMultiply
(
dayShareIncome
.
multiply
(
new
BigDecimal
(
100L
)),
new
BigDecimal
(
daysIncom
),
0
));
//无限流量套餐合同的区间点击数
ArrayList
<
String
>
codes
=
new
ArrayList
<>();
for
(
int
k
=
0
;
k
<=
i
;
k
++)
{
codes
.
add
(
contractsArray
[
k
].
getContractCode
());
}
BigDecimal
clickNumLimit
=
tkioFlowRepository
.
sumFlowByDsAndContractCodes
(
usePart
[
0
].
toString
(
"yyyy-MM-dd"
),
usePart
[
1
].
toString
(
"yyyy-MM-dd"
),
codes
);
long
clickFlowLimit
=
clickNumLimit
==
null
?
0L
:
clickNumLimit
.
longValue
();
if
(
clickFlowLimit
!=
0
){
contract
.
setClickFlow
(
new
BigDecimal
(
clickFlowLimit
/
10000.0
).
setScale
(
4
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
());
}
else
{
contract
.
setClickFlow
(
0.0
);
}
Long
adjustmentFund
=
0L
;
//调整金
Long
adjustmentFund
=
0L
;
//调整金
if
(
isLateContract
)
{
if
(
isLateContract
)
{
...
@@ -605,10 +618,6 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
...
@@ -605,10 +618,6 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
}
}
ArrayList
<
String
>
codes
=
new
ArrayList
<>();
for
(
int
k
=
0
;
k
<=
i
;
k
++)
{
codes
.
add
(
contractsArray
[
k
].
getContractCode
());
}
//处理上一份合同
//处理上一份合同
BigDecimal
clickNum
=
tkioFlowRepository
.
sumFlowByDsAndContractCodes
(
contractPart
[
0
].
toString
(
"yyyy-MM-dd"
),
creatPoints
[
1
].
plusDays
(-
1
).
toString
(
"yyyy-MM-dd"
),
codes
);
BigDecimal
clickNum
=
tkioFlowRepository
.
sumFlowByDsAndContractCodes
(
contractPart
[
0
].
toString
(
"yyyy-MM-dd"
),
creatPoints
[
1
].
plusDays
(-
1
).
toString
(
"yyyy-MM-dd"
),
codes
);
long
clickFlow
=
clickNum
==
null
?
0L
:
clickNum
.
longValue
();
long
clickFlow
=
clickNum
==
null
?
0L
:
clickNum
.
longValue
();
...
...
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