From 08833b653ed1bdd4ad52fca8f97a53e8df5f7740 Mon Sep 17 00:00:00 2001 From: xlinliu Date: Thu, 9 Jan 2025 14:09:33 +0800 Subject: [PATCH] fix int of params --- .../linkisjob/LinkisJobConverter.java | 18 ++++++++++++++++-- .../schedulis/linkisjob/WTSSJobConverter.java | 15 ++++++++++++--- .../service/impl/DSSFlowServiceImpl.java | 11 ++++++++++- 3 files changed, 38 insertions(+), 6 deletions(-) diff --git a/dss-appconn/appconns/dss-schedulis-appconn/src/main/java/com/webank/wedatasphere/dss/appconn/schedulis/linkisjob/LinkisJobConverter.java b/dss-appconn/appconns/dss-schedulis-appconn/src/main/java/com/webank/wedatasphere/dss/appconn/schedulis/linkisjob/LinkisJobConverter.java index c60882d507..8f569be455 100644 --- a/dss-appconn/appconns/dss-schedulis-appconn/src/main/java/com/webank/wedatasphere/dss/appconn/schedulis/linkisjob/LinkisJobConverter.java +++ b/dss-appconn/appconns/dss-schedulis-appconn/src/main/java/com/webank/wedatasphere/dss/appconn/schedulis/linkisjob/LinkisJobConverter.java @@ -115,8 +115,22 @@ private void convertConfiguration(WorkflowNode workflowNode, LinkisJob job){ configuration.forEach((k,v)-> { if(null!=v) { v.forEach((k2, v2) -> { - if(AzkabanConstant.AUTO_DISABLED.equals(k2) && null !=v2){job.setAutoDisabled(v2.toString());} - else if(null !=v2) {job.getConf().put(confprefix + k + "." + k2, v2.toString());} + if(v2!=null) { + String vStr; + if (v2 instanceof Number) { + Number numValue = (Number) v2; + vStr = numValue.longValue() == numValue.doubleValue() ? + String.valueOf(numValue.longValue()) : + numValue.toString(); + } else { + vStr = v2.toString(); + } + if (AzkabanConstant.AUTO_DISABLED.equals(k2) ) { + job.setAutoDisabled(vStr); + } else { + job.getConf().put(confprefix + k + "." + k2, vStr); + } + } }); } }); diff --git a/dss-appconn/appconns/dss-schedulis-appconn/src/main/java/com/webank/wedatasphere/dss/appconn/schedulis/linkisjob/WTSSJobConverter.java b/dss-appconn/appconns/dss-schedulis-appconn/src/main/java/com/webank/wedatasphere/dss/appconn/schedulis/linkisjob/WTSSJobConverter.java index 002152ed84..0705957026 100644 --- a/dss-appconn/appconns/dss-schedulis-appconn/src/main/java/com/webank/wedatasphere/dss/appconn/schedulis/linkisjob/WTSSJobConverter.java +++ b/dss-appconn/appconns/dss-schedulis-appconn/src/main/java/com/webank/wedatasphere/dss/appconn/schedulis/linkisjob/WTSSJobConverter.java @@ -116,12 +116,21 @@ private void convertConfiguration(WorkflowNode workflowNode, LinkisJob job){ v.forEach((k2, v2) -> { if(AzkabanConstant.AUTO_DISABLED.equals(k2) && null !=v2){job.setAutoDisabled(v2.toString());} else if(null !=v2) { + String vStr; + if (v2 instanceof Number) { + Number numValue = (Number) v2; + vStr = numValue.longValue() == numValue.doubleValue() ? + String.valueOf(numValue.longValue()) : + numValue.toString(); + } else { + vStr = v2.toString(); + } if("only.receive.today".equals(k2)){ - job.getConf().put("msg.rece.today", v2.toString()); + job.getConf().put("msg.rece.today", vStr); }else if("max.receive.hours".equals(k2)){ - job.getConf().put("wait.time", v2.toString()); + job.getConf().put("wait.time", vStr); }else{ - job.getConf().put(k2, v2.toString()); + job.getConf().put(k2, vStr); } } }); diff --git a/dss-orchestrator/orchestrators/dss-workflow/dss-workflow-server/src/main/java/com/webank/wedatasphere/dss/workflow/service/impl/DSSFlowServiceImpl.java b/dss-orchestrator/orchestrators/dss-workflow/dss-workflow-server/src/main/java/com/webank/wedatasphere/dss/workflow/service/impl/DSSFlowServiceImpl.java index cfccb81d07..b85d1d3cd9 100644 --- a/dss-orchestrator/orchestrators/dss-workflow/dss-workflow-server/src/main/java/com/webank/wedatasphere/dss/workflow/service/impl/DSSFlowServiceImpl.java +++ b/dss-orchestrator/orchestrators/dss-workflow/dss-workflow-server/src/main/java/com/webank/wedatasphere/dss/workflow/service/impl/DSSFlowServiceImpl.java @@ -666,7 +666,16 @@ public void saveFlowMetaData(Long flowID, String jsonFlow, Long orchestratorId) for (Map.Entry paramEntry : paramValue.entrySet()) { String paramName = paramEntry.getKey(); if (paramEntry.getValue() != null) { - String paramVal = paramEntry.getValue().toString(); + String paramVal; + Object value = paramEntry.getValue(); + if (value instanceof Number) { + Number numValue = (Number) value; + paramVal = numValue.longValue() == numValue.doubleValue() ? + String.valueOf(numValue.longValue()) : + numValue.toString(); + } else { + paramVal = value.toString(); + } logger.info("{}:{}", paramName, paramVal); String nodeContentType = null; if (nodeNumberMap.containsKey(jobType) && nodeNumberMap.get(jobType).equals(paramName)) {