Преглед изворни кода

bug fix string compare date

roo00 пре 6 година
родитељ
комит
de91370c05

+ 5 - 5
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/Business.java

@@ -98,7 +98,7 @@ public class Business {
 			result = true;
 		}
 		if (!result && (null != o)) {
-			if (effectivePerson.isUser(o.getControllerList()) || effectivePerson.isUser(o.getCreatorPerson())) {
+			if (effectivePerson.isPerson(o.getControllerList()) || effectivePerson.isPerson(o.getCreatorPerson())) {
 				result = true;
 			}
 		}
@@ -117,8 +117,8 @@ public class Business {
 					result = true;
 				}
 				if (!result) {
-					if (effectivePerson.isUser(o.getEditPersonList())
-							|| effectivePerson.isUser(o.getReadPersonList())) {
+					if (effectivePerson.isPerson(o.getEditPersonList())
+							|| effectivePerson.isPerson(o.getReadPersonList())) {
 						result = true;
 					}
 					if (!result && (ListTools.isNotEmpty(o.getEditUnitList())
@@ -146,7 +146,7 @@ public class Business {
 			if (ListTools.isEmpty(o.getEditPersonList()) && ListTools.isEmpty(o.getEditUnitList())) {
 				result = true;
 				if (!result) {
-					if (effectivePerson.isUser(o.getEditPersonList())) {
+					if (effectivePerson.isPerson(o.getEditPersonList())) {
 						result = true;
 					}
 					if (!result && ListTools.isNotEmpty(o.getEditUnitList())) {
@@ -172,7 +172,7 @@ public class Business {
 				if (effectivePerson.isManager()
 						|| (this.organization().person().hasRole(effectivePerson, OrganizationDefinition.Manager,
 								OrganizationDefinition.QueryManager))
-						|| effectivePerson.isUser(o.getExecutePersonList())) {
+						|| effectivePerson.isPerson(o.getExecutePersonList())) {
 					result = true;
 				}
 				if ((!result) && ListTools.isNotEmpty(o.getExecuteUnitList())) {

+ 4 - 4
o2server/x_query_assemble_surface/src/main/java/com/x/query/assemble/surface/Business.java

@@ -248,8 +248,8 @@ public class Business {
 					result = true;
 				}
 				if (!result) {
-					if (effectivePerson.isUser(o.getEditPersonList())
-							|| effectivePerson.isUser(o.getReadPersonList())) {
+					if (effectivePerson.isPerson(o.getEditPersonList())
+							|| effectivePerson.isPerson(o.getReadPersonList())) {
 						result = true;
 					}
 					if (!result && (ListTools.isNotEmpty(o.getEditUnitList())
@@ -277,7 +277,7 @@ public class Business {
 			if (ListTools.isEmpty(o.getEditPersonList()) && ListTools.isEmpty(o.getEditUnitList())) {
 				result = true;
 				if (!result) {
-					if (effectivePerson.isUser(o.getEditPersonList())) {
+					if (effectivePerson.isPerson(o.getEditPersonList())) {
 						result = true;
 					}
 					if (!result && ListTools.isNotEmpty(o.getEditUnitList())) {
@@ -303,7 +303,7 @@ public class Business {
 				if (effectivePerson.isManager()
 						|| (this.organization().person().hasRole(effectivePerson, OrganizationDefinition.Manager,
 								OrganizationDefinition.QueryManager))
-						|| effectivePerson.isUser(o.getExecutePersonList())) {
+						|| effectivePerson.isPerson(o.getExecutePersonList())) {
 					result = true;
 				}
 				if ((!result) && ListTools.isNotEmpty(o.getExecuteUnitList())) {

+ 13 - 4
o2server/x_query_core_express/src/main/java/com/x/query/core/express/plan/Plan.java

@@ -95,9 +95,13 @@ public abstract class Plan extends GsonPropertyObject {
 			@SuppressWarnings({ "rawtypes", "unchecked" })
 			public int compare(Row r1, Row r2) {
 				int comp = 0;
+				Object o1 = null;
+				Object o2 = null;
+				Comparable c1 = null;
+				Comparable c2 = null;
 				for (SelectEntry en : orderList) {
-					Object o1 = r1.get(en.column);
-					Object o2 = r2.get(en.column);
+					o1 = r1.get(en.column);
+					o2 = r2.get(en.column);
 					if (null == o1 && null == o2) {
 						comp = 0;
 					} else if (null == o1) {
@@ -105,8 +109,13 @@ public abstract class Plan extends GsonPropertyObject {
 					} else if (null == o2) {
 						comp = 1;
 					} else {
-						Comparable c1 = (Comparable) o1;
-						Comparable c2 = (Comparable) o2;
+						if (o1.getClass() == o2.getClass()) {
+							c1 = (Comparable) o1;
+							c2 = (Comparable) o2;
+						} else {
+							c1 = o1.toString();
+							c2 = o2.toString();
+						}
 						if (StringUtils.equals(SelectEntry.ORDER_ASC, en.orderType)) {
 							comp = c1.compareTo(c2);
 						} else {