|
|
@@ -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();
|