From db7102d84573eff981dc429ccd8c3b657648502a Mon Sep 17 00:00:00 2001 From: ludc Date: 星期五, 22 十一月 2024 11:09:05 +0800 Subject: [PATCH] 本地代码提交 --- Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIDataServiceImpl.java | 74 +++++++++++++++++++++++++++++++++--- 1 files changed, 67 insertions(+), 7 deletions(-) diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIDataServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIDataServiceImpl.java index 3e1c57f..ee21299 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIDataServiceImpl.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIDataServiceImpl.java @@ -5,6 +5,7 @@ import com.vci.corba.omd.btm.BizType; import com.vci.corba.omd.data.*; import com.vci.corba.omd.lcm.LifeCycle; +import com.vci.corba.omd.ltm.LinkType; import com.vci.dto.*; import com.vci.frameworkcore.lcstatuspck.FrameworkDataLCStatus; import com.vci.frameworkcore.lcstatuspck.ReleaseDataLCStatus; @@ -185,7 +186,7 @@ queryFieldList.add("creator_name"); queryFieldList.add("lastmodifier_name"); //鎴戜滑鍦ㄥ悗鍙版煡璇笟鍔℃暟鎹� - Map<String, String> replaceMap = wrapperReplaceMap( dataGridQuery.getSourceData()); + Map<String, String> replaceMap = wrapperReplaceMap(dataGridQuery.getSourceData()); if(dataGridQuery.isLinkTypeFlag()){ UILinkTypeDataQuery linkTypeDataQuery = new UILinkTypeDataQuery(); @@ -367,7 +368,7 @@ if(treeQuery.getExtandParamsMap() != null){ treeQuery.getConditionMap().putAll(treeQuery.getExtandParamsMap()); } - String parentFieldName = treeQuery.getParentFieldName(); + String parentFieldName = treeQuery.getParentFieldName(); if(parentFieldName.contains(",")){ parentFieldName = parentFieldName.split(",")[0]; } @@ -391,7 +392,7 @@ if(StringUtils.isBlank(treeDefineVO.getLinkType())){ //杩欎釜鏄笟鍔$被鍨嬬殑鑷弬鐓� //浠ュ墠鐨勫钩鍙版病鏈夊鑷弬鐓ц繖绉嶆湁鍏ㄩ儴鏌ヨ鐨� - OsBtmTypeVO btmTypeVO = btmService.getBtmById(treeDefineVO.getBtmType(),attributeVOMap); + OsBtmTypeVO btmTypeVO = btmService.getBtmByName(treeDefineVO.getBtmType()); queryFieldList.addAll(btmTypeVO.getAttributes().stream().map(OsBtmTypeAttributeVO::getId).collect(Collectors.toList())); queryFieldList.addAll(WebBoServiceImpl.BO_BASE_FIELD_MAP.values()); @@ -410,7 +411,7 @@ if(StringUtils.isBlank(parentFieldNameAndValue) || !parentFieldNameAndValue.contains(",")){ throw new VciBaseException("閰嶇疆鐨勪俊鎭湁璇�傚湪娌℃湁鍦ㄨ彍鍗曟垨鑰呮潵婧愭暟鎹缃牴鑺傜偣鐨勬煡璇㈡ā鏉挎椂锛岃鍦ㄦ爲鐨勩�愬弬鐓ф爲銆戜笂璁剧疆涓婄骇瀛楁鐨勫悕绉板拰鏍硅妭鐐圭殑鏌ヨ鐨勫�笺�傛瘮濡倄xxx,yyy銆傚叾涓瓁xxx鏄笂绾у瓧娈佃嫳鏂囧悕绉�"); } - parentFieldName= parentFieldNameAndValue.split(",")[0]; + parentFieldName = parentFieldNameAndValue.split(",")[0]; String rootQueryValue = parentFieldNameAndValue.split(",")[1]; treeQuery.getConditionMap().put(parentFieldName,rootQueryValue); replaceMap.put(parentFieldName,rootQueryValue); @@ -445,8 +446,10 @@ return cbo2Trees(thisChildren, valueField, textField, parentFieldName, treeQuery.isShowCheckBox(), null); } }else{ - OsLinkTypeVO linkTypeVO = linkTypeService.getLinkTypeById(treeDefineVO.getLinkType()); - queryFieldList.addAll(linkTypeVO.getAttributes().stream().map(OsLinkTypeAttributeVO::getId).collect(Collectors.toList())); + //OsLinkTypeVO linkTypeVO = linkTypeService.getLinkTypeById(treeDefineVO.getLinkType()); + LinkType linkType = platformClientUtil.getLinkTypeService().getLinkType(treeDefineVO.getLinkType()); + //queryFieldList.addAll(linkTypeVO.getAttributes().stream().map(OsLinkTypeAttributeVO::getId).collect(Collectors.toList())); + queryFieldList.addAll(Arrays.asList(linkType.attributes)); queryFieldList.addAll(WebLoServiceImpl.LO_BASE_FIELD_MAP.values()); addQueryField(queryFieldList,valueField); @@ -540,6 +543,62 @@ return cloAndCbo2Trees(loService.queryCLOAndBoByLinkType(linkTypeDataQuery),valueField,textField,parentFieldName,treeQuery.isShowCheckBox(),treeQuery.getParentOid()); } } + } + + /** + * 鑾峰彇鏁版嵁(鏍规嵁鏌ヨ妯℃澘鏌ヨ瀵硅薄锛岃繑鍥炵殑缁撴瀯鎸夌収ui瀹氫箟锛屽畾涔夌殑妯℃澘绫诲瀷杩斿洖) + * @param treeQuery 鏍戝舰鏌ヨ鏉′欢 + * @return 鏍戝舰鏁版嵁 + * @throws VciBaseException 鏌ヨ鍑洪敊鐨勬椂鍊欎細鎶涘嚭寮傚父 + */ + @Override + public BaseResult getDataByTemp(UITreeQuery treeQuery) throws VciBaseException, PLException { + VciBaseUtil.alertNotNull(treeQuery,"琛ㄥ崟鐨勬煡璇㈠璞�",treeQuery.getComponentOid(),"褰撳墠缁勪欢鐨勪富閿�"); + //1銆佸厛鏌ヨ椤甸潰瀹氫箟缁勪欢 + Map<String, OsAttributeVO> attributeVOMap = attrService.selectAllAttributeMap(); + UIComponentVO componentVO = uiEngineService.getComponentByOid(treeQuery.getComponentOid(),attributeVOMap); + if(componentVO == null || StringUtils.isBlank(componentVO.getOid())){ + throw new VciBaseException("鏈幏鍙栧埌鐣岄潰閰嶇疆淇℃伅锛�"); + } + // 2銆佹牴鎹厤缃殑鏌ヨ妯℃澘鏌ヨ鏁版嵁(闇�瑕佽�冭檻鍏ㄩ潰涓�鐐�), + // 杩欏効鏍规嵁褰撳墠绫诲瀷鏉ヨ幏鍙栨槸浠�涔堢被鍨嬬殑鏌ヨ妯℃澘锛岀劧鍚庡仛瀵瑰簲鐨勬煡璇㈠鐞� + + UITreeDefineVO treeDefineVO = componentVO.getTreeDefineVO(); + String queryTemplate = StringUtils.isNotBlank(treeQuery.getQueryTemplate())?treeQuery.getQueryTemplate():(!CollectionUtils.isEmpty(treeQuery.getSourceData())?treeQuery.getSourceData().getOrDefault("querytemplate",treeDefineVO.getQueryTemplateName()):treeDefineVO.getQueryTemplateName()); + Map<String, String> replaceMap = wrapperReplaceMap(treeQuery.getSourceData()); + List<String> queryFieldList = new ArrayList<>(); + String valueField = treeQuery.isLinkTypeFlag()?(!treeDefineVO.isOrientation()?"${oid}" + TREE_NODE_ID_SEP + "${t_oid}":"${oid}" + TREE_NODE_ID_SEP + "${f_oid}"):(StringUtils.isNotBlank(treeQuery.getValueField())?treeQuery.getValueField():"oid"); + String textField = StringUtils.isNotBlank(treeDefineVO.getTreeNodeExpression())?treeDefineVO.getTreeNodeExpression():(StringUtils.isNotBlank(treeQuery.getTextField())?treeQuery.getTextField():"name"); + String rootExpress = StringUtils.isNotBlank(treeQuery.getRootExpress())?treeQuery.getRootExpress():treeDefineVO.getRootContent(); + String parentFieldName = treeQuery.getParentFieldName(); + if(parentFieldName.contains(",")){ + parentFieldName = parentFieldName.split(",")[0]; + } + queryFieldList.add("creator_name"); + queryFieldList.add("lastmodifier_name"); + OsBtmTypeVO btmTypeVO = btmService.getBtmByName(treeDefineVO.getBtmType()); + queryFieldList.addAll(btmTypeVO.getAttributes().stream().map(OsBtmTypeAttributeVO::getId).collect(Collectors.toList())); + queryFieldList.addAll(WebBoServiceImpl.BO_BASE_FIELD_MAP.values()); + + addQueryField(queryFieldList,valueField); + addQueryField(queryFieldList,textField); + List<BusinessObject> rootCbos = boService.queryCBOByScheme(queryTemplate, null, replaceMap); + + //3銆佹牴鎹笉鍚岀殑缁勪欢杩斿洖涓嶅悓鐨勬暟鎹被鍨嬶紙鏍戙�佸垪琛ㄣ�佹爲琛ㄣ�佽嚜瀹氫箟妯℃澘銆佽〃鍗曠瓑锛� + List<Tree> rootTreeList = null; + if(!CollectionUtils.isEmpty(rootCbos)){ + rootTreeList = cbo2Trees(rootCbos,valueField,StringUtils.isBlank(rootExpress)?textField:rootExpress,parentFieldName,treeQuery.isShowCheckBox(),null); + TreeQueryObject treeQueryObject = new TreeQueryObject(); + treeQueryObject.setValueField(valueField); + treeQueryObject.setTextField(textField); + treeQueryObject.setParentFieldName(parentFieldName); + treeQueryObject.setShowCheckBox(treeQuery.isShowCheckBox()); + if(UITreeLoadTypeEnum.ALL.getValue().equalsIgnoreCase(treeDefineVO.getLoadType())){ + treeQueryObject.setQueryAllLevel(false); + } + //queryTreeForBO(rootTreeList,treeDefineVO.getQueryTemplateName(),queryFieldList,treeQueryObject); + } + return BaseResult.tree(rootTreeList); } /** @@ -650,6 +709,7 @@ Map<String,String> cbo2Map = boService.cbo2Map(cbo); if(!CollectionUtils.isEmpty(cbo2Map)){ cbo2Map.forEach((key,value)->{ + //TODO: 杩欏効涓哄暐瑕佹嫾鎺ヤ笂parentFieldName锛屽鑷村悗闈reemarker琛ㄨ揪寮忔棤娉曟纭浛鎹� cloMap.put(parentFieldName + "." + key,value); }); } @@ -665,7 +725,7 @@ } } - tree.setAttributes(cbo2Map); + tree.setAttributes(cloMap/*cbo2Map*/); tree.setIndex(i[0] + ""); i[0]++; tree.setChecked(showCheckBox); -- Gitblit v1.9.3