Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yudao-cloud
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
hblj
yudao-cloud
Commits
9b7ca47a
提交
9b7ca47a
authored
7月 21, 2019
作者:
zhenxianyimeng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
员工列表 增加部门
上级
e0117960
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
137 行增加
和
18 行删除
+137
-18
adminList.js
admin-web/src/models/admin/adminList.js
+65
-17
AdminList.js
admin-web/src/pages/Admin/AdminList.js
+0
-0
mall_admin.sql
docs/sql/mall_admin.sql
+1
-0
AdminController.java
.../admin/application/controller/admins/AdminController.java
+16
-0
AdminVO.java
...a/cn/iocoder/mall/admin/application/vo/admin/AdminVO.java
+18
-0
AdminBO.java
...main/java/cn/iocoder/mall/admin/api/bo/admin/AdminBO.java
+3
-0
AdminAddDTO.java
...java/cn/iocoder/mall/admin/api/dto/admin/AdminAddDTO.java
+5
-0
AdminPageDTO.java
...ava/cn/iocoder/mall/admin/api/dto/admin/AdminPageDTO.java
+4
-0
AdminUpdateDTO.java
...a/cn/iocoder/mall/admin/api/dto/admin/AdminUpdateDTO.java
+4
-0
AdminMapper.java
.../src/main/java/cn/iocoder/mall/admin/dao/AdminMapper.java
+9
-1
AdminDO.java
...c/main/java/cn/iocoder/mall/admin/dataobject/AdminDO.java
+6
-0
DeptmentServiceImpl.java
...va/cn/iocoder/mall/admin/service/DeptmentServiceImpl.java
+6
-0
没有找到文件。
admin-web/src/models/admin/adminList.js
浏览文件 @
9b7ca47a
import
{
message
}
from
'antd'
;
import
{
message
}
from
'antd'
;
import
{
buildTreeNode
,
findCheckedKeys
}
from
'../../utils/tree.utils'
;
import
{
buildTreeNode
,
findCheckedKeys
}
from
'../../utils/tree.utils'
;
import
{
import
{
addAdmin
,
addAdmin
,
adminRoleAssign
,
adminRoleAssign
,
...
@@ -8,14 +8,30 @@ import {
...
@@ -8,14 +8,30 @@ import {
queryAdminRoleList
,
queryAdminRoleList
,
updateAdmin
,
updateAdmin
,
updateAdminStatus
,
updateAdminStatus
,
deptTreeAll
,
}
from
'../../services/admin'
;
}
from
'../../services/admin'
;
import
{
arrayToStringParams
}
from
'../../utils/request.qs'
;
import
{
arrayToStringParams
}
from
'../../utils/request.qs'
;
import
PaginationHelper
from
'../../../helpers/PaginationHelper'
;
import
PaginationHelper
from
'../../../helpers/PaginationHelper'
;
const
SEARCH_PARAMS_DEFAULT
=
{
const
SEARCH_PARAMS_DEFAULT
=
{
nickname
:
''
,
nickname
:
''
,
};
};
const
buildSelectTree
=
list
=>
{
return
list
.
map
(
item
=>
{
let
children
=
[];
if
(
item
.
children
)
{
children
=
buildSelectTree
(
item
.
children
);
}
return
{
title
:
item
.
name
,
value
:
`
${
item
.
name
}
-
${
item
.
id
}
`
,
key
:
item
.
id
,
children
,
};
});
};
export
default
{
export
default
{
namespace
:
'adminList'
,
namespace
:
'adminList'
,
...
@@ -37,11 +53,22 @@ export default {
...
@@ -37,11 +53,22 @@ export default {
roleModalVisible
:
false
,
roleModalVisible
:
false
,
roleCheckedKeys
:
[],
// 此处的 Key ,就是角色编号
roleCheckedKeys
:
[],
// 此处的 Key ,就是角色编号
roleAssignLoading
:
false
,
roleAssignLoading
:
false
,
//部门相关
deptSelectTree
:
[],
},
},
effects
:
{
effects
:
{
*
getDeptmentTree
({
payload
},
{
call
,
put
})
{
const
result
=
yield
call
(
deptTreeAll
,
payload
);
yield
put
({
type
:
'treeSuccess'
,
payload
:
result
.
data
,
});
},
// 查询列表
// 查询列表
*
query
({
payload
},
{
call
,
put
})
{
*
query
({
payload
},
{
call
,
put
})
{
// 显示加载中
// 显示加载中
yield
put
({
yield
put
({
type
:
'changeListLoading'
,
type
:
'changeListLoading'
,
...
@@ -57,8 +84,8 @@ export default {
...
@@ -57,8 +84,8 @@ export default {
list
:
response
.
data
.
list
,
list
:
response
.
data
.
list
,
pagination
:
PaginationHelper
.
formatPagination
(
response
.
data
,
payload
),
pagination
:
PaginationHelper
.
formatPagination
(
response
.
data
,
payload
),
searchParams
:
{
searchParams
:
{
nickname
:
payload
.
nickname
||
''
nickname
:
payload
.
nickname
||
''
,
}
}
,
},
},
});
});
...
@@ -68,7 +95,7 @@ export default {
...
@@ -68,7 +95,7 @@ export default {
payload
:
false
,
payload
:
false
,
});
});
},
},
*
add
({
payload
},
{
call
,
put
})
{
*
add
({
payload
},
{
call
,
put
})
{
// 显示加载中
// 显示加载中
yield
put
({
yield
put
({
type
:
'changeModalLoading'
,
type
:
'changeModalLoading'
,
...
@@ -87,7 +114,7 @@ export default {
...
@@ -87,7 +114,7 @@ export default {
yield
put
({
yield
put
({
type
:
'query'
,
type
:
'query'
,
payload
:
{
payload
:
{
...
PaginationHelper
.
defaultPayload
...
PaginationHelper
.
defaultPayload
,
},
},
});
});
}
}
...
@@ -98,7 +125,7 @@ export default {
...
@@ -98,7 +125,7 @@ export default {
payload
:
false
,
payload
:
false
,
});
});
},
},
*
update
({
payload
},
{
call
,
put
})
{
*
update
({
payload
},
{
call
,
put
})
{
const
{
callback
,
body
}
=
payload
;
const
{
callback
,
body
}
=
payload
;
// 显示加载中
// 显示加载中
yield
put
({
yield
put
({
...
@@ -117,7 +144,7 @@ export default {
...
@@ -117,7 +144,7 @@ export default {
yield
put
({
yield
put
({
type
:
'query'
,
type
:
'query'
,
payload
:
{
payload
:
{
...
PaginationHelper
.
defaultPayload
...
PaginationHelper
.
defaultPayload
,
},
},
});
});
}
}
...
@@ -129,7 +156,7 @@ export default {
...
@@ -129,7 +156,7 @@ export default {
});
});
},
},
*
updateStatus
({
payload
},
{
call
,
put
})
{
*
updateStatus
({
payload
},
{
call
,
put
})
{
// 请求
// 请求
const
response
=
yield
call
(
updateAdminStatus
,
payload
);
const
response
=
yield
call
(
updateAdminStatus
,
payload
);
// 响应
// 响应
...
@@ -139,13 +166,13 @@ export default {
...
@@ -139,13 +166,13 @@ export default {
yield
put
({
yield
put
({
type
:
'query'
,
type
:
'query'
,
payload
:
{
payload
:
{
...
PaginationHelper
.
defaultPayload
...
PaginationHelper
.
defaultPayload
,
},
},
});
});
}
}
},
},
*
delete
({
payload
},
{
call
,
put
})
{
*
delete
({
payload
},
{
call
,
put
})
{
// 请求
// 请求
const
response
=
yield
call
(
deleteAdmin
,
payload
);
const
response
=
yield
call
(
deleteAdmin
,
payload
);
// 响应
// 响应
...
@@ -155,13 +182,13 @@ export default {
...
@@ -155,13 +182,13 @@ export default {
yield
put
({
yield
put
({
type
:
'query'
,
type
:
'query'
,
payload
:
{
payload
:
{
...
PaginationHelper
.
defaultPayload
...
PaginationHelper
.
defaultPayload
,
},
},
});
});
}
}
},
},
*
queryRoleList
({
payload
},
{
call
,
put
})
{
*
queryRoleList
({
payload
},
{
call
,
put
})
{
// 显示加载中
// 显示加载中
yield
put
({
yield
put
({
type
:
'changeRoleAssignLoading'
,
type
:
'changeRoleAssignLoading'
,
...
@@ -191,7 +218,7 @@ export default {
...
@@ -191,7 +218,7 @@ export default {
});
});
},
},
*
roleAssign
({
payload
},
{
call
,
put
})
{
*
roleAssign
({
payload
},
{
call
,
put
})
{
const
{
callback
,
body
}
=
payload
;
const
{
callback
,
body
}
=
payload
;
// 显示加载中
// 显示加载中
yield
put
({
yield
put
({
...
@@ -220,6 +247,27 @@ export default {
...
@@ -220,6 +247,27 @@ export default {
},
},
reducers
:
{
reducers
:
{
treeSuccess
(
state
,
{
payload
})
{
const
resultData
=
payload
;
const
treeData
=
buildSelectTree
(
resultData
);
// // value 要保护 displayName 不然,搜索会失效
// const rootNode = [
// {
// title: '根节点',
// value: `根节点-0`,
// key: 0,
// children: [],
// },
// ];
// const deptSelectTree = rootNode.concat(treeData);
return
{
...
state
,
// list: resultData,
deptSelectTree
:
treeData
,
};
},
changeRoleCheckedKeys
(
state
,
{
payload
})
{
changeRoleCheckedKeys
(
state
,
{
payload
})
{
return
{
return
{
...
state
,
...
state
,
...
@@ -251,6 +299,6 @@ export default {
...
@@ -251,6 +299,6 @@ export default {
...
state
,
...
state
,
...
payload
,
...
payload
,
};
};
}
}
,
},
},
};
};
admin-web/src/pages/Admin/AdminList.js
浏览文件 @
9b7ca47a
差异被折叠。
点击展开。
docs/sql/mall_admin.sql
浏览文件 @
9b7ca47a
...
@@ -50,6 +50,7 @@ CREATE TABLE `admin` (
...
@@ -50,6 +50,7 @@ CREATE TABLE `admin` (
`nickname`
varchar
(
10
)
NOT
NULL
COMMENT
'昵称'
,
`nickname`
varchar
(
10
)
NOT
NULL
COMMENT
'昵称'
,
`password`
varchar
(
32
)
NOT
NULL
COMMENT
'密码
\n
*
\n
* TODO 芋艿 暂时最简单的 MD5'
,
`password`
varchar
(
32
)
NOT
NULL
COMMENT
'密码
\n
*
\n
* TODO 芋艿 暂时最简单的 MD5'
,
`status`
tinyint
(
11
)
NOT
NULL
COMMENT
'账号状态'
,
`status`
tinyint
(
11
)
NOT
NULL
COMMENT
'账号状态'
,
`deptment_id`
int
(
11
)
DEFAULT
0
NOT
NULL
'部门id'
,
`create_time`
datetime
NOT
NULL
COMMENT
'创建时间'
,
`create_time`
datetime
NOT
NULL
COMMENT
'创建时间'
,
`update_time`
datetime
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
,
`update_time`
datetime
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
,
`deleted`
bit
(
1
)
DEFAULT
NULL
,
`deleted`
bit
(
1
)
DEFAULT
NULL
,
...
...
system/system-application/src/main/java/cn/iocoder/mall/admin/application/controller/admins/AdminController.java
浏览文件 @
9b7ca47a
...
@@ -5,8 +5,10 @@ import cn.iocoder.common.framework.util.CollectionUtil;
...
@@ -5,8 +5,10 @@ import cn.iocoder.common.framework.util.CollectionUtil;
import
cn.iocoder.common.framework.vo.CommonResult
;
import
cn.iocoder.common.framework.vo.CommonResult
;
import
cn.iocoder.common.framework.vo.PageResult
;
import
cn.iocoder.common.framework.vo.PageResult
;
import
cn.iocoder.mall.admin.api.AdminService
;
import
cn.iocoder.mall.admin.api.AdminService
;
import
cn.iocoder.mall.admin.api.DeptmentService
;
import
cn.iocoder.mall.admin.api.ResourceService
;
import
cn.iocoder.mall.admin.api.ResourceService
;
import
cn.iocoder.mall.admin.api.RoleService
;
import
cn.iocoder.mall.admin.api.RoleService
;
import
cn.iocoder.mall.admin.api.bo.deptment.DeptmentBO
;
import
cn.iocoder.mall.admin.api.bo.resource.ResourceBO
;
import
cn.iocoder.mall.admin.api.bo.resource.ResourceBO
;
import
cn.iocoder.mall.admin.api.bo.role.RoleBO
;
import
cn.iocoder.mall.admin.api.bo.role.RoleBO
;
import
cn.iocoder.mall.admin.api.bo.admin.AdminBO
;
import
cn.iocoder.mall.admin.api.bo.admin.AdminBO
;
...
@@ -23,6 +25,7 @@ import io.swagger.annotations.Api;
...
@@ -23,6 +25,7 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.dubbo.config.annotation.Reference
;
import
org.apache.dubbo.config.annotation.Reference
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.*
;
import
java.util.*
;
...
@@ -44,6 +47,9 @@ public class AdminController {
...
@@ -44,6 +47,9 @@ public class AdminController {
@Reference
(
validation
=
"true"
,
version
=
"${dubbo.provider.RoleService.version}"
)
@Reference
(
validation
=
"true"
,
version
=
"${dubbo.provider.RoleService.version}"
)
private
RoleService
roleService
;
private
RoleService
roleService
;
@Autowired
private
DeptmentService
deptmentService
;
// =========== 当前管理员相关的资源 API ===========
// =========== 当前管理员相关的资源 API ===========
// TODO 功能:当前管理员
// TODO 功能:当前管理员
...
@@ -97,7 +103,17 @@ public class AdminController {
...
@@ -97,7 +103,17 @@ public class AdminController {
// 查询角色数组
// 查询角色数组
Map
<
Integer
,
Collection
<
RoleBO
>>
roleMap
=
adminService
.
getAdminRolesMap
(
CollectionUtil
.
convertList
(
resultPage
.
getList
(),
AdminBO:
:
getId
));
Map
<
Integer
,
Collection
<
RoleBO
>>
roleMap
=
adminService
.
getAdminRolesMap
(
CollectionUtil
.
convertList
(
resultPage
.
getList
(),
AdminBO:
:
getId
));
resultPage
.
getList
().
forEach
(
admin
->
admin
.
setRoles
(
AdminConvert
.
INSTANCE
.
convertAdminVORoleList
(
roleMap
.
get
(
admin
.
getId
()))));
resultPage
.
getList
().
forEach
(
admin
->
admin
.
setRoles
(
AdminConvert
.
INSTANCE
.
convertAdminVORoleList
(
roleMap
.
get
(
admin
.
getId
()))));
// 查询对应部门
List
<
DeptmentBO
>
deptmentBOS
=
deptmentService
.
getAllDeptments
();
Map
<
Integer
,
String
>
deptNameMap
=
deptmentBOS
.
stream
().
collect
(
Collectors
.
toMap
(
d
->
d
.
getId
(),
d
->
d
.
getName
()));
//管理员所在部门被删后,变成未分配状态
deptNameMap
.
put
(
0
,
"未分配"
);
resultPage
.
getList
().
forEach
(
admin
->{
admin
.
setDeptment
(
new
AdminVO
.
Deptment
(
admin
.
getDeptmentId
(),
deptNameMap
.
get
(
admin
.
getDeptmentId
())));
});
}
}
return
success
(
resultPage
);
return
success
(
resultPage
);
}
}
...
...
system/system-application/src/main/java/cn/iocoder/mall/admin/application/vo/admin/AdminVO.java
浏览文件 @
9b7ca47a
...
@@ -3,6 +3,7 @@ package cn.iocoder.mall.admin.application.vo.admin;
...
@@ -3,6 +3,7 @@ package cn.iocoder.mall.admin.application.vo.admin;
import
cn.iocoder.mall.admin.api.bo.admin.AdminBO
;
import
cn.iocoder.mall.admin.api.bo.admin.AdminBO
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
lombok.experimental.Accessors
;
...
@@ -15,6 +16,8 @@ public class AdminVO extends AdminBO {
...
@@ -15,6 +16,8 @@ public class AdminVO extends AdminBO {
private
List
<
Role
>
roles
;
private
List
<
Role
>
roles
;
private
Deptment
deptment
;
@ApiModel
(
"管理员 VO - 角色"
)
@ApiModel
(
"管理员 VO - 角色"
)
@Data
@Data
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
...
@@ -28,4 +31,19 @@ public class AdminVO extends AdminBO {
...
@@ -28,4 +31,19 @@ public class AdminVO extends AdminBO {
}
}
@ApiModel
(
"管理员 VO - 部门"
)
@Data
@Accessors
(
chain
=
true
)
@AllArgsConstructor
public
static
class
Deptment
{
@ApiModelProperty
(
value
=
"部门编号"
,
required
=
true
,
example
=
"1"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"部门名称"
,
required
=
true
,
example
=
"研发部"
)
private
String
name
;
}
}
}
system/system-service-api/src/main/java/cn/iocoder/mall/admin/api/bo/admin/AdminBO.java
浏览文件 @
9b7ca47a
...
@@ -28,4 +28,7 @@ public class AdminBO implements Serializable {
...
@@ -28,4 +28,7 @@ public class AdminBO implements Serializable {
@ApiModelProperty
(
value
=
"创建时间"
,
required
=
true
,
example
=
"时间戳格式"
)
@ApiModelProperty
(
value
=
"创建时间"
,
required
=
true
,
example
=
"时间戳格式"
)
private
Date
createTime
;
private
Date
createTime
;
@ApiModelProperty
(
value
=
"部门ID"
,
required
=
true
,
example
=
"1"
)
private
Integer
deptmentId
;
}
}
system/system-service-api/src/main/java/cn/iocoder/mall/admin/api/dto/admin/AdminAddDTO.java
浏览文件 @
9b7ca47a
...
@@ -7,6 +7,7 @@ import lombok.experimental.Accessors;
...
@@ -7,6 +7,7 @@ import lombok.experimental.Accessors;
import
org.hibernate.validator.constraints.Length
;
import
org.hibernate.validator.constraints.Length
;
import
javax.validation.constraints.NotEmpty
;
import
javax.validation.constraints.NotEmpty
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.Pattern
;
import
javax.validation.constraints.Pattern
;
import
java.io.Serializable
;
import
java.io.Serializable
;
...
@@ -31,4 +32,8 @@ public class AdminAddDTO implements Serializable {
...
@@ -31,4 +32,8 @@ public class AdminAddDTO implements Serializable {
@Length
(
min
=
4
,
max
=
16
,
message
=
"密码长度为 4-16 位"
)
@Length
(
min
=
4
,
max
=
16
,
message
=
"密码长度为 4-16 位"
)
private
String
password
;
private
String
password
;
@ApiModelProperty
(
value
=
"部门ID"
,
required
=
true
,
example
=
"1"
)
@NotNull
(
message
=
"部门不能为空"
)
private
Integer
deptmentId
;
}
}
system/system-service-api/src/main/java/cn/iocoder/mall/admin/api/dto/admin/AdminPageDTO.java
浏览文件 @
9b7ca47a
...
@@ -17,4 +17,8 @@ public class AdminPageDTO extends PageParam {
...
@@ -17,4 +17,8 @@ public class AdminPageDTO extends PageParam {
@ApiModelProperty
(
value
=
"昵称,模糊匹配"
,
example
=
"小王"
)
@ApiModelProperty
(
value
=
"昵称,模糊匹配"
,
example
=
"小王"
)
private
String
nickname
;
private
String
nickname
;
@ApiModelProperty
(
value
=
"所在部门ID"
)
private
Integer
deptmentId
;
}
}
system/system-service-api/src/main/java/cn/iocoder/mall/admin/api/dto/admin/AdminUpdateDTO.java
浏览文件 @
9b7ca47a
...
@@ -35,4 +35,8 @@ public class AdminUpdateDTO implements Serializable {
...
@@ -35,4 +35,8 @@ public class AdminUpdateDTO implements Serializable {
@Length
(
min
=
4
,
max
=
16
,
message
=
"密码长度为 4-16 位"
)
@Length
(
min
=
4
,
max
=
16
,
message
=
"密码长度为 4-16 位"
)
private
String
password
;
private
String
password
;
@ApiModelProperty
(
value
=
"部门ID"
,
required
=
true
,
example
=
"1"
)
@NotNull
(
message
=
"部门不能为空"
)
private
Integer
deptmentId
;
}
}
system/system-service-impl/src/main/java/cn/iocoder/mall/admin/dao/AdminMapper.java
浏览文件 @
9b7ca47a
...
@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
...
@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
org.omg.PortableInterceptor.INACTIVE
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
@Repository
@Repository
...
@@ -19,7 +20,14 @@ public interface AdminMapper extends BaseMapper<AdminDO> {
...
@@ -19,7 +20,14 @@ public interface AdminMapper extends BaseMapper<AdminDO> {
default
IPage
<
AdminDO
>
selectPage
(
AdminPageDTO
adminPageDTO
)
{
default
IPage
<
AdminDO
>
selectPage
(
AdminPageDTO
adminPageDTO
)
{
return
selectPage
(
new
Page
<>(
adminPageDTO
.
getPageNo
(),
adminPageDTO
.
getPageSize
()),
return
selectPage
(
new
Page
<>(
adminPageDTO
.
getPageNo
(),
adminPageDTO
.
getPageSize
()),
new
QueryWrapperX
<
AdminDO
>().
likeIfPresent
(
"nickname"
,
adminPageDTO
.
getNickname
()));
new
QueryWrapperX
<
AdminDO
>().
likeIfPresent
(
"nickname"
,
adminPageDTO
.
getNickname
())
.
eqIfPresent
(
"deptment_id"
,
adminPageDTO
.
getDeptmentId
()));
}
default
int
updateDeptByDeptId
(
@Param
(
"fromDeptId"
)
Integer
fromDeptId
,
@Param
(
"toDeptId"
)
Integer
toDeptId
){
QueryWrapper
<
AdminDO
>
query
=
new
QueryWrapper
<
AdminDO
>()
.
eq
(
"deptment_id"
,
fromDeptId
);
return
update
(
new
AdminDO
().
setDeptmentId
(
toDeptId
),
query
);
}
}
}
}
system/system-service-impl/src/main/java/cn/iocoder/mall/admin/dataobject/AdminDO.java
浏览文件 @
9b7ca47a
...
@@ -36,6 +36,12 @@ public class AdminDO extends DeletableDO {
...
@@ -36,6 +36,12 @@ public class AdminDO extends DeletableDO {
*/
*/
private
Integer
status
;
private
Integer
status
;
/**
* 管理员部门id
*/
private
Integer
deptmentId
;
// TODO 芋艿,最后登陆时间、最后登陆 IP
// TODO 芋艿,最后登陆时间、最后登陆 IP
// TODO 芋艿,登陆日志
// TODO 芋艿,登陆日志
...
...
system/system-service-impl/src/main/java/cn/iocoder/mall/admin/service/DeptmentServiceImpl.java
浏览文件 @
9b7ca47a
...
@@ -11,6 +11,7 @@ import cn.iocoder.mall.admin.api.dto.depetment.DeptmentAddDTO;
...
@@ -11,6 +11,7 @@ import cn.iocoder.mall.admin.api.dto.depetment.DeptmentAddDTO;
import
cn.iocoder.mall.admin.api.dto.depetment.DeptmentPageDTO
;
import
cn.iocoder.mall.admin.api.dto.depetment.DeptmentPageDTO
;
import
cn.iocoder.mall.admin.api.dto.depetment.DeptmentUpdateDTO
;
import
cn.iocoder.mall.admin.api.dto.depetment.DeptmentUpdateDTO
;
import
cn.iocoder.mall.admin.convert.DeptmentConvert
;
import
cn.iocoder.mall.admin.convert.DeptmentConvert
;
import
cn.iocoder.mall.admin.dao.AdminMapper
;
import
cn.iocoder.mall.admin.dao.DeptmentMapper
;
import
cn.iocoder.mall.admin.dao.DeptmentMapper
;
import
cn.iocoder.mall.admin.dao.DeptmentRoleMapper
;
import
cn.iocoder.mall.admin.dao.DeptmentRoleMapper
;
import
cn.iocoder.mall.admin.dataobject.DeptmentDO
;
import
cn.iocoder.mall.admin.dataobject.DeptmentDO
;
...
@@ -39,6 +40,9 @@ public class DeptmentServiceImpl implements DeptmentService {
...
@@ -39,6 +40,9 @@ public class DeptmentServiceImpl implements DeptmentService {
@Autowired
@Autowired
private
DeptmentRoleMapper
deptmentRoleMapper
;
private
DeptmentRoleMapper
deptmentRoleMapper
;
@Autowired
private
AdminMapper
adminMapper
;
@Override
@Override
public
DeptmentBO
addDeptment
(
Integer
adminId
,
DeptmentAddDTO
deptmentAddDTO
)
{
public
DeptmentBO
addDeptment
(
Integer
adminId
,
DeptmentAddDTO
deptmentAddDTO
)
{
if
(
deptmentAddDTO
.
getPid
()
!=
0
&&
if
(
deptmentAddDTO
.
getPid
()
!=
0
&&
...
@@ -69,6 +73,8 @@ public class DeptmentServiceImpl implements DeptmentService {
...
@@ -69,6 +73,8 @@ public class DeptmentServiceImpl implements DeptmentService {
deptmentRoleMapper
.
deleteByDeptmentId
(
deptmentId
);
deptmentRoleMapper
.
deleteByDeptmentId
(
deptmentId
);
//将改部门下所有员工的DeptmentID设置为0
adminMapper
.
updateDeptByDeptId
(
deptmentId
,
0
);
return
true
;
return
true
;
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论