From d0ae279ff3b83358d1c07f4481a041c4ad335026 Mon Sep 17 00:00:00 2001
From: dangsn <dangsn@chicecm.com>
Date: 星期二, 03 十二月 2024 11:57:38 +0800
Subject: [PATCH] 提取业务系统使用的功能,独立出一个单独的模块

---
 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsAttributeController.java |   30 +++++++++++++++++++++++++-----
 1 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsAttributeController.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsAttributeController.java
index ae35b5d..8f20767 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsAttributeController.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsAttributeController.java
@@ -2,17 +2,18 @@
 
 import com.vci.constant.FrameWorkLangCodeConstant;
 import com.vci.dto.OsAttributeDTO;
-import com.vci.starter.web.annotation.controller.VciUnCheckRight;
 import com.vci.starter.web.annotation.log.VciBusinessLog;
 import com.vci.starter.web.exception.VciBaseException;
 import com.vci.starter.web.pagemodel.BaseQueryObject;
 import com.vci.starter.web.pagemodel.BaseResult;
 import com.vci.pagemodel.OsAttributeVO;
+import com.vci.starter.web.pagemodel.Tree;
+import com.vci.starter.web.pagemodel.TreeQueryObject;
 import com.vci.starter.web.util.ControllerUtil;
 import com.vci.starter.web.util.LocalFileUtil;
 import com.vci.starter.web.util.VciBaseUtil;
 import com.vci.web.service.OsAttributeServiceI;
-import com.vci.web.util.Func;
+import com.vci.starter.web.util.Lcm.Func;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -45,6 +46,25 @@
      * 鏃ュ織
      */
     private Logger logger = LoggerFactory.getLogger(getClass());
+
+    /**
+     * 鑾峰彇鎵�鏈夊睘鎬э紙鏍戝舰缁撴瀯锛�
+     * @return 鏌ヨ缁撴灉
+     */
+    @GetMapping( "/getTreeAttributes")
+    @VciBusinessLog(operateName = "鑾峰彇灞炴�э紙鏍戝舰缁撴瀯锛�")
+    public BaseResult<List<Tree>> getTreeAttributesByBtmName(TreeQueryObject treeQueryObject){
+        try {
+            List<Tree> trees = attributeService.getTreeAttributesByBtmName(treeQueryObject);
+            return BaseResult.dataList(trees);
+          //  return BaseResult.tree(trees);
+        }catch (Throwable e) {
+            e.printStackTrace();
+            String exceptionMessage = "鏌ヨ涓氬姟绫诲瀷鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e);
+            logger.error(exceptionMessage);
+            return BaseResult.fail(exceptionMessage);
+        }
+    }
 
     /**
      * 灞炴�у垪琛�
@@ -85,7 +105,7 @@
     /**
      * 娣诲姞鍗曟潯灞炴�у埌灞炴�ф睜
      * @param osAttributeDTO
-     * @return 鍒楄〃鐨勫唴瀹�
+     * @return
      */
     @PostMapping( "/addAttribute")
     @VciBusinessLog(operateName = "娣诲姞灞炴��")
@@ -167,7 +187,7 @@
             String excelPath = attributeService.exportAttributes(exportFileName,attrNames,false);
             ControllerUtil.writeFileToResponse(response,excelPath);
         } catch (Exception e) {
-            String msg = "瀵煎嚭鏋氫妇鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e);
+            String msg = "瀵煎嚭灞炴�ф椂鍑虹幇閿欒锛屽師鍥狅細" + VciBaseUtil.getExceptionMessage(e);
             try {
                 //鍑洪敊鏃�
                 e.printStackTrace();
@@ -214,7 +234,7 @@
         try {
             file.transferTo(new File(excelFileName));
             if (file != null) {
-                return attributeService.importAttributes(file1);
+                return attributeService.importAttributes(file1,false);
             } else {
                 return BaseResult.fail(FrameWorkLangCodeConstant.IMPORT_FAIL, new String[]{"鏃犲鍏ョ殑鏂囦欢"});
             }

--
Gitblit v1.9.3