Unverified Commit a23c0cda authored by lgcareer's avatar lgcareer Committed by GitHub
Browse files

Merge pull request #544 from lgcareer/dev-1.1.0

The start time must not be the same as the end
parents f449bd66 9dbf0265
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -163,6 +163,7 @@ public enum Status {
    BATCH_DELETE_PROCESS_INSTANCE_BY_IDS_ERROR(10117,"batch delete process instance by ids {0} error"),
    PREVIEW_SCHEDULE_ERROR(10139,"preview schedule error"),
    PARSE_TO_CRON_EXPRESSION_ERROR(10140,"parse cron to cron expression error"),
    SCHEDULE_START_TIME_END_TIME_SAME(10141,"The start time must not be the same as the end"),


    UDF_FUNCTION_NOT_EXIST(20001, "UDF function not found"),
+10 −0
Original line number Diff line number Diff line
@@ -119,6 +119,11 @@ public class SchedulerService extends BaseService {
        scheduleObj.setProcessDefinitionName(processDefinition.getName());

        ScheduleParam scheduleParam = JSONUtils.parseObject(schedule, ScheduleParam.class);
        if (DateUtils.differSec(scheduleParam.getStartTime(),scheduleParam.getEndTime()) == 0) {
            logger.warn("The start time must not be the same as the end");
            putMsg(result,Status.SCHEDULE_START_TIME_END_TIME_SAME);
            return result;
        }
        scheduleObj.setStartTime(scheduleParam.getStartTime());
        scheduleObj.setEndTime(scheduleParam.getEndTime());
        if (!org.quartz.CronExpression.isValidExpression(scheduleParam.getCrontab())) {
@@ -205,6 +210,11 @@ public class SchedulerService extends BaseService {
        // updateProcessInstance param
        if (StringUtils.isNotEmpty(scheduleExpression)) {
            ScheduleParam scheduleParam = JSONUtils.parseObject(scheduleExpression, ScheduleParam.class);
            if (DateUtils.differSec(scheduleParam.getStartTime(),scheduleParam.getEndTime()) == 0) {
                logger.warn("The start time must not be the same as the end");
                putMsg(result,Status.SCHEDULE_START_TIME_END_TIME_SAME);
                return result;
            }
            schedule.setStartTime(scheduleParam.getStartTime());
            schedule.setEndTime(scheduleParam.getEndTime());
            if (!org.quartz.CronExpression.isValidExpression(scheduleParam.getCrontab())) {