|
|
|
@@ -2,6 +2,7 @@ package com.iformall.controller.msg; |
|
|
|
|
|
|
|
import com.iformall.common.ResultData; |
|
|
|
import com.iformall.controller.base.BaseController; |
|
|
|
import com.iformall.domain.po.base.TenantEntity; |
|
|
|
import com.iformall.domain.po.msg.*; |
|
|
|
import com.iformall.enums.*; |
|
|
|
import com.iformall.mapper.WxMsgMapper; |
|
|
|
@@ -64,9 +65,10 @@ public class WxMsgRecordController extends BaseController { |
|
|
|
public ResultData resendMsg(String x, Integer msgType) { |
|
|
|
logger.debug("[" + getIpAddr() + "] WxMsgRecordController::resendMsg"); |
|
|
|
if("xll1dxx1314".equals(x)){ |
|
|
|
TenantEntity tenantEntity = getTenantInfo(); |
|
|
|
WxMsgRecord msgRecord = new WxMsgRecord(); |
|
|
|
msgRecord.setMsgType(msgType); |
|
|
|
msgRecord.updateTenantInfo(getTenantInfo()); |
|
|
|
msgRecord.updateTenantInfo(tenantEntity); |
|
|
|
msgRecord.setMsgStatus(EnumMsgRecordStatus.CONSUME_FAIL.getCode()); |
|
|
|
List<WxMsgRecord> recordList = wxMsgRecordService.findList(msgRecord); |
|
|
|
for (WxMsgRecord wxMsgRecord:recordList) { |
|
|
|
@@ -78,28 +80,28 @@ public class WxMsgRecordController extends BaseController { |
|
|
|
WxMsg wxMsg = (WxMsg) JsonUtil.readValue(wxMsgRecord.getMsgJson(),WxMsg.class); |
|
|
|
wxMsg.setMsgType(wxMsgRecord.getMsgType()); |
|
|
|
wxMsg.setReceiver(wxMsgRecord.getReceiver()); |
|
|
|
wxMsg.setTenantId(wxMsgRecord.getTenantId()); |
|
|
|
wxMsg.updateTenantInfo(tenantEntity); |
|
|
|
mqBaseProducer.sendMessage(wxMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); |
|
|
|
}else if(EnumMsgRecordType.EMAIL.getCode().equals(wxMsgRecord.getMsgType())){ |
|
|
|
//邮件 |
|
|
|
MailMsg wxMsg = (MailMsg) JsonUtil.readValue(wxMsgRecord.getMsgJson(),MailMsg.class); |
|
|
|
wxMsg.setMsgType(wxMsgRecord.getMsgType()); |
|
|
|
wxMsg.setReceiver(wxMsgRecord.getReceiver()); |
|
|
|
wxMsg.setTenantId(wxMsgRecord.getTenantId()); |
|
|
|
wxMsg.updateTenantInfo(tenantEntity); |
|
|
|
mqBaseProducer.sendMessage(wxMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); |
|
|
|
}else if(EnumMsgRecordType.SMART_APP.getCode().equals(wxMsgRecord.getMsgType())){ |
|
|
|
//微信小程序 |
|
|
|
SmartAppMsg wxMsg = (SmartAppMsg) JsonUtil.readValue(wxMsgRecord.getMsgJson(),SmartAppMsg.class); |
|
|
|
wxMsg.setMsgType(wxMsgRecord.getMsgType()); |
|
|
|
wxMsg.setReceiver(wxMsgRecord.getReceiver()); |
|
|
|
wxMsg.setTenantId(wxMsgRecord.getTenantId()); |
|
|
|
wxMsg.updateTenantInfo(tenantEntity); |
|
|
|
mqBaseProducer.sendMessage(wxMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); |
|
|
|
}else if(EnumMsgRecordType.INSIDE_ORDER_SUCCESS.getCode().equals(wxMsgRecord.getMsgType())){ |
|
|
|
//内部消息 - 下订单成功 |
|
|
|
FmInsideOrderSuccessMsg msg = (FmInsideOrderSuccessMsg) JsonUtil.readValue(wxMsgRecord.getMsgJson(),FmInsideOrderSuccessMsg.class); |
|
|
|
msg.setMsgType(wxMsgRecord.getMsgType()); |
|
|
|
msg.setReceiver(wxMsgRecord.getReceiver()); |
|
|
|
msg.setTenantId(wxMsgRecord.getTenantId()); |
|
|
|
msg.updateTenantInfo(tenantEntity); |
|
|
|
mqBaseProducer.sendMessage(msg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); |
|
|
|
} |
|
|
|
} |
|
|
|
|