zhuo
2025-02-24 e8e73529983bf656d8aa6627215045f56cc27103
cnas-device/src/main/java/com/ruoyi/device/controller/DeviceScrappedController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,82 @@
package com.ruoyi.device.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.domain.Result;
import com.ruoyi.device.pojo.DeviceScrapped;
import com.ruoyi.device.service.DeviceScrappedService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;
/**
 * <p>
 * è®¾å¤‡æŠ¥åºŸç”³è¯·è¡¨ å‰ç«¯æŽ§åˆ¶å™¨
 * </p>
 *
 * @author æ±Ÿè‹éµ·é›ç½‘络科技有限公司
 * @since 2024-12-17 01:53:47
 */
@Api(tags = "设备报废申请表")
@AllArgsConstructor
@RestController
@RequestMapping("/deviceScrapped")
public class DeviceScrappedController {
    private DeviceScrappedService deviceScrappedService;
    /**
     * è®¾å¤‡æŠ¥åºŸç”³è¯·åˆ—表
     * @return
     */
    @ApiOperation(value = "设备报废申请列表")
    @GetMapping("/pageDeviceScrapped")
    public Result<IPage<DeviceScrapped>> pageDeviceScrapped(Page page, DeviceScrapped deviceScrapped) {
        return Result.success(deviceScrappedService.pageDeviceScrapped(page, deviceScrapped));
    }
    /**
     * æŸ¥è¯¢è®¾å¤‡æŠ¥åºŸç”³è¯·
     * @return
     */
    @ApiOperation(value = "查询设备报废申请")
    @GetMapping("/getDeviceScrapped")
    public Result getDeviceScrapped(Integer scrappedId){
        return Result.success(deviceScrappedService.getById(scrappedId));
    }
    /**
     * åˆ é™¤è®¾å¤‡æ ¸æŸ¥è®¡åˆ’详情
     * @return
     */
    @ApiOperation(value = "删除设备报废申请")
    @DeleteMapping("/delDeviceScrapped")
    public Result delDeviceScrapped(Integer scrappedId){
        return Result.success(deviceScrappedService.removeById(scrappedId));
    }
    /**
     * æ–°å¢žè®¾å¤‡æŠ¥åºŸç”³è¯·
     * @return
     */
    @ApiOperation(value = "新增设备报废申请")
    @PostMapping("/addDeviceScrapped")
    public Result addDeviceScrapped(@RequestBody DeviceScrapped deviceScrapped){
        return Result.success(deviceScrappedService.addDeviceScrapped(deviceScrapped));
    }
    /**
     * å¯¼å‡ºè®¾å¤‡æŠ¥åºŸç”³è¯·
     */
    @ApiOperation("导出设备报废申请")
    @GetMapping("/exportDeviceScrapped")
    public Result exportDeviceScrapped(Integer scrappedId, HttpServletResponse response) {
        return deviceScrappedService.exportDeviceScrapped(scrappedId, response);
    }
}