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
9f713476
Commit
9f713476
authored
Sep 07, 2020
by
季圣华
Browse files
优化角色模块
parent
fe99c356
Changes
5
Hide whitespace changes
Inline
Side-by-side
docs/jsh_erp.sql
View file @
9f713476
...
...
@@ -717,7 +717,7 @@ INSERT INTO `jsh_role` VALUES ('4', '管理员', '全部数据', null, null, nul
INSERT
INTO
`jsh_role`
VALUES
(
'10'
,
'租户'
,
'全部数据'
,
null
,
''
,
null
,
'0'
);
INSERT
INTO
`jsh_role`
VALUES
(
'16'
,
'销售经理'
,
'全部数据'
,
null
,
'ddd'
,
'63'
,
'0'
);
INSERT
INTO
`jsh_role`
VALUES
(
'17'
,
'销售代表'
,
'个人数据'
,
null
,
'rrr'
,
'63'
,
'0'
);
INSERT
INTO
`jsh_role`
VALUES
(
'18'
,
'角色abc'
,
'
自定义
数据'
,
null
,
'33333'
,
'63'
,
'0'
);
INSERT
INTO
`jsh_role`
VALUES
(
'18'
,
'角色abc'
,
'
本机构
数据'
,
null
,
'33333'
,
'63'
,
'0'
);
-- ----------------------------
-- Table structure for jsh_sequence
...
...
erp_web/pages/manage/role.html
View file @
9f713476
...
...
@@ -58,7 +58,6 @@
<option
value=
"全部数据"
>
全部数据
</option>
<option
value=
"本机构数据"
>
本机构数据
</option>
<option
value=
"个人数据"
>
个人数据
</option>
<option
value=
"自定义数据"
>
自定义数据
</option>
</select>
</td>
</tr>
...
...
erp_web/pages/manage/rolePushBtn.html
View file @
9f713476
...
...
@@ -22,6 +22,7 @@
<a
id=
"btnAllCheck"
class=
"easyui-linkbutton"
>
全选
</a>
<a
id=
"btnAllCancel"
class=
"easyui-linkbutton"
>
全取消
</a>
<a
id=
"btnOK"
class=
"easyui-linkbutton"
iconCls=
"icon-ok"
>
保存
</a>
<span>
只有勾选了
<b>
编辑
</b>
按钮,才能进行新增、修改、删除操作
</span>
</div>
<div
id=
"pushList"
>
<!-- 数据显示table -->
...
...
src/main/java/com/jsh/erp/constants/BusinessConstants.java
View file @
9f713476
...
...
@@ -165,6 +165,10 @@ public class BusinessConstants {
*/
public
static
final
String
DEFAULT_MANAGER
=
"admin"
;
public
static
final
String
ROLE_TYPE_PRIVATE
=
"个人数据"
;
public
static
final
String
ROLE_TYPE_THIS_ORG
=
"本机构数据"
;
...
...
src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java
View file @
9f713476
...
...
@@ -84,17 +84,7 @@ public class DepotHeadService {
public
List
<
DepotHeadVo4List
>
select
(
String
type
,
String
subType
,
String
roleType
,
String
number
,
String
beginTime
,
String
endTime
,
String
materialParam
,
String
depotIds
,
int
offset
,
int
rows
)
throws
Exception
{
String
handsPersonIds
=
""
;
User
user
=
userService
.
getCurrentUser
();
if
(
"个人数据"
.
equals
(
roleType
))
{
handsPersonIds
=
user
.
getId
().
toString
();
}
else
if
(
"本机构数据"
.
equals
(
roleType
))
{
handsPersonIds
=
orgaUserRelService
.
getUserIdListByUserId
(
user
.
getId
());
}
String
[]
handsPersonIdArray
=
null
;
if
(
StringUtil
.
isNotEmpty
(
handsPersonIds
)){
handsPersonIdArray
=
handsPersonIds
.
split
(
","
);
}
String
[]
handsPersonIdArray
=
getHandsPersonIdArray
(
roleType
);
List
<
DepotHeadVo4List
>
resList
=
new
ArrayList
<
DepotHeadVo4List
>();
List
<
DepotHeadVo4List
>
list
=
null
;
try
{
...
...
@@ -134,24 +124,35 @@ public class DepotHeadService {
public
Long
countDepotHead
(
String
type
,
String
subType
,
String
roleType
,
String
number
,
String
beginTime
,
String
endTime
,
String
materialParam
,
String
depotIds
)
throws
Exception
{
String
[]
handsPersonIdArray
=
getHandsPersonIdArray
(
roleType
);
Long
result
=
null
;
try
{
result
=
depotHeadMapperEx
.
countsByDepotHead
(
type
,
subType
,
handsPersonIdArray
,
number
,
beginTime
,
endTime
,
materialParam
,
depotIds
);
}
catch
(
Exception
e
){
JshException
.
readFail
(
logger
,
e
);
}
return
result
;
}
/**
* 根据角色类型获取经手人数组
* @param roleType
* @return
* @throws Exception
*/
private
String
[]
getHandsPersonIdArray
(
String
roleType
)
throws
Exception
{
String
handsPersonIds
=
""
;
User
user
=
userService
.
getCurrentUser
();
if
(
"个人数据"
.
equals
(
roleType
))
{
if
(
BusinessConstants
.
ROLE_TYPE_PRIVATE
.
equals
(
roleType
))
{
handsPersonIds
=
user
.
getId
().
toString
();
}
else
if
(
"本机构数据"
.
equals
(
roleType
))
{
}
else
if
(
BusinessConstants
.
ROLE_TYPE_THIS_ORG
.
equals
(
roleType
))
{
handsPersonIds
=
orgaUserRelService
.
getUserIdListByUserId
(
user
.
getId
());
}
String
[]
handsPersonIdArray
=
null
;
if
(
StringUtil
.
isNotEmpty
(
handsPersonIds
)){
handsPersonIdArray
=
handsPersonIds
.
split
(
","
);
}
Long
result
=
null
;
try
{
result
=
depotHeadMapperEx
.
countsByDepotHead
(
type
,
subType
,
handsPersonIdArray
,
number
,
beginTime
,
endTime
,
materialParam
,
depotIds
);
}
catch
(
Exception
e
){
JshException
.
readFail
(
logger
,
e
);
}
return
result
;
return
handsPersonIdArray
;
}
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
...
...
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