package com.gkhy.system.controller; import java.util.List; import javax.servlet.http.HttpServletResponse; 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.gkhy.common.annotation.Log; import com.gkhy.common.core.controller.BaseController; import com.gkhy.common.core.domain.AjaxResult; import com.gkhy.common.enums.BusinessType; import com.gkhy.system.domain.ProjectManagement; import com.gkhy.system.service.IProjectManagementService; import com.gkhy.common.utils.poi.ExcelUtil; import com.gkhy.common.core.page.TableDataInfo; /** * 项目管理Controller * * @author expert * @date 2024-11-14 */ @RestController @RequestMapping("/system/management") public class ProjectManagementController extends BaseController { @Autowired private IProjectManagementService projectManagementService; /** * 查询项目管理列表 */ @PreAuthorize("@ss.hasPermi('system:management:list')") @GetMapping("/list") public TableDataInfo list(ProjectManagement projectManagement) { startPage(); List list = projectManagementService.selectProjectManagementList(projectManagement); return getDataTable(list); } /** * 导出项目管理列表 */ @PreAuthorize("@ss.hasPermi('system:management:export')") @Log(title = "项目管理", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, ProjectManagement projectManagement) { List list = projectManagementService.selectProjectManagementList(projectManagement); ExcelUtil util = new ExcelUtil(ProjectManagement.class); util.exportExcel(response, list, "项目管理数据"); } /** * 获取项目管理详细信息 */ @PreAuthorize("@ss.hasPermi('system:management:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return success(projectManagementService.selectProjectManagementById(id)); } /** * 新增项目管理 */ @PreAuthorize("@ss.hasPermi('system:management:add')") @Log(title = "项目管理", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody ProjectManagement projectManagement) { return toAjax(projectManagementService.insertProjectManagement(projectManagement)); } /** * 修改项目管理 */ @PreAuthorize("@ss.hasPermi('system:management:edit')") @Log(title = "项目管理", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody ProjectManagement projectManagement) { return toAjax(projectManagementService.updateProjectManagement(projectManagement)); } /** * 删除项目管理 */ @PreAuthorize("@ss.hasPermi('system:management:remove')") @Log(title = "项目管理", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(projectManagementService.deleteProjectManagementByIds(ids)); } }