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/OsQueryTemplateController.java | 250 ++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 231 insertions(+), 19 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 8202ace..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,36 +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.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.dto.QTInfoDTO; 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; /** * 鏌ヨ妯℃澘鐨勬帶鍒跺櫒 @@ -62,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)); @@ -123,7 +137,7 @@ /** * 鏌ヨ鏉′欢鐨勬煡璇㈡寜閽煡璇is鍒楄〃 - * @param dataMap 浼犺緭鐨勬暟鎹璞★細 + * @param qtInfoDTO 浼犺緭鐨勬暟鎹璞★細 * linkTypeName 閾炬帴绫诲瀷鍚嶇О銆� * rdPositive 鏂瑰悜锛宼rue姝e悜锛宖alse鍙嶅悜 * btmName 涓氬姟绫诲瀷鍚嶇О @@ -133,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)); @@ -160,7 +207,11 @@ objectBaseResult.setMsg(Arrays.toString(e.messages)); return objectBaseResult; } catch (DocumentException e) { - throw new RuntimeException(e); + e.printStackTrace(); + BaseResult objectBaseResult = new BaseResult<>(); + objectBaseResult.setCode(500); + objectBaseResult.setMsg(Arrays.toString(e.getMessage().toCharArray())); + return objectBaseResult; } } @@ -180,4 +231,165 @@ return objectBaseResult; } } + + /** + * 閾炬帴绫诲瀷鏌ヨ妯℃澘淇濆瓨 + * @param qtInfoDTO 淇濆瓨浼犺緭瀵硅薄 + * @return 淇濆瓨缁撴灉 + */ + @PostMapping("/linkSave") + public BaseResult linkSave(@RequestBody QTInfoDTO qtInfoDTO){ + try { + return quereyTemplateServiceI.linkSave(qtInfoDTO); + } catch (PLException e) { + BaseResult objectBaseResult = new BaseResult<>(); + objectBaseResult.setCode(Integer.parseInt(e.code)); + objectBaseResult.setMsg(Arrays.toString(e.messages)); + 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