| | |
| | | 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; |
| | |
| | | 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表达式无法正确替换 |
| | | cloMap.put(parentFieldName + "." + key,value); |
| | | cloMap.put(/*parentFieldName + "." +*/ key,value); |
| | | }); |
| | | } |
| | | tree.setOid(getValueByExpressForBOAndLO(cloMap,cbo2Map,valueField)); |
| | |
| | | } |
| | | } |
| | | |
| | | tree.setAttributes(cloMap/*cbo2Map*/); |
| | | tree.setAttributes(returnMap); |
| | | tree.setIndex(i[0] + ""); |
| | | i[0]++; |
| | | tree.setChecked(showCheckBox); |