|
@@ -11,6 +11,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.fdkankan.common.constant.CommonStatus;
|
|
import com.fdkankan.common.constant.CommonStatus;
|
|
import com.fdkankan.common.constant.RecStatus;
|
|
import com.fdkankan.common.constant.RecStatus;
|
|
import com.fdkankan.model.utils.CreateHouseJsonUtil;
|
|
import com.fdkankan.model.utils.CreateHouseJsonUtil;
|
|
|
|
+import com.fdkankan.scene.entity.ScenePlus;
|
|
|
|
+import com.fdkankan.scene.service.IScenePlusService;
|
|
import com.fdkankan.web.response.ResultData;
|
|
import com.fdkankan.web.response.ResultData;
|
|
import com.fdkankan.common.util.FileUtils;
|
|
import com.fdkankan.common.util.FileUtils;
|
|
import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
@@ -109,6 +111,8 @@ public class SceneUpgradeToV4Service implements ISceneUpgradeToV4Service {
|
|
private IScenePlusExtService scenePlusExtService;
|
|
private IScenePlusExtService scenePlusExtService;
|
|
@Resource
|
|
@Resource
|
|
private FYunFileServiceInterface fYunFileService;
|
|
private FYunFileServiceInterface fYunFileService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IScenePlusService scenePlusService;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void upgrade(long sceneProId, boolean reUpgrade) throws Exception{
|
|
public void upgrade(long sceneProId, boolean reUpgrade) throws Exception{
|
|
@@ -476,6 +480,8 @@ public class SceneUpgradeToV4Service implements ISceneUpgradeToV4Service {
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
log.error(e.getMessage(), e);
|
|
log.error(e.getMessage(), e);
|
|
|
|
|
|
|
|
+ this.rollback(num);
|
|
|
|
+
|
|
//完成数据库操作更新进度条为0,状态失败
|
|
//完成数据库操作更新进度条为0,状态失败
|
|
this.updateProgress(num, 0, ProgressStatus.FAIL.code());
|
|
this.updateProgress(num, 0, ProgressStatus.FAIL.code());
|
|
|
|
|
|
@@ -488,6 +494,26 @@ public class SceneUpgradeToV4Service implements ISceneUpgradeToV4Service {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private void rollback(String num){
|
|
|
|
+
|
|
|
|
+ //还原scenePro的升级状态
|
|
|
|
+ ScenePro scenePro = sceneProService.findBySceneNum(num);
|
|
|
|
+ scenePro.setIsUpgrade(CommonStatus.NO.code().intValue());
|
|
|
|
+ sceneProService.updateById(scenePro);
|
|
|
|
+
|
|
|
|
+ //删除v4数据
|
|
|
|
+ ScenePlus scenePlus = scenePlusService.getByNum(num);
|
|
|
|
+ SceneEditInfo sceneEditInfo = sceneEditInfoService.getByScenePlusId(scenePlus.getId());
|
|
|
|
+ sceneEditControlsService.remove(new LambdaQueryWrapper<SceneEditControls>()
|
|
|
|
+ .eq(SceneEditControls::getEditInfoId, sceneEditInfo.getId()));
|
|
|
|
+ sceneEditInfoExtService.remove(new LambdaQueryWrapper<SceneEditInfoExt>()
|
|
|
|
+ .eq(SceneEditInfoExt::getEditInfoId, sceneEditInfo.getId()));
|
|
|
|
+ sceneEditInfoService.removeById(sceneEditInfo.getId());
|
|
|
|
+ scenePlusExtService.remove(new LambdaQueryWrapper<ScenePlusExt>()
|
|
|
|
+ .eq(ScenePlusExt::getPlusId, scenePlus.getId()));
|
|
|
|
+ scenePlusService.removeById(scenePlus.getId());
|
|
|
|
+ }
|
|
|
|
+
|
|
private void copyFileOss(String num, AtomicInteger completeCnt, AtomicInteger count, List<String> keyList, String sourcePath, String targetPah){
|
|
private void copyFileOss(String num, AtomicInteger completeCnt, AtomicInteger count, List<String> keyList, String sourcePath, String targetPah){
|
|
if(CollUtil.isEmpty(keyList))
|
|
if(CollUtil.isEmpty(keyList))
|
|
return;
|
|
return;
|