| @@ -103,6 +103,13 @@ public class WxMsgRecordController extends BaseController { | |||||
| msg.setReceiver(wxMsgRecord.getReceiver()); | msg.setReceiver(wxMsgRecord.getReceiver()); | ||||
| msg.updateTenantInfo(tenantEntity); | msg.updateTenantInfo(tenantEntity); | ||||
| mqBaseProducer.sendMessage(msg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | mqBaseProducer.sendMessage(msg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | ||||
| }else if(EnumMsgRecordType.INSIDE_COUPON_VERIFY.getCode().equals(wxMsgRecord.getMsgType())){ | |||||
| //内部消息 - 券核销 | |||||
| FmInsideCouponVerifyMsg msg = (FmInsideCouponVerifyMsg) JsonUtil.readValue(wxMsgRecord.getMsgJson(),FmInsideCouponVerifyMsg.class); | |||||
| msg.setMsgType(wxMsgRecord.getMsgType()); | |||||
| msg.setReceiver(wxMsgRecord.getReceiver()); | |||||
| msg.updateTenantInfo(tenantEntity); | |||||
| mqBaseProducer.sendMessage(msg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | |||||
| } | } | ||||
| } | } | ||||
| return new ResultData(); | return new ResultData(); | ||||
| @@ -7,13 +7,16 @@ import com.alibaba.fastjson.JSON; | |||||
| import com.alibaba.fastjson.JSONArray; | import com.alibaba.fastjson.JSONArray; | ||||
| import com.alibaba.fastjson.JSONObject; | import com.alibaba.fastjson.JSONObject; | ||||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||||
| import com.iformall.domain.po.WxAppinfo; | |||||
| import com.iformall.domain.po.WxTemplateMsg; | import com.iformall.domain.po.WxTemplateMsg; | ||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.domain.po.msg.AppUniformMsg; | import com.iformall.domain.po.msg.AppUniformMsg; | ||||
| import com.iformall.domain.po.msg.BaseMsg; | import com.iformall.domain.po.msg.BaseMsg; | ||||
| import com.iformall.mapper.WxAppinfoMapper; | |||||
| import com.iformall.mapper.WxTemplateMsgMapper; | import com.iformall.mapper.WxTemplateMsgMapper; | ||||
| import com.iformall.service.msg.MsgSendService; | import com.iformall.service.msg.MsgSendService; | ||||
| import com.iformall.service.wechat.FmOpenService; | import com.iformall.service.wechat.FmOpenService; | ||||
| import org.apache.commons.lang3.StringUtils; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| @@ -30,6 +33,10 @@ import java.util.List; | |||||
| @Service | @Service | ||||
| public class SendWeappUniformMsgServiceImpl implements MsgSendService { | public class SendWeappUniformMsgServiceImpl implements MsgSendService { | ||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | private final Logger logger = LoggerFactory.getLogger(this.getClass()); | ||||
| @Autowired | |||||
| private WxAppinfoMapper appinfoMapper; | |||||
| @Autowired | @Autowired | ||||
| private WxTemplateMsgMapper wxTemplateMsgMapper; | private WxTemplateMsgMapper wxTemplateMsgMapper; | ||||
| @@ -41,6 +48,10 @@ public class SendWeappUniformMsgServiceImpl implements MsgSendService { | |||||
| AppUniformMsg appUniformMsg = (AppUniformMsg)baseMsg; | AppUniformMsg appUniformMsg = (AppUniformMsg)baseMsg; | ||||
| TenantEntity tenantEntity = appUniformMsg.getTenantInfo(); | TenantEntity tenantEntity = appUniformMsg.getTenantInfo(); | ||||
| if (StringUtils.isBlank(tenantEntity.getTenantId())) { | |||||
| WxAppinfo appinfo = appinfoMapper.findByAppId(appUniformMsg.getAppId()); | |||||
| tenantEntity = appinfo.getTenantInfo(); | |||||
| } | |||||
| WxTemplateMsg msg = null; | WxTemplateMsg msg = null; | ||||
| WxMaService wxMaService = openService.getWxOpenComponentService().getWxMaServiceByAppid(appUniformMsg.getAppId()); | WxMaService wxMaService = openService.getWxOpenComponentService().getWxMaServiceByAppid(appUniformMsg.getAppId()); | ||||
| @@ -2,10 +2,7 @@ package com.iformall.controller.msg; | |||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| import com.iformall.domain.po.msg.MailMsg; | |||||
| import com.iformall.domain.po.msg.SmartAppMsg; | |||||
| import com.iformall.domain.po.msg.WxMsg; | |||||
| import com.iformall.domain.po.msg.WxMsgRecord; | |||||
| import com.iformall.domain.po.msg.*; | |||||
| import com.iformall.enums.*; | import com.iformall.enums.*; | ||||
| import com.iformall.mapper.WxMsgMapper; | import com.iformall.mapper.WxMsgMapper; | ||||
| import com.iformall.mq.MqBaseProducer; | import com.iformall.mq.MqBaseProducer; | ||||
| @@ -66,9 +63,10 @@ public class WxMsgRecordController extends BaseController { | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| @GetMapping(value = "/resendMsg") | @GetMapping(value = "/resendMsg") | ||||
| public ResultData resendMsg(String x) { | |||||
| public ResultData resendMsg(String x, Integer msgType) { | |||||
| if("xll1dxx1314".equals(x)){ | if("xll1dxx1314".equals(x)){ | ||||
| WxMsgRecord msgRecord = new WxMsgRecord(); | WxMsgRecord msgRecord = new WxMsgRecord(); | ||||
| msgRecord.setMsgType(msgType); | |||||
| msgRecord.setMsgStatus(EnumMsgRecordStatus.CONSUME_FAIL.getCode()); | msgRecord.setMsgStatus(EnumMsgRecordStatus.CONSUME_FAIL.getCode()); | ||||
| List<WxMsgRecord> recordList = wxMsgRecordService.findList(msgRecord); | List<WxMsgRecord> recordList = wxMsgRecordService.findList(msgRecord); | ||||
| for (WxMsgRecord wxMsgRecord:recordList) { | for (WxMsgRecord wxMsgRecord:recordList) { | ||||
| @@ -96,6 +94,20 @@ public class WxMsgRecordController extends BaseController { | |||||
| wxMsg.setReceiver(wxMsgRecord.getReceiver()); | wxMsg.setReceiver(wxMsgRecord.getReceiver()); | ||||
| wxMsg.setTenantId(wxMsgRecord.getTenantId()); | wxMsg.setTenantId(wxMsgRecord.getTenantId()); | ||||
| mqBaseProducer.sendMessage(wxMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | 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()); | |||||
| mqBaseProducer.sendMessage(msg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | |||||
| }else if(EnumMsgRecordType.INSIDE_COUPON_VERIFY.getCode().equals(wxMsgRecord.getMsgType())){ | |||||
| //内部消息 - 券核销 | |||||
| FmInsideCouponVerifyMsg msg = (FmInsideCouponVerifyMsg) JsonUtil.readValue(wxMsgRecord.getMsgJson(),FmInsideCouponVerifyMsg.class); | |||||
| msg.setMsgType(wxMsgRecord.getMsgType()); | |||||
| msg.setReceiver(wxMsgRecord.getReceiver()); | |||||
| msg.setTenantId(wxMsgRecord.getTenantId()); | |||||
| mqBaseProducer.sendMessage(msg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | |||||
| } | } | ||||
| } | } | ||||
| return new ResultData(); | return new ResultData(); | ||||