|
|
|
@@ -75,6 +75,9 @@ public class WxMsgServiceImpl implements WxMsgService { |
|
|
|
@Autowired |
|
|
|
WxAppinfoService wxAppinfoService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
WxCUserService wxCUserService; |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageInfo<WxMsg> listAsPage(WxMsg record, Integer pageIndex, Integer pageSize) { |
|
|
|
PageHelper.startPage(pageIndex, pageSize); |
|
|
|
@@ -371,6 +374,10 @@ public class WxMsgServiceImpl implements WxMsgService { |
|
|
|
smartAppMsg.setAppId(cAppInfo.getAppId()); |
|
|
|
|
|
|
|
WxTemplateMsg wxTemplateMsg = wxTemplateMsgMapper.selectById(wxMsg.getModelId()); |
|
|
|
// if(1 == wxTemplateMsg.getOnOff().intValue()){ |
|
|
|
// logger.error("订阅消息模板关闭。"); |
|
|
|
// return; |
|
|
|
// } |
|
|
|
|
|
|
|
smartAppMsg.setTemplateType(wxTemplateMsg.getType()); |
|
|
|
JSONObject customParam = JSON.parseObject(wxMsg.getMsg()); |
|
|
|
@@ -415,13 +422,23 @@ public class WxMsgServiceImpl implements WxMsgService { |
|
|
|
}else{ |
|
|
|
WxCUser wxCUserQ = new WxCUser(); |
|
|
|
wxCUserQ.updateTenantInfo(tenantEntity); |
|
|
|
|
|
|
|
List<WxCUser> list = wxCUserMapper.findList(wxCUserQ); |
|
|
|
wxMsg.setExpectSendNumber(list.size()); |
|
|
|
for (WxCUser u:list) { |
|
|
|
PageInfo<WxCUser> wxCUserPageInfo = wxCUserService.listAsPage(wxCUserQ, 1, 1000); |
|
|
|
// List<WxCUser> list = wxCUserService.findList(wxCUserQ); |
|
|
|
wxMsg.setExpectSendNumber((int) wxCUserPageInfo.getTotal()); |
|
|
|
for (WxCUser u:wxCUserPageInfo.getList()) { |
|
|
|
smartAppMsg.setTo(u.getOpenId()); |
|
|
|
mqBaseProducer.sendMessage(smartAppMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); |
|
|
|
} |
|
|
|
if(wxCUserPageInfo.getPages() > 1){ |
|
|
|
for(int i=2;i<=wxCUserPageInfo.getPages();i++){ |
|
|
|
wxCUserPageInfo = wxCUserService.listAsPage(wxCUserQ, i, 1000); |
|
|
|
for (WxCUser u:wxCUserPageInfo.getList()) { |
|
|
|
smartAppMsg.setTo(u.getOpenId()); |
|
|
|
mqBaseProducer.sendMessage(smartAppMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|