Commit 9dba739e by shiwenbo

同步角色是传递角色title

parent 5e59ba6f
...@@ -147,12 +147,12 @@ public class SyncOaController { ...@@ -147,12 +147,12 @@ public class SyncOaController {
JSONArray roleIds = paramData.getJSONArray("roleIds"); JSONArray roleIds = paramData.getJSONArray("roleIds");
JSONArray staffIds = paramData.getJSONArray("staffIds"); JSONArray staffIds = paramData.getJSONArray("staffIds");
JSONArray deptIds = paramData.getJSONArray("deptIds"); JSONArray deptIds = paramData.getJSONArray("deptIds");
List<String> roleNameList = new ArrayList<String>(); List<String> roleTitleList = new ArrayList<String>();
List<String> staffNameList = new ArrayList<String>(); List<String> staffNameList = new ArrayList<String>();
for(int i = 0; i < roleIds.length(); i++) { for(int i = 0; i < roleIds.length(); i++) {
Optional<Role> role = roleService.get(UUID.fromString(roleIds.getString(i))); Optional<Role> role = roleService.get(UUID.fromString(roleIds.getString(i)));
if(role.isPresent()) { if(role.isPresent()) {
roleNameList.add(role.get().getName()); roleTitleList.add(role.get().getTitle());
} }
} }
for(int i = 0; i < staffIds.length(); i++) { for(int i = 0; i < staffIds.length(); i++) {
...@@ -169,13 +169,13 @@ public class SyncOaController { ...@@ -169,13 +169,13 @@ public class SyncOaController {
JSONObject paramData2 = new JSONObject(); JSONObject paramData2 = new JSONObject();
JSONArray array = new JSONArray(); JSONArray array = new JSONArray();
paramData2.put("datas", array); paramData2.put("datas", array);
for(int i = 0; i < roleNameList.size(); i++) { for(int i = 0; i < roleTitleList.size(); i++) {
String roleName = roleNameList.get(i); String roleTitle = roleTitleList.get(i);
for(int j = 0; j < staffNameList.size(); j++) { for(int j = 0; j < staffNameList.size(); j++) {
String staffName = staffNameList.get(j); String staffName = staffNameList.get(j);
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put("userName", staffName); json.put("userName", staffName);
json.put("roleName", roleName); json.put("roleTitle", roleTitle);
array.put(json); array.put(json);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment