lyhzzz 4 hónapja
szülő
commit
5c434f1a4f

+ 10 - 0
README.md

@@ -64,3 +64,13 @@ fusion:
 ~~~~
 
 
+https://laser.4dkankan.com/index.html?m=SG-CJ547YGxCYH         500
+https://laser.4dkankan.com/index.html?m=SG-75nRZiIrYIV         500
+https://laser.4dkankan.com/index.html?m=SG-cNDMrkU0vDo         500
+https://laser.4dkankan.com/index.html?m=SG-6AYoZZRDwAw         500
+https://laser.4dkankan.com/index.html?m=SG-YoN7RlpqQAd         499
+https://laser.4dkankan.com/index.html?m=SG-iDICgdZUQI2         481
+https://laser.4dkankan.com/index.html?m=SG-ifnhJX2GpD7         478
+https://laser.4dkankan.com/index.html?m=SG-kLepj733iWe         466
+https://laser.4dkankan.com/index.html?m=SG-JsdZBnlGFVw         460
+https://laser.4dkankan.com/index.html?m=SG-gG1YsKujBfN         442

+ 1 - 0
src/main/java/com/fdkankan/fusion/controller/DictFileController.java

@@ -26,6 +26,7 @@ public class DictFileController extends BaseController{
     @PostMapping("/pageList/{typeKey}")
     public ResultData pageList(@RequestBody DictFileParam param, @PathVariable String typeKey){
         param.setTypeKey(typeKey);
+        param.setSysUserId(getUserId());
         return ResultData.ok(dictFileService.pageList(param));
     }
 

+ 2 - 3
src/main/java/com/fdkankan/fusion/controller/UploadController.java

@@ -19,7 +19,7 @@ import java.util.UUID;
 
 @RestController
 @RequestMapping("/upload")
-public class UploadController {
+public class UploadController extends BaseController {
 
     @Autowired
     UploadService uploadService;
@@ -41,7 +41,6 @@ public class UploadController {
     @RequestMapping(value = "/fileNew", method = RequestMethod.POST)
     public ResultData uploadNew(@RequestParam(required = false) MultipartFile file,
             @RequestParam(value = "dictId",required = false) Integer dictId) {
-
-        return commonUploadService.uploadFileNew(dictId,file);
+        return commonUploadService.uploadFileNew(dictId,file, getUserId());
     }
 }

+ 1 - 1
src/main/java/com/fdkankan/fusion/entity/DictFile.java

@@ -45,7 +45,7 @@ public class DictFile implements Serializable {
     private Date updateTime;
 
     @TableField("sys_user_id")
-    private Integer sysUserId;
+    private Long sysUserId;
 
     @TableField("upload_id")
     private Integer uploadId;

+ 5 - 4
src/main/java/com/fdkankan/fusion/mq/consumer/OsgbToB3dmConsumer.java

@@ -7,6 +7,7 @@ import com.fdkankan.fusion.common.OssPath;
 import com.fdkankan.fusion.common.ResultCode;
 import com.fdkankan.fusion.common.util.*;
 import com.fdkankan.fusion.config.CacheUtil;
+import com.fdkankan.fusion.config.FusionConfig;
 import com.fdkankan.fusion.entity.CommonUpload;
 import com.fdkankan.fusion.exception.BusinessException;
 import com.fdkankan.fusion.service.ICommonUploadService;
@@ -41,8 +42,8 @@ public class OsgbToB3dmConsumer {
 
     @Autowired
     ICommonUploadService commonUploadService;
-    @Value("${upload.query-path}")
-    private String ossUrlPrefix;
+    @Autowired
+    FusionConfig fusionConfig;
     @RabbitListener(
             queuesToDeclare = @Queue("${queue.model.osgbToB3dm:queue-model-osgbToB3dm}")
             ,concurrency = "1"
@@ -71,7 +72,7 @@ public class OsgbToB3dmConsumer {
             commonUploadService.updateStatus(uploadId,0);
             ///mnt/manage/media-library/result/ea041f3237df46568f4e83e723e743d4
             String dir = String.format(OssPath.MANAGE_MODEL_FILE_PATH ,UUID.randomUUID().toString().replace("-",""));
-            sourcePath = OssPath.localPath +File.separator+ dir;
+            sourcePath = OssPath.localPath + dir;
 
             OBJToGLBUtil.OsgbToB3dm(localPath,sourcePath);
             String b3dmJsonPath =  FileWriterUtil.checkB3dmTileset(new File(sourcePath));
@@ -81,7 +82,7 @@ public class OsgbToB3dmConsumer {
             }
             String ossPath = sourcePath.replace("/mnt/","");
             ShellUtil.yunUpload(sourcePath,ossPath);
-            String url = ossUrlPrefix + b3dmJsonPath.replace("/mnt/","");
+            String url = fusionConfig.getOssUrlPrefix() + b3dmJsonPath.replace("/mnt/","");
             HashMap<String,String> resultMap = ReadXmlUtil.getLatMap(file);
             if(resultMap != null && !resultMap.isEmpty()){
                 commonUploadService.updateByPath(uploadId,url,resultMap.get("wgs84"),resultMap.get("gcj02"));

+ 2 - 2
src/main/java/com/fdkankan/fusion/service/ICommonUploadService.java

@@ -18,9 +18,9 @@ import java.util.List;
  */
 public interface ICommonUploadService extends IService<CommonUpload> {
 
-    ResultData uploadFileNew( Integer dictId,MultipartFile file);
+    ResultData uploadFileNew( Integer dictId,MultipartFile file,Long userId);
 
-    CommonUpload add(String replace, String url, String s, String uuid, FileTypeEnum fileTypeEnum,String resultFormat, String replace1, Integer status, String unzipPath, Integer dictId);
+    CommonUpload add(String replace, String url, String s, String uuid, FileTypeEnum fileTypeEnum,String resultFormat, String replace1, Integer status, String unzipPath, Integer dictId,Long userId);
 
     void updateStatus(Integer localPath, Integer i);
 

+ 7 - 6
src/main/java/com/fdkankan/fusion/service/impl/CommonUploadServiceImpl.java

@@ -59,7 +59,7 @@ public class CommonUploadServiceImpl extends ServiceImpl<ICommonUploadMapper, Co
     @Autowired
     RabbitMqProducer rabbitMqProducer;
     @Override
-    public ResultData uploadFileNew( Integer dictId,MultipartFile file) {
+    public ResultData uploadFileNew( Integer dictId,MultipartFile file,Long userId) {
         if( file.isEmpty() ){
             throw new BusinessException(ResultCode.UPLOAD_ERROR);
         }
@@ -77,7 +77,7 @@ public class CommonUploadServiceImpl extends ServiceImpl<ICommonUploadMapper, Co
             }
             file.transferTo(tempFile);
             if(extName.equals(".zip")){
-                return uploadModelZip(name.replace(extName, ""),tempFile,dictId);
+                return uploadModelZip(name.replace(extName, ""),tempFile,dictId,userId);
             }
             fYunFileServiceInterface.uploadFile(tempFile.getPath(), ossPath);
             //String url = this.ossUrlPrefix + ossPath;
@@ -88,7 +88,7 @@ public class CommonUploadServiceImpl extends ServiceImpl<ICommonUploadMapper, Co
                 throw new BusinessException(ResultCode.FILE_TYPE_ERROR2);
             }
             String format = extName.replace(".", "");
-            CommonUpload commonUpload = commonUploadService.add(name.replace(extName, ""), url, String.valueOf(file.getSize()), uuid, fileTypeEnum, format,format,1,null,dictId);
+            CommonUpload commonUpload = commonUploadService.add(name.replace(extName, ""), url, String.valueOf(file.getSize()), uuid, fileTypeEnum, format,format,1,null,dictId,userId);
             return ResultData.ok(commonUpload);
         }catch ( BusinessException e){
             log.info("upload-file-error:{}",e);
@@ -99,7 +99,7 @@ public class CommonUploadServiceImpl extends ServiceImpl<ICommonUploadMapper, Co
         }
     }
 
-    private ResultData uploadModelZip(String oldName,File file,Integer dictId) {
+    private ResultData uploadModelZip(String oldName,File file,Integer dictId,Long userId) {
 
         String ossZipPath = String.format(OssPath.MANAGE_MODEL_FILE_PATH, UUID.randomUUID().toString().replace("-", ""));
         String unzipPath = OssPath.localPath + ossZipPath;
@@ -153,7 +153,7 @@ public class CommonUploadServiceImpl extends ServiceImpl<ICommonUploadMapper, Co
         Integer status = StringUtils.isNotBlank(url) ? 1: -1;
         url = StringUtils.isNotBlank(url) ? fusionConfig.getOssUrlPrefix() + url : null;
         CommonUpload commonUpload = commonUploadService.add(oldName,url, String.valueOf(getDirectorySize(unZipFile)),
-                null, fileTypeEnum, modelFileFormat,resultFormat,status,unZipFile.getPath(),dictId);
+                null, fileTypeEnum, modelFileFormat,resultFormat,status,unZipFile.getPath(),dictId,userId);
         if("osgb".equals(modelFileFormat)){
             uploadOsgb(commonUpload.getId()) ;
         }
@@ -232,7 +232,7 @@ public class CommonUploadServiceImpl extends ServiceImpl<ICommonUploadMapper, Co
 
 
     @Override
-    public CommonUpload add(String fileName, String url, String fileSize, String uuid, FileTypeEnum fileTypeEnum, String resultFormat,String replace1, Integer status, String unzipPath, Integer dictId) {
+    public CommonUpload add(String fileName, String url, String fileSize, String uuid, FileTypeEnum fileTypeEnum, String resultFormat,String replace1, Integer status, String unzipPath, Integer dictId,Long userId) {
         CommonUpload upload = new CommonUpload();
         upload.setFileName(fileName);
         upload.setFileUrl(url);
@@ -251,6 +251,7 @@ public class CommonUploadServiceImpl extends ServiceImpl<ICommonUploadMapper, Co
         dictFile.setTypeKey("media-library");
         dictFile.setUploadId(upload.getId());
         dictFile.setDictId(dictId);
+        dictFile.setSysUserId(userId);
         dictFileService.saveOrUpdate(dictFile);
 
         return upload;