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