| | |
| | | package com.ruoyi.project.tr.specialCheck.controller; |
| | | |
| | | import com.ruoyi.common.utils.BeanCopyUtils; |
| | | import com.ruoyi.doublePrevention.entity.CJReport.PreventCJReportDangerInfo; |
| | | import com.ruoyi.doublePrevention.service.baseService.PreventCJReportDangerInfoService; |
| | | import com.ruoyi.doublePrevention.vo.ResultVO; |
| | | 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.tr.riskList.domain.RiskList; |
| | | import com.ruoyi.project.tr.riskList.service.IRiskListService; |
| | | import com.ruoyi.project.tr.specialCheck.domin.BO.*; |
| | | import com.ruoyi.project.tr.specialCheck.domin.DTO.TbSpecialCheckItemDangerLogDTO; |
| | | import com.ruoyi.project.tr.specialCheck.domin.DTO.TbSpecialCheckTaskLogDTO; |
| | | import com.ruoyi.project.tr.specialCheck.domin.TbBaseCheckTask; |
| | | import com.ruoyi.project.tr.specialCheck.domin.TbSpecialCheckItemDangerLog; |
| | | import com.ruoyi.project.tr.specialCheck.domin.TbSpecialCheckTaskLog; |
| | | import com.ruoyi.project.tr.specialCheck.service.SpecialCheckItemDangerLogService; |
| | | import com.ruoyi.project.tr.specialCheck.service.SpecialCheckTaskService; |
| | | import com.ruoyi.project.tr.specialCheck.service.TbBaseCheckService; |
| | | 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 |
| | | * |
| | | * @date 2020-05-08 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/tr/specialCheckItemDangerLog") |
| | | public class TBSpecialCheckItemDangerLogController extends BaseController |
| | | { |
| | | private String prefix = "tr/specialCheckItemDangerLog"; |
| | | |
| | | @Autowired |
| | | private SpecialCheckItemDangerLogService itemDangerLogService; |
| | | |
| | | @Autowired |
| | | private IRiskListService riskListService; |
| | | |
| | | @Autowired |
| | | private TbBaseCheckService tbBaseCheckService; |
| | | |
| | | @Autowired |
| | | private PreventCJReportDangerInfoService preventCJReportDangerInfoService; |
| | | |
| | | |
| | | |
| | | // @GetMapping() |
| | | // public String selectTbBaseCheckTaskPage(ModelMap mmap) |
| | | //package com.ruoyi.project.tr.specialCheck.controller; |
| | | // |
| | | //import com.ruoyi.common.utils.BeanCopyUtils; |
| | | //import com.ruoyi.doublePrevention.entity.CJReport.PreventCJReportDangerInfo; |
| | | //import com.ruoyi.doublePrevention.service.baseService.PreventCJReportDangerInfoService; |
| | | //import com.ruoyi.doublePrevention.vo.ResultVO; |
| | | //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.tr.riskList.domain.RiskList; |
| | | //import com.ruoyi.project.tr.riskList.service.IRiskListService; |
| | | //import com.ruoyi.project.tr.specialCheck.domin.BO.*; |
| | | //import com.ruoyi.project.tr.specialCheck.domin.DTO.TbSpecialCheckItemDangerLogDTO; |
| | | //import com.ruoyi.project.tr.specialCheck.domin.DTO.TbSpecialCheckItemLogQueryDTO; |
| | | //import com.ruoyi.project.tr.specialCheck.domin.DTO.TbSpecialCheckTaskLogDTO; |
| | | //import com.ruoyi.project.tr.specialCheck.domin.TbBaseCheckTask; |
| | | //import com.ruoyi.project.tr.specialCheck.domin.TbSpecialCheckItemDangerLog; |
| | | //import com.ruoyi.project.tr.specialCheck.domin.TbSpecialCheckItemLog; |
| | | //import com.ruoyi.project.tr.specialCheck.domin.TbSpecialCheckTaskLog; |
| | | //import com.ruoyi.project.tr.specialCheck.service.SpecialCheckItemDangerLogService; |
| | | //import com.ruoyi.project.tr.specialCheck.service.SpecialCheckTaskService; |
| | | //import com.ruoyi.project.tr.specialCheck.service.TbBaseCheckService; |
| | | //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 |
| | | // * |
| | | // * @date 2020-05-08 |
| | | // */ |
| | | //@Controller |
| | | //@RequestMapping("/tr/specialCheckItemDangerLog") |
| | | //public class TBSpecialCheckItemDangerLogController extends BaseController |
| | | //{ |
| | | // private String prefix = "tr/specialCheckItemDangerLog"; |
| | | // |
| | | // @Autowired |
| | | // private SpecialCheckItemDangerLogService itemDangerLogService; |
| | | // |
| | | // @Autowired |
| | | // private IRiskListService riskListService; |
| | | // |
| | | // @Autowired |
| | | // private TbBaseCheckService tbBaseCheckService; |
| | | // |
| | | // @Autowired |
| | | // private PreventCJReportDangerInfoService preventCJReportDangerInfoService; |
| | | // |
| | | // |
| | | // |
| | | //// @GetMapping() |
| | | //// public String selectTbBaseCheckTaskPage(ModelMap mmap) |
| | | //// { |
| | | //// return prefix + "/specialCheckItemDangerLog"; |
| | | //// } |
| | | // @GetMapping("{id}") |
| | | // public String specialCheckItemDangerLog(@PathVariable("id")String id,ModelMap modelMap) |
| | | // { |
| | | // modelMap.put("id",id); |
| | | // return prefix + "/specialCheckItemDangerLog"; |
| | | // } |
| | | @GetMapping("{id}") |
| | | public String specialCheckItemDangerLog(@PathVariable("id")String id,ModelMap modelMap) |
| | | { |
| | | modelMap.put("id",id); |
| | | return prefix + "/specialCheckItemDangerLog"; |
| | | } |
| | | |
| | | |
| | | @PostMapping("/list") |
| | | @ResponseBody |
| | | public TableDataInfo selectSpecialCheckItemDangerLogPage(TbSpecialCheckItemDangerLogBO itemDangerLogBO ) |
| | | { |
| | | |
| | | ResultVO<List<TbSpecialCheckItemDangerLog>> resultVO = itemDangerLogService.selectSpecialCheckItemDangerLogPage(itemDangerLogBO); |
| | | List<TbSpecialCheckItemDangerLogDTO> data = (List<TbSpecialCheckItemDangerLogDTO>) resultVO.getData(); |
| | | |
| | | |
| | | TableDataInfo dataTable = getDataTable(data); |
| | | dataTable.setTotal(resultVO.getCount()); |
| | | |
| | | return dataTable; |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | */ |
| | | @GetMapping("/add") |
| | | public String add(ModelMap mmap) |
| | | { |
| | | List<RiskList> riskList = riskListService.listHazardSource(); |
| | | List<PreventCJReportDangerInfo> dangerList = preventCJReportDangerInfoService.getDangerListForCheckTask(); |
| | | mmap.put("hazardList", riskList); |
| | | mmap.put("dangerList", dangerList); |
| | | return prefix + "/add"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 新增保存 |
| | | */ |
| | | @PostMapping("/add") |
| | | @ResponseBody |
| | | public AjaxResult addSpecialItemDanger(TbSpecialCheckItemDangerLog itemDangerLog){ |
| | | |
| | | ResultVO<TbSpecialCheckItemDangerLog> resultVO = itemDangerLogService.addSpecialItemDanger(itemDangerLog); |
| | | String code = resultVO.getCode(); |
| | | if ("200".equals(code)){ |
| | | return toAjax(1); |
| | | }else { |
| | | return AjaxResult.error(resultVO.getMsg()); |
| | | } |
| | | } |
| | | |
| | | @GetMapping("/edit/{id}") |
| | | public String edit(@PathVariable("id") Long indexId, ModelMap mmap) |
| | | { |
| | | TbSpecialCheckItemDangerLog specialCheckItem = itemDangerLogService.getSpecialCheckItemDangerLogByIndexId(indexId); |
| | | mmap.put("specialCheckItem",specialCheckItem); |
| | | |
| | | // TbBaseCheckTaskBO tbBaseCheckTaskBO = new TbBaseCheckTaskBO(); |
| | | // ResultVO<List<TbBaseCheckTask>> listResultVO = tbBaseCheckService.selectTbBaseCheckTaskPage(tbBaseCheckTaskBO); |
| | | // Object data = listResultVO.getData(); |
| | | // mmap.put("tbBaseCheckTask", data); |
| | | return prefix + "/edit"; |
| | | } |
| | | |
| | | /** |
| | | * 修改保存 |
| | | */ |
| | | @PostMapping("/edit") |
| | | @ResponseBody |
| | | public AjaxResult editSave(TbSpecialCheckItemDangerLogUpdateBO updateBO) |
| | | { |
| | | ResultVO<TbSpecialCheckItemDangerLog> resultVO = itemDangerLogService.updateSpecialCheckItemDangerLog(updateBO); |
| | | String code = resultVO.getCode(); |
| | | if ("200".equals(code)){ |
| | | return toAjax(1); |
| | | }else { |
| | | return AjaxResult.error(resultVO.getMsg()); |
| | | } |
| | | } |
| | | |
| | | |
| | | @PostMapping("/remove") |
| | | @ResponseBody |
| | | public AjaxResult remove(TbSpecialCheckItemDangerLogUpdateBO updateBO){ |
| | | ResultVO<TbSpecialCheckItemDangerLog> resultVO = itemDangerLogService.deleteTbSpecialItemDangerTaskLog(updateBO); |
| | | String code = resultVO.getCode(); |
| | | if ("200".equals(code)){ |
| | | return toAjax(1); |
| | | }else { |
| | | return AjaxResult.error(resultVO.getMsg()); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | // |
| | | // |
| | | // @PostMapping("/list") |
| | | // @ResponseBody |
| | | // public TableDataInfo selectSpecialCheckItemDangerLogPage(TbSpecialCheckItemDangerLogBO itemDangerLogBO ) |
| | | // { |
| | | // |
| | | // ResultVO<List<TbSpecialCheckItemLog>> resultVO = itemDangerLogService.selectSpecialCheckItemDangerLogPage(itemDangerLogBO); |
| | | // List<TbSpecialCheckItemLogQueryDTO> data = (List<TbSpecialCheckItemLogQueryDTO>) resultVO.getData(); |
| | | // |
| | | // |
| | | // TableDataInfo dataTable = getDataTable(data); |
| | | // dataTable.setTotal(resultVO.getCount()); |
| | | // |
| | | // return dataTable; |
| | | // } |
| | | // |
| | | // /** |
| | | // * 新增 |
| | | // */ |
| | | // @GetMapping("/add") |
| | | // public String add(ModelMap mmap) |
| | | // { |
| | | // List<RiskList> riskList = riskListService.listHazardSource(); |
| | | // List<PreventCJReportDangerInfo> dangerList = preventCJReportDangerInfoService.getDangerListForCheckTask(); |
| | | // mmap.put("hazardList", riskList); |
| | | // mmap.put("dangerList", dangerList); |
| | | // return prefix + "/add"; |
| | | // } |
| | | // |
| | | // |
| | | // /** |
| | | // * 新增保存 |
| | | // */ |
| | | // @PostMapping("/add") |
| | | // @ResponseBody |
| | | // public AjaxResult addSpecialItemDanger(TbSpecialCheckItemDangerLog itemDangerLog){ |
| | | // |
| | | // ResultVO<TbSpecialCheckItemLog> resultVO = itemDangerLogService.addSpecialItemDanger(itemDangerLog); |
| | | // String code = resultVO.getCode(); |
| | | // if ("200".equals(code)){ |
| | | // return toAjax(1); |
| | | // }else { |
| | | // return AjaxResult.error(resultVO.getMsg()); |
| | | // } |
| | | // } |
| | | // |
| | | // @GetMapping("/edit/{id}") |
| | | // public String edit(@PathVariable("id") Long indexId, ModelMap mmap) |
| | | // { |
| | | // TbSpecialCheckItemLog specialCheckItem = itemDangerLogService.getSpecialCheckItemDangerLogByIndexId(indexId); |
| | | // mmap.put("specialCheckItem",specialCheckItem); |
| | | // |
| | | //// TbBaseCheckTaskBO tbBaseCheckTaskBO = new TbBaseCheckTaskBO(); |
| | | //// ResultVO<List<TbBaseCheckTask>> listResultVO = tbBaseCheckService.selectTbBaseCheckTaskPage(tbBaseCheckTaskBO); |
| | | //// Object data = listResultVO.getData(); |
| | | //// mmap.put("tbBaseCheckTask", data); |
| | | // return prefix + "/edit"; |
| | | // } |
| | | // |
| | | // /** |
| | | // * 修改保存 |
| | | // */ |
| | | // @PostMapping("/edit") |
| | | // @ResponseBody |
| | | // public AjaxResult editSave(TbSpecialCheckItemDangerLogUpdateBO updateBO) |
| | | // { |
| | | // ResultVO<TbSpecialCheckItemLog> resultVO = itemDangerLogService.updateSpecialCheckItemDangerLog(updateBO); |
| | | // String code = resultVO.getCode(); |
| | | // if ("200".equals(code)){ |
| | | // return toAjax(1); |
| | | // }else { |
| | | // return AjaxResult.error(resultVO.getMsg()); |
| | | // } |
| | | // } |
| | | // |
| | | // |
| | | // @PostMapping("/remove") |
| | | // @ResponseBody |
| | | // public AjaxResult remove(TbSpecialCheckItemDangerLogUpdateBO updateBO){ |
| | | // ResultVO<TbSpecialCheckItemLog> resultVO = itemDangerLogService.deleteTbSpecialItemDangerTaskLog(updateBO); |
| | | // String code = resultVO.getCode(); |
| | | // if ("200".equals(code)){ |
| | | // return toAjax(1); |
| | | // }else { |
| | | // return AjaxResult.error(resultVO.getMsg()); |
| | | // } |
| | | // } |
| | | // |
| | | //} |
| | | // |
| | | // |