|
@@ -1,15 +1,13 @@
|
|
|
package com.saga.thread.common;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.Iterator;
|
|
|
-import java.util.List;
|
|
|
+import java.util.*;
|
|
|
import java.util.concurrent.Executor;
|
|
|
import java.util.concurrent.ExecutorService;
|
|
|
import java.util.concurrent.Executors;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.saga.util.MessageUtil;
|
|
|
+import org.apache.commons.lang.StringUtils;
|
|
|
import org.zillion.util.log.LogUtil;
|
|
|
|
|
|
import com.saga.entity.Record;
|
|
@@ -242,7 +240,7 @@ public class SaveThread extends Thread {
|
|
|
|
|
|
private void sendMessage(Record record) {
|
|
|
executorService.execute(() -> {
|
|
|
- if (Constant.activeMqPointSet.contains(record.buildingSign + "-" + record.meterSign + "-" + record.funcID)) {
|
|
|
+ if (isSendMessage(record)) {
|
|
|
try {
|
|
|
MessageUtil.sendMessage(JSONObject.toJSONString(record));
|
|
|
} catch (Exception e) {
|
|
@@ -252,6 +250,25 @@ public class SaveThread extends Thread {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ private boolean isSendMessage(Record record) {
|
|
|
+ if (Constant.activeMqPointSet.contains(record.buildingSign + "-" + record.meterSign + "-" + record.funcID)) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ if (StringUtils.isBlank(Constant.reportFuncId)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ String[] reportFunIds = Constant.reportFuncId.split(",");
|
|
|
+ for (String funcId : reportFunIds) {
|
|
|
+ if (StringUtils.isBlank(funcId)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (Integer.valueOf(funcId).equals(record.funcID)) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* ÊÇ·ñÐèÒª½ø¿â
|
|
|
*
|