From 576c918c2c213176e2aff1e130fd84d5dc1ee835 Mon Sep 17 00:00:00 2001 From: yuxc <yuxc@vci-tech.com> Date: 星期四, 09 一月 2025 16:05:02 +0800 Subject: [PATCH] 在删除属性时删除的属性有数据进行属性的提示 --- Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsBtmServiceImpl.java | 49 ++++++++++++++++++++++++++++++------------------- 1 files changed, 30 insertions(+), 19 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 cf129dd..a2c6224 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; } @@ -255,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()); @@ -275,7 +277,8 @@ btmTypeAttributeVO.setEnumItemMap(enumService.getEnumValueMap(btmTypeAttributeVO.getEnumId())); } btmTypeAttributeVOS.add(btmTypeAttributeVO); - }); +// }); + } vo.setAttributes(btmTypeAttributeVOS); } return vo; @@ -451,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()); @@ -583,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); }); @@ -707,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); @@ -725,6 +735,7 @@ rootTreeList.add(tree); } } + AllOsEnumVOMapThreadLocal.remove(); rootTreeList = rootTreeList.stream().sorted((o1, o2) -> o1.getId().compareTo(o2.getId())).collect(Collectors.toList()); return rootTreeList; } @@ -993,7 +1004,7 @@ //涓氬姟绫诲瀷宸叉湁瀹炰緥, 鍙兘鍒犻櫎娌℃湁鏁版嵁鐨勫垪 if (unRemovableFields != null && unRemovableFields.length > 0) { //绉婚櫎浜嗕笉鍙慨鏀圭殑灞炴�х洿鎺ユ姤閿欙紝灏变笉寰�涓嬫墽琛屼簡 - throw new VciBaseException("涓氬姟绫诲瀷宸叉湁瀹炰緥, 鍙兘鍒犻櫎娌℃湁鏁版嵁鐨勫垪"); + throw new VciBaseException("涓氬姟绫诲瀷宸叉湁瀹炰緥, 鍙兘鍒犻櫎娌℃湁鏁版嵁鐨勫垪锛屾湁鏁版嵁鐨勫垪鍚嶄负锛�" + removableFields); /*unRemovableFields_ = Arrays.asList(unRemovableFields); for (int i = 0; i < removableFields.size(); i++) { String abName = removableFields.get(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(); -- Gitblit v1.9.3