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
5c7dc026
Commit
5c7dc026
authored
Sep 10, 2020
by
周健威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
申请调车相关
parent
5fa479a1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
68 deletions
+13
-68
OrderRentVehicleController.java
.../xxfc/platform/order/rest/OrderRentVehicleController.java
+3
-49
ShuntApplyController.java
.../platform/order/rest/background/ShuntApplyController.java
+10
-19
No files found.
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/OrderRentVehicleController.java
View file @
5c7dc026
...
@@ -70,8 +70,8 @@ public class OrderRentVehicleController extends CommonBaseController {
...
@@ -70,8 +70,8 @@ public class OrderRentVehicleController extends CommonBaseController {
@ResponseBody
@ResponseBody
@ApiOperation
(
value
=
"确认租车订单"
)
@ApiOperation
(
value
=
"确认租车订单"
)
public
ObjectRestResponse
<
BaseOrder
>
add
(
@RequestBody
AddRentVehicleDTO
vo
){
public
ObjectRestResponse
<
BaseOrder
>
add
(
@RequestBody
AddRentVehicleDTO
vo
){
RentVehicleBO
bo
=
initRentVehicleBO
(
vo
);
RentVehicleBO
bo
=
orderRentVehicleBiz
.
initRentVehicleBO
(
vo
);
vo
.
setDayNum
(
orderCalculateBiz
.
getIncludeDays
(
vo
.
getStartTime
(),
vo
.
getEndTime
()));
//
vo.setDayNum(orderCalculateBiz.getIncludeDays(vo.getStartTime(), vo.getEndTime()));
bo
.
setAppUserDTO
(
userFeign
.
userDetailByToken
(
BaseContextHandler
.
getToken
()).
getData
());
bo
.
setAppUserDTO
(
userFeign
.
userDetailByToken
(
BaseContextHandler
.
getToken
()).
getData
());
orderRentVehicleService
.
createOrder
(
bo
);
orderRentVehicleService
.
createOrder
(
bo
);
return
ObjectRestResponse
.
succ
(
bo
.
getOrder
());
return
ObjectRestResponse
.
succ
(
bo
.
getOrder
());
...
@@ -83,8 +83,7 @@ public class OrderRentVehicleController extends CommonBaseController {
...
@@ -83,8 +83,7 @@ public class OrderRentVehicleController extends CommonBaseController {
@ApiOperation
(
value
=
"后台人员为客户下租车订单"
)
@ApiOperation
(
value
=
"后台人员为客户下租车订单"
)
public
ObjectRestResponse
<
BaseOrder
>
backStagedd
(
@RequestBody
BgAddRentDTO
dto
){
public
ObjectRestResponse
<
BaseOrder
>
backStagedd
(
@RequestBody
BgAddRentDTO
dto
){
RentVehicleBO
bo
=
orderRentVehicleBiz
.
initRentVehicleBO
(
dto
);
RentVehicleBO
bo
=
orderRentVehicleBiz
.
initRentVehicleBO
(
dto
);
bo
.
setDayNum
(
orderCalculateBiz
.
getIncludeDays
(
dto
.
getStartTime
(),
dto
.
getEndTime
()));
// bo.setDayNum(orderCalculateBiz.getIncludeDays(dto.getStartTime(), dto.getEndTime()));
bo
.
setAppUserDTO
(
userFeign
.
userDetailById
(
dto
.
getAppUserId
()).
getData
());
bo
.
setAppUserDTO
(
userFeign
.
userDetailById
(
dto
.
getAppUserId
()).
getData
());
bo
.
setCrtUser
(
"-1"
+
BaseContextHandler
.
getUserID
());
bo
.
setCrtUser
(
"-1"
+
BaseContextHandler
.
getUserID
());
//设置-1表示查询所有的车
//设置-1表示查询所有的车
...
@@ -93,51 +92,6 @@ public class OrderRentVehicleController extends CommonBaseController {
...
@@ -93,51 +92,6 @@ public class OrderRentVehicleController extends CommonBaseController {
return
ObjectRestResponse
.
succ
(
bo
.
getOrder
());
return
ObjectRestResponse
.
succ
(
bo
.
getOrder
());
}
}
private
RentVehicleBO
initRentVehicleBO
(
@RequestBody
AddRentVehicleDTO
vo
)
{
//计算天数
vo
.
setDayNum
(
orderCalculateBiz
.
getIncludeDays
(
vo
.
getStartTime
(),
vo
.
getEndTime
()));
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
());
}},
false
,
true
);
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
.
setEndCompanyId
(
endCompany
.
getId
());
}
}
}
if
(
vo
.
getStartCompanyId
()
!=
null
)
{
CompanyDetail
companyDetail
=
vehicleFeign
.
getCompanyDetail
(
vo
.
getStartCompanyId
()).
getData
();
if
(
companyDetail
!=
null
)
{
vo
.
setStartAddr
(
companyDetail
.
detailAddr
());
}
}
if
(
vo
.
getEndCompanyId
()
!=
null
)
{
CompanyDetail
companyDetail
=
vehicleFeign
.
getCompanyDetail
(
vo
.
getEndCompanyId
()).
getData
();
if
(
companyDetail
!=
null
)
{
vo
.
setEndAddr
(
companyDetail
.
detailAddr
());
}
}
RentVehicleBO
bo
=
BeanUtil
.
toBean
(
vo
,
RentVehicleBO
.
class
);
bo
.
setBookVehicleVO
(
new
BookVehicleVO
(){{
setBookStartDate
(
vo
.
getBookStartDate
());
setBookEndDate
(
vo
.
getBookEndDate
());
setBookStartDateTime
(
vo
.
getBookStartDateTime
());
setBookEndDateTime
(
vo
.
getBookEndDateTime
());
}});
bo
.
setTickerNo
(
StrUtil
.
isNotBlank
(
vo
.
getTickerNos
())?
StrUtil
.
splitTrim
(
vo
.
getTickerNos
(),
","
):
null
);
bo
.
setAccompanyItems
(
vo
.
getAccompanyItems
());
return
bo
;
}
@RequestMapping
(
value
=
"list-by-order/{orderId}"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"list-by-order/{orderId}"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
@ResponseBody
@ApiOperation
(
value
=
"租车列表by订单Id"
)
@ApiOperation
(
value
=
"租车列表by订单Id"
)
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/background/ShuntApplyController.java
View file @
5c7dc026
...
@@ -24,6 +24,9 @@ import lombok.Data;
...
@@ -24,6 +24,9 @@ import lombok.Data;
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.*
;
import
static
com
.
xxfc
.
platform
.
order
.
entity
.
ShuntApply
.
STATUS_CONFIRM
;
import
static
com
.
xxfc
.
platform
.
order
.
entity
.
ShuntApply
.
STATUS_CRT
;
@RestController
@RestController
@RequestMapping
(
"/background/shuntApply"
)
@RequestMapping
(
"/background/shuntApply"
)
public
class
ShuntApplyController
extends
BaseController
<
ShuntApplyBiz
,
ShuntApply
>
{
public
class
ShuntApplyController
extends
BaseController
<
ShuntApplyBiz
,
ShuntApply
>
{
...
@@ -41,9 +44,6 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
...
@@ -41,9 +44,6 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
@Autowired
@Autowired
OrderCalculateBiz
orderCalculateBiz
;
OrderCalculateBiz
orderCalculateBiz
;
@Autowired
ShuntApplyBiz
shuntApplyBiz
;
@Autowired
@Autowired
OrderRentVehicleService
orderRentVehicleService
;
OrderRentVehicleService
orderRentVehicleService
;
...
@@ -61,30 +61,21 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
...
@@ -61,30 +61,21 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
throw
new
BaseException
(
ResultCode
.
PARAM_ILLEGAL_CODE
);
throw
new
BaseException
(
ResultCode
.
PARAM_ILLEGAL_CODE
);
}
}
ShuntApply
shuntApply
=
shuntApply
Biz
.
selectById
(
dto
.
getApplyId
());
ShuntApply
shuntApply
=
base
Biz
.
selectById
(
dto
.
getApplyId
());
if
(
null
==
shuntApply
)
{
if
(
null
==
shuntApply
&&
shuntApply
.
getStatus
()
!=
STATUS_CRT
)
{
throw
new
BaseException
(
ResultCode
.
PARAM_ILLEGAL_CODE
);
throw
new
BaseException
(
ResultCode
.
PARAM_ILLEGAL_CODE
);
}
}
BgAddRentDTO
bgAddRentDTO
=
new
BgAddRentDTO
();
shuntApply
.
setVehicleId
(
dto
.
getVehicleId
());
bgAddRentDTO
.
setAppUserId
(
shuntApply
.
getUserId
());
shuntApply
.
setStatus
(
STATUS_CONFIRM
);
bgAddRentDTO
.
setStartTime
(
shuntApply
.
getStartTime
());
baseBiz
.
updateSelectiveById
(
shuntApply
);
bgAddRentDTO
.
setEndTime
(
shuntApply
.
getEndTime
());
RentVehicleBO
bo
=
orderRentVehicleBiz
.
initRentVehicleBO
(
bgAddRentDTO
);
bo
.
setDayNum
(
orderCalculateBiz
.
getIncludeDays
(
bgAddRentDTO
.
getStartTime
(),
bgAddRentDTO
.
getEndTime
()));
bo
.
setAppUserDTO
(
userFeign
.
userDetailById
(
bgAddRentDTO
.
getAppUserId
()).
getData
());
return
ObjectRestResponse
.
succ
();
bo
.
setCrtUser
(
"-1"
+
BaseContextHandler
.
getUserID
());
//设置-1表示查询所有的车
//bo.setUseType(-1);
orderRentVehicleService
.
createOrder
(
bo
);
return
ObjectRestResponse
.
succ
(
bo
.
getOrder
());
}
}
@Data
@Data
public
static
class
confirmApplyDTO
{
public
static
class
confirmApplyDTO
{
Integer
applyId
;
Integer
applyId
;
Integer
vehicleId
;
String
vehicleId
;
}
}
}
}
\ No newline at end of file
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