Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
slm-bi
Project
Project
Details
Activity
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
林锐标
slm-bi
Commits
e6517afa
Commit
e6517afa
authored
May 08, 2021
by
梁光意
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改获取仪表盘列表接口的问题
parent
39870a2e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
7 deletions
+28
-7
SysExceptionHandler.java
...n/java/com/syc/slm/slmbi/handler/SysExceptionHandler.java
+22
-6
InstrumentPanelMapper.xml
...in/resources/mapper/mysql/panel/InstrumentPanelMapper.xml
+6
-1
No files found.
src/main/java/com/syc/slm/slmbi/handler/SysExceptionHandler.java
View file @
e6517afa
...
...
@@ -4,10 +4,9 @@ import com.syc.slm.common.core.util.R;
import
com.syc.slm.slmbi.exception.SysException
;
import
lombok.extern.slf4j.Slf4j
;
import
org.mybatis.spring.MyBatisSystemException
;
import
org.springframework.
web.bind.annotation.ControllerAdvice
;
import
org.springframework.
validation.BindException
;
import
org.springframework.web.bind.annotation.ExceptionHandler
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestControllerAdvice
;
import
javax.servlet.http.HttpServletRequest
;
/**
...
...
@@ -16,7 +15,7 @@ import javax.servlet.http.HttpServletRequest;
* @author : lin
* @date : 2021-04-16 17:34
**/
@ControllerAdvice
@
Rest
ControllerAdvice
@Slf4j
public
class
SysExceptionHandler
{
...
...
@@ -27,7 +26,6 @@ public class SysExceptionHandler {
* @return exception
*/
@ExceptionHandler
(
SysException
.
class
)
@ResponseBody
public
R
<
Object
>
handleSysException
(
SysException
e
,
HttpServletRequest
request
)
{
log
.
info
(
e
.
getMsg
());
return
R
.
bad
(
e
.
getMsg
(),
e
.
getDebugMsg
());
...
...
@@ -39,10 +37,28 @@ public class SysExceptionHandler {
* @return
*/
@ExceptionHandler
(
MyBatisSystemException
.
class
)
@ResponseBody
public
R
<
Object
>
handleMyBatisSystemException
(
MyBatisSystemException
e
)
{
log
.
info
(
e
.
getMessage
());
return
R
.
bad
(
e
.
getCause
().
getCause
().
getMessage
(),
e
.
getMessage
());
}
/**
* 时间格式抛出的异常
* @param e
* @return
*/
@ExceptionHandler
(
BindException
.
class
)
public
R
<
Object
>
handleBindException
(
BindException
e
)
{
String
message
=
e
.
getMessage
();
log
.
info
(
message
);
if
(
message
.
contains
(
"DateTimeFormat"
)){
return
R
.
bad
(
"时间格式错误"
,
null
);
}
else
{
return
R
.
bad
(
"请按照提示填写格式"
,
null
);
}
}
}
src/main/resources/mapper/mysql/panel/InstrumentPanelMapper.xml
View file @
e6517afa
...
...
@@ -38,9 +38,14 @@
p.group_id,
g.name group_name,
if(p.published='published','已发布','未发布') published,
p.creator,
p.creator_name,
p.create_time,
p.updater,
p.updater_name,
p.update_time
p.update_time,
p.app_id,
p.description
from instrument_panel p
join instrument_panel_group g on p.group_id =g.id
${ew.customSqlSegment}
...
...
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