roo00 6 лет назад
Родитель
Сommit
7e065ab6cf

+ 4 - 0
o2server/x_base_core_project/src/main/java/com/x/base/core/project/exception/ExceptionEntityNotExist.java

@@ -18,4 +18,8 @@ public class ExceptionEntityNotExist extends PromptException {
 		super("标识为:{} 的 {} 对象不存在.", flag, name);
 	}
 
+	public <T extends JpaObject> ExceptionEntityNotExist(String flag) {
+		super("标识为:{} 的对象不存在.", flag);
+	}
+
 }

+ 8 - 8
o2server/x_base_core_project/src/main/java/com/x/base/core/project/http/EffectivePerson.java

@@ -129,8 +129,8 @@ public class EffectivePerson extends GsonPropertyObject {
 		return !this.isManager();
 	}
 
-	public boolean isUser(Collection<String> names) {
-		if (Objects.equals(TokenType.user, this.getTokenType())) {
+	public boolean isPerson(Collection<String> names) {
+		if (Objects.equals(TokenType.user, this.getTokenType())||Objects.equals(TokenType.manager, this.getTokenType())) {
 			if (null != names) {
 				List<String> list = new ArrayList<>(names);
 				if (list.contains(this.distinguishedName)) {
@@ -154,16 +154,16 @@ public class EffectivePerson extends GsonPropertyObject {
 		return false;
 	}
 
-	public boolean isUser(String... names) {
-		return this.isUser(Arrays.asList(names));
+	public boolean isPerson(String... names) {
+		return this.isPerson(Arrays.asList(names));
 	}
 
-	public boolean isNotUser(String... names) {
-		return !this.isUser(names);
+	public boolean isNotPerson(String... names) {
+		return !this.isPerson(names);
 	}
 
-	public boolean isNotUser(Collection<String> names) {
-		return !this.isUser(names);
+	public boolean isNotPerson(Collection<String> names) {
+		return !this.isPerson(names);
 	}
 
 	public String getToken() {

+ 5 - 5
o2server/x_base_core_project/src/main/java/com/x/base/core/project/tools/PropertyTools.java

@@ -5,11 +5,11 @@ import org.apache.commons.beanutils.PropertyUtils;
 public class PropertyTools {
 	@SuppressWarnings("unchecked")
 	public static <T> T getOrElse(Object bean, String name, Class<T> cls, T defaultObject) throws Exception {
-		if (null == bean) {
-			return defaultObject;
-		}
-		if (PropertyUtils.isReadable(bean, name)) {
-			return (T) PropertyUtils.getProperty(bean, name);
+		if ((null != bean) && PropertyUtils.isReadable(bean, name)) {
+			Object o = PropertyUtils.getProperty(bean, name);
+			if (null != o) {
+				return (T) o;
+			}
 		}
 		return defaultObject;
 	}

+ 2 - 2
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/factory/element/QueryViewFactory.java

@@ -35,13 +35,13 @@ public class QueryViewFactory extends ElementFactory {
 				&& ListTools.isEmpty(queryView.getAvailablePersonList())) {
 			return true;
 		}
-		if (effectivePerson.isUser(queryView.getCreatorPerson())) {
+		if (effectivePerson.isPerson(queryView.getCreatorPerson())) {
 			return true;
 		}
 		if (effectivePerson.isManager()) {
 			return true;
 		}
-		if (effectivePerson.isUser(queryView.getControllerList())) {
+		if (effectivePerson.isPerson(queryView.getControllerList())) {
 			return true;
 		}
 		if (ListTools.isNotEmpty(queryView.getAvailablePersonList())) {