| | |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.security.ShiroUtils; |
| | | import com.ruoyi.doublePrevention.entity.PreventRiskCheckUnit; |
| | | import com.ruoyi.doublePrevention.repository.param.PreventPointAndMeasureParams; |
| | | import com.ruoyi.doublePrevention.service.RiskService; |
| | | import com.ruoyi.doublePrevention.service.baseService.PreventRiskDangerInfoService; |
| | | import com.ruoyi.project.enumerate.TrEvaluationMethodDetailsEnum; |
| | | import com.ruoyi.project.enumerate.TrEvaluationMethodTypeEnum; |
| | | import com.ruoyi.project.system.dept.domain.Dept; |
| | |
| | | @Log(title = "基础清单检查点", businessType = BusinessType.INSERT) |
| | | @PostMapping("/add") |
| | | @ResponseBody |
| | | @Transactional |
| | | public AjaxResult addSave(BaseCheckPoint baseCheckPoint) |
| | | { |
| | | //老代码改造 |
| | | int result = baseCheckPointService.insertBaseCheckPoint(baseCheckPoint); |
| | | |
| | | //todo ,此处改造,嵌入管控措施 |
| | | //todo-2022 ,此处改造,嵌入管控措施 |
| | | baseCheckPoint.getCheckPointId(); |
| | | PreventPointAndMeasureParams pointAndMeasureParams = new PreventPointAndMeasureParams(); |
| | | //封装参数 |
| | | pointAndMeasureParams.setBaseCheckPointId(baseCheckPoint.getCheckPointId()); |
| | | pointAndMeasureParams.setControlMeasureId(baseCheckPoint.getControlMeasureId());//todo,该参数页面尚未封装进去 |
| | | pointAndMeasureParams.setControlMeasureId(baseCheckPoint.getControlMeasureId());// todo,该参数页面尚未封装进去 |
| | | pointAndMeasureParams.setRiskId(baseCheckPoint.getRiskId()); |
| | | riskService.insertPointAndMeasure(pointAndMeasureParams); |
| | | int result1 = riskService.insertPointAndMeasure(pointAndMeasureParams); |
| | | if (result1 < 1){ |
| | | throw new RuntimeException("新增异常,保存管控措施关系失败"); |
| | | } |
| | | |
| | | return toAjax(result); |
| | | } |
| | |
| | | public String edit(@PathVariable("checkPointId") Long checkPointId, ModelMap mmap) |
| | | { |
| | | BaseCheckPoint baseCheckPoint = baseCheckPointService.selectBaseCheckPointById(checkPointId); |
| | | //todo-2022 返回参数加入措施id |
| | | PreventRiskCheckUnit riskCheckUnit = riskService.getRiskUnitByBaseCheckPointId(checkPointId); |
| | | |
| | | if (riskCheckUnit != null){ |
| | | baseCheckPoint.setControlMeasureId(riskCheckUnit.getControlMeasureId()); |
| | | } |
| | | mmap.put("baseCheckPoint", baseCheckPoint); |
| | | return prefix + "/edit"; |
| | | } |
| | |
| | | @Log(title = "基础清单检查点", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/edit") |
| | | @ResponseBody |
| | | @Transactional |
| | | public AjaxResult editSave(BaseCheckPoint baseCheckPoint) |
| | | { |
| | | return toAjax(baseCheckPointService.updateBaseCheckPoint(baseCheckPoint)); |
| | | int result = baseCheckPointService.updateBaseCheckPoint(baseCheckPoint); |
| | | |
| | | //todo-2022 ,此处改造,修改检查点与管控措施的关系----注,删除点,重加点 |
| | | // int result1 = riskService.updatePointAndMeasure(baseCheckPoint); |
| | | // if (result1 < 1){ |
| | | // throw new RuntimeException("保存管控措施关系失败"); |
| | | // } |
| | | |
| | | return toAjax(result); |
| | | } |
| | | |
| | | /** |
| | | * 删除基础清单检查点 |
| | | */ |
| | | @Transactional |
| | | @Log(title = "基础清单检查点", businessType = BusinessType.DELETE) |
| | | @PostMapping( "/remove") |
| | | @ResponseBody |
| | | public AjaxResult remove(String ids) |
| | | { |
| | | return toAjax(baseCheckPointService.deleteBaseCheckPointByIds(ids)); |
| | | //老代码 |
| | | int result = baseCheckPointService.deleteBaseCheckPointByIds(ids); |
| | | |
| | | //todo-2022 ,此处改造,删除检查点与管控措施的关系 |
| | | int result1 = riskService.deletePointAndMeasure(ids); |
| | | if (result1 < 1){ |
| | | throw new RuntimeException("新增异常,保存管控措施关系失败"); |
| | | } |
| | | |
| | | return toAjax(result); |
| | | } |
| | | } |