瀏覽代碼

更换场景主表

dengsixing 3 年之前
父節點
當前提交
32130742b6

+ 2 - 0
4dkankan-center-scene/src/main/java/com/fdkankan/scene/bean/SceneJsonBean.java

@@ -158,4 +158,6 @@ public class SceneJsonBean {
      */
     private String loadingLogoFile;
 
+    private Integer payStatus;
+
 }

+ 6 - 0
4dkankan-center-scene/src/main/java/com/fdkankan/scene/entity/ScenePlusExt.java

@@ -119,6 +119,12 @@ public class ScenePlusExt implements Serializable {
     private String sceneFrom;
 
     /**
+     * 计算耗时
+     */
+    @TableField("compute_time")
+    private String computeTime;
+
+    /**
      * 点位视频
      */
     @TableField("videos")

+ 187 - 31
4dkankan-center-scene/src/main/java/com/fdkankan/scene/listener/BuildSceneResultMQListener.java

@@ -1,11 +1,15 @@
 package com.fdkankan.scene.listener;
 
+import cn.hutool.core.collection.CollUtil;
 import cn.hutool.http.HttpStatus;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.fdkankan.common.constant.BuildStatus;
 import com.fdkankan.common.constant.ConstantFilePath;
 import com.fdkankan.common.constant.ExpiredStatus;
+import com.fdkankan.common.constant.PayStatus;
 import com.fdkankan.common.constant.SceneFrom;
 import com.fdkankan.common.constant.SceneResolution;
 import com.fdkankan.common.constant.SceneSource;
@@ -13,6 +17,7 @@ import com.fdkankan.common.constant.SceneStatus;
 import com.fdkankan.common.constant.ServerCode;
 import com.fdkankan.common.constant.UploadFilePath;
 import com.fdkankan.common.response.ResultData;
+import com.fdkankan.common.util.FileUtils;
 import com.fdkankan.common.util.MatrixToImageWriterUtil;
 import com.fdkankan.fyun.oss.UploadToOssUtil;
 import com.fdkankan.mq.message.BuildSceneResultMqMessage;
@@ -23,21 +28,30 @@ import com.fdkankan.platform.api.vo.UserIncrement;
 import com.fdkankan.redis.constant.RedisKey;
 import com.fdkankan.redis.util.RedisUtil;
 import com.fdkankan.scene.bean.SceneJsonBean;
+import com.fdkankan.scene.entity.Scene;
 import com.fdkankan.scene.entity.SceneEditControls;
 import com.fdkankan.scene.entity.SceneEditInfo;
+import com.fdkankan.scene.entity.SceneExt;
 import com.fdkankan.scene.entity.SceneFileBuild;
+import com.fdkankan.scene.entity.ScenePlus;
+import com.fdkankan.scene.entity.ScenePlusExt;
 import com.fdkankan.scene.entity.ScenePro;
 import com.fdkankan.scene.entity.SceneProExt;
 import com.fdkankan.scene.service.IBuildScenePreService;
 import com.fdkankan.scene.service.ISceneEditControlsService;
 import com.fdkankan.scene.service.ISceneEditInfoService;
 import com.fdkankan.scene.service.ISceneFileBuildService;
+import com.fdkankan.scene.service.IScenePlusExtService;
+import com.fdkankan.scene.service.IScenePlusService;
 import com.fdkankan.scene.service.ISceneProExtService;
 import com.fdkankan.scene.service.ISceneProService;
 import com.fdkankan.scene.service.ISceneService;
 import com.fdkankan.scene.service.impl.BuildScenePreServiceImpl;
 import java.io.File;
+import java.util.Calendar;
+import java.util.HashMap;
 import java.util.Map;
+import java.util.stream.Collectors;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.rocketmq.spring.annotation.MessageModel;
 import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
@@ -105,6 +119,10 @@ public class BuildSceneResultMQListener implements RocketMQListener<String> {
     IBuildScenePreService buildScenePreService;
     @Autowired
     RedisUtil redisUtil;
+    @Autowired
+    IScenePlusService scenePlusService;
+    @Autowired
+    IScenePlusExtService scenePlusExtService;
 
 
     @Override
@@ -132,9 +150,17 @@ public class BuildSceneResultMQListener implements RocketMQListener<String> {
         String prefix = message.getPrefix();
         try {
             if(!buildSuccess){//建模失败,修改状态为失败状态
-                log.error("建模失败,修改状态为失败状态");
+                log.info("建模失败,修改状态为失败状态");
+                // TODO: 2022/3/21 plus版本稳定后删除------------------------start
                 sceneService.updateStatus(sceneCode, SceneStatus.FAILD.code());
                 sceneProService.updateStatus(sceneCode, SceneStatus.FAILD.code());
+                // TODO: 2022/3/21 plus版本稳定后删除------------------------send
+
+                scenePlusService.update(
+                    new LambdaUpdateWrapper<ScenePlus>()
+                        .set(ScenePlus::getSceneStatus, SceneStatus.FAILD.code())
+                        .eq(ScenePlus::getNum, sceneCode));
+
                 SceneFileBuild sceneFileBuild = sceneFileBuildService.findByFileId(fileId);
                 if(Objects.nonNull(sceneFileBuild)){
                     sceneFileBuild.setBuildStatus(BuildStatus.fail.code());
@@ -146,10 +172,16 @@ public class BuildSceneResultMQListener implements RocketMQListener<String> {
             //建模成功
             log.info("cameraType:{}",cameraType);
 
+            //计算场景消耗磁盘空间
             long space = buildScenePreService.calUseSpace(uploadFiles);
 
             if(cameraType < 3){
+                // TODO: 2022/3/21 plus版本稳定后删除------------------------start
                 sceneService.updateTime(sceneCode, space, payStatus);
+                // TODO: 2022/3/21 plus版本稳定后删除------------------------send
+
+                this.updateDb4Sm(sceneCode, space);
+
                 uploadToOssUtil.uploadMulFiles(uploadFiles);
                 return;
             }
@@ -158,9 +190,20 @@ public class BuildSceneResultMQListener implements RocketMQListener<String> {
             JSONObject videosJson = buildScenePreService.getVideosJson(path, videoVersion, sceneCode, cameraType);
 
             //写入数据库
-            ScenePro scenePro = this.updateDb(sceneCode, space, payStatus, videosJson.toJSONString(), computeTime, fileId);
+            // TODO: 2022/3/21 plus版本稳定后删除------------------------start
+            ScenePro scenePro = this.updateDbPro(sceneCode, space, payStatus, videosJson.toJSONString(), computeTime, fileId);
             SceneProExt sceneProExt = sceneProExtService.findBySceneProId(scenePro.getId());
-            Object[] editInfoArr = this.updateEditInfo(scenePro);
+            // TODO: 2022/3/21 plus版本稳定后删除------------------------send
+            ScenePlus scenePlus = this.updateDbPlus(sceneCode, space, payStatus, videosJson.toJSONString(), computeTime, fileId);
+            ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
+
+            //变更容量,arrearCap为true时,代表容量不足
+            boolean arrearCap = this.updateSpace(scenePlus.getCameraId(), space, scenePlus.getId(), scenePro.getId());
+
+            //如果相机容量不足,需要把场景的paystatus改为容量不足状态
+            this.sealScene(arrearCap, scenePlus.getId(), scenePro.getId());
+
+            Object[] editInfoArr = this.updateEditInfo(scenePlus);
             SceneEditInfo sceneEditInfo = (SceneEditInfo)editInfoArr[0];
             SceneEditControls sceneEditControls = (SceneEditControls)editInfoArr[1];
 
@@ -196,7 +239,8 @@ public class BuildSceneResultMQListener implements RocketMQListener<String> {
             buildScenePreService.uploadLogFile(sceneCode, sceneProExt.getDataSource());
 
             //写scene.json
-            String sceneJson = buildScenePreService.writeSceneJson(sceneCode, videosJson, sceneEditInfo, sceneEditControls, scenePro, sceneProExt);
+            String sceneJson = buildScenePreService.writeSceneJson(sceneCode, videosJson,
+                sceneEditInfo, sceneEditControls, scenePlus, scenePlusExt, arrearCap);
 
             //上传sceneJson文件
             String sceneJsonPath = String.format(UploadFilePath.DATA_VIEW_PATH+"scene.json", sceneCode);
@@ -213,7 +257,59 @@ public class BuildSceneResultMQListener implements RocketMQListener<String> {
         }
     }
 
-    private ScenePro updateDb(String sceneCode, Long space, Integer payStatus, String videosJson, Long computeTime, String fileId) throws Exception{
+    private void sealScene(boolean arrearCap, Long scenePlusId, Long sceneProId){
+        if(!arrearCap){
+            return;
+        }
+        scenePlusService.update(
+            new LambdaUpdateWrapper<ScenePlus>()
+                .set(ScenePlus::getPayStatus, PayStatus.NO_CAPACITY)
+                .eq(ScenePlus::getId, scenePlusId));
+
+
+        // TODO: 2022/3/22 plus版本稳定后删除---------------------------start
+        sceneProService.update(
+            new LambdaUpdateWrapper<ScenePro>()
+                .set(ScenePro::getPayStatus, PayStatus.NO_CAPACITY)
+                .eq(ScenePro::getId, sceneProId));
+        // TODO: 2022/3/22 plus版本稳定后删除---------------------------end
+    }
+
+    /**
+     * <p>
+            双目场景更新数据库
+     * </p>
+     * @author dengsixing
+     * @date 2022/3/21
+     * @param num
+     * @param space
+     **/
+    private void updateDb4Sm(String num, long space){
+        List<ScenePlus> ScenePlusList = scenePlusService.list(
+            new LambdaQueryWrapper<ScenePlus>()
+            .select(ScenePlus::getId)
+            .eq(ScenePlus::getNum, num));
+
+        if(CollUtil.isNotEmpty(ScenePlusList))
+            return ;
+        List<Long> sceneIds = ScenePlusList.stream().map(scene -> {
+            return scene.getId();
+        }).collect(Collectors.toList());
+
+        //更新场景创建时间
+        scenePlusService.update(new LambdaUpdateWrapper<ScenePlus>()
+            .in(ScenePlus::getId, sceneIds)
+            .set(ScenePlus::getCreateTime, Calendar.getInstance().getTime())
+            .set(ScenePlus::getSceneStatus, SceneStatus.NO_DISPLAY.code()));
+
+        //更新使用容量
+        scenePlusExtService.update(
+            new LambdaUpdateWrapper<ScenePlusExt>()
+                .in(ScenePlusExt::getPlusId, sceneIds)
+                .set(ScenePlusExt::getSpace, space));
+    }
+
+    private ScenePro updateDbPro(String sceneCode, Long space, Integer payStatus, String videosJson, Long computeTime, String fileId) throws Exception{
         ScenePro scenePro = sceneProService.findBySceneNum(sceneCode);
 
         sceneProService.updateTime(sceneCode, space, payStatus, videosJson, computeTime);
@@ -225,27 +321,6 @@ public class BuildSceneResultMQListener implements RocketMQListener<String> {
 
         if(Objects.nonNull(scenePro)){
             SceneProExt sceneProExt = sceneProExtService.findBySceneProId(scenePro.getId());
-            ResultData<CameraDetail> resultData = platformGoodsClient.updateCameraDetailByCameraIdAndSpace(scenePro.getCameraId(), sceneProExt.getSpace());
-            if(resultData.getCode() != ServerCode.SUCCESS.code()){
-                log.error("调用platform服务updateCameraDetailByCameraIdAndSpace失败,参数{},{}" ,scenePro.getCameraId(), sceneProExt.getSpace());
-                throw new Exception(ServerCode.FEIGN_REQUEST_FAILD.message());
-            }
-            CameraDetail cameraDetail = JSONObject.parseObject(JSONObject.toJSONString(resultData.getData()), CameraDetail.class);
-
-            ResultData<UserIncrement> resultData1 = platformUserClient.getUserIncrementByCameraId(scenePro.getCameraId());
-            if(resultData1.getCode() != ServerCode.SUCCESS.code()){
-                log.error("调用platform服务getUserIncrementByCameraId失败,参数{}" ,scenePro.getCameraId());
-                throw new Exception(ServerCode.FEIGN_REQUEST_FAILD.message());
-            }
-            if( resultData1.getData() == null || resultData1.getData().getIsExpired() == ExpiredStatus.Expired.code()) {
-                // 新上传的场景,如果总容量小于使用容量,则该大场景保留在临时存储空间30天
-                if (cameraDetail.getTotalSpace().compareTo(cameraDetail.getUsedSpace()) == -1){
-                    List<Long> ids = new ArrayList<>();
-                    ids.add(scenePro.getId());
-                    sceneProService.tempScenes(ids);
-                }
-            }
-
             SceneSource sceneSource = SceneSource.get(sceneProExt.getSceneSource());
             switch (sceneSource){
                 case BM:
@@ -272,14 +347,95 @@ public class BuildSceneResultMQListener implements RocketMQListener<String> {
         return scenePro;
     }
 
-    private Object[] updateEditInfo(ScenePro scenePro){
-        SceneEditInfo sceneEditInfo = sceneEditInfoService.getBySceneProId(scenePro.getId());
+    private ScenePlus updateDbPlus(String num, Long space, Integer payStatus, String videosJson, Long computeTime, String fileId) throws Exception{
+        ScenePlus scenePlus = scenePlusService.getScenePlusByNum(num);
+        ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
+        List<ScenePlus> list = scenePlusService.list(
+            new LambdaQueryWrapper<ScenePlus>()
+                .select(ScenePlus::getId)
+                .eq(ScenePlus::getNum, num));
+        if(scenePlus == null || CollUtil.isEmpty(list))
+            return null;
+
+        //修改场景状态 空间 支付状态 计算时间
+        List<Long> scenePlusIds = list.stream().map(plus -> {
+            return plus.getId();
+        }).collect(Collectors.toList());
+
+        scenePlusService.update(new LambdaUpdateWrapper<ScenePlus>()
+            .in(ScenePlus::getId, scenePlusIds)
+            .set(ScenePlus::getSceneStatus, SceneStatus.NO_DISPLAY.code())
+            .set(ScenePlus::getCreateTime, Calendar.getInstance().getTime())
+            .set(ScenePlus::getPayStatus, payStatus));
+
+        scenePlusExtService.update(new LambdaUpdateWrapper<ScenePlusExt>()
+            .in(ScenePlusExt::getPlusId, scenePlusIds)
+            .set(ScenePlusExt::getSpace, space)
+            .set(ScenePlusExt::getComputeTime, computeTime)
+            .set(ScenePlusExt::getVideos, videosJson));
+
+        SceneFileBuild sceneFileBuild = sceneFileBuildService.findByFileId(fileId);
+        if(sceneFileBuild != null){
+            sceneFileBuild.setBuildStatus(BuildStatus.success.code());
+            sceneFileBuildService.updateById(sceneFileBuild);
+        }
+
+        SceneSource sceneSource = SceneSource.get(scenePlus.getSceneSource());
+        switch (sceneSource){
+            case BM:
+                scenePlusExt.setSceneResolution(SceneResolution.TILES_2K.code());
+                scenePlusExt.setSceneFrom(SceneFrom.PRO.code());
+                break;
+            case SM:
+                scenePlusExt.setSceneResolution(SceneResolution.TILES_1K.code());
+                scenePlusExt.setSceneFrom(SceneFrom.LITE.code());
+                break;
+            case ZT:
+                scenePlusExt.setSceneResolution(SceneResolution.TILES_4K.code());
+                scenePlusExt.setSceneFrom(SceneFrom.MINION.code());
+                break;
+            case JG:
+                scenePlusExt.setSceneResolution(SceneResolution.TILES_4K.code());
+                scenePlusExt.setSceneFrom(SceneFrom.LASER.code());
+                break;
+        }
+        scenePlusExtService.updateById(scenePlusExt);
+
+
+        return scenePlus;
+    }
+
+    private boolean updateSpace(Long cameraId, Long space, Long scenePlusId, Long sceneProId) throws Exception{
+        //更新相机使用用量
+        ResultData<CameraDetail> resultData = platformGoodsClient.updateCameraDetailByCameraIdAndSpace(cameraId, space);
+        if(resultData.getCode() != ServerCode.SUCCESS.code()){
+            log.error("调用platform服务updateCameraDetailByCameraIdAndSpace失败,参数{},{}" ,cameraId, space);
+            throw new Exception(ServerCode.FEIGN_REQUEST_FAILD.message());
+        }
+        CameraDetail cameraDetail = JSONObject.parseObject(JSONObject.toJSONString(resultData.getData()), CameraDetail.class);
+
+        ResultData<UserIncrement> resultData1 = platformUserClient.getUserIncrementByCameraId(cameraId);
+        if(resultData1.getCode() != ServerCode.SUCCESS.code()){
+            log.error("调用platform服务getUserIncrementByCameraId失败,参数{}" ,cameraId);
+            throw new Exception(ServerCode.FEIGN_REQUEST_FAILD.message());
+        }
+        if( resultData1.getData() == null || resultData1.getData().getIsExpired() == ExpiredStatus.Expired.code()) {
+            // 新上传的场景,如果总容量小于使用容量,则该大场景保留在临时存储空间30天
+            if (cameraDetail.getTotalSpace().compareTo(cameraDetail.getUsedSpace()) == -1){
+                return true;
+            }
+        }
+        return false;
+    }
+
+    private Object[] updateEditInfo(ScenePlus scenePlus){
+        SceneEditInfo sceneEditInfo = sceneEditInfoService.getByScenePlusId(scenePlus.getId());
         SceneEditControls sceneEditControls = null;
         if(sceneEditInfo == null){
             sceneEditInfo = new SceneEditInfo();
-            sceneEditInfo.setSceneProId(scenePro.getId());
-            sceneEditInfo.setDescription(scenePro.getSceneDec());
-            sceneEditInfo.setTitle(scenePro.getSceneName());
+            sceneEditInfo.setSceneProId(scenePlus.getId());
+            sceneEditInfo.setDescription(scenePlus.getDescription());
+            sceneEditInfo.setTitle(scenePlus.getTitle());
             sceneEditInfoService.save(sceneEditInfo);
         }else{
             sceneEditControls = sceneEditControlsService.getBySceneEditId(sceneEditInfo.getId());

+ 4 - 1
4dkankan-center-scene/src/main/java/com/fdkankan/scene/service/IBuildScenePreService.java

@@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSONObject;
 import com.fdkankan.mq.message.BuildSceneMqMessage;
 import com.fdkankan.scene.entity.SceneEditControls;
 import com.fdkankan.scene.entity.SceneEditInfo;
+import com.fdkankan.scene.entity.ScenePlus;
+import com.fdkankan.scene.entity.ScenePlusExt;
 import com.fdkankan.scene.entity.ScenePro;
 import com.fdkankan.scene.entity.SceneProExt;
 import java.io.IOException;
@@ -42,7 +44,8 @@ public interface IBuildScenePreService {
 
     JSONObject getVideosJson(String path, Integer videoVersion, String projectNum, int cameraType) throws Exception ;
 
-    String writeSceneJson(String num, JSONObject videoJson, SceneEditInfo sceneEditInfo, SceneEditControls sceneEditControls, ScenePro scenePro, SceneProExt sceneProExt) throws Exception;
+    String writeSceneJson(String num, JSONObject videoJson, SceneEditInfo sceneEditInfo, SceneEditControls sceneEditControls,
+        ScenePlus scenePlus, ScenePlusExt scenePlusExt, boolean arrearCap) throws Exception;
 
 
 

+ 1 - 0
4dkankan-center-scene/src/main/java/com/fdkankan/scene/service/IScenePlusService.java

@@ -23,4 +23,5 @@ public interface IScenePlusService extends IService<ScenePlus> {
 
     ResultData checkKey(SceneCheckKeyParamVO param) throws Exception;
 
+
 }

+ 29 - 4
4dkankan-center-scene/src/main/java/com/fdkankan/scene/service/impl/BuildScenePreServiceImpl.java

@@ -16,9 +16,14 @@ import cn.hutool.json.JSONUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.fdkankan.common.constant.ConstantFilePath;
 import com.fdkankan.common.constant.ConstantUrl;
+import com.fdkankan.common.constant.ExpiredStatus;
+import com.fdkankan.common.constant.PayStatus;
+import com.fdkankan.common.constant.ServerCode;
 import com.fdkankan.common.constant.UploadFilePath;
+import com.fdkankan.common.response.ResultData;
 import com.fdkankan.common.util.CreateObjUtil;
 import com.fdkankan.common.util.FileUtil;
 import com.fdkankan.common.util.FileUtils;
@@ -26,14 +31,21 @@ import com.fdkankan.dingtalk.DingTalkSendUtils;
 import com.fdkankan.fyun.constant.StorageType;
 import com.fdkankan.fyun.oss.UploadToOssUtil;
 import com.fdkankan.mq.message.BuildSceneMqMessage;
+import com.fdkankan.platform.api.feign.PlatformGoodsClient;
+import com.fdkankan.platform.api.feign.PlatformUserClient;
+import com.fdkankan.platform.api.vo.CameraDetail;
+import com.fdkankan.platform.api.vo.UserIncrement;
 import com.fdkankan.push.PushMessageConfig;
 import com.fdkankan.push.PushMsgUtil;
 import com.fdkankan.scene.bean.SceneJsonBean;
 import com.fdkankan.scene.entity.SceneEditControls;
 import com.fdkankan.scene.entity.SceneEditInfo;
+import com.fdkankan.scene.entity.ScenePlus;
+import com.fdkankan.scene.entity.ScenePlusExt;
 import com.fdkankan.scene.entity.ScenePro;
 import com.fdkankan.scene.entity.SceneProExt;
 import com.fdkankan.scene.service.IBuildScenePreService;
+import com.fdkankan.scene.service.IScenePlusService;
 import com.fdkankan.scene.vo.SceneEditControlsVO;
 import com.fdkankan.scene.vo.SceneEditInfoVO;
 import com.taobao.api.ApiException;
@@ -42,6 +54,7 @@ import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 import java.security.InvalidKeyException;
 import java.security.NoSuchAlgorithmException;
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
@@ -49,6 +62,7 @@ import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Objects;
 import java.util.concurrent.CompletableFuture;
+import javafx.application.Platform;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -77,6 +91,12 @@ public class BuildScenePreServiceImpl implements IBuildScenePreService {
     private DingTalkSendUtils dingTalkSendUtils;
     @Value("${environment:dev}")
     private String environment;
+    @Autowired
+    private IScenePlusService scenePlusService;
+    @Autowired
+    private PlatformUserClient platformUserClient;
+    @Autowired
+    private PlatformGoodsClient platformGoodsClient;
 
     public static String hostName;
 
@@ -459,7 +479,7 @@ public class BuildScenePreServiceImpl implements IBuildScenePreService {
 
     @Override
     public String writeSceneJson(String num, JSONObject videosJson, SceneEditInfo sceneEditInfo,
-        SceneEditControls sceneEditControls, ScenePro scenePro, SceneProExt sceneProExt)  throws Exception{
+        SceneEditControls sceneEditControls, ScenePlus scenePlus, ScenePlusExt scenePlusExt, boolean arrearCap)  throws Exception{
         String sceneJsonPath = String.format(ConstantFilePath.SCENE_PATH_FORMAT, num);
         String strsceneInfos = FileUtils.readFile(sceneJsonPath);
         SceneJsonBean sceneJson = null;
@@ -470,12 +490,17 @@ public class BuildScenePreServiceImpl implements IBuildScenePreService {
             SceneEditControlsVO sceneEditControlsVO = BeanUtil.copyProperties(sceneEditControls, SceneEditControlsVO.class);
             sceneJson.setControls(sceneEditControlsVO);
             sceneJson.setNum(num);
-            sceneJson.setCreateTime(scenePro.getCreateTime());
-            sceneJson.setSceneResolution(sceneProExt.getSceneResolution());
-            sceneJson.setSceneFrom(sceneProExt.getSceneFrom());
+            sceneJson.setCreateTime(scenePlus.getCreateTime());
+            sceneJson.setSceneResolution(scenePlusExt.getSceneResolution());
+            sceneJson.setSceneFrom(scenePlusExt.getSceneFrom());
             sceneJson.setVideos(videosJson);
         }
         sceneJson.setVideos(videosJson);
+
+        if(arrearCap) {
+            sceneJson.setPayStatus(PayStatus.NO_CAPACITY.code());
+        }
+
         String sceneJsonStr = JSON.toJSONString(sceneJson);
         FileUtils.writeFile(sceneJsonPath, sceneJsonStr);
         return sceneJsonStr;

+ 5 - 5
4dkankan-center-scene/src/main/java/com/fdkankan/scene/service/impl/SceneServiceImpl.java

@@ -879,15 +879,15 @@ public class SceneServiceImpl extends ServiceImpl<ISceneMapper, Scene> implement
         if(CollUtil.isEmpty(sceneList))
             return ;
 
-        this.update(new LambdaUpdateWrapper<Scene>()
-                .eq(Scene::getNum, sceneNum)
-                .set(Scene::getCreateTime, Calendar.getInstance().getTime())
-                .set(Scene::getSceneStatus, SceneStatus.NO_DISPLAY.code()));
-
         List<Long> sceneIds = sceneList.stream().map(scene -> {
             return scene.getId();
         }).collect(Collectors.toList());
 
+        this.update(new LambdaUpdateWrapper<Scene>()
+                .in(Scene::getId, sceneIds)
+                .set(Scene::getCreateTime, Calendar.getInstance().getTime())
+                .set(Scene::getSceneStatus, SceneStatus.NO_DISPLAY.code()));
+
         sceneExtService.update(new LambdaUpdateWrapper<SceneExt>().in(SceneExt::getSceneId, sceneIds).set(SceneExt::getSpace, space));
     }