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
5677129a
Commit
5677129a
authored
Sep 28, 2020
by
lzxry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
点击数万单位处理
parent
d68ef5d3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
18 deletions
+17
-18
ShareIncomeServiceImpl.java
...main/java/common/service/impl/ShareIncomeServiceImpl.java
+17
-18
No files found.
src/main/java/common/service/impl/ShareIncomeServiceImpl.java
View file @
5677129a
...
...
@@ -232,9 +232,9 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
BigDecimal
clickTenThousand
=
new
BigDecimal
(
0
);
if
(
clickFlow
!=
0
){
clickTenThousand
=
new
BigDecimal
(
clickFlow
/
10000
*
100
);
clickTenThousand
=
new
BigDecimal
(
clickFlow
/
10000
.0
*
100
);
//区间点击数
contract
.
setClickFlow
(
new
BigDecimal
(
clickFlow
/
10000
).
setScale
(
4
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
());
contract
.
setClickFlow
(
new
BigDecimal
(
clickFlow
/
10000
.0
).
setScale
(
4
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
());
}
//区间分摊收入
contract
.
setIntervaIncomeShare
(
unitPriceAccurate
.
multiply
(
clickTenThousand
).
setScale
(
0
,
BigDecimal
.
ROUND_HALF_UP
).
longValue
());
...
...
@@ -251,7 +251,7 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
//累计总收入
clickNum
=
accountFlowRestrictService
.
getTotalNum
(
contractPart
[
0
].
toString
(
"yyyy-MM-dd"
),
grossDate
.
toString
(
"yyyy-MM-dd"
),
appkeyStr
,
"account_track_flow_restrict"
,
"click_sum"
);
clickFlow
=
clickNum
==
null
?
0
:
clickNum
.
intValue
();
contract
.
setIncomeGross
(
unitPriceAccurate
.
multiply
(
new
BigDecimal
(
clickFlow
/
10000
*
100
)).
setScale
(
0
,
BigDecimal
.
ROUND_HALF_UP
).
longValue
());
contract
.
setIncomeGross
(
unitPriceAccurate
.
multiply
(
new
BigDecimal
(
clickFlow
/
10000
.0
*
100
)).
setScale
(
0
,
BigDecimal
.
ROUND_HALF_UP
).
longValue
());
isLater
=
false
;
}
else
if
(
selected
[
1
].
isBefore
(
creatPoints
[
1
]))
{
...
...
@@ -273,9 +273,10 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
BigDecimal
clickTenThousand
=
new
BigDecimal
(
0
);
if
(
clickFlow
!=
0
){
clickTenThousand
=
new
BigDecimal
(
clickFlow
/
10000
*
100
);
clickTenThousand
=
new
BigDecimal
(
clickFlow
/
10000
.0
*
100
);
//区间点击数
contract
.
setClickFlow
(
new
BigDecimal
(
clickFlow
/
10000
).
setScale
(
4
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
());
System
.
out
.
println
(
new
BigDecimal
(
clickFlow
/
10000.0
));
contract
.
setClickFlow
(
new
BigDecimal
(
clickFlow
/
10000.0
).
setScale
(
4
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
());
}
//区间分摊收入
contract
.
setIntervaIncomeShare
(
unitPriceAccurate
.
multiply
(
clickTenThousand
).
setScale
(
0
,
BigDecimal
.
ROUND_HALF_UP
).
longValue
());
...
...
@@ -289,7 +290,7 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
clickFlow
=
clickNum
==
null
?
0
:
clickNum
.
intValue
();
clickTenThousand
=
new
BigDecimal
(
0
);
if
(
clickFlow
!=
0
){
clickTenThousand
=
new
BigDecimal
(
clickFlow
/
10000
*
100
);
clickTenThousand
=
new
BigDecimal
(
clickFlow
/
10000
.0
*
100
);
//区间点击数
}
contract
.
setAdjustmentFund
(
unitPriceAccurate
.
multiply
(
clickTenThousand
).
setScale
(
0
,
BigDecimal
.
ROUND_HALF_UP
).
longValue
());
...
...
@@ -306,7 +307,7 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
//累计总收入
clickNum
=
accountFlowRestrictService
.
getTotalNum
(
contractPart
[
0
].
toString
(
"yyyy-MM-dd"
),
grossDate
.
toString
(
"yyyy-MM-dd"
),
appkeyStr
,
"account_track_flow_restrict"
,
"click_sum"
);
clickFlow
=
clickNum
==
null
?
0
:
clickNum
.
intValue
();
contract
.
setIncomeGross
(
unitPriceAccurate
.
multiply
(
new
BigDecimal
(
clickFlow
/
10000
*
100
)).
setScale
(
0
,
BigDecimal
.
ROUND_HALF_UP
).
longValue
());
contract
.
setIncomeGross
(
unitPriceAccurate
.
multiply
(
new
BigDecimal
(
clickFlow
/
10000
.0
*
100
)).
setScale
(
0
,
BigDecimal
.
ROUND_HALF_UP
).
longValue
());
}
if
(
checkTwoTime
(
contractPart
[
1
],
selected
[
1
]))
{
...
...
@@ -323,7 +324,7 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
int
clickFlow
=
clickNum
==
null
?
0
:
clickNum
.
intValue
();
BigDecimal
clickTenThousand
=
new
BigDecimal
(
0
);
if
(
clickFlow
!=
0
){
clickTenThousand
=
new
BigDecimal
(
clickFlow
/
10000
*
100
);
clickTenThousand
=
new
BigDecimal
(
clickFlow
/
10000
.0
*
100
);
}
long
beforeTheMoney
=
unitPriceAccurate
.
multiply
(
clickTenThousand
).
setScale
(
0
,
BigDecimal
.
ROUND_HALF_UP
).
longValue
();
...
...
@@ -331,7 +332,7 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
clickNum
=
accountFlowRestrictService
.
getTotalNum
(
contractPart
[
1
].
toString
(
"yyyy-MM-dd"
),
contractPart
[
1
].
toString
(
"yyyy-MM-dd"
),
appkeyStr
,
"account_track_flow_restrict"
,
"click_sum"
);
clickFlow
=
clickNum
==
null
?
0
:
clickNum
.
intValue
();
clickTenThousand
=
new
BigDecimal
(
0
);
if
(
clickFlow
!=
0
)
clickTenThousand
=
new
BigDecimal
(
clickFlow
/
10000
*
100
);
if
(
clickFlow
!=
0
)
clickTenThousand
=
new
BigDecimal
(
clickFlow
/
10000
.0
*
100
);
long
lastDayTheMoney
=
unitPriceAccurate
.
multiply
(
clickTenThousand
).
setScale
(
0
,
BigDecimal
.
ROUND_HALF_UP
).
longValue
();
//合同的税后总金额减去最后合同一日之前的钱和调整金
lastDay
=
contract
.
getIncomeExcludingTax
()
-
contract
.
getAdjustmentFund
()
-
beforeTheMoney
;
...
...
@@ -374,7 +375,7 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
BigDecimal
clickTenThousand
=
new
BigDecimal
(
0
);
if
(
clickFlow
!=
0
){
clickTenThousand
=
new
BigDecimal
(
clickFlow
/
10000
*
100
);
clickTenThousand
=
new
BigDecimal
(
clickFlow
/
10000
.0
*
100
);
}
adjustmentFund
=
unitPriceAccurate
.
multiply
(
clickTenThousand
.
multiply
(
new
BigDecimal
(-
1
))).
setScale
(
0
,
BigDecimal
.
ROUND_HALF_UP
).
longValue
();
}
...
...
@@ -386,9 +387,9 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
int
clickFlow
=
clickNum
==
null
?
0
:
clickNum
.
intValue
();
BigDecimal
clickTenThousand
=
new
BigDecimal
(
0
);
if
(
clickFlow
!=
0
){
clickTenThousand
=
new
BigDecimal
(
clickFlow
/
10000
*
100
);
clickTenThousand
=
new
BigDecimal
(
clickFlow
/
10000
.0
*
100
);
//区间点击数
contract
.
setClickFlow
(
new
BigDecimal
(
clickFlow
/
10000
).
setScale
(
4
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
());
contract
.
setClickFlow
(
new
BigDecimal
(
clickFlow
/
10000
.0
).
setScale
(
4
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
());
}
//区间分摊收入,乘以100,前端除以100
long
share
=
unitPriceAccurate
.
multiply
(
clickTenThousand
).
setScale
(
0
,
BigDecimal
.
ROUND_HALF_UP
).
longValue
();
...
...
@@ -404,7 +405,7 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
//累计总收入
clickNum
=
accountFlowRestrictService
.
getTotalNum
(
contractPart
[
0
].
toString
(
"yyyy-MM-dd"
),
grossDate
.
toString
(
"yyyy-MM-dd"
),
appkeys
,
"account_track_flow_restrict"
,
"click_sum"
);
clickFlow
=
clickNum
==
null
?
0
:
clickNum
.
intValue
();
contract
.
setIncomeGross
(
unitPriceAccurate
.
multiply
(
new
BigDecimal
(
clickFlow
/
10000
*
100
)).
setScale
(
0
,
BigDecimal
.
ROUND_HALF_UP
).
longValue
());
contract
.
setIncomeGross
(
unitPriceAccurate
.
multiply
(
new
BigDecimal
(
clickFlow
/
10000
.0
*
100
)).
setScale
(
0
,
BigDecimal
.
ROUND_HALF_UP
).
longValue
());
return
contract
;
}
...
...
@@ -430,9 +431,9 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
contract
.
setClickFlow
(
0.0
);
BigDecimal
clickTenThousand
=
new
BigDecimal
(
0
);
if
(
clickFlow
!=
0
){
clickTenThousand
=
new
BigDecimal
(
clickFlow
/
10000
*
100
);
clickTenThousand
=
new
BigDecimal
(
clickFlow
/
10000
.0
*
100
);
//区间点击数
contract
.
setClickFlow
(
new
BigDecimal
(
clickFlow
/
10000
).
setScale
(
4
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
());
contract
.
setClickFlow
(
new
BigDecimal
(
clickFlow
/
10000
.0
).
setScale
(
4
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
());
}
//区间分摊收入,乘以100,前端除以100
long
share
=
unitPriceAccurate
.
multiply
(
clickTenThousand
).
setScale
(
0
,
BigDecimal
.
ROUND_HALF_UP
).
longValue
();
...
...
@@ -742,9 +743,7 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
}
public
static
void
main
(
String
[]
args
)
{
DateTime
dateTime
=
new
DateTime
(
"2020-09-25"
);
DateTime
creatTime
=
new
DateTime
(
"2020-10-11"
);
System
.
out
.
println
(
dateTime
.
isBefore
(
creatTime
));
System
.
out
.
println
(
new
BigDecimal
(
34009003
/
10000.0
));
}
...
...
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