| | |
| | | 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; |
| | |
| | | import com.ruoyi.sales.pojo.CommonFile; |
| | | 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 org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | |
| | | 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 |
| | |
| | | |
| | | @Autowired |
| | | private TempFileMapper tempFileMapper; |
| | | |
| | | @Autowired |
| | | private StorageAttachmentService storageAttachmentService; |
| | | |
| | | @Value("${file.upload-dir}") |
| | | private String uploadDir; |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | @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; |
| | | } |
| | | } |