Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-standard-interfaces
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
1
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 490f0aad
authored
Feb 21, 2022
by
levphon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
工单标准接口-提示语优化
1 parent
df0e64ea
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
3 deletions
src/main/java/cn/com/glsx/stdinterface/common/exception/StdInterfaceException.java
src/main/java/cn/com/glsx/stdinterface/common/exception/StdInterfaceExceptionHandler.java
src/main/java/cn/com/glsx/stdinterface/modules/service/WorkOrderService.java
src/main/java/cn/com/glsx/stdinterface/common/exception/StdInterfaceException.java
View file @
490f0aa
...
@@ -15,6 +15,8 @@ public class StdInterfaceException extends RuntimeException {
...
@@ -15,6 +15,8 @@ public class StdInterfaceException extends RuntimeException {
private
String
message
;
private
String
message
;
private
Object
data
;
public
StdInterfaceException
()
{
public
StdInterfaceException
()
{
}
}
...
@@ -24,6 +26,13 @@ public class StdInterfaceException extends RuntimeException {
...
@@ -24,6 +26,13 @@ public class StdInterfaceException extends RuntimeException {
this
.
message
=
message
;
this
.
message
=
message
;
}
}
public
StdInterfaceException
(
String
errorCode
,
String
message
,
Object
data
)
{
super
(
message
);
this
.
errorCode
=
errorCode
;
this
.
message
=
message
;
this
.
data
=
data
;
}
public
StdInterfaceException
(
ResultEnum
resultEnum
)
{
public
StdInterfaceException
(
ResultEnum
resultEnum
)
{
this
.
errorCode
=
resultEnum
.
getCode
();
this
.
errorCode
=
resultEnum
.
getCode
();
this
.
message
=
resultEnum
.
getMessage
();
this
.
message
=
resultEnum
.
getMessage
();
...
...
src/main/java/cn/com/glsx/stdinterface/common/exception/StdInterfaceExceptionHandler.java
View file @
490f0aa
...
@@ -20,7 +20,7 @@ public class StdInterfaceExceptionHandler extends GlobalExceptionHandler {
...
@@ -20,7 +20,7 @@ public class StdInterfaceExceptionHandler extends GlobalExceptionHandler {
@ExceptionHandler
(
StdInterfaceException
.
class
)
@ExceptionHandler
(
StdInterfaceException
.
class
)
public
R
handleAdminException
(
StdInterfaceException
e
)
{
public
R
handleAdminException
(
StdInterfaceException
e
)
{
return
R
.
error
(
e
.
getErrorCode
(),
e
.
getMessage
());
return
R
.
error
(
e
.
getErrorCode
(),
e
.
getMessage
())
.
data
(
e
.
getData
())
;
}
}
/**
/**
...
...
src/main/java/cn/com/glsx/stdinterface/modules/service/WorkOrderService.java
View file @
490f0aa
...
@@ -642,7 +642,9 @@ public class WorkOrderService {
...
@@ -642,7 +642,9 @@ public class WorkOrderService {
}.
getType
());
}.
getType
());
gpsBsDataList
.
forEach
(
gdb
->
{
gpsBsDataList
.
forEach
(
gdb
->
{
if
(!
gdb
.
getGpsVerifyResult
()
&&
!
gdb
.
getBsVerifyResult
())
{
if
(!
gdb
.
getGpsVerifyResult
()
&&
!
gdb
.
getBsVerifyResult
())
{
throw
new
StdInterfaceException
(
"2145415"
,
String
.
format
(
"%s设备有效位置验证不通过"
,
gdb
.
getSn
()));
Map
<
String
,
String
>
errorMap
=
Maps
.
newHashMap
();
errorMap
.
put
(
gdb
.
getSn
(),
"设备有效位置验证不通过"
);
throw
new
StdInterfaceException
(
"2145415"
,
String
.
format
(
"设备%s有效位置验证不通过"
,
gdb
.
getSn
()),
Lists
.
newArrayList
(
errorMap
));
}
}
});
});
return
gpsBsDataList
;
return
gpsBsDataList
;
...
@@ -687,7 +689,13 @@ public class WorkOrderService {
...
@@ -687,7 +689,13 @@ public class WorkOrderService {
Set
<
String
>
existSnSet
=
vdList
.
stream
().
map
(
VehicleDevice:
:
getSn
).
collect
(
Collectors
.
toSet
());
Set
<
String
>
existSnSet
=
vdList
.
stream
().
map
(
VehicleDevice:
:
getSn
).
collect
(
Collectors
.
toSet
());
if
(
vdList
.
size
()
>
0
)
{
if
(
vdList
.
size
()
>
0
)
{
throw
new
StdInterfaceException
(
"656565"
,
String
.
format
(
"设备%s已绑定车辆,请更换设备"
,
existSnSet
));
List
<
Map
<
String
,
String
>>
errorMapList
=
Lists
.
newArrayList
();
vdList
.
forEach
(
vd
->
{
Map
<
String
,
String
>
errorMap
=
Maps
.
newHashMap
();
errorMap
.
put
(
vd
.
getSn
(),
"设备已绑定其它车辆"
);
errorMapList
.
add
(
errorMap
);
});
throw
new
StdInterfaceException
(
"656565"
,
String
.
format
(
"设备%s已绑定车辆,请更换设备"
,
existSnSet
),
errorMapList
);
}
}
}
}
...
@@ -793,6 +801,8 @@ public class WorkOrderService {
...
@@ -793,6 +801,8 @@ public class WorkOrderService {
}
}
activatedVehicleInfoDTO
.
setActivatedTime
(
new
Date
());
activatedVehicleInfoDTO
.
setActivatedTime
(
new
Date
());
activatedVehicleInfoDTO
.
setBindingDevices
(
bindingDevices
);
activatedVehicleInfoDTO
.
setBindingDevices
(
bindingDevices
);
log
.
info
(
"激活工单概要信息:{}"
,
JSONUtil
.
toJsonStr
(
activatedVehicleInfoDTO
));
return
activatedVehicleInfoDTO
;
return
activatedVehicleInfoDTO
;
}
}
...
...
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