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
321a895b
Commit
321a895b
authored
Oct 27, 2020
by
周健威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改租车 和 申请接口
parent
ddedcb87
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
387 additions
and
308 deletions
+387
-308
BaseController.java
...m/github/wxiaoqi/security/common/rest/BaseController.java
+15
-0
OrderRentVehicleDetail.java
...om/xxfc/platform/order/entity/OrderRentVehicleDetail.java
+24
-2
ShuntApply.java
.../main/java/com/xxfc/platform/order/entity/ShuntApply.java
+7
-0
RentVehicleBO.java
...ava/com/xxfc/platform/order/pojo/order/RentVehicleBO.java
+2
-1
AddRentVehicleDTO.java
...xxfc/platform/order/pojo/order/add/AddRentVehicleDTO.java
+6
-0
BaseOrderBiz.java
...c/main/java/com/xxfc/platform/order/biz/BaseOrderBiz.java
+1
-1
ShuntApplyController.java
...va/com/xxfc/platform/order/rest/ShuntApplyController.java
+14
-22
BgShuntApplyController.java
...latform/order/rest/background/BgShuntApplyController.java
+256
-262
OrderRentVehicleService.java
.../xxfc/platform/order/service/OrderRentVehicleService.java
+43
-18
VehicleFeign.java
...in/java/com/xxfc/platform/vehicle/feign/VehicleFeign.java
+3
-0
RentVehicleBookDTO.java
...va/com/xxfc/platform/vehicle/pojo/RentVehicleBookDTO.java
+8
-0
RentVehicleController.java
...com/xxfc/platform/vehicle/rest/RentVehicleController.java
+2
-2
VehicleMapper.xml
...ehicle-server/src/main/resources/mapper/VehicleMapper.xml
+6
-0
No files found.
ace-common/src/main/java/com/github/wxiaoqi/security/common/rest/BaseController.java
View file @
321a895b
...
...
@@ -97,6 +97,21 @@ public class BaseController<Biz extends BaseBiz,Entity> extends CommonBaseContro
return
ObjectRestResponse
.
succ
(
baseBiz
.
selectList
(
entity
));
}
@ApiOperation
(
"根据参数查询,等于"
)
@RequestMapping
(
value
=
"/entityListPost"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
ObjectRestResponse
<
List
<
Entity
>>
entityListPost
(
@RequestBody
Entity
entity
){
//查询列表数据
return
ObjectRestResponse
.
succ
(
baseBiz
.
selectList
(
entity
));
}
//
// @ApiOperation("根据参数查询,等于")
// @RequestMapping(value = "/entityListPost",method = RequestMethod.POST)
// @ResponseBody
// public ObjectRestResponse<List<Entity>> entityListPost(@RequestBody Entity entity){
// //查询列表数据
// return ObjectRestResponse.succ(baseBiz.selectList(entity));
// }
@ApiOperation
(
"查询所有"
)
@RequestMapping
(
value
=
"/alls"
,
method
=
RequestMethod
.
GET
)
...
...
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/entity/OrderRentVehicleDetail.java
View file @
321a895b
...
...
@@ -273,8 +273,12 @@ public class OrderRentVehicleDetail implements Serializable {
@Column
(
name
=
"free_days"
)
@ApiModelProperty
(
value
=
"优惠天数"
)
private
Integer
freeDays
;
/**
public
void
setFreeDays
(
Integer
freeDays
)
{
this
.
freeDays
=
freeDays
;
}
/**
* 折扣 80 即 8折
*/
@Column
(
name
=
"rebate"
)
...
...
@@ -295,6 +299,10 @@ public class OrderRentVehicleDetail implements Serializable {
@ApiModelProperty
(
value
=
"剩余需要退还的钱(押金)"
)
private
BigDecimal
returnPayResidue
;
public
void
setReturnPayResidue
(
BigDecimal
returnPayResidue
)
{
this
.
returnPayResidue
=
returnPayResidue
;
}
/**
* 预定记录id
*/
...
...
@@ -392,6 +400,20 @@ public class OrderRentVehicleDetail implements Serializable {
@ApiModelProperty
(
value
=
"车辆公司(门店)id"
)
private
Integer
vehicleCompanyId
;
@Column
(
name
=
"vehicle_deposit"
)
@ApiModelProperty
(
value
=
"车辆押金"
)
private
BigDecimal
vehicleDeposit
;
@Column
(
name
=
"traffic_deposit"
)
@ApiModelProperty
(
value
=
"交通违章押金"
)
private
BigDecimal
trafficDeposit
;
/**
* 商品押金方式 1--线上;2--线下
*/
@Column
(
name
=
"goods_deposit_type"
)
private
Integer
goodsDepositType
;
public
Long
getEndTime
()
{
return
endTime
;
}
...
...
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/entity/ShuntApply.java
View file @
321a895b
...
...
@@ -205,4 +205,11 @@ public class ShuntApply implements Serializable {
@ApiModelProperty
(
value
=
"预约记录id"
,
hidden
=
true
)
private
Long
bookRecordId
;
@Column
(
name
=
"brand_id"
)
@ApiModelProperty
(
"品牌id"
)
private
Integer
brandId
;
@Column
(
name
=
"category_id"
)
@ApiModelProperty
(
"型号id"
)
private
Integer
categoryId
;
}
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/pojo/order/RentVehicleBO.java
View file @
321a895b
...
...
@@ -22,6 +22,7 @@ public class RentVehicleBO extends OrderRentVehicleDetail implements OrderDetail
private
BaseOrder
order
;
private
VehicleModel
vehicleModel
;
private
BookVehicleVO
bookVehicleVO
;
private
Vehicle
vehicle
;
/**
* 是否调车申请下订单
...
...
@@ -93,6 +94,6 @@ public class RentVehicleBO extends OrderRentVehicleDetail implements OrderDetail
this
.
startDate
=
DateUtil
.
date
(
getStartTime
());
this
.
endDate
=
DateUtil
.
date
(
getEndTime
());
this
.
startDateStr
=
DateUtil
.
formatDate
(
this
.
startDate
);
this
.
start
DateStr
=
DateUtil
.
formatDate
(
this
.
endDate
);
this
.
end
DateStr
=
DateUtil
.
formatDate
(
this
.
endDate
);
}
}
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/pojo/order/add/AddRentVehicleDTO.java
View file @
321a895b
...
...
@@ -131,6 +131,12 @@ public class AddRentVehicleDTO extends AddOrderCommonDTO{
@ApiModelProperty
(
value
=
"车辆id"
)
private
String
vehicleId
;
//
@ApiModelProperty
(
value
=
"商品押金类型 1--线上;2--线下"
)
private
Integer
goodsDepositType
;
public
static
final
int
GOODS_DEPOSIT_TYPE_UP
=
1
;
public
static
final
int
GOODS_DEPOSIT_TYPE_DOWN
=
2
;
public
void
setStartTime
(
Long
startTime
)
{
this
.
startTime
=
startTime
;
this
.
bookStartDate
=
YMR_SLASH_FORMATTER
.
format
(
LocalDateTime
.
ofInstant
(
Instant
.
ofEpochMilli
(
startTime
),
ZoneOffset
.
ofHours
(
8
)));
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/BaseOrderBiz.java
View file @
321a895b
...
...
@@ -764,7 +764,7 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> implements
RestResponse
<
Integer
>
result
=
vehicleFeign
.
rentProveVehicleBooking
(
orvd
.
getBookRecordId
());
//确认免费天数
if
(
orvd
.
getFreeDays
()
>
0
)
{
if
(
null
!=
orvd
.
getFreeDays
()
&&
orvd
.
getFreeDays
()
>
0
)
{
userFeign
.
memberDays
(
baseOrder
.
getUserId
(),
orvd
.
getFreeDays
(),
UserFeign
.
MEMBER_DAYS_CONFIRM
);
}
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/ShuntApplyController.java
View file @
321a895b
...
...
@@ -27,9 +27,8 @@ import com.xxfc.platform.order.mqhandler.RabbitProduct;
import
com.xxfc.platform.order.pojo.order.OrderPageVO
;
import
com.xxfc.platform.order.pojo.order.RentVehicleBO
;
import
com.xxfc.platform.order.pojo.order.add.AddRentVehicleDTO
;
import
com.xxfc.platform.order.pojo.order.add.BgAddRentDTO
;
import
com.xxfc.platform.order.rest.background.BgShuntApplyController
;
import
com.xxfc.platform.order.service.OrderRentVehicleService
;
import
com.xxfc.platform.vehicle.entity.VehicleCategory
;
import
com.xxfc.platform.vehicle.entity.VehicleModel
;
import
com.xxfc.platform.vehicle.feign.VehicleFeign
;
import
com.xxfc.platform.vehicle.pojo.BookVehicleVO
;
...
...
@@ -136,7 +135,7 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
return
w
;
},
" crt_time desc "
),
ShuntApplyVO
.
class
);
pages
.
getData
().
forEach
(
data
->
{
data
.
setVehicle
Model
(
vehicleFeign
.
get
(
data
.
getModel
Id
()).
getData
());
data
.
setVehicle
Category
(
vehicleFeign
.
getVehicleCategory
(
data
.
getCategory
Id
()).
getData
());
});
return
ObjectRestResponse
.
succ
(
pages
);
...
...
@@ -189,8 +188,9 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
@Data
public
static
class
ShuntApplyVO
extends
ShuntApply
{
VehicleModel
vehicleModel
;
//
VehicleModel vehicleModel;
OrderPageVO
orderPageVO
;
VehicleCategory
vehicleCategory
;
}
@Data
...
...
@@ -208,20 +208,20 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
@RequestMapping
(
value
=
"/appBusiness/list"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
@ApiOperation
(
value
=
"根据城市查询待确认申请列表"
)
public
ObjectRestResponse
<
PageDataVO
<
BgShuntApplyController
.
StewardShuntApply
>>
stewardList
(
BgShuntApplyController
.
ListDTO
dto
)
{
public
ObjectRestResponse
<
PageDataVO
<
StewardShuntApply
>>
stewardList
(
ListDTO
dto
)
{
AssertUtils
.
isBlank
(
getBusinessUserByAppUser
());
//获取该城市的申请最大和最小时间
//获取该店铺
PageDataVO
<
BgShuntApplyController
.
StewardShuntApply
>
list
=
PageDataVO
.
pageInfo
(
dto
.
initQuery
(),
()
->
baseBiz
.
selectByWeekend
(
w
->
{
PageDataVO
<
StewardShuntApply
>
list
=
PageDataVO
.
pageInfo
(
dto
.
initQuery
(),
()
->
baseBiz
.
selectByWeekend
(
w
->
{
if
(
null
!=
dto
.
getCityCode
())
{
w
.
andEqualTo
(
ShuntApply:
:
getStartCityCode
,
dto
.
getCityCode
());
}
w
.
andEqualTo
(
ShuntApply:
:
getStatus
,
STATUS_CRT
);
return
w
;
},
" crt_time desc "
),
BgShuntApplyController
.
StewardShuntApply
.
class
);
},
" crt_time desc "
),
StewardShuntApply
.
class
);
list
.
getData
().
forEach
(
data
->
{
data
.
setVehicle
Model
(
vehicleFeign
.
get
(
data
.
getModel
Id
()).
getData
());
data
.
setVehicle
Category
(
vehicleFeign
.
getVehicleCategory
(
data
.
getCategory
Id
()).
getData
());
});
return
ObjectRestResponse
.
succ
(
list
);
...
...
@@ -230,7 +230,7 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
@RequestMapping
(
value
=
"/appBusiness/confirmApply"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
@ApiOperation
(
value
=
"app商家用户确认申请"
)
public
ObjectRestResponse
stewardConfirmApply
(
@RequestBody
BgShuntApplyController
.
ConfirmApplyDTO
dto
)
{
public
ObjectRestResponse
stewardConfirmApply
(
@RequestBody
ConfirmApplyDTO
dto
)
{
UserDTO
userDTO
=
getBusinessUserByAppUser
();
AssertUtils
.
isBlank
(
userDTO
);
//查询列表数据
...
...
@@ -289,8 +289,8 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
AssertUtils
.
isBlank
(
userDTO
);
Integer
companyId
=
userDTO
.
getCompanyId
();
ShuntApply
shuntApply
=
baseBiz
.
selectById
(
applyId
);
BgShuntApplyController
.
StewardShuntApply
shuntApplyVO
=
BeanUtil
.
toBean
(
shuntApply
,
BgShuntApplyController
.
StewardShuntApply
.
class
);
shuntApplyVO
.
setVehicle
Model
(
vehicleFeign
.
get
(
shuntApply
.
getModel
Id
()).
getData
());
StewardShuntApply
shuntApplyVO
=
BeanUtil
.
toBean
(
shuntApply
,
StewardShuntApply
.
class
);
shuntApplyVO
.
setVehicle
Category
(
vehicleFeign
.
getVehicleCategory
(
shuntApply
.
getCategory
Id
()).
getData
());
RentVehicleBookDTO
rbd
=
new
RentVehicleBookDTO
();
rbd
.
setModelId
(
shuntApply
.
getModelId
());
rbd
.
setParkBranchCompanyId
(
companyId
);
...
...
@@ -334,7 +334,7 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
@RequestMapping
(
value
=
"/appBusiness/myApplyList"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
@ApiOperation
(
value
=
"我的申请"
)
public
ObjectRestResponse
myApplyList
(
BgShuntApplyController
.
PageDTO
dto
)
{
public
ObjectRestResponse
myApplyList
(
PageDTO
dto
)
{
UserDTO
userDTO
=
getBusinessUserByAppUser
();
AssertUtils
.
isBlank
(
userDTO
);
PageDataVO
<
ShuntApplyController
.
ShuntApplyVO
>
pages
=
PageDataVO
.
pageInfo
(
dto
.
initQuery
(),
()
->
baseBiz
.
selectByWeekend
(
w
->
{
...
...
@@ -346,7 +346,7 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
}),
ShuntApplyController
.
ShuntApplyVO
.
class
);
pages
.
getData
().
forEach
(
data
->
{
data
.
setVehicle
Model
(
vehicleFeign
.
get
(
data
.
getModel
Id
()).
getData
());
data
.
setVehicle
Category
(
vehicleFeign
.
getVehicleCategory
(
data
.
getCategory
Id
()).
getData
());
if
(
StrUtil
.
isNotBlank
(
data
.
getOrderNo
()))
{
Map
<
String
,
Object
>
map
=
CollUtil
.
newHashMap
();
...
...
@@ -381,14 +381,6 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
@Data
public
static
class
StewardShuntApply
extends
ShuntApply
{
List
<
UsableVeicleVO
>
vehicles
;
VehicleModel
vehicleModel
;
public
VehicleModel
getVehicleModel
()
{
return
vehicleModel
;
}
public
void
setVehicleModel
(
VehicleModel
vehicleModel
)
{
this
.
vehicleModel
=
vehicleModel
;
}
VehicleCategory
vehicleCategory
;
}
}
\ No newline at end of file
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/background/BgShuntApplyController.java
View file @
321a895b
package
com
.
xxfc
.
platform
.
order
.
rest
.
background
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.dto.UserDTO
;
import
com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface
;
import
com.github.wxiaoqi.security.common.context.BaseContextHandler
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.github.wxiaoqi.security.common.util.OrderUtil
;
import
com.github.wxiaoqi.security.common.util.Query
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.github.wxiaoqi.security.common.vo.PageParam
;
import
com.xxfc.platform.order.biz.BaseOrderBiz
;
import
com.xxfc.platform.order.biz.OrderRentVehicleBiz
;
import
com.xxfc.platform.order.biz.ShuntApplyBiz
;
import
com.xxfc.platform.order.biz.inner.OrderCalculateBiz
;
import
com.xxfc.platform.order.entity.BaseOrder
;
import
com.xxfc.platform.order.entity.ShuntApply
;
import
com.xxfc.platform.order.mqhandler.RabbitProduct
;
import
com.xxfc.platform.order.pojo.order.OrderPageVO
;
import
com.xxfc.platform.order.pojo.order.RentVehicleBO
;
import
com.xxfc.platform.order.pojo.order.add.BgAddRentDTO
;
import
com.xxfc.platform.order.rest.ShuntApplyController
;
import
com.xxfc.platform.order.service.OrderRentVehicleService
;
import
com.xxfc.platform.vehicle.constant.VehicleBookRecordStatus
;
import
com.xxfc.platform.vehicle.entity.VehicleModel
;
import
com.xxfc.platform.vehicle.feign.VehicleFeign
;
import
com.xxfc.platform.vehicle.pojo.BookVehicleVO
;
import
com.xxfc.platform.vehicle.pojo.RentVehicleBookDTO
;
import
com.xxfc.platform.vehicle.pojo.vo.UsableVeicleVO
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.Data
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
import
java.util.Map
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_FALSE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_TRUE
;
import
static
com
.
xxfc
.
platform
.
order
.
entity
.
ShuntApply
.
STATUS_CONFIRM
;
import
static
com
.
xxfc
.
platform
.
order
.
entity
.
ShuntApply
.
STATUS_CRT
;
@RestController
@RequestMapping
(
"/background/shuntApply"
)
public
class
BgShuntApplyController
extends
BaseController
<
ShuntApplyBiz
,
ShuntApply
>
implements
UserRestInterface
{
@Autowired
VehicleFeign
vehicleFeign
;
@Autowired
UserFeign
userFeign
;
@Autowired
OrderRentVehicleBiz
orderRentVehicleBiz
;
@Autowired
OrderCalculateBiz
orderCalculateBiz
;
@Autowired
OrderRentVehicleService
orderRentVehicleService
;
@Autowired
RabbitProduct
rabbitProduct
;
@Autowired
BaseOrderBiz
baseOrderBiz
;
@Override
public
UserFeign
getUserFeign
()
{
return
this
.
userFeign
;
}
@RequestMapping
(
value
=
"/steward/list"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
@ApiOperation
(
value
=
"根据城市查询待确认申请列表"
)
public
ObjectRestResponse
<
PageDataVO
<
StewardShuntApply
>>
stewardList
(
ListDTO
dto
)
{
//获取该城市的申请最大和最小时间
//获取该店铺
PageDataVO
<
StewardShuntApply
>
list
=
PageDataVO
.
pageInfo
(
dto
.
initQuery
(),
()
->
baseBiz
.
selectByWeekend
(
w
->
{
if
(
null
!=
dto
.
getCityCode
())
{
w
.
andEqualTo
(
ShuntApply:
:
getStartCityCode
,
dto
.
getCityCode
());
}
w
.
andEqualTo
(
ShuntApply:
:
getStatus
,
STATUS_CRT
);
return
w
;
},
" crt_time desc "
),
StewardShuntApply
.
class
);
list
.
getData
().
forEach
(
data
->
{
data
.
setVehicleModel
(
vehicleFeign
.
get
(
data
.
getModelId
()).
getData
());
});
return
ObjectRestResponse
.
succ
(
list
);
}
@RequestMapping
(
value
=
"/steward/confirmApply"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
@ApiOperation
(
value
=
"后台确认申请"
)
public
ObjectRestResponse
stewardConfirmApply
(
@RequestBody
ConfirmApplyDTO
dto
)
{
//查询列表数据
if
(
StrUtil
.
isBlank
(
getCurrentUserId
()))
{
throw
new
BaseException
(
ResultCode
.
AJAX_WECHAT_NOTEXIST_CODE
);
}
if
(
null
==
dto
.
getApplyId
())
{
throw
new
BaseException
(
ResultCode
.
PARAM_ILLEGAL_CODE
);
}
ShuntApply
shuntApply
=
baseBiz
.
selectById
(
dto
.
getApplyId
());
if
(
null
==
shuntApply
&&
shuntApply
.
getStatus
()
!=
STATUS_CRT
)
{
throw
new
BaseException
(
ResultCode
.
PARAM_ILLEGAL_CODE
);
}
RentVehicleBO
detail
=
new
RentVehicleBO
();
detail
.
setStartTime
(
shuntApply
.
getStartTime
());
detail
.
setEndTime
(
shuntApply
.
getEndTime
());
detail
.
setVehicleId
(
dto
.
getVehicleId
());
detail
.
setModelId
(
shuntApply
.
getModelId
());
detail
.
setStartAddr
(
shuntApply
.
getStartCompanyName
());
detail
.
setStartCompanyId
(
shuntApply
.
getStartCompanyId
());
detail
.
setEndCompanyId
(
shuntApply
.
getEndCompanyId
());
detail
.
setOrder
(
new
BaseOrder
(){{
setNo
(
OrderUtil
.
GetOrderNumber
(
""
,
OrderUtil
.
APP_MID
));}});
detail
.
setRentFreeDay
(
SYS_FALSE
);
detail
.
setBookVehicleVO
(
new
BookVehicleVO
(){{
setBookStartDate
(
DateUtil
.
date
(
shuntApply
.
getStartTime
()).
toDateStr
());
setBookEndDate
(
DateUtil
.
date
(
shuntApply
.
getEndTime
()).
toDateStr
());
setBookStartDateTime
(
DateUtil
.
date
(
shuntApply
.
getStartTime
()).
toString
());
setBookEndDateTime
(
DateUtil
.
date
(
shuntApply
.
getEndTime
()).
toString
());
}});
//预约车辆
orderRentVehicleService
.
acquireVehicle
(
detail
,
null
,
null
);
shuntApply
.
setVehicleId
(
dto
.
getVehicleId
());
shuntApply
.
setStatus
(
STATUS_CONFIRM
);
shuntApply
.
setOrderNo
(
detail
.
getOrder
().
getNo
());
shuntApply
.
setOverTime
(
DateUtil
.
offsetHour
(
DateUtil
.
date
(),
1
).
getTime
());
shuntApply
.
setConfirmUserId
(
getAdminUserInfo
().
getId
());
shuntApply
.
setConfirmCompanyId
(
getAdminUserInfo
().
getCompanyId
());
shuntApply
.
setBookRecordId
(
detail
.
getBookRecordId
());
baseBiz
.
updateSelectiveByIdRe
(
shuntApply
);
rabbitProduct
.
sendApplyDelayMessage
(
baseBiz
.
selectById
(
shuntApply
.
getId
()),
1000L
*
3601L
);
return
ObjectRestResponse
.
succ
();
}
@RequestMapping
(
value
=
"/steward/applyDetail"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
@ApiOperation
(
value
=
"申请的详情"
)
public
ObjectRestResponse
stewardApplyDetail
(
Integer
applyId
)
{
Integer
companyId
=
getAdminUserInfo
().
getCompanyId
();
ShuntApply
shuntApply
=
baseBiz
.
selectById
(
applyId
);
StewardShuntApply
shuntApplyVO
=
BeanUtil
.
toBean
(
shuntApply
,
StewardShuntApply
.
class
);
shuntApplyVO
.
setVehicleModel
(
vehicleFeign
.
get
(
shuntApply
.
getModelId
()).
getData
());
RentVehicleBookDTO
rbd
=
new
RentVehicleBookDTO
();
rbd
.
setModelId
(
shuntApply
.
getModelId
());
rbd
.
setParkBranchCompanyId
(
companyId
);
rbd
.
setStartCompanyId
(
companyId
);
rbd
.
setEndCompanyId
(
companyId
);
rbd
.
setBookStartDate
(
DateUtil
.
date
(
shuntApply
.
getStartTime
()).
toDateStr
());
rbd
.
setBookEndDate
(
DateUtil
.
date
(
shuntApply
.
getEndTime
()).
toDateStr
());
rbd
.
setBookStartDateTime
(
DateUtil
.
date
(
shuntApply
.
getStartTime
()).
toString
());
rbd
.
setBookEndDateTime
(
DateUtil
.
date
(
shuntApply
.
getEndTime
()).
toString
());
//查询本公司时间段内可用车辆
ObjectRestResponse
<
PageDataVO
<
UsableVeicleVO
>>
usableVehiclePage
=
vehicleFeign
.
applyUsableVehicle
(
rbd
);
if
(
CollUtil
.
isNotEmpty
(
usableVehiclePage
.
getData
().
getData
()))
{
List
<
UsableVeicleVO
>
vehicles
=
CollUtil
.
newArrayList
();
usableVehiclePage
.
getData
().
getData
().
forEach
(
usableVeicleVO
->
{
//判断是否预定时间内可租
usableVeicleVO
.
setAllowRent
(
SYS_TRUE
);
//如果"必须在这时间后预定" 存在 并且 比预定开始时间 要晚,那么不允许预定
if
(
null
!=
usableVeicleVO
.
getToLiftMustAfterDate
()
&&
DateUtil
.
date
(
shuntApply
.
getStartTime
()).
isBeforeOrEquals
(
usableVeicleVO
.
getToLiftMustAfterDate
()))
{
usableVeicleVO
.
setAllowRent
(
SYS_FALSE
);
}
//如果"必须在这时间前预定" 存在 并且 比预定结束时间 要早,那么不允许预定
if
(
null
!=
usableVeicleVO
.
getToReturnMustBeforeDate
()
&&
DateUtil
.
date
(
shuntApply
.
getEndTime
()).
isAfterOrEquals
(
usableVeicleVO
.
getToReturnMustBeforeDate
()))
{
usableVeicleVO
.
setAllowRent
(
SYS_FALSE
);
}
if
(
SYS_TRUE
.
equals
(
usableVeicleVO
.
getAllowRent
()))
{
vehicles
.
add
(
BeanUtil
.
toBean
(
usableVeicleVO
,
UsableVeicleVO
.
class
));
}
});
if
(
CollUtil
.
isNotEmpty
(
vehicles
))
{
shuntApplyVO
.
setVehicles
(
vehicles
);
}
}
return
ObjectRestResponse
.
succ
(
shuntApplyVO
);
}
@RequestMapping
(
value
=
"/steward/myApplyList"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
@ApiOperation
(
value
=
"我的申请"
)
public
ObjectRestResponse
myApplyList
(
PageDTO
dto
)
{
UserDTO
userDTO
=
getAdminUserInfo
();
PageDataVO
<
ShuntApplyController
.
ShuntApplyVO
>
pages
=
PageDataVO
.
pageInfo
(
dto
.
initQuery
(),
()
->
baseBiz
.
selectByWeekend
(
w
->
{
w
.
andEqualTo
(
ShuntApply:
:
getConfirmUserId
,
userDTO
.
getId
());
if
(
StrUtil
.
isNotBlank
(
dto
.
getMultiStatus
()))
{
w
.
andIn
(
ShuntApply:
:
getStatus
,
CollUtil
.
toList
(
dto
.
getMultiStatus
().
split
(
","
)));
}
return
w
;
}),
ShuntApplyController
.
ShuntApplyVO
.
class
);
pages
.
getData
().
forEach
(
data
->
{
data
.
setVehicleModel
(
vehicleFeign
.
get
(
data
.
getModelId
()).
getData
());
if
(
StrUtil
.
isNotBlank
(
data
.
getOrderNo
()))
{
Map
<
String
,
Object
>
map
=
CollUtil
.
newHashMap
();
map
.
put
(
"no"
,
data
.
getOrderNo
());
List
<
OrderPageVO
>
list
=
baseOrderBiz
.
pageByParm
(
map
);
if
(
CollUtil
.
isNotEmpty
(
list
))
{
data
.
setOrderPageVO
(
list
.
get
(
0
));
}
}
});
return
ObjectRestResponse
.
succ
(
pages
);
}
@Data
public
static
class
ConfirmApplyDTO
{
Integer
applyId
;
String
vehicleId
;
}
@Data
public
static
class
ListDTO
extends
PageParam
{
Integer
cityCode
;
}
@Data
public
static
class
PageDTO
extends
PageParam
{
String
multiStatus
;
}
@Data
public
static
class
StewardShuntApply
extends
ShuntApply
{
List
<
UsableVeicleVO
>
vehicles
;
VehicleModel
vehicleModel
;
public
VehicleModel
getVehicleModel
()
{
return
vehicleModel
;
}
public
void
setVehicleModel
(
VehicleModel
vehicleModel
)
{
this
.
vehicleModel
=
vehicleModel
;
}
}
}
\ No newline at end of file
//package com.xxfc.platform.order.rest.background;
//
//import cn.hutool.core.bean.BeanUtil;
//import cn.hutool.core.collection.CollUtil;
//import cn.hutool.core.date.DateUtil;
//import cn.hutool.core.util.StrUtil;
//import com.github.wxiaoqi.security.admin.feign.UserFeign;
//import com.github.wxiaoqi.security.admin.feign.dto.UserDTO;
//import com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface;
//import com.github.wxiaoqi.security.common.context.BaseContextHandler;
//import com.github.wxiaoqi.security.common.exception.BaseException;
//import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
//import com.github.wxiaoqi.security.common.rest.BaseController;
//import com.github.wxiaoqi.security.common.util.OrderUtil;
//import com.github.wxiaoqi.security.common.util.Query;
//import com.github.wxiaoqi.security.common.util.process.ResultCode;
//import com.github.wxiaoqi.security.common.vo.PageDataVO;
//import com.github.wxiaoqi.security.common.vo.PageParam;
//import com.xxfc.platform.order.biz.BaseOrderBiz;
//import com.xxfc.platform.order.biz.OrderRentVehicleBiz;
//import com.xxfc.platform.order.biz.ShuntApplyBiz;
//import com.xxfc.platform.order.biz.inner.OrderCalculateBiz;
//import com.xxfc.platform.order.entity.BaseOrder;
//import com.xxfc.platform.order.entity.ShuntApply;
//import com.xxfc.platform.order.mqhandler.RabbitProduct;
//import com.xxfc.platform.order.pojo.order.OrderPageVO;
//import com.xxfc.platform.order.pojo.order.RentVehicleBO;
//import com.xxfc.platform.order.pojo.order.add.BgAddRentDTO;
//import com.xxfc.platform.order.rest.ShuntApplyController;
//import com.xxfc.platform.order.service.OrderRentVehicleService;
//import com.xxfc.platform.vehicle.constant.VehicleBookRecordStatus;
//import com.xxfc.platform.vehicle.entity.VehicleCategory;
//import com.xxfc.platform.vehicle.entity.VehicleModel;
//import com.xxfc.platform.vehicle.feign.VehicleFeign;
//import com.xxfc.platform.vehicle.pojo.BookVehicleVO;
//import com.xxfc.platform.vehicle.pojo.RentVehicleBookDTO;
//import com.xxfc.platform.vehicle.pojo.vo.UsableVeicleVO;
//import io.swagger.annotations.ApiOperation;
//import lombok.Data;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.*;
//
//import java.util.List;
//import java.util.Map;
//
//import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_FALSE;
//import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_TRUE;
//import static com.xxfc.platform.order.entity.ShuntApply.STATUS_CONFIRM;
//import static com.xxfc.platform.order.entity.ShuntApply.STATUS_CRT;
//
//@RestController
//@RequestMapping("/background/shuntApply")
//public class BgShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApply> implements UserRestInterface {
//
//
// @Autowired
// VehicleFeign vehicleFeign;
//
// @Autowired
// UserFeign userFeign;
//
// @Autowired
// OrderRentVehicleBiz orderRentVehicleBiz;
//
// @Autowired
// OrderCalculateBiz orderCalculateBiz;
//
// @Autowired
// OrderRentVehicleService orderRentVehicleService;
//
// @Autowired
// RabbitProduct rabbitProduct;
//
// @Autowired
// BaseOrderBiz baseOrderBiz;
//
// @Override
// public UserFeign getUserFeign() {
// return this.userFeign;
// }
//
// @RequestMapping(value = "/steward/list", method = RequestMethod.GET)
// @ResponseBody
// @ApiOperation(value = "根据城市查询待确认申请列表")
// public ObjectRestResponse<PageDataVO<StewardShuntApply>> stewardList(ListDTO dto) {
// //获取该城市的申请最大和最小时间
// //获取该店铺
// PageDataVO<StewardShuntApply> list = PageDataVO.pageInfo(dto.initQuery(), () -> baseBiz.selectByWeekend(w -> {
// if(null != dto.getCityCode()) {
// w.andEqualTo(ShuntApply::getStartCityCode, dto.getCityCode());
// }
// w.andEqualTo(ShuntApply::getStatus, STATUS_CRT);
// return w;
// }, " crt_time desc "), StewardShuntApply.class);
//
// list.getData().forEach(data -> {
// data.setVehicleCategory(vehicleFeign.getVehicleCategory(data.getCategoryId()).getData());
// });
//
// return ObjectRestResponse.succ(list);
// }
//
// @RequestMapping(value = "/steward/confirmApply", method = RequestMethod.POST)
// @ResponseBody
// @ApiOperation(value = "后台确认申请")
// public ObjectRestResponse stewardConfirmApply(@RequestBody ConfirmApplyDTO dto) {
//
// //查询列表数据
// if (StrUtil.isBlank(getCurrentUserId())) {
// throw new BaseException(ResultCode.AJAX_WECHAT_NOTEXIST_CODE);
// }
//
// if(null == dto.getApplyId()) {
// throw new BaseException(ResultCode.PARAM_ILLEGAL_CODE);
// }
//
// ShuntApply shuntApply = baseBiz.selectById(dto.getApplyId());
// if(null == shuntApply && shuntApply.getStatus() != STATUS_CRT) {
// throw new BaseException(ResultCode.PARAM_ILLEGAL_CODE);
// }
//
// RentVehicleBO detail = new RentVehicleBO();
// detail.setStartTime(shuntApply.getStartTime());
// detail.setEndTime(shuntApply.getEndTime());
// detail.setVehicleId(dto.getVehicleId());
// detail.setModelId(shuntApply.getModelId());
// detail.setStartAddr(shuntApply.getStartCompanyName());
// detail.setStartCompanyId(shuntApply.getStartCompanyId());
// detail.setEndCompanyId(shuntApply.getEndCompanyId());
// detail.setOrder(new BaseOrder(){{setNo(OrderUtil.GetOrderNumber("", OrderUtil.APP_MID));}});
// detail.setRentFreeDay(SYS_FALSE);
// detail.setBookVehicleVO(new BookVehicleVO(){{
// setBookStartDate(DateUtil.date(shuntApply.getStartTime()).toDateStr());
// setBookEndDate(DateUtil.date(shuntApply.getEndTime()).toDateStr());
// setBookStartDateTime(DateUtil.date(shuntApply.getStartTime()).toString());
// setBookEndDateTime(DateUtil.date(shuntApply.getEndTime()).toString());
// }});
//
// //预约车辆
// orderRentVehicleService.acquireVehicle(detail, null , null);
//
// shuntApply.setVehicleId(dto.getVehicleId());
// shuntApply.setStatus(STATUS_CONFIRM);
// shuntApply.setOrderNo(detail.getOrder().getNo());
// shuntApply.setOverTime(DateUtil.offsetHour(DateUtil.date(), 1).getTime());
// shuntApply.setConfirmUserId(getAdminUserInfo().getId());
// shuntApply.setConfirmCompanyId(getAdminUserInfo().getCompanyId());
// shuntApply.setBookRecordId(detail.getBookRecordId());
// baseBiz.updateSelectiveByIdRe(shuntApply);
//
// rabbitProduct.sendApplyDelayMessage(baseBiz.selectById(shuntApply.getId()), 1000L * 3601L);
//
// return ObjectRestResponse.succ();
// }
//
// @RequestMapping(value = "/steward/applyDetail", method = RequestMethod.GET)
// @ResponseBody
// @ApiOperation(value = "申请的详情")
// public ObjectRestResponse stewardApplyDetail(Integer applyId) {
// Integer companyId = getAdminUserInfo().getCompanyId();
// ShuntApply shuntApply = baseBiz.selectById(applyId);
// StewardShuntApply shuntApplyVO = BeanUtil.toBean(shuntApply, StewardShuntApply.class);
// shuntApplyVO.setVehicleCategory(vehicleFeign.getVehicleCategory(shuntApply.getCategoryId()).getData());
// RentVehicleBookDTO rbd = new RentVehicleBookDTO();
//// rbd.setModelId(shuntApply.getModelId());
// rbd.setCategoryId(shuntApply.getCategoryId());
// rbd.setParkBranchCompanyId(companyId);
// rbd.setStartCompanyId(companyId);
// rbd.setEndCompanyId(companyId);
// rbd.setBookStartDate(DateUtil.date(shuntApply.getStartTime()).toDateStr());
// rbd.setBookEndDate(DateUtil.date(shuntApply.getEndTime()).toDateStr());
// rbd.setBookStartDateTime(DateUtil.date(shuntApply.getStartTime()).toString());
// rbd.setBookEndDateTime(DateUtil.date(shuntApply.getEndTime()).toString());
// //查询本公司时间段内可用车辆
// ObjectRestResponse<PageDataVO<UsableVeicleVO>> usableVehiclePage = vehicleFeign.applyUsableVehicle(rbd);
//
// if(CollUtil.isNotEmpty(usableVehiclePage.getData().getData())) {
// List<UsableVeicleVO> vehicles = CollUtil.newArrayList();
//
// usableVehiclePage.getData().getData().forEach(usableVeicleVO -> {
// //判断是否预定时间内可租
// usableVeicleVO.setAllowRent(SYS_TRUE);
// //如果"必须在这时间后预定" 存在 并且 比预定开始时间 要晚,那么不允许预定
// if(null != usableVeicleVO.getToLiftMustAfterDate() && DateUtil.date(shuntApply.getStartTime()).isBeforeOrEquals(usableVeicleVO.getToLiftMustAfterDate())) {
// usableVeicleVO.setAllowRent(SYS_FALSE);
// }
//
// //如果"必须在这时间前预定" 存在 并且 比预定结束时间 要早,那么不允许预定
// if(null != usableVeicleVO.getToReturnMustBeforeDate() && DateUtil.date(shuntApply.getEndTime()).isAfterOrEquals(usableVeicleVO.getToReturnMustBeforeDate())) {
// usableVeicleVO.setAllowRent(SYS_FALSE);
// }
// if(SYS_TRUE.equals(usableVeicleVO.getAllowRent())) {
// vehicles.add(BeanUtil.toBean(usableVeicleVO, UsableVeicleVO.class));
// }
// });
//
// if(CollUtil.isNotEmpty(vehicles)) {
// shuntApplyVO.setVehicles(vehicles);
// }
// }
// return ObjectRestResponse.succ(shuntApplyVO);
// }
//
//
// @RequestMapping(value = "/steward/myApplyList", method = RequestMethod.GET)
// @ResponseBody
// @ApiOperation(value = "我的申请")
// public ObjectRestResponse myApplyList(PageDTO dto) {
// UserDTO userDTO = getAdminUserInfo();
// PageDataVO<ShuntApplyController.ShuntApplyVO> pages = PageDataVO.pageInfo(dto.initQuery(), () -> baseBiz.selectByWeekend(w -> {
// w.andEqualTo(ShuntApply::getConfirmUserId, userDTO.getId());
// if(StrUtil.isNotBlank(dto.getMultiStatus())) {
// w.andIn(ShuntApply::getStatus, CollUtil.toList(dto.getMultiStatus().split(",")));
// }
// return w;
// }), ShuntApplyController.ShuntApplyVO.class);
//
// pages.getData().forEach(data -> {
// data.setVehicleCategory(vehicleFeign.getVehicleCategory(data.getCategoryId()).getData());
//
// if(StrUtil.isNotBlank(data.getOrderNo())) {
// Map<String, Object> map = CollUtil.newHashMap();
// map.put("no", data.getOrderNo());
// List<OrderPageVO> list = baseOrderBiz.pageByParm(map);
// if(CollUtil.isNotEmpty(list)) {
// data.setOrderPageVO(list.get(0));
// }
// }
// });
//
// return ObjectRestResponse.succ(pages);
// }
//
//
// @Data
// public static class ConfirmApplyDTO {
// Integer applyId;
// String vehicleId;
// }
//
// @Data
// public static class ListDTO extends PageParam {
// Integer cityCode;
// }
//
// @Data
// public static class PageDTO extends PageParam {
// String multiStatus;
// }
//
// @Data
// public static class StewardShuntApply extends ShuntApply {
// List<UsableVeicleVO> vehicles;
// VehicleCategory vehicleCategory;
// }
//}
\ No newline at end of file
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/service/OrderRentVehicleService.java
View file @
321a895b
...
...
@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.convert.Convert
;
import
cn.hutool.core.lang.Dict
;
import
cn.hutool.core.util.NumberUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.json.JSONObject
;
import
cn.hutool.json.JSONUtil
;
...
...
@@ -58,6 +59,7 @@ import static com.github.wxiaoqi.security.admin.constant.enumerate.MemberEnum.NO
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_FALSE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_TRUE
;
import
static
com
.
xxfc
.
platform
.
order
.
contant
.
enumerate
.
ItemTypeEnum
.
ACCOMPANY
;
import
static
com
.
xxfc
.
platform
.
order
.
pojo
.
order
.
add
.
AddRentVehicleDTO
.
GOODS_DEPOSIT_TYPE_UP
;
import
static
com
.
xxfc
.
platform
.
universal
.
constant
.
DictionaryKey
.
APP_ORDER
;
@Service
...
...
@@ -195,6 +197,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
//商品类型
bo
.
getOrder
().
setGoodsType
(
vehicle
.
getGoodsType
());
bo
.
setVehicle
(
vehicle
);
}
}
...
...
@@ -397,6 +400,9 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
//车型信息
VehicleModel
vehicleModel
=
vehicleFeign
.
get
(
detail
.
getModelId
()).
getData
();
//车型信息
Vehicle
vehicle
=
detail
.
getVehicle
();
detail
.
initDate
();
List
<
VehicleModelCalendarPriceDTO
>
metaVmcpds
=
vehicleFeign
.
getPriceByVehicleIdFeignV2
(
detail
.
getVehicleId
(),
detail
.
getStartDateStr
(),
detail
.
getEndDateStr
(),
dto
.
getUserid
(),
detail
.
getStartCompanyId
()).
getData
();
...
...
@@ -513,7 +519,15 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
}
//总价格(包含押金)
orderAmount
=
orderAmount
.
add
(
goodsAmount
).
add
(
vehicleModel
.
getDeposit
());
//判断商品押金方式
detail
.
setVehicleDeposit
(
vehicle
.
getDeposit
());
detail
.
setTrafficDeposit
(
vehicle
.
getVioDeposit
());
detail
.
setReturnPayResidue
(
vehicle
.
getVioDeposit
());
if
(
GOODS_DEPOSIT_TYPE_UP
==
detail
.
getGoodsDepositType
())
{
orderAmount
=
orderAmount
.
add
(
goodsAmount
).
add
(
detail
.
getVehicleDeposit
()).
add
(
detail
.
getTrafficDeposit
());
}
else
{
orderAmount
=
orderAmount
.
add
(
goodsAmount
).
add
(
detail
.
getTrafficDeposit
());
}
realAmount
=
orderAmount
.
subtract
(
couponAmount
);
//生成订单明细
...
...
@@ -571,6 +585,9 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
//车型信息
VehicleModel
vehicleModel
=
vehicleFeign
.
get
(
detail
.
getModelId
()).
getData
();
//车辆信息
Vehicle
vehicle
=
detail
.
getVehicle
();
detail
.
initDate
();
List
<
VehicleModelCalendarPriceDTO
>
metaVmcpds
=
vehicleFeign
.
getPriceByVehicleIdFeignV2
(
detail
.
getVehicleId
(),
detail
.
getStartDateStr
(),
detail
.
getEndDateStr
(),
dto
.
getUserid
(),
detail
.
getStartCompanyId
()).
getData
();
...
...
@@ -619,20 +636,20 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
//如果用户存在,并且为会员,并且车辆有优惠价
//默认折扣默认100
detail
.
setRebate
(
100
);
if
(
null
!=
dto
&&
SYS_TRUE
.
equals
(
dto
.
getIsMember
())
&&
!
NONE
.
getCode
().
equals
(
dto
.
getMemberLevel
())
&&
!
DISCOUNT_STATUS_NONE
.
equals
(
vehicleModel
.
getRentDiscountStatus
()))
{
String
[]
prices
=
StrUtil
.
isBlank
(
vehicleModel
.
getRentDiscountPrice
())
?
new
String
[]{
vehicleModel
.
getPrice
().
toString
(),
vehicleModel
.
getPrice
().
toString
(),
vehicleModel
.
getPrice
().
toString
()}
:
vehicleModel
.
getRentDiscountPrice
().
split
(
","
);
//设置是否使用会员权益
for
(
VMCalendarPriceCostDTO
vmcpcd
:
vehicleOrderItem
.
getVehicleDetail
())
{
if
(!
vmcpcd
.
getNo_discount_price
().
equals
(
vmcpcd
.
getPrice
()))
{
detail
.
getOrder
().
setHasMemberRight
(
SYS_TRUE
);
break
;
}
}
detail
.
setRebate
(
dto
.
getDiscount
());
}
//
if(null != dto && SYS_TRUE.equals(dto.getIsMember()) && !NONE.getCode().equals(dto.getMemberLevel()) && !DISCOUNT_STATUS_NONE.equals(vehicleModel.getRentDiscountStatus())) {
//
String[] prices = StrUtil.isBlank(vehicleModel.getRentDiscountPrice())
//
?new String[]{vehicleModel.getPrice().toString(),vehicleModel.getPrice().toString(),vehicleModel.getPrice().toString()}
//
:vehicleModel.getRentDiscountPrice().split(",");
//
//设置是否使用会员权益
//
for(VMCalendarPriceCostDTO vmcpcd : vehicleOrderItem.getVehicleDetail()) {
//
if(!vmcpcd.getNo_discount_price().equals(vmcpcd.getPrice())) {
//
detail.getOrder().setHasMemberRight(SYS_TRUE);
//
break;
//
}
//
}
//
//
detail.setRebate(dto.getDiscount());
//
}
//计算价格
if
(
vehicleHourNum
>
0
)
{
...
...
@@ -690,8 +707,15 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
}
//总价格(包含押金)
orderAmount
=
orderAmount
.
add
(
goodsAmount
).
add
(
vehicleModel
.
getDeposit
());
realAmount
=
orderAmount
.
subtract
(
couponAmount
);
//判断商品押金方式
detail
.
setVehicleDeposit
(
vehicle
.
getDeposit
());
detail
.
setTrafficDeposit
(
vehicle
.
getVioDeposit
());
detail
.
setReturnPayResidue
(
vehicle
.
getVioDeposit
());
if
(
GOODS_DEPOSIT_TYPE_UP
==
detail
.
getGoodsDepositType
())
{
orderAmount
=
orderAmount
.
add
(
goodsAmount
).
add
(
detail
.
getVehicleDeposit
()).
add
(
detail
.
getTrafficDeposit
());
}
else
{
orderAmount
=
orderAmount
.
add
(
goodsAmount
).
add
(
detail
.
getTrafficDeposit
());
}
//生成订单明细
RentVehiclePriceVO
rvp
=
new
RentVehiclePriceVO
();
...
...
@@ -713,6 +737,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
rvp
.
setVehicleHourNum
(
vehicleHourNum
);
rvp
.
setFreeHourNum
(
0
);
rvp
.
setFreeDayNum
(
0
);
rvp
.
setCutDayNum
(
offsetNum
);
rvp
.
setFreeAmount
(
vehicleOrderItem
.
getCutAmount
());
rvp
.
setBuyVehicleAmount
(
vehicleOrderItem
.
getBuyAmount
());
...
...
@@ -771,7 +796,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
if
(
DRIVER_TYPE_DAMAGE_SAFE
.
equals
(
detail
.
getDamageSafe
()))
{
childrenStr
.
append
(
",${tem_0104}"
);
}
if
(
detail
.
getFreeDays
()
>
0
)
{
if
(
null
!=
detail
.
getFreeDays
()
&&
detail
.
getFreeDays
()
>
0
)
{
childrenStr
.
append
(
",${tem_0105}"
);
}
if
(
StrUtil
.
isNotBlank
(
detail
.
getOrder
().
getCouponTickerNos
()))
{
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/feign/VehicleFeign.java
View file @
321a895b
...
...
@@ -26,6 +26,9 @@ import java.util.*;
*/
@FeignClient
(
name
=
"vehicle"
,
contextId
=
"vh"
)
public
interface
VehicleFeign
{
@GetMapping
(
value
=
"/vehicleCategory/{id}"
)
public
ObjectRestResponse
<
VehicleCategory
>
getVehicleCategory
(
@PathVariable
(
value
=
"id"
)
int
id
);
@GetMapping
(
value
=
"/vehicleModel/{id}"
)
public
ObjectRestResponse
<
VehicleModel
>
get
(
@PathVariable
(
value
=
"id"
)
int
id
);
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/RentVehicleBookDTO.java
View file @
321a895b
...
...
@@ -5,6 +5,7 @@ import com.xxfc.platform.vehicle.entity.VehiclePlatCata;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.persistence.Column
;
import
java.time.LocalDate
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -16,6 +17,13 @@ public class RentVehicleBookDTO extends PageParam {
//根据车型、时间、距离,门店,预定车辆
@ApiModelProperty
(
"车型id"
)
private
Integer
modelId
;
@ApiModelProperty
(
"品牌id"
)
private
Integer
brandId
;
@ApiModelProperty
(
"型号id"
)
private
Integer
categoryId
;
/**
* 预定目标日期(开始)
*/
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/RentVehicleController.java
View file @
321a895b
...
...
@@ -411,7 +411,7 @@ public class RentVehicleController extends BaseController<VehicleBiz> implements
public
List
<
VehicleModelCalendarPriceDTO
>
getSynthesizePrice
(
String
vehicleId
,
String
startDate
,
String
endDate
,
Integer
userId
,
Integer
companyId
)
{
List
<
VehicleModelCalendarPriceDTO
>
priceDTOS
=
CollUtil
.
newArrayList
();
cn
.
hutool
.
core
.
date
.
DateTime
beginOfStartDate
=
DateUtil
.
beginOfDay
(
DateUtil
.
parse
(
startDate
));
cn
.
hutool
.
core
.
date
.
DateTime
endOf
Start
Date
=
DateUtil
.
endOfDay
(
DateUtil
.
parse
(
endDate
));
cn
.
hutool
.
core
.
date
.
DateTime
endOf
End
Date
=
DateUtil
.
endOfDay
(
DateUtil
.
parse
(
endDate
));
//获取基本和周末价格
Vehicle
vehicle
=
vehicleBiz
.
selectOne
(
new
Vehicle
(){{
setParkBranchCompanyId
(
companyId
);
...
...
@@ -424,7 +424,7 @@ public class RentVehicleController extends BaseController<VehicleBiz> implements
//Date currentDate = DateUtil.beginOfDay(DateUtil.parse(startDate));
for
(
cn
.
hutool
.
core
.
date
.
DateTime
currentDate
=
DateUtil
.
beginOfDay
(
DateUtil
.
parse
(
startDate
));
(
currentDate
.
isAfterOrEquals
(
beginOfStartDate
)
&&
currentDate
.
isBeforeOrEquals
(
endOf
Start
Date
));
(
currentDate
.
isAfterOrEquals
(
beginOfStartDate
)
&&
currentDate
.
isBeforeOrEquals
(
endOf
End
Date
));
currentDate
=
DateUtil
.
offsetDay
(
currentDate
,
1
))
{
cn
.
hutool
.
core
.
date
.
DateTime
finalCurrentDate
=
currentDate
;
VehicleModelCalendarPriceDTO
dto
=
new
VehicleModelCalendarPriceDTO
(){{
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleMapper.xml
View file @
321a895b
...
...
@@ -1135,6 +1135,12 @@
<if
test=
"memberUse != null and memberUse>0"
>
and (v.member_use = 1 or v.member_use = #{memberUse})
</if>
<if
test=
"brandId != null "
>
and brand_id = #{brandId}
</if>
<if
test=
"categoryId != null "
>
and category_id = #{categoryId}
</if>
<if
test=
"lon != null and lat != null"
>
order by
distance asc
...
...
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