From 21d786a59d9c2fc4be0f18e1658abe7f348576e5 Mon Sep 17 00:00:00 2001 From: ludc Date: 星期五, 06 九月 2024 15:24:10 +0800 Subject: [PATCH] ui定义:区域定义:页面表格查询、添加、修改、删除。 页面设计:添加、修改、查询等接口上传 --- Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/UIManagerController.java | 125 ++++++++++++++++++++++++++++++++++++++++- 1 files changed, 120 insertions(+), 5 deletions(-) diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/UIManagerController.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/UIManagerController.java index 5d143b7..324c57f 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/UIManagerController.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/UIManagerController.java @@ -1,10 +1,13 @@ package com.vci.web.controller; import com.vci.corba.common.PLException; +import com.vci.corba.portal.data.PLTabPage; import com.vci.corba.portal.data.PLUILayout; import com.vci.dto.OsBtmTypeDTO; import com.vci.pagemodel.PLUILayoutCloneVO; +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.util.VciBaseUtil; @@ -14,8 +17,12 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; 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.List; /** * UI瀹氫箟鎺у埗灞� @@ -121,9 +128,9 @@ * @return 鍒犻櫎缁撴灉 */ @DeleteMapping("/delUIContextData") - public BaseResult delUIContextData(String[] oids){ + public BaseResult delUIContextData(String[] oids,String plRelatedType){ try { - return uiManagerService.delUIContextData(oids) ? BaseResult.success("UI涓婁笅鏂囧垹闄ゆ垚鍔燂紒"):BaseResult.fail("UI涓婁笅鏂囧垹闄ゅけ璐ワ紒"); + return uiManagerService.delUIContextData(oids,plRelatedType) ? BaseResult.success("UI涓婁笅鏂囧垹闄ゆ垚鍔燂紒"):BaseResult.fail("UI涓婁笅鏂囧垹闄ゅけ璐ワ紒"); } catch (PLException e) { e.printStackTrace(); String exceptionMessage = "鍒犻櫎UI涓婁笅鏂囨椂鍑虹幇閿欒锛屽師鍥狅細" + VciBaseUtil.getExceptionMessage(e); @@ -137,10 +144,10 @@ * pluiLayoutCloneVO 鍏嬮殕鍙傛暟瀵硅薄 * @return 鍏嬮殕缁撴瀯 */ - @PostMapping("/cloneUiContextData") - public BaseResult cloneUiContextData(@RequestBody PLUILayoutCloneVO pluiLayoutCloneVO){ + @PostMapping("/cloneUIContextData") + public BaseResult cloneUIContextData(@RequestBody PLUILayoutCloneVO pluiLayoutCloneVO){ try { - return uiManagerService.cloneUiContextData(pluiLayoutCloneVO) ? BaseResult.success("UI涓婁笅鏂囧厠闅嗘垚鍔燂紒"):BaseResult.fail("UI涓婁笅鏂囧厠闅嗗け璐ワ紒"); + return uiManagerService.cloneUIContextData(pluiLayoutCloneVO) ? BaseResult.success("UI涓婁笅鏂囧厠闅嗘垚鍔燂紒"):BaseResult.fail("UI涓婁笅鏂囧厠闅嗗け璐ワ紒"); } catch (PLException e) { e.printStackTrace(); String exceptionMessage = "UI涓婁笅鏂囧厠闅嗘椂鍑虹幇閿欒锛屽師鍥狅細" + VciBaseUtil.getExceptionMessage(e); @@ -149,6 +156,114 @@ } } + /** + * 瀵煎嚭UI涓婁笅鏂� + * name 閾炬帴绫诲瀷鍚嶇О + * @return + */ + @GetMapping("/expUIContextData") + public void expUIContextData(String[] oids, HttpServletResponse response) throws PLException, IOException { + uiManagerService.expUIContextData(oids, response); + } + /** + * 瀵煎叆UI涓婁笅鏂� + * @param file 涓婁紶鐨勬枃浠� + * @return + */ + @PostMapping("/impUiContextData") + public BaseResult impUIContextData(MultipartFile file){try { + return uiManagerService.impUIContextData(file); + }catch (Throwable e) { + throw new VciBaseException(VciBaseUtil.getExceptionMessage(e),new String[0],e); + } + } + + /** + * 鏍规嵁涓婁笅鏂嘔D鍜屽尯鍩熺被鍨嬶紝鎸夐『搴忚幏鍙栧綋鍓嶅尯鍩熺殑tab椤� + * @param contextId + * @param areaType + * @return + */ + @GetMapping( "/getTabByContextIdAndType") + @VciBusinessLog(operateName = "鏍规嵁涓婁笅鏂嘔D鍜屽尯鍩熺被鍨嬶紝鎸夐『搴忚幏鍙栧綋鍓嶅尯鍩熺殑tab椤�") + public BaseResult<List<PLTabPage>> getTabByContextIdAndType(String contextId, int areaType){ + try { + return BaseResult.dataList(uiManagerService.getTabByContextIdAndType(contextId,areaType)); + }catch (Exception e) { + e.printStackTrace(); + String exceptionMessage = "鏍规嵁涓婁笅鏂嘔D鍜屽尯鍩熺被鍨嬶紝鎸夐『搴忚幏鍙栧綋鍓嶅尯鍩熺殑tab鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e); + logger.error(exceptionMessage); + return BaseResult.fail(exceptionMessage); + } + } + + /** + * 鍒涘缓鍖哄煙鏁版嵁 + * @param plTabPage + * @return 淇濆瓨缁撴灉 + */ + @PostMapping("/addTabData") + public BaseResult addTabData(@RequestBody PLTabPage plTabPage){ + try { + return uiManagerService.addTabData(plTabPage) ? BaseResult.success("鍒涘缓鎴愬姛锛�"):BaseResult.fail("鍒涘缓澶辫触锛�"); + } catch (Exception e) { + e.printStackTrace(); + String exceptionMessage = "鍒涘缓鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e); + logger.error(exceptionMessage); + return BaseResult.fail(exceptionMessage); + } + } + + /** + * 淇敼鍖哄煙鏁版嵁 + * @param plTabPage + * @return 淇敼缁撴灉 + */ + @PutMapping("/updateTabData") + public BaseResult updateTabData(@RequestBody PLTabPage plTabPage){ + try { + return uiManagerService.updateTabData(plTabPage) ? BaseResult.success("淇敼鎴愬姛锛�"):BaseResult.fail("淇敼澶辫触锛�"); + } catch (Exception e) { + e.printStackTrace(); + String exceptionMessage = "淇敼鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e); + logger.error(exceptionMessage); + return BaseResult.fail(exceptionMessage); + } + } + + /** + * UI瑙f瀽绫绘鍒欐鏌� + * @param extAttr + * @return + */ + @GetMapping("/checkTabPageExtAttrIsOk") + public BaseResult checkTabPageExtAttrIsOk(String extAttr){ + try { + return uiManagerService.checkTabPageExtAttrIsOk(extAttr); + }catch (Exception e) { + e.printStackTrace(); + String exceptionMessage = "UI瑙f瀽绫绘鍒欐鏌ユ椂鍑虹幇閿欒锛屽師鍥狅細" + VciBaseUtil.getExceptionMessage(e); + logger.error(exceptionMessage); + return BaseResult.fail(exceptionMessage); + } + } + + /** + * 鍒犻櫎鏁版嵁 + * @param oids + * @return + */ + @DeleteMapping("/deleteTabData") + public BaseResult deleteTabData(String[] oids){ + try { + return uiManagerService.deleteTabData(oids) ? BaseResult.success("鍒犻櫎鎴愬姛锛�"):BaseResult.fail("鍒犻櫎澶辫触锛�"); + } catch (PLException e) { + e.printStackTrace(); + String exceptionMessage = "鍒犻櫎鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e); + logger.error(exceptionMessage); + return BaseResult.fail(exceptionMessage); + } + } } -- Gitblit v1.9.3