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
5fa479a1
Commit
5fa479a1
authored
Sep 10, 2020
by
周健威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
申请调车相关
parent
b121d313
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
186 additions
and
10 deletions
+186
-10
BaseController.java
...m/github/wxiaoqi/security/common/rest/BaseController.java
+2
-2
PageDataVO.java
...ava/com/github/wxiaoqi/security/common/vo/PageDataVO.java
+11
-1
AppStaffUserController.java
...b/wxiaoqi/security/admin/rest/AppStaffUserController.java
+10
-2
application.yml
ace-modules/ace-generator/src/main/resources/application.yml
+2
-1
generator.properties
...les/ace-generator/src/main/resources/generator.properties
+1
-1
OrderRentVehicleBiz.java
...java/com/xxfc/platform/order/biz/OrderRentVehicleBiz.java
+60
-1
WebConfiguration.java
...java/com/xxfc/platform/order/config/WebConfiguration.java
+3
-1
OrderRentVehicleController.java
.../xxfc/platform/order/rest/OrderRentVehicleController.java
+3
-1
ShuntApplyController.java
.../platform/order/rest/background/ShuntApplyController.java
+90
-0
RentVehicleController.java
...com/xxfc/platform/vehicle/rest/RentVehicleController.java
+4
-0
No files found.
ace-common/src/main/java/com/github/wxiaoqi/security/common/rest/BaseController.java
View file @
5fa479a1
...
...
@@ -33,7 +33,7 @@ public class BaseController<Biz extends BaseBiz,Entity> extends CommonBaseContro
@ApiOperation
(
"添加"
)
@RequestMapping
(
value
=
""
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
ObjectRestResponse
<
Entity
>
add
(
@RequestBody
Entity
entity
)
throws
Exception
{
public
ObjectRestResponse
<
Entity
>
add
(
@RequestBody
Entity
entity
)
{
baseBiz
.
insertSelective
(
entity
);
return
new
ObjectRestResponse
<
Entity
>();
}
...
...
@@ -67,7 +67,7 @@ public class BaseController<Biz extends BaseBiz,Entity> extends CommonBaseContro
@ApiOperation
(
"查询所有"
)
@RequestMapping
(
value
=
"/all"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
List
<
Entity
>
all
()
throws
Exception
{
public
List
<
Entity
>
all
()
{
return
baseBiz
.
selectListAll
();
}
...
...
ace-common/src/main/java/com/github/wxiaoqi/security/common/vo/PageDataVO.java
View file @
5fa479a1
package
com
.
github
.
wxiaoqi
.
security
.
common
.
vo
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.convert.Convert
;
import
com.github.pagehelper.ISelect
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.wxiaoqi.security.common.util.Query
;
import
lombok.Data
;
import
java.lang.reflect.ParameterizedType
;
import
java.util.List
;
@Data
...
...
@@ -28,7 +31,6 @@ public class PageDataVO<T> {
public
static
<
M
>
PageDataVO
<
M
>
pageInfo
(
PageInfo
<
M
>
pageInfo
){
PageDataVO
<
M
>
pageDataVo
=
new
PageDataVO
<>();
pageDataVo
.
setTotalCount
(
pageInfo
.
getTotal
());
pageDataVo
.
setData
(
pageInfo
.
getList
());
pageDataVo
.
setPageNum
(
pageInfo
.
getPageNum
());
pageDataVo
.
setTotalPage
(
pageInfo
.
getPages
());
...
...
@@ -48,4 +50,12 @@ public class PageDataVO<T> {
public
static
<
M
>
PageDataVO
<
M
>
pageInfo
(
Query
query
,
ISelect
select
){
return
PageDataVO
.
pageInfo
(
PageHelper
.
startPage
(
query
.
getPage
(),
query
.
getLimit
()).
doSelectPageInfo
(
select
));
}
public
static
<
M
>
PageDataVO
<
M
>
pageInfo
(
Query
query
,
ISelect
select
,
Class
classz
){
PageDataVO
<
M
>
pageDataVo
=
pageInfo
(
query
,
select
);
if
(
CollUtil
.
isNotEmpty
(
pageDataVo
.
getData
())
&&
pageDataVo
.
getData
().
get
(
0
).
getClass
()
!=
classz
)
{
pageDataVo
.
setData
(
Convert
.
toList
(
classz
,
pageDataVo
.
getData
()));
}
return
pageDataVo
;
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/AppStaffUserController.java
View file @
5fa479a1
...
...
@@ -17,6 +17,7 @@ import com.github.wxiaoqi.security.common.util.process.ResultCode;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -26,6 +27,7 @@ import java.util.List;
/**
* @author Administrator
*/
@Slf4j
@RestController
@RequestMapping
(
"/staff"
)
@RequiredArgsConstructor
(
onConstructor_
=
{
@Autowired
})
...
...
@@ -56,8 +58,14 @@ public class AppStaffUserController extends BaseController<AppStaffUserBiz, AppS
@Override
@ApiOperation
(
"添加"
)
@PostMapping
(
value
=
""
)
public
ObjectRestResponse
<
AppStaffUser
>
add
(
@RequestBody
AppStaffUser
appStaffUser
)
throws
Exception
{
IJWTInfo
infoFromToken
=
userAuthUtil
.
getInfoFromToken
(
authConfig
.
getToken
(
request
));
public
ObjectRestResponse
<
AppStaffUser
>
add
(
@RequestBody
AppStaffUser
appStaffUser
)
{
IJWTInfo
infoFromToken
=
null
;
try
{
infoFromToken
=
userAuthUtil
.
getInfoFromToken
(
authConfig
.
getToken
(
request
));
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
return
ObjectRestResponse
.
createDefaultFail
();
}
Integer
positionId
=
null
;
try
{
positionId
=
appUserDetailBiz
.
getUserInfoById
(
...
...
ace-modules/ace-generator/src/main/resources/application.yml
View file @
5fa479a1
...
...
@@ -10,7 +10,8 @@ spring:
datasource
:
type
:
com.alibaba.druid.pool.DruidDataSource
driverClassName
:
com.mysql.jdbc.Driver
url
:
jdbc:mysql://10.5.52.3:3306/xxfc_vehicle?useUnicode=true&characterEncoding=UTF-8
#url: jdbc:mysql://10.5.52.3:3306/xxfc_vehicle?useUnicode=true&characterEncoding=UTF-8
url
:
jdbc:mysql://10.5.52.3:3306/tiande_order?useUnicode=true&characterEncoding=UTF-8
username
:
root
password
:
sslcloud123*()
jackson
:
...
...
ace-modules/ace-generator/src/main/resources/generator.properties
View file @
5fa479a1
#\u4EE3\u7801\u751F\u6210\u5668\uFF0C\u914D\u7F6E\u4FE1\u606F
#\u5305\u540D
package
=
com.xxfc.platform.
vehicle
package
=
com.xxfc.platform.
order
#\u4F5C\u8005
author
=
libin
#Email
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderRentVehicleBiz.java
View file @
5fa479a1
package
com
.
xxfc
.
platform
.
order
.
biz
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.util.result.JsonResultUtil
;
import
com.xxfc.platform.order.biz.inner.OrderCalculateBiz
;
import
com.xxfc.platform.order.entity.OrderRentVehicleDetail
;
import
com.xxfc.platform.order.mapper.OrderRentVehicleDetailMapper
;
import
com.xxfc.platform.order.pojo.order.RentVehicleBO
;
import
com.xxfc.platform.order.pojo.order.add.AddRentVehicleDTO
;
import
com.xxfc.platform.vehicle.entity.BranchCompany
;
import
com.xxfc.platform.vehicle.feign.VehicleFeign
;
import
com.xxfc.platform.vehicle.pojo.BookVehicleVO
;
import
com.xxfc.platform.vehicle.pojo.CompanyDetail
;
import
lombok.extern.slf4j.Slf4j
;
import
org.mockito.internal.util.collections.Sets
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
tk.mybatis.mapper.entity.Example
;
import
java.util.List
;
import
java.util.Map
;
/**
* 租车订单详情
...
...
@@ -29,6 +42,9 @@ public class OrderRentVehicleBiz extends BaseBiz<OrderRentVehicleDetailMapper, O
@Autowired
VehicleFeign
vehicleFeign
;
@Autowired
OrderCalculateBiz
orderCalculateBiz
;
public
List
<
OrderRentVehicleDetail
>
listByOrderId
(
Integer
orderId
)
{
return
mapper
.
listByOrderId
(
orderId
);
...
...
@@ -84,7 +100,50 @@ public class OrderRentVehicleBiz extends BaseBiz<OrderRentVehicleDetailMapper, O
}
}
//获取全部评论
public
RentVehicleBO
initRentVehicleBO
(
AddRentVehicleDTO
vo
)
{
//计算天数
vo
.
setDayNum
(
orderCalculateBiz
.
getIncludeDays
(
vo
.
getStartTime
(),
vo
.
getEndTime
()));
if
(
null
==
vo
.
getEndCompanyId
()
||
vo
.
getEndCompanyId
().
equals
(
0
))
{
if
(
StrUtil
.
isBlank
(
vo
.
getEndAddr
()))
{
throw
new
BaseException
(
ResultCode
.
PARAM_ILLEGAL_CODE
,
Sets
.
newSet
(
"公司参数不正确"
));
}
else
{
Map
<
String
,
Object
>
map
=
BeanUtil
.
beanToMap
(
new
BranchCompany
(){{
setName
(
vo
.
getEndAddr
());
}},
false
,
true
);
List
<
BranchCompany
>
data
=
vehicleFeign
.
branchCompanyEntityList
(
map
).
getData
();
if
(
null
==
data
)
{
throw
new
BaseException
(
ResultCode
.
PARAM_ILLEGAL_CODE
,
Sets
.
newSet
(
"公司参数不正确"
));
}
else
{
BranchCompany
endCompany
=
vehicleFeign
.
branchCompanyEntityList
(
map
).
getData
().
get
(
0
);
vo
.
setEndCompanyId
(
endCompany
.
getId
());
}
}
}
if
(
vo
.
getStartCompanyId
()
!=
null
)
{
CompanyDetail
companyDetail
=
vehicleFeign
.
getCompanyDetail
(
vo
.
getStartCompanyId
()).
getData
();
if
(
companyDetail
!=
null
)
{
vo
.
setStartAddr
(
companyDetail
.
detailAddr
());
}
}
if
(
vo
.
getEndCompanyId
()
!=
null
)
{
CompanyDetail
companyDetail
=
vehicleFeign
.
getCompanyDetail
(
vo
.
getEndCompanyId
()).
getData
();
if
(
companyDetail
!=
null
)
{
vo
.
setEndAddr
(
companyDetail
.
detailAddr
());
}
}
RentVehicleBO
bo
=
BeanUtil
.
toBean
(
vo
,
RentVehicleBO
.
class
);
bo
.
setBookVehicleVO
(
new
BookVehicleVO
(){{
setBookStartDate
(
vo
.
getBookStartDate
());
setBookEndDate
(
vo
.
getBookEndDate
());
setBookStartDateTime
(
vo
.
getBookStartDateTime
());
setBookEndDateTime
(
vo
.
getBookEndDateTime
());
}});
bo
.
setTickerNo
(
StrUtil
.
isNotBlank
(
vo
.
getTickerNos
())?
StrUtil
.
splitTrim
(
vo
.
getTickerNos
(),
","
):
null
);
bo
.
setAccompanyItems
(
vo
.
getAccompanyItems
());
return
bo
;
}
}
\ No newline at end of file
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/config/WebConfiguration.java
View file @
5fa479a1
...
...
@@ -53,12 +53,14 @@ public class WebConfiguration implements WebMvcConfigurer {
private
ArrayList
<
String
>
getIncludePathPatterns
()
{
ArrayList
<
String
>
list
=
new
ArrayList
<>();
String
[]
urls
=
{
"/background/**"
,
"/orderRentVehicle/**"
,
"/baseOrder/**"
,
"/orderTour/**"
,
"/orderMember/**"
,
"/orderRefund/**"
,
"/orderVehicle/**"
"/orderVehicle/**"
,
"/shuntApply/**"
};
Collections
.
addAll
(
list
,
urls
);
return
list
;
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/OrderRentVehicleController.java
View file @
5fa479a1
...
...
@@ -71,6 +71,7 @@ public class OrderRentVehicleController extends CommonBaseController {
@ApiOperation
(
value
=
"确认租车订单"
)
public
ObjectRestResponse
<
BaseOrder
>
add
(
@RequestBody
AddRentVehicleDTO
vo
){
RentVehicleBO
bo
=
initRentVehicleBO
(
vo
);
vo
.
setDayNum
(
orderCalculateBiz
.
getIncludeDays
(
vo
.
getStartTime
(),
vo
.
getEndTime
()));
bo
.
setAppUserDTO
(
userFeign
.
userDetailByToken
(
BaseContextHandler
.
getToken
()).
getData
());
orderRentVehicleService
.
createOrder
(
bo
);
return
ObjectRestResponse
.
succ
(
bo
.
getOrder
());
...
...
@@ -81,7 +82,8 @@ public class OrderRentVehicleController extends CommonBaseController {
@ResponseBody
@ApiOperation
(
value
=
"后台人员为客户下租车订单"
)
public
ObjectRestResponse
<
BaseOrder
>
backStagedd
(
@RequestBody
BgAddRentDTO
dto
){
RentVehicleBO
bo
=
initRentVehicleBO
(
dto
);
RentVehicleBO
bo
=
orderRentVehicleBiz
.
initRentVehicleBO
(
dto
);
bo
.
setDayNum
(
orderCalculateBiz
.
getIncludeDays
(
dto
.
getStartTime
(),
dto
.
getEndTime
()));
bo
.
setAppUserDTO
(
userFeign
.
userDetailById
(
dto
.
getAppUserId
()).
getData
());
bo
.
setCrtUser
(
"-1"
+
BaseContextHandler
.
getUserID
());
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/background/ShuntApplyController.java
0 → 100755
View file @
5fa479a1
package
com
.
xxfc
.
platform
.
order
.
rest
.
background
;
import
cn.hutool.core.util.StrUtil
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
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.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.OrderRentVehicleBiz
;
import
com.xxfc.platform.order.biz.ShuntApplyBiz
;
import
com.xxfc.platform.order.biz.inner.OrderCalculateBiz
;
import
com.xxfc.platform.order.entity.ShuntApply
;
import
com.xxfc.platform.order.pojo.order.RentVehicleBO
;
import
com.xxfc.platform.order.pojo.order.add.BgAddRentDTO
;
import
com.xxfc.platform.order.service.OrderRentVehicleService
;
import
com.xxfc.platform.vehicle.entity.VehicleModel
;
import
com.xxfc.platform.vehicle.feign.VehicleFeign
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.Data
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
@RestController
@RequestMapping
(
"/background/shuntApply"
)
public
class
ShuntApplyController
extends
BaseController
<
ShuntApplyBiz
,
ShuntApply
>
{
@Autowired
VehicleFeign
vehicleFeign
;
@Autowired
UserFeign
userFeign
;
@Autowired
OrderRentVehicleBiz
orderRentVehicleBiz
;
@Autowired
OrderCalculateBiz
orderCalculateBiz
;
@Autowired
ShuntApplyBiz
shuntApplyBiz
;
@Autowired
OrderRentVehicleService
orderRentVehicleService
;
@RequestMapping
(
value
=
"/confirmApply"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
@ApiOperation
(
value
=
"后台确认申请"
)
public
ObjectRestResponse
confirmApply
(
@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
=
shuntApplyBiz
.
selectById
(
dto
.
getApplyId
());
if
(
null
==
shuntApply
)
{
throw
new
BaseException
(
ResultCode
.
PARAM_ILLEGAL_CODE
);
}
BgAddRentDTO
bgAddRentDTO
=
new
BgAddRentDTO
();
bgAddRentDTO
.
setAppUserId
(
shuntApply
.
getUserId
());
bgAddRentDTO
.
setStartTime
(
shuntApply
.
getStartTime
());
bgAddRentDTO
.
setEndTime
(
shuntApply
.
getEndTime
());
RentVehicleBO
bo
=
orderRentVehicleBiz
.
initRentVehicleBO
(
bgAddRentDTO
);
bo
.
setDayNum
(
orderCalculateBiz
.
getIncludeDays
(
bgAddRentDTO
.
getStartTime
(),
bgAddRentDTO
.
getEndTime
()));
bo
.
setAppUserDTO
(
userFeign
.
userDetailById
(
bgAddRentDTO
.
getAppUserId
()).
getData
());
bo
.
setCrtUser
(
"-1"
+
BaseContextHandler
.
getUserID
());
//设置-1表示查询所有的车
//bo.setUseType(-1);
orderRentVehicleService
.
createOrder
(
bo
);
return
ObjectRestResponse
.
succ
(
bo
.
getOrder
());
}
@Data
public
static
class
confirmApplyDTO
{
Integer
applyId
;
Integer
vehicleId
;
}
}
\ No newline at end of file
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/RentVehicleController.java
View file @
5fa479a1
...
...
@@ -139,6 +139,7 @@ public class RentVehicleController extends BaseController<VehicleBiz> implements
PageDataVO
<
UsableVehicleModelVO
>
uvmvpdvs
=
vehicleBiz
.
searchUsableModel
(
dto
);
if
(
CollUtil
.
isNotEmpty
(
uvmvpdvs
.
getData
())){
uvmvpdvs
.
getData
().
forEach
(
data
->
{
data
.
setHasVehicle
(
SYS_FALSE
);
// if(StrUtil.isNotBlank(data.getVehicleIds())) {
// String[] strs = StrUtil.split(data.getVehicleIds(), ",");
// List<Vehicle> vehicleList = vehicleBiz.selectByWeekend(w -> {
...
...
@@ -164,6 +165,7 @@ public class RentVehicleController extends BaseController<VehicleBiz> implements
//查询可车辆信息
PageDataVO
<
UsableVeicleVO
>
pageDataVO
=
vehicleBiz
.
searchUsableVehicle
(
rbd
);
if
(
CollUtil
.
isNotEmpty
(
pageDataVO
.
getData
()))
{
for
(
UsableVeicleVO
usableVeicleVO
:
pageDataVO
.
getData
())
{
//判断是否预定时间内可租
...
...
@@ -176,6 +178,8 @@ public class RentVehicleController extends BaseController<VehicleBiz> implements
//如果"必须在这时间前预定" 存在 并且 比预定结束时间 要早,那么不允许预定
if
(
null
!=
usableVeicleVO
.
getToReturnMustBeforeDate
()
&&
DateUtil
.
date
(
dto
.
getEndDateTamp
()).
isAfterOrEquals
(
usableVeicleVO
.
getToReturnMustBeforeDate
()))
{
usableVeicleVO
.
setAllowRent
(
SYS_FALSE
);
}
else
{
data
.
setHasVehicle
(
SYS_TRUE
);
}
String
priceStartDateStr
=
StrUtil
.
isNotBlank
(
dto
.
getPriceStartDate
())?
dto
.
getPriceStartDate
():
dto
.
getStartDate
();
...
...
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