TableJoin.LOG.info("getUserTables:"+sql);
ResultSet res = stmt.executeQuery(sql);
JSONObject jsonObj = new JSONObject();
jsonObj.put("code", "1");
jsonObj.put("_exehql", sql);
JSONArray jsonArray = new JSONArray();
while (res.next()) {
JSONObject item = new JSONObject();
item.put("source", res.getString("source"));
item.put("tableShowName", res.getString("tableShowName"));//展示名称
item.put("tableName", res.getString("tableName"));//uuid
item.put("colsShowName", res.getString("colsShowName").replaceAll("\\(", "_").replaceAll("\\)", "_").replaceAll(" ", "").replaceAll("_,", ",").replaceAll(",$", ""));
item.put("colsName", res.getString("colsName"));
item.put("colsType", res.getString("colsType"));
item.put("splitString", res.getString("splitString"));
item.put("txtStorePath", res.getString("txtStorePath"));
item.put("indexStorePath", res.getString("indexStorePath"));
item.put("extval", res.getString("extval"));
item.put("status", res.getString("status"));
item.put("username", res.getString("username"));
item.put("createtime", res.getString("createtime"));
item.put("lastuptime", res.getString("lastuptime"));
item.put("joins", res.getString("joins"));
item.put("stage", res.getString("stage"));
item.put("percent", res.getString("percent"));
item.put("resultkb", parseInt(res.getString("resultkb"))>0?res.getString("resultkb"):"<1");
item.put("memo", String.valueOf(res.getString("memo")));
boolean isoversize= (!res.getString("source").equals("8"))&&parseInt(res.getString("resultkb"))>512000;
boolean issuccess=res.getString("status").equals("INDEX")&&res.getString("extval").equals("0");
boolean iserror=res.getString("status").equals("FAIL")||!res.getString("extval").equals("0");
double percent=parsePercent(res.getString("stage"),res.getString("percent"),issuccess);
if(percent>=100&&res.getString("source").equals("8")&&parseInt(res.getString("resultkb"))<=0)
{
issuccess=false;
iserror=true;
}
boolean isallowEdit=!res.getString("status").equals("INDEXING")&&res.getString("source").equals("1");
item.put("allowCreate",String.valueOf(res.getString("source").equals("2")&&issuccess&&percent>=100&&!isoversize));//是否允许将离线下载转换为个人表
item.put("allowUpload",String.valueOf(isallowEdit&&res.getString("status").equals("init")));//上传
item.put("allowDownload",String.valueOf((issuccess||res.getString("status").equals("DUMP"))&&percent>=100));//下载
item.put("allowJoin",String.valueOf(res.getString("source").equals("1")&&issuccess&&percent>=100&&!isoversize));//join
item.put("allowSend",String.valueOf(issuccess&&percent>=100));//推送
item.put("isError", iserror);
String uuidshow=iserror?("<br>"+res.getString("tableName")):"";
item.put("proccess", ((res.getString("status").equals("DUMP")||iserror)?"0":DF_FORMAT.format(percent))+"%");
item.put("msg", String.valueOf(iserror?"服务器异常":isoversize?"数据文件超过500M ":res.getString("status").equals("DUMP")?"设置关联关系的字段有重复值":issuccess&&percent>=100?"成功":res.getString("status").equals("init")?"等待上传数据":"处理中...")+uuidshow);
jsonArray.put(item);
}
HashMap<String,String> cnt=getUserTablesCount(username, type,moduleName);
JSONObject data = new JSONObject();