|
@@ -2,17 +2,23 @@ package com.fdkankan.contro.service.impl;
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.io.FileUtil;
|
|
|
+import cn.hutool.core.lang.UUID;
|
|
|
+import cn.hutool.core.util.ZipUtil;
|
|
|
+import cn.hutool.http.HttpUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.fdkankan.common.constant.ErrorCode;
|
|
|
import com.fdkankan.common.exception.BusinessException;
|
|
|
+import com.fdkankan.contro.bean.SendCallAlgorithmDetail;
|
|
|
import com.fdkankan.contro.entity.OrigFileUpload;
|
|
|
import com.fdkankan.contro.entity.OrigFileUploadBatch;
|
|
|
import com.fdkankan.contro.service.IJmgaService;
|
|
|
import com.fdkankan.contro.service.IOrigFileUploadBatchService;
|
|
|
import com.fdkankan.contro.service.IOrigFileUploadService;
|
|
|
+import com.fdkankan.contro.vo.SendCallAlgorithmParam;
|
|
|
+import com.fdkankan.contro.vo.UploadSceneOrigParamVo;
|
|
|
import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
|
import com.fdkankan.rabbitmq.util.RabbitMqProducer;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -40,6 +46,8 @@ public class JmgaServiceImpl implements IJmgaService {
|
|
|
private FYunFileServiceInterface fileServiceInterface;
|
|
|
@Resource
|
|
|
private RabbitMqProducer mqProducer;
|
|
|
+ @Resource
|
|
|
+ private FYunFileServiceInterface fYunFileService;
|
|
|
|
|
|
@Override
|
|
|
public void checkFileWhole(String uuid, String dataSource, JSONObject fdageData) {
|
|
@@ -181,4 +189,41 @@ public class JmgaServiceImpl implements IJmgaService {
|
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_4001.code(), ErrorCode.FAILURE_CODE_4001.formatMessage(fileName));
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void uploadSceneOrig(UploadSceneOrigParamVo param) {
|
|
|
+ String uuid = UUID.randomUUID().toString();
|
|
|
+// String zipName = FileUtil.getName(param.getFilePath());
|
|
|
+ String zipName = uuid + ".zip";
|
|
|
+ String zipDir = "/oss/4dkankan/bd_server/";
|
|
|
+ fYunFileService.downloadFileByCommand(zipDir + zipName, param.getFilePath());
|
|
|
+
|
|
|
+ //解压缩
|
|
|
+ ZipUtil.unzip(new File(zipDir + zipName), new File(zipDir));
|
|
|
+
|
|
|
+// this.noticeBuildBd();
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void noticeBuildBd(String ossHost, String uuid, String dir) {
|
|
|
+ String prefix = "http://" + ossHost + "/";
|
|
|
+ String path = "/oss/4dkankan/bd_server/" + dir;
|
|
|
+ List<File> files = FileUtil.loopFiles(path).stream().filter(file -> !file.getAbsolutePath().contains("backup")).collect(Collectors.toList());
|
|
|
+ files.parallelStream().forEach(file ->{
|
|
|
+ String url = prefix.concat(file.getAbsolutePath().substring(1).replace("/4dkankan",""));
|
|
|
+ SendCallAlgorithmDetail detail = new SendCallAlgorithmDetail();
|
|
|
+ detail.setFileName(FileUtil.getName(file.getAbsolutePath()));
|
|
|
+ detail.setUuid(uuid);
|
|
|
+ SendCallAlgorithmParam param = new SendCallAlgorithmParam();
|
|
|
+ param.setFilepath(url);
|
|
|
+ param.setDetails(detail);
|
|
|
+ HttpUtil.post("http://127.0.0.1:8085/api/scene/file/sendCallAlgorithm", JSON.toJSONString(param));
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|