From 980df9f28ab644d20ea73e39665f3d61f00cf94e Mon Sep 17 00:00:00 2001
From: 田源 <tianyuan@vci-tech.com>
Date: 星期一, 23 十二月 2024 14:45:05 +0800
Subject: [PATCH] 菜单折叠后图标间距问题
---
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsQueryTemplateController.java | 226 ++++++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 208 insertions(+), 18 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 7eaabfb..47e59f1 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,37 +1,30 @@
package com.vci.web.controller;
+import cn.hutool.core.io.FileUtil;
import com.vci.corba.common.PLException;
-import com.vci.corba.omd.ltm.LinkType;
import com.vci.corba.omd.qtm.QTD;
import com.vci.dto.QTInfoDTO;
-import com.vci.pagemodel.OsBtmTypeAttributeVO;
-import com.vci.pagemodel.OsBtmTypeVO;
-import com.vci.pagemodel.OsLinkTypeAttributeVO;
-import com.vci.pagemodel.OsLinkTypeVO;
-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.starter.web.pagemodel.DataGrid;
+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.OsLinkTypeServiceI;
import com.vci.web.service.OsQuereyTemplateServiceI;
+import com.vci.starter.web.util.Lcm.Func;
import org.apache.commons.lang3.StringUtils;
import org.dom4j.DocumentException;
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 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.HashMap;
-import java.util.List;
-import java.util.stream.Collectors;
+import java.util.Date;
+import java.util.Map;
/**
* 鏌ヨ妯℃澘鐨勬帶鍒跺櫒
@@ -63,6 +56,26 @@
public BaseResult queryTemplateList(String btmName,Boolean linkFlag){
try {
return quereyTemplateServiceI.queryTemplateList(btmName,linkFlag);
+ } catch (PLException e) {
+ BaseResult objectBaseResult = new BaseResult<>();
+ objectBaseResult.setCode(Integer.parseInt(e.code));
+ objectBaseResult.setMsg(Arrays.toString(e.messages));
+ return objectBaseResult;
+ }
+ }
+
+
+ /**
+ * 鏌ヨ妯℃澘鐨勫垪琛ㄦ坊鍔犱簡瀛楁鐨勭浉鍏冲睘鎬�
+ * @param btmName 绫诲瀷
+ * @param linkFlag 鏄惁閾炬帴绫诲瀷 锛歵rue 閾炬帴绫诲瀷 锛宖alse 涓氬姟绫诲瀷
+ * @param direction 姝e弽鏂瑰悜
+ * @return 鏌ヨ妯℃澘鐨勫垪琛�
+ */
+ @GetMapping("/queryTemplateListByAttr")
+ public BaseResult queryTemplateListByAttr(String btmName,Boolean linkFlag, String direction){
+ try {
+ return quereyTemplateServiceI.queryTemplateListByAttr(btmName,linkFlag,direction);
} catch (PLException e) {
BaseResult objectBaseResult = new BaseResult<>();
objectBaseResult.setCode(Integer.parseInt(e.code));
@@ -124,7 +137,7 @@
/**
* 鏌ヨ鏉′欢鐨勬煡璇㈡寜閽煡璇is鍒楄〃
- * @param dataMap 浼犺緭鐨勬暟鎹璞★細
+ * @param qtInfoDTO 浼犺緭鐨勬暟鎹璞★細
* linkTypeName 閾炬帴绫诲瀷鍚嶇О銆�
* rdPositive 鏂瑰悜锛宼rue姝e悜锛宖alse鍙嶅悜
* btmName 涓氬姟绫诲瀷鍚嶇О
@@ -134,10 +147,43 @@
* level 瀛愯妭鐐瑰眰鏁�
* @return 鏌ヨ缁撴灉
*/
- @GetMapping("/getCriteria")
- public BaseResult getCriteria(@RequestBody HashMap<String,Object> dataMap){
+ @PostMapping("/getCriteria")
+ public BaseResult getCriteria(@RequestBody QTInfoDTO qtInfoDTO){
try {
- return quereyTemplateServiceI.getCriteria(dataMap);
+ return quereyTemplateServiceI.getCriteria(qtInfoDTO);
+ } catch (PLException e) {
+ BaseResult objectBaseResult = new BaseResult<>();
+ objectBaseResult.setCode(Integer.parseInt(e.code));
+ objectBaseResult.setMsg(Arrays.toString(e.messages));
+ return objectBaseResult;
+ }
+ }
+
+ /**
+ * 涓氬姟绫诲瀷鏌ヨ妯℃澘涓嬬殑鏌ヨ鏉′欢鐨勬煡璇㈡寜閽煡璇ist鍒楄〃
+ * @param qtInfoDTO
+ * @return 鏌ヨ缁撴灉
+ */
+ @PostMapping("/getCriteriaBtm")
+ public BaseResult getCriteriaBtm(@RequestBody QTInfoDTO qtInfoDTO){
+ try {
+ return quereyTemplateServiceI.getCriteriaBtm(qtInfoDTO);
+ } catch (PLException e) {
+ BaseResult objectBaseResult = new BaseResult<>();
+ objectBaseResult.setCode(Integer.parseInt(e.code));
+ objectBaseResult.setMsg(Arrays.toString(e.messages));
+ return objectBaseResult;
+ }
+ }
+
+ /**
+ * 鏌ヨ鏉′欢涓嬬殑閫夋嫨鏌ヨ妯℃澘瀵硅瘽妗嗭紙鏌ヨ鍏ㄩ儴妯℃澘鍜屾墍瀵瑰簲鐨勪笟鍔$被鍨嬫垨閾炬帴绫诲瀷鍚嶏級
+ * @return
+ */
+ @GetMapping("/getAllQTs")
+ public BaseResult getAllQTs(){
+ try {
+ return quereyTemplateServiceI.getAllQTs();
} catch (PLException e) {
BaseResult objectBaseResult = new BaseResult<>();
objectBaseResult.setCode(Integer.parseInt(e.code));
@@ -202,4 +248,148 @@
return objectBaseResult;
}
}
+
+ /**
+ * 閾炬帴绫诲瀷鏌ヨ妯℃澘鏍戞煡璇紝鐢ㄤ簬鐣岄潰鐨勫鍑哄姛鑳�
+ * @return 鏌ヨ缁撴灉
+ */
+ @GetMapping("/getLinkTree")
+ public BaseResult getLinkTree(){
+ try {
+ return quereyTemplateServiceI.getLinkTree();
+ } catch (PLException e) {
+ BaseResult objectBaseResult = new BaseResult<>();
+ objectBaseResult.setCode(Integer.parseInt(e.code));
+ objectBaseResult.setMsg(Arrays.toString(e.messages));
+ return objectBaseResult;
+ }
+ }
+
+ /**
+ * 瀵煎嚭閾炬帴绫诲瀷鏌ヨ妯℃澘
+ * names 鏌ヨ妯℃澘鍚�
+ * @return
+ */
+ @PostMapping("/expLinkTemplate")
+ public void expLinkTemplate(@RequestBody Map qtNames, HttpServletResponse response) throws PLException, IOException {
+ quereyTemplateServiceI.expLinkTemplate(String.valueOf(qtNames.get("qtNames")), response);
+ }
+
+ /**
+ * 瀵煎叆閾炬帴绫诲瀷鏌ヨ妯℃澘
+ * @param file 涓婁紶鐨勬枃浠�
+ * @return 瀵煎叆缁撴灉
+ */
+ @PostMapping("/impLinkTemplate")
+ public BaseResult impLinkTemplate(MultipartFile file){
+ try {
+ return quereyTemplateServiceI.impLinkTemplate(file);
+ }catch (Throwable e) {
+ throw new VciBaseException(VciBaseUtil.getExceptionMessage(e),new String[0],e);
+ }
+ }
+
+ /**
+ * 鏌ヨ鏂规鍒犻櫎
+ * @param names 鏌ヨ鏂规鍚�
+ * @return 鎿嶄綔缁撴灉
+ */
+ @DeleteMapping("/deleteLinkTemplate")
+ public BaseResult deleteLinkTemplate(String names){
+ try {
+ return quereyTemplateServiceI.deleteLinkTemplate(names);
+ } catch (PLException e) {
+ BaseResult objectBaseResult = new BaseResult<>();
+ objectBaseResult.setCode(Integer.parseInt(e.code));
+ objectBaseResult.setMsg(Arrays.toString(e.messages));
+ return objectBaseResult;
+ }
+ }
+
+ /**
+ * 涓氬姟绫诲瀷鏌ヨ妯℃澘淇濆瓨
+ * @param qtInfoDTO 淇濆瓨浼犺緭瀵硅薄
+ * @return 淇濆瓨缁撴灉
+ */
+ @PostMapping("/btmSave")
+ public BaseResult btmSave(@RequestBody QTInfoDTO qtInfoDTO){
+ try {
+ return quereyTemplateServiceI.btmSave(qtInfoDTO);
+ } catch (PLException e) {
+ BaseResult objectBaseResult = new BaseResult<>();
+ objectBaseResult.setCode(Integer.parseInt(e.code));
+ objectBaseResult.setMsg(Arrays.toString(e.messages));
+ return objectBaseResult;
+ }
+ }
+
+ /**
+ * 鏇存柊鏁版嵁搴撶粨鏋�
+ * @return 鏇存柊缁撴灉
+ */
+ @PostMapping("/updateDBStructure")
+ public BaseResult btmSave(){
+ try {
+ return quereyTemplateServiceI.updateDBStructure();
+ } catch (PLException e) {
+ BaseResult objectBaseResult = new BaseResult<>();
+ objectBaseResult.setCode(Integer.parseInt(e.code));
+ objectBaseResult.setMsg(Arrays.toString(e.messages));
+ return objectBaseResult;
+ }
+ }
+
+ /**
+ * 涓氬姟绫诲瀷鏌ヨ妯℃澘鏍戞煡璇紝鐢ㄤ簬鐣岄潰鐨勫鍑哄姛鑳�
+ * @return 鏌ヨ缁撴灉
+ */
+ @GetMapping("/getBtmQtTree")
+ public BaseResult getBtmQtTree(){
+ try {
+ return quereyTemplateServiceI.getBtmQtTree();
+ } catch (PLException e) {
+ BaseResult objectBaseResult = new BaseResult<>();
+ objectBaseResult.setCode(Integer.parseInt(e.code));
+ objectBaseResult.setMsg(Arrays.toString(e.messages));
+ return objectBaseResult;
+ }
+ }
+
+ /**
+ * 瀵煎嚭涓氬姟绫诲瀷鏌ヨ妯℃澘
+ * names 鏌ヨ妯℃澘鍚�
+ * @return
+ */
+ @PostMapping("/expBtmQTTemplate")
+ 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();
+ }
+ }
+ }
+
+ /**
+ * 瀵煎叆涓氬姟绫诲瀷鏌ヨ妯℃澘
+ * @param file 涓婁紶鐨勬枃浠�
+ * @return 瀵煎叆缁撴灉
+ */
+ @PostMapping("/impBtmTemplate")
+ public BaseResult impBtmTemplate(MultipartFile file){
+ try {
+ return quereyTemplateServiceI.impBtmTemplate(file);
+ }catch (Throwable e) {
+ throw new VciBaseException(VciBaseUtil.getExceptionMessage(e),new String[0],e);
+ }
+ }
+
}
--
Gitblit v1.9.3