From c35c23d75ae0080626cde0c3b6a38bdfb1b5f720 Mon Sep 17 00:00:00 2001 From: xuxueli <931591021@qq.com> Date: Fri, 25 Oct 2019 12:17:33 +0800 Subject: [PATCH] update document --- .../admin/service/impl/XxlJobServiceImpl.java | 28 +++++++++++++++---- .../resources/static/js/jobinfo.index.1.js | 1 + 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/XxlJobServiceImpl.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/XxlJobServiceImpl.java index 7e143955..1bd746ad 100644 --- a/xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/XxlJobServiceImpl.java +++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/XxlJobServiceImpl.java @@ -91,9 +91,8 @@ public class XxlJobServiceImpl implements XxlJobService { } // ChildJobId valid - String childJobId = jobInfo.getChildJobId(); - if (childJobId !=null && childJobId.trim().length()>0) { - String[] childJobIds = childJobId.split(","); + if (jobInfo.getChildJobId()!=null && jobInfo.getChildJobId().trim().length()>0) { + String[] childJobIds = jobInfo.getChildJobId().split(","); for (String childJobIdItem: childJobIds) { if (childJobIdItem!=null && childJobIdItem.trim().length()>0 && isNumeric(childJobIdItem)) { XxlJobInfo childJobInfo = xxlJobInfoDao.loadById(Integer.parseInt(childJobIdItem)); @@ -106,6 +105,15 @@ public class XxlJobServiceImpl implements XxlJobService { MessageFormat.format((I18nUtil.getString("jobinfo_field_childJobId")+"({0})"+I18nUtil.getString("system_unvalid")), childJobIdItem)); } } + + // join , avoid "xxx,," + String temp = ""; + for (String item:childJobIds) { + temp += item + ","; + } + temp = temp.substring(0, temp.length()-1); + + jobInfo.setChildJobId(temp); } // add in db @@ -147,9 +155,8 @@ public class XxlJobServiceImpl implements XxlJobService { } // ChildJobId valid - String childJobId = jobInfo.getChildJobId(); - if (childJobId !=null && childJobId.trim().length()>0) { - String[] childJobIds = childJobId.split(","); + if (jobInfo.getChildJobId()!=null && jobInfo.getChildJobId().trim().length()>0) { + String[] childJobIds = jobInfo.getChildJobId().split(","); for (String childJobIdItem: childJobIds) { if (childJobIdItem!=null && childJobIdItem.trim().length()>0 && isNumeric(childJobIdItem)) { XxlJobInfo childJobInfo = xxlJobInfoDao.loadById(Integer.parseInt(childJobIdItem)); @@ -162,6 +169,15 @@ public class XxlJobServiceImpl implements XxlJobService { MessageFormat.format((I18nUtil.getString("jobinfo_field_childJobId")+"({0})"+I18nUtil.getString("system_unvalid")), childJobIdItem)); } } + + // join , avoid "xxx,," + String temp = ""; + for (String item:childJobIds) { + temp += item + ","; + } + temp = temp.substring(0, temp.length()-1); + + jobInfo.setChildJobId(temp); } // group valid diff --git a/xxl-job-admin/src/main/resources/static/js/jobinfo.index.1.js b/xxl-job-admin/src/main/resources/static/js/jobinfo.index.1.js index 794ad255..124f699d 100644 --- a/xxl-job-admin/src/main/resources/static/js/jobinfo.index.1.js +++ b/xxl-job-admin/src/main/resources/static/js/jobinfo.index.1.js @@ -119,6 +119,7 @@ $(function() { if ('BEAN' != row.glueType) { var codeUrl = base_url +'/jobcode?jobId='+ row.id; codeBtn = '