| | |
| | | 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; |
| | |
| | | import com.vci.web.query.UILinkTypeDataQuery; |
| | | import com.vci.web.query.UITreeQuery; |
| | | import com.vci.web.service.*; |
| | | import com.vci.web.util.Func; |
| | | import com.vci.web.util.PlatformClientUtil; |
| | | import com.vci.web.util.WebUtil; |
| | | import org.apache.commons.lang3.StringUtils; |
| | |
| | | if(parentFieldName.contains(",")){ |
| | | parentFieldName = parentFieldName.split(",")[0]; |
| | | } |
| | | //TODO: 这儿为啥要将根节点显示表达式放到查询条件中去,这样就会导致这个节点被当成查询条件去查询 |
| | | if(StringUtils.isNotBlank(parentFieldName)){ |
| | | if(StringUtils.isNotBlank(treeQuery.getParentOid())){ |
| | | treeQuery.getConditionMap().put(parentFieldName,treeQuery.getParentOid()); |
| | |
| | | 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); |
| | |
| | | clo = boAndLO.lo; |
| | | Map<String,String> cloMap = loService.clo2Map(clo); |
| | | Map<String,String> cbo2Map = boService.cbo2Map(cbo); |
| | | //将链接类型的属性也放进进行返回 |
| | | String linkName = Func.isNotBlank(cloMap.get("linktypename")) ? cloMap.get("linktypename"):parentFieldName; |
| | | Map<String, String> returnMap = new HashMap<>(); |
| | | cloMap.forEach((key,value)->{ |
| | | //过滤掉空值 |
| | | if(!returnMap.containsKey(linkName + key) && Func.isNotBlank(key) || Func.isNotBlank(value)){ |
| | | returnMap.put(linkName + key,value); |
| | | } |
| | | }); |
| | | //过滤掉空值,用作返回的map |
| | | cbo2Map.entrySet().stream().forEach(entry -> { |
| | | String key = entry.getKey(); |
| | | String value = entry.getValue(); |
| | | if (!returnMap.containsKey(key) && Func.isNotBlank(key) && Func.isNotBlank(value)) { |
| | | returnMap.put(key,value); |
| | | } |
| | | }); |
| | | |
| | | if(!CollectionUtils.isEmpty(cbo2Map)){ |
| | | cbo2Map.forEach((key,value)->{ |
| | | //TODO: 这儿为啥要拼接上parentFieldName,导致后面freemarker表达式无法正确替换 |
| | |
| | | } |
| | | } |
| | | |
| | | tree.setAttributes(cbo2Map); |
| | | tree.setAttributes(returnMap); |
| | | tree.setIndex(i[0] + ""); |
| | | i[0]++; |
| | | tree.setChecked(showCheckBox); |