...
|
...
|
@@ -30,6 +30,10 @@ import org.springframework.stereotype.Service; |
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.ExecutorService;
|
|
|
import java.util.concurrent.LinkedBlockingQueue;
|
|
|
import java.util.concurrent.ThreadPoolExecutor;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -111,6 +115,14 @@ public class ChannelGroupServiceImpl implements IChannelGroupService { |
|
|
}};
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 默认10个线程,
|
|
|
*/
|
|
|
private ExecutorService sendMessageExecutor = new ThreadPoolExecutor(5, 10,10L, TimeUnit.MILLISECONDS,
|
|
|
new LinkedBlockingQueue<Runnable>(DEFAULT_QUEUECAPACITY));
|
|
|
|
|
|
private static final int DEFAULT_QUEUECAPACITY = 20000;
|
|
|
|
|
|
@Override
|
|
|
public PageChannelGroupRspBO queryChannelGroupList(ChannelGroupRequestBO channelGroupRequestBO) {
|
|
|
logger.info("enter queryChannelGroupList. param channelGroupRequestBO={}", channelGroupRequestBO);
|
...
|
...
|
@@ -233,7 +245,12 @@ public class ChannelGroupServiceImpl implements IChannelGroupService { |
|
|
}
|
|
|
}
|
|
|
|
|
|
channelSmsDetailDAO.batchInsert(smsDetails);
|
|
|
//异步记录日志表,以后查询日志方便
|
|
|
try {
|
|
|
saveSmsDetail(smsDetails);
|
|
|
} catch (Exception e) {
|
|
|
logger.error("", e);
|
|
|
}
|
|
|
logger.info("sendMessage:insert channelSmsDetai,smsDetails is {}", smsDetails);
|
|
|
|
|
|
//5.修改分组表的分组人数、发送时间、修改时间、内容、发送人
|
...
|
...
|
@@ -253,6 +270,17 @@ public class ChannelGroupServiceImpl implements IChannelGroupService { |
|
|
return count;
|
|
|
}
|
|
|
|
|
|
private void saveSmsDetail(List<ChannelSmsDetail> smsDetails) {
|
|
|
sendMessageExecutor.execute(new Runnable() {
|
|
|
@Override
|
|
|
public void run()
|
|
|
{
|
|
|
channelSmsDetailDAO.batchInsert(smsDetails);
|
|
|
logger.info("sendMessage:end insert channelSmsDetai,smsDetails is {}", smsDetails);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public Map<Integer, String> getCondition(String ids) {
|
|
|
logger.info("enter getCondition. param ids={}", ids);
|
...
|
...
|
|