Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
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
youjj
cloud-platform
Commits
a781f9c7
Commit
a781f9c7
authored
Nov 27, 2020
by
周健威
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature_chw_zjw' into dev-chw
parents
d45c0c5c
38ba142c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
CalculateInterface.java
...com/xxfc/platform/universal/inter/CalculateInterface.java
+7
-6
No files found.
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/inter/CalculateInterface.java
View file @
a781f9c7
...
@@ -57,8 +57,9 @@ public interface CalculateInterface {
...
@@ -57,8 +57,9 @@ public interface CalculateInterface {
default
Integer
getIncludeHours
(
Long
startLong
,
Long
endLong
)
{
default
Integer
getIncludeHours
(
Long
startLong
,
Long
endLong
)
{
Map
<
String
,
Dictionary
>
dictionaryMap
=
getThirdFeign
().
dictionaryGetAll4Map
().
getData
();
Map
<
String
,
Dictionary
>
dictionaryMap
=
getThirdFeign
().
dictionaryGetAll4Map
().
getData
();
Long
hourLong
=
(
60L
*
60L
*
1000L
);
Long
hourLong
=
(
60L
*
60L
*
1000L
);
Long
minuteLong
=
(
60L
*
1000L
);
//Long dayLong = hourLong * 24;
//Long dayLong = hourLong * 24;
Long
bufferLong
=
Long
.
valueOf
(
dictionaryMap
.
get
(
APP_ORDER
+
"_"
+
DictionaryKey
.
RENT_TIME_HOUR_BUFFER
).
getDetail
())
*
hour
Long
;
Long
bufferLong
=
Long
.
valueOf
(
dictionaryMap
.
get
(
APP_ORDER
+
"_"
+
DictionaryKey
.
RENT_TIME_HOUR_BUFFER
).
getDetail
())
*
minute
Long
;
//计算:使用天数 当前时间 - 开始时间的0时0分0秒
//计算:使用天数 当前时间 - 开始时间的0时0分0秒
Long
bookTimeLag
=
endLong
-
startLong
;
Long
bookTimeLag
=
endLong
-
startLong
;
...
@@ -70,16 +71,16 @@ public interface CalculateInterface {
...
@@ -70,16 +71,16 @@ public interface CalculateInterface {
// log.info("bookTimeLag {}", new BigDecimal(bookTimeLag + ""));
// log.info("bookTimeLag {}", new BigDecimal(bookTimeLag + ""));
// log.info("divide {}", new BigDecimal(hourLong+ ""));
// log.info("divide {}", new BigDecimal(hourLong+ ""));
Integer
hour
Day
s
=
new
BigDecimal
(
bookTimeLag
+
""
).
divide
(
new
BigDecimal
(
hourLong
+
""
),
0
,
RoundingMode
.
DOWN
).
intValue
();
Integer
hour
Num
s
=
new
BigDecimal
(
bookTimeLag
+
""
).
divide
(
new
BigDecimal
(
hourLong
+
""
),
0
,
RoundingMode
.
DOWN
).
intValue
();
Long
excess
=
bookTimeLag
%
hourLong
;
Long
excess
=
bookTimeLag
%
hourLong
;
if
(
excess
>
bufferLong
)
{
if
(
excess
>
bufferLong
)
{
hour
Day
s
+=
1
;
hour
Num
s
+=
1
;
}
}
if
(
0
==
hour
Day
s
)
{
if
(
0
==
hour
Num
s
)
{
hour
Day
s
=
1
;
hour
Num
s
=
1
;
}
}
return
hour
Day
s
;
return
hour
Num
s
;
}
}
}
}
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