|
|
|
@ -28,7 +28,6 @@ import org.springframework.util.Assert;
|
|
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.net.URISyntaxException;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.HashSet;
|
|
|
|
|
import java.util.List;
|
|
|
|
@ -129,8 +128,8 @@ public class NoticeManageImpl implements NoticeManage {
|
|
|
|
|
return notice;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Transactional
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional
|
|
|
|
|
public void updateNotice(JSONObject manager, String noticeId, NoticeInfo info) throws Exception {
|
|
|
|
|
JSONObject noticeInfo = noticeManageMapper.getNoticeDetailById(noticeId);
|
|
|
|
|
Assert.notNull(noticeInfo);
|
|
|
|
@ -144,7 +143,6 @@ public class NoticeManageImpl implements NoticeManage {
|
|
|
|
|
}
|
|
|
|
|
if (!notice.getBoolean("merchants_type")){
|
|
|
|
|
StringBuilder sendClients = new StringBuilder();
|
|
|
|
|
|
|
|
|
|
List<JSONObject> clients = clientMapper.listValidClient();
|
|
|
|
|
clients.forEach(c -> {
|
|
|
|
|
if (c.getInteger("parent_client_id")==null || c.getInteger("parent_client_id")!=9){
|
|
|
|
@ -154,22 +152,27 @@ public class NoticeManageImpl implements NoticeManage {
|
|
|
|
|
});
|
|
|
|
|
if (sendClients.length()>0){
|
|
|
|
|
notice.put("send_clients",sendClients.substring(0,sendClients.length()-1));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
notice.put("send_clients",info.getSend_clients());
|
|
|
|
|
}
|
|
|
|
|
noticeManageMapper.updateNotice(notice);
|
|
|
|
|
|
|
|
|
|
if (info.getStatus() != null && info.getSend_clients() != null) {
|
|
|
|
|
if (info.getStatus().equals("1") && noticeInfo.getString("status").equals("0") && !info.getSend_clients().isEmpty()) {
|
|
|
|
|
|
|
|
|
|
String client_monikers []=info.getSend_clients().split(",");
|
|
|
|
|
Set<String> mailto = new HashSet<>();
|
|
|
|
|
ArrayList<String> mailboxs = new ArrayList<>();
|
|
|
|
|
for (String clientMoniker : client_monikers) {
|
|
|
|
|
JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker);
|
|
|
|
|
String contact_email = client.getString("contact_email");
|
|
|
|
|
if (contact_email!=null && !mailboxs.contains(contact_email)){
|
|
|
|
|
mailto.add(contact_email);
|
|
|
|
|
mailboxs.add(contact_email);
|
|
|
|
|
if(notice.getBoolean("merchants_type")){
|
|
|
|
|
for (String clientMoniker : client_monikers) {
|
|
|
|
|
JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker);
|
|
|
|
|
String contact_email = client.getString("contact_email");
|
|
|
|
|
if (contact_email!=null){
|
|
|
|
|
mailto.add(contact_email);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
mailto.add("merchants@mail.royalpay.com.au");
|
|
|
|
|
}
|
|
|
|
|
if(info.isIs_tomail()){
|
|
|
|
|
//同时发送给股东
|
|
|
|
@ -195,7 +198,6 @@ public class NoticeManageImpl implements NoticeManage {
|
|
|
|
|
retailAppService.sendNoticeMessage(info,client_monikers);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|