|
@@ -69,8 +69,19 @@ public class TaskService {
|
|
|
configLogsMap.clear();
|
|
|
return;
|
|
|
}
|
|
|
- log.info("未分配的mq队列数:{}",mqSendLogs.size());
|
|
|
|
|
|
+ List<MqSendLog> fdkkList = mqSendLogs.stream().filter(e -> "4dkk".equals(e.getType())).collect(Collectors.toList());
|
|
|
+ List<MqSendLog> panoList = mqSendLogs.stream().filter(e -> "pano".equals(e.getType())).collect(Collectors.toList());
|
|
|
+ if(!fdkkList.isEmpty()){
|
|
|
+ sendMqByType(fdkkList,"4dkk");
|
|
|
+ }
|
|
|
+ if(!panoList.isEmpty()){
|
|
|
+ sendMqByType(fdkkList,"pano");
|
|
|
+ }
|
|
|
+ log.info("未分配的mq队列数4dkk:{},pano:{}",fdkkList.size(),panoList.size());
|
|
|
+ }
|
|
|
+
|
|
|
+ private void sendMqByType(List<MqSendLog> mqSendLogs,String type){
|
|
|
//设置分配队列
|
|
|
HashSet<String> numList = new HashSet<>();
|
|
|
for (MqSendLog mqSendLog : mqSendLogs) {
|
|
@@ -90,7 +101,7 @@ public class TaskService {
|
|
|
mqSendLog.setConfigId(configId);
|
|
|
numList.add(mqSendLog.getNum());
|
|
|
}
|
|
|
- List<MqQueueConfig> queueConfigList = queueConfigService.list();
|
|
|
+ List<MqQueueConfig> queueConfigList = queueConfigService.getByType(type);
|
|
|
rabbitMqService.getMqMsgMap(queueConfigList);
|
|
|
|
|
|
for (MqQueueConfig config : queueConfigList) {
|
|
@@ -98,7 +109,7 @@ public class TaskService {
|
|
|
configLogsMap.put(config.getId(),msgList);
|
|
|
}
|
|
|
//是否需要重新组合队列
|
|
|
- allocateQueue2(queueConfigList,mqSendLogs);
|
|
|
+ allocateQueue2(queueConfigList,mqSendLogs,type);
|
|
|
|
|
|
for (MqQueueConfig mqQueueConfig : queueConfigList) {
|
|
|
List<MqSendLog> msgList = configLogsMap.get(mqQueueConfig.getId());
|
|
@@ -130,7 +141,7 @@ public class TaskService {
|
|
|
* 设置调配队列计算
|
|
|
* 调配A,B,C
|
|
|
*/
|
|
|
- private void allocateQueue2(List<MqQueueConfig> queueConfigList,List<MqSendLog> mqSendLogs){
|
|
|
+ private void allocateQueue2(List<MqQueueConfig> queueConfigList,List<MqSendLog> mqSendLogs,String type){
|
|
|
//获取常驻队列
|
|
|
for (MqQueueConfig residentConfig : queueConfigList) { // A ,B ,C
|
|
|
if(residentConfig.getIsSpecial() == 1){
|