| | |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.security.ShiroUtils; |
| | | 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; |
| | |
| | | |
| | | @Autowired |
| | | private IUserService userService; |
| | | |
| | | @Autowired |
| | | private RiskService riskService; |
| | | |
| | | @GetMapping("{riskId}") |
| | | public String baseCheckPoint(@PathVariable("riskId")Long riskId,ModelMap modelMap) |
| | |
| | | @Log(title = "基础清单检查点", businessType = BusinessType.INSERT) |
| | | @PostMapping("/add") |
| | | @ResponseBody |
| | | @Transactional |
| | | public AjaxResult addSave(BaseCheckPoint baseCheckPoint) |
| | | { |
| | | return toAjax(baseCheckPointService.insertBaseCheckPoint(baseCheckPoint)); |
| | | //老代码改造 |
| | | int result = baseCheckPointService.insertBaseCheckPoint(baseCheckPoint); |
| | | |
| | | //todo-2022 ,此处改造,嵌入管控措施 |
| | | baseCheckPoint.getCheckPointId(); |
| | | |
| | | //使用baseCheckPointId进行查询 |
| | | // BaseCheckPoint baseCheckPointById = baseCheckPointService.getBaseCheckPointById(baseCheckPoint.getCheckPointId()); |
| | | |
| | | PreventPointAndMeasureParams pointAndMeasureParams = new PreventPointAndMeasureParams(); |
| | | //封装参数 |
| | | pointAndMeasureParams.setBaseCheckPointId(baseCheckPoint.getCheckPointId()); |
| | | pointAndMeasureParams.setControlMeasureId(baseCheckPoint.getControlMeasureId());// todo,该参数页面尚未封装进去 |
| | | pointAndMeasureParams.setRiskId(baseCheckPoint.getRiskId()); |
| | | |
| | | int result1 = riskService.insertPointAndMeasure(pointAndMeasureParams); |
| | | |
| | | if (result1 < 1){ |
| | | throw new RuntimeException("新增异常,保存管控措施关系失败"); |
| | | } |
| | | |
| | | return toAjax(result); |
| | | } |
| | | |
| | | /** |
| | |
| | | @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); |
| | | } |
| | | } |