|
@@ -71,21 +71,24 @@ public class ResetLadderServiceImpl implements ResetLadderService,InitializingBe
|
|
|
entity.setJobGroup("阶梯可用量重置");
|
|
|
entity.setJobName("ResetLadderJob"+payBaseConfigDto.getCustomerId());
|
|
|
entity.setDescription("ResetLadderJob"+payBaseConfigDto.getCustomerId());
|
|
|
- Integer day = 1;
|
|
|
- if(value.length()>2){
|
|
|
- day = Integer.valueOf(value.substring(2));
|
|
|
+ boolean exists = jobAndTriggerService.isExists(entity);
|
|
|
+ if(!exists){
|
|
|
+ Integer day = 1;
|
|
|
+ if(value.length()>2){
|
|
|
+ day = Integer.valueOf(value.substring(2));
|
|
|
+ }
|
|
|
+ String cron = this.buildingCron();
|
|
|
+ //String cron = "0 */30 * 1-31 * ?";
|
|
|
+ log.info("阶梯可用量重置cron:"+cron);
|
|
|
+ entity.setCronExpression(cron);
|
|
|
+ entity.setJobClassName(ResetLadderJob.class.getName());
|
|
|
+ HashMap<String, Object> jobData = new HashMap<String, Object>();
|
|
|
+ jobData.put("siteId", payBaseConfigDto.getSiteId().intValue());
|
|
|
+ jobData.put("customerId", payBaseConfigDto.getCustomerId().intValue());
|
|
|
+ entity.setJobData(jobData);
|
|
|
+ entity.setStartDate(LocalDateTime.now());
|
|
|
+ jobAndTriggerService.addJob(entity);
|
|
|
}
|
|
|
- String cron = this.buildingCron();
|
|
|
- //String cron = "0 */30 * 1-31 * ?";
|
|
|
- log.info("阶梯可用量重置cron:"+cron);
|
|
|
- entity.setCronExpression(cron);
|
|
|
- entity.setJobClassName(ResetLadderJob.class.getName());
|
|
|
- HashMap<String, Object> jobData = new HashMap<String, Object>();
|
|
|
- jobData.put("siteId", payBaseConfigDto.getSiteId().intValue());
|
|
|
- jobData.put("customerId", payBaseConfigDto.getCustomerId().intValue());
|
|
|
- entity.setJobData(jobData);
|
|
|
- entity.setStartDate(LocalDateTime.now());
|
|
|
- jobAndTriggerService.addJob(entity);
|
|
|
}
|
|
|
|
|
|
/**
|