|
@@ -204,6 +204,13 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
String pushToken = message.getPushToken();
|
|
String pushToken = message.getPushToken();
|
|
String prefix = message.getPrefix();
|
|
String prefix = message.getPrefix();
|
|
try {
|
|
try {
|
|
|
|
+ // 上传计算日志
|
|
|
|
+ //如果是重复计算,没有走到计算逻辑,不需要上传日志文件
|
|
|
|
+ log.info("开始上传计算日志");
|
|
|
|
+ String buildLogPath = String.format(UploadFilePath.BUILD_LOG_PATH, sceneCode);
|
|
|
|
+ fYunFileService.uploadFile(path + File.separator + "console.log", buildLogPath + "console.log");
|
|
|
|
+ log.info("计算日志上传完成");
|
|
|
|
+
|
|
if (!buildSuccess) {
|
|
if (!buildSuccess) {
|
|
log.error("建模失败,修改状态为失败状态");
|
|
log.error("建模失败,修改状态为失败状态");
|
|
scenePlusService.update(new LambdaUpdateWrapper<ScenePlus>()
|
|
scenePlusService.update(new LambdaUpdateWrapper<ScenePlus>()
|
|
@@ -295,7 +302,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
this.writeSceneJson(sceneCode, videosJson,sceneEditInfo, sceneEditInfoExt, sceneEditControls, scenePlus,
|
|
this.writeSceneJson(sceneCode, videosJson,sceneEditInfo, sceneEditInfoExt, sceneEditControls, scenePlus,
|
|
scenePlusExt, arrearCap);
|
|
scenePlusExt, arrearCap);
|
|
|
|
|
|
- //计算成功,发短信
|
|
|
|
|
|
+ //计算成功,通知APP
|
|
this.pushMsgToApp(pushChannel,pushToken, cameraType, scenePlus.getTitle(), scenePlusExt.getWebSite());
|
|
this.pushMsgToApp(pushChannel,pushToken, cameraType, scenePlus.getTitle(), scenePlusExt.getWebSite());
|
|
|
|
|
|
if (cameraType == 14) {
|
|
if (cameraType == 14) {
|
|
@@ -457,7 +464,9 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
|
|
|
private void writeSceneJson(String num, JSONObject videosJson, SceneEditInfo sceneEditInfo, SceneEditInfoExt sceneEditInfoExt,
|
|
private void writeSceneJson(String num, JSONObject videosJson, SceneEditInfo sceneEditInfo, SceneEditInfoExt sceneEditInfoExt,
|
|
SceneEditControls sceneEditControls, ScenePlus scenePlus, ScenePlusExt scenePlusExt, boolean arrearCap) throws Exception{
|
|
SceneEditControls sceneEditControls, ScenePlus scenePlus, ScenePlusExt scenePlusExt, boolean arrearCap) throws Exception{
|
|
- String sceneJsonKey = String.format(UploadFilePath.DATA_VIEW_PATH, num) + "scene.json";
|
|
|
|
|
|
+ String dataViewPath = String.format(UploadFilePath.DATA_VIEW_PATH, num);
|
|
|
|
+
|
|
|
|
+ String sceneJsonKey = dataViewPath + "scene.json";
|
|
boolean exist = fYunFileService.fileExist(sceneJsonKey);
|
|
boolean exist = fYunFileService.fileExist(sceneJsonKey);
|
|
//如果云端没有scene.json文件,生成一份
|
|
//如果云端没有scene.json文件,生成一份
|
|
if(!exist){
|
|
if(!exist){
|
|
@@ -481,20 +490,26 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
//scenejson写入缓存
|
|
//scenejson写入缓存
|
|
redisUtil.set(String.format(RedisKey.SCENE_JSON, num), sceneJsonStr);
|
|
redisUtil.set(String.format(RedisKey.SCENE_JSON, num), sceneJsonStr);
|
|
}
|
|
}
|
|
-
|
|
|
|
- // TODO: 2022/4/21 plus版本稳定后删除------------------------------------------start
|
|
|
|
-// String localSceneJsonPath = String.format(ConstantFilePath.SCENE_PATH_FORMAT, num);
|
|
|
|
-// String localSceneJson = FileUtils.readFile(localSceneJsonPath);
|
|
|
|
-// if(StrUtil.isNotEmpty(localSceneJson)){
|
|
|
|
-// JSONObject sceneJsonObject = JSON.parseObject(localSceneJson);
|
|
|
|
-// sceneJsonObject.put("videos", JSON.toJSONString(videosJson));
|
|
|
|
-// if(arrearCap) {
|
|
|
|
-// sceneJsonObject.put("payStatus", PayStatus.NO_CAPACITY.code());
|
|
|
|
-// }
|
|
|
|
-// FileUtils.writeFile(localSceneJsonPath, sceneJsonObject.toJSONString());
|
|
|
|
-// }
|
|
|
|
- // TODO: 2022/4/21 plus版本稳定后删除------------------------------------------end
|
|
|
|
-
|
|
|
|
|
|
+ // 上传status JSON.
|
|
|
|
+
|
|
|
|
+ JSONObject statusJson = new JSONObject();
|
|
|
|
+ //临时将-2改成1,app还没完全更新
|
|
|
|
+ int sceneStatus = scenePlus.getSceneStatus();
|
|
|
|
+ if (sceneStatus == -2) {
|
|
|
|
+ sceneStatus = 1;
|
|
|
|
+ } else if (sceneStatus == -1) {
|
|
|
|
+ // 失败状态不予显示到客户端
|
|
|
|
+ sceneStatus = 0;
|
|
|
|
+ }
|
|
|
|
+ statusJson.put("status", sceneStatus);
|
|
|
|
+ statusJson.put("webSite", scenePlusExt.getWebSite());
|
|
|
|
+ statusJson.put("sceneNum", num);
|
|
|
|
+ statusJson.put("thumb", scenePlusExt.getThumb());
|
|
|
|
+ statusJson.put("payStatus", scenePlus.getPayStatus());
|
|
|
|
+ FileUtils.writeFile(ConstantFilePath.SCENE_PATH + "data/data" + num + File.separator + "status.json", statusJson.toString());
|
|
|
|
+
|
|
|
|
+ fYunFileService.uploadFile(ConstantFilePath.SCENE_PATH + "data/data" + num + File.separator + "status.json",
|
|
|
|
+ dataViewPath + "status.json");
|
|
}
|
|
}
|
|
|
|
|
|
private void pushMsgToApp(Integer pushChannel, String pushToken, int cameraType, String sceneName, String webSite){
|
|
private void pushMsgToApp(Integer pushChannel, String pushToken, int cameraType, String sceneName, String webSite){
|