|
@@ -6,7 +6,7 @@ import cn.hutool.core.util.ZipUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
-import com.fdkankan.common.constant.ErrorCode;
|
|
|
+import com.fdkankan.common.constant.*;
|
|
|
import com.fdkankan.common.exception.BusinessException;
|
|
|
import com.fdkankan.common.util.FileUtils;
|
|
|
import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
@@ -18,6 +18,7 @@ import com.fdkankan.model.utils.CreateObjUtil;
|
|
|
import com.fdkankan.scene.entity.*;
|
|
|
import com.fdkankan.scene.service.*;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
@@ -29,6 +30,9 @@ import java.util.stream.Collectors;
|
|
|
@Service
|
|
|
public class ReverseSceneServiceImpl implements IReverseSceneService {
|
|
|
|
|
|
+ @Value("${scene.pro.new.url}")
|
|
|
+ private String sceneProNewUrl;
|
|
|
+
|
|
|
@Autowired
|
|
|
private IScenePlusService scenePlusService;
|
|
|
@Autowired
|
|
@@ -74,7 +78,7 @@ public class ReverseSceneServiceImpl implements IReverseSceneService {
|
|
|
String zipParentDir = FileUtil.getParent(zipPath, 1);
|
|
|
|
|
|
//生成vision.txt
|
|
|
- this.genVisionTxt(num, zipParentDir);
|
|
|
+ int shootCount = this.genVisionTxt(num, zipParentDir);
|
|
|
|
|
|
//解压
|
|
|
ZipUtil.unzip(zipPath, CharsetUtil.CHARSET_GBK);
|
|
@@ -85,9 +89,27 @@ public class ReverseSceneServiceImpl implements IReverseSceneService {
|
|
|
//计算全景图
|
|
|
this.genPano(num, zipParentDir);
|
|
|
|
|
|
+ scenePlus.setSceneSource(SceneSource.ZT.code());
|
|
|
+ scenePlus.setPayStatus(PayStatus.PAY.code());
|
|
|
+ scenePlus.setSceneStatus(SceneStatus.NO_DISPLAY.code());
|
|
|
+ scenePlus.setUpdateTime(new Date());
|
|
|
+ scenePlusService.updateById(scenePlus);
|
|
|
+
|
|
|
+ scenePlusExt.setSceneFrom(SceneFrom.MINION.code());
|
|
|
+ scenePlusExt.setSceneKind(SceneKind.FACE.code());
|
|
|
+ scenePlusExt.setSceneResolution(SceneResolution.four_K.code());
|
|
|
+ scenePlusExt.setSceneScheme(SceneScheme.LM.code());
|
|
|
+ scenePlusExt.setAlgorithmTime(new Date());
|
|
|
+ scenePlusExt.setBuildType("V3");
|
|
|
+ scenePlusExt.setModelKind(ModelKind.DAM.code());
|
|
|
+ scenePlusExt.setWebSite(sceneProNewUrl + num);
|
|
|
+ scenePlusExt.setShootCount(shootCount);
|
|
|
+ scenePlusExt.setUpdateTime(new Date());
|
|
|
+ scenePlusExtService.updateById(scenePlusExt);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
- private void genVisionTxt(String num, String zipParentDir) throws Exception {
|
|
|
+ private int genVisionTxt(String num, String zipParentDir) throws Exception {
|
|
|
String workJsonPath = zipParentDir + "/work.json";
|
|
|
JSONObject jsonObject = JSON.parseObject(workJsonPath);
|
|
|
JSONArray observers = jsonObject.getJSONArray("observers");
|
|
@@ -163,6 +185,7 @@ public class ReverseSceneServiceImpl implements IReverseSceneService {
|
|
|
fileServiceInterface.uploadFile(zipParentDir + "vision.txt", String.format(UploadFilePath.IMG_VIEW_PATH, num) + "vision.txt");
|
|
|
fileServiceInterface.uploadFile(zipParentDir + "vision.modeldata", String.format(UploadFilePath.IMG_VIEW_PATH, num) + "vision.modeldata");
|
|
|
|
|
|
+ return observers.size();
|
|
|
}
|
|
|
|
|
|
private void genPano(String num, String zipParentDir) throws Exception {
|