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
a89fb725
Commit
a89fb725
authored
Aug 14, 2019
by
libin
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
e2008d2c
0e1f8e85
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
79 additions
and
34 deletions
+79
-34
resultcod.properties
...common/src/main/resources/properties/resultcod.properties
+1
-1
BackStageOrderController.java
...om/xxfc/platform/order/rest/BackStageOrderController.java
+18
-0
BaseOrderMapper.xml
...rder-server/src/main/resources/mapper/BaseOrderMapper.xml
+6
-2
VehicleBiz.java
...c/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
+50
-23
VehicleBookRecordBiz.java
...a/com/xxfc/platform/vehicle/biz/VehicleBookRecordBiz.java
+1
-1
VehicleCataController.java
...com/xxfc/platform/vehicle/rest/VehicleCataController.java
+3
-7
No files found.
ace-common/src/main/resources/properties/resultcod.properties
View file @
a89fb725
...
...
@@ -214,7 +214,7 @@ BOOKED_FAILED_CODE = 4007
4007
=
车辆预定失败,请重试!
ONLY_BOOK_FROM_TODAY
=
4008
4008
=
预定时间不能小于当前时间
4008
=
取消或
预定时间不能小于当前时间
ADD_VEHICLE_FAIL
=
4009
4009
=
添加车辆失败,请重试
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/BackStageOrderController.java
View file @
a89fb725
...
...
@@ -181,6 +181,24 @@ public class BackStageOrderController extends CommonBaseController implements Us
dto
.
setEndTime
(
new
Date
().
getTime
());
}
}
UserDTO
userDTO
=
getAdminUserInfo
();
if
(
userDTO
==
null
)
{
return
ObjectRestResponse
.
succ
(
new
PageDataVO
<>());
}
List
<
BranchCompany
>
branchCompanies
=
vehicleFeign
.
companyAll
(
userDTO
.
getDataAll
(),
userDTO
.
getDataCompany
(),
userDTO
.
getDataZone
());
List
<
Integer
>
companyIds
=
branchCompanies
.
stream
().
map
(
BranchCompany:
:
getId
).
collect
(
Collectors
.
toList
());
if
(
dto
.
getStartCompanyId
()
!=
null
)
{
if
(
companyIds
.
size
()
>
0
)
{
if
(
companyIds
.
contains
(
dto
.
getStartCompanyId
()))
{
companyIds
.
clear
();
companyIds
.
add
(
dto
.
getStartCompanyId
());
}
else
{
return
ObjectRestResponse
.
succ
();
}
}
else
{
companyIds
.
add
(
dto
.
getStartCompanyId
());
}
}
Query
query
=
new
Query
(
dto
);
PageDataVO
<
OrderPageVO
>
pageDataVO
=
PageDataVO
.
pageInfo
(
query
,
()
->
baseOrderBiz
.
getRentVehicle
(
query
.
getSuper
()));
for
(
OrderPageVO
orderPageVO
:
pageDataVO
.
getData
())
{
...
...
xx-order/xx-order-server/src/main/resources/mapper/BaseOrderMapper.xml
View file @
a89fb725
...
...
@@ -192,8 +192,12 @@
<if
test=
"startTime != null and (status == 5 || status == 6 || status == -1)"
>
and r.end_time between #{startTime} and #{endTime}
</if>
<if
test=
"startCompanyId != null"
>
and r.start_company_id = #{startCompanyId}
<if
test=
"companyIds != null and companyIds.size > 0"
>
and r.start_company_id in
<foreach
collection=
"companyIds"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</if>
<if
test=
"status == 4"
>
order by r.start_time
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
View file @
a89fb725
...
...
@@ -603,14 +603,15 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
*/
@Transactional
public
RestResponse
<
Integer
>
reviewVehicleBooking
(
Integer
operatorId
,
Long
bookRecordId
,
Integer
rsStatus
,
String
userName
)
throws
Exception
{
try
{
//获取相关申请记录
VehicleBookRecord
vehicleBookRecord
=
vehicleBookRecordBiz
.
selectById
(
bookRecordId
);
//申请记录验证
if
(
vehicleBookRecord
==
null
){
return
RestResponse
.
codeAndMessage
(
ResCode
.
VEHICLE_BOOK_RECORD_IS_NOT_EXIST
.
getCode
(),
ResCode
.
VEHICLE_BOOK_RECORD_IS_NOT_EXIST
.
getDesc
());
}
if
(
!
VehicleBookRecordStatus
.
APPLY
.
getCode
().
equals
(
vehicleBookRecord
.
getStatus
())){
return
RestResponse
.
code
(
ResCode
.
VEHICLE_BOOKED_RECORD_ALREADY_CHANGED
.
getCode
());
if
(
VehicleBookRecordStatus
.
APPROVE
.
getCode
().
equals
(
vehicleBookRecord
.
getStatus
())){
return
RestResponse
.
code
AndMessage
(
ResCode
.
VEHICLE_BOOKED_RECORD_ALREADY_CHANGED
.
getCode
(),
ResCode
.
VEHICLE_BOOKED_RECORD_ALREADY_CHANGED
.
getDesc
());
}
//转换为相应预定参数
BookVehicleVO
bookVehicleVo
=
new
BookVehicleVO
();
...
...
@@ -649,9 +650,16 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
bookVehicleVo
.
setUnbookStartDate
(
bookVehicleVo
.
getBookStartDate
());
bookVehicleVo
.
setUnbookEndDate
(
bookVehicleVo
.
getBookEndDate
());
Boolean
hasSuc
=
unbookVehicle
(
bookVehicleVo
);
}
if
(
hasSuc
)
{
return
RestResponse
.
suc
();
}
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
RestResponse
.
codeAndMessage
(
1325
,
e
.
getMessage
());
}
return
RestResponse
.
codeAndMessage
(
1325
,
"取消预定失败"
);
}
/**
* 取消预定
...
...
@@ -840,6 +848,25 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
curBookedDateList
.
add
(
curDateStr
);
}
if
(
yearMonthAndDate
.
size
()>
3
){
//连续的日期最多夸3个月
throw
new
BaseException
(
" 只可以预约两个月内的车辆"
);
}
}
private
void
uinbookDateList4DatePeriod
(
Map
<
String
,
List
<
String
>>
yearMonthAndDate
,
DateTime
startDay
,
DateTime
endDay
){
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 BaseException("只可以取消当前时间之后的车辆");
// }
String
curYearMonth
=
curDate
.
toString
(
YEARMONTH_DATE_TIME_FORMATTER
);
if
(!
yearMonthAndDate
.
containsKey
(
curYearMonth
)){
yearMonthAndDate
.
put
(
curYearMonth
,
Lists
.
newArrayList
());
}
List
<
String
>
curBookedDateList
=
yearMonthAndDate
.
get
(
curYearMonth
);
curBookedDateList
.
add
(
curDateStr
);
}
if
(
yearMonthAndDate
.
size
()>
3
){
//连续的日期最多夸3个月
throw
new
BaseException
(
ResultCode
.
ONLY_BOOK_TWO_MONTH
);
}
...
...
@@ -850,14 +877,14 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
* @return
*/
@Transactional
public
Boolean
unbookVehicle
(
BookVehicleVO
bookVehicleVo
){
public
Boolean
unbookVehicle
(
BookVehicleVO
bookVehicleVo
)
throws
Exception
{
//提取日期参数,改为每月一份
//提取日期和相应的预定目标日期
Map
<
String
,
List
<
String
>>
yearMonthAndDate
=
Maps
.
newHashMap
();
DateTime
startDay
=
DateTime
.
parse
(
bookVehicleVo
.
getUnbookStartDate
(),
DEFAULT_DATE_TIME_FORMATTER
);
DateTime
endDay
=
DateTime
.
parse
(
bookVehicleVo
.
getUnbookEndDate
(),
DEFAULT_DATE_TIME_FORMATTER
);
//转换日期范围为列表,并检查是否合法
fill
DateList4DatePeriod
(
yearMonthAndDate
,
startDay
,
endDay
);
uinbook
DateList4DatePeriod
(
yearMonthAndDate
,
startDay
,
endDay
);
if
(
yearMonthAndDate
.
size
()>
3
){
//连续的日期最多夸3个月
throw
new
BaseException
(
ResultCode
.
ONLY_UNBOOK_TWO_MONTH
);
...
...
@@ -1142,7 +1169,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
Map
<
String
,
List
<
String
>>
yearMonthAndDateNotBooked
=
new
HashMap
<>();
//需比较未预定的年月 - 未预定日期列表 "2019-08-29"...."2019-09-04",
classifyByYearMonth
(
notBookedDates
,
yearMonthAndDateNotBooked
,
allYearMonth
);
if
(
allYearMonth
.
size
()>
MAX_MONTH_COUNT_BOOKED_INFO_QUERY
){
throw
new
CustomIllegalParam
Exception
(
" only 3 month can be included <bookedInfo> param."
);
throw
new
Base
Exception
(
" only 3 month can be included <bookedInfo> param."
);
}
//加入预定信息查询条件
...
...
@@ -1168,7 +1195,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
Map
<
String
,
List
<
String
>>
yearMonthAndDateNotBooked
=
new
HashMap
<>();
//未预定年月 - 未预定日期列表
classifyByYearMonth
(
notBookedDates
,
yearMonthAndDateNotBooked
,
allYearMonth
);
if
(
allYearMonth
.
size
()>
MAX_MONTH_COUNT_BOOKED_INFO_QUERY
){
throw
new
CustomIllegalParam
Exception
(
" only 3 month can be included <bookedInfo> param."
);
throw
new
Base
Exception
(
" only 3 month can be included <bookedInfo> param."
);
}
//加入预定信息查询条件
fillBookedDateSearchParam
(
params
,
yearMonthAndDate
,
yearMonthAndDateNotBooked
);
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleBookRecordBiz.java
View file @
a89fb725
...
...
@@ -272,7 +272,7 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic
if
(
params
.
get
(
"selectedMonth"
)
!=
null
)
{
String
selectedMonth
=
(
String
)
params
.
get
(
"selectedMonth"
);
if
(
StringUtils
.
isBlank
(
selectedMonth
)){
throw
new
BaseException
(
"no month selected "
);
throw
new
BaseException
(
"
no month selected "
);
}
DateTime
selectedMonthDate
=
DateTime
.
parse
(
selectedMonth
,
YEARMONTH_DATE_TIME_FORMATTER
);
if
(
selectedMonthDate
.
compareTo
(
DateTime
.
now
().
plusMonths
(-
1
).
withDayOfMonth
(
1
).
withMillisOfDay
(
0
))
<
0
){
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/VehicleCataController.java
View file @
a89fb725
...
...
@@ -9,16 +9,12 @@ import com.xxfc.platform.vehicle.biz.VehiclePlatCataBiz;
import
com.xxfc.platform.vehicle.common.RestResponse
;
import
com.xxfc.platform.vehicle.common.VehicleBaseController
;
import
com.xxfc.platform.vehicle.entity.VehiclePlatCata
;
import
com.xxfc.platform.vehicle.pojo.
*
;
import
lombok.Data
;
import
com.xxfc.platform.vehicle.pojo.
Cascade
;
import
com.xxfc.platform.vehicle.pojo.CataVo
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.ibatis.annotations.Update
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.*
;
import
sun.java2d.pipe.AATextRenderer
;
import
java.util.Arrays
;
@RestController
@RequestMapping
(
"/cata"
)
...
...
@@ -225,7 +221,7 @@ public class VehicleCataController extends VehicleBaseController<VehiclePlatCata
return RestResponse.data(baseBiz.getByPage(vehiclePageQueryVo));
} catch (JSONException ex) {
return RestResponse.code(ResCode.INVALID_REST_REQ_PARAM.getCode());
} catch (
CustomIllegalParam
Exception ex) {
} catch (
Base
Exception ex) {
return RestResponse.code(ResCode.INVALID_REST_REQ_PARAM.getCode());
}
}*/
...
...
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