(Arrays.asList(info.getAlarmEmail().split(",")));
- for (String email: emailSet) {
+ for (String email : emailSet) {
// make mail
try {
@@ -88,28 +89,28 @@ public class EmailJobAlarm implements JobAlarm {
*
* @return
*/
- private static final String loadEmailJobAlarmTemplate(){
+ private static final String loadEmailJobAlarmTemplate() {
String mailBodyTemplate = "" + I18nUtil.getString("jobconf_monitor_detail") + ":" +
- "
\n" +
- " " +
- " \n" +
- " | "+ I18nUtil.getString("jobinfo_field_jobgroup") +" | \n" +
- " "+ I18nUtil.getString("jobinfo_field_id") +" | \n" +
- " "+ I18nUtil.getString("jobinfo_field_jobdesc") +" | \n" +
- " "+ I18nUtil.getString("jobconf_monitor_alarm_title") +" | \n" +
- " "+ I18nUtil.getString("jobconf_monitor_alarm_content") +" | \n" +
- "
\n" +
- " \n" +
- " \n" +
- " \n" +
- " | {0} | \n" +
- " {1} | \n" +
- " {2} | \n" +
- " "+ I18nUtil.getString("jobconf_monitor_alarm_type") +" | \n" +
- " {3} | \n" +
- "
\n" +
- " \n" +
- "
";
+ "\n" +
+ " " +
+ " \n" +
+ " | " + I18nUtil.getString("jobinfo_field_jobgroup") + " | \n" +
+ " " + I18nUtil.getString("jobinfo_field_id") + " | \n" +
+ " " + I18nUtil.getString("jobinfo_field_jobdesc") + " | \n" +
+ " " + I18nUtil.getString("jobconf_monitor_alarm_title") + " | \n" +
+ " " + I18nUtil.getString("jobconf_monitor_alarm_content") + " | \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " | {0} | \n" +
+ " {1} | \n" +
+ " {2} | \n" +
+ " " + I18nUtil.getString("jobconf_monitor_alarm_type") + " | \n" +
+ " {3} | \n" +
+ "
\n" +
+ " \n" +
+ "
";
return mailBodyTemplate;
}
diff --git a/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/core/complete/XxlJobCompleter.java b/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/core/complete/XxlJobCompleter.java
index b9ac59a3..83399336 100644
--- a/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/core/complete/XxlJobCompleter.java
+++ b/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/core/complete/XxlJobCompleter.java
@@ -32,7 +32,7 @@ public class XxlJobCompleter {
// text最大64kb 避免长度过长
if (xxlJobLog.getHandleMsg().length() > 15000) {
- xxlJobLog.setHandleMsg( xxlJobLog.getHandleMsg().substring(0, 15000) );
+ xxlJobLog.setHandleMsg(xxlJobLog.getHandleMsg().substring(0, 15000));
}
// fresh handle
@@ -43,18 +43,18 @@ public class XxlJobCompleter {
/**
* do somethind to finish job
*/
- private static void finishJob(XxlJobLog xxlJobLog){
+ private static void finishJob(XxlJobLog xxlJobLog) {
// 1、handle success, to trigger child job
String triggerChildMsg = null;
- if (XxlJobContext.HANDLE_COCE_SUCCESS == xxlJobLog.getHandleCode()) {
+ if (XxlJobContext.HANDLE_CODE_SUCCESS == xxlJobLog.getHandleCode()) {
XxlJobInfo xxlJobInfo = XxlJobAdminConfig.getAdminConfig().getXxlJobInfoDao().loadById(xxlJobLog.getJobId());
- if (xxlJobInfo!=null && xxlJobInfo.getChildJobId()!=null && xxlJobInfo.getChildJobId().trim().length()>0) {
- triggerChildMsg = "
>>>>>>>>>>>"+ I18nUtil.getString("jobconf_trigger_child_run") +"<<<<<<<<<<<
";
+ if (xxlJobInfo != null && xxlJobInfo.getChildJobId() != null && xxlJobInfo.getChildJobId().trim().length() > 0) {
+ triggerChildMsg = "
>>>>>>>>>>>" + I18nUtil.getString("jobconf_trigger_child_run") + "<<<<<<<<<<<
";
String[] childJobIds = xxlJobInfo.getChildJobId().split(",");
for (int i = 0; i < childJobIds.length; i++) {
- int childJobId = (childJobIds[i]!=null && childJobIds[i].trim().length()>0 && isNumeric(childJobIds[i]))?Integer.valueOf(childJobIds[i]):-1;
+ int childJobId = (childJobIds[i] != null && childJobIds[i].trim().length() > 0 && isNumeric(childJobIds[i])) ? Integer.valueOf(childJobIds[i]) : -1;
if (childJobId > 0) {
JobTriggerPoolHelper.trigger(childJobId, TriggerTypeEnum.PARENT, -1, null, null, null);
@@ -62,16 +62,16 @@ public class XxlJobCompleter {
// add msg
triggerChildMsg += MessageFormat.format(I18nUtil.getString("jobconf_callback_child_msg1"),
- (i+1),
- childJobIds.length,
- childJobIds[i],
- (triggerChildResult.getCode()==ReturnT.SUCCESS_CODE?I18nUtil.getString("system_success"):I18nUtil.getString("system_fail")),
- triggerChildResult.getMsg());
+ (i + 1),
+ childJobIds.length,
+ childJobIds[i],
+ (triggerChildResult.getCode() == ReturnT.SUCCESS_CODE ? I18nUtil.getString("system_success") : I18nUtil.getString("system_fail")),
+ triggerChildResult.getMsg());
} else {
triggerChildMsg += MessageFormat.format(I18nUtil.getString("jobconf_callback_child_msg2"),
- (i+1),
- childJobIds.length,
- childJobIds[i]);
+ (i + 1),
+ childJobIds.length,
+ childJobIds[i]);
}
}
@@ -79,7 +79,7 @@ public class XxlJobCompleter {
}
if (triggerChildMsg != null) {
- xxlJobLog.setHandleMsg( xxlJobLog.getHandleMsg() + triggerChildMsg );
+ xxlJobLog.setHandleMsg(xxlJobLog.getHandleMsg() + triggerChildMsg);
}
// 2、fix_delay trigger next
@@ -87,7 +87,7 @@ public class XxlJobCompleter {
}
- private static boolean isNumeric(String str){
+ private static boolean isNumeric(String str) {
try {
int result = Integer.valueOf(str);
return true;
diff --git a/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/core/conf/XxlJobAdminConfig.java b/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/core/conf/XxlJobAdminConfig.java
index 380b8a59..6e40cb76 100644
--- a/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/core/conf/XxlJobAdminConfig.java
+++ b/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/core/conf/XxlJobAdminConfig.java
@@ -23,6 +23,7 @@ import java.util.Arrays;
public class XxlJobAdminConfig implements InitializingBean, DisposableBean {
private static XxlJobAdminConfig adminConfig = null;
+
public static XxlJobAdminConfig getAdminConfig() {
return adminConfig;
}
diff --git a/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/core/cron/CronExpression.java b/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/core/cron/CronExpression.java
index fce23524..0b594d75 100644
--- a/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/core/cron/CronExpression.java
+++ b/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/core/cron/CronExpression.java
@@ -1,44 +1,35 @@
/*
* All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy
- * of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
* under the License.
- *
+ *
*/
package com.xxl.job.admin.core.cron;
import java.io.Serializable;
import java.text.ParseException;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Locale;
-import java.util.Map;
-import java.util.SortedSet;
-import java.util.StringTokenizer;
-import java.util.TimeZone;
-import java.util.TreeSet;
+import java.util.*;
/**
- * Provides a parser and evaluator for unix-like cron expressions. Cron
+ * Provides a parser and evaluator for unix-like cron expressions. Cron
* expressions provide the ability to specify complex time combinations such as
- * "At 8:00am every Monday through Friday" or "At 1:30am every
- * last Friday of the month".
+ * "At 8:00am every Monday through Friday" or "At 1:30am every
+ * last Friday of the month".
*
* Cron expressions are comprised of 6 required fields and one optional field
* separated by white space. The fields respectively are described as follows:
- *
+ *
*
*
* | Field Name |
@@ -98,7 +89,7 @@ import java.util.TreeSet;
*
*
*
- * The '*' character is used to specify all values. For example, "*"
+ * The '*' character is used to specify all values. For example, "*"
* in the minute field means "every minute".
*
* The '?' character is allowed for the day-of-month and day-of-week fields. It
@@ -113,55 +104,55 @@ import java.util.TreeSet;
* Wednesday, and Friday".
*
* The '/' character is used to specify increments. For example "0/15"
- * in the seconds field means "the seconds 0, 15, 30, and 45". And
+ * in the seconds field means "the seconds 0, 15, 30, and 45". And
* "5/15" in the seconds field means "the seconds 5, 20, 35, and
* 50". Specifying '*' before the '/' is equivalent to specifying 0 is
* the value to start with. Essentially, for each field in the expression, there
- * is a set of numbers that can be turned on or off. For seconds and minutes,
+ * is a set of numbers that can be turned on or off. For seconds and minutes,
* the numbers range from 0 to 59. For hours 0 to 23, for days of the month 0 to
* 31, and for months 0 to 11 (JAN to DEC). The "/" character simply helps you turn
* on every "nth" value in the given set. Thus "7/6" in the
- * month field only turns on month "7", it does NOT mean every 6th
- * month, please note that subtlety.
+ * month field only turns on month "7", it does NOT mean every 6th
+ * month, please note that subtlety.
*
* The 'L' character is allowed for the day-of-month and day-of-week fields.
- * This character is short-hand for "last", but it has different
- * meaning in each of the two fields. For example, the value "L" in
- * the day-of-month field means "the last day of the month" - day 31
- * for January, day 28 for February on non-leap years. If used in the
- * day-of-week field by itself, it simply means "7" or
+ * This character is short-hand for "last", but it has different
+ * meaning in each of the two fields. For example, the value "L" in
+ * the day-of-month field means "the last day of the month" - day 31
+ * for January, day 28 for February on non-leap years. If used in the
+ * day-of-week field by itself, it simply means "7" or
* "SAT". But if used in the day-of-week field after another value, it
* means "the last xxx day of the month" - for example "6L"
- * means "the last friday of the month". You can also specify an offset
- * from the last day of the month, such as "L-3" which would mean the third-to-last
- * day of the calendar month. When using the 'L' option, it is important not to
+ * means "the last friday of the month". You can also specify an offset
+ * from the last day of the month, such as "L-3" which would mean the third-to-last
+ * day of the calendar month. When using the 'L' option, it is important not to
* specify lists, or ranges of values, as you'll get confusing/unexpected results.
*
- * The 'W' character is allowed for the day-of-month field. This character
- * is used to specify the weekday (Monday-Friday) nearest the given day. As an
- * example, if you were to specify "15W" as the value for the
+ * The 'W' character is allowed for the day-of-month field. This character
+ * is used to specify the weekday (Monday-Friday) nearest the given day. As an
+ * example, if you were to specify "15W" as the value for the
* day-of-month field, the meaning is: "the nearest weekday to the 15th of
- * the month". So if the 15th is a Saturday, the trigger will fire on
+ * the month". So if the 15th is a Saturday, the trigger will fire on
* Friday the 14th. If the 15th is a Sunday, the trigger will fire on Monday the
- * 16th. If the 15th is a Tuesday, then it will fire on Tuesday the 15th.
+ * 16th. If the 15th is a Tuesday, then it will fire on Tuesday the 15th.
* However if you specify "1W" as the value for day-of-month, and the
- * 1st is a Saturday, the trigger will fire on Monday the 3rd, as it will not
- * 'jump' over the boundary of a month's days. The 'W' character can only be
+ * 1st is a Saturday, the trigger will fire on Monday the 3rd, as it will not
+ * 'jump' over the boundary of a month's days. The 'W' character can only be
* specified when the day-of-month is a single day, not a range or list of days.
*
- * The 'L' and 'W' characters can also be combined for the day-of-month
- * expression to yield 'LW', which translates to "last weekday of the
+ * The 'L' and 'W' characters can also be combined for the day-of-month
+ * expression to yield 'LW', which translates to "last weekday of the
* month".
*
* The '#' character is allowed for the day-of-week field. This character is
- * used to specify "the nth" XXX day of the month. For example, the
- * value of "6#3" in the day-of-week field means the third Friday of
- * the month (day 6 = Friday and "#3" = the 3rd one in the month).
- * Other examples: "2#1" = the first Monday of the month and
+ * used to specify "the nth" XXX day of the month. For example, the
+ * value of "6#3" in the day-of-week field means the third Friday of
+ * the month (day 6 = Friday and "#3" = the 3rd one in the month).
+ * Other examples: "2#1" = the first Monday of the month and
* "4#5" = the fifth Wednesday of the month. Note that if you specify
* "#5" and there is not 5 of the given day-of-week in the month, then
* no firing will occur that month. If the '#' character is used, there can
- * only be one expression in the day-of-week field ("3#1,6#3" is
+ * only be one expression in the day-of-week field ("3#1,6#3" is
* not valid, since there are two expressions).
*
* json
- *
+ *
* @param obj
* @return json string
* @throws Exception
*/
public static String writeValueAsString(Object obj) {
- try {
- return getInstance().writeValueAsString(obj);
- } catch (JsonGenerationException e) {
- logger.error(e.getMessage(), e);
- } catch (JsonMappingException e) {
- logger.error(e.getMessage(), e);
- } catch (IOException e) {
- logger.error(e.getMessage(), e);
- }
+ try {
+ return getInstance().writeValueAsString(obj);
+ } catch (JsonGenerationException e) {
+ logger.error(e.getMessage(), e);
+ } catch (JsonMappingException e) {
+ logger.error(e.getMessage(), e);
+ } catch (IOException e) {
+ logger.error(e.getMessage(), e);
+ }
return null;
}
/**
* string --> bean、Map、List(array)
- *
+ *
* @param jsonStr
* @param clazz
* @return obj
* @throws Exception
*/
public static T readValue(String jsonStr, Class clazz) {
- try {
- return getInstance().readValue(jsonStr, clazz);
- } catch (JsonParseException e) {
- logger.error(e.getMessage(), e);
- } catch (JsonMappingException e) {
- logger.error(e.getMessage(), e);
- } catch (IOException e) {
- logger.error(e.getMessage(), e);
- }
- return null;
+ try {
+ return getInstance().readValue(jsonStr, clazz);
+ } catch (JsonParseException e) {
+ logger.error(e.getMessage(), e);
+ } catch (JsonMappingException e) {
+ logger.error(e.getMessage(), e);
+ } catch (IOException e) {
+ logger.error(e.getMessage(), e);
+ }
+ return null;
}
- /**
- * string --> List...
- *
- * @param jsonStr
- * @param parametrized
- * @param parameterClasses
- * @param
- * @return
- */
- public static T readValue(String jsonStr, Class> parametrized, Class>... parameterClasses) {
- try {
- JavaType javaType = getInstance().getTypeFactory().constructParametricType(parametrized, parameterClasses);
- return getInstance().readValue(jsonStr, javaType);
- } catch (JsonParseException e) {
- logger.error(e.getMessage(), e);
- } catch (JsonMappingException e) {
- logger.error(e.getMessage(), e);
- } catch (IOException e) {
- logger.error(e.getMessage(), e);
- }
- return null;
- }
+ /**
+ * string --> List...
+ *
+ * @param jsonStr
+ * @param parametrized
+ * @param parameterClasses
+ * @param
+ * @return
+ */
+ public static T readValue(String jsonStr, Class> parametrized, Class>... parameterClasses) {
+ try {
+ JavaType javaType = getInstance().getTypeFactory().constructParametricType(parametrized, parameterClasses);
+ return getInstance().readValue(jsonStr, javaType);
+ } catch (JsonParseException e) {
+ logger.error(e.getMessage(), e);
+ } catch (JsonMappingException e) {
+ logger.error(e.getMessage(), e);
+ } catch (IOException e) {
+ logger.error(e.getMessage(), e);
+ }
+ return null;
+ }
}
diff --git a/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/core/util/LocalCacheUtil.java b/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/core/util/LocalCacheUtil.java
index fbab0613..6232afac 100644
--- a/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/core/util/LocalCacheUtil.java
+++ b/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/core/util/LocalCacheUtil.java
@@ -11,7 +11,8 @@ import java.util.concurrent.ConcurrentMap;
public class LocalCacheUtil {
private static ConcurrentMap cacheRepository = new ConcurrentHashMap(); // 类型建议用抽象父类,兼容性更好;
- private static class LocalCacheData{
+
+ private static class LocalCacheData {
private String key;
private Object val;
private long timeoutTime;
@@ -59,13 +60,13 @@ public class LocalCacheUtil {
* @param cacheTime
* @return
*/
- public static boolean set(String key, Object val, long cacheTime){
+ public static boolean set(String key, Object val, long cacheTime) {
// clean timeout cache, before set new cache (avoid cache too much)
cleanTimeoutCache();
// set new cache
- if (key==null || key.trim().length()==0) {
+ if (key == null || key.trim().length() == 0) {
return false;
}
if (val == null) {
@@ -86,8 +87,8 @@ public class LocalCacheUtil {
* @param key
* @return
*/
- public static boolean remove(String key){
- if (key==null || key.trim().length()==0) {
+ public static boolean remove(String key) {
+ if (key == null || key.trim().length() == 0) {
return false;
}
cacheRepository.remove(key);
@@ -100,12 +101,12 @@ public class LocalCacheUtil {
* @param key
* @return
*/
- public static Object get(String key){
- if (key==null || key.trim().length()==0) {
+ public static Object get(String key) {
+ if (key == null || key.trim().length() == 0) {
return null;
}
LocalCacheData localCacheData = cacheRepository.get(key);
- if (localCacheData!=null && System.currentTimeMillis()=localCacheData.getTimeoutTime()) {
+ if (localCacheData != null && System.currentTimeMillis() >= localCacheData.getTimeoutTime()) {
cacheRepository.remove(key);
}
}
diff --git a/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobInfoDao.java b/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobInfoDao.java
index d640efff..e01dd112 100644
--- a/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobInfoDao.java
+++ b/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobInfoDao.java
@@ -9,41 +9,43 @@ import java.util.List;
/**
* job info
+ *
* @author xuxueli 2016-1-12 18:03:45
*/
@Mapper
public interface XxlJobInfoDao {
- public List pageList(@Param("offset") int offset,
- @Param("pagesize") int pagesize,
- @Param("jobGroup") int jobGroup,
- @Param("triggerStatus") int triggerStatus,
- @Param("jobDesc") String jobDesc,
- @Param("executorHandler") String executorHandler,
- @Param("author") String author);
- public int pageListCount(@Param("offset") int offset,
- @Param("pagesize") int pagesize,
- @Param("jobGroup") int jobGroup,
- @Param("triggerStatus") int triggerStatus,
- @Param("jobDesc") String jobDesc,
- @Param("executorHandler") String executorHandler,
- @Param("author") String author);
-
- public int save(XxlJobInfo info);
+ public List pageList(@Param("offset") int offset,
+ @Param("pagesize") int pagesize,
+ @Param("jobGroup") int jobGroup,
+ @Param("triggerStatus") int triggerStatus,
+ @Param("jobDesc") String jobDesc,
+ @Param("executorHandler") String executorHandler,
+ @Param("author") String author);
- public XxlJobInfo loadById(@Param("id") int id);
-
- public int update(XxlJobInfo xxlJobInfo);
-
- public int delete(@Param("id") long id);
+ public int pageListCount(@Param("offset") int offset,
+ @Param("pagesize") int pagesize,
+ @Param("jobGroup") int jobGroup,
+ @Param("triggerStatus") int triggerStatus,
+ @Param("jobDesc") String jobDesc,
+ @Param("executorHandler") String executorHandler,
+ @Param("author") String author);
- public List getJobsByGroup(@Param("jobGroup") int jobGroup);
+ public int save(XxlJobInfo info);
- public int findAllCount();
+ public XxlJobInfo loadById(@Param("id") int id);
- public List scheduleJobQuery(@Param("maxNextTime") long maxNextTime, @Param("pagesize") int pagesize );
+ public int update(XxlJobInfo xxlJobInfo);
- public int scheduleUpdate(XxlJobInfo xxlJobInfo);
+ public int delete(@Param("id") long id);
+
+ public List getJobsByGroup(@Param("jobGroup") int jobGroup);
+
+ public int findAllCount();
+
+ public List scheduleJobQuery(@Param("maxNextTime") long maxNextTime, @Param("pagesize") int pagesize);
+
+ public int scheduleUpdate(XxlJobInfo xxlJobInfo);
}
diff --git a/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobLogDao.java b/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobLogDao.java
index 62fa3b4f..7beaf755 100644
--- a/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobLogDao.java
+++ b/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobLogDao.java
@@ -10,53 +10,56 @@ import java.util.Map;
/**
* job log
+ *
* @author xuxueli 2016-1-12 18:03:06
*/
@Mapper
public interface XxlJobLogDao {
- // exist jobId not use jobGroup, not exist use jobGroup
- public List pageList(@Param("offset") int offset,
- @Param("pagesize") int pagesize,
- @Param("jobGroup") int jobGroup,
- @Param("jobId") int jobId,
- @Param("triggerTimeStart") Date triggerTimeStart,
- @Param("triggerTimeEnd") Date triggerTimeEnd,
- @Param("logStatus") int logStatus);
- public int pageListCount(@Param("offset") int offset,
- @Param("pagesize") int pagesize,
- @Param("jobGroup") int jobGroup,
- @Param("jobId") int jobId,
- @Param("triggerTimeStart") Date triggerTimeStart,
- @Param("triggerTimeEnd") Date triggerTimeEnd,
- @Param("logStatus") int logStatus);
-
- public XxlJobLog load(@Param("id") long id);
+ // exist jobId not use jobGroup, not exist use jobGroup
+ public List pageList(@Param("offset") int offset,
+ @Param("pagesize") int pagesize,
+ @Param("jobGroup") int jobGroup,
+ @Param("jobId") int jobId,
+ @Param("triggerTimeStart") Date triggerTimeStart,
+ @Param("triggerTimeEnd") Date triggerTimeEnd,
+ @Param("logStatus") int logStatus);
- public long save(XxlJobLog xxlJobLog);
+ public int pageListCount(@Param("offset") int offset,
+ @Param("pagesize") int pagesize,
+ @Param("jobGroup") int jobGroup,
+ @Param("jobId") int jobId,
+ @Param("triggerTimeStart") Date triggerTimeStart,
+ @Param("triggerTimeEnd") Date triggerTimeEnd,
+ @Param("logStatus") int logStatus);
- public int updateTriggerInfo(XxlJobLog xxlJobLog);
+ public XxlJobLog load(@Param("id") long id);
- public int updateHandleInfo(XxlJobLog xxlJobLog);
-
- public int delete(@Param("jobId") int jobId);
+ public long save(XxlJobLog xxlJobLog);
- public Map findLogReport(@Param("from") Date from,
- @Param("to") Date to);
+ public int updateTriggerInfo(XxlJobLog xxlJobLog);
- public List findClearLogIds(@Param("jobGroup") int jobGroup,
- @Param("jobId") int jobId,
- @Param("clearBeforeTime") Date clearBeforeTime,
- @Param("clearBeforeNum") int clearBeforeNum,
- @Param("pagesize") int pagesize);
- public int clearLog(@Param("logIds") List logIds);
+ public int updateHandleInfo(XxlJobLog xxlJobLog);
- public List findFailJobLogIds(@Param("pagesize") int pagesize);
+ public int delete(@Param("jobId") int jobId);
- public int updateAlarmStatus(@Param("logId") long logId,
- @Param("oldAlarmStatus") int oldAlarmStatus,
- @Param("newAlarmStatus") int newAlarmStatus);
+ public Map findLogReport(@Param("from") Date from,
+ @Param("to") Date to);
- public List findLostJobIds(@Param("losedTime") Date losedTime);
+ public List findClearLogIds(@Param("jobGroup") int jobGroup,
+ @Param("jobId") int jobId,
+ @Param("clearBeforeTime") Date clearBeforeTime,
+ @Param("clearBeforeNum") int clearBeforeNum,
+ @Param("pagesize") int pagesize);
+
+ public int clearLog(@Param("logIds") List logIds);
+
+ public List findFailJobLogIds(@Param("pagesize") int pagesize);
+
+ public int updateAlarmStatus(@Param("logId") long logId,
+ @Param("oldAlarmStatus") int oldAlarmStatus,
+ @Param("newAlarmStatus") int newAlarmStatus);
+
+ public List findLostJobIds(@Param("losedTime") Date losedTime);
}
diff --git a/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobLogGlueDao.java b/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobLogGlueDao.java
index 3028aed2..8b2b414c 100644
--- a/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobLogGlueDao.java
+++ b/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobLogGlueDao.java
@@ -8,17 +8,18 @@ import java.util.List;
/**
* job log for glue
+ *
* @author xuxueli 2016-5-19 18:04:56
*/
@Mapper
public interface XxlJobLogGlueDao {
-
- public int save(XxlJobLogGlue xxlJobLogGlue);
-
- public List findByJobId(@Param("jobId") int jobId);
- public int removeOld(@Param("jobId") int jobId, @Param("limit") int limit);
+ public int save(XxlJobLogGlue xxlJobLogGlue);
+
+ public List findByJobId(@Param("jobId") int jobId);
+
+ public int removeOld(@Param("jobId") int jobId, @Param("limit") int limit);
+
+ public int deleteByJobId(@Param("jobId") int jobId);
- public int deleteByJobId(@Param("jobId") int jobId);
-
}
diff --git a/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobLogReportDao.java b/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobLogReportDao.java
index f4b3dc81..d4e0381a 100644
--- a/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobLogReportDao.java
+++ b/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobLogReportDao.java
@@ -9,18 +9,19 @@ import java.util.List;
/**
* job log
+ *
* @author xuxueli 2019-11-22
*/
@Mapper
public interface XxlJobLogReportDao {
- public int save(XxlJobLogReport xxlJobLogReport);
+ public int save(XxlJobLogReport xxlJobLogReport);
- public int update(XxlJobLogReport xxlJobLogReport);
+ public int update(XxlJobLogReport xxlJobLogReport);
- public List queryLogReport(@Param("triggerDayFrom") Date triggerDayFrom,
- @Param("triggerDayTo") Date triggerDayTo);
+ public List queryLogReport(@Param("triggerDayFrom") Date triggerDayFrom,
+ @Param("triggerDayTo") Date triggerDayTo);
- public XxlJobLogReport queryLogReportTotal();
+ public XxlJobLogReport queryLogReportTotal();
}
diff --git a/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobRegistryDao.java b/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobRegistryDao.java
index 1005c46c..a68e12c3 100644
--- a/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobRegistryDao.java
+++ b/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobRegistryDao.java
@@ -32,7 +32,7 @@ public interface XxlJobRegistryDao {
@Param("updateTime") Date updateTime);
public int registryDelete(@Param("registryGroup") String registryGroup,
- @Param("registryKey") String registryKey,
- @Param("registryValue") String registryValue);
+ @Param("registryKey") String registryKey,
+ @Param("registryValue") String registryValue);
}
diff --git a/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobUserDao.java b/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobUserDao.java
index e8404947..064ce19f 100644
--- a/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobUserDao.java
+++ b/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobUserDao.java
@@ -3,6 +3,7 @@ package com.xxl.job.admin.dao;
import com.xxl.job.admin.core.model.XxlJobUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
+
import java.util.List;
/**
@@ -11,21 +12,22 @@ import java.util.List;
@Mapper
public interface XxlJobUserDao {
- public List pageList(@Param("offset") int offset,
+ public List pageList(@Param("offset") int offset,
@Param("pagesize") int pagesize,
@Param("username") String username,
- @Param("role") int role);
- public int pageListCount(@Param("offset") int offset,
- @Param("pagesize") int pagesize,
- @Param("username") String username,
- @Param("role") int role);
+ @Param("role") int role);
- public XxlJobUser loadByUserName(@Param("username") String username);
+ public int pageListCount(@Param("offset") int offset,
+ @Param("pagesize") int pagesize,
+ @Param("username") String username,
+ @Param("role") int role);
- public int save(XxlJobUser xxlJobUser);
+ public XxlJobUser loadByUserName(@Param("username") String username);
- public int update(XxlJobUser xxlJobUser);
-
- public int delete(@Param("id") int id);
+ public int save(XxlJobUser xxlJobUser);
+
+ public int update(XxlJobUser xxlJobUser);
+
+ public int delete(@Param("id") int id);
}
diff --git a/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/service/LoginService.java b/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/service/LoginService.java
index 960aedd9..0937b8e9 100644
--- a/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/service/LoginService.java
+++ b/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/service/LoginService.java
@@ -26,12 +26,13 @@ public class LoginService {
private XxlJobUserDao xxlJobUserDao;
- private String makeToken(XxlJobUser xxlJobUser){
+ private String makeToken(XxlJobUser xxlJobUser) {
String tokenJson = JacksonUtil.writeValueAsString(xxlJobUser);
String tokenHex = new BigInteger(tokenJson.getBytes()).toString(16);
return tokenHex;
}
- private XxlJobUser parseToken(String tokenHex){
+
+ private XxlJobUser parseToken(String tokenHex) {
XxlJobUser xxlJobUser = null;
if (tokenHex != null) {
String tokenJson = new String(new BigInteger(tokenHex, 16).toByteArray()); // username_password(md5)
@@ -41,10 +42,10 @@ public class LoginService {
}
- public ReturnT login(HttpServletRequest request, HttpServletResponse response, String username, String password, boolean ifRemember){
+ public ReturnT login(HttpServletRequest request, HttpServletResponse response, String username, String password, boolean ifRemember) {
// param
- if (username==null || username.trim().length()==0 || password==null || password.trim().length()==0){
+ if (username == null || username.trim().length() == 0 || password == null || password.trim().length() == 0) {
return new ReturnT(500, I18nUtil.getString("login_param_empty"));
}
@@ -71,7 +72,7 @@ public class LoginService {
* @param request
* @param response
*/
- public ReturnT logout(HttpServletRequest request, HttpServletResponse response){
+ public ReturnT logout(HttpServletRequest request, HttpServletResponse response) {
CookieUtil.remove(request, response, LOGIN_IDENTITY_KEY);
return ReturnT.SUCCESS;
}
@@ -82,7 +83,7 @@ public class LoginService {
* @param request
* @return
*/
- public XxlJobUser ifLogin(HttpServletRequest request, HttpServletResponse response){
+ public XxlJobUser ifLogin(HttpServletRequest request, HttpServletResponse response) {
String cookieToken = CookieUtil.getValue(request, LOGIN_IDENTITY_KEY);
if (cookieToken != null) {
XxlJobUser cookieUser = null;
@@ -103,8 +104,5 @@ public class LoginService {
return null;
}
- public static void main(String[] args) {
- System.out.println("121312");
- }
}
diff --git a/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/service/XxlJobService.java b/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/service/XxlJobService.java
index 61da3a27..43c2eff6 100644
--- a/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/service/XxlJobService.java
+++ b/ruoyi-visual/ruoyi-xxl-job-admin/src/main/java/com/xxl/job/admin/service/XxlJobService.java
@@ -9,78 +9,79 @@ import java.util.Map;
/**
* core job action for xxl-job
- *
+ *
* @author xuxueli 2016-5-28 15:30:33
*/
public interface XxlJobService {
- /**
- * page list
- *
- * @param start
- * @param length
- * @param jobGroup
- * @param jobDesc
- * @param executorHandler
- * @param author
- * @return
- */
- public Map pageList(int start, int length, int jobGroup, int triggerStatus, String jobDesc, String executorHandler, String author);
+ /**
+ * page list
+ *
+ * @param start
+ * @param length
+ * @param jobGroup
+ * @param jobDesc
+ * @param executorHandler
+ * @param author
+ * @return
+ */
+ public Map pageList(int start, int length, int jobGroup, int triggerStatus, String jobDesc, String executorHandler, String author);
- /**
- * add job
- *
- * @param jobInfo
- * @return
- */
- public ReturnT add(XxlJobInfo jobInfo);
+ /**
+ * add job
+ *
+ * @param jobInfo
+ * @return
+ */
+ public ReturnT add(XxlJobInfo jobInfo);
- /**
- * update job
- *
- * @param jobInfo
- * @return
- */
- public ReturnT update(XxlJobInfo jobInfo);
+ /**
+ * update job
+ *
+ * @param jobInfo
+ * @return
+ */
+ public ReturnT update(XxlJobInfo jobInfo);
- /**
- * remove job
- * *
- * @param id
- * @return
- */
- public ReturnT remove(int id);
+ /**
+ * remove job
+ * *
+ *
+ * @param id
+ * @return
+ */
+ public ReturnT remove(int id);
- /**
- * start job
- *
- * @param id
- * @return
- */
- public ReturnT start(int id);
+ /**
+ * start job
+ *
+ * @param id
+ * @return
+ */
+ public ReturnT start(int id);
- /**
- * stop job
- *
- * @param id
- * @return
- */
- public ReturnT stop(int id);
+ /**
+ * stop job
+ *
+ * @param id
+ * @return
+ */
+ public ReturnT stop(int id);
- /**
- * dashboard info
- *
- * @return
- */
- public Map dashboardInfo();
+ /**
+ * dashboard info
+ *
+ * @return
+ */
+ public Map