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
6c1d788d
Commit
6c1d788d
authored
Oct 28, 2019
by
jiaorz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加车辆状态限制接口
parent
ff4616d2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
31 deletions
+6
-31
VehicleActiveService.java
...a/com/xxfc/platform/vehicle/biz/VehicleActiveService.java
+5
-1
VehicleActiveController.java
...m/xxfc/platform/vehicle/rest/VehicleActiveController.java
+1
-30
No files found.
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleActiveService.java
View file @
6c1d788d
...
@@ -60,7 +60,7 @@ public class VehicleActiveService {
...
@@ -60,7 +60,7 @@ public class VehicleActiveService {
*/
*/
public
void
departure
(
VehicleDepartureVo
departureVo
)
{
public
void
departure
(
VehicleDepartureVo
departureVo
)
{
log
.
info
(
"出车参数: departureVo = {}"
,
departureVo
.
toString
());
log
.
info
(
"出车参数: departureVo = {}"
,
departureVo
.
toString
());
Vehicle
vehicle
=
vehicle
Mapper
.
selectByPrimaryKey
(
departureVo
.
getVehicleId
());
Vehicle
vehicle
=
vehicle
Biz
.
selectById
(
departureVo
.
getVehicleId
());
if
(
vehicle
==
null
)
{
if
(
vehicle
==
null
)
{
throw
new
BaseException
(
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNEXIST
.
getDesc
(),
throw
new
BaseException
(
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNEXIST
.
getDesc
(),
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNEXIST
.
getCode
());
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNEXIST
.
getCode
());
...
@@ -69,6 +69,10 @@ public class VehicleActiveService {
...
@@ -69,6 +69,10 @@ public class VehicleActiveService {
throw
new
BaseException
(
ResCode
.
CHECKUSER_AND_PHONE_NOT_NULL
.
getDesc
(),
throw
new
BaseException
(
ResCode
.
CHECKUSER_AND_PHONE_NOT_NULL
.
getDesc
(),
ResCode
.
CHECKUSER_AND_PHONE_NOT_NULL
.
getCode
());
ResCode
.
CHECKUSER_AND_PHONE_NOT_NULL
.
getCode
());
}
}
if
(
vehicle
.
getStatus
().
equals
(
VehicleStatus
.
DISCARD
.
getCode
())
||
vehicle
.
getIsDel
()
==
1
||
vehicle
.
getStatus
().
equals
(
VehicleStatus
.
DEPARTURE
.
getCode
()))
{
throw
new
BaseException
(
ResCode
.
VEHICLE_STATUS_IS_NOT_NORMAL
.
getDesc
(),
ResCode
.
VEHICLE_STATUS_IS_NOT_NORMAL
.
getCode
());
}
//添加出车时间过滤 再出车开始时间前一天至结束时间内可以出车,并且预定记录为已审核状态
//添加出车时间过滤 再出车开始时间前一天至结束时间内可以出车,并且预定记录为已审核状态
checkDateInvalid
(
departureVo
);
checkDateInvalid
(
departureVo
);
Integer
MileageLift
=
vehicle
.
getMileageLastUpdate
();
Integer
MileageLift
=
vehicle
.
getMileageLastUpdate
();
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/VehicleActiveController.java
View file @
6c1d788d
package
com
.
xxfc
.
platform
.
vehicle
.
rest
;
package
com
.
xxfc
.
platform
.
vehicle
.
rest
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.xxfc.platform.vehicle.biz.VehicleActiveService
;
import
com.xxfc.platform.vehicle.biz.VehicleActiveService
;
import
com.xxfc.platform.vehicle.biz.VehicleBiz
;
import
com.xxfc.platform.vehicle.biz.VehicleBiz
;
import
com.xxfc.platform.vehicle.common.RestResponse
;
import
com.xxfc.platform.vehicle.common.RestResponse
;
import
com.xxfc.platform.vehicle.constant.ResCode.ResCode
;
import
com.xxfc.platform.vehicle.constant.ResCode.ResCode
;
import
com.xxfc.platform.vehicle.constant.VehicleStatus
;
import
com.xxfc.platform.vehicle.entity.Vehicle
;
import
com.xxfc.platform.vehicle.pojo.*
;
import
com.xxfc.platform.vehicle.pojo.*
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -38,19 +34,7 @@ public class VehicleActiveController {
...
@@ -38,19 +34,7 @@ public class VehicleActiveController {
return
RestResponse
.
codeAndMessage
(
ResCode
.
INVALID_REST_REQ_PARAM
.
getCode
(),
return
RestResponse
.
codeAndMessage
(
ResCode
.
INVALID_REST_REQ_PARAM
.
getCode
(),
ResCode
.
INVALID_REST_REQ_PARAM
.
getDesc
());
ResCode
.
INVALID_REST_REQ_PARAM
.
getDesc
());
}
}
Vehicle
vehicle
=
vehicleBiz
.
selectById
(
departureVo
.
getVehicleId
());
if
(
vehicle
==
null
)
{
throw
new
BaseException
(
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNEXIST
.
getDesc
(),
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNEXIST
.
getCode
());
}
if
(
StringUtils
.
isBlank
(
departureVo
.
getCheckMan
())
||
StringUtils
.
isBlank
(
departureVo
.
getCheckManTel
()))
{
throw
new
BaseException
(
ResCode
.
CHECKUSER_AND_PHONE_NOT_NULL
.
getDesc
(),
ResCode
.
CHECKUSER_AND_PHONE_NOT_NULL
.
getCode
());
}
if
(
vehicle
.
getStatus
().
equals
(
VehicleStatus
.
DISCARD
.
getCode
())
||
vehicle
.
getIsDel
()
==
1
||
vehicle
.
getStatus
().
equals
(
VehicleStatus
.
DEPARTURE
.
getCode
()))
{
throw
new
BaseException
(
ResCode
.
VEHICLE_STATUS_IS_NOT_NORMAL
.
getDesc
(),
ResCode
.
VEHICLE_STATUS_IS_NOT_NORMAL
.
getCode
());
}
vehicleActiveService
.
departure
(
departureVo
);
vehicleActiveService
.
departure
(
departureVo
);
return
RestResponse
.
suc
();
return
RestResponse
.
suc
();
}
}
...
@@ -69,19 +53,6 @@ public class VehicleActiveController {
...
@@ -69,19 +53,6 @@ public class VehicleActiveController {
return
RestResponse
.
codeAndMessage
(
ResCode
.
INVALID_REST_REQ_PARAM
.
getCode
(),
return
RestResponse
.
codeAndMessage
(
ResCode
.
INVALID_REST_REQ_PARAM
.
getCode
(),
ResCode
.
INVALID_REST_REQ_PARAM
.
getDesc
());
ResCode
.
INVALID_REST_REQ_PARAM
.
getDesc
());
}
}
Vehicle
vehicle
=
vehicleBiz
.
selectById
(
departureVo
.
getVehicleId
());
if
(
vehicle
==
null
)
{
throw
new
BaseException
(
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNEXIST
.
getDesc
(),
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNEXIST
.
getCode
());
}
if
(
StringUtils
.
isBlank
(
departureVo
.
getCheckMan
())
||
StringUtils
.
isBlank
(
departureVo
.
getCheckManTel
()))
{
throw
new
BaseException
(
ResCode
.
CHECKUSER_AND_PHONE_NOT_NULL
.
getDesc
(),
ResCode
.
CHECKUSER_AND_PHONE_NOT_NULL
.
getCode
());
}
if
(
vehicle
.
getStatus
().
equals
(
VehicleStatus
.
DISCARD
.
getCode
())
||
vehicle
.
getIsDel
()
==
1
)
{
throw
new
BaseException
(
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_DISABLE
.
getDesc
(),
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_DISABLE
.
getCode
());
}
vehicleActiveService
.
departure
(
departureVo
);
vehicleActiveService
.
departure
(
departureVo
);
return
RestResponse
.
suc
();
return
RestResponse
.
suc
();
}
}
...
...
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