From 4bb8ba81183e81cd51dea99ef446cdef22bdb0fe Mon Sep 17 00:00:00 2001 From: "Signed-off-by: wmqwxb" <13628607970@163.com> Date: Wed, 15 Nov 2023 10:21:49 +0800 Subject: [PATCH 1/2] update query param to list Signed-off-by: wmqwxb <13628607970@163.com> --- .../board/services/JobManagerService.java | 7 ++----- .../board/services/JobWebSocketService.java | 20 +++++++++++-------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/main/java/org/fedai/fate/board/services/JobManagerService.java b/src/main/java/org/fedai/fate/board/services/JobManagerService.java index 06e7a77d..c0f43ef4 100644 --- a/src/main/java/org/fedai/fate/board/services/JobManagerService.java +++ b/src/main/java/org/fedai/fate/board/services/JobManagerService.java @@ -73,12 +73,9 @@ public class JobManagerService { public List queryJobStatus() { Map param = new HashMap<>(); List statusList = new ArrayList<>(); -// statusList.add(Dict.STATUS_JOB_WAITING); + statusList.add(Dict.STATUS_JOB_WAITING); statusList.add(Dict.STATUS_JOB_RUNNING); - - String statusStr = String.join(",", statusList); - param.put("status", statusStr); - + param.put("status", statusList); Map jobMap = getJobMap(param); if (jobMap != null) { return (List) jobMap.get("list"); diff --git a/src/main/java/org/fedai/fate/board/services/JobWebSocketService.java b/src/main/java/org/fedai/fate/board/services/JobWebSocketService.java index a91cdb0e..7125956d 100644 --- a/src/main/java/org/fedai/fate/board/services/JobWebSocketService.java +++ b/src/main/java/org/fedai/fate/board/services/JobWebSocketService.java @@ -132,14 +132,15 @@ public void run() { throw new IllegalArgumentException("summary parameter error"); } - if (pushStatus) { - JSONObject dependency = (JSONObject) flushToWebData.get(Dict.DEPENDENCY_DATA); - dependency.remove("component_module"); - dependency.remove("component_need_run"); - dependency.remove("dependencies"); - Map summary = (Map) flushToWebData.get(Dict.SUMMARY_DATA); - summary.remove("dataset"); - } +// if (pushStatus) { +// JSONObject dependency = (JSONObject) flushToWebData.get(Dict.DEPENDENCY_DATA); +// dependency.remove("component_module"); +// dependency.remove("component_need_run"); +// dependency.remove("dependencies"); +// Map summary = (Map) flushToWebData.get(Dict.SUMMARY_DATA); +// summary.remove("dataset"); +// } +// if (session.isOpen()) { session.getBasicRemote().sendText(JSON.toJSONString(flushToWebData)); logger.warn("session:{}, data to push:{}", session, JSON.toJSONString(flushToWebData)); @@ -147,6 +148,9 @@ public void run() { if (Dict.JOB_FINISHED_STATUS.contains(status)) { session.close(); break; + + + } Thread.sleep(500); } else { From 31148d9d6f52f509a9cf8e6b3bc299bed4132fd5 Mon Sep 17 00:00:00 2001 From: "Signed-off-by: wmqwxb" <13628607970@163.com> Date: Wed, 15 Nov 2023 20:08:02 +0800 Subject: [PATCH 2/2] fix bug: update query param to list Signed-off-by: wmqwxb <13628607970@163.com> --- src/main/java/org/fedai/fate/board/pojo/PagedJobQO.java | 2 ++ .../java/org/fedai/fate/board/services/JobManagerService.java | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/fedai/fate/board/pojo/PagedJobQO.java b/src/main/java/org/fedai/fate/board/pojo/PagedJobQO.java index a3c5c058..6456658b 100644 --- a/src/main/java/org/fedai/fate/board/pojo/PagedJobQO.java +++ b/src/main/java/org/fedai/fate/board/pojo/PagedJobQO.java @@ -28,7 +28,9 @@ @EqualsAndHashCode @ToString public class PagedJobQO implements Serializable { + @JsonProperty("job_id") private String jobId; + @JsonProperty("partyId") private String partyId; private Long pageNum = 1L; private Long pageSize = 10L; diff --git a/src/main/java/org/fedai/fate/board/services/JobManagerService.java b/src/main/java/org/fedai/fate/board/services/JobManagerService.java index c0f43ef4..b634d549 100644 --- a/src/main/java/org/fedai/fate/board/services/JobManagerService.java +++ b/src/main/java/org/fedai/fate/board/services/JobManagerService.java @@ -181,11 +181,11 @@ public PageBean> queryPagedJobs(PagedJobQO pagedJobQO) { } if (pagedJobQO.getRole() != null && pagedJobQO.getRole().size() > 0) { - reqMap.put(Dict.ROLE, String.join(",",pagedJobQO.getRole())); + reqMap.put(Dict.ROLE, pagedJobQO.getRole()); } if (pagedJobQO.getStatus() != null && pagedJobQO.getStatus().size() > 0) { - reqMap.put(Dict.STATUS, String.join(",",pagedJobQO.getStatus())); + reqMap.put(Dict.STATUS, pagedJobQO.getStatus()); } if (org.apache.commons.lang3.StringUtils.isNotBlank(pagedJobQO.getOrderField())) {