|
@@ -1,29 +1,31 @@
|
|
|
-package com.fdkankan.common.util;
|
|
|
+package com.fdkankan.model.utils;
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.io.FileUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
-import com.fdkankan.common.constant.ConstantFileName;
|
|
|
-import com.fdkankan.common.constant.ConstantFilePath;
|
|
|
import com.fdkankan.common.constant.ErrorCode;
|
|
|
-import com.fdkankan.common.constant.UploadFilePath;
|
|
|
import com.fdkankan.common.exception.BusinessException;
|
|
|
-import lombok.extern.slf4j.Slf4j;
|
|
|
-import org.springframework.stereotype.Component;
|
|
|
+import com.fdkankan.common.util.FileUtils;
|
|
|
+import com.fdkankan.model.constants.ConstantFileName;
|
|
|
+import com.fdkankan.model.constants.ConstantFilePath;
|
|
|
+import com.fdkankan.model.constants.UploadFilePath;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
|
|
|
import java.io.File;
|
|
|
-import java.util.*;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.UUID;
|
|
|
|
|
|
/**
|
|
|
* 生成场景和计算场景
|
|
|
* Created by Hb_zzZ on 2019/5/8.
|
|
|
*/
|
|
|
-@Slf4j
|
|
|
-@Component
|
|
|
public class ComputerUtil {
|
|
|
|
|
|
+ private static Logger log = LoggerFactory.getLogger(ComputerUtil.class.getName());
|
|
|
|
|
|
public static Map<String,String> computer(String projectNum, String path, String buildType) throws Exception{
|
|
|
|
|
@@ -410,176 +412,6 @@ public class ComputerUtil {
|
|
|
return map;
|
|
|
}
|
|
|
|
|
|
-// public static SceneEntity createScene(String projectNum, Long cameraId, String cameraName, String phoneId, String scenepsd,
|
|
|
-// String unicode, Long cameraType, String fileId, String prefix,
|
|
|
-// String imgsName, String pic, String isModel, Long userId, String userName,
|
|
|
-// String algorithm, Integer sceneShootCount, String sceneName,
|
|
|
-// String sceneDec, Integer sceneType, String gps, ISceneService sceneService,
|
|
|
-// Integer type, ModelingMsgProducer producer, String url, String ecsType,
|
|
|
-// RubberSheetingUtil rubberSheetingUtil)throws Exception{
|
|
|
-// //先返回链接地址
|
|
|
-// SceneEntity scene = new SceneEntity();
|
|
|
-// scene.setWebSite(url+projectNum);
|
|
|
-// scene.setCameraId(cameraId);
|
|
|
-// scene.setPhoneId(phoneId);
|
|
|
-// scene.setNum(String.valueOf(projectNum));
|
|
|
-// if(scenepsd == null)
|
|
|
-// {
|
|
|
-// scenepsd = "";
|
|
|
-// }
|
|
|
-// if(!scenepsd.equals(""))
|
|
|
-// {
|
|
|
-// scene.setSceneKey(scenepsd);
|
|
|
-// }
|
|
|
-//
|
|
|
-// if(!StringUtils.isEmpty(ecsType)){
|
|
|
-// scene.setEcs(ecsType);
|
|
|
-// }
|
|
|
-//
|
|
|
-// String path = ConstantFilePath.BUILD_MODEL_PATH + unicode;
|
|
|
-//
|
|
|
-// if(cameraType.longValue() >= 4){
|
|
|
-// scene.setDataSource(ConstantFilePath.BUILD_MODEL_PATH +
|
|
|
-// cameraName.replace("4DKKPRO_", "").replace("-fdage", "").toLowerCase() + File.separator + fileId + File.separator + unicode);
|
|
|
-// }else {
|
|
|
-// scene.setDataSource(prefix+imgsName);
|
|
|
-// }
|
|
|
-//
|
|
|
-// if(cameraType.longValue() == 14){
|
|
|
-//
|
|
|
-// scene.setDataSource(ConstantFilePath.BUILD_MODEL_LASER_PATH +
|
|
|
-// cameraName.replace("4DKKPRO_", "").replace("-fdage", "").toLowerCase() + File.separator +
|
|
|
-// fileId + File.separator + unicode);
|
|
|
-//
|
|
|
-// log.info("激光相机 dataSource :" + scene.getDataSource());
|
|
|
-//
|
|
|
-// }
|
|
|
-//
|
|
|
-//
|
|
|
-// if(pic!=null&&pic.length()>5)
|
|
|
-// {
|
|
|
-// scene.setThumb(pic);
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// scene.setThumb(ConstantUrl.DEFAULT_SCENE_PIC);
|
|
|
-// }
|
|
|
-//
|
|
|
-// String parametr = "";
|
|
|
-// parametr+=unicode+":;"+path+":;"+prefix+":;"+imgsName+":;"+projectNum+":;"+isModel;
|
|
|
-// if(userName!=null&&!userName.trim().equals(""))
|
|
|
-// {
|
|
|
-// parametr+=":;"+userName;
|
|
|
-// scene.setUserId(userId);
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// parametr+=":;noMan";
|
|
|
-// }
|
|
|
-// parametr+=":;"+cameraType;
|
|
|
-// parametr+=":;"+algorithm;
|
|
|
-// parametr += ":;" + fileId;
|
|
|
-// parametr += ":;" + cameraName;
|
|
|
-// parametr += ":;1";
|
|
|
-// log.info("大场景添加到队列:"+parametr);
|
|
|
-// producer.sendMsg(parametr);
|
|
|
-//
|
|
|
-// if(sceneShootCount == null)
|
|
|
-// {
|
|
|
-// scene.setShootCount(0);
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// scene.setShootCount(sceneShootCount);
|
|
|
-// }
|
|
|
-// if(sceneName!=null)
|
|
|
-// {
|
|
|
-// scene.setSceneName(sceneName);
|
|
|
-// }
|
|
|
-// if(sceneDec!=null)
|
|
|
-// {
|
|
|
-// scene.setSceneDec("<p>"+sceneDec+"</p>");
|
|
|
-// }
|
|
|
-//
|
|
|
-// if(sceneType!=null)
|
|
|
-// {
|
|
|
-// scene.setSceneType(sceneType);
|
|
|
-// }
|
|
|
-//
|
|
|
-// if(gps!=null&&!gps.trim().equals(""))
|
|
|
-// {
|
|
|
-// scene.setGps(gps);
|
|
|
-// }
|
|
|
-//
|
|
|
-// scene.setSceneScheme(cameraType.intValue());
|
|
|
-// scene.setAlgorithm(algorithm);
|
|
|
-// log.info("场景记录添加到数据库:"+projectNum);
|
|
|
-// if(type == 0){
|
|
|
-// sceneService.save(scene);
|
|
|
-// }
|
|
|
-//
|
|
|
-// JSONObject scenejson = JSONObject.parseObject(JSONObject.toJSONString(scene));
|
|
|
-// scenejson.put("thumbImg", 0);
|
|
|
-// scenejson.put("version", 0);
|
|
|
-// scenejson.put("floorLogo", 0);
|
|
|
-// if(!scenepsd.equals("")){
|
|
|
-// scenejson.put("scenePsd", scenepsd);
|
|
|
-// scenejson.put("public", 1);
|
|
|
-// }else{
|
|
|
-// scenejson.put("scenePsd", "");
|
|
|
-// scenejson.put("public", 0);
|
|
|
-// }
|
|
|
-// if(cameraType < 4){
|
|
|
-// scenejson.put("visions", 1);
|
|
|
-// }else {
|
|
|
-// scenejson.put("visions", 2);
|
|
|
-// }
|
|
|
-// scenejson.put("createTime", new DateTime(new Date()).toString("yyyy-MM-dd HH:mm"));
|
|
|
-//
|
|
|
-// File file = new File(ConstantFilePath.SCENE_PATH+"data/data"+projectNum);
|
|
|
-// if(!file.exists()||!file.isDirectory())
|
|
|
-// {
|
|
|
-// file.mkdirs();
|
|
|
-// }
|
|
|
-// FileUtils.writeFile(ConstantFilePath.SCENE_PATH+"data/data"+projectNum+File.separator+"scene.json", scenejson.toString());
|
|
|
-//
|
|
|
-// //生成二维码
|
|
|
-// MatrixToImageWriterUtil.createQRCode(url + projectNum, ConstantFilePath.BASE_PATH + File.separator + "sceneQRcode/"+projectNum+".png", null);
|
|
|
-// MatrixToImageWriterUtil.createQRCode(url + projectNum + "&lang=en", ConstantFilePath.BASE_PATH + File.separator + "sceneQRcode/"+projectNum+"_en.png", null);
|
|
|
-// log.info("二维码生成完成");
|
|
|
-//
|
|
|
-// return scene;
|
|
|
-// }
|
|
|
-
|
|
|
-
|
|
|
- public static String getMQMsg(String projectNum, String cameraName, String unicode, Long cameraType, String fileId,
|
|
|
- String prefix, String imgsName, String isModel,String userName,
|
|
|
- String algorithm, Integer resolution, String buildType, String path) {
|
|
|
- String parametr = "";
|
|
|
- parametr+= unicode +":;"+ path +":;"+ prefix +":;"+ imgsName +":;"+ projectNum +":;"+ isModel;
|
|
|
- if(userName !=null&&!userName.trim().equals("")){
|
|
|
- parametr+=":;"+ userName;
|
|
|
- }else{
|
|
|
- parametr+=":;noMan";
|
|
|
- }
|
|
|
- parametr+=":;"+ cameraType;
|
|
|
- parametr+=":;"+ algorithm;
|
|
|
- parametr += ":;" + fileId;
|
|
|
- parametr += ":;" + cameraName;
|
|
|
- if(resolution == null){
|
|
|
- parametr += ":;0";
|
|
|
- }else {
|
|
|
- parametr += ":;" + resolution.intValue();
|
|
|
- }
|
|
|
-
|
|
|
- if(buildType != null){
|
|
|
- parametr += ":;" + buildType;
|
|
|
- }
|
|
|
-
|
|
|
- log.info("pro大场景添加到队列:"+parametr);
|
|
|
- return parametr;
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 循环检测算法是否计算成功
|
|
|
* @param uploadJsonPath uploadjson路径
|