From e8e73529983bf656d8aa6627215045f56cc27103 Mon Sep 17 00:00:00 2001 From: zhuo <2089219845@qq.com> Date: 星期一, 24 二月 2025 11:01:00 +0800 Subject: [PATCH] Merge branch 'dev' into dev_ly --- cnas-device/src/main/java/com/ruoyi/device/controller/DeviceAcceptanceController.java | 133 ++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 133 insertions(+), 0 deletions(-) diff --git a/cnas-device/src/main/java/com/ruoyi/device/controller/DeviceAcceptanceController.java b/cnas-device/src/main/java/com/ruoyi/device/controller/DeviceAcceptanceController.java new file mode 100644 index 0000000..d77575d --- /dev/null +++ b/cnas-device/src/main/java/com/ruoyi/device/controller/DeviceAcceptanceController.java @@ -0,0 +1,133 @@ +package com.ruoyi.device.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.common.core.domain.Result; +import com.ruoyi.device.pojo.DeviceAcceptance; +import com.ruoyi.device.pojo.DeviceAcceptanceFile; +import com.ruoyi.device.service.DeviceAcceptanceFileService; +import com.ruoyi.device.service.DeviceAcceptanceService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + +/** + * <p> + * 璁惧楠屾敹(瑁呭) 鍓嶇鎺у埗鍣� + * </p> + * + * @author 姹熻嫃榈烽洀缃戠粶绉戞妧鏈夐檺鍏徃 + * @since 2024-12-20 01:45:14 + */ +@Api(tags = "璁惧楠屾敹(瑁呭)") +@AllArgsConstructor +@RestController +@RequestMapping("/deviceAcceptance") +public class DeviceAcceptanceController { + + private DeviceAcceptanceService deviceAcceptanceService; + private DeviceAcceptanceFileService deviceAcceptanceFileService; + + /** + * 璁惧楠屾敹鍒楄〃 + * @return + */ + @ApiOperation(value = "璁惧楠屾敹鍒楄〃") + @GetMapping("/pageDeviceAcceptance") + public Result<IPage<DeviceAcceptance>> pageDeviceAcceptance(Page page, DeviceAcceptance deviceAcceptance) { + return Result.success(deviceAcceptanceService.pageDeviceAcceptance(page, deviceAcceptance)); + } + + /** + * 鏌ヨ璁惧楠屾敹 + * @return + */ + @ApiOperation(value = "鏌ヨ璁惧楠屾敹") + @GetMapping("/getDeviceAcceptance") + public Result getDeviceAcceptance(Integer acceptanceId){ + return Result.success(deviceAcceptanceService.getById(acceptanceId)); + } + + /** + * 鍒犻櫎璁惧楠屾敹 + * @return + */ + @ApiOperation(value = "鍒犻櫎璁惧楠屾敹") + @DeleteMapping("/delDeviceAcceptance") + public Result delDeviceAcceptance(Integer acceptanceId){ + return Result.success(deviceAcceptanceService.removeById(acceptanceId)); + } + + /** + * 鏂板璁惧楠屾敹 + * @return + */ + @ApiOperation(value = "鏂板璁惧楠屾敹") + @PostMapping("/addDeviceAcceptance") + public Result addDeviceAcceptance(@RequestBody DeviceAcceptance deviceAcceptance){ + return Result.success(deviceAcceptanceService.save(deviceAcceptance)); + } + + /** + * 鏂板璁惧楠屾敹 + * @return + */ + @ApiOperation(value = "缂栬緫璁惧楠屾敹") + @PostMapping("/updateDeviceAcceptance") + public Result updateDeviceAcceptance(@RequestBody DeviceAcceptance deviceAcceptance){ + return Result.success(deviceAcceptanceService.updateById(deviceAcceptance)); + } + + /** + * 璁惧楠屾敹瀵煎嚭 + * @param acceptanceId 璁惧楠屾敹id + * @param response 鍝嶅簲浣� + * @return + */ + @ApiOperation(value = "璁惧楠屾敹瀵煎嚭") + @GetMapping("/exportDeviceAcceptance") + public void exportDeviceAcceptance(Integer acceptanceId, HttpServletResponse response){ + deviceAcceptanceService.exportDeviceAcceptance(acceptanceId, response); + } + + /** + * 璁惧楠屾敹闄勪欢鏂板 + * @param acceptanceId + * @param file + * @return + */ + @ApiOperation(value = "璁惧楠屾敹闄勪欢鏂板") + @PostMapping("/uploadDeviceAcceptanceFile") + public Result<?> uploadDeviceAcceptanceFile(Integer acceptanceId, MultipartFile file) { + return Result.success(deviceAcceptanceService.uploadDeviceAcceptanceFile(acceptanceId, file)); + } + + + /** + * 璁惧楠屾敹闄勪欢鍒楄〃 + * @return + */ + @ApiOperation(value = "璁惧楠屾敹闄勪欢鍒楄〃") + @GetMapping("/getDeviceAcceptanceFileList") + public Result<List<DeviceAcceptanceFile>> getVerifyMethodFileList(Integer acceptanceId){ + return Result.success(deviceAcceptanceFileService.list(Wrappers.<DeviceAcceptanceFile>lambdaQuery() + .eq(DeviceAcceptanceFile::getAcceptanceId, acceptanceId))); + } + + /** + * 璁惧楠屾敹闄勪欢鍒犻櫎 + * @return + */ + @ApiOperation(value = "璁惧楠屾敹闄勪欢鍒犻櫎") + @GetMapping("/delDeviceAcceptanceFileList") + public Result delDeviceAcceptanceFileList(Integer acceptanceFileId){ + return Result.success(deviceAcceptanceFileService.removeById(acceptanceFileId)); + } +} -- Gitblit v1.9.3