no message
This commit is contained in:
@@ -2,22 +2,23 @@ package _VisualDVM.ComponentsServer.Recipient;
|
||||
import Common.Database.Tables.DataSet;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import _VisualDVM.ComponentsServer.Recipient.Json.RecipientJson;
|
||||
import _VisualDVM.ComponentsServer.Recipient.Json.RecipientsJson;
|
||||
import _VisualDVM.ComponentsServer.Recipient.Json.UserAccountJson;
|
||||
import _VisualDVM.ComponentsServer.Recipient.Json.UserAccountsJson;
|
||||
import _VisualDVM.ComponentsServer.Recipient.UI.RecipientsForm;
|
||||
import _VisualDVM.Constants;
|
||||
import _VisualDVM.Global;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.Vector;
|
||||
public class RecipientsDataSet extends DataSet<String, Recipient> {
|
||||
public RecipientsDataSet() {
|
||||
super(String.class, Recipient.class);
|
||||
}
|
||||
public void Unpack(String packed){
|
||||
System.out.println(Utils_.Brackets(packed));
|
||||
clear();
|
||||
RecipientsJson jsons = Utils_.gson.fromJson(packed, RecipientsJson.class);
|
||||
for (RecipientJson json: jsons.values){
|
||||
Global.componentsServer.db.recipients.put(json.email, new Recipient(json));
|
||||
UserAccountsJson jsons = Utils_.gson.fromJson(packed, UserAccountsJson.class);
|
||||
for (UserAccountJson userAccountJson: jsons.values){
|
||||
Global.componentsServer.db.recipients.put(userAccountJson.email, new Recipient(userAccountJson));
|
||||
}
|
||||
}
|
||||
@Override
|
||||
@@ -32,4 +33,22 @@ public class RecipientsDataSet extends DataSet<String, Recipient> {
|
||||
public String getSingleDescription() {
|
||||
return "адресат";
|
||||
}
|
||||
public Vector<String> getSelectedMails(){
|
||||
//баг текущий. значит адресаты уже активные и правильные. дополняем их админами и автором.
|
||||
Vector<String> res = new Vector<>();
|
||||
for (Recipient recipient:Data.values()){
|
||||
if (recipient.isSelected()&& !res.contains(recipient.email))
|
||||
res.add(recipient.email);
|
||||
}
|
||||
//--
|
||||
if (!res.contains(Global.mainModule.getAccount().email))
|
||||
res.add(Global.mainModule.getAccount().email);
|
||||
//--
|
||||
for (String admin_mail : Constants.admins_mails) {
|
||||
if (!res.contains(admin_mail))
|
||||
res.add(admin_mail);
|
||||
}
|
||||
//--
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user