Skip to content

Commit 76bc582

Browse files
committed
批量编辑tableu节点视图ID属性 #AI commit#
1 parent b76b458 commit 76bc582

2 files changed

Lines changed: 41 additions & 0 deletions

File tree

dss-orchestrator/orchestrators/dss-workflow/dss-workflow-server/src/main/java/com/webank/wedatasphere/dss/workflow/entity/request/EditFlowRequest.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ public class EditFlowRequest {
1212
private String desc;
1313
private String businessTag;
1414
private String appTag;
15+
private String viewId;
16+
private String datasourceId;
1517
private String params;
1618
private String ecConfTemplateId;
1719
private String ecConfTemplateName;
@@ -80,6 +82,22 @@ public void setAppTag(String appTag) {
8082
this.appTag = appTag;
8183
}
8284

85+
public String getViewId() {
86+
return viewId;
87+
}
88+
89+
public void setViewId(String viewId) {
90+
this.viewId = viewId;
91+
}
92+
93+
public String getDatasourceId() {
94+
return datasourceId;
95+
}
96+
97+
public void setDatasourceId(String datasourceId) {
98+
this.datasourceId = datasourceId;
99+
}
100+
83101
public String getEcConfTemplateId() {
84102
return ecConfTemplateId;
85103
}

dss-orchestrator/orchestrators/dss-workflow/dss-workflow-server/src/main/java/com/webank/wedatasphere/dss/workflow/service/impl/DSSFlowServiceImpl.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2641,6 +2641,8 @@ private String modifyJson(String flowJson, EditFlowRequest editFlowRequest, Long
26412641
String desc = editFlowRequest.getDesc();
26422642
String appTag = editFlowRequest.getAppTag();
26432643
String businessTag = editFlowRequest.getBusinessTag();
2644+
String viewId = editFlowRequest.getViewId();
2645+
String datasourceId = editFlowRequest.getDatasourceId();
26442646
String ecConfTemplateId = editFlowRequest.getEcConfTemplateId();
26452647
String ecConfTemplateName = editFlowRequest.getEcConfTemplateName();
26462648
JsonObject jsonObject = JsonParser.parseString(flowJson).getAsJsonObject();
@@ -2660,6 +2662,27 @@ private String modifyJson(String flowJson, EditFlowRequest editFlowRequest, Long
26602662
flowJsonAddPointProperty(obj, "desc", desc);
26612663
flowJsonAddProperty(obj, "appTag", appTag);
26622664
flowJsonAddProperty(obj, "businessTag", businessTag);
2665+
2666+
if (StringUtils.isNotEmpty(viewId)) {
2667+
JsonObject jobContent = new JsonObject();
2668+
if (obj.has("jobContent") && obj.get("jobContent").isJsonObject()) {
2669+
jobContent = obj.getAsJsonObject("jobContent");
2670+
} else {
2671+
obj.add("jobContent", jobContent);
2672+
}
2673+
jobContent.addProperty("viewId", viewId);
2674+
}
2675+
2676+
if (StringUtils.isNotEmpty(datasourceId)) {
2677+
JsonObject jobContent = new JsonObject();
2678+
if (obj.has("jobContent") && obj.get("jobContent").isJsonObject()) {
2679+
jobContent = obj.getAsJsonObject("jobContent");
2680+
} else {
2681+
obj.add("jobContent", jobContent);
2682+
}
2683+
jobContent.addProperty("datasourceId", datasourceId);
2684+
}
2685+
26632686
flowJsonAddProperty(obj, "ecConfTemplateId", ecConfTemplateId);
26642687
flowJsonAddProperty(obj, "ecConfTemplateName", ecConfTemplateName);
26652688
break;

0 commit comments

Comments
 (0)