dengsixing 6 달 전
부모
커밋
5f641e2694
1개의 변경된 파일10개의 추가작업 그리고 1개의 파일을 삭제
  1. 10 1
      src/main/java/com/fdkankan/contro/service/impl/HaixinServiceImpl.java

+ 10 - 1
src/main/java/com/fdkankan/contro/service/impl/HaixinServiceImpl.java

@@ -1,8 +1,11 @@
 package com.fdkankan.contro.service.impl;
 
 import cn.hutool.core.io.FileUtil;
+import cn.hutool.core.util.StrUtil;
 import com.fdkankan.common.constant.CommonSuccessStatus;
+import com.fdkankan.common.constant.ErrorCode;
 import com.fdkankan.common.constant.SceneStatus;
+import com.fdkankan.common.exception.BusinessException;
 import com.fdkankan.common.util.CmdUtils;
 import com.fdkankan.contro.dto.UploadSceneDTO;
 import com.fdkankan.contro.entity.SceneOrigBd;
@@ -38,9 +41,15 @@ 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(taskId)){
+            throw new BusinessException(ErrorCode.PARAM_REQUIRED.code(), "taskId和kNo不能同时为空");
+        }
+
         SceneOrigBd sceneOrigBd = new SceneOrigBd();
         sceneOrigBd.setFileUrl(dto.getFileUrl());
-        sceneOrigBd.setTaskId(sceneOrigBd.getTaskId());
+        sceneOrigBd.setTaskId(dto.getKNo());
         sceneOrigBd.setKNo(dto.getKNo());
 
         sceneOrigBdService.save(sceneOrigBd);