| | |
| | | import com.vci.pagemodel.*; |
| | | import com.vci.starter.web.annotation.log.VciUnLog; |
| | | import com.vci.starter.web.exception.VciBaseException; |
| | | import com.vci.starter.web.util.*; |
| | | import com.vci.starter.web.util.BeanUtilForVCI; |
| | | import com.vci.starter.web.util.LangBaseUtil; |
| | | import com.vci.starter.web.util.VciBaseUtil; |
| | | import com.vci.starter.web.util.VciDateUtil; |
| | | import com.vci.starter.web.wrapper.VciQueryWrapperForDO; |
| | | import com.vci.web.enumpck.UIComponentDisplayTypeEnum; |
| | | import com.vci.web.enumpck.UIComponentTypeEnum; |
| | | import com.vci.web.enumpck.UIFieldTypeEnum; |
| | | import com.vci.web.enumpck.UILayoutAreaTypeEnum; |
| | | import com.vci.web.other.AllActionThreadLocal; |
| | | import com.vci.web.service.OsAttributeServiceI; |
| | | import com.vci.web.service.OsBtmServiceI; |
| | | import com.vci.web.service.UIEngineServiceI; |
| | |
| | | import com.vci.web.xmlmodel.UIComponentDetailXO; |
| | | import com.vci.web.xmlmodel.UIComponentItemXO; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.poi.hdf.extractor.SEP; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | if(StringUtils.isBlank(btmId) || StringUtils.isBlank(id)){ |
| | | return null; |
| | | } |
| | | if(!QUERY_BY_CACHE){ |
| | | PortalVI portalVI = null; |
| | | try { |
| | | portalVI = platformClientUtil.getUIService().getPortalVIByTypeNameAndVIName(btmId, id); |
| | | } catch (PLException vciError) { |
| | | throw WebUtil.getVciBaseException(vciError); |
| | | } |
| | | return formDO2VO(portalVI); |
| | | PortalVI portalVI = null; |
| | | try { |
| | | portalVI = platformClientUtil.getUIService().getPortalVIByTypeNameAndVIName(btmId, id); |
| | | } catch (PLException vciError) { |
| | | throw WebUtil.getVciBaseException(vciError); |
| | | } |
| | | return self.selectAllFormMap().getOrDefault(btmId.toLowerCase()+SEP+id.toLowerCase(),null); |
| | | return formDO2VO(portalVI); |
| | | } |
| | | |
| | | /** |
| | |
| | | && !UIFieldTypeEnum.CUSTOM.getValue().equalsIgnoreCase(s.getFieldType())).forEach(fieldVO->{ |
| | | //列表里面不放edit,而查询里面需要放edit |
| | | UITableFieldVO queryFieldVO = new UITableFieldVO(); |
| | | BeanUtil.convert(fieldVO,queryFieldVO); |
| | | BeanUtilForVCI.convert(fieldVO,queryFieldVO); |
| | | canQueryFields.add(queryFieldVO); |
| | | }); |
| | | tableDefineVO.setSeniorQueryColumns(canQueryFields); |
| | |
| | | List<UIComponentVO> southCompVO = componentVOs.stream().filter(s->!s.getOid().equals(firstCompVO.getOid())).collect(Collectors.toList()); |
| | | |
| | | UILayoutVO centerVO = new UILayoutVO(); |
| | | BeanUtil.convert(layoutVO,centerVO); |
| | | BeanUtilForVCI.convert(layoutVO,centerVO); |
| | | centerVO.setOid(centerVO.getOid() + "_center"); |
| | | centerVO.setLayoutAreaType(UILayoutAreaTypeEnum.CENTER.getValue()); |
| | | centerVO.setOrderNum(0); |
| | |
| | | //其余的作为south |
| | | if(!CollectionUtils.isEmpty(southCompVO)) { |
| | | UILayoutVO southVO = new UILayoutVO(); |
| | | BeanUtil.convert(layoutVO, southVO); |
| | | BeanUtilForVCI.convert(layoutVO, southVO); |
| | | southVO.setOid(centerVO.getOid() + "_south"); |
| | | southVO.setLayoutAreaType(UILayoutAreaTypeEnum.SOUTH.getValue()); |
| | | southVO.setOrderNum(0); |
| | |
| | | Map<String, OsAttributeVO> attributeVOMap; |
| | | if(pages != null && pages.size() > 0){ |
| | | attributeVOMap = attrService.selectAllAttributeMap(); |
| | | Map<String, UIActionVO> actionVOMap = AllActionThreadLocal.get(); |
| | | if(actionVOMap == null || actionVOMap.isEmpty()){ |
| | | actionVOMap = selectAllActionMap(); |
| | | AllActionThreadLocal.set(actionVOMap); |
| | | } |
| | | }else{ |
| | | attributeVOMap = null; |
| | | } |
| | |
| | | } |
| | | }); |
| | | } |
| | | AllActionThreadLocal.remove(); |
| | | return contentVOS; |
| | | } |
| | | |
| | |
| | | if(StringUtils.isBlank(componentOid)){ |
| | | return null; |
| | | } |
| | | if(!QUERY_BY_CACHE){ |
| | | try { |
| | | return uiComponentDO2VO(platformClientUtil.getUIService().getPLPageDefinationById(componentOid),true,attributeVOMap); |
| | | } catch (PLException vciError) { |
| | | throw WebUtil.getVciBaseException(vciError); |
| | | } |
| | | /*if(!QUERY_BY_CACHE){ |
| | | try { |
| | | return uiComponentDO2VO(platformClientUtil.getUIService().getPLPageDefinationById(componentOid),true,attributeVOMap); |
| | | } catch (PLException vciError) { |
| | |
| | | if(!CollectionUtils.isEmpty(componentVOList)){ |
| | | return componentVOList.get(0); |
| | | } |
| | | } |
| | | return null; |
| | | }*/ |
| | | } |
| | | |
| | | /** |
| | |
| | | componentVO.setName(page.name); |
| | | componentVO.setDescription(page.desc); |
| | | componentVO.setOrderNum((int) page.seq); |
| | | |
| | | UIComponentDefineXO componentDefineXO = null; |
| | | try { |
| | | componentDefineXO = readInfoFromXML(page.plDefination, UIComponentDefineXO.class); |
| | |
| | | logger.error("读取xml出错",e); |
| | | return null; |
| | | } |
| | | //自定义查询方式 |
| | | componentVO.setBsDataModel(componentDefineXO.getBsDataModel()); |
| | | //之前的类型的值是1,2,3等看着不直观 |
| | | UIComponentTypeEnum componentTypeEnum = null; |
| | | if("1".equals(componentDefineXO.getTemplateType())){ |
| | |
| | | if(tableDefineVO != null) { |
| | | |
| | | UITreeTableDefineVO treeTableDefineVO = new UITreeTableDefineVO(); |
| | | BeanUtil.convert(tableDefineVO, treeTableDefineVO); |
| | | BeanUtilForVCI.convert(tableDefineVO, treeTableDefineVO); |
| | | if(isLink){ |
| | | treeTableDefineVO.setTreeCurrentField("t_oid"); |
| | | treeTableDefineVO.setTreeParentField("f_oid"); |
| | |
| | | treeDefineVO.setBtmType(componentDefineXO.getShowType()); |
| | | treeDefineVO.setLinkType(componentDefineXO.getLinkType()); |
| | | treeDefineVO.setLoadType("1".equalsIgnoreCase(componentDefineXO.getExpandMode())?"node":"all"); |
| | | treeDefineVO.setOrientation("positive".equalsIgnoreCase(componentDefineXO.getOrientation())?false:true); |
| | | //TODO:这个属性现在由链接类型查询控制,不由页面定义控制了 |
| | | //treeDefineVO.setOrientation("positive".equalsIgnoreCase(componentDefineXO.getOrientation())?false:true); |
| | | treeDefineVO.setShowImage("1".equalsIgnoreCase(componentDefineXO.getIsShowImage())?true:false); |
| | | treeDefineVO.setRootContent(componentDefineXO.getRootContent()); |
| | | treeDefineVO.setFieldSep(StringUtils.isBlank(componentDefineXO.getSeparator())?",":componentDefineXO.getSeparator()); |
| | |
| | | public List<UIButtonDefineVO> buttonDO2VOs(Collection<com.vci.corba.portal.data.PLTabButton> buttons){ |
| | | List<UIButtonDefineVO> buttonDefineVOS = new ArrayList<>(); |
| | | if(buttons != null && buttons.size() > 0){ |
| | | Map<String, UIActionVO> actionVOMap = self.selectAllActionMap(); |
| | | // Map<String, UIActionVO> actionVOMap = self.selectAllActionMap(); |
| | | Map<String, UIActionVO> actionVOMap = null; |
| | | actionVOMap = AllActionThreadLocal.get(); |
| | | if(actionVOMap == null ){ |
| | | actionVOMap = self.selectAllActionMap(); |
| | | } |
| | | Map<String, UIActionVO> finalActionVOMap = actionVOMap; |
| | | Optional.ofNullable(buttons).orElseGet(()->new ArrayList<>()).stream().forEach(button->{ |
| | | buttonDefineVOS.add(buttonDO2VO(button, actionVOMap)); |
| | | buttonDefineVOS.add(buttonDO2VO(button, finalActionVOMap)); |
| | | }); |
| | | } |
| | | |