lyhzzz 3 週間 前
コミット
3076b9131d

+ 3 - 3
src/main/java/com/fdkankan/manage/controller/SceneController.java

@@ -212,16 +212,16 @@ public class SceneController {
 
     @PostMapping("/uploadSceneCheck")
     public ResultData uploadSceneCheck(@RequestBody UploadSceneOrigParamVo paramVo){
-        if(StringUtils.isBlank(paramVo.getFilePath()) || !paramVo.getFilePath().contains(".zip")){
+        if(StringUtils.isBlank(paramVo.getFilePath()) || !paramVo.getFilePath().contains(".zip") || StringUtils.isBlank(paramVo.getSourceType())){
             throw new BusinessException(ResultCode.UPLOAD_FILE_OBJ_ERROR);
         }
         return ResultData.ok(fdkkService.uploadSceneCheck(paramVo));
     }
 
 
-    @PostMapping("/uploadSceneOrig")
+    @PostMapping("/uploadScene")
     public ResultData uploadSceneOrig(@RequestBody UploadSceneOrigParamVo paramVo){
-        if(StringUtils.isBlank(paramVo.getFilePath()) || !paramVo.getFilePath().contains(".zip")){
+        if(StringUtils.isBlank(paramVo.getFilePath()) || !paramVo.getFilePath().contains(".zip") || StringUtils.isBlank(paramVo.getSourceType())){
             throw new BusinessException(ResultCode.UPLOAD_FILE_OBJ_ERROR);
         }
         fdkkService.uploadSceneOrig(paramVo);

+ 9 - 0
src/main/java/com/fdkankan/manage/entity/ScenePlus.java

@@ -124,4 +124,13 @@ public class ScenePlus implements Serializable {
 
     @TableField("k_no")
     private String kNo;
+
+    @TableField("push_address")
+    private String pushAddress;
+
+    @TableField("district_code")
+    private String districtCode;
+
+    @TableField("district_name")
+    private String districtName;
 }

+ 1 - 1
src/main/java/com/fdkankan/manage/httpClient/client/FdKKClient.java

@@ -25,6 +25,6 @@ public interface FdKKClient {
     @Post("/fusion/case/addScene")
     ResultData addScene(@JSONBody CaseParam caseParam, @Header("token") String token);
 
-    @Post(value = "/api/scene/file/jmga/uploadSceneOrig",readTimeout = 10* 60* 1000,connectTimeout = 10* 60* 1000)
+    @Post(value = "/api/scene/file/jmga/uploadScene",readTimeout = 10* 60* 1000,connectTimeout = 10* 60* 1000)
     ResultData uploadSceneOrig(@JSONBody UploadSceneOrigParamVo param, @Header("token") String token);
 }

+ 19 - 0
src/main/java/com/fdkankan/manage/httpClient/client/OtherClient.java

@@ -0,0 +1,19 @@
+package com.fdkankan.manage.httpClient.client;
+
+import com.dtflys.forest.annotation.Get;
+import com.dtflys.forest.annotation.JSONBody;
+import com.dtflys.forest.annotation.Post;
+import com.dtflys.forest.annotation.Var;
+
+import java.util.Map;
+
+public interface OtherClient {
+
+    @Post("{url}")
+    String postJson(@Var("url") String url,@JSONBody Map<String,Object> param);
+
+    @Get("{url}")
+    String get(@Var("url") String url);
+
+
+}

+ 2 - 0
src/main/java/com/fdkankan/manage/httpClient/param/UploadSceneOrigParamVo.java

@@ -6,4 +6,6 @@ import lombok.Data;
 public class UploadSceneOrigParamVo {
     private String filePath;
     private Long userId;
+    //资源包类型 orig-原始数据  offline 离线包
+    private String sourceType;
 }

+ 14 - 18
src/main/java/com/fdkankan/manage/service/impl/DictFileServiceImpl.java

@@ -1,9 +1,11 @@
 package com.fdkankan.manage.service.impl;
 
 import cn.dev33.satoken.stp.StpUtil;
+import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.io.FileUtil;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson2.util.BeanUtils;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -17,6 +19,7 @@ import com.fdkankan.manage.constant.FileTypeEnum;
 import com.fdkankan.manage.entity.*;
 import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.manage.httpClient.client.HaixinClient;
+import com.fdkankan.manage.httpClient.client.OtherClient;
 import com.fdkankan.manage.httpClient.param.HaixinParam;
 import com.fdkankan.manage.mapper.IDictFileMapper;
 import com.fdkankan.manage.service.*;
@@ -173,6 +176,8 @@ public class DictFileServiceImpl extends ServiceImpl<IDictFileMapper, DictFile>
     ManageConfig manageConfig;
     @Autowired
     HaixinClient haixinClient;
+    @Autowired
+    OtherClient otherClient;
 
     @Override
     public void checkMediaLibrary(addMediaLibraryParam param) {
@@ -259,14 +264,21 @@ public class DictFileServiceImpl extends ServiceImpl<IDictFileMapper, DictFile>
         }
 
         if(param.getToHaixin() ==1){
+            String pushUrl = manageConfig.getHaixinApiBasePath();
             ScenePlus scenePlus = scenePlusService.getByNum(param.getNum());
             if(scenePlus == null){
                 return dictFile;
             }
+            if(StringUtils.isNotBlank(scenePlus.getPushAddress())){
+                pushUrl = scenePlus.getPushAddress();
+            }
             Case caseEntity = caseService.getByKno(scenePlus.getKNo());
             if(caseEntity == null){
                 return dictFile;
             }
+            if(StringUtils.isBlank(pushUrl)){
+                return dictFile;
+            }
             SubmitPhotoHaixinVo vo = new SubmitPhotoHaixinVo();
             vo.setKno(scenePlus.getKNo());
             vo.setCaseId(caseEntity.getCaseId().toString());
@@ -279,7 +291,8 @@ public class DictFileServiceImpl extends ServiceImpl<IDictFileMapper, DictFile>
             vo.setMd5(param.getFileMd5());
             vo.setCategory(param.getCategory());
             vo.setServerUrl(manageConfig.getServerUrl());
-            String jsonObject = haixinClient.submitPhoto(vo);
+           // String jsonObject = haixinClient.submitPhoto(vo);
+            String jsonObject = otherClient.postJson(pushUrl +"/ecs/api/panoramicImageService/submitPhoto", BeanUtil.beanToMap(vo));
             log.info("submitPhoto-tohaixin-result:{}",jsonObject);
 
         }
@@ -328,23 +341,6 @@ public class DictFileServiceImpl extends ServiceImpl<IDictFileMapper, DictFile>
                 }
                 EvidenceVo vo = new EvidenceVo(materialEvidenceName,leftPosition,feature,collectionModeName,collectedTime,collectedPerson.toString(),0,null);
 
-//                String localPath = OssPath.localPath + OssPath.MANAGE_MODEL_FILE_PATH;
-//                String uuid = UUID.randomUUID().toString().replace("-","");
-//                String extName = fileServerPath.substring(fileServerPath.lastIndexOf(".")).toLowerCase();
-//                String formart = extName.replace(".", "");
-//                localPath = String.format(localPath,uuid) + extName;
-//
-//                String cmd = String.format(CommandEnum.WGET_URL,localPath,manageConfig.getHaixinApiBasePath() + "/"+ fileServerPath);
-//                ShellUtil.execCmd(cmd);
-//                if(!new File(localPath).exists()){
-//                    log.info("wget-文件不存在");
-//                    continue;
-//                }
-//                Long fileSize = new File(localPath).length();
-//                String ossPath = String.format(OssPath.MANAGE_MODEL_FILE_PATH, uuid+ extName);
-//                fYunFileServiceInterface.uploadFile(localPath, ossPath);
-//                FileUtil.del(localPath);
-
                 DictFile dictFile = this.getByEvidenceNo(evidenceNo);
                 if(dictFile == null){
                     dictFile = new DictFile();