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