diff --git a/o2server/x_console/src/main/java/com/x/server/console/Main.java b/o2server/x_console/src/main/java/com/x/server/console/Main.java index b0542117e30cfb2089168200fc630c6b0111208a..da30efc39386a7c9f74fe81c18de354607183bba 100644 --- a/o2server/x_console/src/main/java/com/x/server/console/Main.java +++ b/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; - } - } \ No newline at end of file diff --git a/o2server/x_organization_core_express/src/main/java/com/x/organization/core/express/Organization.java b/o2server/x_organization_core_express/src/main/java/com/x/organization/core/express/Organization.java index d0c9773b2734fcd49e730e4899548f547f856706..d0bd63979ebe28f0744eeb38454540601b07cd0b 100644 --- a/o2server/x_organization_core_express/src/main/java/com/x/organization/core/express/Organization.java +++ b/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; +// } } diff --git a/o2server/x_organization_core_express/src/main/java/com/x/organization/core/express/Detail.java b/o2server/x_organization_core_express/src/main/java/com/x/organization/core/express/PersonDetail.java similarity index 98% rename from o2server/x_organization_core_express/src/main/java/com/x/organization/core/express/Detail.java rename to o2server/x_organization_core_express/src/main/java/com/x/organization/core/express/PersonDetail.java index 513bf7eee8bcb6c16e03ad36b28d2a97adbe7ea6..1c8b29552d5930a696534519bd0efe80060f3cc8 100644 --- a/o2server/x_organization_core_express/src/main/java/com/x/organization/core/express/Detail.java +++ b/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 = "";