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

+ 9 - 20
o2server/x_console/src/main/java/com/x/server/console/Main.java

@@ -43,7 +43,6 @@ import com.x.server.console.action.ActionEraseContentBbs;
 import com.x.server.console.action.ActionEraseContentCms;
 import com.x.server.console.action.ActionEraseContentLog;
 import com.x.server.console.action.ActionEraseContentProcessPlatform;
-import com.x.server.console.action.ActionEraseContentReport;
 import com.x.server.console.action.ActionRestoreData;
 import com.x.server.console.action.ActionRestoreStorage;
 import com.x.server.console.action.ActionSetPassword;
@@ -52,6 +51,7 @@ import com.x.server.console.action.ActionShowMemory;
 import com.x.server.console.action.ActionShowOs;
 import com.x.server.console.action.ActionShowThread;
 import com.x.server.console.action.ActionUpdate;
+import com.x.server.console.action.ActionUpdateFile;
 import com.x.server.console.action.ActionVersion;
 import com.x.server.console.log.LogTools;
 import com.x.server.console.server.Servers;
@@ -275,7 +275,7 @@ public class Main {
 
 					matcher = CommandFactory.update_pattern.matcher(cmd);
 					if (matcher.find()) {
-						if (update(matcher.group(1))) {
+						if (update(matcher.group(1), matcher.group(2), matcher.group(3))) {
 							stopAll();
 							System.exit(0);
 						} else {
@@ -283,9 +283,9 @@ public class Main {
 						}
 					}
 
-					matcher = CommandFactory.fastUpdate_pattern.matcher(cmd);
+					matcher = CommandFactory.updateFile_pattern.matcher(cmd);
 					if (matcher.find()) {
-						if (fastUpdate(matcher.group(1))) {
+						if (updateFile(matcher.group(1), matcher.group(2), matcher.group(3))) {
 							stopAll();
 							System.exit(0);
 						} else {
@@ -315,9 +315,6 @@ public class Main {
 						case "log":
 							eraseContentLog(matcher.group(2));
 							break;
-						case "report":
-							eraseContentReport(matcher.group(2));
-							break;
 						case "bbs":
 							eraseContentBbs(matcher.group(2));
 							break;
@@ -421,18 +418,19 @@ public class Main {
 		return true;
 	}
 
-	private static boolean fastUpdate(String password) {
+	private static boolean update(String password, String backup, String latest) {
 		try {
-			return new ActionUpdate().execute(password, false, true);
+			return new ActionUpdate().execute(password, BooleanUtils.toBoolean(backup),
+					BooleanUtils.toBoolean(latest));
 		} catch (Exception e) {
 			e.printStackTrace();
 		}
 		return true;
 	}
 
-	private static boolean update(String password) {
+	private static boolean updateFile(String path, String backup, String password) {
 		try {
-			return new ActionUpdate().execute(password, true, false);
+			return new ActionUpdateFile().execute(path, BooleanUtils.toBoolean(backup), password);
 		} catch (Exception e) {
 			e.printStackTrace();
 		}
@@ -885,13 +883,4 @@ public class Main {
 		return false;
 	}
 
-	private static boolean eraseContentReport(String password) throws Exception {
-		try {
-			return new ActionEraseContentReport().execute(password);
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-		return false;
-	}
-
 }

+ 22 - 10
o2server/x_organization_core_express/src/main/java/com/x/organization/core/express/Organization.java

@@ -216,15 +216,27 @@ public class Organization {
 
 	}
 
-	public Detail detail(EffectivePerson effectivePerson) throws Exception {
-		Detail o = new Detail();
-		o.setPerson(effectivePerson.getDistinguishedName());
-		o.setIdentityList(identity().listWithPerson(effectivePerson));
-		o.setUnitList(unit().listWithPerson(effectivePerson));
-		o.setUnitAllList(unit().listWithPersonSupNested(effectivePerson));
-		o.setGroupList(group().listWithPerson(effectivePerson.getDistinguishedName()));
-		o.setRoleList(role().listWithPerson(effectivePerson));
-		return o;
-	}
+//	public PersonDetail detail(EffectivePerson effectivePerson) throws Exception {
+//		PersonDetail o = new PersonDetail();
+//		o.setPerson(effectivePerson.getDistinguishedName());
+//		o.setIdentityList(identity().listWithPerson(effectivePerson));
+//		o.setUnitList(unit().listWithPerson(effectivePerson));
+//		o.setUnitAllList(unit().listWithPersonSupNested(effectivePerson));
+//		o.setGroupList(group().listWithPerson(effectivePerson.getDistinguishedName()));
+//		o.setRoleList(role().listWithPerson(effectivePerson));
+//		return o;
+//	}
+//
+//	public PersonDetail detail(String name) throws Exception {
+//		PersonDetail o = new PersonDetail();
+//		String person = this.person().get(name);
+//		o.setPerson(person);
+//		o.setIdentityList(identity().listWithPerson(person));
+//		o.setUnitList(unit().listWithPerson(person));
+//		o.setUnitAllList(unit().listWithPersonSupNested(person));
+//		o.setGroupList(group().listWithPerson(person));
+//		o.setRoleList(role().listWithPerson(person));
+//		return o;
+//	}
 
 }

+ 1 - 1
o2server/x_organization_core_express/src/main/java/com/x/organization/core/express/Detail.java → o2server/x_organization_core_express/src/main/java/com/x/organization/core/express/PersonDetail.java

@@ -6,7 +6,7 @@ import org.apache.commons.collections4.list.TreeList;
 
 import com.x.base.core.project.annotation.FieldDescribe;
 
-public class Detail {
+public class PersonDetail {
 
 	@FieldDescribe("当前用户")
 	private String person = "";