From 0c6be90e78c1f02a6ba20f219e7b3985af4aca91 Mon Sep 17 00:00:00 2001
From: 田源 <tianyuan@vci-tech.com>
Date: 星期三, 08 一月 2025 10:45:27 +0800
Subject: [PATCH] 按钮设计树结构添加判空不展示图标&&角色管理分配成员修改为行内展示
---
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebBtmTypeController.java | 346 ++++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 325 insertions(+), 21 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..6ae0bdc 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,7 +1,11 @@
package com.vci.web.controller;
import com.vci.corba.common.PLException;
-import com.vci.starter.web.annotation.controller.VciUnCheckRight;
+import com.vci.dto.OsBtmTypeDTO;
+import com.vci.model.IndexObject;
+import com.vci.pagemodel.OsBtmTypeAttributeVO;
+import com.vci.pagemodel.OsBtmTypeVO;
+import com.vci.pagemodel.OsERVO;
import com.vci.starter.web.annotation.log.VciBusinessLog;
import com.vci.starter.web.enumpck.BooleanEnum;
import com.vci.starter.web.exception.VciBaseException;
@@ -9,15 +13,13 @@
import com.vci.starter.web.pagemodel.BaseResult;
import com.vci.starter.web.pagemodel.DataGrid;
import com.vci.starter.web.pagemodel.Tree;
-import com.vci.starter.web.util.BeanUtil;
+import com.vci.starter.web.util.BeanUtilForVCI;
import com.vci.starter.web.util.ControllerUtil;
import com.vci.starter.web.util.LangBaseUtil;
import com.vci.starter.web.util.VciBaseUtil;
-import com.vci.pagemodel.OsBtmTypeAttributeVO;
-import com.vci.pagemodel.OsBtmTypeVO;
-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 org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
@@ -25,6 +27,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.FileNotFoundException;
@@ -60,6 +63,12 @@
private OsBtmServiceI btmService;
/**
+ * 杩炴帴绫诲瀷鐨勬湇鍔�
+ */
+ @Autowired
+ private OsLinkTypeServiceI linkTypeService;
+
+ /**
* 涓氬姟绫诲瀷瀵煎叆瀵煎嚭鏈嶅姟
*/
@Autowired
@@ -90,7 +99,6 @@
*/
@GetMapping( "/getBizTypes")
@VciBusinessLog(operateName = "涓氬姟绫诲瀷鍒楄〃(涓昏鐢ㄤ簬瀵硅瘽妗嗕娇鐢�)")
- @VciUnCheckRight
public BaseResult getBizTypes(String btmName){
try {
return BaseResult.dataList(Arrays.asList(btmService.getBizTypes(btmName)));
@@ -102,23 +110,282 @@
}
}
-
/**
* 鑾峰彇鎵�鏈変笟鍔$被鍨嬶紙鏍戝舰缁撴瀯锛�
* @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 淇濆瓨缁撴灉
+ */
+ @PutMapping("/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);
+ }
+ }
+
+ /**
+ * 鑾峰彇褰撳墠涓氬姟绫诲瀷涓嬬殑绱㈠紩
+ * @return
+ * @throws PLException
+ */
+ @GetMapping("/getIndexByCondition")
+ public BaseResult getIndexByCondition(BaseQueryObject baseQueryObject){
+ try {
+ return BaseResult.dataList(btmService.getIndexByCondition(baseQueryObject.getConditionMap()));
+ } catch (Exception e) {
+ e.printStackTrace();
+ String exceptionMessage = "鏌ヨ褰撳墠涓氬姟绫诲瀷涓嬬殑绱㈠紩鏃舵椂鍑虹幇閿欒锛屽師鍥狅細" + VciBaseUtil.getExceptionMessage(e);
+ logger.error(exceptionMessage);
+ return BaseResult.fail(exceptionMessage);
+ }
+ }
+
+ /**
+ * 鍒涘缓绱㈠紩
+ * @param indexObjectList
+ * @return
+ */
+ @PostMapping("/addIndex")
+ public BaseResult addIndex(@RequestBody List<IndexObject> indexObjectList){
+ try {
+ return btmService.addIndex(indexObjectList) ? BaseResult.success("鍒涘缓绱㈠紩鎴愬姛!"):BaseResult.fail("鍒涘缓绱㈠紩澶辫触!");
+ } catch (Exception e) {
+ e.printStackTrace();
+ String exceptionMessage = "鍒涘缓绱㈠紩鏃舵椂鍑虹幇閿欒锛屽師鍥狅細" + VciBaseUtil.getExceptionMessage(e);
+ logger.error(exceptionMessage);
+ return BaseResult.fail(exceptionMessage);
+ }
+ }
+
+ /**
+ * 鍒犻櫎绱㈠紩
+ * @param btmName
+ * @param indexName
+ * @return
+ */
+ @DeleteMapping("/delIndex")
+ public BaseResult delIndex(String btmName,String indexName){
+ try {
+ return btmService.delIndex(btmName,indexName) ? BaseResult.success("鍒犻櫎绱㈠紩鎴愬姛!"):BaseResult.fail("鍒犻櫎绱㈠紩澶辫触!");
+ } catch (Exception e) {
+ e.printStackTrace();
+ String exceptionMessage = "鍒犻櫎绱㈠紩鏃舵椂鍑虹幇閿欒锛屽師鍥狅細" + VciBaseUtil.getExceptionMessage(e);
+ logger.error(exceptionMessage);
+ return BaseResult.fail(exceptionMessage);
+ }
+ }
+
+ /**
+ * 瀵煎嚭涓氬姟绫诲瀷
+ * name 閾炬帴绫诲瀷鍚嶇О
+ * @return
+ */
+ @GetMapping("/expData")
+ public void expData(String name,HttpServletResponse response) throws PLException, IOException {
+ btmService.expData(name, response);
+ }
+
+ /**
+ * 瀵煎叆涓氬姟绫诲瀷
+ * @param file 涓婁紶鐨勬枃浠�
+ * @return
+ */
+ @PostMapping("/impData")
+ public BaseResult impData(MultipartFile file){try {
+ return btmService.impData(file);
+ }catch (Throwable e) {
+ throw new VciBaseException(VciBaseUtil.getExceptionMessage(e),new String[0],e);
+ }
}
/**
@@ -129,7 +396,15 @@
@GetMapping(value = "/getAllAttributesByBtmId")
@VciBusinessLog(operateName = "鏌ョ湅涓氬姟绫诲瀷鐨勫睘鎬�")
public BaseResult<List<OsBtmTypeAttributeVO>> getAllAttributesByBtmId(String btmId){
- List<OsBtmTypeAttributeVO> osBtmTypeAttributeVOS = btmService.listAttributeByBtmIdHasDefault(btmId);
+ List<OsBtmTypeAttributeVO> osBtmTypeAttributeVOS = null;
+ try {
+ osBtmTypeAttributeVOS = btmService.listAttributeByBtmIdHasDefault(btmId);
+ } catch (PLException e) {
+ e.printStackTrace();
+ String exceptionMessage = VciBaseUtil.getExceptionMessage(e);
+ logger.error(exceptionMessage);
+ throw new VciBaseException(exceptionMessage);
+ }
return BaseResult.dataList(osBtmTypeAttributeVOS);
}
@@ -141,7 +416,6 @@
@GetMapping(value = "/getBizTypeQTDs")
@VciBusinessLog(operateName = "鏌ョ湅涓氬姟绫诲瀷鐨勫睘鎬�")
public BaseResult<List<OsBtmTypeAttributeVO>> getBizTypeQTDs(String btmName){
-
try {
List<OsBtmTypeAttributeVO> osBtmTypeAttributeVOS = btmService.getBizTypeQTDs(btmName);
return BaseResult.dataList(osBtmTypeAttributeVOS);
@@ -184,7 +458,15 @@
String hasDefaultAttr = baseQueryObject.getConditionMap().getOrDefault("hasDefaultAttr","false");
String attrId = baseQueryObject.getConditionMap().containsKey("name")?baseQueryObject.getConditionMap().get("name").replace("*",""):"";
String attrName = baseQueryObject.getConditionMap().containsKey("label") ? baseQueryObject.getConditionMap().get("label").replace("*","") : "";
- List<OsBtmTypeAttributeVO> boAttrs = btmService.listAttributeByBtmId(btmTypeId);
+ List<OsBtmTypeAttributeVO> boAttrs = null;
+ try {
+ boAttrs = btmService.listAttributeByBtmId(btmTypeId);
+ } catch (PLException e) {
+ e.printStackTrace();
+ String exceptionMessage = VciBaseUtil.getExceptionMessage(e);
+ logger.error(exceptionMessage);
+ throw new VciBaseException(exceptionMessage);
+ }
if(boAttrs == null){
boAttrs = new ArrayList<>();
}
@@ -193,9 +475,9 @@
List<OsBtmTypeAttributeVO> finalBoAttrs = boAttrs;
attributeService.getDefaultAttributeVOs().stream().forEach(attr->{
OsBtmTypeAttributeVO attributeVO = new OsBtmTypeAttributeVO();
- BeanUtil.convert(attr,attributeVO);
+ BeanUtilForVCI.convert(attr,attributeVO);
attributeVO.setAttributeLength(attr.getAttrLength());
- attributeVO.setAttrDataType(attr.getAttributeDataType());
+ attributeVO.setAttributeDataType(attr.getAttributeDataType());
attributeVO.setReferBtmTypeId(attr.getBtmTypeId());
attributeVO.setReferBtmTypeName(attr.getBtmTypeName());
finalBoAttrs.add(attributeVO);
@@ -218,7 +500,6 @@
return dataGrid;
}
-
/**
* 浣跨敤涓婚敭鑾峰彇涓氬姟绫诲瀷鍖呭惈鐨勫睘鎬э紝涓嶅垎椤�
* @param baseQueryObject 鏌ヨ瀵硅薄
@@ -233,7 +514,15 @@
String attrId = baseQueryObject.getConditionMap().containsKey("name")?baseQueryObject.getConditionMap().get("name").replace("*",""):"";
String attrName = baseQueryObject.getConditionMap().containsKey("label") ? baseQueryObject.getConditionMap().get("label").replace("*","") : "";
OsBtmTypeVO btmTypeVO = btmService.selectByOid(btmTypeOid);
- List<OsBtmTypeAttributeVO> boAttrs = btmService.listAttributeByBtmId(btmTypeVO.getId());
+ List<OsBtmTypeAttributeVO> boAttrs = null;
+ try {
+ boAttrs = btmService.listAttributeByBtmId(btmTypeVO.getId());
+ } catch (PLException e) {
+ e.printStackTrace();
+ String exceptionMessage = VciBaseUtil.getExceptionMessage(e);
+ logger.error(exceptionMessage);
+ throw new VciBaseException(exceptionMessage);
+ }
List<OsBtmTypeAttributeVO> attrList = boAttrs.stream().filter(s->{
boolean usedFlag = true;
if(StringUtils.isNotBlank(attrId) && !s.getId().contains(attrId)){
@@ -250,7 +539,6 @@
return dataGrid;
}
-
/**
* 浣跨敤涓婚敭鑾峰彇涓氬姟绫诲瀷鐨勫璞�
* @param oid 涓婚敭
@@ -264,6 +552,7 @@
}
return BaseResult.success(btmTypeVO);
}
+
/**
* 瀵煎嚭涓氬姟绫诲瀷鐨勪俊鎭埌word涓�
* @param btmTypeIds 涓氬姟绫诲瀷鐨勭紪鍙凤紝鐢ㄩ�楀彿鍒嗗壊
@@ -320,8 +609,15 @@
*/
@GetMapping("/createERDiagram")
public BaseResult createERDiagram(String id){
- OsERVO osERVO = btmService.createERDiagram(id);
- return BaseResult.success(osERVO);
+ try {
+ OsERVO osERVO = btmService.createERDiagram(id);
+ return BaseResult.success(osERVO);
+ }catch (Exception e){
+ e.printStackTrace();
+ String msg = "鐢熸垚涓氬姟绫诲瀷浣跨敤鐨凟R鍥炬椂鍑虹幇閿欒锛屽師鍥狅細"+VciBaseUtil.getExceptionMessage(e);
+ logger.error(msg);
+ return BaseResult.fail(msg);
+ }
}
/**
@@ -331,6 +627,14 @@
*/
@GetMapping("/createERUsed")
public BaseResult createERUsed(String id){
- return BaseResult.success(btmService.createERUsed(id));
+ try {
+ return BaseResult.success(btmService.createERUsed(id));
+ } catch (PLException e) {
+ e.printStackTrace();
+ String msg = "鍙栦娇鐢ㄨ繖涓笟鍔$被鍨嬬殑E-R鍥炬椂鍑虹幇閿欒锛屽師鍥狅細"+VciBaseUtil.getExceptionMessage(e);
+ logger.error(msg);
+ return BaseResult.fail(msg);
+ }
}
+
}
--
Gitblit v1.9.3