liding
9 小时以前 13c70b027a3037ee4affd06ca7935cfe9554e298
src/main/java/com/ruoyi/inspectiontask/service/impl/TimingTaskScheduler.java
@@ -84,9 +84,13 @@
    /**
     * 删除任务
     */
    public void unscheduleTimingTask(Long taskId) throws SchedulerException {
        JobKey jobKey = new JobKey("timingTask_" + taskId);
        scheduler.deleteJob(jobKey);
    public void unscheduleTimingTask(Long taskId){
        try {
            JobKey jobKey = new JobKey("timingTask_" + taskId);
            scheduler.deleteJob(jobKey);
        }catch (SchedulerException e){
            throw new RuntimeException(e);
        }
    }
    private JobDetail buildJobDetail(TimingTask task) {
@@ -98,6 +102,9 @@
        jobDataMap.put("taskId", task.getId());           // 任务ID(Long,可序列化)
        jobDataMap.put("taskName", task.getTaskName());   // 任务名称(String,可序列化)
        jobDataMap.put("taskType", task.getFrequencyType()); // 任务类型(String)
        jobDataMap.put("takePhone", task.isTakePhone()); // 是否必须手机拍照
        jobDataMap.put("takeAlbum", task.isTakeAlbum()); // 是否可以上传相册
        jobDataMap.put("inspectionDeadline", task.getInspectionDeadline()); // 巡检期限
        // 按需添加其他必要的基本类型参数
        // 3. 构建JobDetail,设置持久化相关属性