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
d514f71c
Commit
d514f71c
authored
Oct 06, 2020
by
周健威
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master-vehicle-price' into dev-tiande
parents
72e800ae
1a63c879
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
0 deletions
+41
-0
AddRentVehicleDTO.java
...xxfc/platform/order/pojo/order/add/AddRentVehicleDTO.java
+6
-0
OrderRentVehicleBiz.java
...java/com/xxfc/platform/order/biz/OrderRentVehicleBiz.java
+1
-0
OrderCalculateBiz.java
.../com/xxfc/platform/order/biz/inner/OrderCalculateBiz.java
+34
-0
No files found.
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/pojo/order/add/AddRentVehicleDTO.java
View file @
d514f71c
...
@@ -127,6 +127,12 @@ public class AddRentVehicleDTO extends AddOrderCommonDTO{
...
@@ -127,6 +127,12 @@ public class AddRentVehicleDTO extends AddOrderCommonDTO{
@ApiModelProperty
(
value
=
"车辆id"
)
@ApiModelProperty
(
value
=
"车辆id"
)
private
String
vehicleId
;
private
String
vehicleId
;
@ApiModelProperty
(
value
=
"商品类型 1--房车;2--机车;3--游艇"
)
private
Integer
goodsType
=
1
;
@ApiModelProperty
(
value
=
"小时数"
)
private
Integer
hourNum
;
public
void
setStartTime
(
Long
startTime
)
{
public
void
setStartTime
(
Long
startTime
)
{
this
.
startTime
=
startTime
;
this
.
startTime
=
startTime
;
this
.
bookStartDate
=
YMR_SLASH_FORMATTER
.
format
(
LocalDateTime
.
ofInstant
(
Instant
.
ofEpochMilli
(
startTime
),
ZoneOffset
.
ofHours
(
8
)));
this
.
bookStartDate
=
YMR_SLASH_FORMATTER
.
format
(
LocalDateTime
.
ofInstant
(
Instant
.
ofEpochMilli
(
startTime
),
ZoneOffset
.
ofHours
(
8
)));
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderRentVehicleBiz.java
View file @
d514f71c
...
@@ -105,6 +105,7 @@ public class OrderRentVehicleBiz extends BaseBiz<OrderRentVehicleDetailMapper, O
...
@@ -105,6 +105,7 @@ public class OrderRentVehicleBiz extends BaseBiz<OrderRentVehicleDetailMapper, O
public
RentVehicleBO
initRentVehicleBO
(
AddRentVehicleDTO
vo
)
{
public
RentVehicleBO
initRentVehicleBO
(
AddRentVehicleDTO
vo
)
{
//计算天数
//计算天数
vo
.
setDayNum
(
orderCalculateBiz
.
getIncludeDays
(
vo
.
getStartTime
(),
vo
.
getEndTime
()));
vo
.
setDayNum
(
orderCalculateBiz
.
getIncludeDays
(
vo
.
getStartTime
(),
vo
.
getEndTime
()));
vo
.
setHourNum
(
orderCalculateBiz
.
getIncludeHours
(
vo
.
getStartTime
(),
vo
.
getEndTime
()));
if
(
null
==
vo
.
getEndCompanyId
()
||
vo
.
getEndCompanyId
().
equals
(
0
))
{
if
(
null
==
vo
.
getEndCompanyId
()
||
vo
.
getEndCompanyId
().
equals
(
0
))
{
if
(
StrUtil
.
isBlank
(
vo
.
getEndAddr
()))
{
if
(
StrUtil
.
isBlank
(
vo
.
getEndAddr
()))
{
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/inner/OrderCalculateBiz.java
View file @
d514f71c
...
@@ -384,6 +384,40 @@ public class OrderCalculateBiz {
...
@@ -384,6 +384,40 @@ public class OrderCalculateBiz {
return
bookDays
;
return
bookDays
;
}
}
/**
* 计算包含多少小时
* @param startLong
* @param endLong
* @return
*/
public
Integer
getIncludeHours
(
Long
startLong
,
Long
endLong
)
{
Map
<
String
,
Dictionary
>
dictionaryMap
=
thirdFeign
.
dictionaryGetAll4Map
().
getData
();
Long
hourLong
=
(
60L
*
60L
*
1000L
);
//Long dayLong = hourLong * 24;
Long
bufferLong
=
0L
;
//计算:使用天数 当前时间 - 开始时间的0时0分0秒
Long
bookTimeLag
=
endLong
-
startLong
;
//默认 已使用了1小时
if
(
bookTimeLag
<=
0
)
{
return
1
;
}
log
.
info
(
"bookTimeLag {}"
,
new
BigDecimal
(
bookTimeLag
+
""
));
log
.
info
(
"divide {}"
,
new
BigDecimal
(
hourLong
+
""
));
Integer
hourDays
=
new
BigDecimal
(
bookTimeLag
+
""
).
divide
(
new
BigDecimal
(
hourLong
+
""
),
0
,
RoundingMode
.
DOWN
).
intValue
();
Long
excess
=
bookTimeLag
%
hourLong
;
if
(
excess
>
bufferLong
)
{
hourDays
+=
1
;
}
if
(
0
==
hourDays
)
{
hourDays
=
1
;
}
return
hourDays
;
}
public
OrderRefundPriceVO
getPriceCalculate
(
String
no
,
OrderPageVO
orderPageVO
)
{
public
OrderRefundPriceVO
getPriceCalculate
(
String
no
,
OrderPageVO
orderPageVO
)
{
//根据no 查订单
//根据no 查订单
...
...
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