From 98c8e73c57f8f76e5720a066f155ebfff2a7cc5f Mon Sep 17 00:00:00 2001
From: rain <167982779@qq.com>
Date: Thu, 18 Apr 2024 20:05:48 +0800
Subject: [PATCH] 修改DB成果展示入库失败,增加TbfjEntity表的字段,无对应字段默认0.
---
src/main/java/com/dji/sample/territory/controller/TbFjController.java | 18 +++++++++++-------
1 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/src/main/java/com/dji/sample/territory/controller/TbFjController.java b/src/main/java/com/dji/sample/territory/controller/TbFjController.java
index ee3a4c2..c65dbed 100644
--- a/src/main/java/com/dji/sample/territory/controller/TbFjController.java
+++ b/src/main/java/com/dji/sample/territory/controller/TbFjController.java
@@ -1,4 +1,5 @@
package com.dji.sample.territory.controller;
+
import com.dji.sample.common.model.ResponseResult;
import com.dji.sample.media.model.MediaFileEntity;
import com.dji.sample.patches.model.entity.LotInfo;
@@ -10,6 +11,7 @@
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
+
import java.io.IOException;
import java.util.List;
@@ -26,14 +28,16 @@
@PostMapping("/insertDb")
public ResponseResult insertDb(String dkbh, String workspaceId) throws IOException {
List<MediaFileEntity> list = getPatches.listPohto(dkbh, workspaceId);
- if(list.size()==0){
- return ResponseResult.error("未找到该照片、视频信息");}
+ if (list.size() == 0) {
+ return ResponseResult.error("未找到该照片、视频信息");
+ }
LotInfo lotInfo = getPatches.getLotinfo(dkbh, workspaceId);
- if(lotInfo==null){
- return ResponseResult.error("未找到该图斑信息");}
- TbFjEntity entity=tbFJService.insertData(list, lotInfo);
- if (entity!=null){
- return ResponseResult.success("上传成功");
+ if (lotInfo == null) {
+ return ResponseResult.error("未找到该图斑信息");
+ }
+ int num = tbFJService.insertData(list, lotInfo);
+ if (num != 0) {
+ return ResponseResult.success("上传成功,上传了" + num + "个文件");
}
return ResponseResult.error("上传失败");
}
--
Gitblit v1.9.3