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
c7180a0d
"...java/me/zhengjie/git@ustchcs.com:gujinli1118/eladmin.git" did not exist on "a0b6e85ee5d402d3378e8425ed4f1aca50a3db6a"
Commit
c7180a0d
authored
Sep 04, 2020
by
季圣华
Browse files
优化角色和按钮权限
parent
92a4a79f
Changes
14
Expand all
Hide whitespace changes
Inline
Side-by-side
docs/jsh_erp.sql
View file @
c7180a0d
This diff is collapsed.
Click to expand it.
erp_web/js/pages/manage/pushBtn.json
View file @
c7180a0d
[
[
{
{
"id"
:
1
,
"id"
:
1
,
"text"
:
"
导入导出
"
"text"
:
"
编辑
"
},
},
{
{
"id"
:
2
,
"id"
:
2
,
"text"
:
"
启用禁用
"
"text"
:
"
审核反审核
"
},
},
{
{
"id"
:
3
,
"id"
:
3
,
"text"
:
"
审核反审核
"
"text"
:
"
导入导出
"
},
},
{
{
"id"
:
4
,
"id"
:
4
,
"text"
:
"
打印
"
"text"
:
"
启用禁用
"
},
},
{
{
"id"
:
5
,
"id"
:
5
,
"text"
:
"打印"
},
{
"id"
:
6
,
"text"
:
"作废"
"text"
:
"作废"
}
}
]
]
\ No newline at end of file
erp_web/js/pages/materials/in_out.js
View file @
c7180a0d
...
@@ -26,9 +26,11 @@
...
@@ -26,9 +26,11 @@
var
btnEnableList
=
getBtnStr
();
//获取按钮的权限
var
btnEnableList
=
getBtnStr
();
//获取按钮的权限
var
mPropertyList
=
""
;
//商品属性列表
var
mPropertyList
=
""
;
//商品属性列表
var
defaultAccountId
=
0
;
//默认账户id
var
defaultAccountId
=
0
;
//默认账户id
var
roleType
=
""
;
//角色类型
$
(
function
(){
$
(
function
(){
//初始化系统基础信息
//初始化系统基础信息
getType
();
getType
();
getRoleType
();
initSystemData_UB
();
initSystemData_UB
();
initSystemData_depot
();
initSystemData_depot
();
initSystemData_account
();
initSystemData_account
();
...
@@ -142,6 +144,21 @@
...
@@ -142,6 +144,21 @@
amountNum
=
"
CXD
"
;
amountNum
=
"
CXD
"
;
}
}
}
}
function
getRoleType
(){
$
.
ajax
({
type
:
"
get
"
,
url
:
"
/user/getRoleTypeByUserId
"
,
async
:
false
,
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
)
{
roleType
=
res
.
data
.
roleType
;
}
else
{
roleType
=
null
;
}
}
});
}
//初始化系统基础信息
//初始化系统基础信息
function
initSystemData_UB
(){
function
initSystemData_UB
(){
$
.
ajax
({
$
.
ajax
({
...
@@ -360,8 +377,8 @@
...
@@ -360,8 +377,8 @@
}
}
}
}
];
];
//如果允许的按钮列表中存在就显示,
3
-代表审核|反审核的权限
//如果允许的按钮列表中存在就显示,
2
-代表审核|反审核的权限
if
(
btnEnableList
&&
btnEnableList
.
indexOf
(
3
)
>-
1
&&
listTitle
.
indexOf
(
"
订单
"
)
>-
1
){
if
(
btnEnableList
&&
btnEnableList
.
indexOf
(
2
)
>-
1
&&
listTitle
.
indexOf
(
"
订单
"
)
>-
1
){
isHiddenStatus
=
false
;
//显示
isHiddenStatus
=
false
;
//显示
tableToolBar
.
push
({
tableToolBar
.
push
({
id
:
'
okDepotHead
'
,
id
:
'
okDepotHead
'
,
...
@@ -2214,6 +2231,7 @@
...
@@ -2214,6 +2231,7 @@
search
:
JSON
.
stringify
({
search
:
JSON
.
stringify
({
type
:
listType
,
type
:
listType
,
subType
:
listSubType
,
subType
:
listSubType
,
roleType
:
roleType
,
state
:
$
.
trim
(
$
(
"
#searchState
"
).
val
()),
state
:
$
.
trim
(
$
(
"
#searchState
"
).
val
()),
number
:
$
.
trim
(
$
(
"
#searchNumber
"
).
val
()),
number
:
$
.
trim
(
$
(
"
#searchNumber
"
).
val
()),
beginTime
:
beginTime
,
beginTime
:
beginTime
,
...
...
erp_web/pages/manage/functions.html
View file @
c7180a0d
...
@@ -245,7 +245,7 @@
...
@@ -245,7 +245,7 @@
url
:
url
,
url
:
url
,
valueField
:
'
id
'
,
valueField
:
'
id
'
,
textField
:
'
text
'
,
textField
:
'
text
'
,
panelHeight
:
1
2
0
,
panelHeight
:
1
6
0
,
multiple
:
true
,
multiple
:
true
,
method
:
'
get
'
method
:
'
get
'
});
});
...
...
erp_web/pages/manage/role.html
View file @
c7180a0d
...
@@ -31,8 +31,8 @@
...
@@ -31,8 +31,8 @@
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<a
href=
"javascript:void(0)"
class=
"easyui-linkbutton"
iconCls=
"icon-search"
id=
"searchBtn"
>
查询
</a>
<a
href=
"javascript:void(0)"
class=
"easyui-linkbutton"
iconCls=
"icon-search"
id=
"searchBtn"
>
查询
</a>
<a
href=
"javascript:void(0)"
class=
"easyui-linkbutton"
iconCls=
"icon-redo"
id=
"searchResetBtn"
>
重置
</a>
<a
href=
"javascript:void(0)"
class=
"easyui-linkbutton"
iconCls=
"icon-redo"
id=
"searchResetBtn"
>
重置
</a>
<a
id=
"btnSetFunctions"
class=
'easyui-linkbutton iframe iframe_LargeForm'
href=
'#'
title=
'分配功能'
>
分配功能
</a>
<a
id=
"btnSetFunctions"
class=
'easyui-linkbutton iframe iframe_LargeForm'
href=
'#'
title=
'分配功能'
>
分配功能
</a>
<a
id=
"btnSetPushBtn"
class=
'easyui-linkbutton iframe iframe_LargeForm'
href=
'#'
title=
'分配按钮'
>
分配按钮
</a>
<a
id=
"btnSetPushBtn"
class=
'easyui-linkbutton iframe iframe_LargeForm'
href=
'#'
title=
'分配按钮'
>
分配按钮
</a>
</div>
</div>
</div>
</div>
...
@@ -50,6 +50,24 @@
...
@@ -50,6 +50,24 @@
data-options=
"required:true,validType:'length[2,30]'"
style=
"width: 230px;"
/>
data-options=
"required:true,validType:'length[2,30]'"
style=
"width: 230px;"
/>
</td>
</td>
</tr>
</tr>
<tr>
<td>
数据类型
</td>
<td
style=
"padding:5px"
>
<select
name=
"type"
id=
"type"
class=
"easyui-combobox"
data-options=
"required:true,panelHeight:'auto'"
style=
"width: 230px;"
>
<option
value=
"全部数据"
>
全部数据
</option>
<option
value=
"本部门数据"
>
本部门数据
</option>
<option
value=
"个人数据"
>
个人数据
</option>
<option
value=
"自定义数据"
>
自定义数据
</option>
</select>
</td>
</tr>
<tr>
<td>
描述
</td>
<td
style=
"padding:5px"
>
<input
name=
"description"
id=
"description"
class=
"easyui-textbox"
data-options=
"multiline:true"
style=
"width: 230px;height: 40px;"
/>
</td>
</tr>
</table>
</table>
</form>
</form>
</div>
</div>
...
@@ -110,7 +128,9 @@
...
@@ -110,7 +128,9 @@
return
str
;
return
str
;
}
}
},
},
{
title
:
'
角色名称
'
,
field
:
'
name
'
,
width
:
200
}
{
title
:
'
角色名称
'
,
field
:
'
name
'
,
width
:
200
},
{
title
:
'
数据类型
'
,
field
:
'
type
'
,
width
:
200
},
{
title
:
'
描述
'
,
field
:
'
description
'
,
width
:
200
}
]],
]],
toolbar
:
[
toolbar
:
[
{
{
...
@@ -147,7 +167,7 @@
...
@@ -147,7 +167,7 @@
//兼容 IE,firefox 兼容
//兼容 IE,firefox 兼容
var
obj
=
e
.
srcElement
?
e
.
srcElement
:
e
.
target
;
var
obj
=
e
.
srcElement
?
e
.
srcElement
:
e
.
target
;
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
if
(
k
==
"
13
"
&&
(
obj
.
id
==
"
name
"
||
obj
.
id
==
"
sort
"
||
obj
.
id
==
"
remark
"
))
{
if
(
k
==
"
13
"
&&
(
obj
.
id
==
"
name
"
||
obj
.
id
==
"
description
"
))
{
$
(
"
#saveRole
"
).
click
();
$
(
"
#saveRole
"
).
click
();
}
}
//搜索按钮添加快捷键
//搜索按钮添加快捷键
...
@@ -258,13 +278,9 @@
...
@@ -258,13 +278,9 @@
var
oldName
=
""
;
var
oldName
=
""
;
function
addRole
()
{
function
addRole
()
{
$
(
"
#sort
"
).
val
(
""
);
$
(
'
#roleFM
'
).
form
(
'
clear
'
);
$
(
"
#remark
"
).
val
(
""
);
$
(
'
#roleDlg
'
).
dialog
(
'
open
'
).
dialog
(
'
setTitle
'
,
'
<img src="/js/easyui/themes/icons/edit_add.png"/> 增加角色信息
'
);
$
(
'
#roleDlg
'
).
dialog
(
'
open
'
).
dialog
(
'
setTitle
'
,
'
<img src="/js/easyui/themes/icons/edit_add.png"/> 增加角色信息
'
);
$
(
"
.window-mask
"
).
css
({
width
:
webW
,
height
:
webH
});
$
(
"
.window-mask
"
).
css
({
width
:
webW
,
height
:
webH
});
$
(
"
#name
"
).
val
(
""
).
focus
();
//$('#roleFM').form('clear');
oldName
=
""
;
oldName
=
""
;
roleID
=
0
;
roleID
=
0
;
url
=
'
/role/add
'
;
url
=
'
/role/add
'
;
...
@@ -305,6 +321,8 @@
...
@@ -305,6 +321,8 @@
function
editRole
(
index
)
{
function
editRole
(
index
)
{
var
rowsdata
=
$
(
"
#tableData
"
).
datagrid
(
"
getRows
"
)[
index
];
var
rowsdata
=
$
(
"
#tableData
"
).
datagrid
(
"
getRows
"
)[
index
];
$
(
"
#name
"
).
textbox
(
"
setValue
"
,
rowsdata
.
name
);
$
(
"
#name
"
).
textbox
(
"
setValue
"
,
rowsdata
.
name
);
$
(
"
#type
"
).
combobox
(
"
setValue
"
,
rowsdata
.
type
);
$
(
"
#description
"
).
textbox
(
"
setValue
"
,
rowsdata
.
description
);
oldName
=
rowsdata
.
name
;
oldName
=
rowsdata
.
name
;
$
(
'
#roleDlg
'
).
dialog
(
'
open
'
).
dialog
(
'
setTitle
'
,
'
<img src="/js/easyui/themes/icons/pencil.png"/> 编辑角色信息
'
);
$
(
'
#roleDlg
'
).
dialog
(
'
open
'
).
dialog
(
'
setTitle
'
,
'
<img src="/js/easyui/themes/icons/pencil.png"/> 编辑角色信息
'
);
$
(
"
.window-mask
"
).
css
({
width
:
webW
,
height
:
webH
});
$
(
"
.window-mask
"
).
css
({
width
:
webW
,
height
:
webH
});
...
...
erp_web/pages/manage/rolePushBtn.html
View file @
c7180a0d
...
@@ -19,6 +19,8 @@
...
@@ -19,6 +19,8 @@
<body>
<body>
<!-- 数据显示table -->
<!-- 数据显示table -->
<div
style=
"padding-bottom: 10px;"
>
<div
style=
"padding-bottom: 10px;"
>
<a
id=
"btnAllCheck"
class=
"easyui-linkbutton"
>
全选
</a>
<a
id=
"btnAllCancel"
class=
"easyui-linkbutton"
>
全取消
</a>
<a
id=
"btnOK"
class=
"easyui-linkbutton"
iconCls=
"icon-ok"
>
保存
</a>
<a
id=
"btnOK"
class=
"easyui-linkbutton"
iconCls=
"icon-ok"
>
保存
</a>
</div>
</div>
<div
id=
"pushList"
>
<div
id=
"pushList"
>
...
@@ -83,7 +85,7 @@
...
@@ -83,7 +85,7 @@
for
(
var
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
for
(
var
j
=
0
;
j
<
pushBtnJSON
.
length
;
j
++
)
{
for
(
var
j
=
0
;
j
<
pushBtnJSON
.
length
;
j
++
)
{
if
(
pushBtnJSON
[
j
].
id
===
arr
[
i
]
-
0
)
{
if
(
pushBtnJSON
[
j
].
id
===
arr
[
i
]
-
0
)
{
str
+=
"
<input type='checkbox' value='
"
+
pushBtnJSON
[
j
].
id
+
"
' />
"
+
pushBtnJSON
[
j
].
text
;
str
+=
"
<input type='checkbox' value='
"
+
pushBtnJSON
[
j
].
id
+
"
' />
"
+
pushBtnJSON
[
j
].
text
+
"
"
;
}
}
}
}
}
}
...
@@ -211,6 +213,40 @@
...
@@ -211,6 +213,40 @@
}
}
$
(
this
).
closest
(
"
.datagrid-row
"
).
find
(
"
[field='Id']
"
).
attr
(
"
data-btn
"
,
checkStr
);
$
(
this
).
closest
(
"
.datagrid-row
"
).
find
(
"
[field='Id']
"
).
attr
(
"
data-btn
"
,
checkStr
);
});
});
//全选
$
(
"
#btnAllCheck
"
).
off
(
"
click
"
).
on
(
"
click
"
,
function
()
{
bindBody
.
find
(
"
.datagrid-row
"
).
each
(
function
()
{
$
(
this
).
find
(
"
[field='PushBtnList']
"
).
find
(
"
input
"
).
each
(
function
()
{
$
(
this
).
prop
(
"
checked
"
,
"
checked
"
);
});
$
(
this
).
find
(
"
[field='PushBtnList']
"
).
find
(
"
input
"
).
each
(
function
()
{
var
checkStr
=
""
;
$
(
this
).
closest
(
"
.datagrid-cell
"
).
find
(
"
input
"
).
each
(
function
()
{
var
thisValue
=
$
(
this
).
val
();
//勾选的值
var
isChecked
=
$
(
this
).
prop
(
"
checked
"
);
if
(
isChecked
)
{
checkStr
=
checkStr
+
thisValue
+
"
,
"
;
}
});
if
(
checkStr
)
{
checkStr
=
checkStr
.
substring
(
0
,
checkStr
.
length
-
1
);
}
$
(
this
).
closest
(
"
.datagrid-row
"
).
find
(
"
[field='Id']
"
).
attr
(
"
data-btn
"
,
checkStr
);
});
});
});
//全取消
$
(
"
#btnAllCancel
"
).
off
(
"
click
"
).
on
(
"
click
"
,
function
()
{
bindBody
.
find
(
"
.datagrid-row
"
).
each
(
function
()
{
$
(
this
).
find
(
"
[field='Id']
"
).
attr
(
"
data-btn
"
,
""
);
$
(
this
).
find
(
"
[field='PushBtnList']
"
).
find
(
"
input
"
).
each
(
function
()
{
$
(
this
).
prop
(
"
checked
"
,
""
);
});
});
});
},
500
);
},
500
);
$
(
"
#btnOK
"
).
off
(
"
click
"
).
on
(
"
click
"
,
function
()
{
$
(
"
#btnOK
"
).
off
(
"
click
"
).
on
(
"
click
"
,
function
()
{
...
...
erp_web/pages/manage/user.html
View file @
c7180a0d
...
@@ -35,9 +35,9 @@
...
@@ -35,9 +35,9 @@
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<a
href=
"javascript:void(0)"
class=
"easyui-linkbutton"
iconCls=
"icon-search"
id=
"searchBtn"
>
查询
</a>
<a
href=
"javascript:void(0)"
class=
"easyui-linkbutton"
iconCls=
"icon-search"
id=
"searchBtn"
>
查询
</a>
<a
href=
"javascript:void(0)"
class=
"easyui-linkbutton"
iconCls=
"icon-redo"
id=
"searchResetBtn"
>
重置
</a>
<a
href=
"javascript:void(0)"
class=
"easyui-linkbutton"
iconCls=
"icon-redo"
id=
"searchResetBtn"
>
重置
</a>
<a
id=
"btnSetRole"
class=
'easyui-linkbutton iframe iframe_LargeForm'
href=
'#'
title=
'分配角色'
>
分配角色
</a>
<a
id=
"btnSetRole"
class=
'easyui-linkbutton iframe iframe_LargeForm'
href=
'#'
title=
'分配角色'
>
分配角色
</a>
<a
id=
"btnSetDepart"
class=
'easyui-linkbutton iframe iframe_LargeForm'
href=
'#'
title=
'分配仓库'
>
分配仓库
</a>
<a
id=
"btnSetDepart"
class=
'easyui-linkbutton iframe iframe_LargeForm'
href=
'#'
title=
'分配仓库'
>
分配仓库
</a>
<a
id=
"btnSetCustomer"
class=
'easyui-linkbutton iframe iframe_LargeForm'
href=
'#'
title=
'分配客户'
>
分配客户
</a>
<a
id=
"btnSetCustomer"
class=
'easyui-linkbutton iframe iframe_LargeForm'
href=
'#'
title=
'分配客户'
>
分配客户
</a>
</div>
</div>
</div>
</div>
...
...
src/main/java/com/jsh/erp/controller/DepotHeadController.java
View file @
c7180a0d
...
@@ -368,7 +368,7 @@ public class DepotHeadController {
...
@@ -368,7 +368,7 @@ public class DepotHeadController {
String
updated
=
body
.
getUpdated
();
String
updated
=
body
.
getUpdated
();
Long
billsNumLimit
=
Long
.
parseLong
(
request
.
getSession
().
getAttribute
(
"billsNumLimit"
).
toString
());
Long
billsNumLimit
=
Long
.
parseLong
(
request
.
getSession
().
getAttribute
(
"billsNumLimit"
).
toString
());
Long
tenantId
=
Long
.
parseLong
(
request
.
getSession
().
getAttribute
(
"tenantId"
).
toString
());
Long
tenantId
=
Long
.
parseLong
(
request
.
getSession
().
getAttribute
(
"tenantId"
).
toString
());
Long
count
=
depotHeadService
.
countDepotHead
(
null
,
null
,
null
,
null
,
null
,
null
,
null
);
Long
count
=
depotHeadService
.
countDepotHead
(
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
);
if
(
count
>=
billsNumLimit
)
{
if
(
count
>=
billsNumLimit
)
{
throw
new
BusinessParamCheckingException
(
ExceptionConstants
.
DEPOT_HEAD_OVER_LIMIT_FAILED_CODE
,
throw
new
BusinessParamCheckingException
(
ExceptionConstants
.
DEPOT_HEAD_OVER_LIMIT_FAILED_CODE
,
ExceptionConstants
.
DEPOT_HEAD_OVER_LIMIT_FAILED_MSG
);
ExceptionConstants
.
DEPOT_HEAD_OVER_LIMIT_FAILED_MSG
);
...
...
src/main/java/com/jsh/erp/controller/UserController.java
View file @
c7180a0d
...
@@ -106,6 +106,8 @@ public class UserController {
...
@@ -106,6 +106,8 @@ public class UserController {
//验证通过 ,可以登录,放入session,记录登录日志
//验证通过 ,可以登录,放入session,记录登录日志
user
=
userService
.
getUserByLoginName
(
loginName
);
user
=
userService
.
getUserByLoginName
(
loginName
);
request
.
getSession
().
setAttribute
(
"user"
,
user
);
request
.
getSession
().
setAttribute
(
"user"
,
user
);
String
roleType
=
userService
.
getRoleTypeByUserId
(
user
.
getId
());
//角色类型
request
.
getSession
().
setAttribute
(
"roleType"
,
roleType
);
if
(
user
.
getTenantId
()!=
null
)
{
if
(
user
.
getTenantId
()!=
null
)
{
Tenant
tenant
=
tenantService
.
getTenantByTenantId
(
user
.
getTenantId
());
Tenant
tenant
=
tenantService
.
getTenantByTenantId
(
user
.
getTenantId
());
if
(
tenant
!=
null
)
{
if
(
tenant
!=
null
)
{
...
@@ -346,4 +348,19 @@ public class UserController {
...
@@ -346,4 +348,19 @@ public class UserController {
}
}
return
arr
;
return
arr
;
}
}
@GetMapping
(
"/getRoleTypeByUserId"
)
public
BaseResponseInfo
getRoleTypeByUserId
(
HttpServletRequest
request
)
{
BaseResponseInfo
res
=
new
BaseResponseInfo
();
try
{
Map
<
String
,
Object
>
data
=
new
HashMap
<
String
,
Object
>();
data
.
put
(
"roleType"
,
request
.
getSession
().
getAttribute
(
"roleType"
));
res
.
code
=
200
;
res
.
data
=
data
;
}
catch
(
Exception
e
){
e
.
printStackTrace
();
res
.
code
=
500
;
res
.
data
=
"获取失败"
;
}
return
res
;
}
}
}
src/main/java/com/jsh/erp/datasource/mappers/DepotHeadMapperEx.java
View file @
c7180a0d
...
@@ -21,6 +21,7 @@ public interface DepotHeadMapperEx {
...
@@ -21,6 +21,7 @@ public interface DepotHeadMapperEx {
List
<
DepotHeadVo4List
>
selectByConditionDepotHead
(
List
<
DepotHeadVo4List
>
selectByConditionDepotHead
(
@Param
(
"type"
)
String
type
,
@Param
(
"type"
)
String
type
,
@Param
(
"subType"
)
String
subType
,
@Param
(
"subType"
)
String
subType
,
@Param
(
"handsPersonId"
)
Long
handsPersonId
,
@Param
(
"number"
)
String
number
,
@Param
(
"number"
)
String
number
,
@Param
(
"beginTime"
)
String
beginTime
,
@Param
(
"beginTime"
)
String
beginTime
,
@Param
(
"endTime"
)
String
endTime
,
@Param
(
"endTime"
)
String
endTime
,
...
@@ -32,6 +33,7 @@ public interface DepotHeadMapperEx {
...
@@ -32,6 +33,7 @@ public interface DepotHeadMapperEx {
Long
countsByDepotHead
(
Long
countsByDepotHead
(
@Param
(
"type"
)
String
type
,
@Param
(
"type"
)
String
type
,
@Param
(
"subType"
)
String
subType
,
@Param
(
"subType"
)
String
subType
,
@Param
(
"handsPersonId"
)
Long
handsPersonId
,
@Param
(
"number"
)
String
number
,
@Param
(
"number"
)
String
number
,
@Param
(
"beginTime"
)
String
beginTime
,
@Param
(
"beginTime"
)
String
beginTime
,
@Param
(
"endTime"
)
String
endTime
,
@Param
(
"endTime"
)
String
endTime
,
...
...
src/main/java/com/jsh/erp/service/depotHead/DepotHeadComponent.java
View file @
c7180a0d
...
@@ -32,12 +32,13 @@ public class DepotHeadComponent implements ICommonQuery {
...
@@ -32,12 +32,13 @@ public class DepotHeadComponent implements ICommonQuery {
String
search
=
map
.
get
(
Constants
.
SEARCH
);
String
search
=
map
.
get
(
Constants
.
SEARCH
);
String
type
=
StringUtil
.
getInfo
(
search
,
"type"
);
String
type
=
StringUtil
.
getInfo
(
search
,
"type"
);
String
subType
=
StringUtil
.
getInfo
(
search
,
"subType"
);
String
subType
=
StringUtil
.
getInfo
(
search
,
"subType"
);
String
roleType
=
StringUtil
.
getInfo
(
search
,
"roleType"
);
String
number
=
StringUtil
.
getInfo
(
search
,
"number"
);
String
number
=
StringUtil
.
getInfo
(
search
,
"number"
);
String
beginTime
=
StringUtil
.
getInfo
(
search
,
"beginTime"
);
String
beginTime
=
StringUtil
.
getInfo
(
search
,
"beginTime"
);
String
endTime
=
StringUtil
.
getInfo
(
search
,
"endTime"
);
String
endTime
=
StringUtil
.
getInfo
(
search
,
"endTime"
);
String
materialParam
=
StringUtil
.
getInfo
(
search
,
"materialParam"
);
String
materialParam
=
StringUtil
.
getInfo
(
search
,
"materialParam"
);
String
depotIds
=
StringUtil
.
getInfo
(
search
,
"depotIds"
);
String
depotIds
=
StringUtil
.
getInfo
(
search
,
"depotIds"
);
return
depotHeadService
.
select
(
type
,
subType
,
number
,
beginTime
,
endTime
,
materialParam
,
depotIds
,
QueryUtils
.
offset
(
map
),
QueryUtils
.
rows
(
map
));
return
depotHeadService
.
select
(
type
,
subType
,
roleType
,
number
,
beginTime
,
endTime
,
materialParam
,
depotIds
,
QueryUtils
.
offset
(
map
),
QueryUtils
.
rows
(
map
));
}
}
@Override
@Override
...
@@ -45,12 +46,13 @@ public class DepotHeadComponent implements ICommonQuery {
...
@@ -45,12 +46,13 @@ public class DepotHeadComponent implements ICommonQuery {
String
search
=
map
.
get
(
Constants
.
SEARCH
);
String
search
=
map
.
get
(
Constants
.
SEARCH
);
String
type
=
StringUtil
.
getInfo
(
search
,
"type"
);
String
type
=
StringUtil
.
getInfo
(
search
,
"type"
);
String
subType
=
StringUtil
.
getInfo
(
search
,
"subType"
);
String
subType
=
StringUtil
.
getInfo
(
search
,
"subType"
);
String
roleType
=
StringUtil
.
getInfo
(
search
,
"roleType"
);
String
number
=
StringUtil
.
getInfo
(
search
,
"number"
);
String
number
=
StringUtil
.
getInfo
(
search
,
"number"
);
String
beginTime
=
StringUtil
.
getInfo
(
search
,
"beginTime"
);
String
beginTime
=
StringUtil
.
getInfo
(
search
,
"beginTime"
);
String
endTime
=
StringUtil
.
getInfo
(
search
,
"endTime"
);
String
endTime
=
StringUtil
.
getInfo
(
search
,
"endTime"
);
String
materialParam
=
StringUtil
.
getInfo
(
search
,
"materialParam"
);
String
materialParam
=
StringUtil
.
getInfo
(
search
,
"materialParam"
);
String
depotIds
=
StringUtil
.
getInfo
(
search
,
"depotIds"
);
String
depotIds
=
StringUtil
.
getInfo
(
search
,
"depotIds"
);
return
depotHeadService
.
countDepotHead
(
type
,
subType
,
number
,
beginTime
,
endTime
,
materialParam
,
depotIds
);
return
depotHeadService
.
countDepotHead
(
type
,
subType
,
roleType
,
number
,
beginTime
,
endTime
,
materialParam
,
depotIds
);
}
}
@Override
@Override
...
...
src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java
View file @
c7180a0d
...
@@ -79,12 +79,17 @@ public class DepotHeadService {
...
@@ -79,12 +79,17 @@ public class DepotHeadService {
return
list
;
return
list
;
}
}
public
List
<
DepotHeadVo4List
>
select
(
String
type
,
String
subType
,
String
number
,
String
beginTime
,
String
endTime
,
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
materialParam
,
String
depotIds
,
int
offset
,
int
rows
)
throws
Exception
{
Long
handsPersonId
=
null
;
User
user
=
userService
.
getCurrentUser
();
if
(
"个人数据"
.
equals
(
roleType
))
{
handsPersonId
=
user
.
getId
();
}
List
<
DepotHeadVo4List
>
resList
=
new
ArrayList
<
DepotHeadVo4List
>();
List
<
DepotHeadVo4List
>
resList
=
new
ArrayList
<
DepotHeadVo4List
>();
List
<
DepotHeadVo4List
>
list
=
null
;
List
<
DepotHeadVo4List
>
list
=
null
;
try
{
try
{
list
=
depotHeadMapperEx
.
selectByConditionDepotHead
(
type
,
subType
,
number
,
beginTime
,
endTime
,
materialParam
,
depotIds
,
offset
,
rows
);
list
=
depotHeadMapperEx
.
selectByConditionDepotHead
(
type
,
subType
,
handsPersonId
,
number
,
beginTime
,
endTime
,
materialParam
,
depotIds
,
offset
,
rows
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
JshException
.
readFail
(
logger
,
e
);
JshException
.
readFail
(
logger
,
e
);
}
}
...
@@ -118,13 +123,16 @@ public class DepotHeadService {
...
@@ -118,13 +123,16 @@ public class DepotHeadService {
return
resList
;
return
resList
;
}
}
public
Long
countDepotHead
(
String
type
,
String
subType
,
String
roleType
,
String
number
,
String
beginTime
,
String
endTime
,
public
Long
countDepotHead
(
String
type
,
String
subType
,
String
number
,
String
beginTime
,
String
endTime
,
String
materialParam
,
String
depotIds
)
throws
Exception
{
String
materialParam
,
String
depotIds
)
throws
Exception
{
Long
handsPersonId
=
null
;
User
user
=
userService
.
getCurrentUser
();
if
(
"个人数据"
.
equals
(
roleType
))
{
handsPersonId
=
user
.
getId
();
}
Long
result
=
null
;
Long
result
=
null
;
try
{
try
{
result
=
depotHeadMapperEx
.
countsByDepotHead
(
type
,
subType
,
number
,
beginTime
,
endTime
,
materialParam
,
depotIds
);
result
=
depotHeadMapperEx
.
countsByDepotHead
(
type
,
subType
,
handsPersonId
,
number
,
beginTime
,
endTime
,
materialParam
,
depotIds
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
JshException
.
readFail
(
logger
,
e
);
JshException
.
readFail
(
logger
,
e
);
}
}
...
...
src/main/java/com/jsh/erp/service/user/UserService.java
View file @
c7180a0d
package
com.jsh.erp.service.user
;
package
com.jsh.erp.service.user
;
import
com.jsh.erp.datasource.entities.*
;
import
com.jsh.erp.service.role.RoleService
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.jsh.erp.constants.BusinessConstants
;
import
com.jsh.erp.constants.BusinessConstants
;
import
com.jsh.erp.constants.ExceptionConstants
;
import
com.jsh.erp.constants.ExceptionConstants
;
import
com.jsh.erp.datasource.entities.OrgaUserRel
;
import
com.jsh.erp.datasource.entities.User
;
import
com.jsh.erp.datasource.entities.UserEx
;
import
com.jsh.erp.datasource.entities.UserExample
;
import
com.jsh.erp.datasource.mappers.UserMapper
;
import
com.jsh.erp.datasource.mappers.UserMapper
;
import
com.jsh.erp.datasource.mappers.UserMapperEx
;
import
com.jsh.erp.datasource.mappers.UserMapperEx
;
import
com.jsh.erp.datasource.vo.TreeNodeEx
;
import
com.jsh.erp.datasource.vo.TreeNodeEx
;
...
@@ -61,6 +59,8 @@ public class UserService {
...
@@ -61,6 +59,8 @@ public class UserService {
private
TenantService
tenantService
;
private
TenantService
tenantService
;
@Resource
@Resource
private
UserBusinessService
userBusinessService
;
private
UserBusinessService
userBusinessService
;
@Resource
private
RoleService
roleService
;
public
User
getUser
(
long
id
)
throws
Exception
{
public
User
getUser
(
long
id
)
throws
Exception
{
User
result
=
null
;
User
result
=
null
;
...
@@ -675,4 +675,35 @@ public class UserService {
...
@@ -675,4 +675,35 @@ public class UserService {
}
}
return
list
;
return
list
;
}
}
/**
* 根据用户id查询角色类型
* @param userId
* @return
*/
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
String
getRoleTypeByUserId
(
long
userId
)
throws
Exception
{
List
<
UserBusiness
>
list
=
userBusinessService
.
getBasicData
(
String
.
valueOf
(
userId
),
"UserRole"
);
UserBusiness
ub
=
null
;
if
(
list
.
size
()
>
0
)
{
ub
=
list
.
get
(
0
);
String
values
=
ub
.
getValue
();
String
roleId
=
null
;
if
(
values
!=
null
)
{
values
=
values
.
replaceAll
(
"\\[\\]"
,
","
).
replace
(
"["
,
""
).
replace
(
"]"
,
""
);
}
String
[]
valueArray
=
values
.
split
(
","
);
if
(
valueArray
.
length
>
0
)
{
roleId
=
valueArray
[
0
];
}
Role
role
=
roleService
.
getRole
(
Long
.
parseLong
(
roleId
));
if
(
role
!=
null
)
{
return
role
.
getType
();
}
else
{
return
null
;
}
}
else
{
return
null
;
}
}
}
}
src/main/resources/mapper_xml/DepotHeadMapperEx.xml
View file @
c7180a0d
...
@@ -55,6 +55,9 @@
...
@@ -55,6 +55,9 @@
<if
test=
"subType != null"
>
<if
test=
"subType != null"
>
and dh.sub_type='${subType}'
and dh.sub_type='${subType}'
</if>
</if>
<if
test=
"handsPersonId != null"
>
and dh.hands_person_id='${handsPersonId}'
</if>
<if
test=
"number != null"
>
<if
test=
"number != null"
>
and dh.number like '%${number}%'
and dh.number like '%${number}%'
</if>
</if>
...
@@ -89,6 +92,9 @@
...
@@ -89,6 +92,9 @@
<if
test=
"subType != null"
>
<if
test=
"subType != null"
>
and sub_type='${subType}'
and sub_type='${subType}'
</if>
</if>
<if
test=
"handsPersonId != null"
>
and hands_person_id='${handsPersonId}'
</if>
<if
test=
"number != null"
>
<if
test=
"number != null"
>
and number like '%${number}%'
and number like '%${number}%'
</if>
</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