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
2da8b4b9
Commit
2da8b4b9
authored
Jun 28, 2019
by
周健威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
ce2ae719
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
10 deletions
+13
-10
CommonConstants.java
...hub/wxiaoqi/security/common/constant/CommonConstants.java
+1
-0
BaseException.java
...thub/wxiaoqi/security/common/exception/BaseException.java
+4
-8
OrderRentVehicleService.java
.../xxfc/platform/order/service/OrderRentVehicleService.java
+4
-0
BaseExceptionHandler.java
...om/xxfc/platform/vehicle/config/BaseExceptionHandler.java
+1
-1
VehicleController.java
...ava/com/xxfc/platform/vehicle/rest/VehicleController.java
+3
-1
No files found.
ace-common/src/main/java/com/github/wxiaoqi/security/common/constant/CommonConstants.java
View file @
2da8b4b9
...
...
@@ -6,6 +6,7 @@ package com.github.wxiaoqi.security.common.constant;
public
class
CommonConstants
{
public
static
final
Integer
SYS_TRUE
=
1
;
public
static
final
Integer
SYS_FALSE
=
0
;
public
static
final
Integer
SYS_JSON_TRUE
=
200
;
public
final
static
String
RESOURCE_TYPE_MENU
=
"menu"
;
public
final
static
String
RESOURCE_TYPE_BTN
=
"button"
;
// 用户token异常
...
...
ace-common/src/main/java/com/github/wxiaoqi/security/common/exception/BaseException.java
View file @
2da8b4b9
...
...
@@ -53,12 +53,8 @@ public class BaseException extends RuntimeException {
this
.
status
=
code
;
}
// public BaseException(int code, Map<String, Object> map) {
// String msg = ResultCode.getMsg(code);
// if(null != map && map.size() > 0){
// for(String)
//
// }
// this.status = code;
// }
public
BaseException
(
int
code
,
Map
<
String
,
Object
>
map
)
{
super
(
ResultCode
.
getMsg
(
code
)
+
(
map
==
null
?
""
:
map
.
toString
()));
this
.
status
=
code
;
}
}
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/service/OrderRentVehicleService.java
View file @
2da8b4b9
...
...
@@ -6,6 +6,7 @@ import cn.hutool.core.util.StrUtil;
import
com.github.wxiaoqi.security.admin.constant.enumerate.MemberEnum
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.common.constant.CommonConstants
;
import
com.github.wxiaoqi.security.common.context.BaseContextHandler
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
...
...
@@ -251,6 +252,9 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
rentVehicleBookDTO
.
setModelId
(
detail
.
getModelId
());
rentVehicleBookDTO
.
setUserName
(
BaseContextHandler
.
getName
());
ObjectRestResponse
<
VehicleBookRecord
>
orr
=
vehicleFeign
.
rentApplyVehicle
(
rentVehicleBookDTO
);
if
(!
CommonConstants
.
SYS_JSON_TRUE
.
equals
(
orr
.
getStatus
()))
{
throw
new
BaseException
(
orr
.
getMessage
(),
orr
.
getStatus
());
}
detail
.
setVehicleId
(
orr
.
getData
().
getVehicleId
());
detail
.
setBookRecordId
(
orr
.
getData
().
getId
());
}
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/config/BaseExceptionHandler.java
View file @
2da8b4b9
...
...
@@ -5,7 +5,7 @@ import com.xxfc.platform.vehicle.common.RestResponse;
import
org.springframework.web.bind.annotation.ExceptionHandler
;
import
org.springframework.web.bind.annotation.RestControllerAdvice
;
@RestControllerAdvice
//
@RestControllerAdvice
public
class
BaseExceptionHandler
{
@ExceptionHandler
(
BaseException
.
class
)
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/VehicleController.java
View file @
2da8b4b9
...
...
@@ -401,7 +401,9 @@ public class VehicleController extends BaseController<VehicleBiz> {
//查询可车辆信息
PageDataVO
<
Vehicle
>
pageDataVO
=
vehicleBiz
.
searchUsableVehicle
(
dto
);
if
(
pageDataVO
.
getData
().
size
()
<=
0
)
{
throw
new
BaseException
(
ResultCode
.
NOTEXIST_CODE
);
throw
new
BaseException
(
ResultCode
.
NOTEXIST_CODE
,
new
HashMap
<
String
,
Object
>(){{
put
(
"可用车辆"
,
"不存在"
);
}});
}
bookVehicleVo
.
setVehicleId
(
pageDataVO
.
getData
().
get
(
0
).
getId
());
...
...
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