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
76f3ac76
"jetbrains:/idea/checkout/git" did not exist on "5e95ae5bf1e0f854a55456c1b45b28d0edec66e7"
Commit
76f3ac76
authored
Dec 17, 2021
by
季圣华
Browse files
禁止超管读取消息
parent
e0480755
Changes
1
Show whitespace changes
Inline
Side-by-side
jshERP-boot/src/main/java/com/jsh/erp/service/msg/MsgService.java
View file @
76f3ac76
...
...
@@ -80,14 +80,17 @@ public class MsgService {
public
List
<
MsgEx
>
select
(
String
name
,
int
offset
,
int
rows
)
throws
Exception
{
List
<
MsgEx
>
list
=
null
;
try
{
User
userInfo
=
userService
.
getCurrentUser
();
if
(!
BusinessConstants
.
DEFAULT_MANAGER
.
equals
(
userInfo
.
getLoginName
()))
{
list
=
msgMapperEx
.
selectByConditionMsg
(
name
,
offset
,
rows
);
if
(
null
!=
list
)
{
for
(
MsgEx
msgEx
:
list
)
{
if
(
msgEx
.
getCreateTime
()
!=
null
)
{
if
(
msgEx
.
getCreateTime
()
!=
null
)
{
msgEx
.
setCreateTimeStr
(
getCenternTime
(
msgEx
.
getCreateTime
()));
}
}
}
}
}
catch
(
Exception
e
){
logger
.
error
(
"异常码[{}],异常提示[{}],异常[{}]"
,
ExceptionConstants
.
DATA_READ_FAIL_CODE
,
ExceptionConstants
.
DATA_READ_FAIL_MSG
,
e
);
...
...
@@ -100,7 +103,10 @@ public class MsgService {
public
Long
countMsg
(
String
name
)
throws
Exception
{
Long
result
=
null
;
try
{
result
=
msgMapperEx
.
countsByMsg
(
name
);
User
userInfo
=
userService
.
getCurrentUser
();
if
(!
BusinessConstants
.
DEFAULT_MANAGER
.
equals
(
userInfo
.
getLoginName
()))
{
result
=
msgMapperEx
.
countsByMsg
(
name
);
}
}
catch
(
Exception
e
){
logger
.
error
(
"异常码[{}],异常提示[{}],异常[{}]"
,
ExceptionConstants
.
DATA_READ_FAIL_CODE
,
ExceptionConstants
.
DATA_READ_FAIL_MSG
,
e
);
...
...
@@ -226,12 +232,14 @@ public class MsgService {
public
List
<
MsgEx
>
getMsgByStatus
(
String
status
)
throws
Exception
{
List
<
MsgEx
>
resList
=
new
ArrayList
<>();
try
{
User
userInfo
=
userService
.
getCurrentUser
();
if
(!
BusinessConstants
.
DEFAULT_MANAGER
.
equals
(
userInfo
.
getLoginName
()))
{
MsgExample
example
=
new
MsgExample
();
example
.
createCriteria
().
andStatusEqualTo
(
status
).
andDeleteFlagNotEqualTo
(
BusinessConstants
.
DELETE_FLAG_DELETED
);
List
<
Msg
>
list
=
msgMapper
.
selectByExample
(
example
);
if
(
null
!=
list
)
{
for
(
Msg
msg
:
list
)
{
if
(
msg
.
getCreateTime
()
!=
null
)
{
if
(
msg
.
getCreateTime
()
!=
null
)
{
MsgEx
msgEx
=
new
MsgEx
();
msgEx
.
setId
(
msg
.
getId
());
msgEx
.
setMsgTitle
(
msg
.
getMsgTitle
());
...
...
@@ -243,6 +251,7 @@ public class MsgService {
}
}
}
}
}
catch
(
Exception
e
){
logger
.
error
(
"异常码[{}],异常提示[{}],异常[{}]"
,
ExceptionConstants
.
DATA_READ_FAIL_CODE
,
ExceptionConstants
.
DATA_READ_FAIL_MSG
,
e
);
...
...
@@ -273,7 +282,9 @@ public class MsgService {
Long
result
=
null
;
try
{
User
userInfo
=
userService
.
getCurrentUser
();
result
=
msgMapperEx
.
getMsgCountByStatus
(
status
,
userInfo
.
getId
());
if
(!
BusinessConstants
.
DEFAULT_MANAGER
.
equals
(
userInfo
.
getLoginName
()))
{
result
=
msgMapperEx
.
getMsgCountByStatus
(
status
,
userInfo
.
getId
());
}
}
catch
(
Exception
e
){
logger
.
error
(
"异常码[{}],异常提示[{}],异常[{}]"
,
ExceptionConstants
.
DATA_READ_FAIL_CODE
,
ExceptionConstants
.
DATA_READ_FAIL_MSG
,
e
);
...
...
@@ -286,10 +297,13 @@ public class MsgService {
public
Integer
getMsgCountByType
(
String
type
)
throws
Exception
{
int
msgCount
=
0
;
try
{
User
userInfo
=
userService
.
getCurrentUser
();
if
(!
BusinessConstants
.
DEFAULT_MANAGER
.
equals
(
userInfo
.
getLoginName
()))
{
MsgExample
example
=
new
MsgExample
();
example
.
createCriteria
().
andTypeEqualTo
(
type
).
andDeleteFlagNotEqualTo
(
BusinessConstants
.
DELETE_FLAG_DELETED
);
List
<
Msg
>
list
=
msgMapper
.
selectByExample
(
example
);
msgCount
=
list
.
size
();
}
}
catch
(
Exception
e
){
logger
.
error
(
"异常码[{}],异常提示[{}],异常[{}]"
,
ExceptionConstants
.
DATA_READ_FAIL_CODE
,
ExceptionConstants
.
DATA_READ_FAIL_MSG
,
e
);
...
...
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