wangli 4 年之前
父節點
當前提交
ce0b0100ea

+ 5 - 9
smart-city-platform/src/main/java/com/bz/smart_city/quartz/job/OpenAccountValveInspection.java

@@ -68,14 +68,10 @@ public class OpenAccountValveInspection  implements InitializingBean, Job, Seria
         entity.setJobName("OpenAccountValveInspectionSyncByJob" );
         entity.setDescription("OpenAccountValveInspectionSyncByJob" );
         // modify by pengdi ,判断定时任务是否存在,不存在才进行新增
-
-        boolean exists = jobAndTriggerService.isExists(entity);
-        if(!exists) {
-            String cron = "0 */2 * * * ?";
-            log.info("巡检开户开阀操作:" + cron);
-            entity.setCronExpression(cron);
-            entity.setJobClassName(OpenAccountValveInspection.class.getName());
-            jobAndTriggerService.save(entity);
-        }
+        String cron = "0 */2 * * * ?";
+        log.info("巡检开户开阀操作:" + cron);
+        entity.setCronExpression(cron);
+        entity.setJobClassName(OpenAccountValveInspection.class.getName());
+        jobAndTriggerService.save(entity);
     }
 }