|
@@ -1,5 +1,6 @@
|
|
|
package com.sagacloud.route;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.github.rjeschke.txtmark.Processor;
|
|
|
import com.sagacloud.pojos.DPSelectPropertyResult;
|
|
@@ -142,30 +143,35 @@ public class Route extends ExceptionHandlerBaseRoute {
|
|
|
.consumes(MediaType.APPLICATION_JSON)
|
|
|
.produces(MediaType.APPLICATION_JSON)
|
|
|
.route()
|
|
|
+ .process(exchange -> {
|
|
|
+ String jsonStr = exchange.getIn().getBody(String.class);
|
|
|
+ JSONObject json = JSONObject.parseObject(jsonStr);
|
|
|
+ JSONArray projectArr = json.getJSONArray("project");
|
|
|
+ List<String> projectList = projectArr.toJavaList(String.class);
|
|
|
+ exchange.setProperty("projectList",projectList);
|
|
|
+ })
|
|
|
.to("direct:buildVenderMap");
|
|
|
|
|
|
from("direct:buildVenderMap")
|
|
|
- .process(exchange -> {
|
|
|
- Object temp = exchange.getIn().getBody();
|
|
|
- exchange.setProperty("tempBody",temp);
|
|
|
- exchange.getIn().setHeader(Exchange.HTTP_URI, Const.venders+"/auxiliary/vender/query_detail?method=POST");
|
|
|
- })
|
|
|
- .to(Const.venders+"/auxiliary/vender/query_detail")
|
|
|
+// .process(exchange -> {
|
|
|
+// exchange.getIn().setHeader(Exchange.HTTP_URI, Const.venders+"/auxiliary/vender/query_detail?method=POST");
|
|
|
+// })
|
|
|
+ .to(Const.venders+"/auxiliary/vender/query_detail?bridgeEndpoint=true&method=POST")
|
|
|
.process(new VenderMapProcessor())
|
|
|
.split(body()).parallelProcessing()
|
|
|
.process(exchange -> {
|
|
|
String projectId = exchange.getIn().getBody(String.class);
|
|
|
JSONObject json = new JSONObject();
|
|
|
json.put("projectId",projectId);
|
|
|
- exchange.setProperty("projectId",projectId);
|
|
|
+ exchange.setProperty("projectId"+exchange.getExchangeId(),projectId);
|
|
|
exchange.getIn().setBody(json.toString());
|
|
|
})
|
|
|
.to("direct:getPropertiesByPj")
|
|
|
.process(exchange -> {
|
|
|
String jsonStr = exchange.getIn().getBody(String.class);
|
|
|
DPSelectPropertyResult dpResult = JSONObject.parseObject(jsonStr, DPSelectPropertyResult.class);
|
|
|
- exchange.setProperty("propertyData",dpResult);
|
|
|
- exchange.getIn().setBody(exchange.getProperty("projectId"));
|
|
|
+ exchange.setProperty("propertyData"+exchange.getExchangeId(),dpResult);
|
|
|
+ exchange.getIn().setBody(exchange.getProperty("projectId"+exchange.getExchangeId()));
|
|
|
})
|
|
|
.to("direct:getPropertyStatisticsByProject");
|
|
|
}
|