| | |
| | | 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.PlatformClientUtil; |
| | | import com.vci.web.util.WebUtil; |
| | |
| | | @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; |
| | | } |
| | | |
| | |
| | | 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(); |
| | | BeanUtilForVCI.convert(attributeVO, btmTypeAttributeVO); |
| | | btmTypeAttributeVO.setPkBtmType(vo.getOid()); |
| | |
| | | btmTypeAttributeVO.setEnumItemMap(enumService.getEnumValueMap(btmTypeAttributeVO.getEnumId())); |
| | | } |
| | | btmTypeAttributeVOS.add(btmTypeAttributeVO); |
| | | }); |
| | | // }); |
| | | } |
| | | vo.setAttributes(btmTypeAttributeVOS); |
| | | } |
| | | return vo; |
| | |
| | | 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); |
| | | |
| | |
| | | rootTreeList.add(tree); |
| | | } |
| | | } |
| | | AllOsEnumVOMapThreadLocal.remove(); |
| | | rootTreeList = rootTreeList.stream().sorted((o1, o2) -> o1.getId().compareTo(o2.getId())).collect(Collectors.toList()); |
| | | return rootTreeList; |
| | | } |