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
a13fcfcd
Commit
a13fcfcd
authored
Jun 18, 2021
by
季圣华
Browse files
优化演示用户的删除逻辑
parent
bcd07444
Changes
2
Show whitespace changes
Inline
Side-by-side
jshERP-boot/src/main/java/com/jsh/erp/constants/ExceptionConstants.java
View file @
a13fcfcd
...
@@ -72,10 +72,10 @@ public class ExceptionConstants {
...
@@ -72,10 +72,10 @@ public class ExceptionConstants {
public
static
final
String
USER_NAME_LIMIT_USE_MSG
=
"此用户名限制使用"
;
public
static
final
String
USER_NAME_LIMIT_USE_MSG
=
"此用户名限制使用"
;
//演示用户不允许删除
//演示用户不允许删除
public
static
final
int
USER_LIMIT_DELETE_CODE
=
500006
;
public
static
final
int
USER_LIMIT_DELETE_CODE
=
500006
;
public
static
final
String
USER_LIMIT_DELETE_MSG
=
"抱歉,演示用户不允许删除"
;
public
static
final
String
USER_LIMIT_DELETE_MSG
=
"抱歉,演示
模式下的演示
用户不允许删除"
;
//演示用户不允许修改
//演示用户不允许修改
public
static
final
int
USER_LIMIT_UPDATE_CODE
=
500007
;
public
static
final
int
USER_LIMIT_UPDATE_CODE
=
500007
;
public
static
final
String
USER_LIMIT_UPDATE_MSG
=
"抱歉,演示用户不允许修改"
;
public
static
final
String
USER_LIMIT_UPDATE_MSG
=
"抱歉,演示
模式下的演示
用户不允许修改"
;
/**
/**
* 角色信息
* 角色信息
...
...
jshERP-boot/src/main/java/com/jsh/erp/service/user/UserService.java
View file @
a13fcfcd
...
@@ -257,7 +257,7 @@ public class UserService {
...
@@ -257,7 +257,7 @@ public class UserService {
sb
.
append
(
BusinessConstants
.
LOG_OPERATION_TYPE_DELETE
);
sb
.
append
(
BusinessConstants
.
LOG_OPERATION_TYPE_DELETE
);
List
<
User
>
list
=
getUserListByIds
(
ids
);
List
<
User
>
list
=
getUserListByIds
(
ids
);
for
(
User
user:
list
){
for
(
User
user:
list
){
if
(
user
.
getLoginName
().
equals
(
TEST_USER
)){
if
(
demonstrateOpen
&&
user
.
getLoginName
().
equals
(
TEST_USER
)){
logger
.
error
(
"异常码[{}],异常提示[{}],参数,ids:[{}]"
,
logger
.
error
(
"异常码[{}],异常提示[{}],参数,ids:[{}]"
,
ExceptionConstants
.
USER_LIMIT_DELETE_CODE
,
ExceptionConstants
.
USER_LIMIT_DELETE_MSG
,
ids
);
ExceptionConstants
.
USER_LIMIT_DELETE_CODE
,
ExceptionConstants
.
USER_LIMIT_DELETE_MSG
,
ids
);
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
USER_LIMIT_DELETE_CODE
,
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
USER_LIMIT_DELETE_CODE
,
...
@@ -539,7 +539,7 @@ public class UserService {
...
@@ -539,7 +539,7 @@ public class UserService {
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
USER_NAME_LIMIT_USE_CODE
,
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
USER_NAME_LIMIT_USE_CODE
,
ExceptionConstants
.
USER_NAME_LIMIT_USE_MSG
);
ExceptionConstants
.
USER_NAME_LIMIT_USE_MSG
);
}
else
{
}
else
{
if
(
ue
.
getLoginName
().
equals
(
TEST_USER
)){
if
(
demonstrateOpen
&&
ue
.
getLoginName
().
equals
(
TEST_USER
)){
logger
.
error
(
"异常码[{}],异常提示[{}],参数,obj:[{}]"
,
logger
.
error
(
"异常码[{}],异常提示[{}],参数,obj:[{}]"
,
ExceptionConstants
.
USER_LIMIT_UPDATE_CODE
,
ExceptionConstants
.
USER_LIMIT_UPDATE_MSG
,
TEST_USER
);
ExceptionConstants
.
USER_LIMIT_UPDATE_CODE
,
ExceptionConstants
.
USER_LIMIT_UPDATE_MSG
,
TEST_USER
);
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
USER_LIMIT_UPDATE_CODE
,
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
USER_LIMIT_UPDATE_CODE
,
...
...
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