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
692b1cc8
Commit
692b1cc8
authored
Nov 17, 2020
by
周健威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改提示语
parent
30d598f3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
SpecialRentBiz.java
...main/java/com/xxfc/platform/order/biz/SpecialRentBiz.java
+10
-3
No files found.
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/SpecialRentBiz.java
View file @
692b1cc8
...
@@ -22,6 +22,7 @@ import com.xxfc.platform.vehicle.feign.VehicleFeign;
...
@@ -22,6 +22,7 @@ import com.xxfc.platform.vehicle.feign.VehicleFeign;
import
com.xxfc.platform.vehicle.pojo.BookVehicleVO
;
import
com.xxfc.platform.vehicle.pojo.BookVehicleVO
;
import
com.xxfc.platform.vehicle.pojo.CompanyDetail
;
import
com.xxfc.platform.vehicle.pojo.CompanyDetail
;
import
com.xxfc.platform.vehicle.pojo.vo.VehicleVO
;
import
com.xxfc.platform.vehicle.pojo.vo.VehicleVO
;
import
lombok.extern.slf4j.Slf4j
;
import
org.mockito.internal.util.collections.Sets
;
import
org.mockito.internal.util.collections.Sets
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -46,6 +47,7 @@ import static com.xxfc.platform.vehicle.entity.Vehicle.STATE_DOWN;
...
@@ -46,6 +47,7 @@ import static com.xxfc.platform.vehicle.entity.Vehicle.STATE_DOWN;
* @date 2020-10-31 11:02:42
* @date 2020-10-31 11:02:42
*/
*/
@Service
@Service
@Slf4j
public
class
SpecialRentBiz
extends
BaseBiz
<
SpecialRentMapper
,
SpecialRent
>
{
public
class
SpecialRentBiz
extends
BaseBiz
<
SpecialRentMapper
,
SpecialRent
>
{
...
@@ -104,8 +106,12 @@ public class SpecialRentBiz extends BaseBiz<SpecialRentMapper, SpecialRent> {
...
@@ -104,8 +106,12 @@ public class SpecialRentBiz extends BaseBiz<SpecialRentMapper, SpecialRent> {
}
}
//判断车辆是否下架、是否已经存在一个特惠租车
//判断车辆是否下架、是否已经存在一个特惠租车
if
(
STATE_DOWN
==
vehicle
.
getStatus
()
||
checkHasSpecialRent
(
vehicle
.
getId
()))
{
if
(
STATE_DOWN
==
vehicle
.
getStatus
()
)
{
throw
new
BaseException
(
ResultCode
.
PARAM_ILLEGAL_CODE
);
throw
new
BaseException
(
"车辆已下架"
,
ResultCode
.
PARAM_ILLEGAL_CODE
);
}
if
(
checkHasSpecialRent
(
vehicle
.
getId
())
)
{
throw
new
BaseException
(
"车辆已被占用"
,
ResultCode
.
PARAM_ILLEGAL_CODE
);
}
}
//设置当前经营门店为停靠门店、品牌id、型号id
//设置当前经营门店为停靠门店、品牌id、型号id
...
@@ -124,7 +130,7 @@ public class SpecialRentBiz extends BaseBiz<SpecialRentMapper, SpecialRent> {
...
@@ -124,7 +130,7 @@ public class SpecialRentBiz extends BaseBiz<SpecialRentMapper, SpecialRent> {
DateTime
afterDateTime
=
DateUtil
.
offsetHour
(
DateUtil
.
date
(),
1
);
DateTime
afterDateTime
=
DateUtil
.
offsetHour
(
DateUtil
.
date
(),
1
);
if
(!
startDateTime
.
isAfterOrEquals
(
afterDateTime
))
{
if
(!
startDateTime
.
isAfterOrEquals
(
afterDateTime
))
{
throw
new
BaseException
(
ResultCode
.
FAILED_CODE
,
Sets
.
newSet
(
"请提前一小时特惠租车发布"
)
);
throw
new
BaseException
(
"请提前一小时特惠租车发布"
,
ResultCode
.
FAILED_CODE
);
}
}
if
(
null
!=
specialRent
.
getStartCompanyId
())
{
if
(
null
!=
specialRent
.
getStartCompanyId
())
{
...
@@ -191,6 +197,7 @@ public class SpecialRentBiz extends BaseBiz<SpecialRentMapper, SpecialRent> {
...
@@ -191,6 +197,7 @@ public class SpecialRentBiz extends BaseBiz<SpecialRentMapper, SpecialRent> {
setId
(
vehicle
.
getId
());
setId
(
vehicle
.
getId
());
setState
(
STATE_DOWN
);
setState
(
STATE_DOWN
);
}});
}});
log
.
info
(
"设置车辆下架: {} restResponse: {}"
,
vehicle
.
getId
(),
JSONUtil
.
toJsonStr
(
restResponse
));
}
}
Date
endDateTime
=
DateUtil
.
date
(
specialRent
.
getEndTime
());
Date
endDateTime
=
DateUtil
.
date
(
specialRent
.
getEndTime
());
...
...
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