maven
4 天以前 2ed03e83ce1e513632a188de78190e79a85636b9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package com.ruoyi.staff.controller;
 
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.compensationperformance.pojo.CompensationPerformance;
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.SaveStaffSchedulingDto;
import com.ruoyi.staff.dto.StaffSchedulingDto;
import com.ruoyi.staff.service.StaffSchedulingService;
import com.ruoyi.staff.vo.SearchSchedulingVo;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
 
import javax.servlet.http.HttpServletResponse;
import java.util.List;
 
/**
 * 排班
 * @author buhuazhen
 * @date 2025/9/3
 * @email 3038525872@qq.com
 */
@RestController
@RequestMapping("/staff/staffScheduling")
@RequiredArgsConstructor
public class StaffSchedulingController {
 
    private final StaffSchedulingService staffSchedulingService;
 
    @PostMapping("/listPage")
    public AjaxResult listPage(@RequestBody SearchSchedulingVo vo){
       return AjaxResult.success(staffSchedulingService.listPage(vo));
    }
 
    @PostMapping("/save")
    public AjaxResult save(@RequestBody @Validated SaveStaffSchedulingDto saveStaffSchedulingDto){
        staffSchedulingService.saveStaffScheduling(saveStaffSchedulingDto);
        return AjaxResult.success();
    }
 
    @DeleteMapping("/delByIds")
    public AjaxResult delByIds(@RequestBody List<Integer> ids){
        staffSchedulingService.removeByIds(ids);
        return AjaxResult.success();
    }
 
    @DeleteMapping("/del/{id}")
    public AjaxResult del(@PathVariable("id") Integer id){
        staffSchedulingService.removeById(id);
        return AjaxResult.success();
    }
 
    @Log(title = "导出人员排班列表", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response ) {
        SearchSchedulingVo vo = new SearchSchedulingVo();
        vo.setCurrent(-1);
        vo.setSize(-1);
        IPage<StaffSchedulingDto> list = staffSchedulingService.listPage(vo);
        ExcelUtil<StaffSchedulingDto> util = new ExcelUtil<StaffSchedulingDto>(StaffSchedulingDto.class);
        util.exportExcel(response, list.getRecords(), "导出人员排班列表");
    }
 
}