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
d7a100de
Commit
d7a100de
authored
Sep 02, 2020
by
周健威
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master-vehicle-price' into dev-tiande
parents
76faa405
f32c5524
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
0 deletions
+59
-0
VehicleController.java
...ava/com/xxfc/platform/vehicle/rest/VehicleController.java
+59
-0
No files found.
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/VehicleController.java
View file @
d7a100de
package
com
.
xxfc
.
platform
.
vehicle
.
rest
;
package
com
.
xxfc
.
platform
.
vehicle
.
rest
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONException
;
import
com.alibaba.fastjson.JSONException
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
...
@@ -23,9 +26,11 @@ import com.xxfc.platform.vehicle.constant.VehicleBookRecordStatus;
...
@@ -23,9 +26,11 @@ import com.xxfc.platform.vehicle.constant.VehicleBookRecordStatus;
import
com.xxfc.platform.vehicle.entity.*
;
import
com.xxfc.platform.vehicle.entity.*
;
import
com.xxfc.platform.vehicle.jobhandler.VehicleJobHandler
;
import
com.xxfc.platform.vehicle.jobhandler.VehicleJobHandler
;
import
com.xxfc.platform.vehicle.pojo.*
;
import
com.xxfc.platform.vehicle.pojo.*
;
import
com.xxfc.platform.vehicle.pojo.dto.VehicleModelCalendarPriceDTO
;
import
com.xxfc.platform.vehicle.pojo.dto.VehiclePlanDto
;
import
com.xxfc.platform.vehicle.pojo.dto.VehiclePlanDto
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.Data
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.joda.time.DateTime
;
import
org.joda.time.DateTime
;
import
org.joda.time.format.DateTimeFormat
;
import
org.joda.time.format.DateTimeFormat
;
...
@@ -63,6 +68,9 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use
...
@@ -63,6 +68,9 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use
@Autowired
@Autowired
private
VehiclePlatCataBiz
vehiclePlatCataBiz
;
private
VehiclePlatCataBiz
vehiclePlatCataBiz
;
@Autowired
private
VehicleCataBiz
vehicleCataBiz
;
@Autowired
@Autowired
private
VehicleWarningMsgBiz
vehicleWarningMsgBiz
;
private
VehicleWarningMsgBiz
vehicleWarningMsgBiz
;
...
@@ -81,6 +89,11 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use
...
@@ -81,6 +89,11 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use
@Autowired
@Autowired
VehicleDepartureService
vehicleDepartureService
;
VehicleDepartureService
vehicleDepartureService
;
@Autowired
VehicleModelBiz
vehicleModelBiz
;
@Autowired
VehicleHolidayPriceInfoBiz
vehicleHolidayPriceInfoBiz
;
public
UserFeign
getUserFeign
()
{
public
UserFeign
getUserFeign
()
{
return
userFeign
;
return
userFeign
;
...
@@ -623,4 +636,50 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use
...
@@ -623,4 +636,50 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use
public
List
<
String
>
findbyPlateNumberAndVehicleCod
(
@RequestParam
(
value
=
"plateNumber"
,
required
=
false
)
String
plateNumber
,
@RequestParam
(
value
=
"vehicleCode"
,
required
=
false
)
String
vehicleCode
){
public
List
<
String
>
findbyPlateNumberAndVehicleCod
(
@RequestParam
(
value
=
"plateNumber"
,
required
=
false
)
String
plateNumber
,
@RequestParam
(
value
=
"vehicleCode"
,
required
=
false
)
String
vehicleCode
){
return
vehicleBiz
.
findbyPlateNumberAndVehicleCod
(
plateNumber
,
vehicleCode
);
return
vehicleBiz
.
findbyPlateNumberAndVehicleCod
(
plateNumber
,
vehicleCode
);
}
}
/*** 新增给App ****/
@RequestMapping
(
value
=
"/app/unauth/findById"
,
method
=
RequestMethod
.
GET
)
@IgnoreUserToken
public
RestResponse
<
VehicleVO
>
appFindById
(
String
id
,
String
priceStartDate
,
String
priceEndDate
)
{
Vehicle
vehicle
=
baseBiz
.
get
(
id
);
VehicleVO
vehicleVO
=
BeanUtil
.
toBean
(
vehicle
,
VehicleVO
.
class
);
vehicleVO
.
setVehicleModel
(
vehicleModelBiz
.
selectById
(
vehicleVO
.
getModelId
()));
List
<
VehicleCata
>
vehicleCatas
=
vehicleCataBiz
.
selectList
(
new
VehicleCata
(){{
setVehicleModelId
(
vehicleVO
.
getModelId
());
}});
if
(
CollUtil
.
isNotEmpty
(
vehicleCatas
))
{
List
<
Integer
>
list
=
vehicleCatas
.
parallelStream
().
map
(
VehicleCata:
:
getCataId
).
collect
(
Collectors
.
toList
());
vehicleVO
.
setVehiclePlatCatas
(
vehiclePlatCataBiz
.
selectByWeekend
(
w
->
{
w
.
andIn
(
VehiclePlatCata:
:
getId
,
list
);
return
w
;
}));
}
if
(
StrUtil
.
isNotBlank
(
priceStartDate
)
&&
StrUtil
.
isNotBlank
(
priceEndDate
))
{
vehicleVO
.
setPriceDTOS
(
vehicleHolidayPriceInfoBiz
.
getSynthesizePrice
(
vehicleVO
.
getId
(),
priceStartDate
,
priceEndDate
,
null
,
vehicleVO
.
getSubordinateBranch
()));
}
return
RestResponse
.
data
(
vehicleVO
);
}
@Data
static
public
class
VehicleVO
extends
Vehicle
{
private
VehicleModel
vehicleModel
;
private
List
<
VehiclePlatCata
>
vehiclePlatCatas
;
private
List
<
VehicleModelCalendarPriceDTO
>
priceDTOS
;
/**
* 价格开始日期
*/
private
String
priceStartDate
;
/**
* 价格结束日期
*/
private
String
priceEndDate
;
}
}
}
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