|
|
|
@@ -1,10 +1,15 @@ |
|
|
|
package com.iformall.controller; |
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
import com.iformall.common.ResultData; |
|
|
|
import com.iformall.domain.po.*; |
|
|
|
import com.iformall.enums.*; |
|
|
|
import com.iformall.mapper.WxMsgMapper; |
|
|
|
import com.iformall.mq.MqBaseProducer; |
|
|
|
import com.iformall.service.MsgSendService; |
|
|
|
import com.iformall.service.WxMsgRecordService; |
|
|
|
import com.iformall.service.impl.SendCallBackSmsServiceImpl; |
|
|
|
import com.iformall.utils.DateUtils; |
|
|
|
import com.iformall.utils.JsonUtil; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import org.slf4j.Logger; |
|
|
|
@@ -24,6 +29,36 @@ public class WxMsgRecordController extends BaseController { |
|
|
|
private WxMsgRecordService wxMsgRecordService; |
|
|
|
@Autowired |
|
|
|
private MqBaseProducer mqBaseProducer; |
|
|
|
@Autowired |
|
|
|
private WxMsgMapper wxMsgMapper; |
|
|
|
@Autowired |
|
|
|
private SendCallBackSmsServiceImpl msgSendService; |
|
|
|
|
|
|
|
|
|
|
|
@GetMapping(value = "/test") |
|
|
|
public ResultData test() throws Exception{ |
|
|
|
// String systemTime = DateUtils.getSystemTime("yyyy-MM-dd HH:00:00"); |
|
|
|
// WxMsg wxMsg = new WxMsg(); |
|
|
|
// wxMsg.setIsright(0); |
|
|
|
// wxMsg.setSendtime(systemTime); |
|
|
|
// wxMsg.setId(270060355273621504l); |
|
|
|
// List<WxMsg> list = wxMsgMapper.findList(wxMsg); |
|
|
|
// logger.info("将要发送的短信列表:" + JSONArray.toJSONString(list)); |
|
|
|
// for (WxMsg msg : list) { |
|
|
|
// //sendmsg(msg); |
|
|
|
// msg.setMsgType(EnumMsgRecordType.SMS_CALLBACK.getCode()); |
|
|
|
// msg.setReceiver(msg.getPhones()); |
|
|
|
// mqBaseProducer.sendMessage(msg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(),null); |
|
|
|
// } |
|
|
|
|
|
|
|
String s = "{\"tenantId\":\"456\",\"uuid\":\"0a410e4e-c0ef-461e-bea8-7bd222e7c7b7\",\"delayTimeLevel\":0,\"id\":270060355273621504,\"modelId\":220401934081720320,\"msg\":\"狂欢双十一:更多礼品等你来领取\",\"sendtime\":\"2019-03-25 16:00:00\",\"createtime\":\"2019-03-25 15:30:16\",\"expectSendNumber\":1,\"phones\":\"18601973448\",\"signature\":\"富茂科技\",\"isright\":0,\"name\":\"狂欢双十一\",\"excelpath\":\"\",\"label\":\"\",\"status\":0,\"way\":1}"; |
|
|
|
WxMsg wxMsg = (WxMsg) JsonUtil.readValue(s,WxMsg.class); |
|
|
|
wxMsg.setMsgType(EnumMsgRecordType.SMS_CALLBACK.getCode()); |
|
|
|
wxMsg.setReceiver("18601973448"); |
|
|
|
wxMsg.setTenantId("456"); |
|
|
|
msgSendService.send(wxMsg); |
|
|
|
return new ResultData(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 重新发送失败的消息 |
|
|
|
|