Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
civil-bigdata
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
civil
civil-bigdata
Commits
8a39e625
Commit
8a39e625
authored
Aug 23, 2021
by
袁伟铭
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增获取机构信息接口
parent
c7017ef3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
127 additions
and
0 deletions
+127
-0
resource-server/src/main/java/com/zq/resource/controller/admin/DeptController.java
+8
-0
resource-server/src/main/java/com/zq/resource/service/DeptService.java
+17
-0
resource-server/src/main/java/com/zq/resource/vo/OrgDeptVo.java
+102
-0
No files found.
resource-server/src/main/java/com/zq/resource/controller/admin/DeptController.java
View file @
8a39e625
...
...
@@ -6,6 +6,7 @@ import com.zq.common.vo.ResultVo;
import
com.zq.resource.entity.OrgDept
;
import
com.zq.resource.service.DeptService
;
import
com.zq.resource.vo.OrgDeptFindVo
;
import
com.zq.resource.vo.OrgDeptVo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.RequiredArgsConstructor
;
...
...
@@ -31,6 +32,13 @@ public class DeptController {
return
ResultVo
.
success
(
deptService
.
getDeptList
(
vo
));
}
@ApiOperation
(
"获取机构信息"
)
@GetMapping
(
value
=
"/getDeptInfo/{deptId}"
)
public
ResultVo
<
OrgDeptVo
>
getDeptInfo
(
@PathVariable
Long
deptId
)
{
AssertUtils
.
notNull
(
deptId
,
"缺少机构ID"
);
return
ResultVo
.
success
(
deptService
.
getDeptInfo
(
deptId
));
}
@ApiOperation
(
"根据部门PID查询子机构"
)
@GetMapping
(
value
=
"/getDeptByPid/{parentId}"
)
public
ResultVo
<
List
<
OrgDept
>>
getDeptByPid
(
@PathVariable
Long
parentId
)
{
...
...
resource-server/src/main/java/com/zq/resource/service/DeptService.java
View file @
8a39e625
package
com
.
zq
.
resource
.
service
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.date.DateUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.StringUtils
;
...
...
@@ -12,6 +13,7 @@ import com.zq.resource.entity.OrgDept;
import
com.zq.resource.utils.TreeUtils
;
import
com.zq.resource.vo.DataTreeVo
;
import
com.zq.resource.vo.OrgDeptFindVo
;
import
com.zq.resource.vo.OrgDeptVo
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.stereotype.Service
;
...
...
@@ -102,4 +104,19 @@ public class DeptService {
return
TreeUtils
.
buildTree
(
collect
,
"0"
);
}
public
OrgDeptVo
getDeptInfo
(
Long
deptId
)
{
OrgDept
orgDept
=
orgDeptDao
.
selectById
(
deptId
);
AssertUtils
.
notNull
(
orgDept
,
"机构不存在"
);
OrgDeptVo
orgDeptVo
=
BeanUtil
.
copyProperties
(
orgDept
,
OrgDeptVo
.
class
);
if
(
orgDept
.
getParentId
()
!=
null
&&
orgDept
.
getParentId
()
!=
0
)
{
OrgDept
parentDept
=
orgDeptDao
.
selectById
(
orgDept
.
getParentId
());
if
(
parentDept
!=
null
)
{
orgDeptVo
.
setParentName
(
parentDept
.
getDeptName
());
}
}
return
orgDeptVo
;
}
}
resource-server/src/main/java/com/zq/resource/vo/OrgDeptVo.java
0 → 100644
View file @
8a39e625
package
com
.
zq
.
resource
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.Date
;
/**
* 机构表(OrgDept)实体类
*
* @author makejava
* @since 2021-08-19 11:28:38
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public
class
OrgDeptVo
{
/**
* 自增
*/
@ApiModelProperty
(
"自增"
)
private
Long
id
;
/**
* 上级机构id
*/
@ApiModelProperty
(
"上级机构id"
)
private
Long
parentId
;
/**
* 机构(部门)名称
*/
@ApiModelProperty
(
"机构(部门)名称"
)
private
String
deptName
;
/**
* 机构类型:1 业务处室 2二层机构 3二层机构业务科室
*/
@ApiModelProperty
(
"机构类型:1 业务处室 2二层机构 3二层机构业务科室"
)
private
Integer
deptType
;
/**
* 行政区域编号
*/
@ApiModelProperty
(
"行政区域编号"
)
private
String
areaCode
;
/**
* 地址
*/
@ApiModelProperty
(
"地址"
)
private
String
address
;
/**
* 联系电话
*/
@ApiModelProperty
(
"联系电话"
)
private
String
tel
;
/**
* 编制(人员数量)
*/
@ApiModelProperty
(
"编制(人员数量)"
)
private
Integer
totalOrgStaff
;
/**
* 在编(人员数量)
*/
@ApiModelProperty
(
"在编(人员数量)"
)
private
Integer
currOrgStaff
;
/**
* 主要职责
*/
@ApiModelProperty
(
"主要职责"
)
private
String
responsibility
;
/**
* 创建时间
*/
@ApiModelProperty
(
"创建时间"
)
private
Date
createTime
;
/**
* 更新时间
*/
@ApiModelProperty
(
"更新时间"
)
private
Date
updateTime
;
/**
* 上级机构名称
*/
@ApiModelProperty
(
"上级机构名称"
)
private
String
parentName
;
}
\ No newline at end of file
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