From f0b8a8d9966d0ccbb23ee8baaedf4ff8ba6060ed Mon Sep 17 00:00:00 2001 From: ludc Date: 星期四, 08 八月 2024 18:15:42 +0800 Subject: [PATCH] 业务类型新增、修改、删除、查看使用范围、创建视图、一致性检查、一致性检查修复、删除数据、删除数据界面查询、删除全部类型接口上传。 --- Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebBtmTypeController.java | 209 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 202 insertions(+), 7 deletions(-) diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebBtmTypeController.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebBtmTypeController.java index 395bfa5..7e6b5cf 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebBtmTypeController.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebBtmTypeController.java @@ -1,6 +1,9 @@ package com.vci.web.controller; import com.vci.corba.common.PLException; +import com.vci.corba.omd.btm.BizType; +import com.vci.corba.omd.ltm.LinkType; +import com.vci.dto.OsBtmTypeDTO; import com.vci.starter.web.annotation.controller.VciUnCheckRight; import com.vci.starter.web.annotation.log.VciBusinessLog; import com.vci.starter.web.enumpck.BooleanEnum; @@ -18,7 +21,9 @@ import com.vci.pagemodel.OsERVO; import com.vci.web.service.OsAttributeServiceI; import com.vci.web.service.OsBtmServiceI; +import com.vci.web.service.OsLinkTypeServiceI; import com.vci.web.service.WebBtmIOServiceI; +import feign.Param; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -46,6 +51,7 @@ @RequestMapping("/btmTypeController") @VciBusinessLog(modelName="涓氬姟绫诲瀷") @RestController +@VciUnCheckRight public class WebBtmTypeController { /** @@ -58,6 +64,12 @@ */ @Autowired private OsBtmServiceI btmService; + + /** + * 杩炴帴绫诲瀷鐨勬湇鍔� + */ + @Autowired + private OsLinkTypeServiceI linkTypeService; /** * 涓氬姟绫诲瀷瀵煎叆瀵煎嚭鏈嶅姟 @@ -102,20 +114,204 @@ } } - /** * 鑾峰彇鎵�鏈変笟鍔$被鍨嬶紙鏍戝舰缁撴瀯锛� * @return 鏌ヨ缁撴灉 */ @GetMapping( "/getTreeBizTypes") @VciBusinessLog(operateName = "鑾峰彇鎵�鏈変笟鍔$被鍨嬶紙鏍戝舰缁撴瀯锛�") - @VciUnCheckRight public BaseResult<List<Tree>> getTreeBizTypes(){ try { - return btmService.getTreeBizTypes(); + return BaseResult.dataList(btmService.getTreeBizTypes()); }catch (Exception e) { e.printStackTrace(); - String exceptionMessage = "鑾峰彇涓氬姟绫诲瀷鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e); + String exceptionMessage = "鏌ヨ涓氬姟绫诲瀷鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e); + logger.error(exceptionMessage); + return BaseResult.fail(exceptionMessage); + } + } + + /** + * 鑾峰彇涓氬姟绫诲瀷浣跨敤鑼冨洿 + * @param btmName + * @return 鏌ヨ缁撴灉 + */ + @GetMapping( "/getUsedBtmLinkList") + @VciBusinessLog(operateName = "鑾峰彇涓氬姟绫诲瀷浣跨敤鑼冨洿") + public BaseResult<List<String>> getUsedBtmLinkList(String btmName){ + try { + return BaseResult.dataList(linkTypeService.getUsedBtmLinkList(btmName)); + }catch (Exception e) { + e.printStackTrace(); + String exceptionMessage = "鑾峰彇涓氬姟绫诲瀷浣跨敤鑼冨洿鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e); + logger.error(exceptionMessage); + return BaseResult.fail(exceptionMessage); + } + } + + /** + * 鍒涘缓涓氬姟绫诲瀷 + * btmTypeDTO 閾炬帴绫诲瀷鐨勪繚瀛樺璞� + * @return 淇濆瓨缁撴灉 + */ + @PostMapping("/addBtmType") + public BaseResult addBtmType(@RequestBody OsBtmTypeDTO btmTypeDTO){ + try { + return btmService.addBtmType(btmTypeDTO) ? BaseResult.success("涓氬姟绫诲瀷鍒涘缓鎴愬姛锛�"):BaseResult.fail("涓氬姟绫诲瀷鍒涘缓澶辫触锛�"); + } catch (Exception e) { + e.printStackTrace(); + String exceptionMessage = "鍒涘缓涓氬姟绫诲瀷鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e); + logger.error(exceptionMessage); + return BaseResult.fail(exceptionMessage); + } + } + + /** + * 鎵归噺鍒涘缓涓氬姟绫诲瀷 + * btmTypeDTO 閾炬帴绫诲瀷鐨勪繚瀛樺璞� + * @return 淇濆瓨缁撴灉 + */ + @PostMapping("/addBtmTypes") + public BaseResult addBtmTypes(@RequestBody List<BizType> bizTypes){ + try { + return btmService.addBtmTypes(bizTypes) ? BaseResult.success("涓氬姟绫诲瀷鎵归噺鍒涘缓鎴愬姛锛�"):BaseResult.fail("涓氬姟绫诲瀷鎵归噺鍒涘缓澶辫触锛�"); + } catch (Exception e) { + e.printStackTrace(); + String exceptionMessage = "鎵归噺鍒涘缓涓氬姟绫诲瀷鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e); + logger.error(exceptionMessage); + return BaseResult.fail(exceptionMessage); + } + } + + /** + * 淇敼涓氬姟绫诲瀷 + * btmTypeDTO 閾炬帴绫诲瀷淇敼鐨勫璞� + * @return 淇濆瓨缁撴灉 + */ + @PostMapping("/updateBtmType") + public BaseResult updateBtmType(@RequestBody OsBtmTypeDTO btmTypeDTO){ + try { + return btmService.updateBtmType(btmTypeDTO) ? BaseResult.success("涓氬姟绫诲瀷淇敼鎴愬姛锛�"):BaseResult.fail("涓氬姟绫诲瀷淇敼澶辫触锛�"); + } catch (Exception e) { + e.printStackTrace(); + String exceptionMessage = "淇敼涓氬姟绫诲瀷鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e); + logger.error(exceptionMessage); + return BaseResult.fail(exceptionMessage); + } + } + + /** + * 涓氬姟绫诲瀷鍒犻櫎 + * btmTypeDTO 涓氬姟绫诲瀷瀵硅薄 + * @return 鍒犻櫎缁撴灉 + */ + @DeleteMapping("/deleteBtmType") + public BaseResult deleteLink(@RequestBody OsBtmTypeDTO btmTypeDTO){ + try { + return btmService.deleteBtmType(btmTypeDTO) ? BaseResult.success("鍒犻櫎涓氬姟绫诲瀷鎴愬姛锛�"):BaseResult.fail("鍒犻櫎涓氬姟绫诲瀷澶辫触锛�"); + } catch (PLException e) { + e.printStackTrace(); + String exceptionMessage = "鍒犻櫎涓氬姟绫诲瀷鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e); + logger.error(exceptionMessage); + return BaseResult.fail(exceptionMessage); + } + } + + /** + * 涓�鑷存�ф鏌� + * @return 妫�鏌ョ粨鏋� + */ + @GetMapping("/checkBtmConsistency") + public BaseResult checkBtmConsistency(){ + try { + return btmService.checkBtmConsistency(); + } catch (PLException e) { + e.printStackTrace(); + String exceptionMessage = "涓氬姟绫诲瀷涓�鑷存�ф鏌ユ椂鍑虹幇閿欒锛屽師鍥狅細" + VciBaseUtil.getExceptionMessage(e); + logger.error(exceptionMessage); + return BaseResult.fail(exceptionMessage); + } + } + + /** + * 涓�鑷存�ф鏌ワ紝涓氬姟绫诲瀷淇 + * @return 鍒犻櫎缁撴灉 + */ + @PostMapping("/executeRepair") + public BaseResult executeRepair(@RequestBody String repairData){ + try { + return btmService.executeRepair(repairData); + } catch (Exception e) { + e.printStackTrace(); + String exceptionMessage = "涓氬姟绫诲瀷淇鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e); + logger.error(exceptionMessage); + return BaseResult.fail(exceptionMessage); + } + } + + /** + * 鍒涘缓瑙嗗浘 + * @return + */ + @PostMapping("/createView") + public BaseResult createView(){ + try { + return btmService.createView() ? BaseResult.success("鍒涘缓瑙嗗浘鎴愬姛!"):BaseResult.fail("鍒涘缓瑙嗗浘澶辫触!"); + } catch (Exception e) { + e.printStackTrace(); + String exceptionMessage = "鍒涘缓瑙嗗浘鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e); + logger.error(exceptionMessage); + return BaseResult.fail(exceptionMessage); + } + } + + /** + * 鍒犻櫎鏁版嵁鐣岄潰鐨勬暟鎹煡璇� + * @return + */ + @GetMapping("/getObjectData") + public BaseResult getObjectData(){ + try { + return btmService.getObjectData(); + } catch (Exception e) { + e.printStackTrace(); + String exceptionMessage = "鏁版嵁瀵硅薄鏌ヨ鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e); + logger.error(exceptionMessage); + return BaseResult.fail(exceptionMessage); + } + } + + /** + * 鍒犻櫎鏁版嵁 + * @param btmNames 涓氬姟绫诲瀷鍚� + * @param linkNames 閾炬帴绫诲瀷鍚� + * @return + * @throws PLException + */ + @DeleteMapping("/truncateTable") + public BaseResult truncateTable(String[] btmNames,String[] linkNames){ + try { + return BaseResult.dataList(btmService.truncateTable(btmNames,linkNames)); + } catch (Exception e) { + e.printStackTrace(); + String exceptionMessage = "鍒犻櫎鏁版嵁鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e); + logger.error(exceptionMessage); + return BaseResult.fail(exceptionMessage); + } + } + + /** + * 鍒犻櫎鍏ㄩ儴绫诲瀷 + * @return + * @throws PLException + */ + @DeleteMapping("/deleteAllType") + public BaseResult deleteAllType(){ + try { + return BaseResult.dataList(btmService.deleteAllType()); + } catch (Exception e) { + e.printStackTrace(); + String exceptionMessage = "鍒犻櫎鍏ㄩ儴绫诲瀷鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e); logger.error(exceptionMessage); return BaseResult.fail(exceptionMessage); } @@ -141,7 +337,6 @@ @GetMapping(value = "/getBizTypeQTDs") @VciBusinessLog(operateName = "鏌ョ湅涓氬姟绫诲瀷鐨勫睘鎬�") public BaseResult<List<OsBtmTypeAttributeVO>> getBizTypeQTDs(String btmName){ - try { List<OsBtmTypeAttributeVO> osBtmTypeAttributeVOS = btmService.getBizTypeQTDs(btmName); return BaseResult.dataList(osBtmTypeAttributeVOS); @@ -218,7 +413,6 @@ return dataGrid; } - /** * 浣跨敤涓婚敭鑾峰彇涓氬姟绫诲瀷鍖呭惈鐨勫睘鎬э紝涓嶅垎椤� * @param baseQueryObject 鏌ヨ瀵硅薄 @@ -250,7 +444,6 @@ return dataGrid; } - /** * 浣跨敤涓婚敭鑾峰彇涓氬姟绫诲瀷鐨勫璞� * @param oid 涓婚敭 @@ -264,6 +457,7 @@ } return BaseResult.success(btmTypeVO); } + /** * 瀵煎嚭涓氬姟绫诲瀷鐨勪俊鎭埌word涓� * @param btmTypeIds 涓氬姟绫诲瀷鐨勭紪鍙凤紝鐢ㄩ�楀彿鍒嗗壊 @@ -333,4 +527,5 @@ public BaseResult createERUsed(String id){ return BaseResult.success(btmService.createERUsed(id)); } + } -- Gitblit v1.9.3