v++
массовые операции с бд тестирования
This commit is contained in:
@@ -2,8 +2,8 @@ package Visual_DVM_2021.Passes.All;
|
||||
import Common.Global;
|
||||
import TestingSystem.Common.TestingServer;
|
||||
import TestingSystem.SAPFOR.SapforConfigurationCommand.SapforConfigurationCommand;
|
||||
import Visual_DVM_2021.Passes.Server.DeleteServerObject;
|
||||
public class DeleteSapforConfigurationCommand extends DeleteServerObject<TestingServer, SapforConfigurationCommand> {
|
||||
import Visual_DVM_2021.Passes.DeleteServerObjects;
|
||||
public class DeleteSapforConfigurationCommand extends DeleteServerObjects<TestingServer, SapforConfigurationCommand> {
|
||||
public DeleteSapforConfigurationCommand() {
|
||||
super(Global.testingServer, SapforConfigurationCommand.class);
|
||||
}
|
||||
|
||||
@@ -1,17 +1,38 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Common.Database.Database;
|
||||
import Common.Global;
|
||||
import Common.UI.UI;
|
||||
import Common.Utils.Utils;
|
||||
import TestingSystem.Common.TestingServer;
|
||||
import TestingSystem.DVM.TasksPackage.TasksPackageState;
|
||||
import TestingSystem.SAPFOR.SapforTasksPackage.SapforTasksPackage;
|
||||
import Visual_DVM_2021.Passes.Server.DeleteServerAccountObject;
|
||||
public class DeleteSapforTasksPackage extends DeleteServerAccountObject<SapforTasksPackage> {
|
||||
import Visual_DVM_2021.Passes.DeleteServerObjects;
|
||||
|
||||
import java.util.Vector;
|
||||
public class DeleteSapforTasksPackage extends DeleteServerObjects<TestingServer,SapforTasksPackage> {
|
||||
public DeleteSapforTasksPackage() {
|
||||
super(SapforTasksPackage.class);
|
||||
super(Global.testingServer,SapforTasksPackage.class);
|
||||
}
|
||||
protected Database getDb() {
|
||||
return server.account_db;
|
||||
}
|
||||
protected String getEmail() {
|
||||
return Current.getAccount().email;
|
||||
}
|
||||
Vector<SapforTasksPackage> to_delete;
|
||||
//---
|
||||
public boolean checkActivity() {
|
||||
if (!target.state.equals(TasksPackageState.Done) && !target.state.equals(TasksPackageState.Aborted)) {
|
||||
Log.Writeln_("Нельзя удалить активный пакет!");
|
||||
return false;
|
||||
to_delete = new Vector<>();
|
||||
for (Object key : target) {
|
||||
SapforTasksPackage tasksPackage = server.account_db.sapforTasksPackages.get(key);
|
||||
if (!tasksPackage.state.equals(TasksPackageState.Done) &&
|
||||
!tasksPackage.state.equals(TasksPackageState.Aborted)
|
||||
) {
|
||||
Log.Writeln_("Нельзя удалить активный пакет " + key + " !");
|
||||
return false;
|
||||
}
|
||||
to_delete.add(tasksPackage);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -26,7 +47,8 @@ public class DeleteSapforTasksPackage extends DeleteServerAccountObject<SapforTa
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
super.performDone();
|
||||
Utils.delete_with_check(target.getLocalWorkspace());
|
||||
for (SapforTasksPackage tasksPackage: to_delete)
|
||||
Utils.delete_with_check(tasksPackage.getLocalWorkspace());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,12 +23,6 @@ public class DeleteTasksPackage extends DeleteServerObjects<TestingServer, Tasks
|
||||
TasksPackage tasksPackage = server.account_db.packages.get(key);
|
||||
if (!tasksPackage.state.equals(TasksPackageState.Done) &&
|
||||
!tasksPackage.state.equals(TasksPackageState.Aborted)
|
||||
/*&&
|
||||
!tasksPackage.state.equals(TasksPackageState.Queued) &&
|
||||
!tasksPackage.state.equals(TasksPackageState.TestsSynchronize) &&
|
||||
!tasksPackage.state.equals(TasksPackageState.PackageWorkspaceCreation) &&
|
||||
!tasksPackage.state.equals(TasksPackageState.PackageStart)
|
||||
*/
|
||||
) {
|
||||
Log.Writeln_("Нельзя удалить активный пакет " + key + " !");
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user