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
9a6cb077
Commit
9a6cb077
authored
Aug 16, 2019
by
libin
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
9bc6b75e
0b9a5ef8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
63 additions
and
27 deletions
+63
-27
CommonConstants.java
...hub/wxiaoqi/security/common/constant/CommonConstants.java
+15
-0
BackStageOrderController.java
...om/xxfc/platform/order/rest/BackStageOrderController.java
+31
-25
VehicleBiz.java
...c/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
+1
-1
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 @
9a6cb077
...
...
@@ -24,4 +24,19 @@ public class CommonConstants {
public
static
final
String
CONTEXT_KEY_USER_TOKEN
=
"currentUserToken"
;
public
static
final
String
JWT_KEY_USER_ID
=
"userId"
;
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 @
9a6cb077
...
...
@@ -293,31 +293,37 @@ public class BackStageOrderController extends CommonBaseController implements Us
@ResponseBody
public
ObjectRestResponse
<
OrderPageVO
>
changeVehicle
(
@RequestBody
ChangeVehicleDTO
dto
)
{
checkAdminUser
();
// //根据订单号获取订单
// //查询列表数据
// Query query = baseOrderBiz.initQuery(dto.getNo());
// PageDataVO<OrderPageVO> page = PageDataVO.pageInfo(query, () -> baseOrderBiz.pageByParm(query.getSuper()));
// OrderPageVO orderPageVO = page.getData().get(0);
// if(null == orderPageVO) {
// throw new BaseException(ResultCode.PARAM_ILLEGAL_CODE, Sets.newSet("订单不存在"));
// }
// //预约新的车辆
// RentVehicleBO bo = BeanUtil.toBean(orderPageVO.getOrderRentVehicleDetail(), RentVehicleBO.class);
// bo.setOrder(orderPageVO);
// bo.setBookVehicleVO(new BookVehicleVO(){{
// 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))));
// }});
//
// List<OrderAccompanyDTO> oads = JSONUtil.toList(JSONUtil.parseArray(orderItemBiz.selectOne(new OrderItem(){{
// setOrderId(orderPageVO.getId());
// setType(ItemTypeEnum.ACCOMPANY.getCode());
// }}).getDetail()), OrderAccompanyDTO.class);
// bo.setAccompanyItems(oads);
// orderRentVehicleService.acquireVehicle(bo);
// //如果成功则取消旧车的预约
//
// orderRentVehicle
//根据订单号获取订单
//查询列表数据
Query
query
=
baseOrderBiz
.
initQuery
(
dto
.
getNo
());
PageDataVO
<
OrderPageVO
>
page
=
PageDataVO
.
pageInfo
(
query
,
()
->
baseOrderBiz
.
pageByParm
(
query
.
getSuper
()));
OrderPageVO
orderPageVO
=
page
.
getData
().
get
(
0
);
if
(
null
==
orderPageVO
)
{
throw
new
BaseException
(
ResultCode
.
PARAM_ILLEGAL_CODE
,
Sets
.
newSet
(
"订单不存在"
));
}
//预约新的车辆
RentVehicleBO
bo
=
BeanUtil
.
toBean
(
orderPageVO
.
getOrderRentVehicleDetail
(),
RentVehicleBO
.
class
);
bo
.
setOrder
(
orderPageVO
);
bo
.
setBookVehicleVO
(
new
BookVehicleVO
(){{
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
))));
}});
List
<
OrderAccompanyDTO
>
oads
=
JSONUtil
.
toList
(
JSONUtil
.
parseArray
(
orderItemBiz
.
selectOne
(
new
OrderItem
(){{
setOrderId
(
orderPageVO
.
getId
());
setType
(
ItemTypeEnum
.
ACCOMPANY
.
getCode
());
}}).
getDetail
()),
OrderAccompanyDTO
.
class
);
bo
.
setAccompanyItems
(
oads
);
Long
oldBookRecordId
=
bo
.
getBookRecordId
();
orderRentVehicleService
.
acquireVehicle
(
bo
);
//如果成功则取消旧车的预约
vehicleFeign
.
rentUnbookVehicle
(
oldBookRecordId
);
//设置新的vehicleId 和 record
orderRentVehicleBiz
.
updateSelectiveByIdRe
(
new
OrderRentVehicleDetail
(){{
setId
(
bo
.
getId
());
setVehicleId
(
bo
.
getVehicleId
());
setBookRecordId
(
bo
.
getBookRecordId
());
}});
return
ObjectRestResponse
.
succ
();
}
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
View file @
9a6cb077
...
...
@@ -415,7 +415,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
checkIfVehicleExists
(
bookVehicleVo
.
getVehicleId
());
//提取日期和相应的预定目标日期
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
);
//转换日期范围为列表,并检查是否合法
fillDateList4DatePeriod
(
yearMonthAndDate
,
startDay
,
endDay
);
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/RentVehicleController.java
View file @
9a6cb077
package
com
.
xxfc
.
platform
.
vehicle
.
rest
;
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.rest.UserRestInterface
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken
;
...
...
@@ -25,8 +26,14 @@ import org.apache.commons.lang3.StringUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
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
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_NAME
;
...
...
@@ -156,7 +163,13 @@ public class RentVehicleController extends BaseController<VehicleBiz> implements
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"
);
BookVehicleVO
bookVehicleVo
=
BeanUtil
.
toBean
(
dto
,
BookVehicleVO
.
class
);
bookVehicleVo
.
setBookType
(
BookType
.
USER_RENT
.
getCode
());
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleMapper.xml
View file @
9a6cb077
...
...
@@ -637,6 +637,8 @@
and v.park_branch_company_id = #{parkBranchCompanyId}
</if>
and v.is_del = 0
and v.status != 3
and v.use_type = 1
</where>
</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