| @@ -39,5 +39,5 @@ public interface WxCUserMapper extends CommonMapper<WxCUser, Long> { | |||||
| void updateMsgCount(WxCUser user); | void updateMsgCount(WxCUser user); | ||||
| void updateMsgCountDown(@Param("tenantId")String tenantId, String[] array); | |||||
| void updateMsgCountDown(@Param("tenantId")String tenantId, @Param("openIds")List<String> list); | |||||
| } | } | ||||
| @@ -441,6 +441,9 @@ public class WxMsgServiceImpl implements WxMsgService { | |||||
| wxCUserQ.updateTenantInfo(tenantEntity); | wxCUserQ.updateTenantInfo(tenantEntity); | ||||
| PageInfo<String> openIdPage = wxCUserService.listOpenIdAsPage(wxCUserQ, 1, 1000); | PageInfo<String> openIdPage = wxCUserService.listOpenIdAsPage(wxCUserQ, 1, 1000); | ||||
| wxMsg.setExpectSendNumber((int) openIdPage.getTotal()); | wxMsg.setExpectSendNumber((int) openIdPage.getTotal()); | ||||
| if(openIdPage.getTotal() == 0){ | |||||
| return; | |||||
| } | |||||
| String phones = StringUtils.join(openIdPage.getList(), ","); | String phones = StringUtils.join(openIdPage.getList(), ","); | ||||
| smartAppMsg.setTo(phones); | smartAppMsg.setTo(phones); | ||||
| mqBaseProducer.sendMessage(smartAppMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | mqBaseProducer.sendMessage(smartAppMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | ||||
| @@ -24,6 +24,7 @@ import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import java.util.Arrays; | |||||
| import java.util.List; | import java.util.List; | ||||
| /** | /** | ||||
| @@ -115,7 +116,7 @@ public class SendSmartAppMsgServiceImpl implements MsgSendService { | |||||
| // wxMaService.getMsgService().sendTemplateMsg(templateMessage); | // wxMaService.getMsgService().sendTemplateMsg(templateMessage); | ||||
| String[] split = smartAppMsg.getTo().split(","); | String[] split = smartAppMsg.getTo().split(","); | ||||
| wxCUserMapper.updateMsgCountDown(tenantEntity.getTenantId(),split); | |||||
| wxCUserMapper.updateMsgCountDown(tenantEntity.getTenantId(),Arrays.asList(split)); | |||||
| for (String to:split) { | for (String to:split) { | ||||
| subscribeMessage = WxMaSubscribeMessage.builder() | subscribeMessage = WxMaSubscribeMessage.builder() | ||||
| @@ -265,7 +265,7 @@ | |||||
| and `tenant_id` = #{tenantId} | and `tenant_id` = #{tenantId} | ||||
| </if> | </if> | ||||
| and `open_id` in | and `open_id` in | ||||
| <foreach collection="array" item="openId" open="(" separator="," close=")" > | |||||
| <foreach collection="openIds" item="openId" open="(" separator="," close=")" > | |||||
| #{openId} | #{openId} | ||||
| </foreach> | </foreach> | ||||
| </update> | </update> | ||||