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
d6878b03
Commit
d6878b03
authored
Aug 16, 2019
by
libin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into base-modify
parents
ba333528
9a6cb077
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
93 additions
and
35 deletions
+93
-35
CommonConstants.java
...hub/wxiaoqi/security/common/constant/CommonConstants.java
+15
-0
BackStageOrderController.java
...om/xxfc/platform/order/rest/BackStageOrderController.java
+31
-25
BranchCompanyBiz.java
.../java/com/xxfc/platform/vehicle/biz/BranchCompanyBiz.java
+27
-5
VehicleBiz.java
...c/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
+1
-1
BranchCompanyController.java
...m/xxfc/platform/vehicle/rest/BranchCompanyController.java
+3
-3
RentVehicleController.java
...com/xxfc/platform/vehicle/rest/RentVehicleController.java
+14
-1
VehicleMapper.xml
...ehicle-server/src/main/resources/mapper/VehicleMapper.xml
+2
-0
No files found.
ace-common/src/main/java/com/github/wxiaoqi/security/common/constant/CommonConstants.java
View file @
d6878b03
...
@@ -24,4 +24,19 @@ public class CommonConstants {
...
@@ -24,4 +24,19 @@ public class CommonConstants {
public
static
final
String
CONTEXT_KEY_USER_TOKEN
=
"currentUserToken"
;
public
static
final
String
CONTEXT_KEY_USER_TOKEN
=
"currentUserToken"
;
public
static
final
String
JWT_KEY_USER_ID
=
"userId"
;
public
static
final
String
JWT_KEY_USER_ID
=
"userId"
;
public
static
final
String
JWT_KEY_NAME
=
"name"
;
public
static
final
String
JWT_KEY_NAME
=
"name"
;
// 时间相关
public
static
final
String
DEFAULT
=
"yyyy/MM/dd"
;
public
static
final
String
YM
=
"yyyy/MM"
;
public
static
final
String
YMR_SLASH
=
"yyyy-MM-dd"
;
public
static
final
String
NO_SLASH
=
"yyyyMMdd"
;
public
static
final
String
YM_NO_SLASH
=
"yyyyMM"
;
public
static
final
String
DATE_TIME
=
"yyyy/MM/dd HH:mm:ss"
;
public
static
final
String
DATE_TIME_NO_SLASH
=
"yyyyMMddHHmmss"
;
public
static
final
String
DATE_HM
=
"yyyy/MM/dd HH:mm"
;
public
static
final
String
TIME
=
"HH:mm:ss"
;
public
static
final
String
HM
=
"HH:mm"
;
public
static
final
String
LONG_TIME
=
"HHmmss"
;
public
static
final
String
SHORT_TIME
=
"HHmm"
;
public
static
final
String
DATE_TIME_LINE
=
"yyyy-MM-dd HH:mm:ss"
;
}
}
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/BackStageOrderController.java
View file @
d6878b03
...
@@ -293,31 +293,37 @@ public class BackStageOrderController extends CommonBaseController implements Us
...
@@ -293,31 +293,37 @@ public class BackStageOrderController extends CommonBaseController implements Us
@ResponseBody
@ResponseBody
public
ObjectRestResponse
<
OrderPageVO
>
changeVehicle
(
@RequestBody
ChangeVehicleDTO
dto
)
{
public
ObjectRestResponse
<
OrderPageVO
>
changeVehicle
(
@RequestBody
ChangeVehicleDTO
dto
)
{
checkAdminUser
();
checkAdminUser
();
// //根据订单号获取订单
//根据订单号获取订单
// //查询列表数据
//查询列表数据
// Query query = baseOrderBiz.initQuery(dto.getNo());
Query
query
=
baseOrderBiz
.
initQuery
(
dto
.
getNo
());
// PageDataVO<OrderPageVO> page = PageDataVO.pageInfo(query, () -> baseOrderBiz.pageByParm(query.getSuper()));
PageDataVO
<
OrderPageVO
>
page
=
PageDataVO
.
pageInfo
(
query
,
()
->
baseOrderBiz
.
pageByParm
(
query
.
getSuper
()));
// OrderPageVO orderPageVO = page.getData().get(0);
OrderPageVO
orderPageVO
=
page
.
getData
().
get
(
0
);
// if(null == orderPageVO) {
if
(
null
==
orderPageVO
)
{
// throw new BaseException(ResultCode.PARAM_ILLEGAL_CODE, Sets.newSet("订单不存在"));
throw
new
BaseException
(
ResultCode
.
PARAM_ILLEGAL_CODE
,
Sets
.
newSet
(
"订单不存在"
));
// }
}
// //预约新的车辆
//预约新的车辆
// RentVehicleBO bo = BeanUtil.toBean(orderPageVO.getOrderRentVehicleDetail(), RentVehicleBO.class);
RentVehicleBO
bo
=
BeanUtil
.
toBean
(
orderPageVO
.
getOrderRentVehicleDetail
(),
RentVehicleBO
.
class
);
// bo.setOrder(orderPageVO);
bo
.
setOrder
(
orderPageVO
);
// bo.setBookVehicleVO(new BookVehicleVO(){{
bo
.
setBookVehicleVO
(
new
BookVehicleVO
(){{
// setBookStartDate(DEFAULT_DATE_TIME_FORMATTER.format(LocalDateTime.ofInstant(Instant.ofEpochMilli(bo.getStartTime()), ZoneOffset.ofHours(8))));
setBookStartDate
(
DEFAULT_DATE_TIME_FORMATTER
.
format
(
LocalDateTime
.
ofInstant
(
Instant
.
ofEpochMilli
(
bo
.
getStartTime
()),
ZoneOffset
.
ofHours
(
8
))));
// setBookEndDate(DEFAULT_DATE_TIME_FORMATTER.format(LocalDateTime.ofInstant(Instant.ofEpochMilli(bo.getStartTime()), ZoneOffset.ofHours(8))));
setBookEndDate
(
DEFAULT_DATE_TIME_FORMATTER
.
format
(
LocalDateTime
.
ofInstant
(
Instant
.
ofEpochMilli
(
bo
.
getStartTime
()),
ZoneOffset
.
ofHours
(
8
))));
// }});
}});
//
// List<OrderAccompanyDTO> oads = JSONUtil.toList(JSONUtil.parseArray(orderItemBiz.selectOne(new OrderItem(){{
List
<
OrderAccompanyDTO
>
oads
=
JSONUtil
.
toList
(
JSONUtil
.
parseArray
(
orderItemBiz
.
selectOne
(
new
OrderItem
(){{
// setOrderId(orderPageVO.getId());
setOrderId
(
orderPageVO
.
getId
());
// setType(ItemTypeEnum.ACCOMPANY.getCode());
setType
(
ItemTypeEnum
.
ACCOMPANY
.
getCode
());
// }}).getDetail()), OrderAccompanyDTO.class);
}}).
getDetail
()),
OrderAccompanyDTO
.
class
);
// bo.setAccompanyItems(oads);
bo
.
setAccompanyItems
(
oads
);
// orderRentVehicleService.acquireVehicle(bo);
Long
oldBookRecordId
=
bo
.
getBookRecordId
();
// //如果成功则取消旧车的预约
orderRentVehicleService
.
acquireVehicle
(
bo
);
//
//如果成功则取消旧车的预约
// orderRentVehicle
vehicleFeign
.
rentUnbookVehicle
(
oldBookRecordId
);
//设置新的vehicleId 和 record
orderRentVehicleBiz
.
updateSelectiveByIdRe
(
new
OrderRentVehicleDetail
(){{
setId
(
bo
.
getId
());
setVehicleId
(
bo
.
getVehicleId
());
setBookRecordId
(
bo
.
getBookRecordId
());
}});
return
ObjectRestResponse
.
succ
();
return
ObjectRestResponse
.
succ
();
}
}
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/BranchCompanyBiz.java
View file @
d6878b03
...
@@ -13,6 +13,7 @@ import com.github.wxiaoqi.security.common.vo.PageDataVO;
...
@@ -13,6 +13,7 @@ import com.github.wxiaoqi.security.common.vo.PageDataVO;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
com.xxfc.platform.vehicle.common.RestResponse
;
import
com.xxfc.platform.vehicle.common.RestResponse
;
import
com.xxfc.platform.vehicle.constant.RedisKey
;
import
com.xxfc.platform.vehicle.constant.RedisKey
;
import
com.xxfc.platform.vehicle.entity.Area
;
import
com.xxfc.platform.vehicle.entity.BranchCompany
;
import
com.xxfc.platform.vehicle.entity.BranchCompany
;
import
com.xxfc.platform.vehicle.entity.BranchCompanyStockInfo
;
import
com.xxfc.platform.vehicle.entity.BranchCompanyStockInfo
;
import
com.xxfc.platform.vehicle.entity.SysRegion
;
import
com.xxfc.platform.vehicle.entity.SysRegion
;
...
@@ -65,6 +66,9 @@ public class BranchCompanyBiz extends BaseBiz<BranchCompanyMapper, BranchCompany
...
@@ -65,6 +66,9 @@ public class BranchCompanyBiz extends BaseBiz<BranchCompanyMapper, BranchCompany
@Autowired
@Autowired
UserFeign
userFeign
;
UserFeign
userFeign
;
@Autowired
private
AreaBiz
areaBiz
;
@Override
@Override
public
UserFeign
getUserFeign
()
{
public
UserFeign
getUserFeign
()
{
return
userFeign
;
return
userFeign
;
...
@@ -152,17 +156,35 @@ public class BranchCompanyBiz extends BaseBiz<BranchCompanyMapper, BranchCompany
...
@@ -152,17 +156,35 @@ public class BranchCompanyBiz extends BaseBiz<BranchCompanyMapper, BranchCompany
}
}
public
PageDataVO
<
BranchCompany
>
getAll
(
Integer
page
,
Integer
limit
,
Integer
addrProvince
,
Integer
addrCity
,
public
PageDataVO
<
BranchCompany
>
getAll
(
Integer
page
,
Integer
limit
,
Integer
addrProvince
,
Integer
addrCity
,
Integer
addrTown
,
UserDTO
userDTO
)
{
Integer
addrTown
,
Integer
zoneId
,
UserDTO
userDTO
)
{
Example
example
=
new
Example
(
BranchCompany
.
class
);
Example
example
=
new
Example
(
BranchCompany
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
Example
.
Criteria
criteria
=
example
.
createCriteria
();
if
(
addrProvince
!=
null
)
{
String
provinceIds
=
""
;
criteria
.
andCondition
(
" addr_province = '"
+
addrProvince
+
"'"
);
if
(
Objects
.
nonNull
(
zoneId
)){
Area
area
=
areaBiz
.
selectById
(
zoneId
);
provinceIds
=
area
.
getProvinceIds
();
}
if
(
StringUtils
.
isNotEmpty
(
provinceIds
)){
List
<
String
>
provinceIdList
=
Arrays
.
asList
(
provinceIds
.
split
(
","
));
if
(
Objects
.
nonNull
(
addrProvince
)){
if
(
provinceIdList
.
contains
(
String
.
valueOf
(
addrProvince
))){
criteria
.
andEqualTo
(
"addrProvince"
,
addrProvince
);
}
else
{
return
new
PageDataVO
<
BranchCompany
>();
}
}
else
{
criteria
.
andIn
(
"addrProvince"
,
provinceIdList
);
}
}
else
{
if
(
addrProvince
!=
null
)
{
criteria
.
andEqualTo
(
"addrProvince"
,
addrProvince
);
}
}
}
if
(
addrCity
!=
null
)
{
if
(
addrCity
!=
null
)
{
criteria
.
and
Condition
(
" addr_city = '"
+
addrCity
+
"'"
);
criteria
.
and
EqualTo
(
"addrCity"
,
addrCity
);
}
}
if
(
addrTown
!=
null
)
{
if
(
addrTown
!=
null
)
{
criteria
.
and
Condition
(
" addr_town = '"
+
addrTown
+
"'"
);
criteria
.
and
EqualTo
(
"addrTown"
,
addrTown
);
}
}
if
(
userDTO
!=
null
&&
DATA_ALL_FALSE
.
equals
(
userDTO
.
getDataAll
()))
{
if
(
userDTO
!=
null
&&
DATA_ALL_FALSE
.
equals
(
userDTO
.
getDataAll
()))
{
if
(
StringUtils
.
isNotBlank
(
userDTO
.
getDataZone
()))
{
if
(
StringUtils
.
isNotBlank
(
userDTO
.
getDataZone
()))
{
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
View file @
d6878b03
...
@@ -415,7 +415,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
...
@@ -415,7 +415,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
checkIfVehicleExists
(
bookVehicleVo
.
getVehicleId
());
checkIfVehicleExists
(
bookVehicleVo
.
getVehicleId
());
//提取日期和相应的预定目标日期
//提取日期和相应的预定目标日期
Map
<
String
,
List
<
String
>>
yearMonthAndDate
=
Maps
.
newHashMap
();
Map
<
String
,
List
<
String
>>
yearMonthAndDate
=
Maps
.
newHashMap
();
DateTime
startDay
=
DateTime
.
parse
(
bookVehicleVo
.
getBookStartDate
(),
DATE_TIME_FORMATTER
);
DateTime
startDay
=
DateTime
.
parse
(
bookVehicleVo
.
getBookStartDate
(),
DATE_TIME_FORMATTER
);
DateTime
endDay
=
DateTime
.
parse
(
bookVehicleVo
.
getBookEndDate
(),
DATE_TIME_FORMATTER
);
DateTime
endDay
=
DateTime
.
parse
(
bookVehicleVo
.
getBookEndDate
(),
DATE_TIME_FORMATTER
);
//转换日期范围为列表,并检查是否合法
//转换日期范围为列表,并检查是否合法
fillDateList4DatePeriod
(
yearMonthAndDate
,
startDay
,
endDay
);
fillDateList4DatePeriod
(
yearMonthAndDate
,
startDay
,
endDay
);
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/BranchCompanyController.java
View file @
d6878b03
...
@@ -52,9 +52,9 @@ public class BranchCompanyController extends BaseController<BranchCompanyBiz> {
...
@@ -52,9 +52,9 @@ public class BranchCompanyController extends BaseController<BranchCompanyBiz> {
@RequestMapping
(
value
=
"/page"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/page"
,
method
=
RequestMethod
.
GET
)
public
RestResponse
<
PageDataVO
<
BranchCompany
>>
page
(
@RequestParam
Integer
page
,
@RequestParam
Integer
limit
,
public
RestResponse
<
PageDataVO
<
BranchCompany
>>
page
(
@RequestParam
Integer
page
,
@RequestParam
Integer
limit
,
@RequestParam
(
required
=
false
)
Integer
addrProvince
,
@RequestParam
(
required
=
false
)
Integer
addrCity
,
@RequestParam
(
required
=
false
)
Integer
addrProvince
,
@RequestParam
(
required
=
false
)
Integer
addrCity
,
@RequestParam
(
required
=
false
)
Integer
addrTown
,
@RequestParam
(
required
=
false
)
String
location
)
{
@RequestParam
(
required
=
false
)
Integer
addrTown
,
@RequestParam
(
required
=
false
)
Integer
zoneId
)
{
UserDTO
userDTO
=
userFeign
.
userinfoByToken
(
userAuthConfig
.
getToken
(
request
)).
getData
();
UserDTO
userDTO
=
userFeign
.
userinfoByToken
(
userAuthConfig
.
getToken
(
request
)).
getData
();
return
RestResponse
.
data
(
baseBiz
.
getAll
(
page
,
limit
,
addrProvince
,
addrCity
,
addrTown
,
userDTO
));
return
RestResponse
.
data
(
baseBiz
.
getAll
(
page
,
limit
,
addrProvince
,
addrCity
,
addrTown
,
zoneId
,
userDTO
));
}
}
@IgnoreUserToken
@IgnoreUserToken
...
@@ -62,7 +62,7 @@ public class BranchCompanyController extends BaseController<BranchCompanyBiz> {
...
@@ -62,7 +62,7 @@ public class BranchCompanyController extends BaseController<BranchCompanyBiz> {
public
RestResponse
<
PageDataVO
<
BranchCompany
>>
allPage
(
@RequestParam
Integer
page
,
@RequestParam
Integer
limit
,
public
RestResponse
<
PageDataVO
<
BranchCompany
>>
allPage
(
@RequestParam
Integer
page
,
@RequestParam
Integer
limit
,
@RequestParam
(
required
=
false
)
Integer
addrProvince
,
@RequestParam
(
required
=
false
)
Integer
addrCity
,
@RequestParam
(
required
=
false
)
Integer
addrProvince
,
@RequestParam
(
required
=
false
)
Integer
addrCity
,
@RequestParam
(
required
=
false
)
Integer
addrTown
)
{
@RequestParam
(
required
=
false
)
Integer
addrTown
)
{
return
RestResponse
.
data
(
baseBiz
.
getAll
(
page
,
limit
,
addrProvince
,
addrCity
,
addrTown
,
null
));
return
RestResponse
.
data
(
baseBiz
.
getAll
(
page
,
limit
,
addrProvince
,
addrCity
,
addrTown
,
null
,
null
));
}
}
@RequestMapping
(
value
=
"/search"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/search"
,
method
=
RequestMethod
.
GET
)
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/RentVehicleController.java
View file @
d6878b03
package
com
.
xxfc
.
platform
.
vehicle
.
rest
;
package
com
.
xxfc
.
platform
.
vehicle
.
rest
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.date.DateUtil
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface
;
import
com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken
;
...
@@ -25,8 +26,14 @@ import org.apache.commons.lang3.StringUtils;
...
@@ -25,8 +26,14 @@ import org.apache.commons.lang3.StringUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
java.time.Instant
;
import
java.time.LocalDateTime
;
import
java.time.ZoneOffset
;
import
java.time.format.DateTimeFormatter
;
import
java.util.HashSet
;
import
java.util.HashSet
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
DATE_TIME_LINE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_TRUE
;
import
static
com
.
xxfc
.
platform
.
vehicle
.
constant
.
VehicleConstant
.
USER_APP
;
import
static
com
.
xxfc
.
platform
.
vehicle
.
constant
.
VehicleConstant
.
USER_APP
;
import
static
com
.
xxfc
.
platform
.
vehicle
.
constant
.
VehicleConstant
.
USER_APP_NAME
;
import
static
com
.
xxfc
.
platform
.
vehicle
.
constant
.
VehicleConstant
.
USER_APP_NAME
;
...
@@ -156,7 +163,13 @@ public class RentVehicleController extends BaseController<VehicleBiz> implements
...
@@ -156,7 +163,13 @@ public class RentVehicleController extends BaseController<VehicleBiz> implements
add
(
"可用车辆不存在"
);
add
(
"可用车辆不存在"
);
}});
}});
}
}
dto
.
setBookStartDate
(
dto
.
getBookStartDate
()+
" 00:00:00"
);
//判断是否为今天,如果是则设置为一分钟后开始
if
(
DateUtil
.
today
().
equals
(
dto
.
getBookStartDate
()))
{
LocalDateTime
ldt
=
LocalDateTime
.
ofInstant
(
Instant
.
ofEpochMilli
(
System
.
currentTimeMillis
()),
ZoneOffset
.
ofHours
(
8
)).
plusSeconds
(
30L
);
dto
.
setBookStartDate
(
DateTimeFormatter
.
ofPattern
(
DATE_TIME_LINE
).
format
(
ldt
));
}
else
{
dto
.
setBookStartDate
(
dto
.
getBookStartDate
()+
" 00:00:00"
);
}
dto
.
setBookEndDate
(
dto
.
getBookEndDate
()+
" 23:59:59"
);
dto
.
setBookEndDate
(
dto
.
getBookEndDate
()+
" 23:59:59"
);
BookVehicleVO
bookVehicleVo
=
BeanUtil
.
toBean
(
dto
,
BookVehicleVO
.
class
);
BookVehicleVO
bookVehicleVo
=
BeanUtil
.
toBean
(
dto
,
BookVehicleVO
.
class
);
bookVehicleVo
.
setBookType
(
BookType
.
USER_RENT
.
getCode
());
bookVehicleVo
.
setBookType
(
BookType
.
USER_RENT
.
getCode
());
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleMapper.xml
View file @
d6878b03
...
@@ -637,6 +637,8 @@
...
@@ -637,6 +637,8 @@
and v.park_branch_company_id = #{parkBranchCompanyId}
and v.park_branch_company_id = #{parkBranchCompanyId}
</if>
</if>
and v.is_del = 0
and v.is_del = 0
and v.status != 3
and v.use_type = 1
</where>
</where>
</sql>
</sql>
...
...
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