|
@@ -42,7 +42,9 @@ public class Route extends ExceptionHandlerBaseRoute {
|
|
|
public void configure() throws Exception {
|
|
|
configExceptionHandler();
|
|
|
|
|
|
- fromF("timer://simpleTimer?period=1m").process(new OnTimeTaskProcessor()).to("direct:syncAllProject");
|
|
|
+ fromF("timer://simpleTimer?period=1m")
|
|
|
+ .process(new OnTimeTaskProcessor())
|
|
|
+ .to("direct:syncAllProject");
|
|
|
fromF("timer://simpleTimer?period=30m").to("direct:synProjectName");
|
|
|
|
|
|
rest().get("/doc")
|
|
@@ -155,6 +157,7 @@ public class Route extends ExceptionHandlerBaseRoute {
|
|
|
//同步全部项目的资产信息
|
|
|
from("direct:syncAllProject")
|
|
|
.process(exchange -> {
|
|
|
+ System.out.println("someThing happened");
|
|
|
exchange.setProperty("projectList", ProPasCache.pjList);
|
|
|
log.warn("统计数据开始更新");
|
|
|
})
|
|
@@ -167,19 +170,21 @@ public class Route extends ExceptionHandlerBaseRoute {
|
|
|
|
|
|
//body为JSONObject,含有projectId字段
|
|
|
from("direct:getPropertiesByPj")
|
|
|
- .process(new GetPropByPjProcessor())
|
|
|
- .to(Const.dataPlatform + "/property/relation_query");
|
|
|
+ .process(new GetPropByPjProcessor()).setHeader(Exchange.HTTP_METHOD, constant("POST"))
|
|
|
+ .to(InitEnvRoute.dataPlatform + "/property/relation_query?bridgeEndpoint=true&method=POST");
|
|
|
from("direct:getEquipmentByPj")
|
|
|
.process(new GetEquipmentByPjProcessor())
|
|
|
.to(Const.dataPlatform + "/object/subset_query");
|
|
|
|
|
|
// 统计数据平台资产和设备信息(数量)
|
|
|
- from("direct:buildVenderMap")
|
|
|
+ from("direct:buildVenderMap").setHeader(Exchange.HTTP_METHOD, constant("POST"))
|
|
|
.to(Const.venders + "/auxiliary/vender/query_detail?bridgeEndpoint=true&method=POST")
|
|
|
.process(new VenderMapProcessor())
|
|
|
- .split(body()).parallelProcessing()
|
|
|
+ .split(body())
|
|
|
+ //.parallelProcessing()
|
|
|
.process(exchange -> {
|
|
|
String projectId = exchange.getIn().getBody(String.class);
|
|
|
+ System.out.println("统计:" + projectId);
|
|
|
JSONObject json = new JSONObject();
|
|
|
json.put("projectId", projectId);
|
|
|
exchange.setProperty("projectId" + exchange.getExchangeId(), projectId);
|
|
@@ -188,6 +193,7 @@ public class Route extends ExceptionHandlerBaseRoute {
|
|
|
.to("direct:getPropertiesByPj")
|
|
|
.process(exchange -> {
|
|
|
String jsonStr = exchange.getIn().getBody(String.class);
|
|
|
+
|
|
|
DPSelectPropertyResult dpResult = JSONObject.parseObject(jsonStr, DPSelectPropertyResult.class);
|
|
|
exchange.setProperty("propertyData" + exchange.getExchangeId(), dpResult);
|
|
|
// 为下个路由准备输入数据
|