Index: build.gradle
===================================================================
diff -u -r17065 -r17182
--- build.gradle (.../build.gradle) (revision 17065)
+++ build.gradle (.../build.gradle) (revision 17182)
@@ -216,6 +216,7 @@
dependencies {
+ compile group: 'com.jfinal', name: 'jfinal', version: '2.2'
compile group: 'org.apache.axis', name: 'axis', version:'1.4'
compile group: 'org.apache.axis', name: 'axis-ant', version:'1.4'
Index: forgon-tools/src/main/java/com/forgon/entity/ExtJsEntity.java
===================================================================
diff -u
--- forgon-tools/src/main/java/com/forgon/entity/ExtJsEntity.java (revision 0)
+++ forgon-tools/src/main/java/com/forgon/entity/ExtJsEntity.java (revision 17182)
@@ -0,0 +1,114 @@
+package com.forgon.entity;
+
+/**
+ * @author zhonghaowen
+ * @apiNote extJs实体类, 里面有分页的属性, sql的select条件, where条件, order条件
+ * @since 2017-02-04
+ */
+public class ExtJsEntity {
+
+ /**
+ * select的语句,不包括from
+ */
+ private String select;
+
+ /**
+ * from后面语句,包括from
+ */
+ private String where;
+
+ /**
+ * 排序语句
+ */
+ private String order;
+
+ /**
+ * 分页的页数
+ */
+ private int start;
+
+ /**
+ * 分页的大小
+ */
+ private int limit;
+
+ /**
+ * 查询表的别名
+ */
+ private String alias;
+
+ public ExtJsEntity() {
+ }
+
+
+ public ExtJsEntity(String select, String where, String order) {
+ this.select = select;
+ this.where = where;
+ this.order = order;
+ }
+
+ public ExtJsEntity(String where) {
+ this.where = where;
+ }
+
+ public String getSelect() {
+ return select;
+ }
+
+ public void setSelect(String select) {
+ this.select = select;
+ }
+
+ public String getWhere() {
+ return where;
+ }
+
+ public void setWhere(String where) {
+ this.where = where;
+ }
+
+ public String getOrder() {
+ return order;
+ }
+
+ public void setOrder(String order) {
+ this.order = order;
+ }
+
+ public int getStart() {
+ return start;
+ }
+
+ public void setStart(int start) {
+ this.start = start;
+ }
+
+ public int getLimit() {
+ return limit;
+ }
+
+ public void setLimit(int limit) {
+ this.limit = limit;
+ }
+
+
+ public String getAlias() {
+ return alias;
+ }
+
+ public void setAlias(String alias) {
+ this.alias = alias;
+ }
+
+ @Override
+ public String toString() {
+ return "ExtJsEntity{" +
+ "select='" + select + '\'' +
+ ", where='" + where + '\'' +
+ ", order='" + order + '\'' +
+ ", start=" + start +
+ ", limit=" + limit +
+ ", alias='" + alias + '\'' +
+ '}';
+ }
+}
Index: ssts-web/src/main/resources/spring/applicationContext-service.xml
===================================================================
diff -u -r16279 -r17182
--- ssts-web/src/main/resources/spring/applicationContext-service.xml (.../applicationContext-service.xml) (revision 16279)
+++ ssts-web/src/main/resources/spring/applicationContext-service.xml (.../applicationContext-service.xml) (revision 17182)
@@ -781,6 +781,8 @@
+
+
Index: forgon-core/src/main/java/com/forgon/util/ExtGridUtils.java
===================================================================
diff -u
--- forgon-core/src/main/java/com/forgon/util/ExtGridUtils.java (revision 0)
+++ forgon-core/src/main/java/com/forgon/util/ExtGridUtils.java (revision 17182)
@@ -0,0 +1,440 @@
+package com.forgon.util;
+
+import com.forgon.entity.ExtJsEntity;
+import com.forgon.tools.StrutsParamUtils;
+import com.forgon.tools.hibernate.ObjectDao;
+import com.forgon.tools.json.JSONUtil;
+import com.forgon.tools.util.IntegerUtils;
+import net.sf.json.JSONArray;
+import net.sf.json.JSONObject;
+import org.apache.commons.lang.ArrayUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.log4j.Logger;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author 袁彬
+ */
+public class ExtGridUtils {
+
+ protected Logger logger = Logger.getLogger(this.getClass());
+
+ private static final String GRID_MAPPARAM_FILTER_PREFIX = "grid_filter_";
+ private static final String GRID_MAPPARAM_SORT = "sort";
+ private static final String GRID_SEARCH_FIELDS = "fields";
+ private static final String GRID_SEARCH_QUERY = "query";
+ // private static String GRID_PAGE_START = "start";
+ // private static String GRID_PAGE_LIMIT = "limit";
+ private final static String RESULT = "rows";
+ private final static String TOTAL = "total";
+
+ private ObjectDao objectDao;
+
+ public void setObjectDao(ObjectDao objectDao) {
+ this.objectDao = objectDao;
+ }
+
+ /*public static Map getPagedResult(HttpServletRequest request, String select, String sqlExceptSelect, String order, Object... paras) {
+ int start = StrutsParamUtils.getPraramValue(GRID_PAGE_START, 0);
+ int limit = StrutsParamUtils.getPraramValue(GRID_PAGE_LIMIT, 30);
+ int pageNum = start / limit + 1;
+ //搜索时,优先从搜索框开始,如果没有搜索条件就用列过滤条件
+ // String searchQuery = request.getParameter(GRID_SEARCH_QUERY);
+ if (paras == null) {
+ paras = new Object[]{};
+ }
+ //过滤条件放在所有条件之后
+ List