Merge pull request #2892 from dataease/pr@dev@feat_email_task_batchdel

fix(系统管理-定时报告): 定时报告增加批量删除api
This commit is contained in:
fit2cloud-chenyw 2022-08-22 16:15:21 +08:00 committed by GitHub
commit a59bdbbae8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -176,6 +176,23 @@ public class XEmailTaskServer {
}
}
@RequiresPermissions("task-email:del")
@PostMapping("/batchDel")
public void delete(@RequestBody List<Long> taskIds) {
EmailXpackService emailXpackService = SpringContextUtil.getBean(EmailXpackService.class);
try {
taskIds.forEach(taskId -> {
XpackEmailTaskRequest request = emailXpackService.taskForm(taskId);
GlobalTaskEntity globalTaskEntity = BeanUtils.copyBean(new GlobalTaskEntity(), request);
scheduleService.deleteSchedule(globalTaskEntity);
});
emailXpackService.batchDel(taskIds);
} catch (Exception e) {
LogUtil.error(e);
DEException.throwException(e);
}
}
@PostMapping("/stop/{taskId}")
public void stop(@PathVariable Long taskId) throws Exception {
EmailXpackService emailXpackService = SpringContextUtil.getBean(EmailXpackService.class);