package com.ruoyi.web.controller.staffManage; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.core.domain.entity.StaffManage; import com.ruoyi.system.service.IStaffManageService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.util.List; /** * 员工管理Controller * * @author boman * @date 2025-02-18 */ @RestController @RequestMapping("/wuYe/staffManage") public class StaffManageController extends BaseController { @Autowired private IStaffManageService staffManageService; /** * 查询员工管理列表 */ @PreAuthorize("@ss.hasPermi('wuYe:staffManage:list')") @GetMapping("/list") public TableDataInfo list(StaffManage staffManage) { startPage(); List list = staffManageService.selectStaffManageList(staffManage); return getDataTable(list); } /** * 查询员工管理列表不分页 */ @PreAuthorize("@ss.hasPermi('wuYe:staffManage:listNoPage')") @GetMapping("/listNoPage") public TableDataInfo listNoPage(StaffManage staffManage) { List list = staffManageService.selectStaffManageList(staffManage); return getDataTable(list); } /** * 导出员工管理列表 */ @PreAuthorize("@ss.hasPermi('wuYe:staffManage:export')") @Log(title = "员工管理", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, StaffManage staffManage) { List list = staffManageService.selectStaffManageList(staffManage); ExcelUtil util = new ExcelUtil(StaffManage.class); util.exportExcel(response, list, "员工管理数据"); } /** * 获取员工管理详细信息 */ @PreAuthorize("@ss.hasPermi('wuYe:staffManage:query')") @GetMapping(value = "/{staffId}") public AjaxResult getInfo(@PathVariable("staffId") Long staffId) { return success(staffManageService.selectStaffManageByStaffId(staffId)); } /** * 新增员工管理 */ @PreAuthorize("@ss.hasPermi('wuYe:staffManage:add')") @Log(title = "员工管理", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody StaffManage staffManage) { return toAjax(staffManageService.insertStaffManage(staffManage)); } /** * 修改员工管理 */ @PreAuthorize("@ss.hasPermi('wuYe:staffManage:edit')") @Log(title = "员工管理", businessType = BusinessType.UPDATE) @PostMapping("/put") public AjaxResult edit(@RequestBody StaffManage staffManage) { return toAjax(staffManageService.updateStaffManage(staffManage)); } /** * 删除员工管理 */ @PreAuthorize("@ss.hasPermi('wuYe:staffManage:remove')") @Log(title = "员工管理", businessType = BusinessType.DELETE) @GetMapping("/delete/{staffIds}") public AjaxResult remove(@PathVariable Long[] staffIds) { getUsername(); return toAjax(staffManageService.deleteStaffManageByStaffIds(staffIds)); } }