|  |  |  | 
|---|
|  |  |  | * 新增任务 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public int insert(QuartzJob quartzJob) { | 
|---|
|  |  |  | if(quartzJobMapper.selectCount(new QueryWrapper<QuartzJob>().lambda() | 
|---|
|  |  |  | .eq(QuartzJob::getModule,quartzJob.getModule()) | 
|---|
|  |  |  | .eq(QuartzJob::getBeanName,quartzJob.getBeanName())) >0){ | 
|---|
|  |  |  | throw  new BusinessException(ResponseStatus.DATA_EXISTS); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | int flag = quartzJobMapper.insert(quartzJob) ; | 
|---|
|  |  |  | if (flag > 0){ | 
|---|
|  |  |  | quartzManage.createJob(quartzJob) ; | 
|---|
|  |  |  | 
|---|
|  |  |  | * 更新任务 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public int update(QuartzJob quartzJob) { | 
|---|
|  |  |  | if(quartzJobMapper.selectCount(new QueryWrapper<QuartzJob>().lambda() | 
|---|
|  |  |  | .eq(QuartzJob::getModule,quartzJob.getModule()) | 
|---|
|  |  |  | .ne(QuartzJob::getId,quartzJob.getId()) | 
|---|
|  |  |  | .eq(QuartzJob::getBeanName,quartzJob.getBeanName())) >0){ | 
|---|
|  |  |  | throw  new BusinessException(ResponseStatus.DATA_EXISTS); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | int flag = quartzJobMapper.updateById(quartzJob); | 
|---|
|  |  |  | if (flag > 0){ | 
|---|
|  |  |  | quartzManage.updateJob(quartzJob); | 
|---|