cnas-device/src/main/java/com/ruoyi/device/controller/DeviceMaintenancePlanController.java
@@ -5,6 +5,7 @@
import com.ruoyi.common.core.domain.Result;
import com.ruoyi.device.dto.DeviceMaintenancePlanDetailsDto;
import com.ruoyi.device.dto.DeviceMaintenancePlanDto;
import com.ruoyi.device.pojo.DeviceMaintenanceAttachment;
import com.ruoyi.device.pojo.DeviceMaintenancePlan;
import com.ruoyi.device.pojo.DeviceMaintenancePlanDetails;
import com.ruoyi.device.service.DeviceMaintenancePlanService;
@@ -12,6 +13,7 @@
import io.swagger.v3.oas.annotations.Operation;
import lombok.SneakyThrows;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletResponse;
@@ -132,7 +134,8 @@
     */
    @Operation(summary = "导出设备保养计划")
    @GetMapping("/exportDeviceMaintenancePlan")
    public Result exportDeviceMaintenancePlan(@RequestParam("maintenancePlanId") Integer maintenancePlanId, HttpServletResponse response) {
    public Result exportDeviceMaintenancePlan(@RequestParam("maintenancePlanId") Integer maintenancePlanId,
                                              HttpServletResponse response) {
        return deviceMaintenancePlanService.exportDeviceMaintenancePlanDto(maintenancePlanId, response);
    }
@@ -153,4 +156,32 @@
    public Result reviewMaintenancePlanStatus(@RequestBody DeviceMaintenancePlanDto deviceMaintenancePlanDto) {
        return deviceMaintenancePlanService.reviewMaintenancePlanStatus(deviceMaintenancePlanDto);
    }
    /**
     * 查询保养计划明细附件
     */
    @Operation(summary = "查询保养计划明细附件")
    @GetMapping("/selectAttachments")
    public Result<List<DeviceMaintenanceAttachment>> selectAttachments(Integer maintenancePlanDetailId) {
        return Result.success(deviceMaintenancePlanService.selectAttachments(maintenancePlanDetailId));
    }
    /**
     * 上传保养计划明细附件
     */
    @Operation(summary = "上传保养计划明细附件")
    @PostMapping("/uploadAttachment")
    public Result uploadAttachment(@RequestParam("maintenancePlanDetailId") Integer maintenancePlanDetailId,
                                   @RequestParam("file") MultipartFile file) {
        return Result.success(deviceMaintenancePlanService.uploadAttachment(maintenancePlanDetailId, file));
    }
    /**
     * 删除保养计划明细附件
     */
    @Operation(summary = "删除保养计划明细附件")
    @DeleteMapping("/deleteAttachment")
    public Result deleteAttachment(Long id) {
        return Result.success(deviceMaintenancePlanService.deleteAttachment(id));
    }
}