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
43d34227
Commit
43d34227
authored
Sep 09, 2019
by
jiaorz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改提前还车逻辑
parent
ea18f88b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
OrderVehicleCrosstownBiz.java
...com/xxfc/platform/order/biz/OrderVehicleCrosstownBiz.java
+9
-7
No files found.
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderVehicleCrosstownBiz.java
View file @
43d34227
...
@@ -36,6 +36,8 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -36,6 +36,8 @@ import lombok.extern.slf4j.Slf4j;
import
org.apache.commons.collections4.map.HashedMap
;
import
org.apache.commons.collections4.map.HashedMap
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.joda.time.DateTime
;
import
org.joda.time.DateTime
;
import
org.joda.time.format.DateTimeFormat
;
import
org.joda.time.format.DateTimeFormatter
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -83,7 +85,7 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
...
@@ -83,7 +85,7 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
public
OrderVehicleCrosstown
get
(
Integer
id
)
{
public
OrderVehicleCrosstown
get
(
Integer
id
)
{
return
selectById
(
id
);
return
selectById
(
id
);
}
}
public
static
final
DateTimeFormatter
DEFAULT_DATE_TIME_FORMATTER
=
DateTimeFormat
.
forPattern
(
"yyyy-MM-dd"
);
public
List
<
OrderVehicleCrosstownDto
>
selectByOrderId
(
OrderVehicleCrosstownDto
orderVehicleCrosstownDto
)
{
public
List
<
OrderVehicleCrosstownDto
>
selectByOrderId
(
OrderVehicleCrosstownDto
orderVehicleCrosstownDto
)
{
List
<
OrderVehicleCrosstownDto
>
list
=
mapper
.
selectByOrderId
(
orderVehicleCrosstownDto
);
List
<
OrderVehicleCrosstownDto
>
list
=
mapper
.
selectByOrderId
(
orderVehicleCrosstownDto
);
...
@@ -307,14 +309,14 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
...
@@ -307,14 +309,14 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
baseOrder
=
baseOrderBiz
.
updateSelectiveByIdReT
(
baseOrder
);
baseOrder
=
baseOrderBiz
.
updateSelectiveByIdReT
(
baseOrder
);
}
else
if
(
baseOrder
.
getStatus
()
==
OrderStatusEnum
.
ORDER_WAIT
.
getCode
())
{
//还车
}
else
if
(
baseOrder
.
getStatus
()
==
OrderStatusEnum
.
ORDER_WAIT
.
getCode
())
{
//还车
//提前还车,结束时间大于当前时间
//提前还车,结束时间大于当前时间
DateTime
nowTime
=
DateTime
.
now
(
);
DateTime
nowTime
=
DateTime
.
parse
(
DateTime
.
now
().
toString
(),
DEFAULT_DATE_TIME_FORMATTER
);
DateTime
endTime
=
new
DateTime
(
orderRentVehicleDetail
.
getEndTime
()
);
DateTime
endTime
=
DateTime
.
parse
(
new
DateTime
(
orderRentVehicleDetail
.
getEndTime
()).
toString
(),
DEFAULT_DATE_TIME_FORMATTER
);
DateTime
startTime
=
new
DateTime
(
orderRentVehicleDetail
.
getStartTime
()
);
DateTime
startTime
=
DateTime
.
parse
(
new
DateTime
(
orderRentVehicleDetail
.
getStartTime
()).
toString
(),
DEFAULT_DATE_TIME_FORMATTER
);
//实际预定的天数
//实际预定的天数
int
actualDay
=
getDaysBetweenDateTime
(
startTime
,
endTime
);
int
actualDay
=
getDaysBetweenDateTime
(
startTime
,
endTime
);
if
(
orderRentVehicleDetail
.
getEndTime
()
>
nowTime
.
getMillis
())
{
if
(
orderRentVehicleDetail
.
getEndTime
()
>
nowTime
.
getMillis
())
{
//提前的天数
//提前的天数
, 当天就算使用一天
int
noUsedDay
=
getDaysBetweenDateTime
(
nowTime
,
endTime
);
int
noUsedDay
=
getDaysBetweenDateTime
(
nowTime
,
endTime
)
-
1
;
//退还未使用的天数,或者金额,扣除违约金,实际未使用天数的金额,最多3000元
//退还未使用的天数,或者金额,扣除违约金,实际未使用天数的金额,最多3000元
InProgressVO
inProgressVO
=
orderCalculateBiz
.
inProgressCalculate
(
baseOrder
,
actualDay
-
noUsedDay
);
InProgressVO
inProgressVO
=
orderCalculateBiz
.
inProgressCalculate
(
baseOrder
,
actualDay
-
noUsedDay
);
if
(
inProgressVO
!=
null
)
{
if
(
inProgressVO
!=
null
)
{
...
@@ -328,7 +330,7 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
...
@@ -328,7 +330,7 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
}
}
BigDecimal
cost
=
new
BigDecimal
(
0
);
BigDecimal
cost
=
new
BigDecimal
(
0
);
cost
.
add
(
inProgressVO
.
getExtraAmount
()).
add
(
inProgressVO
.
getViolateAmount
());
cost
.
add
(
inProgressVO
.
getExtraAmount
()).
add
(
inProgressVO
.
getViolateAmount
());
updateCrossRefund
(
orderVehicleCrosstown
,
cost
,
OrderViolateEnum
.
AFTER
.
getCode
());
updateCrossRefund
(
orderVehicleCrosstown
,
cost
,
OrderViolateEnum
.
BEFORE
.
getCode
());
//延期还车,结束时间小于当前时间
//延期还车,结束时间小于当前时间
}
else
if
(
orderRentVehicleDetail
.
getEndTime
()
<
nowTime
.
getMillis
())
{
}
else
if
(
orderRentVehicleDetail
.
getEndTime
()
<
nowTime
.
getMillis
())
{
//延期的天数, 延期违约金是延期天数*200%
//延期的天数, 延期违约金是延期天数*200%
...
...
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