Browse Source

竖井类型获取,参数调整,格式化返回值

lvxianyun 3 years ago
parent
commit
aa31b99739

+ 7 - 4
src/main/java/com/persagy/proxy/adm/controller/AdmShaftController.java

@@ -142,7 +142,7 @@ public class AdmShaftController {
      */
     @PostMapping("/query")
     public AdmResponse query(@RequestBody AdmQueryCriteria request) throws Exception {      
-        request.setName("shaft");
+        request.setName(AdmShaft.OBJ_TYPE);
         return service.doQuery(AdmContextUtil.toDmpContext(), request, AdmShaft.class);
     }
 
@@ -256,14 +256,17 @@ public class AdmShaftController {
                     for (HashMap map : datasourceList){
                         datasourceMap.put(map.get("code").toString(),map.get("name").toString());
                     }
-                    Map<String, String> datasourceMapUsed = new HashMap<>(datasourceMap.size());
+                    Map<String, Object> datasourceMapUsed = new HashMap<>(datasourceMap.size());
                     listInfos.stream().forEach(map -> {
                         if(!datasourceMapUsed.containsKey(map.get("shaftFuncType")) || datasourceMap.containsKey(map.get("shaftFuncType"))){
-                            datasourceMapUsed.put(map.get("shaftFuncType").toString(),datasourceMap.get(map.get("shaftFuncType").toString()));
+                            JSONObject jsonObject = new JSONObject();
+                            jsonObject.put("id", map.get("shaftFuncType").toString());
+                            jsonObject.put("name", datasourceMap.get(map.get("shaftFuncType").toString()));
+                            datasourceMapUsed.put(map.get("shaftFuncType").toString(),jsonObject);
                         }
                     });
                     if(CollUtil.isNotEmpty(datasourceMapUsed)){
-                        admResponse = AdmResponse.success(Arrays.asList(datasourceMapUsed.entrySet().toArray()));
+                        admResponse = AdmResponse.success(Arrays.asList(datasourceMapUsed.values()));
                     }
                 }
             }