| | |
| | | import org.springframework.web.bind.annotation.RequestBody;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RestController;
|
| | | import com.ruoyi.common.constant.Constants;
|
| | | import com.ruoyi.common.exception.job.TaskException;
|
| | | import com.ruoyi.common.utils.SecurityUtils;
|
| | | import com.ruoyi.common.utils.StringUtils;
|
| | | import com.ruoyi.common.utils.job.CronUtils;
|
| | | import com.ruoyi.common.utils.poi.ExcelUtil;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
| | |
| | | {
|
| | | if (!CronUtils.isValid(sysJob.getCronExpression()))
|
| | | {
|
| | | return AjaxResult.error("cron表达式不正确");
|
| | | return AjaxResult.error("新增任务'" + sysJob.getJobName() + "'失败,Cron表达式不正确");
|
| | | }
|
| | | else if (StringUtils.containsIgnoreCase(sysJob.getInvokeTarget(), Constants.LOOKUP_RMI))
|
| | | {
|
| | | return AjaxResult.error("新增任务'" + sysJob.getJobName() + "'失败,目标字符串不允许'rmi://'调用");
|
| | | }
|
| | | sysJob.setCreateBy(SecurityUtils.getUsername());
|
| | | return toAjax(jobService.insertJob(sysJob));
|
| | |
| | | {
|
| | | if (!CronUtils.isValid(sysJob.getCronExpression()))
|
| | | {
|
| | | return AjaxResult.error("cron表达式不正确");
|
| | | return AjaxResult.error("修改任务'" + sysJob.getJobName() + "'失败,Cron表达式不正确");
|
| | | }
|
| | | else if (StringUtils.containsIgnoreCase(sysJob.getInvokeTarget(), Constants.LOOKUP_RMI))
|
| | | {
|
| | | return AjaxResult.error("修改任务'" + sysJob.getJobName() + "'失败,目标字符串不允许'rmi://'调用");
|
| | | }
|
| | | sysJob.setUpdateBy(SecurityUtils.getUsername());
|
| | | return toAjax(jobService.updateJob(sysJob));
|