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
967ff1f8
Commit
967ff1f8
authored
Dec 16, 2020
by
季圣华
Browse files
优化用户模块
parent
518831da
Changes
2
Hide whitespace changes
Inline
Side-by-side
erp_web/pages/manage/user.html
View file @
967ff1f8
...
...
@@ -208,14 +208,6 @@
handler
:
function
()
{
addUser
();
}
},
'
-
'
,
{
id
:
'
deleteUser
'
,
text
:
'
删除
'
,
iconCls
:
'
icon-remove
'
,
handler
:
function
()
{
batDeleteUser
();
}
}
],
onLoadError
:
function
()
{
...
...
@@ -300,60 +292,6 @@
});
}
//批量删除用户
function
batDeleteUser
()
{
var
row
=
$
(
'
#tableData
'
).
datagrid
(
'
getChecked
'
);
if
(
row
.
length
==
0
)
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
没有记录被选中!
'
,
'
info
'
);
return
;
}
if
(
row
.
length
>
0
)
{
$
.
messager
.
confirm
(
'
删除确认
'
,
'
确定要删除选中的
'
+
row
.
length
+
'
条用户信息吗?
'
,
function
(
r
)
{
if
(
r
)
{
var
ids
=
""
;
for
(
var
i
=
0
;
i
<
row
.
length
;
i
++
)
{
if
(
i
==
row
.
length
-
1
)
{
ids
+=
row
[
i
].
id
;
break
;
}
ids
+=
row
[
i
].
id
+
"
,
"
;
}
if
(
row
[
i
].
loginName
==
"
jsh
"
){
$
.
messager
.
alert
(
'
提示
'
,
'
租户jsh不能删除!
'
,
'
warning
'
);
return
;
}
else
if
(
row
[
i
].
id
==
row
[
i
].
tenantId
)
{
$
.
messager
.
alert
(
'
提示
'
,
'
不能删除自己!
'
,
'
warning
'
);
return
;
}
else
{
$
.
ajax
({
type
:
"
post
"
,
url
:
"
/user/batchDeleteUser
"
,
dataType
:
"
json
"
,
async
:
false
,
data
:
({
ids
:
ids
,
}),
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
!=
200
)
{
$
.
messager
.
alert
(
'
提示
'
,
res
.
msg
,
'
error
'
);
return
;
}
$
.
messager
.
alert
(
'
提示
'
,
res
.
msg
,
'
info
'
);
$
(
"
#searchBtn
"
).
click
();
$
(
"
:checkbox
"
).
attr
(
"
checked
"
,
false
);
},
//此处添加错误处理
error
:
function
()
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除用户信息异常,请稍后再试!
'
,
'
error
'
);
return
;
}
});
}
}
});
}
}
//增加用户
var
url
;
var
userID
=
0
;
...
...
src/main/resources/mapper_xml/UserMapperEx.xml
View file @
967ff1f8
...
...
@@ -10,15 +10,12 @@
</resultMap>
<select
id=
"selectByConditionUser"
parameterType=
"com.jsh.erp.datasource.entities.UserExample"
resultMap=
"ResultMapEx"
>
select user.id, user.username, user.login_name, user.position, user.email, user.phonenum,
user.description, user.remark,user.isystem,org.id as orgaId,user.tenant_id,org.org_abr,rel.user_blng_orga_dspl_seq,
rel.id as orgaUserRelId, tb.roleName
FROM jsh_user user
left join
(
select ub.*,r.name roleName from jsh_user_business ub
user.description, user.remark,user.isystem,org.id as orgaId,user.tenant_id,org.org_abr,
rel.user_blng_orga_dspl_seq,rel.id as orgaUserRelId,
(select r.name from jsh_user_business ub
inner join jsh_role r on ub.value=concat("[",r.id,"]") and ifnull(r.delete_flag,'0') !='1'
where ub.type='UserRole'
) tb on tb.key_id=
user
.id
where ub.type='UserRole'
and ub.key_id=user.id) roleName
FROM jsh_user
user
left join jsh_orga_user_rel rel on user.id=rel.user_id and ifnull(rel.delete_flag,'0') !='1'
left join jsh_organization org on rel.orga_id=org.id and ifnull(org.org_stcd,'0') !='5'
where 1=1
...
...
@@ -38,12 +35,10 @@
select count(user.id)
FROM jsh_user user
left join jsh_user_business ub on user.id=ub.key_id
left join jsh_role r on ub.value=concat("[",r.id,"]") and ifnull(r.delete_flag,'0') !='1'
left join jsh_orga_user_rel rel on user.id=rel.user_id and ifnull(rel.delete_flag,'0') !='1'
left join jsh_organization org on rel.orga_id=org.id and ifnull(org.org_stcd,'0') !='5'
where 1=1
and ifnull(user.status,'0') not in('1','2')
and ub.type='UserRole'
<if
test=
"userName != null"
>
and user.username like '%${userName}%'
</if>
...
...
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