package com.klp.perf.controller; import java.util.List; import java.util.Arrays; import lombok.RequiredArgsConstructor; import javax.servlet.http.HttpServletResponse; import javax.validation.constraints.*; import org.springframework.web.bind.annotation.*; import org.springframework.validation.annotation.Validated; import com.klp.common.annotation.RepeatSubmit; import com.klp.common.annotation.Log; import com.klp.common.core.controller.BaseController; import com.klp.common.core.domain.PageQuery; import com.klp.common.core.domain.R; import com.klp.common.core.validate.AddGroup; import com.klp.common.core.validate.EditGroup; import com.klp.common.enums.BusinessType; import com.klp.common.utils.poi.ExcelUtil; import com.klp.perf.domain.vo.PerfDeptVo; import com.klp.perf.domain.bo.PerfDeptBo; import com.klp.perf.service.IPerfDeptService; import com.klp.common.core.page.TableDataInfo; /** * 绩效系统部门 * * @author klp * @date 2026-07-07 */ @Validated @RequiredArgsConstructor @RestController @RequestMapping("/perf/dept") public class PerfDeptController extends BaseController { private final IPerfDeptService iPerfDeptService; /** * 查询绩效系统部门列表 */ @GetMapping("/list") public TableDataInfo list(PerfDeptBo bo, PageQuery pageQuery) { return iPerfDeptService.queryPageList(bo, pageQuery); } /** * 导出绩效系统部门列表 */ @Log(title = "绩效系统部门", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(PerfDeptBo bo, HttpServletResponse response) { List list = iPerfDeptService.queryList(bo); ExcelUtil.exportExcel(list, "绩效系统部门", PerfDeptVo.class, response); } /** * 获取绩效系统部门详细信息 * * @param id 主键 */ @GetMapping("/{id}") public R getInfo(@NotNull(message = "主键不能为空") @PathVariable String id) { return R.ok(iPerfDeptService.queryById(id)); } /** * 新增绩效系统部门 */ @Log(title = "绩效系统部门", businessType = BusinessType.INSERT) @RepeatSubmit() @PostMapping() public R add(@Validated(AddGroup.class) @RequestBody PerfDeptBo bo) { return toAjax(iPerfDeptService.insertByBo(bo)); } /** * 修改绩效系统部门 */ @Log(title = "绩效系统部门", businessType = BusinessType.UPDATE) @RepeatSubmit() @PutMapping() public R edit(@Validated(EditGroup.class) @RequestBody PerfDeptBo bo) { return toAjax(iPerfDeptService.updateByBo(bo)); } /** * 删除绩效系统部门 * * @param ids 主键串 */ @Log(title = "绩效系统部门", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public R remove(@NotEmpty(message = "主键不能为空") @PathVariable String[] ids) { return toAjax(iPerfDeptService.deleteWithValidByIds(Arrays.asList(ids), true)); } }