рефакторинг адресатов баг репортов
This commit is contained in:
@@ -4,12 +4,10 @@ import Common.Database.Objects.rDBObject;
|
||||
import Common.Utils.TextLog;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Utils.Vector_;
|
||||
import _VisualDVM.ComponentsServer.BugReport.Json.RecipientJson;
|
||||
import _VisualDVM.ComponentsServer.BugReport.Json.RecipientsJson;
|
||||
import _VisualDVM.ComponentsServer.BugReport.Json.VisualiserSettingsJson;
|
||||
import _VisualDVM.ComponentsServer.BugReportRecipient.BugReportRecipient;
|
||||
import _VisualDVM.ComponentsServer.BugReportSetting.BugReportSetting;
|
||||
import _VisualDVM.ComponentsServer.Component.ComponentType;
|
||||
import _VisualDVM.ComponentsServer.Recipient.Recipient;
|
||||
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
|
||||
import _VisualDVM.Constants;
|
||||
import _VisualDVM.Global;
|
||||
@@ -25,11 +23,12 @@ public class BugReport extends rDBObject {
|
||||
public long visualiser_version = -1;
|
||||
public long sapfor_version = -1;
|
||||
public String comment = "";
|
||||
@Description("DEFAULT ''")
|
||||
@Description("IGNORE")
|
||||
public String packedRecipientsJson = "";
|
||||
@Description("IGNORE")
|
||||
public String packedSettingsJson = ""; //todo вывести.
|
||||
public Vector<BugReportSetting> settings=null;
|
||||
public Vector<BugReportSetting> settings = null;
|
||||
public Vector<BugReportRecipient> recipients = null;
|
||||
public String executor = "";
|
||||
@Description("DEFAULT ''")
|
||||
public String executor_address = "";
|
||||
@@ -71,7 +70,6 @@ public class BugReport extends rDBObject {
|
||||
change_date = b.change_date;
|
||||
description = b.description;
|
||||
comment = b.comment;
|
||||
packedRecipientsJson = b.packedRecipientsJson;
|
||||
state = b.state;
|
||||
percentage = b.percentage;
|
||||
//-
|
||||
@@ -80,8 +78,6 @@ public class BugReport extends rDBObject {
|
||||
project_version = b.project_version;
|
||||
visualiser_version = b.visualiser_version;
|
||||
sapfor_version = b.sapfor_version;
|
||||
// packedSettingsJson = b.packedSettingsJson;
|
||||
//-
|
||||
descriptionAdditionDraft = b.descriptionAdditionDraft;
|
||||
commentAdditionDraft = b.commentAdditionDraft;
|
||||
owner = b.owner;
|
||||
@@ -157,20 +153,15 @@ public class BugReport extends rDBObject {
|
||||
}
|
||||
//--->
|
||||
public void CheckRecipients() {
|
||||
for (Recipient recipient : Global.componentsServer.db.recipients.Data.values())
|
||||
recipient.Select(packedRecipientsJson.contains(recipient.email));
|
||||
}
|
||||
public void saveRecipientsAsJson(Vector<Recipient> recipients) {
|
||||
packedRecipientsJson = Utils_.gson.toJson(new RecipientsJson(recipients));
|
||||
}
|
||||
public Vector<String> getRecipients() {
|
||||
Vector<String> res = new Vector<>();
|
||||
if (packedRecipientsJson.isEmpty()) return res;
|
||||
RecipientsJson recipients = Utils_.gson.fromJson(packedRecipientsJson, RecipientsJson.class);
|
||||
for (RecipientJson recipientJson : recipients.array) {
|
||||
res.add(recipientJson.address);
|
||||
Global.componentsServer.db.recipients.getUI().SelectAll(false);
|
||||
Vector<BugReportRecipient> recipients_ = state.equals(BugReportState.draft) ?
|
||||
recipients : Global.componentsServer.db.getVectorByFK(this, BugReportRecipient.class);
|
||||
if (recipients_!=null) {
|
||||
for (BugReportRecipient bugReportRecipient : recipients_) {
|
||||
if (Global.componentsServer.db.recipients.containsKey(bugReportRecipient.email))
|
||||
Global.componentsServer.db.recipients.get(bugReportRecipient.email).Select(true);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
public VisualiserSettingsJson getSettingsJson() {
|
||||
return packedSettingsJson.isEmpty() ? new VisualiserSettingsJson() : Utils_.gson.fromJson(packedSettingsJson, VisualiserSettingsJson.class);
|
||||
|
||||
Reference in New Issue
Block a user