|
build version : 5.3.6.5569
build time : 2016.10.21 19:17:28
com.justep.exception.BusinessException: 编码: JUSTEP150087; 提示: 不支持数据类型"[Lcom.alibaba.fastjson.JSONObject;@1a22076", class "class [Lcom.alibaba.fastjson.JSONObject;"
at com.justep.exception.BusinessException.create(Unknown Source)
at com.justep.system.transform.ResultTransform.transformByJson(Unknown Source)
at com.justep.system.transform.ResultTransform.transform(Unknown Source)
at com.justep.system.transform.ResponseTransform.transform(Unknown Source)
at com.justep.system.action.Engine.translateResult(Unknown Source)
at com.justep.system.action.Engine.invokeActions(Native Method)
at com.justep.system.action.Engine.invokeActions(Unknown Source)
at com.justep.business.server.BusinessServer.doAction(Unknown Source)
at com.justep.business.server.BusinessServer.doExcute(Unknown Source)
at com.justep.business.server.BusinessServer.excute(Unknown Source)
at com.justep.business.server.BusinessServer.excute(Unknown Source)
at com.justep.business.server.BusinessServerServlet.execService(Unknown Source)
at com.justep.business.server.BusinessServerServlet.service(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
at com.justep.x.bs.BusinessServerServlet.service(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:745)
代码如下:
public static JSONObject[] getColumns(String tableName){
JSONObject object = null;
JSONObject[] arrObject = null;
String userID = ContextHelper.getOperator().getID();
System.out.println(userID);
Connection conn = DBUtils.getConnection();
PreparedStatement statement = null;
ResultSet rs = null;
//判断查询表是否有配置
String sql = "select * from tabGridSet where fTabName = '"+tableName+"'";
try {
System.out.println(sql);
statement = conn.prepareStatement(sql);
rs = statement.executeQuery();
if (rs.next()) {
//判断查询表是否有当前人配置
System.out.println(sql);
sql = "select * from tabGridSet where fTabName = '"+tableName+"' and fUsedType='person' and fOpeatorID = '"+userID+"'";
statement = conn.prepareStatement(sql);
rs = statement.executeQuery();
if (rs.next()) {
System.out.println(sql);
String[] columns = rs.getString("fFildName").split(",");
String[] labels = rs.getString("fFileComment").split(",");
arrObject = new JSONObject[columns.length];
for(int i = 0 ;i<columns.length;i++){
object = new JSONObject();
object.put("name", columns[i]);
object.put("xid", "column"+i);
object.put("label", labels[i]);
object.put("searchoptions","sopt : [ 'eq', 'ne', 'bw', 'bn', 'ew', 'en', 'cn', 'nc', 'nu', 'nn', 'in', 'ni' ] ");
arrObject[i]=object;
}
}else{
//判断查询表是否有当前登录机构配置
sql = "select * from tabGridSet where fTabName = '"+tableName+"' and fUsedType='org' and fOpeatorID = '"+userID+"'";
statement = conn.prepareStatement(sql);
rs = statement.executeQuery();
if (rs.next()) {
System.out.println(sql);
String[] columns = rs.getString("fFildName").split(",");
String[] labels = rs.getString("fFileComment").split(",");
arrObject = new JSONObject[columns.length];
for(int i = 0 ;i<columns.length;i++){
object = new JSONObject();
object.put("name", columns[i]);
object.put("xid", "column"+i);
object.put("label", labels[i]);
object.put("searchoptions","sopt : [ 'eq', 'ne', 'bw', 'bn', 'ew', 'en', 'cn', 'nc', 'nu', 'nn', 'in', 'ni' ] ");
arrObject[i]=object;
}
}
}
}
//如果都没有则返回length为0的数组;
return arrObject;
} catch (SQLException e) {
// TODO 自动生成的 catch 块
e.printStackTrace();
}finally{
DBUtils.close(conn, statement, rs);
}
return null;
}
|
|