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
e2b7aa39
Commit
e2b7aa39
authored
Aug 07, 2019
by
周健威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复bug
parent
8f8a0b5f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
3 deletions
+23
-3
OrderRentVehicleController.java
.../xxfc/platform/order/rest/OrderRentVehicleController.java
+23
-3
No files found.
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/OrderRentVehicleController.java
View file @
e2b7aa39
...
...
@@ -18,7 +18,11 @@ import com.xxfc.platform.order.service.OrderRentVehicleService;
import
com.xxfc.platform.order.pojo.AddRentVehicleDTO
;
import
com.xxfc.platform.order.pojo.order.RentVehicleBO
;
import
com.xxfc.platform.order.pojo.price.RentVehiclePriceVO
;
import
com.xxfc.platform.vehicle.entity.BranchCompany
;
import
com.xxfc.platform.vehicle.entity.Vehicle
;
import
com.xxfc.platform.vehicle.feign.VehicleFeign
;
import
com.xxfc.platform.vehicle.pojo.BookVehicleVO
;
import
com.xxfc.platform.vehicle.pojo.CompanyDetail
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -32,6 +36,7 @@ import springfox.documentation.annotations.ApiIgnore;
import
javax.persistence.Column
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
@Controller
...
...
@@ -52,13 +57,28 @@ public class OrderRentVehicleController extends CommonBaseController {
@Autowired
UserFeign
userFeign
;
@Autowired
VehicleFeign
vehicleFeign
;
@RequestMapping
(
value
=
"add"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
@ApiOperation
(
value
=
"确认租车订单"
)
public
ObjectRestResponse
<
BaseOrder
>
add
(
@RequestBody
AddRentVehicleDTO
vo
){
if
(
null
==
vo
.
getBookEndDate
()
||
null
==
vo
.
getBookStartDate
()
||
vo
.
getBookStartDate
().
equals
(
0
)
||
vo
.
getBookEndDate
().
equals
(
0
))
{
throw
new
BaseException
(
ResultCode
.
PARAM_ILLEGAL_CODE
,
Sets
.
newSet
(
"公司参数不正确"
));
if
(
null
==
vo
.
getEndCompanyId
()
||
vo
.
getEndCompanyId
().
equals
(
0
))
{
if
(
StrUtil
.
isBlank
(
vo
.
getEndAddr
()))
{
throw
new
BaseException
(
ResultCode
.
PARAM_ILLEGAL_CODE
,
Sets
.
newSet
(
"公司参数不正确"
));
}
else
{
Map
<
String
,
Object
>
map
=
BeanUtil
.
beanToMap
(
new
BranchCompany
(){{
setName
(
vo
.
getEndAddr
());
}});
List
<
BranchCompany
>
data
=
vehicleFeign
.
branchCompanyEntityList
(
map
).
getData
();
if
(
null
==
data
)
{
throw
new
BaseException
(
ResultCode
.
PARAM_ILLEGAL_CODE
,
Sets
.
newSet
(
"公司参数不正确"
));
}
else
{
BranchCompany
endCompany
=
vehicleFeign
.
branchCompanyEntityList
(
map
).
getData
().
get
(
0
);
vo
.
setEndCity
(
endCompany
.
getId
());
}
}
}
RentVehicleBO
bo
=
BeanUtil
.
toBean
(
vo
,
RentVehicleBO
.
class
);
bo
.
setBookVehicleVO
(
new
BookVehicleVO
(){{
...
...
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