Explorar el Código

fix sort error

zhouhao hace 6 años
padre
commit
526a05b8fa

+ 6 - 5
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-local/src/main/java/org/hswebframework/web/workflow/util/QueryUtils.java

@@ -82,12 +82,13 @@ public class QueryUtils {
             Method method = ReflectionUtils.findMethod(type, "orderBy" + StringUtils.toUpperCaseFirstOne(name));
             if (method != null && method.getParameterCount() == 0) {
                 ReflectionUtils.invokeMethod(method, query);
+                if ("asc".equals(sort.getOrder())) {
+                    query.asc();
+                } else {
+                    query.desc();
+                }
             }
-            if ("asc".equals(sort.getOrder())) {
-                query.asc();
-            } else {
-                query.desc();
-            }
+
         }
     }
 }