package com.zc.business.controller; import java.util.List; import javax.servlet.http.HttpServletResponse; import com.ruoyi.common.enums.BusinessType; import com.zc.business.domain.DcEventConstruction; import com.zc.business.service.IDcEventConstructionService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.core.page.TableDataInfo; /** * 施工建设事件 "施工分类"为事件“事件子类”Controller * * @author ruoyi * @date 2024-01-12 */ @Api(tags = "施工建设事件") @RestController @RequestMapping("/dc/system/construction") public class DcEventConstructionController extends BaseController { @Autowired private IDcEventConstructionService dcEventConstructionService; /** * 查询施工建设事件 "施工分类"为事件“事件子类”列表 */ @ApiOperation("查询施工建设事件") // @PreAuthorize("@ss.hasPermi('system:construction:list')") @GetMapping("/list") public TableDataInfo list(DcEventConstruction dcEventConstruction) { startPage(); List list = dcEventConstructionService.selectDcEventConstructionList(dcEventConstruction); return getDataTable(list); } /** * 导出施工建设事件 "施工分类"为事件“事件子类”列表 */ //@PreAuthorize("@ss.hasPermi('system:construction:export')") @Log(title = "施工建设事件 ", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, DcEventConstruction dcEventConstruction) { List list = dcEventConstructionService.selectDcEventConstructionList(dcEventConstruction); ExcelUtil util = new ExcelUtil<>(DcEventConstruction.class); util.exportExcel(response, list, "施工建设事件施工分类"); } /** * 获取施工建设事件 "施工分类"为事件“事件子类”详细信息 */ @ApiOperation("获取施工建设事件") // @PreAuthorize("@ss.hasPermi('system:construction:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") String id) { return AjaxResult.success(dcEventConstructionService.selectDcEventConstructionById(id)); } /** * 新增施工建设事件 "施工分类"为事件“事件子类” */ @ApiOperation("新增施工建设事件") //@PreAuthorize("@ss.hasPermi('system:construction:add')") @Log(title = "施工建设事件施工分类", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody DcEventConstruction dcEventConstruction) { return toAjax(dcEventConstructionService.insertDcEventConstruction(dcEventConstruction)); } /** * 修改施工建设事件 "施工分类"为事件“事件子类” */ @ApiOperation("修改施工建设事件") //@PreAuthorize("@ss.hasPermi('system:construction:edit')") @Log(title = "施工建设事件施工分类", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody DcEventConstruction dcEventConstruction) { return toAjax(dcEventConstructionService.updateDcEventConstruction(dcEventConstruction)); } /** * 删除施工建设事件 "施工分类"为事件“事件子类” */ @ApiOperation("删除施工建设事件") //@PreAuthorize("@ss.hasPermi('system:construction:remove')") @Log(title = "施工建设事件施工分类", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable String[] ids) { return toAjax(dcEventConstructionService.deleteDcEventConstructionByIds(ids)); } }