|
@@ -16,6 +16,7 @@ import com.fdkankan.redis.constant.RedisLockKey;
|
|
|
import com.fdkankan.redis.util.RedisLockUtil;
|
|
|
import com.fdkankan.redis.util.RedisUtil;
|
|
|
import com.fdkankan.scene.bean.SceneUpgradeProgressBean;
|
|
|
+import com.fdkankan.scene.bean.UpgradeBean;
|
|
|
import com.fdkankan.scene.entity.ScenePlus;
|
|
|
import com.fdkankan.scene.entity.ScenePlusExt;
|
|
|
import com.fdkankan.scene.entity.ScenePro;
|
|
@@ -116,12 +117,10 @@ public class SceneUpgradeToV4Service implements ISceneUpgradeToV4Service {
|
|
|
.last("limit 1"));
|
|
|
if(Objects.nonNull(sceneRepairLog)){
|
|
|
if(sceneRepairLog.getState() == 0){
|
|
|
- redisLockUtil.unlockLua(lockKey);
|
|
|
return ResultData.error(ErrorCode.FAILURE_CODE_7019);
|
|
|
}
|
|
|
if(!param.isReUpgrade()){
|
|
|
if(sceneRepairLog.getState() == 1){
|
|
|
- redisLockUtil.unlockLua(lockKey);
|
|
|
return ResultData.error(ErrorCode.FAILURE_CODE_7020);
|
|
|
}
|
|
|
}
|
|
@@ -162,15 +161,19 @@ public class SceneUpgradeToV4Service implements ISceneUpgradeToV4Service {
|
|
|
sceneUpgradeMapper.deleteScenePlusExt(sceneProV3.getId());
|
|
|
sceneUpgradeMapper.transferScenePlusExt(sceneProV3.getId());
|
|
|
|
|
|
- //发送mq
|
|
|
- rabbitMqProducer.sendByWorkQueue(upgradeToV4, sceneProV3.getId());
|
|
|
-
|
|
|
//写入进度条
|
|
|
Map<String, Integer> progress = new HashMap<>();
|
|
|
progress.put("status", 0);
|
|
|
progress.put("progress", 0);
|
|
|
redisUtil.set(RedisKey.scene_upgrade_progress_num, JSON.toJSONString(progress));
|
|
|
|
|
|
+ //发送mq
|
|
|
+ rabbitMqProducer.sendByWorkQueue(upgradeToV4,
|
|
|
+ UpgradeBean.builder()
|
|
|
+ .sceneProId(sceneProV3.getId())
|
|
|
+ .reUpgrade(param.isReUpgrade())
|
|
|
+ .build());
|
|
|
+
|
|
|
}catch (Exception e){
|
|
|
log.error("场景升级失败", e);
|
|
|
this.upgradeLog(sceneRepairLog, sceneProV3.getNum(), 2, ExceptionUtil.stacktraceToString(e, 3000));
|