diff --git a/renren-admin/src/main/java/io/renren/modules/sys/controller/SysDeptController.java b/renren-admin/src/main/java/io/renren/modules/sys/controller/SysDeptController.java index 351df329..3e982c4e 100644 --- a/renren-admin/src/main/java/io/renren/modules/sys/controller/SysDeptController.java +++ b/renren-admin/src/main/java/io/renren/modules/sys/controller/SysDeptController.java @@ -142,16 +142,19 @@ public class SysDeptController { } List> list_metting = jdbcTemplate.queryForList("SELECT DISTINCT dept from t_meetingroom_book WHERE dept IS NOT NULL;"); List temp = list.stream().map(index -> index.get("name")).filter(index -> index != null).map(index -> index.toString()).distinct().collect(Collectors.toList()); + List finalTemp = temp; List> list_ = list_metting.stream().map(index -> index.get("dept")).filter(index -> index != null).collect(Collectors.toList()) - .stream().filter(index -> !temp.contains(index.toString())).map(index -> new HashMap() {{ + .stream().filter(index -> !finalTemp.contains(index.toString())).map(index -> new HashMap() {{ put("id", null); put("name", index.toString()); }}).collect(Collectors.toList()); list.addAll(list_); // 获取会客厅申请部门 if (cloud) { + temp = list.stream().map(index -> index.get("name")).filter(index -> index != null).map(index -> index.toString()).distinct().collect(Collectors.toList()); List> list_zwy = lcJdbcTemplate.queryForList(getAllsql); + List finalTemp1 = temp; List> list_1 = list_zwy.stream().map(index -> index.get("deptName")).filter(index -> index != null).distinct().collect(Collectors.toList()) - .stream().filter(index -> !temp.contains(index.toString())).map(index -> new HashMap() {{ + .stream().filter(index -> !finalTemp1.contains(index.toString())).map(index -> new HashMap() {{ put("id", null); put("name", index.toString()); }}).collect(Collectors.toList());