Commit a4efac66c1485ec81a67dc4153b4a989c8bd17ea
1 parent
7b5eae1c7d
Exists in
master
and in
8 other branches
配置接口修改
Showing 3 changed files with 46 additions and 2 deletions
platform-common/src/main/java/com/lyms/platform/common/enums/SmsServiceEnums.java
View file @
a4efac6
... | ... | @@ -110,6 +110,32 @@ |
110 | 110 | |
111 | 111 | } |
112 | 112 | |
113 | + public static List<Map> getSelectedNodes(int id) | |
114 | + { | |
115 | + | |
116 | + List<Map> list = new ArrayList<>(); | |
117 | + for (SmsServiceEnums e : SmsServiceEnums.values()) { | |
118 | + if(e.getId() == id) { | |
119 | + Map rootMap = new HashMap(); | |
120 | + rootMap.put("id",e.getId()); | |
121 | + rootMap.put("name",e.getName()); | |
122 | + rootMap.put("pid",e.getPid()); | |
123 | + if (isLeaf(e.getId())) | |
124 | + { | |
125 | + rootMap.put("children",getSmsServiceTree(e.getId())); | |
126 | + rootMap.put("isLeaf",false); | |
127 | + } | |
128 | + else | |
129 | + { | |
130 | + rootMap.put("isLeaf",true); | |
131 | + } | |
132 | + list.add(rootMap); | |
133 | + } | |
134 | + } | |
135 | + return list; | |
136 | + | |
137 | + } | |
138 | + | |
113 | 139 | |
114 | 140 | /** |
115 | 141 | * 只要子节点 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/EnumsController.java
View file @
a4efac6
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/SmsConfigFacade.java
View file @
a4efac6
... | ... | @@ -2,6 +2,7 @@ |
2 | 2 | |
3 | 3 | import com.lyms.platform.biz.service.*; |
4 | 4 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
5 | +import com.lyms.platform.common.enums.SmsServiceEnums; | |
5 | 6 | import com.lyms.platform.common.enums.WeekEnums; |
6 | 7 | import com.lyms.platform.common.enums.YnEnums; |
7 | 8 | import com.lyms.platform.common.result.BaseObjectResponse; |
8 | 9 | |
... | ... | @@ -212,8 +213,25 @@ |
212 | 213 | } |
213 | 214 | sr.setDeptPrefix(deptsPrefixs); |
214 | 215 | List<Map> smsService = JsonUtil.toList(model.getSmsService(), Map.class); |
215 | - sr.setSmsService(smsService); | |
216 | + sr.setSmsService(getSelectedNode(smsService)); | |
216 | 217 | return sr; |
218 | + } | |
219 | + | |
220 | + private List<Map> getSelectedNode(List<Map> smsServices) | |
221 | + { | |
222 | + List<Map> nodes = new ArrayList<>(); | |
223 | + | |
224 | + for(Map service : smsServices) | |
225 | + { | |
226 | + for(Object obj : service.keySet()) | |
227 | + { | |
228 | + Integer id = (Integer)obj; | |
229 | + List<Map> list = SmsServiceEnums.getSelectedNodes(id); | |
230 | + nodes.addAll(list); | |
231 | + } | |
232 | + | |
233 | + } | |
234 | + return nodes; | |
217 | 235 | } |
218 | 236 | |
219 | 237 |