| | |
| | | package com.ruoyi.staff.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.staff.dto.StaffLeaveDto; |
| | | import com.ruoyi.staff.service.StaffLeaveService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/staff/staffLeave") |
| | | @Api(tags = "员工离职") |
| | | @Tag(name = "员工离职") |
| | | public class StaffLeaveController { |
| | | @Resource |
| | | private StaffLeaveService staffLeaveService; |
| | |
| | | * @param staffLeaveDto |
| | | * @return |
| | | */ |
| | | @Log(title = "新增离职记录", businessType = BusinessType.INSERT) |
| | | @PostMapping("") |
| | | public AjaxResult add(@RequestBody StaffLeaveDto staffLeaveDto) { |
| | | return AjaxResult.success(staffLeaveService.add(staffLeaveDto)); |
| | |
| | | * @param staffLeaveDto |
| | | * @return |
| | | */ |
| | | @Log(title = "修改离职记录", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/{id}") |
| | | public AjaxResult update(@PathVariable("id") Long id, @RequestBody StaffLeaveDto staffLeaveDto) { |
| | | return AjaxResult.success(staffLeaveService.update(id, staffLeaveDto)); |
| | |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @Log(title = "删除离职记录", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/del") |
| | | public AjaxResult del(@RequestBody List<Integer> ids) { |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | |
| | | * 离职导出 |
| | | * @param staffLeaveDto |
| | | */ |
| | | @Log(title = "导出离职记录", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, StaffLeaveDto staffLeaveDto) { |
| | | staffLeaveService.export(response, staffLeaveDto); |