Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cloud-fb
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王衍超
cloud-fb
Commits
c1c90ad7
Commit
c1c90ad7
authored
May 11, 2021
by
shiwenbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改获取部门接口
parent
d8c00855
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
2 deletions
+18
-2
DinasCommonController.java
...in/java/com/xyst/dinas/biz/web/DinasCommonController.java
+18
-2
No files found.
backend/xyst.dinas.biz/src/main/java/com/xyst/dinas/biz/web/DinasCommonController.java
View file @
c1c90ad7
...
...
@@ -23,7 +23,9 @@ import com.beecode.bap.staff.Staff;
import
com.beecode.bap.staff.service.StaffService
;
import
com.beecode.bap.staff.util.StaffUtil
;
import
com.beecode.bcp.type.KObject
;
import
com.beecode.bcp.type.json.JSONObjectUtils
;
import
com.beecode.inz.basis.team.pojo.ResponseObj
;
import
com.beecode.nlib.utils.StringUtils
;
import
com.xyst.dinas.biz.enumeration.PlanningCycleEnum
;
import
com.xyst.dinas.biz.service.PlanningCycleService
;
...
...
@@ -47,7 +49,7 @@ public class DinasCommonController {
*/
@ResponseBody
@RequestMapping
(
value
=
"/dinasBiz/department/queryDepartmentById"
,
method
=
RequestMethod
.
POST
)
public
List
<
KObject
>
queryDepartmentById
(
@RequestBody
String
body
)
{
public
List
<
Map
<
String
,
Object
>
>
queryDepartmentById
(
@RequestBody
String
body
)
{
JSONObject
param
=
new
JSONObject
(
body
);
List
<
KObject
>
list
=
new
ArrayList
<
KObject
>();
if
(
param
.
isNull
(
"id"
))
{
...
...
@@ -62,8 +64,22 @@ public class DinasCommonController {
list
.
add
(
rootLevel
);
list
.
add
(
regionalLevel
);
}
Map
<
UUID
,
String
>
deptTitlePath
=
departmentService
.
getTitlePath
(
list
);
List
<
Map
<
String
,
Object
>>
result
=
deptAddTitlePathProperty
(
list
,
deptTitlePath
);
return
list
;
return
result
;
}
private
List
<
Map
<
String
,
Object
>>
deptAddTitlePathProperty
(
List
<
KObject
>
depts
,
Map
<
UUID
,
String
>
deptTitlePath
)
{
List
<
Map
<
String
,
Object
>>
result
=
new
ArrayList
<
Map
<
String
,
Object
>>();
depts
.
forEach
(
dept
->
{
Map
<
String
,
Object
>
deptMap
=
JSONObjectUtils
.
toMap
(
JSONObjectUtils
.
toJson
(
dept
));
UUID
deptId
=
dept
.
getUuid
(
"id"
);
String
deptPath
=
deptTitlePath
.
get
(
deptId
);
deptMap
.
put
(
"titlePath"
,
StringUtils
.
isEmpty
(
deptPath
)
?
""
:
deptPath
);
result
.
add
(
deptMap
);
});
return
result
;
}
/**
...
...
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