Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-trialdrive-admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 1a6ce210
authored
Aug 21, 2021
by
刘宇峰
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
新增车辆-车型管理
1 parent
26154d57
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
15 deletions
src/main/java/cn/com/glsx/admin/modules/controller/VehicleController.java
src/main/java/cn/com/glsx/admin/modules/model/TenantTypesDTO.java
src/main/java/cn/com/glsx/admin/modules/model/param/VehicleTypesBO.java
src/main/java/cn/com/glsx/admin/modules/service/VehicleService.java
src/main/java/cn/com/glsx/admin/modules/controller/VehicleController.java
View file @
1a6ce21
...
@@ -197,21 +197,21 @@ public class VehicleController {
...
@@ -197,21 +197,21 @@ public class VehicleController {
@ApiOperation
(
value
=
"车辆子品牌查询"
)
@ApiOperation
(
value
=
"车辆子品牌查询"
)
@GetMapping
(
"/subbrands"
)
@GetMapping
(
"/subbrands"
)
public
R
<
List
<
Carbrand
>>
subBrands
(
@RequestParam
Long
brandId
)
{
public
R
<
List
<
Carbrand
>>
subBrands
(
@RequestParam
Integer
brandId
)
{
List
<
Carbrand
>
carBrandList
=
vehicleService
.
getSubBrandsByBrandId
(
brandId
);
List
<
Carbrand
>
carBrandList
=
vehicleService
.
getSubBrandsByBrandId
(
brandId
);
return
R
.
ok
().
data
(
carBrandList
);
return
R
.
ok
().
data
(
carBrandList
);
}
}
@ApiOperation
(
value
=
"车辆系别查询"
)
@ApiOperation
(
value
=
"车辆系别查询"
)
@GetMapping
(
"/series"
)
@GetMapping
(
"/series"
)
public
R
<
List
<
Carseries
>>
series
(
@RequestParam
Long
brandId
)
{
public
R
<
List
<
Carseries
>>
series
(
@RequestParam
Integer
brandId
)
{
List
<
Carseries
>
carSeriesList
=
vehicleService
.
getSeriesByBrandId
(
brandId
);
List
<
Carseries
>
carSeriesList
=
vehicleService
.
getSeriesByBrandId
(
brandId
);
return
R
.
ok
().
data
(
carSeriesList
);
return
R
.
ok
().
data
(
carSeriesList
);
}
}
@ApiOperation
(
value
=
"车辆类型查询"
)
@ApiOperation
(
value
=
"车辆类型查询"
)
@GetMapping
(
"/types"
)
@GetMapping
(
"/types"
)
public
R
<
List
<
Cartype
>>
types
(
@RequestParam
Long
seriesId
)
{
public
R
<
List
<
Cartype
>>
types
(
@RequestParam
Integer
seriesId
)
{
List
<
Cartype
>
carTypeList
=
vehicleService
.
getTypesBySeriesId
(
seriesId
);
List
<
Cartype
>
carTypeList
=
vehicleService
.
getTypesBySeriesId
(
seriesId
);
return
R
.
ok
().
data
(
carTypeList
);
return
R
.
ok
().
data
(
carTypeList
);
}
}
...
...
src/main/java/cn/com/glsx/admin/modules/model/TenantTypesDTO.java
View file @
1a6ce21
...
@@ -23,7 +23,7 @@ public class TenantTypesDTO {
...
@@ -23,7 +23,7 @@ public class TenantTypesDTO {
@JsonIgnore
@JsonIgnore
private
String
types
;
private
String
types
;
private
List
<
Long
>
typeIds
;
private
List
<
Integer
>
typeIds
;
private
Long
createdBy
;
private
Long
createdBy
;
...
...
src/main/java/cn/com/glsx/admin/modules/model/param/VehicleTypesBO.java
View file @
1a6ce21
...
@@ -22,6 +22,7 @@ public class VehicleTypesBO {
...
@@ -22,6 +22,7 @@ public class VehicleTypesBO {
* 启用状态:0关闭;1开启
* 启用状态:0关闭;1开启
*/
*/
private
Integer
enableStatus
;
private
Integer
enableStatus
;
private
List
<
Long
>
typeIds
;
private
List
<
Integer
>
typeIds
;
}
}
src/main/java/cn/com/glsx/admin/modules/service/VehicleService.java
View file @
1a6ce21
...
@@ -761,23 +761,28 @@ public class VehicleService {
...
@@ -761,23 +761,28 @@ public class VehicleService {
}
}
@Cacheable
(
value
=
"carbrands"
,
key
=
"#brandId"
)
@Cacheable
(
value
=
"carbrands"
,
key
=
"#brandId"
)
public
List
<
Carbrand
>
getSubBrandsByBrandId
(
Long
brandId
)
{
public
List
<
Carbrand
>
getSubBrandsByBrandId
(
Integer
brandId
)
{
return
carbrandService
.
listSubCarbrandByParentId
(
Math
.
toIntExact
(
brandId
)
);
return
carbrandService
.
listSubCarbrandByParentId
(
brandId
);
}
}
@Cacheable
(
value
=
"carseries"
,
key
=
"#brandId"
)
@Cacheable
(
value
=
"carseries"
,
key
=
"#brandId"
)
public
List
<
Carseries
>
getSeriesByBrandId
(
Long
brandId
)
{
public
List
<
Carseries
>
getSeriesByBrandId
(
Integer
brandId
)
{
return
carseriesService
.
getByCarbrandId
(
Math
.
toIntExact
(
brandId
)
);
return
carseriesService
.
getByCarbrandId
(
brandId
);
}
}
@Cacheable
(
value
=
"cartypes"
,
key
=
"#seriesId"
)
@Cacheable
(
value
=
"cartypes"
,
key
=
"#seriesId"
)
public
List
<
Cartype
>
getTypesBySeriesId
(
Long
seriesId
)
{
public
List
<
Cartype
>
getTypesBySeriesId
(
Integer
seriesId
)
{
return
cartypeService
.
getBySeiesId
(
Math
.
toIntExact
(
seriesId
));
return
cartypeService
.
getBySeiesId
(
seriesId
);
}
@Cacheable
(
value
=
"carbrand"
,
key
=
"#brandId"
)
public
Carbrand
getByBrandId
(
Integer
brandId
)
{
return
carbrandService
.
getParentBrandByBrandId
(
brandId
);
}
}
@Cacheable
(
value
=
"cartype"
,
key
=
"#typeId"
)
@Cacheable
(
value
=
"cartype"
,
key
=
"#typeId"
)
public
Cartype
getByTypeId
(
Long
typeId
)
{
public
Cartype
getByTypeId
(
Integer
typeId
)
{
return
cartypeService
.
getByCarTypeId
(
Math
.
toIntExact
(
typeId
)
);
return
cartypeService
.
getByCarTypeId
(
typeId
);
}
}
public
void
saveVehicleTypes
(
VehicleTypesBO
typesBO
)
{
public
void
saveVehicleTypes
(
VehicleTypesBO
typesBO
)
{
...
@@ -789,7 +794,7 @@ public class VehicleService {
...
@@ -789,7 +794,7 @@ public class VehicleService {
typesBO
.
getTypeIds
().
forEach
(
tId
->
{
typesBO
.
getTypeIds
().
forEach
(
tId
->
{
Cartype
carType
=
this
.
getByTypeId
(
tId
);
Cartype
carType
=
this
.
getByTypeId
(
tId
);
if
(
carType
!=
null
)
{
if
(
carType
!=
null
)
{
Carbrand
carBrand
=
carbrandService
.
getParentBrand
ByBrandId
(
carType
.
getCarBrandId
());
Carbrand
carBrand
=
this
.
get
ByBrandId
(
carType
.
getCarBrandId
());
TenantVehicleType
tvType
=
new
TenantVehicleType
();
TenantVehicleType
tvType
=
new
TenantVehicleType
();
tvType
.
setTenantId
(
typesBO
.
getTenantId
());
tvType
.
setTenantId
(
typesBO
.
getTenantId
());
...
@@ -822,7 +827,7 @@ public class VehicleService {
...
@@ -822,7 +827,7 @@ public class VehicleService {
TenantTypesDTO
typesDTO
=
tenantVehicleTypeMapper
.
selectByTenantId
(
tenantId
);
TenantTypesDTO
typesDTO
=
tenantVehicleTypeMapper
.
selectByTenantId
(
tenantId
);
if
(
typesDTO
!=
null
)
{
if
(
typesDTO
!=
null
)
{
String
[]
typeStrs
=
typesDTO
.
getTypes
().
split
(
","
);
String
[]
typeStrs
=
typesDTO
.
getTypes
().
split
(
","
);
Long
[]
types
=
(
Long
[])
ConvertUtils
.
convert
(
typeStrs
,
Long
.
class
);
Integer
[]
types
=
(
Integer
[])
ConvertUtils
.
convert
(
typeStrs
,
Integer
.
class
);
typesDTO
.
setTypeIds
(
Arrays
.
asList
(
types
));
typesDTO
.
setTypeIds
(
Arrays
.
asList
(
types
));
}
}
return
typesDTO
;
return
typesDTO
;
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment