Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
guns-vip
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenjunxiong
guns-vip
Commits
20aae729
Commit
20aae729
authored
Apr 25, 2017
by
fsn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
部门管理列表添加父级名称
parent
e0f04149
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
5 deletions
+41
-5
src/main/java/com/stylefeng/guns/modular/system/controller/DeptController.java
+4
-1
src/main/java/com/stylefeng/guns/modular/system/dao/DeptDao.java
+2
-2
src/main/java/com/stylefeng/guns/modular/system/dao/mapping/DeptDao.xml
+1
-1
src/main/java/com/stylefeng/guns/modular/system/warpper/DeptWarpper.java
+33
-0
src/main/webapp/static/modular/system/dept/dept.js
+1
-1
No files found.
src/main/java/com/stylefeng/guns/modular/system/controller/DeptController.java
View file @
20aae729
...
...
@@ -9,6 +9,7 @@ import com.stylefeng.guns.common.node.ZTreeNode;
import
com.stylefeng.guns.core.log.LogObjectHolder
;
import
com.stylefeng.guns.core.util.ToolUtil
;
import
com.stylefeng.guns.modular.system.dao.DeptDao
;
import
com.stylefeng.guns.modular.system.warpper.DeptWarpper
;
import
com.stylefeng.guns.persistence.dao.DeptMapper
;
import
com.stylefeng.guns.persistence.model.Dept
;
import
org.springframework.stereotype.Controller
;
...
...
@@ -19,6 +20,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
import
javax.annotation.Resource
;
import
java.util.List
;
import
java.util.Map
;
/**
* 部门控制器
...
...
@@ -96,7 +98,8 @@ public class DeptController extends BaseController {
@RequestMapping
(
value
=
"/list"
)
@ResponseBody
public
Object
list
(
String
condition
)
{
return
this
.
deptDao
.
list
(
condition
);
List
<
Map
<
String
,
Object
>>
list
=
this
.
deptDao
.
list
(
condition
);
return
super
.
warpObject
(
new
DeptWarpper
(
list
));
}
/**
...
...
src/main/java/com/stylefeng/guns/modular/system/dao/DeptDao.java
View file @
20aae729
package
com
.
stylefeng
.
guns
.
modular
.
system
.
dao
;
import
com.stylefeng.guns.common.node.ZTreeNode
;
import
com.stylefeng.guns.persistence.model.Dept
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
/**
* 部门dao
...
...
@@ -22,5 +22,5 @@ public interface DeptDao {
*/
List
<
ZTreeNode
>
tree
();
List
<
Dept
>
list
(
@Param
(
"condition"
)
String
condition
);
List
<
Map
<
String
,
Object
>
>
list
(
@Param
(
"condition"
)
String
condition
);
}
src/main/java/com/stylefeng/guns/modular/system/dao/mapping/DeptDao.xml
View file @
20aae729
...
...
@@ -14,7 +14,7 @@
) as open from _dept
</select>
<select
id=
"list"
resultType=
"
dept
"
>
<select
id=
"list"
resultType=
"
map
"
>
select * from _dept
<if
test=
"condition != null and condition != ''"
>
where simplename like CONCAT('%',#{condition},'%') or fullname like CONCAT('%',#{condition},'%')
...
...
src/main/java/com/stylefeng/guns/modular/system/warpper/DeptWarpper.java
0 → 100644
View file @
20aae729
package
com
.
stylefeng
.
guns
.
modular
.
system
.
warpper
;
import
com.stylefeng.guns.common.constant.factory.ConstantFactory
;
import
com.stylefeng.guns.common.warpper.BaseControllerWarpper
;
import
com.stylefeng.guns.core.util.ToolUtil
;
import
java.util.Map
;
/**
* 部门列表的包装
*
* @author fengshuonan
* @date 2017年4月25日 18:10:31
*/
public
class
DeptWarpper
extends
BaseControllerWarpper
{
public
DeptWarpper
(
Object
list
)
{
super
(
list
);
}
@Override
public
void
warpTheMap
(
Map
<
String
,
Object
>
map
)
{
Integer
pid
=
(
Integer
)
map
.
get
(
"pid"
);
if
(
ToolUtil
.
isEmpty
(
pid
)
||
pid
.
equals
(
0
))
{
map
.
put
(
"pName"
,
"--"
);
}
else
{
map
.
put
(
"pName"
,
ConstantFactory
.
me
().
getDeptName
(
pid
));
}
}
}
src/main/webapp/static/modular/system/dept/dept.js
View file @
20aae729
...
...
@@ -15,7 +15,7 @@ Dept.initColumn = function () {
return
[
{
field
:
'selectItem'
,
radio
:
true
},
{
title
:
'id'
,
field
:
'id'
,
align
:
'center'
,
valign
:
'middle'
},
{
title
:
'父级
id'
,
field
:
'pid
'
,
align
:
'center'
,
valign
:
'middle'
},
{
title
:
'父级
部门'
,
field
:
'pName
'
,
align
:
'center'
,
valign
:
'middle'
},
{
title
:
'部门简称'
,
field
:
'simplename'
,
align
:
'center'
,
valign
:
'middle'
},
{
title
:
'部门全称'
,
field
:
'fullname'
,
align
:
'center'
,
valign
:
'middle'
},
{
title
:
'排序'
,
field
:
'num'
,
align
:
'center'
,
valign
:
'middle'
},
...
...
Write
Preview
Markdown
is supported
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