|
|
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));
|
}
|
}
|