zhangzeli
5 天以前 7a8a994feafb8ef8333a9590bd637630c42609d6
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
 
 
package com.by4cloud.platform.processing.controller;
 
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.by4cloud.platform.common.core.util.R;
import com.by4cloud.platform.common.log.annotation.SysLog;
import com.by4cloud.platform.processing.entity.LoadUnloadAvgTime;
import com.by4cloud.platform.processing.service.LoadUnloadAvgTimeService;
import org.springframework.security.access.prepost.PreAuthorize;
import com.by4cloud.platform.common.excel.annotation.ResponseExcel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
 
/**
 * 装车卸载平均时间
 *
 * @author zzl
 * @date 2025-10-19 10:40:20
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/loadunloadavgtime" )
@Api(value = "loadunloadavgtime", tags = "装车卸载平均时间管理")
public class LoadUnloadAvgTimeController {
 
    private final  LoadUnloadAvgTimeService loadUnloadAvgTimeService;
 
    /**
     * 分页查询
     * @param page 分页对象
     * @param loadUnloadAvgTime 装车卸载平均时间
     * @return
     */
    @ApiOperation(value = "分页查询", notes = "分页查询")
    @GetMapping("/page" )
    @PreAuthorize("@pms.hasPermission('processing_loadunloadavgtime_view')" )
    public R getLoadUnloadAvgTimePage(Page page, LoadUnloadAvgTime loadUnloadAvgTime) {
        return R.ok(loadUnloadAvgTimeService.page(page, Wrappers.query(loadUnloadAvgTime)));
    }
 
 
    /**
     * 通过id查询装车卸载平均时间
     * @param id id
     * @return R
     */
    @ApiOperation(value = "通过id查询", notes = "通过id查询")
    @GetMapping("/{id}" )
    @PreAuthorize("@pms.hasPermission('processing_loadunloadavgtime_view')" )
    public R getById(@PathVariable("id" ) Integer id) {
        return R.ok(loadUnloadAvgTimeService.getById(id));
    }
 
    /**
     * 新增装车卸载平均时间
     * @param loadUnloadAvgTime 装车卸载平均时间
     * @return R
     */
    @ApiOperation(value = "新增装车卸载平均时间", notes = "新增装车卸载平均时间")
    @SysLog("新增装车卸载平均时间" )
    @PostMapping
    @PreAuthorize("@pms.hasPermission('processing_loadunloadavgtime_add')" )
    public R save(@RequestBody LoadUnloadAvgTime loadUnloadAvgTime) {
        return R.ok(loadUnloadAvgTimeService.save(loadUnloadAvgTime));
    }
 
    /**
     * 修改装车卸载平均时间
     * @param loadUnloadAvgTime 装车卸载平均时间
     * @return R
     */
    @ApiOperation(value = "修改装车卸载平均时间", notes = "修改装车卸载平均时间")
    @SysLog("修改装车卸载平均时间" )
    @PutMapping
    @PreAuthorize("@pms.hasPermission('processing_loadunloadavgtime_edit')" )
    public R updateById(@RequestBody LoadUnloadAvgTime loadUnloadAvgTime) {
        return R.ok(loadUnloadAvgTimeService.updateById(loadUnloadAvgTime));
    }
 
    /**
     * 通过id删除装车卸载平均时间
     * @param id id
     * @return R
     */
    @ApiOperation(value = "通过id删除装车卸载平均时间", notes = "通过id删除装车卸载平均时间")
    @SysLog("通过id删除装车卸载平均时间" )
    @DeleteMapping("/{id}" )
    @PreAuthorize("@pms.hasPermission('processing_loadunloadavgtime_del')" )
    public R removeById(@PathVariable Integer id) {
        return R.ok(loadUnloadAvgTimeService.removeById(id));
    }
 
 
    /**
     * 导出excel 表格
     * @param loadUnloadAvgTime 查询条件
     * @return excel 文件流
     */
    @ResponseExcel
    @GetMapping("/export")
    @PreAuthorize("@pms.hasPermission('processing_loadunloadavgtime_export')" )
    public List<LoadUnloadAvgTime> export(LoadUnloadAvgTime loadUnloadAvgTime) {
        return loadUnloadAvgTimeService.list(Wrappers.query(loadUnloadAvgTime));
    }
}