From 370b26066c560f15f6a84caca2be149e48e86556 Mon Sep 17 00:00:00 2001
From: 田源 <tianyuan@vci-tech.com>
Date: 星期二, 07 一月 2025 15:52:05 +0800
Subject: [PATCH] 系统菜单 默认显示&&系统配置、对象建模按钮权限以及按钮图标
---
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsBtmServiceImpl.java | 71 +++++++++++++++++++++--------------
1 files changed, 42 insertions(+), 29 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 4076503..92fe590 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;
@@ -22,9 +20,7 @@
import com.vci.corba.omd.ltm.LinkType;
import com.vci.corba.omd.stm.StatePool;
import com.vci.corba.omd.vrm.VersionRule;
-import com.vci.corba.portal.data.PLUILayout;
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;
@@ -32,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;
@@ -47,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;
@@ -60,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;
@@ -204,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<>()).parallelStream().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;
}
@@ -245,6 +246,7 @@
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.getRevisionRuleId()) || vo.isInputRevisionFlag()) {
@@ -254,9 +256,10 @@
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());
@@ -274,7 +277,8 @@
btmTypeAttributeVO.setEnumItemMap(enumService.getEnumValueMap(btmTypeAttributeVO.getEnumId()));
}
btmTypeAttributeVOS.add(btmTypeAttributeVO);
- });
+// });
+ }
vo.setAttributes(btmTypeAttributeVOS);
}
return vo;
@@ -450,7 +454,7 @@
List<OsBtmTypeAttributeVO> finalAttrVOs = attrVOs;
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());
@@ -459,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());
}
/**
@@ -581,9 +586,10 @@
tree.setOid(bizType.oid);
tree.setLeaf(true);
tree.setParentName(bizType.fName);
+ tree.setIcon(bizType.imageName);
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);
});
@@ -705,7 +711,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);
@@ -715,6 +727,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));
@@ -722,7 +735,8 @@
rootTreeList.add(tree);
}
}
-
+ AllOsEnumVOMapThreadLocal.remove();
+ rootTreeList = rootTreeList.stream().sorted((o1, o2) -> o1.getId().compareTo(o2.getId())).collect(Collectors.toList());
return rootTreeList;
}
@@ -811,6 +825,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(","));
@@ -823,14 +838,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();
@@ -1406,7 +1416,7 @@
//璁剧疆鍒楀悕
List<String> columns = new ArrayList<>(
Arrays.asList("绫诲瀷鍚嶇О", "鏍囩", "缁ф壙鑷�", "瀹炵幇绫�", "鎻忚堪", "鐗堟湰瑙勫垯", "鐗堟湰鍙疯鍒�",
- "鏄惁鎵嬪伐杈撳叆", "鍒嗛殧绗�", "鐗堟鍙疯鍒�", "鐢熷懡鍛ㄦ湡", "澶囬�夌敓鍛藉懆鏈熷垪琛�", "灞炴�у垪琛�")
+ "鏄惁鎵嬪伐杈撳叆", "鍒嗛殧绗�", "鐗堟鍙疯鍒�","鍥炬爣", "鐢熷懡鍛ㄦ湡", "澶囬�夌敓鍛藉懆鏈熷垪琛�", "灞炴�у垪琛�")
);
try {
new File(excelPath).createNewFile();
@@ -1430,9 +1440,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++;
}
@@ -1540,7 +1551,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();
@@ -1549,6 +1560,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(",");
@@ -1622,6 +1634,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));
--
Gitblit v1.9.3