huminmin
10 天以前 d2038a623e02c2d7bb6b95a908832c0432adf2f0
src/main/java/com/ruoyi/staff/controller/StaffSchedulingController.java
@@ -10,6 +10,8 @@
import com.ruoyi.staff.dto.StaffSchedulingDto;
import com.ruoyi.staff.service.StaffSchedulingService;
import com.ruoyi.staff.vo.SearchSchedulingVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@@ -26,28 +28,37 @@
@RestController
@RequestMapping("/staff/staffScheduling")
@RequiredArgsConstructor
@Api(tags = "排班")
public class StaffSchedulingController {
    private final StaffSchedulingService staffSchedulingService;
    @PostMapping("/listPage")
    @ApiOperation("排班分页查询")
    @Log(title = "排班分页查询", businessType = BusinessType.OTHER)
    public AjaxResult listPage(@RequestBody SearchSchedulingVo vo){
       return AjaxResult.success(staffSchedulingService.listPage(vo));
    }
    @PostMapping("/save")
    @ApiOperation("保存排班")
    @Log(title = "保存排班", businessType = BusinessType.UPDATE)
    public AjaxResult save(@RequestBody @Validated SaveStaffSchedulingDto saveStaffSchedulingDto){
        staffSchedulingService.saveStaffScheduling(saveStaffSchedulingDto);
        return AjaxResult.success();
    }
    @DeleteMapping("/delByIds")
    @ApiOperation("批量删除排班")
    @Log(title = "批量删除排班", businessType = BusinessType.DELETE)
    public AjaxResult delByIds(@RequestBody List<Integer> ids){
        staffSchedulingService.removeByIds(ids);
        return AjaxResult.success();
    }
    @DeleteMapping("/del/{id}")
    @ApiOperation("删除排班")
    @Log(title = "删除排班", businessType = BusinessType.DELETE)
    public AjaxResult del(@PathVariable("id") Integer id){
        staffSchedulingService.removeById(id);
        return AjaxResult.success();
@@ -57,12 +68,15 @@
     * 获取当前用户最新排班记录
     */
    @GetMapping("/getCurrentUserLatestScheduling")
    @ApiOperation("获取当前用户最新排班记录")
    @Log(title = "获取当前用户最新排班记录", businessType = BusinessType.OTHER)
    public AjaxResult getCurrentUserLatestScheduling(){
        return AjaxResult.success(staffSchedulingService.getCurrentUserLatestScheduling());
    }
    @Log(title = "导出人员排班列表", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    @ApiOperation("导出人员排班列表")
    public void export(HttpServletResponse response ) {
        SearchSchedulingVo vo = new SearchSchedulingVo();
        vo.setCurrent(-1);