|

楼主 |
发表于 2017-12-8 13:37:15
|
显示全部楼层
报错:构造函数 JSONArray(String)未定义
- public static Table printExpertMessages(String zjbh) throws Exception {
- zjbh = "695";
- String data_model = "/XGDXMGL/ExpertReview/data";
- String sql = "select * from t_pms_expertdefine where bh = '" + zjbh + "' ";
- Table tab = SQL.select(sql, null, data_model);
- System.out.println(sql);
- System.out.println(tab.size());
- System.out.println("=======================================================");
- Iterator<Row> it = tab.iterator();
- if (tab.size() > 0) {
- while (it.hasNext()) {
- Row row = it.next();
- String zp = row.getString("ZP");// 取出照片字段
- System.out.println("ZP=========" + zp);
- if (zp.length() > 2) {
- JSONArray ja = new JSONArray(zp);
- JSONObject jsonObject = ja.getJSONObject(0);
- String docPath = jsonObject.getString("docPath");
- String fileID = jsonObject.getString("fileID");
- try {
- String urlPattern = "/repository/file/view/" + fileID + "/last/content";
- String url = addBsessionid(DocAdapter.queryNoPermissionHost(true, docPath, urlPattern, true)); // 通过docPath和fileID获得图片的url
- System.out.println(url);
- row.setString("ZP", url); // 将url存入table对象
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- }
- }
- return tab;
- }
- protected static String addBsessionid(String url) {
- String bessionid = ActionUtils.getRequestContext().getSessionContext().getSessionID();
- if (url.contains("?")) {
- return url + "&bsessionid=" + bessionid;
- } else {
- return url + "?bsessionid=" + bessionid;
- }
- }
复制代码 |
|