| | |
| | | import com.ruoyi.common.exception.job.TaskException; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.doublePrevention.entity.PreventReportConfig; |
| | | import com.ruoyi.doublePrevention.entity.PreventRiskJobAndMeasure; |
| | | import com.ruoyi.doublePrevention.enums.SyncEnum; |
| | | import com.ruoyi.doublePrevention.service.RiskService; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | |
| | | private IRegionService regionService; |
| | | @Autowired |
| | | private IDeptService deptService; |
| | | @Autowired |
| | | private RiskService riskService; |
| | | |
| | | @GetMapping() |
| | | public String hiddenDangerCheckJob() { |
| | |
| | | @ResponseBody |
| | | public AjaxResult remove(String ids) throws SchedulerException { |
| | | hiddenDangerCheckJobService.deleteJobByIds(ids); |
| | | |
| | | //todo-2022 删除job与措施的关联关系 |
| | | riskService.deleteJobAndMeasure(ids); |
| | | |
| | | return success(); |
| | | } |
| | | |
| | |
| | | |
| | | /** |
| | | * 新增保存调度 |
| | | * todo-2022 对应work |
| | | */ |
| | | @Log(title = "定时任务", businessType = BusinessType.INSERT) |
| | | @PostMapping("/add") |
| | |
| | | } |
| | | } |
| | | hiddenDangerCheckJobService.insertJob(hiddenDangerCheckJob); |
| | | |
| | | //todo- 2022 保存job与管控措施的对应关系 |
| | | hiddenDangerCheckJob.getJobId(); |
| | | int result = riskService.insertJobAndMeasure(hiddenDangerCheckJob.getJobId());{ |
| | | if (result < 0 ){ |
| | | throw new RuntimeException("保存job与管控措施的对应关系失败"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | hiddenDangerCheckJob.setRiskDeptName(d.getDeptName()); |
| | | } |
| | | } |
| | | |
| | | //todo- 2022 保存job与管控措施的对应关系 |
| | | //1、先查询基础清单是否有变更 |
| | | HiddenDangerCheckJob jobById = hiddenDangerCheckJobService.getJobById(hiddenDangerCheckJob.getJobId()); |
| | | if (!jobById.getRiskId().equals(hiddenDangerCheckJob.getRiskId())){ |
| | | // 2、若有变更,再次添加关联关系 |
| | | riskService.updateJobAndMeasure(hiddenDangerCheckJob); |
| | | } |
| | | |
| | | return toAjax(hiddenDangerCheckJobService.updateJob(hiddenDangerCheckJob)); |
| | | } |
| | | |