| | |
| | | package com.ard.inspection.service.impl; |
| | | |
| | | import com.ard.common.core.domain.AjaxResult; |
| | | import com.ard.common.utils.uuid.IdUtils; |
| | | import com.ard.inspection.domain.ArdPointCloud; |
| | | import com.ard.inspection.domain.UploadFileEntity; |
| | | import com.ard.inspection.service.IArdPointCloudService; |
| | |
| | | import com.ard.inspection.utils.ZipFileUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | |
| | | @Slf4j |
| | | public class BigFileUploadServiceImpl implements IBigFileUploadService { |
| | | |
| | | public static final String CLOUD_FILE_PATH = "http://192.168.1.3:6100"; |
| | | @Value(value = "${pointCloud.url}") |
| | | private String cloudUrl; |
| | | |
| | | @Value(value = "${pointCloud.type}") |
| | | private String cloudType; |
| | | |
| | | @Autowired |
| | | private IArdPointCloudService ardPointCloudService; |
| | |
| | | ardPointCloud.setFileSize(formatFileSize(file.getSize())); |
| | | int dotIndex = originalFilename.lastIndexOf('.'); |
| | | String folderName = (dotIndex > 0) ? originalFilename.substring(0, dotIndex) : originalFilename; |
| | | ardPointCloud.setFolderName(folderName); |
| | | String zipP = CLOUD_FILE_PATH + zipPath + "/" + folderName + "/tileset.json"; |
| | | String zipP = cloudUrl + folderName + cloudType; |
| | | ardPointCloud.setFilePath(zipP); |
| | | ardPointCloud.setFolderName(folderName); |
| | | return AjaxResult.success("文件上传并解压成功", ardPointCloud); |
| | | } catch (IOException e) { |
| | | log.error("解压文件失败", e); |