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
c08b69ac
Commit
c08b69ac
authored
Aug 13, 2019
by
jiaorz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改租車訂單地址,修改车辆预定时添加订单号
parent
77adbcaf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
6 deletions
+34
-6
ResultCode.java
...thub/wxiaoqi/security/common/util/process/ResultCode.java
+13
-0
resultcod.properties
...common/src/main/resources/properties/resultcod.properties
+14
-0
VehicleBiz.java
...c/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
+7
-6
No files found.
ace-common/src/main/java/com/github/wxiaoqi/security/common/util/process/ResultCode.java
View file @
c08b69ac
...
...
@@ -23,6 +23,19 @@ public class ResultCode {
// 预定时间不能小于当前时间
public
static
int
ONLY_BOOK_FROM_TODAY
=
Integer
.
valueOf
(
SystemProperty
.
getResultConfig
(
"ONLY_BOOK_FROM_TODAY"
));
// 只能预定两个月内的车辆
public
static
int
ONLY_BOOK_TWO_MONTH
=
Integer
.
valueOf
(
SystemProperty
.
getResultConfig
(
"ONLY_BOOK_TWO_MONTH"
));
// 只能取消预定两个月内的车辆
public
static
int
ONLY_UNBOOK_TWO_MONTH
=
Integer
.
valueOf
(
SystemProperty
.
getResultConfig
(
"ONLY_UNBOOK_TWO_MONTH"
));
// 选择日期不可取消预定
public
static
int
VEHICLE_CAN_NOT_UNBOOK
=
Integer
.
valueOf
(
SystemProperty
.
getResultConfig
(
"VEHICLE_CAN_NOT_UNBOOK"
));
//预定日期为空
public
static
int
BOOKED_DATE_IS_EMPTY
=
Integer
.
valueOf
(
SystemProperty
.
getResultConfig
(
"BOOKED_DATE_IS_EMPTY"
));
public
static
int
TODAY_CAN_NOT_BOOK
=
Integer
.
valueOf
(
SystemProperty
.
getResultConfig
(
"TODAY_CAN_NOT_BOOK"
));
// 添加车辆失败,请重试
public
static
int
ADD_VEHICLE_FAIL
=
Integer
.
valueOf
(
SystemProperty
.
getResultConfig
(
"ADD_VEHICLE_FAIL"
));
...
...
ace-common/src/main/resources/properties/resultcod.properties
View file @
c08b69ac
...
...
@@ -225,3 +225,17 @@ UPDATE_VEHICLE_FAIL = 4010
DATE_TIME_IS_NULL
=
4011
4011
=
预定时间不能为空
ONLY_BOOK_TWO_MONTH
=
4012
4012
=
只能预定两月内的车辆
ONLY_UNBOOK_TWO_MONTH
=
4013
4013
=
只能取消预定两月内的车辆
VEHICLE_CAN_NOT_UNBOOK
=
4014
4014
=
选择日期不可取消预定
BOOKED_DATE_IS_EMPTY
=
4015
4015
=
预定日期为空
TODAY_CAN_NOT_BOOK
=
4016
4016
=
当天不可预定
\ No newline at end of file
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
View file @
c08b69ac
...
...
@@ -830,7 +830,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
for
(
DateTime
curDate
=
startDay
;
curDate
.
compareTo
(
endDay
)<=
0
;
curDate
=
curDate
.
plusDays
(
1
)){
String
curDateStr
=
curDate
.
toString
(
DEFAULT_DATE_TIME_FORMATTER
);
if
(
curDateStr
.
compareTo
(
DateTime
.
now
().
toString
(
DEFAULT_DATE_TIME_FORMATTER
))<
0
){
throw
new
CustomIllegalParamException
(
"只可以取消当前时间之后的车辆"
);
throw
new
BaseException
(
ResultCode
.
ONLY_BOOK_FROM_TODAY
);
}
String
curYearMonth
=
curDate
.
toString
(
YEARMONTH_DATE_TIME_FORMATTER
);
if
(!
yearMonthAndDate
.
containsKey
(
curYearMonth
)){
...
...
@@ -841,7 +841,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
}
if
(
yearMonthAndDate
.
size
()>
3
){
//连续的日期最多夸3个月
throw
new
CustomIllegalParamException
(
" 只可以预约两个月内的车辆"
);
throw
new
BaseException
(
ResultCode
.
ONLY_BOOK_TWO_MONTH
);
}
}
...
...
@@ -860,7 +860,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
fillDateList4DatePeriod
(
yearMonthAndDate
,
startDay
,
endDay
);
if
(
yearMonthAndDate
.
size
()>
3
){
//连续的日期最多夸3个月
throw
new
CustomIllegalParamException
(
" 只可以预约两个月内的车辆"
);
throw
new
BaseException
(
ResultCode
.
ONLY_UNBOOK_TWO_MONTH
);
}
Boolean
rs
=
Boolean
.
TRUE
;
for
(
Map
.
Entry
<
String
,
List
<
String
>>
entry:
yearMonthAndDate
.
entrySet
()){
...
...
@@ -881,7 +881,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
params
.
put
(
"yearMonth"
,
yearMonth
);
//加入更新条件
if
(
CollectionUtils
.
isEmpty
(
unbookDates
)){
throw
new
CustomIllegalParamException
(
" 车辆不可预定"
);
throw
new
BaseException
(
ResultCode
.
VEHICLE_CAN_NOT_UNBOOK
);
}
Map
<
String
,
List
<
String
>>
yearMonthAndDate
=
new
HashMap
<>();
yearMonthAndDate
.
put
(
yearMonth
,
unbookDates
);
...
...
@@ -908,7 +908,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
public
void
fillBookedDateSearchParam
(
Map
<
String
,
Object
>
params
,
Map
<
String
,
List
<
String
>>
yearMonthAndDate
,
Map
<
String
,
List
<
String
>>
yearMonthAndDateNotBooked
){
if
(
MapUtils
.
isEmpty
(
yearMonthAndDate
)&&
MapUtils
.
isEmpty
(
yearMonthAndDateNotBooked
)){
//没有预定信息查询条件
throw
new
CustomIllegalParamException
(
"没有预订信息!"
);
throw
new
BaseException
(
ResultCode
.
BOOKED_DATE_IS_EMPTY
);
}
Map
<
String
,
Map
<
String
,
Integer
>>
yearMonthAndParam
=
new
HashMap
<>();
...
...
@@ -953,7 +953,8 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
}
for
(
String
dateStr:
entry
.
getValue
())
{
//已预定作为条件,该位与1作与运算必定为1
if
(
bookedYearMonth
.
contains
(
dateStr
)){
throw
new
CustomIllegalParamException
(
"同一天既作为未预定查询条件又作为已预定查询条件"
);
log
.
info
(
"当天不可预定,日期为:dateStr = {}"
,
dateStr
);
throw
new
BaseException
(
ResultCode
.
TODAY_CAN_NOT_BOOK
);
}
DateTime
dateTime
=
DateTime
.
parse
(
dateStr
,
DEFAULT_DATE_TIME_FORMATTER
);
//仅对应位为1的整形值
...
...
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