| | |
| | | */ |
| | | @Transactional |
| | | public boolean updateWarning(FieldSetEntity fse) throws BaseException, SchedulerException, TaskException { |
| | | FieldSetEntity fseJob = new FieldSetEntity(); |
| | | fseJob.setTableName("product_sys_timed_task"); |
| | | fseJob.setValue("concurrent", 1); |
| | | fseJob.setValue("job_name", fse.getString("config_name")); |
| | | fseJob.setValue("cron_expression", fse.getString("execution_frequency")); |
| | | fseJob.setValue("invoke_target", "warnTask.triggerSingleWarningTask('" + fse.getUUID() + "')"); |
| | | fseJob.setValue("job_group", "system"); |
| | | fseJob.setValue("misfire_policy", 2); |
| | | fseJob.setValue("remark", ""); |
| | | if (fse.getInteger("config_status") == 0) { |
| | | fseJob.setValue("status", 0); |
| | | sysJobService.pauseJob(fse.getString("time_task_uuid")); |
| | | } else { |
| | | fseJob.setValue("status", 1); |
| | | sysJobService.resumeJob(fse.getString("time_task_uuid")); |
| | | if (fse.getString("type").equals("0")) { |
| | | FieldSetEntity fseJob = new FieldSetEntity(); |
| | | fseJob.setTableName("product_sys_timed_task"); |
| | | fseJob.setValue("concurrent", 1); |
| | | fseJob.setValue("job_name", fse.getString("config_name")); |
| | | fseJob.setValue("cron_expression", fse.getString("execution_frequency")); |
| | | fseJob.setValue("invoke_target", "warnTask.triggerSingleWarningTask('" + fse.getUUID() + "')"); |
| | | fseJob.setValue("job_group", "system"); |
| | | fseJob.setValue("misfire_policy", 2); |
| | | fseJob.setValue("remark", ""); |
| | | if (fse.getInteger("config_status") == 0) { |
| | | fseJob.setValue("status", 0); |
| | | sysJobService.pauseJob(fse.getString("time_task_uuid")); |
| | | } else { |
| | | fseJob.setValue("status", 1); |
| | | sysJobService.resumeJob(fse.getString("time_task_uuid")); |
| | | } |
| | | fseJob.setValue("is_conceal", 1); |
| | | fseJob.setValue("uuid", fse.getString("time_task_uuid")); |
| | | sysJobService.updateJob(fseJob); |
| | | } |
| | | fseJob.setValue("is_conceal", 1); |
| | | fseJob.setValue("uuid", fse.getString("time_task_uuid")); |
| | | sysJobService.updateJob(fseJob); |
| | | |
| | | fse.setValue(CmnConst.UPDATED_BY, SpringMVCContextHolder.getCurrentUser().getUser_id()); |
| | | fse.setValue(CmnConst.UPDATED_UTC_DATETIME, new Date()); |
| | | return baseDao.update(fse); |