Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
govdna
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
开发共享交流平台
govdna
Commits
7b5d1aa8
Commit
7b5d1aa8
authored
Aug 08, 2018
by
刘弈臻
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
部门-刘弈臻
parent
b6449fc2
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
263 additions
and
3 deletions
+263
-3
DepartController.java
...m/govmade/modules/system/controller/DepartController.java
+71
-0
RoleController.java
...com/govmade/modules/system/controller/RoleController.java
+1
-1
DepartDao.java
src/main/java/com/govmade/modules/system/dao/DepartDao.java
+17
-0
DepartEntity.java
.../java/com/govmade/modules/system/entity/DepartEntity.java
+80
-0
DepartService.java
...ava/com/govmade/modules/system/service/DepartService.java
+37
-0
DepartServiceImpl.java
...ovmade/modules/system/service/impl/DepartServiceImpl.java
+54
-0
RoleServiceImpl.java
.../govmade/modules/system/service/impl/RoleServiceImpl.java
+3
-2
No files found.
src/main/java/com/govmade/modules/system/controller/DepartController.java
0 → 100644
View file @
7b5d1aa8
package
com
.
govmade
.
modules
.
system
.
controller
;
import
java.util.Map
;
import
java.util.Set
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.govmade.common.utils.PageUtils
;
import
com.govmade.common.utils.R
;
import
com.govmade.modules.basic.controller.AbstractController
;
import
com.govmade.modules.system.entity.DepartEntity
;
import
com.govmade.modules.system.service.DepartService
;
/**
* 系统管理 - 部门设置
*
* @author 刘弈臻
* @date 2018年8月8日
*/
@RestController
@RequestMapping
(
"/system/depart"
)
public
class
DepartController
extends
AbstractController
{
@Autowired
private
DepartService
departService
;
/**
* 部门列表
*/
@GetMapping
(
"/list"
)
public
R
list
(
@RequestParam
Map
<
String
,
Object
>
params
)
{
PageUtils
page
=
departService
.
queryPage
(
params
);
return
R
.
ok
().
put
(
"page"
,
page
);
}
/**
* 保存或更新部门
*/
@PostMapping
(
"/save"
)
public
R
save
(
DepartEntity
depart
)
{
if
(
null
==
depart
.
getId
())
{
if
(
this
.
departService
.
checkDepart
(
depart
.
getName
())
>
0
)
{
return
R
.
error
(
depart
.
getName
()
+
" 已存在!"
);
}
}
departService
.
save
(
depart
);
return
R
.
ok
();
}
/**
* 删除或批量删除角色
*/
@DeleteMapping
(
"/delete"
)
public
R
deleteDepart
(
@RequestParam
Set
<
Long
>
ids
)
{
departService
.
deleteBatchIds
(
ids
);
return
R
.
ok
();
}
}
src/main/java/com/govmade/modules/system/controller/RoleController.java
View file @
7b5d1aa8
...
...
@@ -42,7 +42,7 @@ public class RoleController extends AbstractController{
}
/**
* 保存或更新
权限
* 保存或更新
角色
*/
@PostMapping
(
"/save"
)
public
R
save
(
RoleEntity
role
)
{
...
...
src/main/java/com/govmade/modules/system/dao/DepartDao.java
0 → 100644
View file @
7b5d1aa8
package
com
.
govmade
.
modules
.
system
.
dao
;
import
org.apache.ibatis.annotations.Mapper
;
import
com.baomidou.mybatisplus.mapper.BaseMapper
;
import
com.govmade.modules.system.entity.DepartEntity
;
/**
* 系统管理 - 部门设置
*
* @author 刘弈臻
* @date 2018年8月8日
*/
@Mapper
public
interface
DepartDao
extends
BaseMapper
<
DepartEntity
>{
}
src/main/java/com/govmade/modules/system/entity/DepartEntity.java
0 → 100644
View file @
7b5d1aa8
package
com
.
govmade
.
modules
.
system
.
entity
;
import
com.baomidou.mybatisplus.annotations.TableName
;
import
com.govmade.modules.basic.entity.BaseEntity
;
/**
* 系统管理 - 部门设置
*
* @author 刘弈臻
* @date 2018年8月8日
*/
@TableName
(
"system_departs"
)
public
class
DepartEntity
extends
BaseEntity
<
Long
>{
private
static
final
long
serialVersionUID
=
1L
;
private
String
code
;
//机构编码
private
String
name
;
//部门名称
private
Long
areaId
;
//所属行政区划
private
Integer
type
;
//机构类别
private
Integer
level
;
//层级
private
Long
weight
;
//权重
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
Long
getAreaId
()
{
return
areaId
;
}
public
void
setAreaId
(
Long
areaId
)
{
this
.
areaId
=
areaId
;
}
public
Integer
getType
()
{
return
type
;
}
public
void
setType
(
Integer
type
)
{
this
.
type
=
type
;
}
public
Integer
getLevel
()
{
return
level
;
}
public
void
setLevel
(
Integer
level
)
{
this
.
level
=
level
;
}
public
Long
getWeight
()
{
return
weight
;
}
public
void
setWeight
(
Long
weight
)
{
this
.
weight
=
weight
;
}
}
src/main/java/com/govmade/modules/system/service/DepartService.java
0 → 100644
View file @
7b5d1aa8
package
com
.
govmade
.
modules
.
system
.
service
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.service.IService
;
import
com.govmade.common.utils.PageUtils
;
import
com.govmade.modules.system.entity.DepartEntity
;
/**
* 系统管理 - 部门设置
*
* @author 刘弈臻
* @date 2018年8月8日
*/
public
interface
DepartService
extends
IService
<
DepartEntity
>{
/**
* 查看部门列表
*/
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
);
/**
* 保存或修改部门
*/
void
save
(
DepartEntity
depart
);
/**
* 删除部门
*/
void
deleteBatch
(
Long
[]
roleIds
);
/**
* 部门查重
*/
Integer
checkDepart
(
String
name
);
}
src/main/java/com/govmade/modules/system/service/impl/DepartServiceImpl.java
0 → 100644
View file @
7b5d1aa8
package
com
.
govmade
.
modules
.
system
.
service
.
impl
;
import
java.util.Map
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.mapper.EntityWrapper
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.baomidou.mybatisplus.service.impl.ServiceImpl
;
import
com.govmade.common.utils.PageUtils
;
import
com.govmade.common.utils.Query
;
import
com.govmade.modules.system.dao.DepartDao
;
import
com.govmade.modules.system.entity.DepartEntity
;
import
com.govmade.modules.system.service.DepartService
;
import
cn.hutool.core.util.StrUtil
;
/**
* 系统管理 - 部门设置
*
* @author 刘弈臻
* @date 2018年8月8日
*/
@Service
(
"DepartService"
)
public
class
DepartServiceImpl
extends
ServiceImpl
<
DepartDao
,
DepartEntity
>
implements
DepartService
{
@Override
public
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
)
{
String
name
=
(
String
)
params
.
get
(
"name"
);
Page
<
DepartEntity
>
page
=
this
.
selectPage
(
new
Query
<
DepartEntity
>(
params
).
getPage
(),
new
EntityWrapper
<
DepartEntity
>()
.
like
(
StrUtil
.
isNotBlank
(
name
),
"name"
,
name
));
return
new
PageUtils
(
page
);
}
@Override
public
void
save
(
DepartEntity
depart
)
{
super
.
insertOrUpdate
(
depart
);
}
@Override
public
void
deleteBatch
(
Long
[]
roleIds
)
{
// TODO Auto-generated method stub
}
@Override
public
Integer
checkDepart
(
String
name
)
{
return
super
.
selectCount
(
new
EntityWrapper
<
DepartEntity
>().
eq
(
"name"
,
name
));
}
}
src/main/java/com/govmade/modules/system/service/impl/RoleServiceImpl.java
View file @
7b5d1aa8
...
...
@@ -28,8 +28,9 @@ public class RoleServiceImpl extends ServiceImpl<RoleDao, RoleEntity> implements
public
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
)
{
String
name
=
(
String
)
params
.
get
(
"name"
);
Page
<
RoleEntity
>
page
=
this
.
selectPage
(
new
Query
<
RoleEntity
>(
params
).
getPage
(),
new
EntityWrapper
<
RoleEntity
>()
.
eq
(
StrUtil
.
isNotBlank
(
name
),
"name"
,
name
));
Page
<
RoleEntity
>
page
=
this
.
selectPage
(
new
Query
<
RoleEntity
>(
params
).
getPage
(),
new
EntityWrapper
<
RoleEntity
>()
.
like
(
StrUtil
.
isNotBlank
(
name
),
"name"
,
name
));
return
new
PageUtils
(
page
);
}
...
...
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