|
@@ -26,6 +26,7 @@ import java.nio.file.Path;
|
|
import java.nio.file.WatchEvent;
|
|
import java.nio.file.WatchEvent;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
+import java.util.Objects;
|
|
|
|
|
|
@RefreshScope
|
|
@RefreshScope
|
|
@Slf4j
|
|
@Slf4j
|
|
@@ -63,25 +64,25 @@ public class BuildSceneProgressServiceImpl implements IBuildSceneProgressService
|
|
|
|
|
|
boolean complete = false;
|
|
boolean complete = false;
|
|
int mainProgress = 0;
|
|
int mainProgress = 0;
|
|
- Long totalTime = buildProgressTime;
|
|
|
|
|
|
+ Long totalTime = null;//buildProgressTime
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void onCreate(WatchEvent<?> event, Path currentPath) {
|
|
public void onCreate(WatchEvent<?> event, Path currentPath) {
|
|
- log.info("project.json文件创建完毕");
|
|
|
|
- String projectJsonStr = FileUtil.readUtf8String(file);
|
|
|
|
- JSONObject projectJson = JSON.parseObject(projectJsonStr);
|
|
|
|
- JSONObject state = projectJson.getJSONObject("state");
|
|
|
|
- Long expectTime = state.getLong("expect_time");
|
|
|
|
- totalTime += expectTime;
|
|
|
|
- redisUtil.set(String.format(RedisKey.SCENE_BUILD_EXPECT_TOTAL_TIME_NUM, num), String.valueOf(totalTime), RedisKey.CAMERA_EXPIRE_7_TIME);
|
|
|
|
- Map<String, Object> params = new HashMap<>();
|
|
|
|
- params.put("website", website);
|
|
|
|
- params.put("title", title);
|
|
|
|
- params.put("customUserId",customUserId);
|
|
|
|
- params.put("gps", gps);
|
|
|
|
- params.put("totalTime", totalTime);
|
|
|
|
- params.put("progress", mainProgress);
|
|
|
|
- HttpUtil.post(buildProgressUrl, JSON.toJSONString(params), 2000);
|
|
|
|
|
|
+// log.info("project.json文件创建完毕");
|
|
|
|
+// String projectJsonStr = FileUtil.readUtf8String(file);
|
|
|
|
+// JSONObject projectJson = JSON.parseObject(projectJsonStr);
|
|
|
|
+// JSONObject state = projectJson.getJSONObject("state");
|
|
|
|
+// Long expectTime = state.getLong("expect_time");
|
|
|
|
+// totalTime += expectTime;
|
|
|
|
+// redisUtil.set(String.format(RedisKey.SCENE_BUILD_EXPECT_TOTAL_TIME_NUM, num), String.valueOf(totalTime), RedisKey.CAMERA_EXPIRE_7_TIME);
|
|
|
|
+// Map<String, Object> params = new HashMap<>();
|
|
|
|
+// params.put("website", website);
|
|
|
|
+// params.put("title", title);
|
|
|
|
+// params.put("customUserId",customUserId);
|
|
|
|
+// params.put("gps", gps);
|
|
|
|
+// params.put("totalTime", totalTime);
|
|
|
|
+// params.put("progress", mainProgress);
|
|
|
|
+// HttpUtil.post(buildProgressUrl, JSON.toJSONString(params), 2000);
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -92,6 +93,10 @@ public class BuildSceneProgressServiceImpl implements IBuildSceneProgressService
|
|
JSONObject projectJson = JSON.parseObject(projectJsonStr);
|
|
JSONObject projectJson = JSON.parseObject(projectJsonStr);
|
|
JSONObject state = projectJson.getJSONObject("state");
|
|
JSONObject state = projectJson.getJSONObject("state");
|
|
complete = state.getBoolean("done");
|
|
complete = state.getBoolean("done");
|
|
|
|
+ if(Objects.isNull(totalTime)){
|
|
|
|
+ totalTime = state.getLong("expect_time") + buildProgressTime;
|
|
|
|
+ redisUtil.set(String.format(RedisKey.SCENE_BUILD_EXPECT_TOTAL_TIME_NUM, num), String.valueOf(totalTime), RedisKey.CAMERA_EXPIRE_7_TIME);
|
|
|
|
+ }
|
|
if(complete){
|
|
if(complete){
|
|
mainProgress = 90;
|
|
mainProgress = 90;
|
|
Map<String, Object> params = new HashMap<>();
|
|
Map<String, Object> params = new HashMap<>();
|