From 5203081b68e3a8dc139d1807b2f8774e4a00a82a Mon Sep 17 00:00:00 2001
From: ludc <ludc@vci-tech.com>
Date: 星期四, 16 一月 2025 11:11:59 +0800
Subject: [PATCH] 退出登录接口增加清除session、jwttoken等缓存信息

---
 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebUIDataController.java |   99 +++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 83 insertions(+), 16 deletions(-)

diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebUIDataController.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebUIDataController.java
index c436ff7..5a6ae2f 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebUIDataController.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebUIDataController.java
@@ -1,6 +1,8 @@
 package com.vci.web.controller;
 
+import com.alibaba.fastjson.JSON;
 import com.vci.corba.common.PLException;
+import com.vci.corba.query.data.KV;
 import com.vci.dto.DeleteDataDTO;
 import com.vci.dto.DeleteLinkDataDTO;
 import com.vci.dto.FormDataDTO;
@@ -11,20 +13,20 @@
 import com.vci.starter.web.pagemodel.*;
 import com.vci.pagemodel.ReferConfigVO;
 import com.vci.pagemodel.UIFormDataVO;
+import com.vci.starter.web.util.Lcm.Func;
 import com.vci.starter.web.util.VciBaseUtil;
-import com.vci.web.query.UIDataGridQuery;
-import com.vci.web.query.UIFormQuery;
-import com.vci.web.query.UITreeQuery;
-import com.vci.web.service.UIDataServiceI;
+import com.vci.query.UIDataGridQuery;
+import com.vci.query.UIFormQuery;
+import com.vci.query.UITreeQuery;
+import com.vci.web.service.uidataservice.UIDataCommonServiceI;
+import com.vci.web.util.PlatformClientUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.*;
 
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 /**
  * ui瀹氫箟鐨勬暟鎹煡璇�
@@ -40,7 +42,7 @@
      * 鐣岄潰鐨勬暟鎹湇鍔�
      */
     @Autowired
-    private UIDataServiceI uiDataService;
+    private UIDataCommonServiceI uiDataService;
 
     /**
      * 鏃ュ織
@@ -53,10 +55,17 @@
      * @return 鍒楄〃鏁版嵁
      */
     @PostMapping("/dataGridQuery")
-    @VciUnCheckRight
+    //@VciUnCheckRight
     @VciBusinessLog(operateName = "鍒楄〃鏁版嵁鐨勬煡璇�",description = "${param.btmname}閲岀殑${param.tableDefineId}")
