|
|
@@ -329,7 +329,7 @@ public class WxMsgServiceImpl implements WxMsgService { |
|
|
batchSendMsg(wxmsg, wxMsgConfig, couponInject); |
|
|
batchSendMsg(wxmsg, wxMsgConfig, couponInject); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
public void batchSendMsg(WxMsg wxMsg, WxMsgConfig wxMsgConfig, WxCouponInject couponInject) { |
|
|
public void batchSendMsg(WxMsg wxMsg, WxMsgConfig wxMsgConfig, WxCouponInject couponInject) { |
|
|
|
|
|
|
|
|
String[] split = wxMsg.getPhones().split(","); |
|
|
String[] split = wxMsg.getPhones().split(","); |
|
|
@@ -337,27 +337,30 @@ public class WxMsgServiceImpl implements WxMsgService { |
|
|
int extra = length % 1000; |
|
|
int extra = length % 1000; |
|
|
int extracount = extra > 0 ? (length / 1000 + 1) : (length / 1000); |
|
|
int extracount = extra > 0 ? (length / 1000 + 1) : (length / 1000); |
|
|
int index = extracount - 1; |
|
|
int index = extracount - 1; |
|
|
|
|
|
|
|
|
for (int i = 0; i < extracount; i++) { |
|
|
for (int i = 0; i < extracount; i++) { |
|
|
|
|
|
WxMsg wxMsg1 = new WxMsg(); |
|
|
|
|
|
wxMsg1.setId(wxMsg.getId()); |
|
|
if (extra > 0 && i == index) { |
|
|
if (extra > 0 && i == index) { |
|
|
List<String> phoneList = Arrays.asList(split).subList(i * 1000, length); |
|
|
List<String> phoneList = Arrays.asList(split).subList(i * 1000, length); |
|
|
String phones = StringUtils.join(phoneList, ","); |
|
|
String phones = StringUtils.join(phoneList, ","); |
|
|
wxMsg.setPhones(phones); |
|
|
|
|
|
wxMsg.setExpectSendNumber(extra); |
|
|
|
|
|
wxMsg.setWxMsgConfig(wxMsgConfig); |
|
|
|
|
|
wxMsg.setCouponInject(couponInject); |
|
|
|
|
|
wxMsg.setMsgType(EnumMsgRecordType.SMS_CALLBACK.getCode()); |
|
|
|
|
|
wxMsg.setReceiver(wxMsg.getPhones()); |
|
|
|
|
|
mqBaseProducer.sendMessage(wxMsg, EnumMsgMqTopic.DEFAULT.getCode(),EnumMsgMqTag.DEFAULT.getCode(),EnumMsgMqKey.DEFAULT.getCode()); |
|
|
|
|
|
|
|
|
wxMsg1.setPhones(phones); |
|
|
|
|
|
wxMsg1.setExpectSendNumber(extra); |
|
|
|
|
|
wxMsg1.setWxMsgConfig(wxMsgConfig); |
|
|
|
|
|
wxMsg1.setCouponInject(couponInject); |
|
|
|
|
|
wxMsg1.setMsgType(EnumMsgRecordType.SMS_CALLBACK.getCode()); |
|
|
|
|
|
wxMsg1.setReceiver(wxMsg1.getPhones()); |
|
|
|
|
|
mqBaseProducer.sendMessage(wxMsg1, EnumMsgMqTopic.DEFAULT.getCode(),EnumMsgMqTag.DEFAULT.getCode(),EnumMsgMqKey.DEFAULT.getCode()); |
|
|
} else { |
|
|
} else { |
|
|
List<String> phoneList = Arrays.asList(split).subList(i * 1000, (i + 1) * 1000); |
|
|
List<String> phoneList = Arrays.asList(split).subList(i * 1000, (i + 1) * 1000); |
|
|
String phones = StringUtils.join(phoneList, ","); |
|
|
String phones = StringUtils.join(phoneList, ","); |
|
|
wxMsg.setExpectSendNumber(1000); |
|
|
|
|
|
wxMsg.setPhones(phones); |
|
|
|
|
|
wxMsg.setWxMsgConfig(wxMsgConfig); |
|
|
|
|
|
wxMsg.setCouponInject(couponInject); |
|
|
|
|
|
wxMsg.setMsgType(EnumMsgRecordType.SMS_CALLBACK.getCode()); |
|
|
|
|
|
wxMsg.setReceiver(wxMsg.getPhones()); |
|
|
|
|
|
mqBaseProducer.sendMessage(wxMsg, EnumMsgMqTopic.DEFAULT.getCode(),EnumMsgMqTag.DEFAULT.getCode(),EnumMsgMqKey.DEFAULT.getCode()); |
|
|
|
|
|
|
|
|
wxMsg1.setExpectSendNumber(1000); |
|
|
|
|
|
wxMsg1.setPhones(phones); |
|
|
|
|
|
wxMsg1.setWxMsgConfig(wxMsgConfig); |
|
|
|
|
|
wxMsg1.setCouponInject(couponInject); |
|
|
|
|
|
wxMsg1.setMsgType(EnumMsgRecordType.SMS_CALLBACK.getCode()); |
|
|
|
|
|
wxMsg1.setReceiver(wxMsg1.getPhones()); |
|
|
|
|
|
mqBaseProducer.sendMessage(wxMsg1, EnumMsgMqTopic.DEFAULT.getCode(),EnumMsgMqTag.DEFAULT.getCode(),EnumMsgMqKey.DEFAULT.getCode()); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|