From 3dae83e56bbdef77404be7b47d19136bb8251c8c Mon Sep 17 00:00:00 2001
From: rain <167982779@qq.com>
Date: Thu, 18 Apr 2024 10:31:11 +0800
Subject: [PATCH] 修改DB文件使用图斑功能流程

---
 src/main/java/com/dji/sample/patches/service/impl/ShpToDataSourceServiceImpl.java |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/main/java/com/dji/sample/patches/service/impl/ShpToDataSourceServiceImpl.java b/src/main/java/com/dji/sample/patches/service/impl/ShpToDataSourceServiceImpl.java
index f5e14db..72ad27d 100644
--- a/src/main/java/com/dji/sample/patches/service/impl/ShpToDataSourceServiceImpl.java
+++ b/src/main/java/com/dji/sample/patches/service/impl/ShpToDataSourceServiceImpl.java
@@ -80,10 +80,11 @@
         return multipartFile;
     }
     @Transactional
-    public void savaInMysql(List<TbDkjbxxEntity> list){
+    public void savaInMysql(List<TbDkjbxxEntity> list,String workspaceId){
         for (int i = 0; i <list.size() ; i++) {
             LotInfo lotInfo = new LotInfo();
-            lotInfo=dbConvertToEntity(list.get(i));
+            lotInfo.setWorkspaceId(workspaceId);
+            lotInfo=dbConvertToEntity(list.get(i),workspaceId);
             mapper.insert(lotInfo);
         }
     }
@@ -92,7 +93,7 @@
      * @param file 需要转换的DKJBXX对象。
      * @return 返回一个构建好的LotInfo对象,包含从数据库实体中转换来的信息。
      */
-    private LotInfo dbConvertToEntity(TbDkjbxxEntity file) {
+    private LotInfo dbConvertToEntity(TbDkjbxxEntity file,String workspaceId) {
         LotInfo.LotInfoBuilder builder = LotInfo.builder();
         if (file != null) {
             builder.bsm(file.getBsm())
@@ -109,6 +110,7 @@
                     .yzb(file.getYzb())
                     .kzxx(file.getKzxx())
                     .dklx(file.getDklx())
+                    .workspaceId(workspaceId)
                     .build();
         }
         return builder.build();

--
Gitblit v1.9.3