src/main/java/com/ruoyi/doublePrevention/controller/PreventRiskEventController.java
@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.security.ShiroUtils; import com.ruoyi.doublePrevention.entity.PreventRiskEvent; import com.ruoyi.doublePrevention.entity.dto.req.*; import com.ruoyi.doublePrevention.entity.dto.resp.PreventRiskEventListQueryRespDTO; @@ -13,17 +15,36 @@ import com.ruoyi.doublePrevention.enums.ResultCodes; import com.ruoyi.doublePrevention.service.RiskService; import com.ruoyi.doublePrevention.vo.ResultVO; import com.ruoyi.framework.aspectj.lang.annotation.Log; import com.ruoyi.framework.aspectj.lang.enums.BusinessType; import com.ruoyi.framework.web.controller.BaseController; import com.ruoyi.framework.web.domain.AjaxResult; import com.ruoyi.framework.web.page.TableDataInfo; import com.ruoyi.project.system.user.domain.User; import com.ruoyi.project.tr.riskType.domain.RiskType; import com.ruoyi.project.tr.riskType.service.IRiskTypeService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.*; import java.util.List; import static com.ruoyi.common.utils.security.ShiroUtils.getSysUser; @RestController @RequestMapping("/riskEvent") public class PreventRiskEventController { @Controller @RequestMapping("/tr/test") public class PreventRiskEventController extends BaseController { private String prefix = ""; @GetMapping() public String riskEvent() { return prefix + "/riskEvent"; } @Autowired private RiskService riskService; @@ -75,4 +96,211 @@ public ResultVO<List<PreventRiskEventListQueryRespDTO>> listRiskEvent() { return riskService.listRiskEvent(); } @Autowired private IRiskTypeService riskTypeService; /** * 查询风险单元类型列表 */ @PostMapping("/list") @ResponseBody public TableDataInfo list(RiskType riskType) { //只查询属于该公司下的 riskType.setCompanyId(ShiroUtils.getSysUser().getCompanyId()); startPage(); List<RiskType> list = riskTypeService.selectRiskTypeList(riskType); return getDataTable(list); } /** * 导出风险单元类型列表 */ @Log(title = "风险单元类型", businessType = BusinessType.EXPORT) @PostMapping("/export") @ResponseBody public AjaxResult export(RiskType riskType) { List<RiskType> list = riskTypeService.selectRiskTypeList(riskType); ExcelUtil<RiskType> util = new ExcelUtil<RiskType>(RiskType.class); return util.exportExcel(list, "riskType"); } /** * 新增风险单元类型 */ @GetMapping("/add") public String add() { return prefix + "/add"; } /** * 新增保存风险单元类型 */ @Log(title = "风险单元类型", businessType = BusinessType.INSERT) @PostMapping("/add") @ResponseBody public AjaxResult addSave(RiskType riskType) { User user = ShiroUtils.getSysUser(); riskType.setCompanyId(user.getCompanyId()); riskType.setCreateBy(user.getUserName()); return toAjax(riskTypeService.insertRiskType(riskType)); } /** * 修改风险单元类型 */ @GetMapping("/edit/{riskTypeId}") public String edit(@PathVariable("riskTypeId") Long riskTypeId, ModelMap mmap) { RiskType riskType = riskTypeService.selectRiskTypeById(riskTypeId); mmap.put("riskType", riskType); return prefix + "/edit"; } /** * 修改保存风险单元类型 */ @Log(title = "风险单元类型", businessType = BusinessType.UPDATE) @PostMapping("/edit") @ResponseBody public AjaxResult editSave(RiskType riskType) { riskType.setUpdateBy(ShiroUtils.getSysUser().getUserName()); return toAjax(riskTypeService.updateRiskType(riskType)); } /** * 删除风险单元类型 */ @Log(title = "风险单元类型", businessType = BusinessType.DELETE) @PostMapping( "/remove") @ResponseBody public AjaxResult remove(String ids) { return toAjax(riskTypeService.deleteRiskTypeByIds(ids)); } /** * 跳转至设备设施类型 * @return */ @GetMapping("/riskTypeByDevice") public String riskTypeByDevice() { return prefix + "/riskTypeByDevice"; } /** * 新增风险单元类型 */ @GetMapping("/addByDevice") public String addByDevice() { return prefix + "/addByDevice"; } @GetMapping("/editByDevice/{riskTypeId}") public String editByDevice(@PathVariable("riskTypeId") Long riskTypeId, ModelMap mmap) { RiskType riskType = riskTypeService.selectRiskTypeById(riskTypeId); mmap.put("riskType", riskType); return prefix + "/editByDevice"; } /** * 跳转至作业活动类型 * @return */ @GetMapping("/riskTypeByWork") public String riskTypeByWork() { return prefix + "/riskTypeByWork"; } /** * 新增风险单元类型 */ @GetMapping("/addByWork") public String addByWork() { return prefix + "/addByWork"; } @GetMapping("/editByWork/{riskTypeId}") public String editByWork(@PathVariable("riskTypeId") Long riskTypeId, ModelMap mmap) { RiskType riskType = riskTypeService.selectRiskTypeById(riskTypeId); mmap.put("riskType", riskType); return prefix + "/editByWork"; } /** * 跳转至工艺节点类型 * @return */ @GetMapping("/riskTypeByCrafts") public String riskTypeByCrafts(){ return prefix + "/riskTypeByCrafts"; } /** * 新增风险单元类型 */ @GetMapping("/addByCrafts") public String addByCrafts() { return prefix + "/addByCrafts"; } @GetMapping("/editByCrafts/{riskTypeId}") public String editByCrafts(@PathVariable("riskTypeId") Long riskTypeId, ModelMap mmap) { RiskType riskType = riskTypeService.selectRiskTypeById(riskTypeId); mmap.put("riskType", riskType); return prefix + "/editByCrafts"; } /** * 跳转至作业频率类型 * @return */ @GetMapping("/riskTypeByFrequency") public String riskTypeByFrequency() { return prefix + "/riskTypeByFrequency"; } /** * 新增风险单元类型 */ @GetMapping("/addByFrequency") public String addByFrequency() { return prefix + "/addByFrequency"; } @GetMapping("/editByFrequency/{riskTypeId}") public String editByFrequency(@PathVariable("riskTypeId") Long riskTypeId, ModelMap mmap) { RiskType riskType = riskTypeService.selectRiskTypeById(riskTypeId); mmap.put("riskType", riskType); return prefix + "/editByFrequency"; } } src/main/java/com/ruoyi/doublePrevention/entity/dto/req/PreventRiskControlMeasureQueryReqDTO.java
@@ -2,7 +2,7 @@ public class PreventRiskControlMeasureQueryReqDTO { private Integer pageIndex; private Integer pageNum; private Integer pageSize; /** @@ -30,12 +30,12 @@ this.riskEventId = riskEventId; } public Integer getPageIndex() { return pageIndex; public Integer getPageNum() { return pageNum; } public void setPageIndex(Integer pageIndex) { this.pageIndex = pageIndex; public void setPageNum(Integer pageNum) { this.pageNum = pageNum; } public Integer getPageSize() { src/main/java/com/ruoyi/doublePrevention/entity/dto/req/PreventRiskEventPageQueryReqDTO.java
@@ -3,7 +3,7 @@ public class PreventRiskEventPageQueryReqDTO { private Integer pageIndex; private Integer pageNum; private Integer pageSize; /** @@ -15,12 +15,12 @@ */ private String riskEventName; public Integer getPageIndex() { return pageIndex; public Integer getPageNum() { return pageNum; } public void setPageIndex(Integer pageIndex) { this.pageIndex = pageIndex; public void setPageNum(Integer pageNum) { this.pageNum = pageNum; } public Integer getPageSize() { @@ -46,4 +46,14 @@ public void setRiskEventName(String riskEventName) { this.riskEventName = riskEventName; } @Override public String toString() { return "PreventRiskEventPageQueryReqDTO{" + "pageNum=" + pageNum + ", pageSize=" + pageSize + ", riskUnitId=" + riskUnitId + ", riskEventName='" + riskEventName + '\'' + '}'; } } src/main/java/com/ruoyi/doublePrevention/entity/dto/req/PreventRiskEventUpdateReqDTO.java
@@ -49,4 +49,5 @@ public void setRiskEventName(String riskEventName) { this.riskEventName = riskEventName; } } src/main/java/com/ruoyi/doublePrevention/service/baseService/impl/PreventRiskControlMeasureServiceImpl.java
@@ -18,7 +18,6 @@ @Autowired private PreventRiskControlMeasureRepository preventRiskControlMeasureRepository; /** * @description 新增风险控制措施 */ src/main/java/com/ruoyi/doublePrevention/service/impl/RiskServiceImpl.java
@@ -281,11 +281,11 @@ resultVO.setMsg("安全风险分析单元名称不能为空"); return resultVO; } PreventRiskUnitUuid riskUnit = preventRiskUnitUuidService.getRiskUnitUuidById(riskUnitId); if (riskUnit == null){ resultVO.setMsg("安全风险分析单元名称不存在"); return resultVO; } // PreventRiskUnitUuid riskUnit = preventRiskUnitUuidService.getRiskUnitUuidById(riskUnitId); // if (riskUnit == null){ // resultVO.setMsg("安全风险分析单元名称不存在"); // return resultVO; // } if (StringUtils.isEmpty(riskEventName)){ resultVO.setMsg("安全风险事件名称不能为空"); return resultVO; @@ -369,7 +369,7 @@ */ @Override public ResultVO<List<PreventRiskEventPageQueryRespDTO>> listRiskEventPage(PreventRiskEventPageQueryReqDTO riskEventQueryReqDTO) { Integer pageIndex = riskEventQueryReqDTO.getPageIndex(); Integer pageIndex = riskEventQueryReqDTO.getPageNum(); Integer pageSize = riskEventQueryReqDTO.getPageSize(); if (pageIndex == 0 || pageSize == 0){ return new ResultVO<>(ErrorCodes.REQUEST_PARAM_ERROR.getCode(),"当前页码或当前页显示数不能为0"); @@ -690,7 +690,7 @@ */ @Override public ResultVO<List<PreventRiskControlMeasurePageQueryRespDTO>> getRiskControlMeasurePage(PreventRiskControlMeasureQueryReqDTO measureQueryReqDTO) { Integer pageIndex = measureQueryReqDTO.getPageIndex(); Integer pageIndex = measureQueryReqDTO.getPageNum(); Integer pageSize = measureQueryReqDTO.getPageSize(); if (pageIndex == 0 || pageSize == 0){ return new ResultVO<>(ErrorCodes.REQUEST_PARAM_ERROR.getCode(),"当前页码或当前页显示数不能为0"); src/main/java/com/ruoyi/project/tr/baseCheckPoint/controller/BaseCheckPointController.java
@@ -9,10 +9,12 @@ import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.security.ShiroUtils; import com.ruoyi.doublePrevention.entity.PreventRiskCheckUnit; import com.ruoyi.doublePrevention.entity.dto.resp.PreventRiskControlMeasureListQueryRespDTO; 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.doublePrevention.vo.ResultVO; import com.ruoyi.project.enumerate.TrEvaluationMethodDetailsEnum; import com.ruoyi.project.enumerate.TrEvaluationMethodTypeEnum; import com.ruoyi.project.system.dept.domain.Dept; @@ -164,8 +166,10 @@ * 新增基础清单检查点 */ @GetMapping("/add/{riskId}") public String add(@PathVariable("riskId")Long riskId ,ModelMap modelMap) public String add(@PathVariable("riskId")Long riskId ,ModelMap modelMap, ModelMap mmap) { ResultVO<List<PreventRiskControlMeasureListQueryRespDTO>> resultVO = riskService.listRiskControlMeasure(); mmap.put("measureList",resultVO.getData()); modelMap.put("riksId",riskId); return prefix + "/add"; } @@ -209,6 +213,8 @@ @GetMapping("/edit/{checkPointId}") public String edit(@PathVariable("checkPointId") Long checkPointId, ModelMap mmap) { ResultVO<List<PreventRiskControlMeasureListQueryRespDTO>> resultVO = riskService.listRiskControlMeasure(); mmap.put("measureList",resultVO.getData()); BaseCheckPoint baseCheckPoint = baseCheckPointService.selectBaseCheckPointById(checkPointId); //todo-2022 ,此处改造,嵌入管控措施 src/main/java/com/ruoyi/project/tr/hiddenDangerCheck/controller/DangerReportController.java
@@ -6,6 +6,7 @@ import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.security.ShiroUtils; import com.ruoyi.doublePrevention.entity.PreventRiskDangerInfo; import com.ruoyi.doublePrevention.entity.dto.resp.PreventRiskUnitCodeAndNameListQueryRespDTO; import com.ruoyi.doublePrevention.service.RiskService; import com.ruoyi.framework.aspectj.lang.annotation.Log; import com.ruoyi.framework.aspectj.lang.enums.BusinessType; @@ -93,7 +94,6 @@ hiddenDangerCheckPoint.setJudgeQueryByUserIdList(userIdList);//隐患整改人ID 为登陆账号companyId下的userId的 startPage(); List<HiddenDangerCheckPoint> list = hiddenDangerCheckPointService.selectHiddenDangerCheckPointList(hiddenDangerCheckPoint); return getDataTable(list); } @@ -147,7 +147,8 @@ hiddenTroubleType.setCompanyId(sysUser.getCompanyId()); List<HiddenTroubleType> hiddenTroubleTypeList = hiddenTroubleTypeService.selectHiddenTroubleTypeList(hiddenTroubleType); mmap.put("hiddenTroubleTypeList", hiddenTroubleTypeList); List<PreventRiskUnitCodeAndNameListQueryRespDTO> respDTOS = riskService.listRiskUnitCodeAndName(); mmap.put("riskUnits", respDTOS); return prefix + "/addDangerReport"; } src/main/java/com/ruoyi/project/tr/riskEvent/controller/RiskEventController.java
对比新文件 @@ -0,0 +1,292 @@ package com.ruoyi.project.tr.riskEvent.controller; import java.util.List; import java.util.Random; import java.util.UUID; import com.ruoyi.common.utils.security.ShiroUtils; import com.ruoyi.doublePrevention.entity.PreventRiskEvent; import com.ruoyi.doublePrevention.entity.dto.req.*; import com.ruoyi.doublePrevention.entity.dto.resp.PreventRiskEventPageQueryRespDTO; import com.ruoyi.doublePrevention.entity.dto.resp.PreventRiskEventRespDTO; import com.ruoyi.doublePrevention.entity.dto.resp.PreventRiskUnitCodeAndNameListQueryRespDTO; import com.ruoyi.doublePrevention.service.RiskService; import com.ruoyi.doublePrevention.vo.ResultVO; import com.ruoyi.framework.web.page.PageDomain; import com.ruoyi.framework.web.page.TableSupport; import com.ruoyi.project.system.user.domain.User; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.*; import com.ruoyi.framework.aspectj.lang.annotation.Log; import com.ruoyi.framework.aspectj.lang.enums.BusinessType; import com.ruoyi.project.tr.riskType.domain.RiskType; import com.ruoyi.project.tr.riskType.service.IRiskTypeService; import com.ruoyi.framework.web.controller.BaseController; import com.ruoyi.framework.web.domain.AjaxResult; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.framework.web.page.TableDataInfo; /** * 风险单元类型Controller * * @author wm * @date 2020-05-05 */ @Controller @RequestMapping("/tr/riskEvent") public class RiskEventController extends BaseController { private String prefix = "tr/riskEvent"; @Autowired private IRiskTypeService riskTypeService; @Autowired private RiskService riskService; @GetMapping() public String riskEvent(ModelMap mmap) { List<PreventRiskUnitCodeAndNameListQueryRespDTO> respDTOS = riskService.listRiskUnitCodeAndName(); mmap.put("riskUnits", respDTOS); return prefix + "/riskEvent"; } /** * 查询安全风险事件 */ @PostMapping("/list") @ResponseBody public TableDataInfo list(PreventRiskEventPageQueryReqDTO riskEventQueryReqDTO) { ResultVO<List<PreventRiskEventPageQueryRespDTO>> resultVO = riskService.listRiskEventPage(riskEventQueryReqDTO); List<PreventRiskEventPageQueryRespDTO> data = (List<PreventRiskEventPageQueryRespDTO>) resultVO.getData(); //只查询属于该公司下的 // riskType.setCompanyId(ShiroUtils.getSysUser().getCompanyId()); // startPage(); // List<RiskType> list = riskTypeService.selectRiskTypeList(riskType); // return getDataTable(list); TableDataInfo dataTable = getDataTable(data); dataTable.setTotal(resultVO.getCount()); return dataTable; } /** * 导出风险单元类型列表 */ @Log(title = "风险单元类型", businessType = BusinessType.EXPORT) @PostMapping("/export") @ResponseBody public AjaxResult export(RiskType riskType) { List<RiskType> list = riskTypeService.selectRiskTypeList(riskType); ExcelUtil<RiskType> util = new ExcelUtil<RiskType>(RiskType.class); return util.exportExcel(list, "riskType"); } /** * 新增风险单元类型 */ @GetMapping("/add") public String add(ModelMap mmap) { List<PreventRiskUnitCodeAndNameListQueryRespDTO> respDTOS = riskService.listRiskUnitCodeAndName(); mmap.put("riskUnits", respDTOS); return prefix + "/add"; } /** * 新增保存风险单元类型 */ @Log(title = "风险单元类型", businessType = BusinessType.INSERT) @PostMapping("/add") @ResponseBody public AjaxResult addSave(PreventRiskEventSaveReqDTO riskEventSaveReqDTO) { ResultVO<PreventRiskEvent> resultVO = riskService.saveRiskEvent(riskEventSaveReqDTO); String code = resultVO.getCode(); if ("200".equals(code)){ return toAjax(1); }else { return toAjax(0); } // User user = ShiroUtils.getSysUser(); // riskType.setCompanyId(user.getCompanyId()); // riskType.setCreateBy(user.getUserName()); // return toAjax(riskTypeService.insertRiskType(riskType)); } /** * 修改风险单元类型 */ @GetMapping("/edit/{id}") public String edit(@PathVariable("id") Long id, ModelMap mmap) { PreventRiskEventGetReqDTO riskEventGetReqDTO = new PreventRiskEventGetReqDTO(); riskEventGetReqDTO.setId(id); ResultVO<PreventRiskEventRespDTO> riskEventById = riskService.getRiskEventById(riskEventGetReqDTO); Object data = riskEventById.getData(); // RiskType riskType = riskTypeService.selectRiskTypeById(id); mmap.put("riskType", data); // System.out.println(prefix + "/edit"); List<PreventRiskUnitCodeAndNameListQueryRespDTO> respDTOS = riskService.listRiskUnitCodeAndName(); mmap.put("riskUnits", respDTOS); return prefix + "/edit"; } /** * 修改保存风险单元类型 */ @Log(title = "风险单元类型", businessType = BusinessType.UPDATE) @PostMapping("/edit") @ResponseBody public AjaxResult editSave(PreventRiskEventUpdateReqDTO riskEventUpdateReqDTO) { System.out.println(riskEventUpdateReqDTO); ResultVO<PreventRiskEvent> resultVO = riskService.updateRiskEvent(riskEventUpdateReqDTO); String code = resultVO.getCode(); if ("200".equals(code)){ return toAjax(1); }else { return toAjax(0); } // riskType.setUpdateBy(ShiroUtils.getSysUser().getUserName()); // return toAjax(riskTypeService.updateRiskType(riskType)); } /** * 删除风险单元类型 */ @Log(title = "风险单元类型", businessType = BusinessType.DELETE) @PostMapping( "/remove") @ResponseBody public AjaxResult remove(Long ids) { PreventRiskEventDeleteReqDTO riskEventDeleteReqDTO = new PreventRiskEventDeleteReqDTO(); riskEventDeleteReqDTO.setId(ids); ResultVO<PreventRiskEvent> resultVO = riskService.deleteRiskEvent(riskEventDeleteReqDTO); String code = resultVO.getCode(); if ("200".equals(code)){ return toAjax(1); }else { return toAjax(0); } } /** * 跳转至设备设施类型 * @return */ @GetMapping("/riskTypeByDevice") public String riskTypeByDevice() { return prefix + "/riskTypeByDevice"; } /** * 新增风险单元类型 */ @GetMapping("/addByDevice") public String addByDevice() { return prefix + "/addByDevice"; } @GetMapping("/editByDevice/{riskTypeId}") public String editByDevice(@PathVariable("riskTypeId") Long riskTypeId, ModelMap mmap) { RiskType riskType = riskTypeService.selectRiskTypeById(riskTypeId); mmap.put("riskType", riskType); return prefix + "/editByDevice"; } /** * 跳转至作业活动类型 * @return */ @GetMapping("/riskTypeByWork") public String riskTypeByWork() { return prefix + "/riskTypeByWork"; } /** * 新增风险单元类型 */ @GetMapping("/addByWork") public String addByWork() { return prefix + "/addByWork"; } @GetMapping("/editByWork/{riskTypeId}") public String editByWork(@PathVariable("riskTypeId") Long riskTypeId, ModelMap mmap) { RiskType riskType = riskTypeService.selectRiskTypeById(riskTypeId); mmap.put("riskType", riskType); return prefix + "/editByWork"; } /** * 跳转至工艺节点类型 * @return */ @GetMapping("/riskTypeByCrafts") public String riskTypeByCrafts(){ return prefix + "/riskTypeByCrafts"; } /** * 新增风险单元类型 */ @GetMapping("/addByCrafts") public String addByCrafts() { return prefix + "/addByCrafts"; } @GetMapping("/editByCrafts/{riskTypeId}") public String editByCrafts(@PathVariable("riskTypeId") Long riskTypeId, ModelMap mmap) { RiskType riskType = riskTypeService.selectRiskTypeById(riskTypeId); mmap.put("riskType", riskType); return prefix + "/editByCrafts"; } /** * 跳转至作业频率类型 * @return */ @GetMapping("/riskTypeByFrequency") public String riskTypeByFrequency() { return prefix + "/riskTypeByFrequency"; } /** * 新增风险单元类型 */ @GetMapping("/addByFrequency") public String addByFrequency() { return prefix + "/addByFrequency"; } @GetMapping("/editByFrequency/{riskTypeId}") public String editByFrequency(@PathVariable("riskTypeId") Long riskTypeId, ModelMap mmap) { RiskType riskType = riskTypeService.selectRiskTypeById(riskTypeId); mmap.put("riskType", riskType); return prefix + "/editByFrequency"; } } src/main/java/com/ruoyi/project/tr/riskList/controller/RiskListController.java
@@ -6,6 +6,7 @@ import com.ruoyi.common.utils.security.ShiroUtils; import com.ruoyi.doublePrevention.entity.PreventRiskControlMeasure; import com.ruoyi.doublePrevention.entity.dto.resp.PreventRiskCheckUnitRespDTO; import com.ruoyi.doublePrevention.entity.dto.resp.PreventRiskUnitCodeAndNameListQueryRespDTO; import com.ruoyi.doublePrevention.service.RiskService; import com.ruoyi.framework.aspectj.lang.annotation.Log; import com.ruoyi.framework.aspectj.lang.enums.BusinessType; @@ -48,6 +49,8 @@ @RequestMapping("/tr/riskList") public class RiskListController extends BaseController { private String prefix = "tr/riskList"; @Autowired private IRiskListService riskListService; @@ -222,7 +225,7 @@ mmap.put("riskList", riskList); //查询风险清单类型 List<RiskType> riskTypes = getRiskTypes(riskList.getRiskType()); mmap.put("riskTypes", riskTypes); mmap.put(" ", riskTypes); //判断如果是作业活动,查询作业活动频率 if (riskList.getRiskType() == 2) { List riskTypes1 = getRiskTypes(4); src/main/java/com/ruoyi/project/tr/riskMeasure/controller/riskMeasureController.java
对比新文件 @@ -0,0 +1,143 @@ package com.ruoyi.project.tr.riskMeasure.controller; import com.ruoyi.doublePrevention.entity.PreventRiskControlMeasure; import com.ruoyi.doublePrevention.entity.PreventRiskEvent; import com.ruoyi.doublePrevention.entity.dto.req.*; import com.ruoyi.doublePrevention.entity.dto.resp.*; import com.ruoyi.doublePrevention.service.RiskService; import com.ruoyi.doublePrevention.vo.ResultVO; import com.ruoyi.framework.aspectj.lang.annotation.Log; import com.ruoyi.framework.aspectj.lang.enums.BusinessType; import com.ruoyi.framework.web.controller.BaseController; import com.ruoyi.framework.web.domain.AjaxResult; import com.ruoyi.framework.web.page.TableDataInfo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.*; import java.util.List; @Controller @RequestMapping("/tr/riskMeasure") public class riskMeasureController extends BaseController { private String prefix = "tr/riskMeasure"; @Autowired private RiskService riskService; @GetMapping() public String riskEvent(ModelMap mmap) { ResultVO<List<PreventRiskEventListQueryRespDTO>> resultVO = riskService.listRiskEvent(); Object data = resultVO.getData(); mmap.put("riskEvents", data); return prefix + "/riskMeasure"; } /** * 风险管控措施分页查询 */ @PostMapping("/list") @ResponseBody public TableDataInfo list(PreventRiskControlMeasureQueryReqDTO measureQueryReqDTO) { ResultVO<List<PreventRiskControlMeasurePageQueryRespDTO>> resultVO = riskService.getRiskControlMeasurePage(measureQueryReqDTO); List<PreventRiskControlMeasureQueryReqDTO> data = (List<PreventRiskControlMeasureQueryReqDTO>) resultVO.getData(); //只查询属于该公司下的 // riskType.setCompanyId(ShiroUtils.getSysUser().getCompanyId()); // startPage(); // List<RiskType> list = riskTypeService.selectRiskTypeList(riskType); // return getDataTable(list); TableDataInfo dataTable = getDataTable(data); dataTable.setTotal(resultVO.getCount()); return dataTable; } /** * 新增风险管控措施 */ @GetMapping("/add") public String add(ModelMap mmap) { ResultVO<List<PreventRiskEventListQueryRespDTO>> resultVO = riskService.listRiskEvent(); Object data = resultVO.getData(); mmap.put("riskEvents", data); return prefix + "/add"; } /** * 新增保存安全风险事件 */ @Log(title = "风险单元类型", businessType = BusinessType.INSERT) @PostMapping("/add") @ResponseBody public AjaxResult addSave(PreventRiskControlMeasureSaveReqDTO measureSaveReqDTO) { ResultVO<PreventRiskControlMeasure> resultVO = riskService.saveRiskControlMeasure(measureSaveReqDTO); String code = resultVO.getCode(); if ("200".equals(code)){ return toAjax(1); }else { return toAjax(0); } } /** * 修改风险管控措施 */ @GetMapping("/edit/{id}") public String edit(@PathVariable("id") Long id, ModelMap mmap) { PreventRiskControlMeasureGetReqDTO riskControlMeasureGetReqDTO = new PreventRiskControlMeasureGetReqDTO(); riskControlMeasureGetReqDTO.setId(id); ResultVO<PreventRiskControlMeasureRespDTO> riskControlMeasure = riskService.getRiskControlMeasure(riskControlMeasureGetReqDTO); Object measureData = riskControlMeasure.getData(); mmap.put("measureData",measureData); ResultVO<List<PreventRiskEventListQueryRespDTO>> resultVO = riskService.listRiskEvent(); Object data = resultVO.getData(); mmap.put("riskEvents", data); return prefix + "/edit"; } /** * 修改保存风险单元类型 */ @Log(title = "风险单元类型", businessType = BusinessType.UPDATE) @PostMapping("/edit") @ResponseBody public AjaxResult editSave(PreventRiskControlMeasureUpdateReqDTO measureUpdateReqDTO) { ResultVO<PreventRiskControlMeasure> resultVO = riskService.updateRiskControlMeasure(measureUpdateReqDTO); String code = resultVO.getCode(); if ("200".equals(code)){ return toAjax(1); }else { return toAjax(0); } } /** * 删除风险管控措施 */ @Log(title = "风险管控措施", businessType = BusinessType.DELETE) @PostMapping( "/remove") @ResponseBody public AjaxResult remove(Long ids) { PreventRiskControlMeasureDeleteReqDTO measureDeleteReqDTO = new PreventRiskControlMeasureDeleteReqDTO(); measureDeleteReqDTO.setId(ids); ResultVO<PreventRiskControlMeasure> resultVO = riskService.deleteRiskControlMeasure(measureDeleteReqDTO); String code = resultVO.getCode(); if ("200".equals(code)){ return toAjax(1); }else { return toAjax(0); } } } src/main/java/com/ruoyi/project/tr/riskType/controller/RiskTypeController.java
@@ -42,6 +42,7 @@ @GetMapping() public String riskType() { return prefix + "/riskType"; } src/main/resources/templates/tr/baseCheckPoint/add.html
@@ -30,7 +30,16 @@ <textarea id="checkResult" name="checkResult" class="form-control"></textarea> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">风险管控措施:</label> <div class="col-sm-8"> <select name="controlMeasureId" class="form-control m-b"> <option value="">--请选择风险管控措施--</option> <option th:each="u :${measureList}" th:value="${u.id}" th:text="${u.checkContent}"></option> </select> <!-- <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>--> </div> </div> <!--<div class="form-group"> <label class="col-sm-3 control-label">备注:</label> <div class="col-sm-8"> src/main/resources/templates/tr/baseCheckPoint/edit.html
@@ -32,8 +32,15 @@ </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">风险管控措施:</label> <div class="col-sm-8"> <select name="controlMeasureId" th:field="*{controlMeasureId}" class="form-control m-b"> <option value="">--请选择风险管控措施--</option> <option th:each="u :${measureList}" th:value="${u.id}" th:text="${u.checkContent}"></option> </select> </div> </div> </form> </div> <th:block th:include="include :: footer" /> src/main/resources/templates/tr/hiddenDangerCheck/dangerReport/addDangerReport.html
@@ -110,6 +110,48 @@ </div> </div> <div class="form-group"> <label class="col-sm-3 control-label is-required">风险对象分析编码:</label> <div class="col-sm-8"> <textarea name="hazardCode" maxlength="500" class="form-control" rows="3" required></textarea> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label is-required">隐患来源:</label> <div class="col-sm-8"> <select name="dangerSrc" class="form-control m-b" th:with="type=${@dict.getType('danger_source')}" required> <option value="">--请选择隐患来源--</option> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> </select> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label is-required">隐患类型:</label> <div class="col-sm-8"> <select name="hazardDangerType" class="form-control m-b" th:with="type=${@dict.getType('danger_type')}" required> <option value="">--请选择隐患类型--</option> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> </select> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label is-required">隐患造成后果:</label> <div class="col-sm-8"> <select name="dangerResult" class="form-control m-b" th:with="type=${@dict.getType('danger_result')}" required> <option value="">--请选择隐患造成后果--</option> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> </select> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label is-required">隐患原因:</label> <div class="col-sm-8"> <textarea name="dangerReason" maxlength="500" class="form-control" rows="3" required></textarea> </div> </div> </form> </div> <th:block th:include="include :: footer"/> src/main/resources/templates/tr/hiddenDangerCheck/dangerReport/editDangerReport.html
@@ -106,11 +106,62 @@ <input id="judgeUserId" name="judgeUserId" th:field="*{judgeUserId}" type="hidden" > </div> </div> <!-- <div class="form-group">--> <!-- <label class="col-sm-3 control-label is-required">安全风险分析单元名称:</label>--> <!-- <div class="col-sm-8">--> <!-- <select name="riskUnitId" th:field="*{riskUnitId}" class="form-control m-b" required>--> <!-- <option value="">--请选择安全风险分析单元--</option>--> <!-- <option th:each="u :${riskUnits}" th:value="${u.riskListId}" th:text="${u.riskListName}"></option>--> <!-- </select>--> <!-- </div>--> <!-- </div>--> <div class="form-group"> <label class="col-sm-3 control-label is-required">风险对象分析编码:</label> <div class="col-sm-8"> <textarea name="hazardCode" th:field="*{hazardCode}" maxlength="500" class="form-control" rows="3" required></textarea> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label is-required">隐患来源:</label> <div class="col-sm-8"> <select name="dangerSrc" th:field="*{dangerSrc}" class="form-control m-b" th:with="type=${@dict.getType('danger_source')}" required> <option value="">--请选择隐患来源--</option> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> </select> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label is-required">隐患类型:</label> <div class="col-sm-8"> <select name="hazardDangerType" th:field="*{hazardDangerType}" class="form-control m-b" th:with="type=${@dict.getType('danger_type')}" required> <option value="">--请选择隐患类型--</option> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> </select> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label is-required">隐患造成后果:</label> <div class="col-sm-8"> <select name="dangerResult" th:field="*{dangerResult}" class="form-control m-b" th:with="type=${@dict.getType('danger_result')}" required> <option value="">--请选择隐患造成后果--</option> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> </select> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label is-required">隐患原因:</label> <div class="col-sm-8"> <textarea name="dangerReason" th:field="*{dangerReason}" maxlength="500" class="form-control" rows="3" required></textarea> </div> </div> </form> </div> <th:block th:include="include :: footer"/> <th:block th:include="include :: datetimepicker-js"/> <script type="text/javascript"> <script th:inline="javascript"> src/main/resources/templates/tr/riskEvent/add.html
对比新文件 @@ -0,0 +1,47 @@ <!DOCTYPE html> <html lang="zh" xmlns:th="http://www.thymeleaf.org" > <head> <th:block th:include="include :: header('新增风险单元类型')" /> </head> <body class="white-bg"> <div class="wrapper wrapper-content animated fadeInRight ibox-content"> <form class="form-horizontal m" id="form-riskEvent-add"> <div class="form-group"> <label class="col-sm-3 control-label">安全风险分析单元名称:</label> <div class="col-sm-8"> <select name="riskUnitId" class="form-control m-b"> <option value="">--请选择安全风险分析单元--</option> <option th:each="u :${riskUnits}" th:value="${u.riskListId}" th:text="${u.riskListName}"></option> </select> <!-- <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>--> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">安全风险事件名称:</label> <div class="col-sm-8"> <input name="riskEventName" class="form-control" type="text"> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">可能造成后果:</label> <div class="col-sm-8"> <input name="eventResult" class="form-control" type="text"> </div> </div> </form> </div> <th:block th:include="include :: footer" /> <script type="text/javascript"> var prefix = ctx + "tr/riskEvent"; $("#form-riskEvent-add").validate({ focusCleanup: true }); function submitHandler() { if ($.validate.form()) { $.operate.save(prefix + "/add", $('#form-riskEvent-add').serialize()); } } </script> </body> </html> src/main/resources/templates/tr/riskEvent/edit.html
对比新文件 @@ -0,0 +1,57 @@ <!DOCTYPE html> <html lang="zh" xmlns:th="http://www.thymeleaf.org" > <head> <th:block th:include="include :: header('修改安全风险事件')" /> </head> <body class="white-bg"> <div class="wrapper wrapper-content animated fadeInRight ibox-content"> <form class="form-horizontal m" id="form-riskEvent-edit" th:object="${riskType}"> <input name="id" th:field="*{id}" type="hidden"> <!-- <div class="form-group">--> <!-- <label class="col-sm-3 control-label">所属公司:</label>--> <!-- <div class="col-sm-8">--> <!-- <select name="companyId" class="form-control m-b">--> <!-- <option value="">所有</option>--> <!-- </select>--> <!-- <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>--> <!-- </div>--> <!-- </div>--> <div class="form-group"> <label class="col-sm-3 control-label">安全风险分析单元名称:</label> <div class="col-sm-8"> <select name="riskUnitId" th:field="*{riskUnitId}" class="form-control m-b"> <option value="">--请选择安全风险分析单元--</option> <option th:each="u :${riskUnits}" th:value="${u.riskListId}" th:text="${u.riskListName}"></option> </select> <!-- <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>--> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">安全风险事件名称:</label> <div class="col-sm-8"> <input name="riskEventName" th:field="*{riskEventName}" class="form-control" type="text"> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">可能造成后果:</label> <div class="col-sm-8"> <input name="eventResult" th:field="*{eventResult}" class="form-control" type="text"> </div> </div> </form> </div> <th:block th:include="include :: footer" /> <script type="text/javascript"> var prefix = ctx + "tr/riskEvent"; $("#form-riskEvent-edit").validate({ focusCleanup: true }); function submitHandler() { if ($.validate.form()) { $.operate.save(prefix + "/edit", $('#form-riskEvent-edit').serialize()); } } </script> </body> </html> src/main/resources/templates/tr/riskEvent/riskEvent.html
对比新文件 @@ -0,0 +1,124 @@ <!DOCTYPE html> <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> <head> <th:block th:include="include :: header('风险单元类型列表')" /> </head> <body class="gray-bg"> <div class="container-div"> <div class="row"> <div class="col-sm-12 search-collapse"> <form id="formId"> <div class="select-list"> <ul> <li> <label>安全风险单元名称:</label> <select name="riskUnitId"> <option value="">--请选择安全风险分析单元--</option> <option th:each="u :${riskUnits}" th:value="${u.riskListId}" th:text="${u.riskListName}"></option> </select> </li> <li> <label>安全风险事件名称:</label> <input type="text" name="riskEventId"/> </li> <li> <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a> </li> </ul> </div> </form> </div> <div class="btn-group-sm" id="toolbar" role="group"> <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="tr:riskType:add"> <i class="fa fa-plus"></i> 添加 </a> <!-- <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="tr:riskType:edit">--> <!-- <i class="fa fa-edit"></i> 修改--> <!-- </a>--> <!-- <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="tr:riskType:remove">--> <!-- <i class="fa fa-remove"></i> 删除--> <!--<!– </a>–>--> <!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="tr:riskType:export">--> <!-- <i class="fa fa-download"></i> 导出--> </a> </div> <div class="col-sm-12 select-table table-striped"> <table id="bootstrap-table"></table> </div> </div> </div> <th:block th:include="include :: footer" /> <script th:inline="javascript"> var editFlag = [[${@permission.hasPermi('tr:riskType:edit')}]]; var removeFlag = [[${@permission.hasPermi('tr:riskType:remove')}]]; var riskTypeTypeDatas = [[${@dict.getType('tr_risk_type_type')}]]; var prefix = ctx + "tr/riskEvent"; $(function() { var options = { url: prefix + "/list", createUrl: prefix + "/add", updateUrl: prefix + "/edit/{id}", removeUrl: prefix + "/remove", exportUrl: prefix + "/export", modalName: "风险单元类型", columns: [ { field: 'id', title: 'id', visible: false }, { field: 'riskUnitName', title: '安全风险分析单元名称' }, { field: 'riskEventName', title: '安全风险事件名称' }, { field: 'eventResult', title: '可能造成的后果' }, { field: 'createByUserName', title: '创建人' }, { field: 'gmtCreate', title: '创建时间' }, { field: 'lastEditUserName', title: '最后修改人' }, { field: 'gmtModitify', title: '最后修改时间' }, // { // field: 'riskTypeType', // title: '类型所属类型(1设备设置,2作业活动,3工艺节点,4活动频率)', // formatter: function(value, row, index) { // return $.table.selectDictLabel(riskTypeTypeDatas, value); // } // }, { title: '操作', align: 'center', formatter: function(value, row, index) { var actions = []; actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> '); actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>'); return actions.join(''); } }] }; $.table.init(options); }); </script> </body> </html> src/main/resources/templates/tr/riskMeasure/add.html
对比新文件 @@ -0,0 +1,183 @@ <!DOCTYPE html> <html lang="zh" xmlns:th="http://www.thymeleaf.org" > <head> <th:block th:include="include :: header('新增安全风险事件')" /> </head> <body class="white-bg"> <div class="wrapper wrapper-content animated fadeInRight ibox-content"> <form class="form-horizontal m" id="form-riskMeasure-add"> <div class="form-group"> <label class="col-sm-3 control-label">安全风险事件名称:</label> <div class="col-sm-8"> <select name="riskEventId" class="form-control m-b"> <option value="">--请选择安全风险事件名称--</option> <option th:each="u :${riskEvents}" th:value="${u.id}" th:text="${u.riskEventName}"></option> </select> <!-- <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>--> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">风险措施编码:</label> <div class="col-sm-8"> <input name="controlMeasureCode" class="form-control" type="text"> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">管控方式:</label> <div class="col-sm-8"> <select name="controlType" class="form-control m-b" th:with="type=${@dict.getType('dc_action_type')}"> <option value="">--请选择管控方式--</option> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> </select> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">管控内容:</label> <div class="col-sm-8"> <input name="checkContent" class="form-control" type="text"> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">管控措施1:</label> <div class="col-sm-8"> <select name="classify1" class="form-control m-b" th:with="type=${@dict.getType('dc_action_one')}"> <option value="">--请选择管控措施1--</option> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> </select> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">管控措施2:</label> <div class="col-sm-8"> <select name="classify2" class="form-control m-b" th:with="type=${@dict.getType('dc_action_two')}"> <option value="">--请选择管控措施1--</option> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> </select> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">管控措施3:</label> <div class="col-sm-8"> <input name="classify3" class="form-control" type="text"> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">措施说明:</label> <div class="col-sm-8"> <input name="measureDesc" class="form-control" type="text"> </div> </div> </form> </div> <th:block th:include="include :: footer" /> <script th:inline="javascript"> var actionTypeDatas = [[${@dict.getType('dc_action_type')}]]; var actionOneList = [[${@dict.getType('dc_action_one')}]]; var actionTwoList = [[${@dict.getType('dc_action_two')}]]; var prefix = ctx + "tr/riskMeasure"; $("#form-riskMeasure-add").validate({ focusCleanup: true }); function submitHandler() { if ($.validate.form()) { $.operate.save(prefix + "/add", $('#form-riskMeasure-add').serialize()); } } </script> </body> </html> <!--<!DOCTYPE html>--> <!--<html lang="zh" xmlns:th="http://www.thymeleaf.org" >--> <!--<head>--> <!-- <th:block th:include="include :: header('新增风险管控措施')" />--> <!--</head>--> <!--<body class="white-bg">--> <!-- <div class="wrapper wrapper-content animated fadeInRight ibox-content">--> <!-- <form class="form-horizontal m" id="form-riskMeasure-add">--> <!-- <div class="form-group"> --> <!-- <label class="col-sm-3 control-label">风险事件名称:</label>--> <!-- <div class="col-sm-8">--> <!-- <select name="riskUnitId" class="form-control m-b">--> <!--<!– <option value="">--风险事件名称--</option>–>--> <!-- <option th:each="u :${riskEvents}" th:value="${u.id}" th:text="${u.riskEventName}"></option>--> <!-- </select>--> <!--<!– <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>–>--> <!-- </div>--> <!-- </div>--> <!-- <div class="form-group"> --> <!-- <label class="col-sm-3 control-label">风险措施编码:</label>--> <!-- <div class="col-sm-8">--> <!-- <input name="riskEventName" class="form-control" type="text">--> <!-- </div>--> <!-- </div>--> <!-- <div class="form-group">--> <!-- <label class="col-sm-3 control-label">管控方式:</label>--> <!-- <div class="col-sm-8">--> <!-- <select name="riskUnitId" class="form-control m-b" th:with="type=${@dict.getType('dc_action_type')}">--> <!--<!– <option value="">--管控方式--</option>–>--> <!-- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>--> <!-- </select>--> <!-- </div>--> <!-- </div>--> <!-- <div class="form-group"> --> <!-- <label class="col-sm-3 control-label">管控内容:</label>--> <!-- <div class="col-sm-8">--> <!-- <input name="eventResult" class="form-control" type="text">--> <!-- </div>--> <!-- </div>--> <!-- <div class="form-group">--> <!-- <label class="col-sm-3 control-label">管控措施1:</label>--> <!-- <div class="col-sm-8">--> <!-- <select name="riskUnitId" class="form-control m-b" th:with="type=${@dict.getType('dc_action_one')}">--> <!-- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>--> <!-- </select>--> <!-- </div>--> <!-- </div>--> <!-- <div class="form-group">--> <!-- <label class="col-sm-3 control-label">管控措施2:</label>--> <!-- <div class="col-sm-8">--> <!-- <select name="riskUnitId" class="form-control m-b" th:with="type=${@dict.getType('dc_action_two')}">--> <!-- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>--> <!-- </select>--> <!-- </div>--> <!-- </div>--> <!-- <div class="form-group">--> <!-- <label class="col-sm-3 control-label">管控措施3:</label>--> <!-- <div class="col-sm-8">--> <!-- <input name="eventResult" class="form-control" type="text">--> <!-- </div>--> <!-- </div>--> <!-- <div class="form-group">--> <!-- <label class="col-sm-3 control-label">措施说明:</label>--> <!-- <div class="col-sm-8">--> <!-- <input name="eventResult" class="form-control" type="text">--> <!-- </div>--> <!-- </div>--> <!-- </form>--> <!-- </div>--> <!-- <th:block th:include="include :: footer" />--> <!-- <script type="text/javascript">--> <!-- var actionTypeDatas = [[${@dict.getType('dc_action_type')}]];--> <!-- var actionOneList = [[${@dict.getType('dc_action_one')}]];--> <!-- var actionTwoList = [[${@dict.getType('dc_action_two')}]];--> <!-- var prefix = ctx + "tr/riskMeasure";--> <!-- $("#form-riskMeasure-add").validate({--> <!-- focusCleanup: true--> <!-- });--> <!-- function submitHandler() {--> <!-- if ($.validate.form()) {--> <!-- $.operate.save(prefix + "/add", $('#form-riskMeasure-add').serialize());--> <!-- }--> <!-- }--> <!-- </script>--> <!--</body>--> <!--</html>--> src/main/resources/templates/tr/riskMeasure/edit.html
对比新文件 @@ -0,0 +1,94 @@ <!DOCTYPE html> <html lang="zh" xmlns:th="http://www.thymeleaf.org" > <head> <th:block th:include="include :: header('修改安全风险事件')" /> </head> <body class="white-bg"> <div class="wrapper wrapper-content animated fadeInRight ibox-content"> <form class="form-horizontal m" id="form-riskMeasure-edit" th:object="${measureData}"> <input name="id" th:field="*{id}" type="hidden"> <div class="form-group"> <label class="col-sm-3 control-label">安全风险分析单元名称:</label> <div class="col-sm-8"> <select name="riskUnitId" th:field="*{riskEventId}" class="form-control m-b"> <option value="">--请选择安全风险分析单元--</option> <option th:each="u :${riskEvents}" th:value="${u.id}" th:text="${u.riskEventName}"></option> </select> <!-- <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>--> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">风险措施编码:</label> <div class="col-sm-8"> <input name="controlMeasureCode" th:field="*{controlMeasureCode}" class="form-control" type="text"> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">管控方式:</label> <div class="col-sm-8"> <select name="controlType" th:field="*{controlType}" class="form-control m-b" th:with="type=${@dict.getType('dc_action_type')}"> <option value="">--请选择管控方式--</option> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> </select> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">管控内容:</label> <div class="col-sm-8"> <input name="checkContent" th:field="*{checkContent}" class="form-control" type="text"> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">管控措施1:</label> <div class="col-sm-8"> <select name="classify1" th:field="*{classify1}" class="form-control m-b" th:with="type=${@dict.getType('dc_action_one')}"> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> </select> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">管控措施2:</label> <div class="col-sm-8"> <select name="classify2" th:field="*{classify2}" class="form-control m-b" th:with="type=${@dict.getType('dc_action_two')}"> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> </select> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">管控措施3:</label> <div class="col-sm-8"> <input name="classify3" th:field="*{classify3}" class="form-control" type="text"> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">措施说明:</label> <div class="col-sm-8"> <input name="measureDesc" th:field="*{measureDesc}" class="form-control" type="text"> </div> </div> <!-- <div class="form-group">--> <!-- <label class="col-sm-3 control-label">可能造成后果:</label>--> <!-- <div class="col-sm-8">--> <!-- <input name="eventResult" th:field="*{eventResult}" class="form-control" type="text">--> <!-- </div>--> <!-- </div>--> </form> </div> <th:block th:include="include :: footer" /> <script th:inline="javascript"> var actionTypeDatas = [[${@dict.getType('dc_action_type')}]]; var actionOneList = [[${@dict.getType('dc_action_one')}]]; var actionTwoList = [[${@dict.getType('dc_action_two')}]]; var prefix = ctx + "tr/riskMeasure"; $("#form-riskMeasure-edit").validate({ focusCleanup: true }); function submitHandler() { if ($.validate.form()) { $.operate.save(prefix + "/edit", $('#form-riskMeasure-edit').serialize()); } } </script> </body> </html> src/main/resources/templates/tr/riskMeasure/riskMeasure.html
对比新文件 @@ -0,0 +1,142 @@ <!DOCTYPE html> <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> <head> <th:block th:include="include :: header('风险管控措施列表')" /> </head> <body class="gray-bg"> <div class="container-div"> <div class="row"> <div class="col-sm-12 search-collapse"> <form id="formId"> <div class="select-list"> <ul> <li> <label>管控方式:</label> <select name="controlType" th:with="type=${@dict.getType('dc_action_type')}"> <option value="">所有</option> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> </select> </li> <li> <label>安全风险事件:</label> <select name="riskEventId"> <option value="">--请选择安全风险事件--</option> <option th:each="u :${riskEvents}" th:value="${u.id}" th:text="${u.riskEventName}"></option> </select> </li> <li> <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a> </li> </ul> </div> </form> </div> <div class="btn-group-sm" id="toolbar" role="group"> <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="tr:riskType:add"> <i class="fa fa-plus"></i> 添加 </a> <!-- <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="tr:riskType:edit">--> <!-- <i class="fa fa-edit"></i> 修改--> <!-- </a>--> <!-- <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="tr:riskType:remove">--> <!-- <i class="fa fa-remove"></i> 删除--> <!--<!– </a>–>--> <!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="tr:riskType:export">--> <!-- <i class="fa fa-download"></i> 导出--> </a> </div> <div class="col-sm-12 select-table table-striped"> <table id="bootstrap-table"></table> </div> </div> </div> <th:block th:include="include :: footer" /> <script th:inline="javascript"> var editFlag = [[${@permission.hasPermi('tr:riskType:edit')}]]; var removeFlag = [[${@permission.hasPermi('tr:riskType:remove')}]]; var actionTypeDatas = [[${@dict.getType('dc_action_type')}]]; var actionOneList = [[${@dict.getType('dc_action_one')}]]; var actionTwoList = [[${@dict.getType('dc_action_two')}]]; var prefix = ctx + "tr/riskMeasure"; $(function() { var options = { url: prefix + "/list", createUrl: prefix + "/add", updateUrl: prefix + "/edit/{id}", removeUrl: prefix + "/remove", exportUrl: prefix + "/export", modalName: "风险管控措施", columns: [ { field: 'id', title: 'id', visible: false }, { field: 'riskEventName', title: '安全风险事件名称' }, { field: 'controlMeasureCode', title: '风险措施编码' }, { field: 'controlType', title: '管控方式', formatter: function(value, row, index) { return $.table.selectDictLabel(actionTypeDatas, value); } }, { field: 'checkContent', title: '管控内容' }, { field: 'classify1', title: '管控措施分类1', formatter: function(value, row, index) { return $.table.selectDictLabel(actionOneList, value); } }, { field: 'classify2', title: '管控措施分类2', formatter: function(value, row, index) { return $.table.selectDictLabel(actionTwoList, value); } }, { field: 'classify3', title: '管控措施分类3' }, { field: 'measureDesc', title: '措施说明' }, // { // field: 'riskTypeType', // title: '类型所属类型(1设备设置,2作业活动,3工艺节点,4活动频率)', // formatter: function(value, row, index) { // return $.table.selectDictLabel(riskTypeTypeDatas, value); // } // }, { title: '操作', align: 'center', formatter: function(value, row, index) { var actions = []; actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> '); actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>'); return actions.join(''); } }] }; $.table.init(options); }); </script> </body> </html>