|
@@ -60,10 +60,13 @@ public class EstimatedValveServiceImpl implements EstimatedValveService, Initial
|
|
|
entity.setJobGroup("预计费推送阀控");
|
|
|
entity.setJobName("EstimatedValveJob"+siteId );
|
|
|
entity.setDescription("EstimatedValveJob"+customerId );
|
|
|
- // modify by pengdi ,判断定时任务是否存在,不存在才进行新增
|
|
|
|
|
|
boolean exists = jobAndTriggerService.isExists(entity);
|
|
|
- if(!exists) {
|
|
|
+ if(exists)
|
|
|
+ //先把之前Job删除
|
|
|
+ jobAndTriggerService.deleteJob(entity);
|
|
|
+
|
|
|
+ if(true) {
|
|
|
String time = "";
|
|
|
String minute = "";
|
|
|
String second = "";
|
|
@@ -74,12 +77,9 @@ public class EstimatedValveServiceImpl implements EstimatedValveService, Initial
|
|
|
String currTime = LocalDateTime.now().format(dfYmd) + " " + sendTime;;
|
|
|
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
LocalDateTime localDateTime = LocalDateTime.parse(currTime,df);
|
|
|
- localDateTime = localDateTime.plusMinutes(30);
|
|
|
+ localDateTime = localDateTime.plusMinutes(60);
|
|
|
String cron = String.format("%s %s %s * * ?",localDateTime.getSecond(),localDateTime.getMinute(),localDateTime.getHour());
|
|
|
- //String cron = "0 */2 * * * ?";
|
|
|
//String cron ="0 40 14 * * ?";
|
|
|
- //String cron = "0 "+Integer.valueOf(minute)+" "+Integer.valueOf(time)+" * * ?";
|
|
|
- //String cron = "0 22 15 * * ?";
|
|
|
log.info("预计费推送阀控:" + cron);
|
|
|
log.info("预计费推送阀控:" + "站点ID:"+siteId+"水司ID:"+customerId);
|
|
|
entity.setCronExpression(cron);
|