From 435e3366a85f797ce02008698c28c9a8ca73b4a6 Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期二, 08 十月 2024 10:10:24 +0800
Subject: [PATCH] UI定义复制粘贴树查询接口,按钮复制粘贴接口

---
 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/UIManagerController.java |  161 +++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 147 insertions(+), 14 deletions(-)

diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/UIManagerController.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/UIManagerController.java
index ad31810..f3707d7 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/UIManagerController.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/UIManagerController.java
@@ -1,6 +1,7 @@
 package com.vci.web.controller;
 
 import cn.hutool.core.io.FileUtil;
+import com.vci.constant.FrameWorkLangCodeConstant;
 import com.vci.corba.common.PLException;
 import com.vci.corba.portal.data.PLTabPage;
 import com.vci.corba.portal.data.PLUILayout;
@@ -211,14 +212,32 @@
     /**
      * 瀵煎叆UI涓婁笅鏂�
      * @param file 涓婁紶鐨勬枃浠�
+     * @param isCovered 鏄惁瑕嗙洊
+     * @param selectBtm 閫夋嫨瀵煎叆鍒扮殑涓氬姟绫诲瀷
      * @return
      */
-    @PostMapping("/impUiContextData")
-    public BaseResult impUIContextData(MultipartFile file){try {
-        return uiManagerService.impUIContextData(file);
-    }catch (Throwable e) {
-        throw new VciBaseException(VciBaseUtil.getExceptionMessage(e),new String[0],e);
-    }
+    @PostMapping("/impUIContextData")
+    public BaseResult impUIContextData(MultipartFile file, boolean isCovered,String selectBtm){
+        File file1 = null;
+        try {
+            //瑕嗙洊锛屼笉闇�瑕佷紶file
+            if(!isCovered){
+                String excelFileName = LocalFileUtil.getDefaultTempFolder() + File.separator + LocalFileUtil.getFileNameForIE(file.getOriginalFilename());
+                file1 = new File(excelFileName);
+                file.transferTo(new File(excelFileName));
+            }
+            if (file != null || isCovered) {
+                return uiManagerService.impUIContextData(file1, isCovered,selectBtm);
+            } else {
+                return BaseResult.fail(FrameWorkLangCodeConstant.IMPORT_FAIL, new String[]{"鏃犲鍏ョ殑鏂囦欢"});
+            }
+        }catch (Throwable e) {
+            throw new VciBaseException(VciBaseUtil.getExceptionMessage(e),new String[0],e);
+        }finally {
+            if(!isCovered){
+                file1.delete();
+            }
+        }
     }
 
     /**
@@ -378,6 +397,102 @@
         }
     }
 
+    /**
+     * 涓氬姟绫诲瀷涓嬫媺鏌ヨ
+     * @param baseQueryObject selectBtmType 閫夋嫨鐨勬簮瀵硅薄,甯﹀垎椤典俊鎭�
+     * @return
+     * @throws PLException
+     */
+    @GetMapping( "/getBtmDatasByPage")
+    @VciBusinessLog(operateName = "涓氬姟绫诲瀷涓嬫媺鏌ヨ")
+    public BaseResult getBtmDatasByPage(BaseQueryObject baseQueryObject){
+        try {
+            return BaseResult.dataGrid(uiManagerService.getBtmDatasByPage(baseQueryObject));
+        }catch (Throwable e) {
+            e.printStackTrace();
+            String exceptionMessage = "涓氬姟绫诲瀷涓嬫媺鏌ヨ鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e);
+            logger.error(exceptionMessage);
+            return BaseResult.fail(exceptionMessage);
+        }
+    }
+
+    /**
+     * 閾炬帴绫诲瀷涓嬫媺鏌ヨ
+     * @param baseQueryObject selectBtmType 閫夋嫨鐨勬簮瀵硅薄,甯﹀垎椤典俊鎭�
+     * @return
+     * @throws PLException
+     */
+    @GetMapping( "/getLinkDatasByPage")
+    @VciBusinessLog(operateName = "閾炬帴绫诲瀷涓嬫媺鏌ヨ")
+    public BaseResult getLinkDatasByPage(BaseQueryObject baseQueryObject){
+        try {
+            return BaseResult.dataGrid(uiManagerService.getLinkDatasByPage(baseQueryObject));
+        }catch (Throwable e) {
+            e.printStackTrace();
+            String exceptionMessage = "閾炬帴绫诲瀷涓嬫媺鏌ヨ鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e);
+            logger.error(exceptionMessage);
+            return BaseResult.fail(exceptionMessage);
+        }
+    }
+
+    /**
+     * UI瀹氫箟涓嬫媺鏌ヨ锛坱emplateType涓篣I瀹氫箟鏃剁殑閫夋嫨瀵硅薄涓嬫媺鏌ヨ锛�
+     * @param baseQueryObject selectBtmType 閫夋嫨鐨勬簮瀵硅薄,甯﹀垎椤典俊鎭�
+     * @return
+     * @throws PLException
+     */
+    @GetMapping( "/getUILayoutDatasByPage")
+    @VciBusinessLog(operateName = "UI瀹氫箟涓嬫媺鏌ヨ")
+    public BaseResult getUILayoutDatasByPage(BaseQueryObject baseQueryObject){
+        try {
+            return BaseResult.dataGrid(uiManagerService.getUILayoutDatasByPage(baseQueryObject));
+        }catch (Throwable e) {
+            e.printStackTrace();
+            String exceptionMessage = "UI瀹氫箟涓嬫媺鏌ヨ鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e);
+            logger.error(exceptionMessage);
+            return BaseResult.fail(exceptionMessage);
+        }
+    }
+
+    /**
+     * 閫夋嫨妯℃澘涓嬫媺鏌ヨ
+     * @param baseQueryObject
+     * @return
+     * @throws PLException
+     */
+    @GetMapping( "/getPortalVIDatasByPage")
+    @VciBusinessLog(operateName = "閫夋嫨妯℃澘涓嬫媺鏌ヨ")
+    public BaseResult getPortalVIDatasByPage(BaseQueryObject baseQueryObject){
+        try {
+            return BaseResult.dataGrid(uiManagerService.getPortalVIDatasByPage(baseQueryObject));
+        }catch (Throwable e) {
+            e.printStackTrace();
+            String exceptionMessage = "閫夋嫨妯℃澘涓嬫媺鏌ヨ鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e);
+            logger.error(exceptionMessage);
+            return BaseResult.fail(exceptionMessage);
+        }
+    }
+
+    /**
+     * 鏌ヨ妯℃澘涓嬫媺鏌ヨ
+     * @param baseQueryObject
+     * @return
+     * @throws PLException
+     */
+    @GetMapping( "/getQTInfoDatasByPage")
+    @VciBusinessLog(operateName = "鏌ヨ妯℃澘涓嬫媺鏌ヨ")
+    public BaseResult getQTInfoDatasByPage(BaseQueryObject baseQueryObject){
+        try {
+            return BaseResult.dataGrid(uiManagerService.getQTInfoDatasByPage(baseQueryObject));
+        }catch (Throwable e) {
+            e.printStackTrace();
+            String exceptionMessage = "鏌ヨ妯℃澘涓嬫媺鏌ヨ鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e);
+            logger.error(exceptionMessage);
+            return BaseResult.fail(exceptionMessage);
+        }
+    }
+
+
     //椤甸潰璁捐涓嬮厤缃寜閽浉鍏虫帴鍙�
     /**
      * 鑾峰彇椤电鍖哄煙鎸夐挳閰嶇疆淇℃伅
@@ -403,9 +518,9 @@
      * @return 淇濆瓨缁撴灉
      */
     @PostMapping("/addTapButton")
-    public BaseResult addTapButton(@RequestBody PLTabButtonVO tabButtonVO){
+    public BaseResult addTabButton(@RequestBody PLTabButtonVO tabButtonVO){
         try {
-            return uiManagerService.addTapButton(tabButtonVO);
+            return uiManagerService.addTabButton(tabButtonVO);
         } catch (Throwable e) {
             e.printStackTrace();
             String exceptionMessage = "鎸夐挳閰嶇疆淇℃伅娣诲姞鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e);
@@ -419,10 +534,10 @@
      * @param  tabButtonVO
      * @return 淇敼缁撴灉
      */
-    @PutMapping("/updateTapButton")
-    public BaseResult updateTapButton(@RequestBody PLTabButtonVO tabButtonVO){
+    @PutMapping("/updateTapbutton")
+    public BaseResult updateTabButton(@RequestBody PLTabButtonVO tabButtonVO){
         try {
-            return uiManagerService.updateTapButton(tabButtonVO);
+            return uiManagerService.updateTabButton(tabButtonVO);
         } catch (Throwable e) {
             e.printStackTrace();
             String exceptionMessage = "淇敼鎸夐挳閰嶇疆淇℃伅鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e);
@@ -437,9 +552,9 @@
      * @return
      */
     @DeleteMapping("/deleteTapButton")
-    public BaseResult deleteTapButton(@RequestBody PLTabButtonVO tabButtonVO){
+    public BaseResult deleteTabButton(@RequestBody PLTabButtonVO tabButtonVO){
         try {
-            return uiManagerService.deleteTapButton(tabButtonVO) ? BaseResult.success("鍒犻櫎鍗曚釜鎸夐挳閰嶇疆鎴愬姛锛�"):BaseResult.fail("鍒犻櫎鍗曚釜鎸夐挳閰嶇疆澶辫触锛�");
+            return uiManagerService.deleteTabButton(tabButtonVO) ? BaseResult.success("鍒犻櫎鍗曚釜鎸夐挳閰嶇疆鎴愬姛锛�"):BaseResult.fail("鍒犻櫎鍗曚釜鎸夐挳閰嶇疆澶辫触锛�");
         } catch (PLException e) {
             e.printStackTrace();
             String exceptionMessage = "鍒犻櫎鍗曚釜鎸夐挳閰嶇疆鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e);
@@ -506,7 +621,7 @@
      */
     @PostMapping( "/authorizedUI")
     @VciBusinessLog(operateName = "UI鎺堟潈")
-    public BaseResult authorizedUI(UIAuthorDTO uiAuthorDTO){
+    public BaseResult authorizedUI(@RequestBody UIAuthorDTO uiAuthorDTO){
         try {
             return uiManagerService.authorizedUI(uiAuthorDTO)?BaseResult.success("鎺堟潈鎴愬姛!"):BaseResult.fail("鎺堟潈澶辫触锛�");
         }catch (Throwable e) {
@@ -517,4 +632,22 @@
         }
     }
 
+    /**
+     * 閫氳繃涓氬姟绫诲瀷鑾峰彇UI涓婁笅鏂囧寘鍚叾涓嬪叧鑱旂殑鍖哄煙瀹氫箟>椤甸潰瀹氫箟绛夋墍鏈夊叧鑱旀暟鎹紝褰掔撼鎴恡ree缁撴瀯
+     * @param btmName
+     * @param level
+     * @return
+     */
+    @GetMapping( "/getAllLevelTreeByBtm")
+    public BaseResult getAllLevelTreeByBtm(String btmName,String level){
+        try {
+            return BaseResult.success(uiManagerService.getAllLevelTreeByBtm(btmName,level));
+        }catch (Exception e) {
+            e.printStackTrace();
+            String exceptionMessage = "鑾峰彇UI鏍戞椂鍑虹幇閿欒锛屽師鍥狅細" + VciBaseUtil.getExceptionMessage(e);
+            logger.error(exceptionMessage);
+            return BaseResult.fail(exceptionMessage);
+        }
+    }
+
 }

--
Gitblit v1.9.3