Merge remote-tracking branch 'origin/develop' into develop

master
yuan 6 years ago
commit 6981aa715e

@ -13,7 +13,7 @@ import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
/**
* Create by yixian at 2017-12-13 19:10
*/
@AutoMapper(tablename = "sys_mail_send", pkName = "id")
@AutoMapper(tablename = "sys_mail_send", pkName = {"id", "mail_address"})
public interface MailSendMapper {
@AutoSql(type = SqlType.INSERT)
void save(JSONObject record);
@ -21,6 +21,9 @@ public interface MailSendMapper {
@AutoSql(type = SqlType.UPDATE)
void update(JSONObject record);
@AutoSql(type = SqlType.UPDATE)
void updateStatus(JSONObject record);
@AutoSql(type = SqlType.SELECT)
JSONObject find(@Param("id") String id, @Param("mail_address")String mail_address);
}

@ -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,28 @@ 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");
// mailto.add("test@mail.royalpay.com.au");
}
if(info.isIs_tomail()){
//同时发送给股东
@ -195,7 +199,6 @@ public class NoticeManageImpl implements NoticeManage {
retailAppService.sendNoticeMessage(info,client_monikers);
}
}
}
}

@ -10,8 +10,6 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@RestController
@RequestMapping(value = "/mailgun")
@ -28,10 +26,8 @@ public class MailCallBackController {
@RequestMapping(value = "/callback/dropped", method = RequestMethod.POST)
public void contractList(HttpServletRequest req, HttpServletResponse res) throws Exception {
logger.info("kira"+req.getRequestURL().toString());
// logger.info("kira"+content);
// mailService.dealDroppedNotify(content);
public void contractList(@RequestBody String content) throws Exception {
mailService.dealDroppedNotify(content);
}
}

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="au.com.royalpay.payment.manage.mappers.system.MailSendMapper">
<update id="updateStatus">
update sys_mail_send
set status = #{status}
where id = #{id}
and mail_address = #{mail_address}
</update>
</mapper>
Loading…
Cancel
Save