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
6496daa9
Commit
6496daa9
authored
Jun 17, 2019
by
hanfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加运营管理后台
parent
0b4c3518
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
113 additions
and
18 deletions
+113
-18
AdminBootstrap.java
...ava/com/github/wxiaoqi/security/admin/AdminBootstrap.java
+1
-1
Vehicle.java
...c/main/java/com/xxfc/platform/vehicle/entity/Vehicle.java
+1
-1
VehicleBiz.java
...c/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
+44
-0
VehiclePlatCataBiz.java
...ava/com/xxfc/platform/vehicle/biz/VehiclePlatCataBiz.java
+19
-0
VehicleCataController.java
...com/xxfc/platform/vehicle/rest/VehicleCataController.java
+21
-8
VehicleController.java
...ava/com/xxfc/platform/vehicle/rest/VehicleController.java
+27
-8
No files found.
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/AdminBootstrap.java
View file @
6496daa9
...
@@ -33,7 +33,7 @@ import java.util.List;
...
@@ -33,7 +33,7 @@ import java.util.List;
@EnableDiscoveryClient
@EnableDiscoveryClient
@EnableCircuitBreaker
@EnableCircuitBreaker
@SpringBootApplication
@SpringBootApplication
@EnableFeignClients
({
"com.github.wxiaoqi.security.auth.client.feign"
,
"com.xxfc.platform"
})
@EnableFeignClients
({
"com.github.wxiaoqi.security.auth.client.feign"
,
"com.xxfc.platform"
,
"com.github.wxiaoqi.security.admin.feign"
})
@EnableScheduling
@EnableScheduling
@EnableAceAuthClient
@EnableAceAuthClient
@EnableAceCache
@EnableAceCache
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/entity/Vehicle.java
View file @
6496daa9
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
View file @
6496daa9
...
@@ -6,6 +6,7 @@ import com.github.pagehelper.PageHelper;
...
@@ -6,6 +6,7 @@ import com.github.pagehelper.PageHelper;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
...
@@ -44,6 +45,8 @@ import org.springframework.stereotype.Service;
...
@@ -44,6 +45,8 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
import
tk.mybatis.mapper.entity.Example
;
import
tk.mybatis.mapper.weekend.WeekendSqls
;
import
java.io.File
;
import
java.io.File
;
import
java.util.*
;
import
java.util.*
;
...
@@ -910,4 +913,45 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> {
...
@@ -910,4 +913,45 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> {
PageInfo
<
Vehicle
>
usableVehicleInfo
=
new
PageInfo
<>(
lists
);
PageInfo
<
Vehicle
>
usableVehicleInfo
=
new
PageInfo
<>(
lists
);
return
PageDataVO
.
pageInfo
(
usableVehicleInfo
);
return
PageDataVO
.
pageInfo
(
usableVehicleInfo
);
}
}
/**
* 保存
* @param vehicle
* @return
*/
@Transactional
public
ObjectRestResponse
save
(
Vehicle
vehicle
){
if
(
vehicle
==
null
)
{
ObjectRestResponse
.
createDefaultFail
();
}
String
id
=
vehicle
.
getId
();
if
(
StringUtils
.
isBlank
(
id
))
{
insertSelective
(
vehicle
);
insertSelective
(
vehicle
);
}
else
{
updateSelectiveById
(
vehicle
);
}
return
ObjectRestResponse
.
succ
();
}
public
ObjectRestResponse
findListByVehicle
(
Vehicle
vehicle
,
Integer
page
,
Integer
limit
){
WeekendSqls
<
Vehicle
>
sqls
=
WeekendSqls
.<
Vehicle
>
custom
();
if
(
vehicle
.
getStatus
()!=
null
||
vehicle
.
getStatus
()!=
0
){
sqls
.
andEqualTo
(
Vehicle:
:
getStatus
,
vehicle
.
getStatus
());
}
if
(
StringUtils
.
isBlank
(
vehicle
.
getNumberPlate
())){
sqls
.
andEqualTo
(
Vehicle:
:
getNumberPlate
,
vehicle
.
getNumberPlate
());
}
if
(
vehicle
.
getSubordinateBranch
()==
null
||
vehicle
.
getSubordinateBranch
()==
0
){
sqls
.
andEqualTo
(
Vehicle:
:
getSubordinateBranch
,
vehicle
.
getSubordinateBranch
());
}
Example
exa
=
Example
.
builder
(
Vehicle
.
class
).
where
(
sqls
).
build
();
selectByExample
(
exa
);
return
ObjectRestResponse
.
succ
();
}
}
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehiclePlatCataBiz.java
View file @
6496daa9
...
@@ -11,6 +11,7 @@ import com.github.wxiaoqi.security.common.util.process.ResultCode;
...
@@ -11,6 +11,7 @@ import com.github.wxiaoqi.security.common.util.process.ResultCode;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.xxfc.platform.vehicle.common.RestResponse
;
import
com.xxfc.platform.vehicle.common.RestResponse
;
import
com.xxfc.platform.vehicle.constant.RedisKey
;
import
com.xxfc.platform.vehicle.constant.RedisKey
;
import
com.xxfc.platform.vehicle.entity.Vehicle
;
import
com.xxfc.platform.vehicle.entity.VehicleCata
;
import
com.xxfc.platform.vehicle.entity.VehicleCata
;
import
com.xxfc.platform.vehicle.entity.VehiclePlatCata
;
import
com.xxfc.platform.vehicle.entity.VehiclePlatCata
;
import
com.xxfc.platform.vehicle.mapper.VehiclePlatCataMapper
;
import
com.xxfc.platform.vehicle.mapper.VehiclePlatCataMapper
;
...
@@ -404,4 +405,22 @@ public class VehiclePlatCataBiz extends BaseBiz<VehiclePlatCataMapper, VehiclePl
...
@@ -404,4 +405,22 @@ public class VehiclePlatCataBiz extends BaseBiz<VehiclePlatCataMapper, VehiclePl
return
ObjectRestResponse
.
succ
(
vehiclePlatCatas
);
return
ObjectRestResponse
.
succ
(
vehiclePlatCatas
);
}
}
@Transactional
public
ObjectRestResponse
deleteCascadeById
(
Integer
id
){
//修改一级标签
VehiclePlatCata
vehiclePlatCata
=
new
VehiclePlatCata
();
vehiclePlatCata
.
setId
(
id
);
vehiclePlatCata
.
setState
(
1
);
updateSelectiveById
(
vehiclePlatCata
);
//修改子标签
VehiclePlatCata
vpc
=
new
VehiclePlatCata
();
vpc
.
setState
(
1
);
mapper
.
updateByExampleSelective
(
vpc
,
Example
.
builder
(
VehiclePlatCata
.
class
)
.
andWhere
(
WeekendSqls
.<
VehiclePlatCata
>
custom
()
.
andEqualTo
(
VehiclePlatCata:
:
getParentId
,
id
)).
build
());
return
ObjectRestResponse
.
succ
();
}
}
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/VehicleCataController.java
View file @
6496daa9
...
@@ -10,6 +10,7 @@ import com.xxfc.platform.vehicle.common.RestResponse;
...
@@ -10,6 +10,7 @@ import com.xxfc.platform.vehicle.common.RestResponse;
import
com.xxfc.platform.vehicle.common.VehicleBaseController
;
import
com.xxfc.platform.vehicle.common.VehicleBaseController
;
import
com.xxfc.platform.vehicle.entity.VehiclePlatCata
;
import
com.xxfc.platform.vehicle.entity.VehiclePlatCata
;
import
com.xxfc.platform.vehicle.pojo.*
;
import
com.xxfc.platform.vehicle.pojo.*
;
import
lombok.Data
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -62,7 +63,7 @@ public class VehicleCataController extends VehicleBaseController<VehiclePlatCata
...
@@ -62,7 +63,7 @@ public class VehicleCataController extends VehicleBaseController<VehiclePlatCata
* @return
* @return
*/
*/
@GetMapping
(
value
=
"/add/fingCatasByParentId/{parentId}"
)
@GetMapping
(
value
=
"/add/fingCatasByParentId/{parentId}"
)
public
ObjectRestResponse
fingCatasByParentId
(
@PathVariable
Integer
parentId
){
public
ObjectRestResponse
fingCatasByParentId
(
@PathVariable
(
"parentId"
)
Integer
parentId
){
return
baseBiz
.
fingCatasByParentId
(
parentId
);
return
baseBiz
.
fingCatasByParentId
(
parentId
);
}
}
...
@@ -73,7 +74,7 @@ public class VehicleCataController extends VehicleBaseController<VehiclePlatCata
...
@@ -73,7 +74,7 @@ public class VehicleCataController extends VehicleBaseController<VehiclePlatCata
* @return
* @return
*/
*/
@GetMapping
(
value
=
"/add/findCascade/{id}"
)
@GetMapping
(
value
=
"/add/findCascade/{id}"
)
public
ObjectRestResponse
findCascade
(
@PathVariable
Integer
id
){
public
ObjectRestResponse
findCascade
(
@PathVariable
(
"id"
)
Integer
id
){
return
baseBiz
.
findCascade
(
id
);
return
baseBiz
.
findCascade
(
id
);
...
@@ -87,14 +88,16 @@ public class VehicleCataController extends VehicleBaseController<VehiclePlatCata
...
@@ -87,14 +88,16 @@ public class VehicleCataController extends VehicleBaseController<VehiclePlatCata
* @param sort 分类 0-增加车型页面,1-标签管理页面
* @param sort 分类 0-增加车型页面,1-标签管理页面
* @return
* @return
*/
*/
@GetMapping
(
value
=
"/add/
fingCatasByParentId
/{page}/{limit}/{sort}"
)
@GetMapping
(
value
=
"/add/
getCascades
/{page}/{limit}/{sort}"
)
public
ObjectRestResponse
getCascades
(
public
ObjectRestResponse
getCascades
(
// @PathVariable("page") Integer page
// ,@PathVariable("limit") Integer limit
// ,@PathVariable("sort") Integer sort){
@PathVariable
Integer
page
@PathVariable
Integer
page
,
@PathVariable
Integer
limit
,
@PathVariable
Integer
limit
,
@PathVariable
Integer
sort
){
,
@PathVariable
Integer
sort
){
return
baseBiz
.
getCascades
(
page
,
limit
,
sort
);
return
baseBiz
.
getCascades
(
page
,
limit
,
sort
);
}
}
...
@@ -136,7 +139,7 @@ public class VehicleCataController extends VehicleBaseController<VehiclePlatCata
...
@@ -136,7 +139,7 @@ public class VehicleCataController extends VehicleBaseController<VehiclePlatCata
* @return
* @return
*/
*/
@PutMapping
(
"/add/updateParentRank/{id}/{rank}"
)
@PutMapping
(
"/add/updateParentRank/{id}/{rank}"
)
public
ObjectRestResponse
updateParentRank
(
@PathVariable
Integer
id
,
@PathVariable
Integer
rank
){
public
ObjectRestResponse
updateParentRank
(
@PathVariable
(
"id"
)
Integer
id
,
@PathVariable
(
"rank"
)
Integer
rank
){
return
baseBiz
.
updateParentRank
(
id
,
rank
);
return
baseBiz
.
updateParentRank
(
id
,
rank
);
}
}
...
@@ -152,6 +155,16 @@ public class VehicleCataController extends VehicleBaseController<VehiclePlatCata
...
@@ -152,6 +155,16 @@ public class VehicleCataController extends VehicleBaseController<VehiclePlatCata
return
baseBiz
.
getCatasByIds
(
ids
);
return
baseBiz
.
getCatasByIds
(
ids
);
}
}
/**
* 删除一级标签及其子标签
* @param id 标签id
* @return
*/
@DeleteMapping
(
"/add/deleteCascadeById/{id}"
)
public
ObjectRestResponse
deleteCascadeById
(
@PathVariable
(
"id"
)
Integer
id
){
return
baseBiz
.
deleteCascadeById
(
id
);
}
/* @RequestMapping(value = "/{id}", method = RequestMethod.GET)
/* @RequestMapping(value = "/{id}", method = RequestMethod.GET)
public RestResponse<Vehicle> get(@PathVariable String id) {
public RestResponse<Vehicle> get(@PathVariable String id) {
return RestResponse.data(baseBiz.get(id));
return RestResponse.data(baseBiz.get(id));
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/VehicleController.java
View file @
6496daa9
...
@@ -52,7 +52,7 @@ import static com.xxfc.platform.vehicle.constant.VehicleConstant.USER_APP;
...
@@ -52,7 +52,7 @@ import static com.xxfc.platform.vehicle.constant.VehicleConstant.USER_APP;
@RequestMapping
(
"/vehicleInfo"
)
@RequestMapping
(
"/vehicleInfo"
)
@Slf4j
@Slf4j
@IgnoreClientToken
@IgnoreClientToken
@Api
(
value
=
"车辆管理controller"
,
tags
=
{
"车辆管理接口"
})
@Api
(
value
=
"车辆管理controller"
,
tags
=
{
"车辆管理接口"
})
public
class
VehicleController
extends
BaseController
<
VehicleBiz
>
{
public
class
VehicleController
extends
BaseController
<
VehicleBiz
>
{
@Autowired
@Autowired
...
@@ -280,14 +280,14 @@ public class VehicleController extends BaseController<VehicleBiz> {
...
@@ -280,14 +280,14 @@ public class VehicleController extends BaseController<VehicleBiz> {
public
ObjectRestResponse
<
PageDataVO
<
UsableVehicleModelVO
>>
rentUsableVehicle
(
UsableVeicleDTO
dto
)
throws
Exception
{
public
ObjectRestResponse
<
PageDataVO
<
UsableVehicleModelVO
>>
rentUsableVehicle
(
UsableVeicleDTO
dto
)
throws
Exception
{
//根据时间 获得 可用车辆
//根据时间 获得 可用车辆
//结合车型
//结合车型
if
(
StringUtils
.
isNotBlank
(
dto
.
getCatasStr
()))
{
if
(
StringUtils
.
isNotBlank
(
dto
.
getCatasStr
()))
{
List
<
Integer
>
catasIds
=
Pattern
.
compile
(
","
).
splitAsStream
(
dto
.
getCatasStr
()).
map
((
s
)->
Integer
.
parseInt
(
s
)).
collect
(
Collectors
.
toList
());
List
<
Integer
>
catasIds
=
Pattern
.
compile
(
","
).
splitAsStream
(
dto
.
getCatasStr
()).
map
((
s
)
->
Integer
.
parseInt
(
s
)).
collect
(
Collectors
.
toList
());
List
<
VehiclePlatCata
>
catas
=
vehiclePlatCataBiz
.
selectByExample
(
new
Example
.
Builder
(
VehiclePlatCata
.
class
)
List
<
VehiclePlatCata
>
catas
=
vehiclePlatCataBiz
.
selectByExample
(
new
Example
.
Builder
(
VehiclePlatCata
.
class
)
.
where
(
WeekendSqls
.<
VehiclePlatCata
>
custom
().
andIn
(
VehiclePlatCata:
:
getId
,
catasIds
)).
build
());
.
where
(
WeekendSqls
.<
VehiclePlatCata
>
custom
().
andIn
(
VehiclePlatCata:
:
getId
,
catasIds
)).
build
());
Map
<
Integer
,
List
<
VehiclePlatCata
>>
vpcMap
=
new
HashMap
<
Integer
,
List
<
VehiclePlatCata
>>();
Map
<
Integer
,
List
<
VehiclePlatCata
>>
vpcMap
=
new
HashMap
<
Integer
,
List
<
VehiclePlatCata
>>();
for
(
VehiclePlatCata
vpc
:
catas
)
{
for
(
VehiclePlatCata
vpc
:
catas
)
{
List
<
VehiclePlatCata
>
vpcs
=
vpcMap
.
get
(
vpc
.
getParentId
());
List
<
VehiclePlatCata
>
vpcs
=
vpcMap
.
get
(
vpc
.
getParentId
());
if
(
null
==
vpcs
)
{
if
(
null
==
vpcs
)
{
vpcs
=
new
ArrayList
<
VehiclePlatCata
>();
vpcs
=
new
ArrayList
<
VehiclePlatCata
>();
}
}
vpcs
.
add
(
vpc
);
vpcs
.
add
(
vpc
);
...
@@ -333,7 +333,7 @@ public class VehicleController extends BaseController<VehicleBiz> {
...
@@ -333,7 +333,7 @@ public class VehicleController extends BaseController<VehicleBiz> {
//查询可车辆信息
//查询可车辆信息
PageDataVO
<
Vehicle
>
pageDataVO
=
vehicleBiz
.
searchUsableVehicle
(
dto
);
PageDataVO
<
Vehicle
>
pageDataVO
=
vehicleBiz
.
searchUsableVehicle
(
dto
);
if
(
pageDataVO
.
getData
().
size
()
<=
0
)
{
if
(
pageDataVO
.
getData
().
size
()
<=
0
)
{
throw
new
BaseException
(
ResultCode
.
NOTEXIST_CODE
);
throw
new
BaseException
(
ResultCode
.
NOTEXIST_CODE
);
}
}
bookVehicleVo
.
setVehicle
(
pageDataVO
.
getData
().
get
(
0
).
getId
());
bookVehicleVo
.
setVehicle
(
pageDataVO
.
getData
().
get
(
0
).
getId
());
...
@@ -343,4 +343,23 @@ public class VehicleController extends BaseController<VehicleBiz> {
...
@@ -343,4 +343,23 @@ public class VehicleController extends BaseController<VehicleBiz> {
return
ObjectRestResponse
.
succ
(
bookVehicleVo
.
getVehicle
());
return
ObjectRestResponse
.
succ
(
bookVehicleVo
.
getVehicle
());
}
}
/**
* 保存
*
* @param vehicle
* @return
*/
@PostMapping
(
"/add/seva"
)
public
ObjectRestResponse
seva
(
Vehicle
vehicle
)
{
return
baseBiz
.
save
(
vehicle
);
}
@PostMapping
(
"/add/findListByVehicle/{page}/{limit}"
)
public
ObjectRestResponse
findListByVehicle
(
@RequestBody
Vehicle
vehicle
,
@PathVariable
(
"page"
)
Integer
page
,
@PathVariable
(
"limit"
)
Integer
limit
)
{
return
baseBiz
.
findListByVehicle
(
vehicle
,
page
,
limit
);
}
}
}
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