Przeglądaj źródła

Merge pull request #1196 from Z-Beatles/hotfix-1022

许雪里 5 lat temu
rodzic
commit
404500e981
No account linked to committer's email

+ 11 - 21
xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/XxlJobServiceImpl.java Wyświetl plik

91
 		}
91
 		}
92
 
92
 
93
 		// ChildJobId valid
93
 		// ChildJobId valid
94
-		if (jobInfo.getChildJobId()!=null && jobInfo.getChildJobId().trim().length()>0) {
95
-			String[] childJobIds = jobInfo.getChildJobId().split(",");
94
+        String childJobId = jobInfo.getChildJobId();
95
+        if (childJobId !=null && childJobId.trim().length()>0) {
96
+			String[] childJobIds = childJobId.split(",");
96
 			for (String childJobIdItem: childJobIds) {
97
 			for (String childJobIdItem: childJobIds) {
97
 				if (childJobIdItem!=null && childJobIdItem.trim().length()>0 && isNumeric(childJobIdItem)) {
98
 				if (childJobIdItem!=null && childJobIdItem.trim().length()>0 && isNumeric(childJobIdItem)) {
98
-					XxlJobInfo childJobInfo = xxlJobInfoDao.loadById(Integer.valueOf(childJobIdItem));
99
+					XxlJobInfo childJobInfo = xxlJobInfoDao.loadById(Integer.parseInt(childJobIdItem));
99
 					if (childJobInfo==null) {
100
 					if (childJobInfo==null) {
100
 						return new ReturnT<String>(ReturnT.FAIL_CODE,
101
 						return new ReturnT<String>(ReturnT.FAIL_CODE,
101
 								MessageFormat.format((I18nUtil.getString("jobinfo_field_childJobId")+"({0})"+I18nUtil.getString("system_not_found")), childJobIdItem));
102
 								MessageFormat.format((I18nUtil.getString("jobinfo_field_childJobId")+"({0})"+I18nUtil.getString("system_not_found")), childJobIdItem));
106
 				}
107
 				}
107
 			}
108
 			}
108
 
109
 
109
-			String temp = "";	// join ,
110
-			for (String item:childJobIds) {
111
-				temp += item + ",";
112
-			}
113
-			temp = temp.substring(0, temp.length()-1);
114
-
115
-			jobInfo.setChildJobId(temp);
110
+			jobInfo.setChildJobId(childJobId);
116
 		}
111
 		}
117
 
112
 
118
 		// add in db
113
 		// add in db
154
 		}
149
 		}
155
 
150
 
156
 		// ChildJobId valid
151
 		// ChildJobId valid
157
-		if (jobInfo.getChildJobId()!=null && jobInfo.getChildJobId().trim().length()>0) {
158
-			String[] childJobIds = jobInfo.getChildJobId().split(",");
152
+        String childJobId = jobInfo.getChildJobId();
153
+        if (childJobId !=null && childJobId.trim().length()>0) {
154
+			String[] childJobIds = childJobId.split(",");
159
 			for (String childJobIdItem: childJobIds) {
155
 			for (String childJobIdItem: childJobIds) {
160
 				if (childJobIdItem!=null && childJobIdItem.trim().length()>0 && isNumeric(childJobIdItem)) {
156
 				if (childJobIdItem!=null && childJobIdItem.trim().length()>0 && isNumeric(childJobIdItem)) {
161
-					XxlJobInfo childJobInfo = xxlJobInfoDao.loadById(Integer.valueOf(childJobIdItem));
157
+					XxlJobInfo childJobInfo = xxlJobInfoDao.loadById(Integer.parseInt(childJobIdItem));
162
 					if (childJobInfo==null) {
158
 					if (childJobInfo==null) {
163
 						return new ReturnT<String>(ReturnT.FAIL_CODE,
159
 						return new ReturnT<String>(ReturnT.FAIL_CODE,
164
 								MessageFormat.format((I18nUtil.getString("jobinfo_field_childJobId")+"({0})"+I18nUtil.getString("system_not_found")), childJobIdItem));
160
 								MessageFormat.format((I18nUtil.getString("jobinfo_field_childJobId")+"({0})"+I18nUtil.getString("system_not_found")), childJobIdItem));
169
 				}
165
 				}
170
 			}
166
 			}
171
 
167
 
172
-			String temp = "";	// join ,
173
-			for (String item:childJobIds) {
174
-				temp += item + ",";
175
-			}
176
-			temp = temp.substring(0, temp.length()-1);
177
-
178
-			jobInfo.setChildJobId(temp);
168
+			jobInfo.setChildJobId(childJobId);
179
 		}
169
 		}
180
 
170
 
181
 		// group valid
171
 		// group valid
216
 		exists_jobInfo.setExecutorBlockStrategy(jobInfo.getExecutorBlockStrategy());
206
 		exists_jobInfo.setExecutorBlockStrategy(jobInfo.getExecutorBlockStrategy());
217
 		exists_jobInfo.setExecutorTimeout(jobInfo.getExecutorTimeout());
207
 		exists_jobInfo.setExecutorTimeout(jobInfo.getExecutorTimeout());
218
 		exists_jobInfo.setExecutorFailRetryCount(jobInfo.getExecutorFailRetryCount());
208
 		exists_jobInfo.setExecutorFailRetryCount(jobInfo.getExecutorFailRetryCount());
219
-		exists_jobInfo.setChildJobId(jobInfo.getChildJobId());
209
+		exists_jobInfo.setChildJobId(childJobId);
220
 		exists_jobInfo.setTriggerNextTime(nextTriggerTime);
210
 		exists_jobInfo.setTriggerNextTime(nextTriggerTime);
221
         xxlJobInfoDao.update(exists_jobInfo);
211
         xxlJobInfoDao.update(exists_jobInfo);
222
 
212