dengsixing 6 달 전
부모
커밋
753af25a18

+ 2 - 2
src/main/java/com/fdkankan/contro/controller/SceneFileController.java

@@ -82,7 +82,7 @@ public class SceneFileController{
      */
     @PostMapping("turntableUploadSuccess")
     public ResultData turntableUploadSuccess(String params) throws Exception {
-        return sceneFileBuildService.turntableUploadSuccess(params);
+        return sceneFileBuildService.turntableUploadSuccess(params, null, null);
     }
 
     /**
@@ -213,7 +213,7 @@ public class SceneFileController{
                 paramsStr.getBytes(StandardCharsets.UTF_8));
         String params = new Base64().encodeToString(res);
 
-        sceneFileBuildService.turntableUploadSuccess(params);
+        sceneFileBuildService.turntableUploadSuccess(params, null, null);
 
         return ResultData.ok();
     }

+ 4 - 0
src/main/java/com/fdkankan/contro/dto/UploadSceneDTO.java

@@ -2,14 +2,18 @@ package com.fdkankan.contro.dto;
 
 import lombok.Data;
 
+import javax.validation.constraints.NotBlank;
+
 @Data
 public class UploadSceneDTO {
 
     /**
      * 原始资源压缩包url
      */
+    @NotBlank(message = "fileUrl不能为空")
     private String fileUrl;
 
+    @NotBlank(message = "taskId不能为空")
     private String taskId;
 
     private String kNo;

+ 2 - 9
src/main/java/com/fdkankan/contro/service/impl/GzZcdjzxServiceImpl.java

@@ -91,14 +91,7 @@ public class GzZcdjzxServiceImpl implements GzZcdjzxService {
                 String uuidtime = dataFdageJson.getString("uuidtime");
                 String unicode = snCode + "_" + uuidtime;
 
-                LambdaQueryWrapper<SceneFileBuild> wrapper = new LambdaQueryWrapper<>();
-                if(StrUtil.isNotEmpty(taskId)){
-                    wrapper.eq(SceneFileBuild::getTaskId, taskId);
-                }
-                if(StrUtil.isNotEmpty(kNo)){
-                    wrapper.eq(SceneFileBuild::getKNo, kNo);
-                }
-                SceneFileBuild sceneFileBuild = sceneFileBuildService.getOne(wrapper);
+                SceneFileBuild sceneFileBuild = sceneFileBuildService.getOne(new LambdaQueryWrapper<SceneFileBuild>().eq(SceneFileBuild::getTaskId, taskId));
                 String fileId = null;
                 if(Objects.isNull(sceneFileBuild)){
                     fileId = String.valueOf(new SnowflakeIdGenerator(0,0).nextId());
@@ -130,7 +123,7 @@ public class GzZcdjzxServiceImpl implements GzZcdjzxService {
 
                 Integer code = null;
                 try {
-                    ResultData resultData = sceneFileBuildService.turntableUploadSuccess(params);
+                    ResultData resultData = sceneFileBuildService.turntableUploadSuccess(params, taskId, kNo);
                     code = resultData.getCode();
                 }catch (BusinessException e){
                     code = e.getCode();

+ 0 - 6
src/main/java/com/fdkankan/contro/service/impl/HaixinServiceImpl.java

@@ -42,12 +42,6 @@ public class HaixinServiceImpl implements IHaixinService {
     @Override
     public ResultData uploadScene(UploadSceneDTO dto) {
 
-        String taskId = dto.getTaskId();
-        String kNo = dto.getKNo();
-        if(StrUtil.isEmpty(taskId) && StrUtil.isEmpty(kNo)){
-            return ResultData.error(ServerCode.PARAM_REQUIRED.code(), ServerCode.PARAM_REQUIRED.formatMessage("taskId和kNo不能同时为空"));
-        }
-
         SceneOrigBd sceneOrigBd = new SceneOrigBd();
         sceneOrigBd.setFileUrl(dto.getFileUrl());
         sceneOrigBd.setTaskId(dto.getTaskId());