|
@@ -118,13 +118,6 @@ public class SceneUpgradeToV4Service implements ISceneUpgradeToV4Service {
|
|
|
@Autowired
|
|
|
FdkankanMiniClient fdkankanMiniClient;
|
|
|
|
|
|
- private static final String[] prefixArr = new String[]{
|
|
|
- "data/data%s/",
|
|
|
- "voice/voice%s/",
|
|
|
- "video/video%s/",
|
|
|
- "images/images%s/"
|
|
|
- };
|
|
|
-
|
|
|
@Override
|
|
|
public void upgrade(long sceneProId) throws Exception{
|
|
|
|
|
@@ -452,7 +445,7 @@ public class SceneUpgradeToV4Service implements ISceneUpgradeToV4Service {
|
|
|
sceneRepairLogService.updateById(sceneRepairLog);
|
|
|
|
|
|
// 调用v3接口回写数据
|
|
|
- String url = fkankanMiniHost + "/api/scene/upgradeToV4ResultSync";
|
|
|
+ String url = fkankanMiniHost + "/api-v4/upgradeToV4ResultSync";
|
|
|
fdkankanMiniClient.upgradeToV4ResultSync(url,
|
|
|
RequestSceneProV4.builder().id(sceneProId).webSite(scenePro.getWebSite()).build(),
|
|
|
new FdkkMiniReqSuccessCallback(), new FdkkMiniReqErrorCallback()
|
|
@@ -479,6 +472,32 @@ public class SceneUpgradeToV4Service implements ISceneUpgradeToV4Service {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private void copyFileOss(String num, AtomicInteger completeCnt, AtomicInteger count, List<String> keyList, String sourcePath, String targetPah){
|
|
|
+ if(CollUtil.isEmpty(keyList))
|
|
|
+ return;
|
|
|
+ keyList.parallelStream().forEach(key->{
|
|
|
+ try {
|
|
|
+ String targetKey = null;
|
|
|
+ if(key.contains(sourcePath)){
|
|
|
+ targetKey = key.replace(sourcePath, targetPah);
|
|
|
+ }
|
|
|
+ uploadToOssUtil.copyObject(key, targetKey);
|
|
|
+ this.updateProgress(num,
|
|
|
+ 10 +
|
|
|
+ (new BigDecimal(completeCnt.incrementAndGet())
|
|
|
+ .divide(new BigDecimal(count.get()), 6, BigDecimal.ROUND_HALF_UP)
|
|
|
+ .multiply(new BigDecimal(0.7))
|
|
|
+ .multiply(new BigDecimal(100))
|
|
|
+ .setScale(0, RoundingMode.UP)
|
|
|
+ .intValue()),
|
|
|
+ ProgressStatus.DO_OSS.code()
|
|
|
+ );
|
|
|
+ } catch (IOException e) {
|
|
|
+ log.error("文件拷贝出错,key:{}", key);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
private Integer createHotJson(String dataPath, String num) throws IOException {
|
|
|
Integer tags = Integer.valueOf(CommonStatus.NO.code());
|
|
|
// Set<String> icons = new HashSet<>();
|
|
@@ -542,32 +561,6 @@ public class SceneUpgradeToV4Service implements ISceneUpgradeToV4Service {
|
|
|
return tags;
|
|
|
}
|
|
|
|
|
|
- private void copyFileOss(String num, AtomicInteger completeCnt, AtomicInteger count, List<String> keyList, String sourcePath, String targetPah){
|
|
|
- if(CollUtil.isEmpty(keyList))
|
|
|
- return;
|
|
|
- keyList.parallelStream().forEach(key->{
|
|
|
- try {
|
|
|
- String targetKey = null;
|
|
|
- if(key.contains(sourcePath)){
|
|
|
- targetKey = key.replace(sourcePath, targetPah);
|
|
|
- }
|
|
|
- uploadToOssUtil.copyObject(key, targetKey);
|
|
|
- this.updateProgress(num,
|
|
|
- 10 +
|
|
|
- (new BigDecimal(completeCnt.incrementAndGet())
|
|
|
- .divide(new BigDecimal(count.get()), 6, BigDecimal.ROUND_HALF_UP)
|
|
|
- .multiply(new BigDecimal(0.7))
|
|
|
- .multiply(new BigDecimal(100))
|
|
|
- .setScale(0, RoundingMode.UP)
|
|
|
- .intValue()),
|
|
|
- ProgressStatus.DO_OSS.code()
|
|
|
- );
|
|
|
- } catch (IOException e) {
|
|
|
- log.error("文件拷贝出错,key:{}", key);
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
private Float getFloorPlanCompass(String num){
|
|
|
String objectContent =
|
|
|
uploadToOssUtil.getObjectContent(bucket, "data/data" + num + "/houst_floor.json");
|