-    public DataGrid dataGrid(UIDataGridQuery dataGridQuery) throws PLException {
-        return uiDataService.getDataForGrid(dataGridQuery);
+    public BaseResult dataGrid(UIDataGridQuery dataGridQuery) throws Exception {
+        try {
+            return BaseResult.dataGrid(uiDataService.getDataForGrid(dataGridQuery));
+        }catch (Exception e){
+            e.printStackTrace();
+            String errorMsg = "琛ㄥ崟鏁版嵁鏌ヨ鏃跺嚭鐜伴敊璇紝鍘熷洜锛�"+ VciBaseUtil.getExceptionMessage(e);
+            logger.error(errorMsg);
+            throw new VciBaseException(errorMsg);
+        }
     }
 
     /**
@@ -65,7 +74,7 @@
      * @return 琛ㄥ崟鐨勬暟鎹�
      */
     @PostMapping("/dataFormQuery")
-    @VciUnCheckRight
+    //@VciUnCheckRight
     @VciBusinessLog(operateName = "琛ㄥ崟鐨勬煡璇�",description = "${param.btmname}閲岀殑${param.formDefineId}")
     public BaseResult<UIFormDataVO> getDataForForm(UIFormQuery formQuery){
         try {
@@ -84,10 +93,66 @@
      * @return 鏍戠殑鏁版嵁
      */
     @PostMapping("/getDataForTree")
-    @VciUnCheckRight
+    //@VciUnCheckRight
     @VciBusinessLog(operateName = "鏍戠殑鏌ヨ",description = "${param.btmname}")
-    public List<Tree> getDataForTree(UITreeQuery treeQuery){
-        return uiDataService.getDataForTree(treeQuery);
+    public BaseResult getDataForTree(UITreeQuery treeQuery){
+        try {
+            return BaseResult.tree(uiDataService.getDataForTree(treeQuery));
+        }catch (Exception e){
+            e.printStackTrace();
+            String errorMsg = "鏍戠殑鏁版嵁鏌ヨ鍑虹幇閿欒锛屽師鍥狅細"+ VciBaseUtil.getExceptionMessage(e);
+            logger.error(errorMsg);
+            throw new VciBaseException(errorMsg);
+        }
+    }
+
+    /**
+     * 娴嬭瘯鑷畾涔塙RL鏂瑰紡鏌ヨ
+     * @param dataGridQuery
+     * @return
+     */
+    @PostMapping("/getTestPartQueryList")
+    public BaseResult getTestPartQueryList(UIDataGridQuery dataGridQuery) throws PLException {
+        PlatformClientUtil platformClientUtil = new PlatformClientUtil();
+        String sql = "select * from " + VciBaseUtil.getTableName(dataGridQuery.getBtmName())
+                + " where oid in ('D5DFA9D3-D2AF-4D1D-850F-73B102532740','BCE5B0E3-A49C-2453-8E62-8F4C7F4BEDF2','257BB15B-12CF-68D2-FCFE-1FA3E29DBD1E')";
+        KV[][] kvs = platformClientUtil.getQueryService().queryBySql(sql);
+        List<Map<String, Object>> resulListMap = new ArrayList<>();
+        for (KV[] kvArray : kvs) {
+            Map<String, Object> map = new HashMap<>();
+            for (KV kv : kvArray) {
+                if (kv.key != null && kv.value != null) {
+                    //杩斿洖鍏ㄥ皬鍐欑殑
+                    map.put(kv.key.toLowerCase(Locale.ROOT), kv.value);
+                }
+            }
+            resulListMap.add(map);
+        }
+        DataGrid dataGrid = new DataGrid();
+        dataGrid.setData(resulListMap);
+        dataGrid.setTotal(resulListMap.size());
+        // TODO: 2024/12/5 Ludc 杩欏効杩樺彲浠ユ寜鐓ataGridQuery.getTableDefineId()鏉ユ煡璇㈣〃鏍煎畾涔夌殑鍐呭锛�
+        //  鐒跺悗鏍规嵁閰嶇疆鐨勯〉闈俊鎭潵澶勭悊瑕佹煡璇㈡潯浠舵垨鍒椾互鍙婅繑鍥炵殑鍙傛暟
+        return BaseResult.dataGrid(dataGrid);
+    }
+
+    /**
+     * 鏍规嵁鏌ヨ妯℃澘鏌ヨ鏁版嵁锛岃繑鍥炲�兼寜鐓ч〉闈㈠畾涔�
+     * @param treeQuery 鏍戞煡璇㈠璞�
+     * @return 鏍戠殑鏁版嵁
+     */
+    @PostMapping("/getDataByTemp")
+    //@VciUnCheckRight
+    @VciBusinessLog(operateName = "鏌ヨ")
+    public BaseResult getDataByTemp(UITreeQuery treeQuery){
+        try {
+            return uiDataService.getDataByTemp(treeQuery);
+        }catch (Exception e){
+            e.printStackTrace();
+            String errorMsg = "鏁版嵁鏌ヨ鍑虹幇閿欒锛屽師鍥狅細"+ VciBaseUtil.getExceptionMessage(e);
+            logger.error(errorMsg);
+            throw new VciBaseException(errorMsg);
+        }
     }
 
     /**
@@ -96,7 +161,7 @@
      * @return 鎵ц鐨勭粨鏋�
      */
     @PostMapping("/addSave")
-    @VciUnCheckRight
+    //@VciUnCheckRight
     @VciBusinessLog(operateName = "娣诲姞鏁版嵁",description = "${param.btmname}")
     public BaseResult<Map<String,Object>> addSave(@RequestBody FormDataDTO formDataDTO){
         try {
@@ -270,6 +335,7 @@
         re.setData(dataMapList);
         return re;
     }
+
     /**
      * 鍙樻洿鎵�鏈夎��
      * @param btmname 涓氬姟绫诲瀷
@@ -306,4 +372,5 @@
             return objectBaseResult;
         }
     }
+
 }

--
Gitblit v1.9.3