From af8757f5f6b9c9c215fc09636610fbf3ffc74deb Mon Sep 17 00:00:00 2001
From: yuxc <yuxc@vci-tech.com>
Date: 星期二, 07 一月 2025 10:08:28 +0800
Subject: [PATCH] 按钮返回接口增加图标返回数据
---
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsBtmServiceImpl.java | 189 ++++++++++++++++++++++++++++++++++------------
1 files changed, 138 insertions(+), 51 deletions(-)
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsBtmServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsBtmServiceImpl.java
index a5c6e59..90ba72c 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsBtmServiceImpl.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsBtmServiceImpl.java
@@ -6,10 +6,8 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import com.vci.client.common.oq.OQTool;
import com.vci.client.common.providers.ClientServiceProvider;
-import com.vci.client.mw.ClientSessionUtility;
import com.vci.common.qt.object.Condition;
import com.vci.common.qt.object.QueryTemplate;
-import com.vci.common.utility.ObjectUtility;
import com.vci.constant.FrameWorkLangCodeConstant;
import com.vci.corba.common.PLException;
import com.vci.corba.omd.atm.AttributeDef;
@@ -23,7 +21,6 @@
import com.vci.corba.omd.stm.StatePool;
import com.vci.corba.omd.vrm.VersionRule;
import com.vci.dto.OsBtmTypeDTO;
-import com.vci.dto.OsBtmTypeLinkAttributesDTO;
import com.vci.model.IndexObject;
import com.vci.omd.constants.AttributeConstants;
import com.vci.omd.constants.FileObjectType;
@@ -31,14 +28,12 @@
import com.vci.omd.utils.ObjectTool;
import com.vci.pagemodel.*;
import com.vci.po.OsBtmTypePO;
-import com.vci.po.OsLinkTypePO;
import com.vci.starter.poi.bo.ReadExcelOption;
import com.vci.starter.poi.bo.WriteExcelData;
import com.vci.starter.poi.bo.WriteExcelOption;
import com.vci.starter.poi.constant.ExcelLangCodeConstant;
import com.vci.starter.poi.util.ExcelUtil;
import com.vci.starter.web.annotation.log.VciUnLog;
-import com.vci.starter.web.constant.QueryOptionConstant;
import com.vci.starter.web.enumpck.BooleanEnum;
import com.vci.starter.web.exception.VciBaseException;
import com.vci.starter.web.pagemodel.BaseResult;
@@ -46,9 +41,13 @@
import com.vci.starter.web.pagemodel.PageHelper;
import com.vci.starter.web.pagemodel.Tree;
import com.vci.starter.web.util.*;
-import com.vci.starter.web.util.BeanUtil;
+import com.vci.starter.web.util.Lcm.ConcurrentDateFormat;
+import com.vci.starter.web.util.Lcm.DateUtil;
+import com.vci.starter.web.util.Lcm.Func;
+import com.vci.web.other.AllOsEnumVOMapThreadLocal;
import com.vci.web.service.*;
-import com.vci.web.util.*;
+import com.vci.web.util.PlatformClientUtil;
+import com.vci.web.util.WebUtil;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -59,7 +58,6 @@
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
-import javax.swing.*;
import java.io.File;
import java.io.IOException;
import java.text.ParseException;
@@ -203,10 +201,14 @@
@Override
public List<OsBtmTypeVO> btmDO2VOs(Collection<BizType> btmItems,Map<String, OsAttributeVO> attributeVOMap) {
List<OsBtmTypeVO> VOS = new ArrayList<>();
- Optional.ofNullable(btmItems).orElseGet(() -> new ArrayList<>()).stream().forEach(btmItem -> {
+// Optional.ofNullable(btmItems).orElseGet(() -> new ArrayList<>()).parallelStream().forEach(btmItem -> {
+// OsBtmTypeVO vo = btmDO2VO(btmItem,attributeVOMap);
+// VOS.add(vo);
+// });
+ for (BizType btmItem : btmItems) {
OsBtmTypeVO vo = btmDO2VO(btmItem,attributeVOMap);
VOS.add(vo);
- });
+ }
return VOS;
}
@@ -244,18 +246,20 @@
vo.setTableName(VciBaseUtil.getTableName(vo.getId()));
vo.setInputRevisionFlag(btmItem.revInput);
vo.setDelimiter(btmItem.delimiter);
+ vo.setImageName(btmItem.imageName);
vo.setfName(btmItem.fName);
vo.setVersionRule(String.valueOf(btmItem.verRuleName));
- if (StringUtils.isNotBlank(vo.getRevisionRuleName()) || vo.isInputRevisionFlag()) {
+ if (StringUtils.isNotBlank(vo.getRevisionRuleId()) || vo.isInputRevisionFlag()) {
vo.setRevisionFlag(true);
}
vo.setLifeCycleIds(Arrays.stream(btmItem.lifeCycles).collect(Collectors.joining(",")));
vo.setApNameArray(btmItem.apNameArray);
List<OsAttributeVO> attributeVOS = attributeService.listAttrByIds(Arrays.stream(btmItem.apNameArray).collect(Collectors.toList()),attributeVOMap);
List<OsBtmTypeAttributeVO> btmTypeAttributeVOS = new ArrayList<>();
- Optional.ofNullable(attributeVOS).orElseGet(() -> new ArrayList<>()).stream().forEach(attributeVO -> {
+// Optional.ofNullable(attributeVOS).orElseGet(() -> new ArrayList<>()).stream().forEach(attributeVO -> {
+ for (OsAttributeVO attributeVO : attributeVOS) {
OsBtmTypeAttributeVO btmTypeAttributeVO = new OsBtmTypeAttributeVO();
- BeanUtil.convert(attributeVO, btmTypeAttributeVO);
+ BeanUtilForVCI.convert(attributeVO, btmTypeAttributeVO);
btmTypeAttributeVO.setPkBtmType(vo.getOid());
btmTypeAttributeVO.setBtmTypeId(vo.getId());
btmTypeAttributeVO.setAttributeDataType(attributeVO.getAttributeDataType());
@@ -273,7 +277,8 @@
btmTypeAttributeVO.setEnumItemMap(enumService.getEnumValueMap(btmTypeAttributeVO.getEnumId()));
}
btmTypeAttributeVOS.add(btmTypeAttributeVO);
- });
+// });
+ }
vo.setAttributes(btmTypeAttributeVOS);
}
return vo;
@@ -290,12 +295,12 @@
if (CollectionUtils.isEmpty(btmIds)) {
return null;
}
- Map<String, OsBtmTypeVO> btmTypeVOMap = self.selectAllBtmMap();
+ //Map<String, OsBtmTypeVO> btmTypeVOMap = self.selectAllBtmMap();
+ BtmDataFetcher btmDataFetcher = new BtmDataFetcher();
List<OsBtmTypeVO> btmTypeVOS = new ArrayList<>();
btmIds.stream().forEach(id -> {
- if (btmTypeVOMap.containsKey(id.toLowerCase())) {
- btmTypeVOS.add(btmTypeVOMap.get(id.toLowerCase()));
- }
+ OsBtmTypeVO btmType = btmDataFetcher.getBtmType(id);
+ btmTypeVOS.add(btmType);
});
return btmTypeVOS;
}
@@ -307,12 +312,32 @@
* @return 涓氬姟绫诲瀷
*/
@Override
- public OsBtmTypeVO getBtmById(String id) {
+ public OsBtmTypeVO getBtmById(String id) throws PLException {
if (StringUtils.isBlank(id)) {
return null;
}
- return self.selectAllBtmMap().getOrDefault(id.toLowerCase(), null);
+ BizType bizType = platformClientUtil.getBtmService().getBizTypeByName(id);
+ return btmDO2VO(bizType,null);
}
+
+ /**
+ * 浣跨敤绫诲瀷鍚嶈幏鍙栦笟鍔$被鍨�,鏌ヤ笉鍒扮洿鎺ユ姤閿�
+ * @param btmName 绫诲瀷鍚�
+ * @return 涓氬姟绫诲瀷
+ * @throws
+ */
+ @Override
+ public OsBtmTypeVO getBtmByName(String btmName) throws PLException{
+ if(Func.isBlank(btmName)){
+ throw new PLException("500",new String[]{"鏌ヨ鏉′欢绫诲瀷鍚嶄笉鑳戒负绌猴紒"});
+ }
+ BizType bizType = platformClientUtil.getBtmService().getBizTypeByName(btmName);
+ if(Func.isEmpty(bizType) || Func.isBlank(bizType.oid)){
+ throw new PLException("500",new String[]{"鏍规嵁銆�"+btmName+"銆戞湭鏌ヨ鍒板搴斾笟鍔$被鍨嬶紒"});
+ }
+ return btmDO2VO(bizType,null);
+ }
+
/**
* 浣跨敤缂栧彿鑾峰彇涓氬姟绫诲瀷
*
@@ -424,11 +449,12 @@
if (attrVOs == null) {
attrVOs = new ArrayList<>();
}
- if (!CollectionUtils.isEmpty(attributeService.getDefaultAttributeVOs())) {
+ List<OsAttributeVO> defaultAttributeVOs = attributeService.getDefaultAttributeVOs();
+ if (!CollectionUtils.isEmpty(defaultAttributeVOs)) {
List<OsBtmTypeAttributeVO> finalAttrVOs = attrVOs;
- attributeService.getDefaultAttributeVOs().stream().forEach(attr -> {
+ defaultAttributeVOs.stream().forEach(attr -> {
OsBtmTypeAttributeVO attributeVO = new OsBtmTypeAttributeVO();
- BeanUtil.convert(attr, attributeVO);
+ BeanUtilForVCI.convert(attr, attributeVO);
attributeVO.setAttributeDataType(attr.getAttributeDataType());
attributeVO.setAttributeLength(attr.getAttrLength());
attributeVO.setReferBtmTypeId(attr.getBtmTypeId());
@@ -437,7 +463,8 @@
});
attrVOs = finalAttrVOs;
}
- return attrVOs;
+ // TODO: 2024/12/2 Ludc 杩斿洖鍊兼帓搴�
+ return attrVOs.stream().sorted(Comparator.comparing(o->o.getId(),String.CASE_INSENSITIVE_ORDER)).collect(Collectors.toList());
}
/**
@@ -561,7 +588,7 @@
tree.setParentName(bizType.fName);
Map<String, String> atrrMap = new HashMap<>();
atrrMap.put("name", bizType.name);
- atrrMap.put("lable", bizType.label);
+ atrrMap.put("label", bizType.label);
tree.setAttributes(atrrMap);
trees.add(tree);
});
@@ -603,7 +630,7 @@
* @return 鏋氫妇鐨勫悕绉�
*/
@Override
- public String getNameById(String id) {
+ public String getNameById(String id) throws PLException {
OsBtmTypeVO btmTypeVO = getBtmById(id);
if (btmTypeVO == null) {
throw new VciBaseException("涓氬姟绫诲瀷[{0}]鍦ㄧ郴缁熼噷涓嶅瓨鍦�", new String[]{id});
@@ -617,7 +644,7 @@
* @param btmId 涓氬姟绫诲瀷涓婚敭
*/
@Override
- public OsERVO createERDiagram(String btmId) {
+ public OsERVO createERDiagram(String btmId) throws PLException {
VciBaseUtil.alertNotNull(btmId, "涓氬姟绫诲瀷缂栧彿");
OsBtmTypeVO btmTypeVO = getBtmById(btmId);
List<OsERNodeVO> nodeVOList = new ArrayList<>();
@@ -638,7 +665,7 @@
* @return 鎵ц缁撴灉
*/
@Override
- public OsERVO createERUsed(String btmId) {
+ public OsERVO createERUsed(String btmId) throws PLException {
VciBaseUtil.alertNotNull(btmId, "涓氬姟绫诲瀷缂栧彿");
OsBtmTypeVO btmTypeVO = getBtmById(btmId);
//鑾峰彇浣跨敤褰撳墠绫诲瀷鐨勫睘鎬�
@@ -683,7 +710,13 @@
List<Tree> rootTreeList = new ArrayList<>();
BizType[] bizTypes = getBizTypes("");
OsBtmTypeVO osBtmTypeVO = null;
- List<OsBtmTypeVO> osBtmTypeVOS = btmDO2VOs(Arrays.asList(bizTypes),null);
+ Map<String, OsAttributeVO> attributeVOMap = null;
+ if(bizTypes.length > 0){
+ //鍏堝皢鎵�闇�瑕佺殑灞炴�с�佹灇涓炬暟鎹叏閮ㄥ姞杞藉嚭鏉ワ紝閬垮厤鍚庣画杩涜閲嶅鍔犺浇
+ attributeVOMap = attributeService.selectAllAttributeMap();
+ AllOsEnumVOMapThreadLocal.set(enumService.selectAllEnumMap());
+ }
+ List<OsBtmTypeVO> osBtmTypeVOS = btmDO2VOs(Arrays.asList(bizTypes),attributeVOMap);
for (int i = 0; i < osBtmTypeVOS.size(); i++) {
osBtmTypeVO = osBtmTypeVOS.get(i);
@@ -693,6 +726,7 @@
tree.setParentName(null);
tree.setParentId(null);
tree.setLeaf(true);
+ tree.setIcon(osBtmTypeVO.getImageName());
tree.setId(osBtmTypeVO.getId());
tree.setText(osBtmTypeVO.getDescription());
tree.setAttributes(WebUtil.objectToMapString(osBtmTypeVO));
@@ -700,7 +734,8 @@
rootTreeList.add(tree);
}
}
-
+ AllOsEnumVOMapThreadLocal.remove();
+ rootTreeList = rootTreeList.stream().sorted((o1, o2) -> o1.getId().compareTo(o2.getId())).collect(Collectors.toList());
return rootTreeList;
}
@@ -789,6 +824,7 @@
bizType.label = dto.getName();
bizType.fName = dto.getfName();
bizType.implClass = dto.getImplClass();
+ bizType.imageName = dto.getImageName();
bizType.shape = "";
bizType.lifeCycle = dto.getLifeCycleId();
List<String> lcList = Arrays.asList(dto.getSubLifeCycleId().split(","));
@@ -801,14 +837,9 @@
bizType.revLevel = dto.getRevLevel();
bizType.revRuleName = dto.getRevisionRuleId();
bizType.revInput = dto.isInputRevisionFlag();
-
bizType.delimiter = (dto.getDelimiter() == null ? "" : dto.getDelimiter());
-
bizType.verRuleName = Func.isBlank(dto.getVersionRule()) ? 0 : Short.parseShort(dto.getVersionRule());
-
- //bizType.imageName = dto.get;
//List<String> attrIdList = dto.getAttributesDTOList().stream().map(OsBtmTypeLinkAttributesDTO::getId).collect(Collectors.toList());
-
bizType.apNameArray = dto.getApNameArray().split(",");//attrIdList.toArray(new String[attrIdList.size()]);
String userId = WebThreadLocalUtil.getCurrentUserSessionInfoInThread().getUserId();
long timeMillis = System.currentTimeMillis();
@@ -955,14 +986,14 @@
String[] unRemovableFields = null;
List<String> unRemovableFields_ = null;
//闇�瑕佺Щ闄ょ殑灞炴��
- List<String> removableFields = null;
+ List<String> removableFields = new ArrayList<>();
//淇敼鍓嶄笟鍔$被鍨嬪湪鏁版嵁搴撲腑宸插瓨鍦ㄧ殑鎵�鏈夊睘鎬�
- String[] apNameArray = btmTypeDTO.getApNameArray().split(",");
+ List<String> apNameArray = Func.toStrList(btmTypeDTO.getApNameArray());
Set<String> dbApNameArray = Arrays.stream(dbBizType.apNameArray)
.collect(Collectors.toSet());
//杩囨护鍑洪渶瑕佺Щ闄ょ殑灞炴��
- removableFields = Arrays.stream(apNameArray)
- .filter(ap -> !dbApNameArray.contains(ap)) // 杩囨护涓嶅湪 dbApSet 涓殑鍏冪礌
+ removableFields = dbApNameArray.stream()
+ .filter(ap -> !apNameArray.contains(ap)) // 杩囨护涓嶅湪 dbApSet 涓殑鍏冪礌
.collect(Collectors.toList());
// 褰撲笟鍔$被鍨嬭〃涓煇灞炴�у凡缁忔湁鍊�, 涓嶅垹闄よ灞炴��, 灏嗗凡缁忕Щ闄ょ殑灞炴�ф坊鍔犲洖鏉�
unRemovableFields = platformClientUtil.getBtmService().getUnRemovableFields(id, removableFields.toArray(new String[0]));
@@ -971,7 +1002,9 @@
if (this.hasInstanceByBtmName(id)) {
//涓氬姟绫诲瀷宸叉湁瀹炰緥, 鍙兘鍒犻櫎娌℃湁鏁版嵁鐨勫垪
if (unRemovableFields != null && unRemovableFields.length > 0) {
- unRemovableFields_ = Arrays.asList(unRemovableFields);
+ //绉婚櫎浜嗕笉鍙慨鏀圭殑灞炴�х洿鎺ユ姤閿欙紝灏变笉寰�涓嬫墽琛屼簡
+ throw new VciBaseException("涓氬姟绫诲瀷宸叉湁瀹炰緥, 鍙兘鍒犻櫎娌℃湁鏁版嵁鐨勫垪");
+ /*unRemovableFields_ = Arrays.asList(unRemovableFields);
for (int i = 0; i < removableFields.size(); i++) {
String abName = removableFields.get(i);
if (unRemovableFields_.contains(abName)) {
@@ -979,7 +1012,7 @@
lastAttrList.add(abName);
}
}
- }
+ }*/
}
}
}
@@ -1382,7 +1415,7 @@
//璁剧疆鍒楀悕
List<String> columns = new ArrayList<>(
Arrays.asList("绫诲瀷鍚嶇О", "鏍囩", "缁ф壙鑷�", "瀹炵幇绫�", "鎻忚堪", "鐗堟湰瑙勫垯", "鐗堟湰鍙疯鍒�",
- "鏄惁鎵嬪伐杈撳叆", "鍒嗛殧绗�", "鐗堟鍙疯鍒�", "鐢熷懡鍛ㄦ湡", "澶囬�夌敓鍛藉懆鏈熷垪琛�", "灞炴�у垪琛�")
+ "鏄惁鎵嬪伐杈撳叆", "鍒嗛殧绗�", "鐗堟鍙疯鍒�","鍥炬爣", "鐢熷懡鍛ㄦ湡", "澶囬�夌敓鍛藉懆鏈熷垪琛�", "灞炴�у垪琛�")
);
try {
new File(excelPath).createNewFile();
@@ -1406,9 +1439,10 @@
excelDataList.add(new WriteExcelData(i + 1, 7, bizType.revInput));
excelDataList.add(new WriteExcelData(i + 1, 8, bizType.delimiter));
excelDataList.add(new WriteExcelData(i + 1, 9, bizType.verRuleName));
- excelDataList.add(new WriteExcelData(i + 1, 10, bizType.lifeCycle));
- excelDataList.add(new WriteExcelData(i + 1, 11, String.join(",", bizType.lifeCycles)));
- excelDataList.add(new WriteExcelData(i + 1, 12, String.join(",", bizType.apNameArray)));
+ excelDataList.add(new WriteExcelData(i + 1, 10, bizType.imageName));
+ excelDataList.add(new WriteExcelData(i + 1, 11, bizType.lifeCycle));
+ excelDataList.add(new WriteExcelData(i + 1, 12, String.join(",", bizType.lifeCycles)));
+ excelDataList.add(new WriteExcelData(i + 1, 13, String.join(",", bizType.apNameArray)));
attributes.addAll(Arrays.asList(bizType.apNameArray));
i++;
}
@@ -1516,7 +1550,7 @@
excelReapeat.put(osBtmTypePO.getName(), osBtmTypePO.getRowIndex());
BizType bizType = new BizType();
bizType.name = osBtmTypePO.getName();
- bizType.label = osBtmTypePO.getLable();
+ bizType.label = osBtmTypePO.getLabel();
bizType.description = osBtmTypePO.getDescription();
bizType.fName = osBtmTypePO.getFName();
bizType.implClass = osBtmTypePO.getImplClass();
@@ -1525,6 +1559,7 @@
bizType.revInput = Boolean.parseBoolean(osBtmTypePO.getRevInput().toLowerCase(Locale.ROOT));
bizType.delimiter = osBtmTypePO.getDelimiter();
bizType.verRuleName = osBtmTypePO.getVerRuleName();
+ bizType.imageName = osBtmTypePO.getImageName();
bizType.lifeCycle = osBtmTypePO.getLifeCycle();
bizType.lifeCycles = osBtmTypePO.getLifeCycles().split(",");
bizType.apNameArray = osBtmTypePO.getApNameArray().split(",");
@@ -1575,7 +1610,7 @@
//boolean flag = DDLToolClient.getService().hasInstanceOralce(tableName);
boolean flag = false;
try {
- flag = ClientServiceProvider.getOMDService().getBTMService().hasData(btmName);
+ flag = platformClientUtil.getBtmService().hasData(btmName);
} catch (PLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -1598,6 +1633,7 @@
tree.setParentName(parentBIzType.getfName());
tree.setParentId(parentBIzType.getOid());
tree.setLeaf(true);
+ tree.setIcon(bizType.getImageName());
tree.setText(bizType.getDescription());
tree.setAttributes(WebUtil.objectToMapString(bizType));
tree.setChildren(getChildren(osBtmTypeVOS, bizType));
@@ -1632,7 +1668,14 @@
itemList.add(nodePropertyVO);
//鍒ゆ柇鍙傜収
if (hasRefer) {
- selectReferenceBtmType(attribute, btmTypeVO, nodeVOList, relationVOList);
+ try {
+ selectReferenceBtmType(attribute, btmTypeVO, nodeVOList, relationVOList);
+ } catch (PLException e) {
+ e.printStackTrace();
+ String exceptionMessage = "鍒ゆ柇涓氬姟绫诲瀷鐨勫睘鎬ф槸涓嶆槸鍙傜収绫诲瀷鏃跺嚭鐜伴敊璇紝鍘熷洜锛�"+VciBaseUtil.getExceptionMessage(e);
+ logger.error(exceptionMessage);
+ throw new VciBaseException(exceptionMessage);
+ }
}
});
nodeVO.setItems(itemList);
@@ -1648,7 +1691,7 @@
* @param relationVOList 鍏崇郴淇℃伅
*/
private void selectReferenceBtmType(OsBtmTypeAttributeVO attribute, OsBtmTypeVO btmTypeVO,
- List<OsERNodeVO> nodeVOList, List<OsERRelationVO> relationVOList) {
+ List<OsERNodeVO> nodeVOList, List<OsERRelationVO> relationVOList) throws PLException {
if (StringUtils.isNotBlank(attribute.getReferBtmTypeId())) {
//鏄弬鐓х被鍨嬬殑
OsBtmTypeVO referenceBtmType = getBtmById(attribute.getReferBtmTypeId());
@@ -1737,7 +1780,14 @@
items.add(nodePropertyVO);
//鍒ゆ柇鍙傜収
if (!used) {
- selectReferenceLinkType(attr, link, nodeVOList, relationVOList);
+ try {
+ selectReferenceLinkType(attr, link, nodeVOList, relationVOList);
+ } catch (PLException e) {
+ e.printStackTrace();
+ String exceptionMessage = "鏂摼鎺ョ被鍨嬬殑灞炴�ф槸涓嶆槸鍙傜収绫诲瀷鏃跺嚭鐜伴敊璇紝鍘熷洜锛�"+VciBaseUtil.getExceptionMessage(e);
+ logger.error(exceptionMessage);
+ throw new VciBaseException(exceptionMessage);
+ }
}
});
nodeVO.setItems(items);
@@ -1812,7 +1862,7 @@
* @param nodeVOList 鑺傜偣瀵硅薄
* @param relationVOList 鍏崇郴瀵硅薄
*/
- private void selectReferenceLinkType(OsLinkTypeAttributeVO attr, OsLinkTypeVO linkTypeVO, List<OsERNodeVO> nodeVOList, List<OsERRelationVO> relationVOList) {
+ private void selectReferenceLinkType(OsLinkTypeAttributeVO attr, OsLinkTypeVO linkTypeVO, List<OsERNodeVO> nodeVOList, List<OsERRelationVO> relationVOList) throws PLException {
if (StringUtils.isNotBlank(attr.getReferBtmTypeId())) {
//鏄弬鐓х被鍨嬬殑
OsBtmTypeVO referenceBtmType = getBtmById(attr.getReferBtmTypeId());
@@ -2063,4 +2113,41 @@
}
+ private class BtmDataFetcher {
+
+ //涓氬姟绫诲瀷
+ private Map<String, BizType> btmTypeVOMap = new HashMap<String, BizType>();
+
+ public BtmDataFetcher() {
+ initBtmDataFetcher();
+ }
+
+ private void initBtmDataFetcher(){
+ try {
+ BizType[] bizTypes = platformClientUtil.getBtmService().getBizTypes("");
+ //List<OsBtmTypeVO> osBtmTypeVOS = btmDO2VOs(Arrays.asList(bizTypes), null);
+ if(Func.isNotEmpty(bizTypes)){
+ btmTypeVOMap = Arrays.stream(bizTypes).collect(Collectors.toMap(btm -> btm.name, btm -> btm));
+ }
+ }catch (Exception e){
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * 鑾峰彇涓氬姟绫诲瀷
+ * @param id
+ * @return
+ */
+ public OsBtmTypeVO getBtmType(String id) {
+ BizType bizType = btmTypeVOMap.get(id);
+ if(Func.isEmpty(bizType)){
+ return null;
+ }
+ //鑾峰彇鐨勬椂鍊欐墠璧歏O瀵硅薄锛岃繖鏍烽伩鍏嶄竴娆℃�у叏閮˙tm杞琕O澶參鐨勯棶棰�
+ return btmDO2VO(bizType,null);
+ }
+
+ }
+
}
--
Gitblit v1.9.3