|
@@ -77,28 +77,21 @@ public class SysPostController extends BaseController
|
77
|
77
|
}
|
78
|
78
|
|
79
|
79
|
/**
|
80
|
|
- * 获取分管领导
|
|
80
|
+ * 通过userId获取分管领导
|
81
|
81
|
*/
|
82
|
82
|
@GetMapping("/manageLeader")
|
83
|
83
|
public AjaxResult getManageLeader(String userId)
|
84
|
84
|
{
|
85
|
|
- JSONObject jsonObject = new JSONObject();
|
86
|
|
- jsonObject.put("2", Arrays.asList(103,105,113));
|
87
|
|
- jsonObject.put("7", Arrays.asList(104, 112, 116));
|
88
|
|
- jsonObject.put("9", Arrays.asList(108, 109));
|
89
|
|
- jsonObject.put("10", Arrays.asList(110, 111));
|
90
|
|
- jsonObject.put("11", Arrays.asList(160, 107));
|
91
|
|
- jsonObject.put("12", Arrays.asList(117));
|
92
|
|
- jsonObject.put("13", Arrays.asList(114, 115));
|
93
|
|
- Iterator<String> iterator = jsonObject.keySet().iterator();
|
94
|
|
- String manageId = "";
|
95
|
|
- while(iterator.hasNext()){
|
96
|
|
- String key = (String) iterator.next();
|
97
|
|
- List<Long> value = jsonObject.getList(key, Long.class);
|
98
|
|
- if (value.contains(userService.selectUserById(Long.parseLong(userId)).getDeptId()))
|
99
|
|
- manageId = key;
|
100
|
|
- }
|
101
|
|
- return success(manageId);
|
|
85
|
+ return success(getManageId(userService.selectUserById(Long.parseLong(userId)).getDeptId()));
|
|
86
|
+ }
|
|
87
|
+
|
|
88
|
+ /**
|
|
89
|
+ * 通过deptId获取分管领导
|
|
90
|
+ */
|
|
91
|
+ @GetMapping("/manageLeaderByDept")
|
|
92
|
+ public AjaxResult getManageLeaderByDeptId(String deptId)
|
|
93
|
+ {
|
|
94
|
+ return success(getManageId(Long.parseLong(deptId)));
|
102
|
95
|
}
|
103
|
96
|
|
104
|
97
|
@Log(title = "岗位管理", businessType = BusinessType.EXPORT)
|
|
@@ -181,4 +174,27 @@ public class SysPostController extends BaseController
|
181
|
174
|
List<SysPost> posts = postService.selectPostAll();
|
182
|
175
|
return success(posts);
|
183
|
176
|
}
|
|
177
|
+
|
|
178
|
+ private SysUser getManageId(Long id) {
|
|
179
|
+ JSONObject jsonObject = new JSONObject();
|
|
180
|
+ jsonObject.put("2", Arrays.asList(103,105,113));
|
|
181
|
+ jsonObject.put("7", Arrays.asList(104, 112, 116));
|
|
182
|
+ jsonObject.put("9", Arrays.asList(108, 109));
|
|
183
|
+ jsonObject.put("10", Arrays.asList(110, 111));
|
|
184
|
+ jsonObject.put("11", Arrays.asList(106, 107));
|
|
185
|
+ jsonObject.put("12", Arrays.asList(117));
|
|
186
|
+ jsonObject.put("13", Arrays.asList(114, 115));
|
|
187
|
+ Iterator<String> iterator = jsonObject.keySet().iterator();
|
|
188
|
+ String manageId = "";
|
|
189
|
+ while(iterator.hasNext()){
|
|
190
|
+ String key = (String) iterator.next();
|
|
191
|
+ List<Long> value = jsonObject.getList(key, Long.class);
|
|
192
|
+ if (value.contains(id))
|
|
193
|
+ manageId = key;
|
|
194
|
+ }
|
|
195
|
+ SysUser user = new SysUser();
|
|
196
|
+ if (!manageId.equals(""))
|
|
197
|
+ user = userService.selectUserById(Long.parseLong(manageId));
|
|
198
|
+ return user;
|
|
199
|
+ }
|
184
|
200
|
}
|