|
|
|
@ -46,20 +46,21 @@ public class SearchDSProductCatTreeService extends SPIBaseService implements Ext
|
|
|
|
|
// ----业务处理----
|
|
|
|
|
HashMap<String, Object> params = new HashMap<>();
|
|
|
|
|
String res = null;
|
|
|
|
|
String strList = null;
|
|
|
|
|
String strList = "";
|
|
|
|
|
JSONObject str = null;
|
|
|
|
|
JSONObject data = null;
|
|
|
|
|
List<Object> arrayData = null;
|
|
|
|
|
try {
|
|
|
|
|
String resourceFileName = "/getSimpleProductCatTree.txt"; // 注意路径的开头是一个斜杠
|
|
|
|
|
|
|
|
|
|
try (InputStream is = InputStream.class.getResourceAsStream(resourceFileName);
|
|
|
|
|
BufferedReader reader = new BufferedReader(new InputStreamReader(is))) {
|
|
|
|
|
String line;
|
|
|
|
|
while ((line = reader.readLine()) != null) {
|
|
|
|
|
strList = strList + line;
|
|
|
|
|
}
|
|
|
|
|
JSONObject str = JSONObject.parseObject(strList);
|
|
|
|
|
str = JSONObject.parseObject(strList);
|
|
|
|
|
data = str.getJSONObject("data");
|
|
|
|
|
log.info("str:" + data);
|
|
|
|
|
arrayData = new ArrayList<>(data.values());
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
log.error("strerror:" + e.getMessage());
|
|
|
|
|
e.printStackTrace();
|
|
|
|
@ -68,10 +69,10 @@ public class SearchDSProductCatTreeService extends SPIBaseService implements Ext
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error(e.getMessage());
|
|
|
|
|
}
|
|
|
|
|
// Map<String, Object> result = new HashMap<>();
|
|
|
|
|
// result.put("data", data);
|
|
|
|
|
Map<String, Object> result = new HashMap<>();
|
|
|
|
|
result.put("data", arrayData);
|
|
|
|
|
|
|
|
|
|
// ----结果返回----
|
|
|
|
|
return R.ok(Ret.success());
|
|
|
|
|
return R.ok(Ret.success(result));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|