| | |
| | | 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.entity.PreventRiskControlMeasure; |
| | | 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; |
| | |
| | | { |
| | | startPage(); |
| | | List<BaseCheckPoint> list = baseCheckPointService.selectBaseCheckPointList(baseCheckPoint); |
| | | return getDataTable(list); |
| | | List<BaseCheckPoint> resultList = new ArrayList<>(); |
| | | |
| | | //todo-2022 ,此处改造,查询措施相关信息 |
| | | for (BaseCheckPoint checkPoint : list) { |
| | | PreventRiskCheckUnit measureByCheckPointId = riskService.getRiskControlMeasureByCheckPointId(checkPoint.getCheckPointId()); |
| | | checkPoint.setControlMeasureId(measureByCheckPointId.getControlMeasureId()); |
| | | PreventRiskControlMeasure riskControlMeasureInfo = riskService.getRiskControlMeasureInfo(checkPoint.getCheckPointId()); |
| | | checkPoint.setControlMeasureId(riskControlMeasureInfo.getId()); |
| | | checkPoint.setControlMeasureCode(riskControlMeasureInfo.getControlMeasureCode()); |
| | | checkPoint.setClassify1(Integer.valueOf(riskControlMeasureInfo.getClassify1())); |
| | | checkPoint.setClassify2(Integer.valueOf(riskControlMeasureInfo.getClassify2())); |
| | | checkPoint.setClassify3(riskControlMeasureInfo.getClassify3()); |
| | | checkPoint.setMeasureDesc(riskControlMeasureInfo.getMeasureDesc()); |
| | | checkPoint.setRiskCheckContent(riskControlMeasureInfo.getCheckContent()); |
| | | resultList.add(checkPoint); |
| | | } |
| | | |
| | | return getDataTable(resultList); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Log(title = "基础清单检查点", businessType = BusinessType.INSERT) |
| | | @PostMapping("/add") |
| | | @ResponseBody |
| | | @Transactional |
| | | public AjaxResult addSave(BaseCheckPoint baseCheckPoint) |
| | | { |
| | | //老代码改造 |
| | | int result = baseCheckPointService.insertBaseCheckPoint(baseCheckPoint); |
| | | |
| | | //todo ,此处改造,嵌入管控措施 |
| | | //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.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 ,此处改造,嵌入管控措施 |
| | | PreventRiskControlMeasure riskControlMeasureInfo = riskService.getRiskControlMeasureInfo(baseCheckPoint.getCheckPointId()); |
| | | |
| | | baseCheckPoint.setControlMeasureId(riskControlMeasureInfo.getId()); |
| | | baseCheckPoint.setControlMeasureCode(riskControlMeasureInfo.getControlMeasureCode()); |
| | | baseCheckPoint.setClassify1(Integer.valueOf(riskControlMeasureInfo.getClassify1())); |
| | | baseCheckPoint.setClassify2(Integer.valueOf(riskControlMeasureInfo.getClassify2())); |
| | | baseCheckPoint.setClassify3(riskControlMeasureInfo.getClassify3()); |
| | | baseCheckPoint.setMeasureDesc(riskControlMeasureInfo.getMeasureDesc()); |
| | | baseCheckPoint.setRiskCheckContent(riskControlMeasureInfo.getCheckContent()); |
| | | |
| | | |
| | | 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); |
| | | } |
| | | } |