From 7ff5e9edadf446d0d033574a7b0ae802f5ac2233 Mon Sep 17 00:00:00 2001
From: cl <418351270@qq.com>
Date: 星期六, 17 二月 2024 15:36:20 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 jcdm-main/src/main/java/com/jcdm/main/bs/workshop/controller/BsWorkshopInfoController.java |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/jcdm-main/src/main/java/com/jcdm/main/bs/workshop/controller/BsWorkshopInfoController.java b/jcdm-main/src/main/java/com/jcdm/main/bs/workshop/controller/BsWorkshopInfoController.java
index fed473f..83492f6 100644
--- a/jcdm-main/src/main/java/com/jcdm/main/bs/workshop/controller/BsWorkshopInfoController.java
+++ b/jcdm-main/src/main/java/com/jcdm/main/bs/workshop/controller/BsWorkshopInfoController.java
@@ -3,6 +3,7 @@
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
 
+import com.jcdm.common.core.domain.entity.SysUser;
 import com.jcdm.main.bs.workshop.service.IBsWorkshopInfoService;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -21,9 +22,10 @@
 import com.jcdm.main.bs.workshop.domain.BsWorkshopInfo;
 import com.jcdm.common.utils.poi.ExcelUtil;
 import com.jcdm.common.core.page.TableDataInfo;
+import org.springframework.web.multipart.MultipartFile;
 
 /**
- * 杞﹂棿淇℃伅Controller
+ * 杞﹂棿淇℃伅Controller123
  * 
  * @author jc
  * @date 2023-12-06
@@ -102,4 +104,21 @@
     {
         return toAjax(bsWorkshopInfoService.deleteBsWorkshopInfoByIds(ids));
     }
+
+    @PostMapping("/importTemplate")
+    public void importTemplate(HttpServletResponse response)
+    {
+        ExcelUtil<BsWorkshopInfo> util = new ExcelUtil<>(BsWorkshopInfo.class);
+        util.importTemplateExcel(response, "杞﹂棿鏁版嵁");
+    }
+
+    @PostMapping("/importData")
+    public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
+    {
+        ExcelUtil<BsWorkshopInfo> util = new ExcelUtil<BsWorkshopInfo>(BsWorkshopInfo.class);
+        List<BsWorkshopInfo> workshopList = util.importExcel(file.getInputStream());
+        String operName = getUsername();
+        String message = bsWorkshopInfoService.importWrokshop(workshopList, updateSupport, operName);
+        return success(message);
+    }
 }

--
Gitblit v1.9.3