liyong
5 小时以前 1ca5584d7e3200a9af65a099bd26d3593e2ba702
src/main/java/com/ruoyi/inspectiontask/service/impl/QrCodeScanRecordServiceImpl.java
@@ -5,11 +5,16 @@
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
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.dto.StorageBlobVO;
import com.ruoyi.basic.enums.ApplicationTypeEnum;
import com.ruoyi.basic.enums.RecordTypeEnum;
import com.ruoyi.basic.mapper.StorageAttachmentMapper;
import com.ruoyi.basic.mapper.StorageBlobMapper;
import com.ruoyi.basic.pojo.StorageAttachment;
import com.ruoyi.basic.pojo.StorageBlob;
import com.ruoyi.basic.service.StorageAttachmentService;
import com.ruoyi.basic.utils.FileUtil;
import com.ruoyi.common.utils.bean.BeanUtils;
import com.ruoyi.inspectiontask.dto.QrCodeScanRecordDto;
import com.ruoyi.inspectiontask.mapper.QrCodeMapper;
@@ -51,6 +56,8 @@
    private final SysUserMapper sysUserMapper;
    private final FileUtil fileUtil;
    @Override
    public IPage<QrCodeScanRecordDto> selectQrCodeScanRecordList(Page<QrCodeScanRecord> page, QrCodeScanRecordDto qrCodeScanRecordDto) {
@@ -159,19 +166,15 @@
        }
        if (qrCodeScanRecordDto.getStorageBlobVO() != null && !qrCodeScanRecordDto.getStorageBlobVO().isEmpty()) {
            List<StorageAttachment> attachments = new ArrayList<>();
            // vo 转 dto
            List<StorageBlobDTO> storageBlobDTOs = new ArrayList<>();
            for (StorageBlobVO storageBlobVO : qrCodeScanRecordDto.getStorageBlobVO()) {
                StorageBlobDTO storageBlobDTO = new StorageBlobDTO();
                BeanUtils.copyProperties(storageBlobVO, storageBlobDTO);
                storageBlobDTOs.add(storageBlobDTO);
            }
            // todo fileChange
//            for (StorageBlobDTO storageBlobDTO : qrCodeScanRecordDto.getStorageBlobDTO()) {
//                StorageAttachment storageAttachment = new StorageAttachment(
//                        StorageAttachmentFile,
//                        (long) QrCodeScanRecords.ordinal(),
//                        qrCodeScanRecord.getId()
//                );
//                storageAttachment.setStorageBlobDTO(storageBlobDTO);
//                attachments.add(storageAttachment);
//            }
            storageAttachmentService.saveStorageAttachment(attachments, qrCodeScanRecord.getId(), QrCodeScanRecords, StorageAttachmentFile);
            fileUtil.saveStorageAttachment(ApplicationTypeEnum.FILE, RecordTypeEnum.QR_CODE_SCAN_RECORDS, qrCodeScanRecord.getId(), storageBlobDTOs);
        }
        return i;
    }
@@ -181,4 +184,4 @@
        return qrCodeScanRecordMapper.deleteBatchIds(Arrays.asList(ids));
    }
}
}