From 9423f2936340d82b046ec615381c1c5e03698557 Mon Sep 17 00:00:00 2001
From: yuxc <yuxc@vci-tech.com>
Date: 星期五, 27 九月 2024 17:56:53 +0800
Subject: [PATCH] 1、主要完成对获取UI上下文的定义接口的优化,优化的方向为对多次获取业务类型对象进行转换而导致耗时较久的问题继续修改,还有对多次获取属性对象进行转换对象导致耗时过长问题进行修改。 2、对树的数据查询接口的优化,对多次获取属性对象进行转换对象导致耗时过长问题进行修改。

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

diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsQueryTemplateController.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsQueryTemplateController.java
index 2db280d..bf51a1c 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsQueryTemplateController.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsQueryTemplateController.java
@@ -1,12 +1,17 @@
 package com.vci.web.controller;
 
+import cn.hutool.core.io.FileUtil;
 import com.vci.corba.common.PLException;
 import com.vci.corba.omd.qtm.QTD;
 import com.vci.dto.QTInfoDTO;
 import com.vci.starter.web.exception.VciBaseException;
 import com.vci.starter.web.pagemodel.BaseResult;
+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.OsQuereyTemplateServiceI;
+import com.vci.web.util.Func;
+import org.apache.commons.lang3.StringUtils;
 import org.dom4j.DocumentException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -15,9 +20,12 @@
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletResponse;
+import java.io.File;
 import java.io.IOException;
 import java.util.Arrays;
+import java.util.Date;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 鏌ヨ妯℃澘鐨勬帶鍒跺櫒
@@ -263,8 +271,8 @@
      * @return
      */
     @PostMapping("/expLinkTemplate")
-    public void expLinkTemplate(@RequestBody List<String> names,HttpServletResponse response) throws PLException, IOException {
-        quereyTemplateServiceI.expLinkTemplate(names, response);
+    public void expLinkTemplate(@RequestBody Map qtNames, HttpServletResponse response) throws PLException, IOException {
+        quereyTemplateServiceI.expLinkTemplate(String.valueOf(qtNames.get("qtNames")), response);
     }
 
     /**
@@ -353,8 +361,21 @@
      * @return
      */
     @PostMapping("/expBtmQTTemplate")
-    public void expBtmQTTemplate(@RequestBody List<String> names,HttpServletResponse response) throws PLException, IOException {
-        quereyTemplateServiceI.expBtmQTTemplate(names, response);
+    public void expBtmQTTemplate(@RequestBody Map qtNames, HttpServletResponse response) throws PLException, IOException {
+        try {
+            String excelPath = quereyTemplateServiceI.expBtmQTTemplate(String.valueOf(qtNames.get("qtNames")));
+            ControllerUtil.writeFileToResponse(response,excelPath);
+            FileUtil.del(LocalFileUtil.getDefaultTempFolder() + File.separator);
+        } catch (Exception e) {
+            String msg = "瀵煎嚭涓氬姟绫诲瀷鏌ヨ妯℃澘鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e);
+            try {
+                //鍑洪敊鏃�
+                e.printStackTrace();
+                ControllerUtil.writeDataToResponse(response,"error_" + Func.format(new Date(),"yyyy-MM-dd HHmmss.sss") + ".txt", StringUtils.isNotBlank(msg)?msg.getBytes():new byte[0],null);
+            } catch (IOException ioException) {
+                ioException.printStackTrace();
+            }
+        }
     }
 
     /**

--
Gitblit v1.9.3