Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
JSH ERP
Commits
8c54806e
Commit
8c54806e
authored
Dec 14, 2021
by
季圣华
Browse files
增加全部设置未已读的功能的接口
parent
b3191480
Changes
2
Hide whitespace changes
Inline
Side-by-side
jshERP-boot/src/main/java/com/jsh/erp/controller/MsgController.java
View file @
8c54806e
...
...
@@ -130,4 +130,26 @@ public class MsgController {
}
return
res
;
}
/**
* 全部设置未已读
* @param request
* @return
* @throws Exception
*/
@PostMapping
(
"/readAllMsg"
)
@ApiOperation
(
value
=
"全部设置未已读"
)
public
BaseResponseInfo
readAllMsg
(
HttpServletRequest
request
)
throws
Exception
{
BaseResponseInfo
res
=
new
BaseResponseInfo
();
try
{
msgService
.
readAllMsg
();
res
.
code
=
200
;
res
.
data
=
"操作成功!"
;
}
catch
(
Exception
e
){
e
.
printStackTrace
();
res
.
code
=
500
;
res
.
data
=
"获取数据失败"
;
}
return
res
;
}
}
jshERP-boot/src/main/java/com/jsh/erp/service/msg/MsgService.java
View file @
8c54806e
...
...
@@ -298,4 +298,23 @@ public class MsgService {
}
return
msgCount
;
}
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
void
readAllMsg
()
throws
Exception
{
try
{
User
userInfo
=
userService
.
getCurrentUser
();
if
(!
BusinessConstants
.
DEFAULT_MANAGER
.
equals
(
userInfo
.
getLoginName
()))
{
Msg
msg
=
new
Msg
();
msg
.
setStatus
(
"2"
);
MsgExample
example
=
new
MsgExample
();
example
.
createCriteria
();
msgMapper
.
updateByExampleSelective
(
msg
,
example
);
}
}
catch
(
Exception
e
){
logger
.
error
(
"异常码[{}],异常提示[{}],异常[{}]"
,
ExceptionConstants
.
DATA_WRITE_FAIL_CODE
,
ExceptionConstants
.
DATA_WRITE_FAIL_MSG
,
e
);
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
DATA_WRITE_FAIL_CODE
,
ExceptionConstants
.
DATA_WRITE_FAIL_MSG
);
}
}
}
Write
Preview
Supports
Markdown
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