From 7b3d5fb08fdbd2ce574c3b9ab666c8c7082be728 Mon Sep 17 00:00:00 2001 From: ludc Date: 星期五, 06 九月 2024 15:38:35 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsQueryTemplateController.java | 147 +++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 130 insertions(+), 17 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 0313038..2db280d 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,23 @@ package com.vci.web.controller; 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.VciBaseUtil; -import com.vci.web.service.OsLinkTypeServiceI; import com.vci.web.service.OsQuereyTemplateServiceI; -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.IOException; import java.util.Arrays; -import java.util.HashMap; import java.util.List; -import java.util.stream.Collectors; /** * 鏌ヨ妯℃澘鐨勬帶鍒跺櫒 @@ -63,6 +49,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)); @@ -138,6 +144,39 @@ public BaseResult getCriteria(@RequestBody QTInfoDTO qtInfoDTO){ try { 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)); @@ -244,13 +283,13 @@ /** * 鏌ヨ鏂规鍒犻櫎 - * @param templateNames 鏌ヨ鏂规鍚� + * @param names 鏌ヨ鏂规鍚� * @return 鎿嶄綔缁撴灉 */ @DeleteMapping("/deleteLinkTemplate") - public BaseResult deleteLinkTemplate(@RequestBody List<String> templateNames){ + public BaseResult deleteLinkTemplate(String names){ try { - return quereyTemplateServiceI.deleteLinkTemplate(templateNames); + return quereyTemplateServiceI.deleteLinkTemplate(names); } catch (PLException e) { BaseResult objectBaseResult = new BaseResult<>(); objectBaseResult.setCode(Integer.parseInt(e.code)); @@ -258,4 +297,78 @@ 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 List<String> names,HttpServletResponse response) throws PLException, IOException { + quereyTemplateServiceI.expBtmQTTemplate(names, response); + } + + /** + * 瀵煎叆涓氬姟绫诲瀷鏌ヨ妯℃澘 + * @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