|
|
@ -5,6 +5,7 @@ import cn.hutool.core.date.DateUtil; |
|
|
|
import cn.hutool.core.util.EnumUtil; |
|
|
|
import cn.hutool.core.util.EnumUtil; |
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
|
|
|
|
import cn.hutool.http.HttpUtil; |
|
|
|
import cn.hutool.json.JSONArray; |
|
|
|
import cn.hutool.json.JSONArray; |
|
|
|
import cn.hutool.json.JSONObject; |
|
|
|
import cn.hutool.json.JSONObject; |
|
|
|
import cn.hutool.json.JSONUtil; |
|
|
|
import cn.hutool.json.JSONUtil; |
|
|
@ -12,6 +13,7 @@ import com.logpm.factorydata.feign.IFactoryDataClient; |
|
|
|
import com.logpm.factorydata.olo.enums.FactoryNodeEnums; |
|
|
|
import com.logpm.factorydata.olo.enums.FactoryNodeEnums; |
|
|
|
import com.logpm.factorydata.olo.enums.NodeMappingEnums; |
|
|
|
import com.logpm.factorydata.olo.enums.NodeMappingEnums; |
|
|
|
import com.logpm.factorydata.olo.enums.NodeNeedEnums; |
|
|
|
import com.logpm.factorydata.olo.enums.NodeNeedEnums; |
|
|
|
|
|
|
|
import com.logpm.factorydata.olo.pros.OldProperties; |
|
|
|
import com.logpm.factorydata.vo.PushData; |
|
|
|
import com.logpm.factorydata.vo.PushData; |
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
@ -40,6 +42,7 @@ import java.util.stream.Collectors; |
|
|
|
public class NodeDataPushListener { |
|
|
|
public class NodeDataPushListener { |
|
|
|
|
|
|
|
|
|
|
|
private final IFactoryDataClient factoryDataClient; |
|
|
|
private final IFactoryDataClient factoryDataClient; |
|
|
|
|
|
|
|
private final OldProperties oldProperties; |
|
|
|
|
|
|
|
|
|
|
|
@RabbitListener(bindings = @QueueBinding( |
|
|
|
@RabbitListener(bindings = @QueueBinding( |
|
|
|
value = @Queue(name = FactoryDataConstants.Mq.Queues.OLO_NODE_DATA_PUSH, durable = "true"), |
|
|
|
value = @Queue(name = FactoryDataConstants.Mq.Queues.OLO_NODE_DATA_PUSH, durable = "true"), |
|
|
@ -87,7 +90,15 @@ public class NodeDataPushListener { |
|
|
|
} |
|
|
|
} |
|
|
|
js.set("snList", snArray); |
|
|
|
js.set("snList", snArray); |
|
|
|
log.info("推送节点数据:{}", js.toString()); |
|
|
|
log.info("推送节点数据:{}", js.toString()); |
|
|
|
// HttpUtil.post("", js.toString());
|
|
|
|
if (StrUtil.isNotEmpty(oldProperties.getPushNodeUrl())) { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
String post = HttpUtil.post(oldProperties.getPushNodeUrl(), js.toString()); |
|
|
|
|
|
|
|
log.info("推送结果:{}", post); |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
e.printStackTrace(); |
|
|
|
|
|
|
|
log.error("推送节点数据错误:{}", e); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|