From c247f5bf64c98595cc7e4efc9e1ae7ff1df79c11 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期四, 23 四月 2026 14:05:32 +0800
Subject: [PATCH] refactor(swagger): 迁移Swagger注解到OpenAPI 3.0

---
 src/main/java/com/ruoyi/measuringinstrumentledger/service/impl/MeasuringInstrumentLedgerRecordServiceImpl.java |   48 +++++++-----------------------------------------
 1 files changed, 7 insertions(+), 41 deletions(-)

diff --git a/src/main/java/com/ruoyi/measuringinstrumentledger/service/impl/MeasuringInstrumentLedgerRecordServiceImpl.java b/src/main/java/com/ruoyi/measuringinstrumentledger/service/impl/MeasuringInstrumentLedgerRecordServiceImpl.java
index 840a15a..b178d75 100644
--- a/src/main/java/com/ruoyi/measuringinstrumentledger/service/impl/MeasuringInstrumentLedgerRecordServiceImpl.java
+++ b/src/main/java/com/ruoyi/measuringinstrumentledger/service/impl/MeasuringInstrumentLedgerRecordServiceImpl.java
@@ -4,14 +4,9 @@
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.ruoyi.basic.dto.StorageBlobDTO;
-import com.ruoyi.basic.pojo.StorageAttachment;
-import com.ruoyi.basic.service.StorageAttachmentService;
 import com.ruoyi.common.enums.FileNameType;
-import com.ruoyi.common.enums.StorageAttachmentRecordType;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
-import com.ruoyi.measuringinstrumentledger.dto.MeasuringInstrumentLedgerRecordDTO;
 import com.ruoyi.measuringinstrumentledger.mapper.MeasuringInstrumentLedgerMapper;
 import com.ruoyi.measuringinstrumentledger.mapper.MeasuringInstrumentLedgerRecordMapper;
 import com.ruoyi.measuringinstrumentledger.pojo.MeasuringInstrumentLedger;
@@ -21,14 +16,13 @@
 import com.ruoyi.other.pojo.TempFile;
 import com.ruoyi.sales.mapper.CommonFileMapper;
 import com.ruoyi.sales.pojo.CommonFile;
+import jakarta.servlet.http.HttpServletResponse;
+import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.io.FilenameUtils;
-import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
-import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
@@ -39,11 +33,7 @@
 import java.time.format.DateTimeFormatter;
 import java.util.Date;
 import java.util.List;
-import java.util.Objects;
 import java.util.UUID;
-import java.util.stream.Collectors;
-
-import static com.ruoyi.common.constant.StorageAttachmentConstants.StorageAttachmentFile;
 
 /**
  * @author :yys
@@ -51,22 +41,13 @@
  */
 @Service
 @Slf4j
+@RequiredArgsConstructor
 public class MeasuringInstrumentLedgerRecordServiceImpl extends ServiceImpl<MeasuringInstrumentLedgerRecordMapper, MeasuringInstrumentLedgerRecord> implements MeasuringInstrumentLedgerRecordService {
 
-    @Autowired
-    private MeasuringInstrumentLedgerRecordMapper measuringInstrumentLedgerRecordMapper;
-
-    @Autowired
-    private MeasuringInstrumentLedgerMapper measuringInstrumentLedgerMapper;
-
-    @Autowired
-    private CommonFileMapper commonFileMapper;
-
-    @Autowired
-    private TempFileMapper tempFileMapper;
-
-    @Autowired
-    private StorageAttachmentService storageAttachmentService;
+    private final MeasuringInstrumentLedgerRecordMapper measuringInstrumentLedgerRecordMapper;
+    private final MeasuringInstrumentLedgerMapper measuringInstrumentLedgerMapper;
+    private final CommonFileMapper commonFileMapper;
+    private final TempFileMapper tempFileMapper;
 
     @Value("${file.upload-dir}")
     private String uploadDir;
@@ -185,20 +166,5 @@
                 throw new IOException("鏂囦欢杩佺Щ寮傚父", e);
             }
         }
-    }
-
-    @Override
-    public MeasuringInstrumentLedgerRecordDTO getById(Long id) {
-        MeasuringInstrumentLedgerRecord measuringInstrumentLedgerRecord = measuringInstrumentLedgerRecordMapper.selectById(id);
-        List<StorageAttachment> storageAttachments = storageAttachmentService.selectStorageAttachments(measuringInstrumentLedgerRecord.getId(), StorageAttachmentRecordType.MeasuringInstrumentLedgerRecord, StorageAttachmentFile);
-        List<StorageBlobDTO> storageBlobDTOList =
-                storageAttachments.stream()
-                        .map(StorageAttachment::getStorageBlobDTO)
-                        .filter(Objects::nonNull)
-                        .collect(Collectors.toList());
-        MeasuringInstrumentLedgerRecordDTO measuringInstrumentLedgerRecordDTO = new MeasuringInstrumentLedgerRecordDTO();
-        BeanUtils.copyProperties(measuringInstrumentLedgerRecord, measuringInstrumentLedgerRecordDTO);
-        measuringInstrumentLedgerRecordDTO.setBlobs(storageBlobDTOList);
-        return measuringInstrumentLedgerRecordDTO;
     }
 }

--
Gitblit v1.9.3