|
@@ -1,6 +1,7 @@
|
|
|
package com.winhc.dataworks.flow.touch;
|
|
|
|
|
|
import com.aliyuncs.dataworks_public.model.v20180601.CreateManualDagResponse;
|
|
|
+import com.google.gson.JsonObject;
|
|
|
import com.helospark.lightdi.LightDi;
|
|
|
import com.helospark.lightdi.LightDiContext;
|
|
|
import com.helospark.lightdi.annotation.Autowired;
|
|
@@ -8,12 +9,11 @@ import com.helospark.lightdi.annotation.Service;
|
|
|
import com.winhc.dataworks.flow.touch.bean.TaskParam;
|
|
|
import com.winhc.dataworks.flow.touch.service.TouchService;
|
|
|
import com.winhc.dataworks.flow.touch.utils.JsonUtils;
|
|
|
+import com.winhc.dataworks.flow.touch.utils.YmlUtil;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
-import java.util.Arrays;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.io.File;
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
|
* @Author: XuJiakai
|
|
@@ -30,14 +30,26 @@ public class Main {
|
|
|
public static void main(String[] args) {
|
|
|
LightDiContext context = LightDi.initContextByPackage(Main.class.getPackage().getName());
|
|
|
Main bean = context.getBean(Main.class);
|
|
|
-// bean.start();
|
|
|
- bean.query();
|
|
|
+ bean.start();
|
|
|
+// bean.query();
|
|
|
}
|
|
|
|
|
|
private void start() {
|
|
|
log.info("start");
|
|
|
Map<String, String> map = new HashMap<>();
|
|
|
- List<String> strings = Arrays.asList("test1=a1"
|
|
|
+ Map<String,Object> mapTable=YmlUtil.getResMap("table");
|
|
|
+ for(Map.Entry<String, Object> entry : mapTable.entrySet()){
|
|
|
+ String tableName = entry.getKey();
|
|
|
+ Object mapValue = entry.getValue();
|
|
|
+ JsonObject dagPara = new JsonObject();
|
|
|
+ dagPara.addProperty("PROJECT","winhc_eci");//业务流程参数。
|
|
|
+ JsonObject nodePara = new JsonObject();
|
|
|
+ nodePara.addProperty("700003366062",mapValue.toString().replaceAll(":","="));
|
|
|
+ CreateManualDagResponse touch = touchService.triggerWithParam("winhc_eci","IncDataFlow","2020-06-05",dagPara.toString(),nodePara.toString());
|
|
|
+ System.out.println(JsonUtils.jsonObjToString(touch));
|
|
|
+ }
|
|
|
+
|
|
|
+ /*List<String> strings = Arrays.asList("test1=a1"
|
|
|
, "test2=a2"
|
|
|
, "test3=a3");
|
|
|
map.put("700003342843", String.join(" ", strings));
|
|
@@ -48,7 +60,7 @@ public class Main {
|
|
|
.bizDate("2020-06-04")
|
|
|
.nodeParam(map).build();
|
|
|
CreateManualDagResponse touch = touchService.touch(build);
|
|
|
- System.out.println(JsonUtils.jsonObjToString(touch));
|
|
|
+ System.out.println(JsonUtils.jsonObjToString(touch));*/
|
|
|
}
|
|
|
|
|
|
private void query(){
|