|
|
@@ -22,6 +22,7 @@ import org.springframework.web.client.RestTemplate;
|
|
|
import java.io.UnsupportedEncodingException;
|
|
|
import java.net.URLEncoder;
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.Iterator;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
@@ -69,13 +70,24 @@ public class ListenTask {
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
+ Iterator<Master> iterator = masters.iterator();
|
|
|
+ while (iterator.hasNext()) {
|
|
|
+ Master checkProd = iterator.next();
|
|
|
+ if (!"prod".equals(checkProd.getMa_env())) {
|
|
|
+ iterator.remove();
|
|
|
+ }
|
|
|
+ }
|
|
|
if (!CollectionUtils.isEmpty(masters)) {
|
|
|
ContextHolder.setMaster(masters.get(0));
|
|
|
int dual = jdbcTemplate.getInt("select 1 from dual");
|
|
|
if (dual == 1) {
|
|
|
StringBuilder str = new StringBuilder();
|
|
|
for (Master master : masters) {
|
|
|
- str.append(master.getMa_function() + ",");
|
|
|
+ if ("".equals(str.toString())) {
|
|
|
+ str.append(master.getMa_function());
|
|
|
+ } else {
|
|
|
+ str.append("、" + master.getMa_function());
|
|
|
+ }
|
|
|
}
|
|
|
ListenDomain listenDomain = new ListenDomain(DiskUtil.getMacAddress(),
|
|
|
str == null ? "" : str.toString());
|
|
|
@@ -83,6 +95,7 @@ public class ListenTask {
|
|
|
listenDomains.add(listenDomain);
|
|
|
postForList(getApiDomain() + "/erp/listen", ListenDomain.class, dataWrap(listenDomains));
|
|
|
}
|
|
|
+ ContextHolder.clear();
|
|
|
}
|
|
|
}
|
|
|
|